Cleanups that will hopefully allow compilation in more strict environments
authorJohn Hodge <tpg@prelude.(none)>
Wed, 3 Feb 2010 06:44:45 +0000 (14:44 +0800)
committerJohn Hodge <tpg@prelude.(none)>
Wed, 3 Feb 2010 06:44:45 +0000 (14:44 +0800)
Kernel/arch/x86/lib.c
Kernel/include/acess.h

index a3c4fa6..7fa666f 100644 (file)
@@ -49,10 +49,10 @@ Uint32 ind(Uint16 Port)
 }
 
 /**
- * \fn void *memset(void *Dest, int Val, Uint Num)
+ * \fn void *memset(void *Dest, int Val, size_t Num)
  * \brief Do a byte granuality set of Dest
  */
-void *memset(void *Dest, int Val, Uint Num)
+void *memset(void *Dest, int Val, size_t Num)
 {
        __asm__ __volatile__ (
                "rep stosl;\n\t"
@@ -62,19 +62,19 @@ void *memset(void *Dest, int Val, Uint Num)
        return Dest;
 }
 /**
- * \fn void *memsetd(void *Dest, Uint Val, Uint Num)
+ * \brief Set double words
  */
-void *memsetd(void *Dest, Uint Val, Uint Num)
+void *memsetd(void *Dest, Uint32 Val, size_t Num)
 {
        __asm__ __volatile__ ("rep stosl" :: "D" (Dest), "a" (Val), "c" (Num));
        return Dest;
 }
 
 /**
- * \fn int memcmp(const void *m1, const void *m2, Uint Num)
+ * \fn int memcmp(const void *m1, const void *m2, size_t Num)
  * \brief Compare two pieces of memory
  */
-int memcmp(const void *m1, const void *m2, Uint Num)
+int memcmp(const void *m1, const void *m2, size_t Num)
 {
        while(Num--)
        {
@@ -86,10 +86,10 @@ int memcmp(const void *m1, const void *m2, Uint Num)
 }
 
 /**
- * \fn void *memcpy(void *Dest, const void *Src, Uint Num)
+ * \fn void *memcpy(void *Dest, const void *Src, size_t Num)
  * \brief Copy \a Num bytes from \a Src to \a Dest
  */
-void *memcpy(void *Dest, const void *Src, Uint Num)
+void *memcpy(void *Dest, const void *Src, size_t Num)
 {
        if((Uint)Dest & 3 || (Uint)Src & 3)
                __asm__ __volatile__ ("rep movsb" :: "D" (Dest), "S" (Src), "c" (Num));
@@ -103,10 +103,10 @@ void *memcpy(void *Dest, const void *Src, Uint Num)
        return Dest;
 }
 /**
- * \fn void *memcpyd(void *Dest, const void *Src, Uint Num)
+ * \fn void *memcpyd(void *Dest, const void *Src, size_t Num)
  * \brief Copy \a Num DWORDs from \a Src to \a Dest
  */
-void *memcpyd(void *Dest, const void *Src, Uint Num)
+void *memcpyd(void *Dest, const void *Src, size_t Num)
 {
        __asm__ __volatile__ ("rep movsl" :: "D" (Dest), "S" (Src), "c" (Num));
        return Dest;
index 930e323..c4a1c5f 100644 (file)
@@ -257,11 +257,11 @@ extern void       MM_DerefPhys(tPAddr PAddr);
  * \name Memory Manipulation
  * \{
  */
-extern int     memcmp(const void *m1, const void *m2, Uint count);
-extern void *memcpy(void *dest, const void *src, Uint count);
-extern void *memcpyd(void *dest, const void *src, Uint count);
-extern void *memset(void *dest, int val, Uint count);
-extern void *memsetd(void *dest, Uint val, Uint count);
+extern int     memcmp(const void *m1, const void *m2, size_t count);
+extern void *memcpy(void *dest, const void *src, size_t count);
+extern void *memcpyd(void *dest, const void *src, size_t count);
+extern void *memset(void *dest, int val, size_t count);
+extern void *memsetd(void *dest, Uint32 val, size_t count);
 /**
  * \}
  */

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