X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Farch%2Fx86%2Flib.c;h=5fa9d12e66524aeba7332df51b0a458a48121810;hb=9d85201216cb35e1b1e051b1d7cdc38eaa5befa4;hp=3d951d462cb1ac49109d21082083cfd3f67e5a59;hpb=635bc78017d8a4a16314a973e39c849b2afac795;p=tpg%2Facess2.git diff --git a/Kernel/arch/x86/lib.c b/Kernel/arch/x86/lib.c index 3d951d46..5fa9d12e 100644 --- a/Kernel/arch/x86/lib.c +++ b/Kernel/arch/x86/lib.c @@ -11,8 +11,13 @@ extern struct sShortSpinlock glDebug_Lock; #endif +// === IMPRORTS === extern int GetCPUNum(void); +// === PROTOTYPES == +Uint64 __udivdi3(Uint64 Num, Uint64 Den); +Uint64 __umoddi3(Uint64 Num, Uint64 Den); + // === CODE === /** * \brief Determine if a short spinlock is locked @@ -216,14 +221,16 @@ void *memsetd(void *Dest, Uint32 Val, size_t Num) */ int memcmp(const void *m1, const void *m2, size_t Num) { + const Uint8 *d1 = m1; + const Uint8 *d2 = m2; if( Num == 0 ) return 0; // No bytes are always identical while(Num--) { - if(*(Uint8*)m1 != *(Uint8*)m2) - return *(Uint8*)m1 - *(Uint8*)m2; - m1 ++; - m2 ++; + if(*d1 != *d2) + return *d1 - *d2; + d1 ++; + d2 ++; } return 0; }