Kernel/x86 - Workaround for possibly buggy 64-bit divide/modulo
authorJohn Hodge <[email protected]>
Sun, 23 Jun 2013 06:42:36 +0000 (14:42 +0800)
committerJohn Hodge <[email protected]>
Sun, 23 Jun 2013 06:42:36 +0000 (14:42 +0800)
KernelLand/Kernel/arch/x86/lib.c

index b732f75..f862afd 100644 (file)
@@ -351,6 +351,10 @@ DEF_DIVMOD(64);
 
 Uint64 DivMod64U(Uint64 Num, Uint64 Div, Uint64 *Rem)
 {
+       if( Div == 16 ) {
+               if(Rem) *Rem = Num & 15;
+               return Num >> 4;
+       }
        if( Div < 0x100000000ULL && Num < 0xFFFFFFFF * Div ) {
                Uint32  rem, ret_32;
                __asm__ __volatile__(

UCC git Repository :: git.ucc.asn.au