OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [include/] [asm-sh/] [div64.h] - Blame information for rev 1774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1275 phoenix
#ifndef __ASM_SH_DIV64
2
#define __ASM_SH_DIV64
3
 
4
extern u64 __xdiv64_32(u64 n, u32 d);
5
 
6
#define do_div(n,base) ({ \
7
u64 __n = (n), __q; \
8
u32 __base = (base); \
9
u32 __res; \
10
if ((__n >> 32) == 0) { \
11
        __res = ((unsigned long) __n) % (unsigned) __base; \
12
        (n) = ((unsigned long) __n) / (unsigned) __base; \
13
} else { \
14
        __q = __xdiv64_32(__n, __base); \
15
        __res = __n - __q * __base; \
16
        (n) = __q; \
17
} \
18
__res; })
19
 
20
#endif /* __ASM_SH_DIV64 */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.