Kernel/armv7 - Debugging, fixed TLB issues with a HACK!
[tpg/acess2.git] / Kernel / arch / armv7 / lib.c
index a1fbfb7..5a6928e 100644 (file)
@@ -4,6 +4,7 @@
  * lib.c - Library Functions
  */
 #include <acess.h>
+#include "../helpers.h"
 
 // === IMPORTS ===
 extern void    __memcpy_align4(void *_dest, const void *_src, size_t _length);
@@ -114,25 +115,9 @@ void *memset(void *_dest, int _value, size_t _length)
        return _dest;
 }
 
-// Divide
-// - Find what power of two times Den is > Num
-// - Iterate down in bit significance
-//  > If the `N` value is greater than `D`, we can set this bit
-#define DEF_DIVMOD(s) Uint##s __divmod##s(Uint##s N, Uint##s D, Uint##s*Rem){\
-       Uint##s ret=0,add=1;\
-       while(N>=D&&add) {D<<=1;add<<=1;}\
-       while(add>1){\
-               add>>=1;D>>=1;\
-               if(N>=D){ret+=add;N-=D;}\
-       }\
-       if(Rem)*Rem = N;\
-       return ret;\
-}
-
 DEF_DIVMOD(64)
 DEF_DIVMOD(32)
 
-
 Uint64 DivMod64U(Uint64 Num, Uint64 Den, Uint64 *Rem)
 {
        Uint64  ret;

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