Subversion Repositories shark

Rev

Rev 306 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
306 giacomo 1
/* Project:     OSLib
2
 * Description: The OS Construction Kit
3
 * Date:                1.6.2000
4
 * Idea by:             Luca Abeni & Gerardo Lamastra
5
 *
6
 * OSLib is an SO project aimed at developing a common, easy-to-use
7
 * low-level infrastructure for developing OS kernels and Embedded
8
 * Applications; it partially derives from the HARTIK project but it
9
 * currently is independently developed.
10
 *
11
 * OSLib is distributed under GPL License, and some of its code has
12
 * been derived from the Linux kernel source; also some important
13
 * ideas come from studying the DJGPP go32 extender.
14
 *
15
 * We acknowledge the Linux Community, Free Software Foundation,
16
 * D.J. Delorie and all the other developers who believe in the
17
 * freedom of software and ideas.
18
 *
19
 * For legalese, check out the included GPL license.
20
 */
21
 
22
/*      64 bit arithmetic       */
23
 
24
#ifndef __LL_I386_64BIT__
25
#define __LL_I386_64BIT__
26
 
27
#define mul32div32to32(a,b,c,res)                                   \
28
     __asm__ __volatile__("mull %%ebx\n\t"                          \
29
                          "divl %%ecx\n\t"                          \
30
                          : "=a" ((res))                            \
31
                          : "a" ((a)), "b" ((b)), "c" ((c)), "d" (0))
32
 
492 giacomo 33
#define smul32div32to32(a,b,c,res)                                   \
34
     __asm__ __volatile__("imull %%ebx\n\t"                          \
35
                          "idivl %%ecx\n\t"                          \
36
                          : "=a" ((res))                            \
37
                          : "a" ((a)), "b" ((b)), "c" ((c)), "d" (0))
38
 
306 giacomo 39
#endif