The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/include/asm-mips64/div64.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*
    2  * This file is subject to the terms and conditions of the GNU General Public
    3  * License.  See the file "COPYING" in the main directory of this archive
    4  * for more details.
    5  */
    6 #ifndef _ASM_DIV64_H
    7 #define _ASM_DIV64_H
    8 
    9 /*
   10  * Don't use this one in new code
   11  */
   12 #define do_div64_32(res, high, low, base) ({ \
   13         unsigned int __quot, __mod; \
   14         unsigned long __div; \
   15         unsigned int __low, __high, __base; \
   16         \
   17         __high = (high); \
   18         __low = (low); \
   19         __div = __high; \
   20         __div = __div << 32 | __low; \
   21         __base = (base); \
   22         \
   23         __mod = __div % __base; \
   24         __div = __div / __base; \
   25         \
   26         __quot = __div; \
   27         (res) = __quot; \
   28         __mod; })
   29 
   30 /*
   31  * Hey, we're already 64-bit, no
   32  * need to play games..
   33  */
   34 #define do_div(n, base) ({ \
   35         unsigned long __quot; \
   36         unsigned int __mod; \
   37         unsigned long __div; \
   38         unsigned int __base; \
   39         \
   40         __div = (n); \
   41         __base = (base); \
   42         \
   43         __mod = __div % __base; \
   44         __quot = __div / __base; \
   45         \
   46         (n) = __quot; \
   47         __mod; })
   48 
   49 #endif /* _ASM_DIV64_H */

Cache object: c474d9cda1ccf0e729d9688593f81df9


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.