diff packages/hal/common/current/src/hal_stub.c @ 143:6b5f480c6929 ecos-sw-2000-12-08

Merge from eCos master repository on 2000-12-08-02:09:36-GMT
author jlarmour
date Fri, 08 Dec 2000 03:30:06 +0000
parents 289bf90c6a9b
children 25e238959bae
line wrap: on
line diff
--- a/packages/hal/common/current/src/hal_stub.c
+++ b/packages/hal/common/current/src/hal_stub.c
@@ -647,6 +647,7 @@ void
 {
     target_register_t addr;
     char *ptr = buf;
+    target_register_t extend_val = 0;
 
     *ptr++ = 'T';
     *ptr++ = __tohex (sigval >> 4);
@@ -713,7 +714,6 @@ void
         // GDB is expecting REGSIZE(PC) number of bytes.
         // We only have sizeof(addr) number.  Let's fill
         // the appropriate number of bytes intelligently.
-        target_register_t extend_val = 0;
 #ifdef CYGARC_SIGN_EXTEND_REGISTERS
         {
             unsigned long bits_in_addr = (sizeof(addr) << 3);  // ie Size in bytes * 8
@@ -722,9 +722,14 @@ void
                 extend_val = ~0;
         }
 #endif
-        ptr = __mem2hex((char *)&extend_val, ptr, REGSIZE(PC) - sizeof(addr), 0);
     }
+#if (CYG_BYTEORDER == CYG_MSBFIRST)
+    ptr = __mem2hex((char *)&extend_val, ptr, REGSIZE(PC) - sizeof(addr), 0);
+#endif
     ptr = __mem2hex((char *)&addr, ptr, sizeof(addr), 0);
+#if (CYG_BYTEORDER == CYG_LSBFIRST)
+    ptr = __mem2hex((char *)&extend_val, ptr, REGSIZE(PC) - sizeof(addr), 0);
+#endif
     *ptr++ = ';';
 
     *ptr++ = __tohex (SP >> 4);