This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

i386: s/memcpy/local_memcpy/ in stub


Hi,

The patch renames the local memcpy in the i386 stub so it doesn't
conflict with the built-in memcpy in later GCCs.

David Vrabel
-- 
David Vrabel, Design Engineer

Arcom, Clifton Road           Tel: +44 (0)1223 411200 ext. 3233
Cambridge CB1 7EA, UK         Web: http://www.arcom.com/
%status
pending
%patch
Index: packages/hal/i386/arch/current/ChangeLog
===================================================================
--- packages/hal/i386/arch/current/ChangeLog.orig	2005-04-21 16:04:00.000000000 +0100
+++ packages/hal/i386/arch/current/ChangeLog	2005-04-21 16:04:47.000000000 +0100
@@ -1,5 +1,9 @@
 2005-04-21  David Vrabel  <dvrabel@arcom.com>
 
+	* src/i386_stub.c: Rename the local memcpy function to
+	local_memcpy so it doesn't conflict with later GCC's built-in
+	memcpy.
+
 	* src/i386.ld: Add .2ram section.
 
 2005-04-21  David Vrabel  <dvrabel@arcom.com>
Index: packages/hal/i386/arch/current/src/i386_stub.c
===================================================================
--- packages/hal/i386/arch/current/src/i386_stub.c.orig	2005-04-21 16:04:00.000000000 +0100
+++ packages/hal/i386/arch/current/src/i386_stub.c	2005-04-21 16:04:19.000000000 +0100
@@ -46,7 +46,7 @@
 
 // We need a local memcpy so we don't rely on libc.
 static inline void*
-memcpy(void* dest, void* src, int size)
+local_memcpy(void* dest, void* src, size_t size)
 {
     unsigned char* __d = (unsigned char*) dest;
     unsigned char* __s = (unsigned char*) src;
@@ -419,7 +419,7 @@
 	    if (rdmsr(val1, msrval))
 		__mem2hex ((char*)msrval, buf, 8, 0);
 	    else
-		memcpy (buf, "INVALID", 8);
+		local_memcpy (buf, "INVALID", 8);
         }
 	return 1;
     }
@@ -440,7 +440,7 @@
     // Read the currently selected MSR
     if (which == REG_MSR) {
 	if (rdmsr(_which_msr, _msrval)) {
-	    memcpy (value, _msrval, REGSIZE(which));
+	    local_memcpy (value, _msrval, REGSIZE(which));
 	    return 1;
 	}
 	return 0;
@@ -453,15 +453,15 @@
         // GDB requires these to be sent base first though the CPU stores them
 	// limit first in 6 bytes. Weird.
         offset = reg_offset(which);
-        memcpy (value, (char *)_registers + offset + 2, 4);
-        memcpy (value + 4, (char *)_registers + offset, 2);
+        local_memcpy (value, (char *)_registers + offset + 2, 4);
+        local_memcpy (value + 4, (char *)_registers + offset, 2);
         return 1;
     }
 #endif
 
     offset = reg_offset(which);
     if (offset != -1) {
-	memcpy (value, (char *)_registers + offset, REGSIZE(which));
+	local_memcpy (value, (char *)_registers + offset, REGSIZE(which));
 	return 1;
     }
     return 0;
@@ -486,15 +486,15 @@
         // GDB sends these base first, though the CPU stores them
 	// limit first. Weird.
         offset = reg_offset(which);
-        memcpy ((char *)_registers + offset + 2, value, 4);
-        memcpy ((char *)_registers + offset, value + 4, 2);
+        local_memcpy ((char *)_registers + offset + 2, value, 4);
+        local_memcpy ((char *)_registers + offset, value + 4, 2);
         return 1;
     }
 #endif
 
     offset = reg_offset(which);
     if (offset != -1) {
-	memcpy ((char *)_registers + offset, value, REGSIZE(which));
+	local_memcpy ((char *)_registers + offset, value, REGSIZE(which));
 	return 1;
     }
     return 0;
@@ -591,14 +591,14 @@
 #ifdef CYGHWR_HAL_I386_FPU
 #ifdef CYGHWR_HAL_I386_FPU_SWITCH_LAZY
     asm volatile ("fnop\n");  // force state save
-    memcpy(&d->fcw, &s->fpucontext->fpstate[0], sizeof(s->fpucontext->fpstate));
+    local_memcpy(&d->fcw, &s->fpucontext->fpstate[0], sizeof(s->fpucontext->fpstate));
 #ifdef CYGHWR_HAL_I386_PENTIUM_SSE
-    memcpy(&d->xmm0[0], &s->fpucontext->xmm0[0], (16 * 8) + 4);
+    local_memcpy(&d->xmm0[0], &s->fpucontext->xmm0[0], (16 * 8) + 4);
 #endif
 #else
-    memcpy(&d->fcw, &s->fpucontext.fpstate[0], sizeof(s->fpucontext.fpstate));
+    local_memcpy(&d->fcw, &s->fpucontext.fpstate[0], sizeof(s->fpucontext.fpstate));
 #ifdef CYGHWR_HAL_I386_PENTIUM_SSE
-    memcpy(&d->xmm0[0], &s->fpucontext.xmm0[0], (16 * 8) + 4);
+    local_memcpy(&d->xmm0[0], &s->fpucontext.xmm0[0], (16 * 8) + 4);
 #endif
 #endif
 #endif
@@ -642,14 +642,14 @@
     d->eflags = s->ps;
 #ifdef CYGHWR_HAL_I386_FPU
 #ifdef CYGHWR_HAL_I386_FPU_SWITCH_LAZY
-    memcpy(&d->fpucontext->fpstate[0], &s->fcw, sizeof(d->fpucontext->fpstate));
+    local_memcpy(&d->fpucontext->fpstate[0], &s->fcw, sizeof(d->fpucontext->fpstate));
 #ifdef CYGHWR_HAL_I386_PENTIUM_SSE
-    memcpy(&d->fpucontext->xmm0[0], &s->xmm0[0], (16 * 8) + 4);
+    local_memcpy(&d->fpucontext->xmm0[0], &s->xmm0[0], (16 * 8) + 4);
 #endif
 #else
-    memcpy(&d->fpucontext.fpstate[0], &s->fcw, sizeof(d->fpucontext.fpstate));
+    local_memcpy(&d->fpucontext.fpstate[0], &s->fcw, sizeof(d->fpucontext.fpstate));
 #ifdef CYGHWR_HAL_I386_PENTIUM_SSE
-    memcpy(&d->fpucontext.xmm0[0], &s->xmm0[0], (16 * 8) + 4);
+    local_memcpy(&d->fpucontext.xmm0[0], &s->xmm0[0], (16 * 8) + 4);
 #endif
 #endif
 #endif

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]