diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-10-03 22:27:01 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-10-03 22:27:01 +0000 |
commit | db41bb6784c6f7da698eda25c969082143e65b43 (patch) | |
tree | 11a87692f381ac4205491f4f18c1fec16f76ece6 | |
parent | 2008-10-03 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-db41bb6784c6f7da698eda25c969082143e65b43.tar.bz2 |
2008-10-03 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/src/printk.c: Addresses can be larger than integers
so use long for %p formats.
* score/inline/rtems/score/address.inl: Offsets can be positive or
negative, so use int32_t. Also do math with intptr_t since there
are cases where the number of bits in an address do not equal the
number of bits in an integer.
* score/inline/rtems/score/heap.inl: Offsets can be positive or
negative, so use int32_t.
-rw-r--r-- | cpukit/ChangeLog | 11 | ||||
-rw-r--r-- | cpukit/libcsupport/src/printk.c | 2 | ||||
-rw-r--r-- | cpukit/score/inline/rtems/score/address.inl | 11 | ||||
-rw-r--r-- | cpukit/score/inline/rtems/score/heap.inl | 4 |
4 files changed, 20 insertions, 8 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 7e7bae04a3..0dd2202a95 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,5 +1,16 @@ 2008-10-03 Joel Sherrill <joel.sherrill@oarcorp.com> + * libcsupport/src/printk.c: Addresses can be larger than integers + so use long for %p formats. + * score/inline/rtems/score/address.inl: Offsets can be positive or + negative, so use int32_t. Also do math with intptr_t since there + are cases where the number of bits in an address do not equal the + number of bits in an integer. + * score/inline/rtems/score/heap.inl: Offsets can be positive or + negative, so use int32_t. + +2008-10-03 Joel Sherrill <joel.sherrill@oarcorp.com> + * configure.ac: Add m32r. * libcsupport/src/newlibc_exit.c: For some odd reason, the fini symbol for the m32r in C needs an extra leading _. diff --git a/cpukit/libcsupport/src/printk.c b/cpukit/libcsupport/src/printk.c index c42beb4720..9754574c38 100644 --- a/cpukit/libcsupport/src/printk.c +++ b/cpukit/libcsupport/src/printk.c @@ -113,7 +113,7 @@ void vprintk( case 'd': case 'D': base = 10; sign = 1; break; case 'u': case 'U': base = 10; sign = 0; break; case 'x': case 'X': base = 16; sign = 0; break; - case 'p': base = 16; sign = 0; break; + case 'p': base = 16; sign = 0; lflag = 1; break; case 's': { int i, len; char *s; diff --git a/cpukit/score/inline/rtems/score/address.inl b/cpukit/score/inline/rtems/score/address.inl index 3394a52388..fb44781e6d 100644 --- a/cpukit/score/inline/rtems/score/address.inl +++ b/cpukit/score/inline/rtems/score/address.inl @@ -6,7 +6,7 @@ */ /* - * COPYRIGHT (c) 1989-2006. + * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -39,12 +39,13 @@ * * @return This method returns the resulting address. */ +#include <rtems/bspIo.h> RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( void *base, - uint32_t offset + int32_t offset ) { - return (void *)((char *)base + offset); + return (void *)((intptr_t)base + offset); } /** @brief Subtract Offset from Offset @@ -61,10 +62,10 @@ RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( RTEMS_INLINE_ROUTINE void *_Addresses_Subtract_offset ( void *base, - uint32_t offset + int32_t offset ) { - return (void *)((char *)base - offset); + return (void *)((intptr_t)base - offset); } /** @brief Subtract Two Offsets diff --git a/cpukit/score/inline/rtems/score/heap.inl b/cpukit/score/inline/rtems/score/heap.inl index 7b8701bdc8..80f6f853e6 100644 --- a/cpukit/score/inline/rtems/score/heap.inl +++ b/cpukit/score/inline/rtems/score/heap.inl @@ -6,7 +6,7 @@ */ /* - * COPYRIGHT (c) 1989-2006. + * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -272,7 +272,7 @@ RTEMS_INLINE_ROUTINE void _Heap_Align_down_uptr ( */ RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( void *base, - uint32_t offset + int32_t offset ) { return (Heap_Block *) _Addresses_Add_offset( base, offset ); |