diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2006-03-07 21:56:45 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2006-03-07 21:56:45 +0000 |
commit | 5b07faf305072e7e769d772da420193b6343cddd (patch) | |
tree | a22c2a602341125d0136914b44ea8b2a0d45ff33 /c | |
parent | 2006-03-07 Paul Whitfield <paulw@omnitronics.com.au> (diff) | |
download | rtems-5b07faf305072e7e769d772da420193b6343cddd.tar.bz2 |
2006-03-07 Aaron Frye <aaron@frye.com>
PR 719/bsps
* m68kpretaskinghook.c: The optimizer on gcc 3.4.2 assumes that the
address of a variable cannot be 0, so it optimizes out any such
checks. this breaks the shared m68k bsp_pretasking_hook() which uses
such a check to determine heap size during runtime.
Diffstat (limited to 'c')
-rw-r--r-- | c/src/lib/libbsp/m68k/shared/ChangeLog | 8 | ||||
-rw-r--r-- | c/src/lib/libbsp/m68k/shared/m68kpretaskinghook.c | 11 |
2 files changed, 14 insertions, 5 deletions
diff --git a/c/src/lib/libbsp/m68k/shared/ChangeLog b/c/src/lib/libbsp/m68k/shared/ChangeLog index a8fb6c08cb..e02e9af11d 100644 --- a/c/src/lib/libbsp/m68k/shared/ChangeLog +++ b/c/src/lib/libbsp/m68k/shared/ChangeLog @@ -1,3 +1,11 @@ +2006-03-07 Aaron Frye <aaron@frye.com> + + PR 719/bsps + * m68kpretaskinghook.c: The optimizer on gcc 3.4.2 assumes that the + address of a variable cannot be 0, so it optimizes out any such + checks. this breaks the shared m68k bsp_pretasking_hook() which uses + such a check to determine heap size during runtime. + 2004-03-05 Joel Sherrill <joel@OARcorp.com> PR 505/bsps diff --git a/c/src/lib/libbsp/m68k/shared/m68kpretaskinghook.c b/c/src/lib/libbsp/m68k/shared/m68kpretaskinghook.c index dc0132053c..25f8be35a1 100644 --- a/c/src/lib/libbsp/m68k/shared/m68kpretaskinghook.c +++ b/c/src/lib/libbsp/m68k/shared/m68kpretaskinghook.c @@ -36,20 +36,21 @@ extern rtems_configuration_table BSP_Configuration; extern void *_RamBase; extern void *_WorkspaceBase; -extern void *_HeapSize; +extern volatile void *_HeapSize; unsigned long _M68k_Ramsize; void bsp_pretasking_hook(void) { - void *heapStart; - unsigned long heapSize = (unsigned long)&_HeapSize; - unsigned long ramSpace; + void *heapStart; + volatile unsigned long heapSize = (volatile unsigned long)&_HeapSize; + unsigned long ramSpace; heapStart = (void *) ((unsigned long)&_WorkspaceBase + BSP_Configuration.work_space_size); - ramSpace = (unsigned long) &_RamBase + _M68k_Ramsize - (unsigned long) heapStart; + ramSpace = (unsigned long) &_RamBase + _M68k_Ramsize - + (unsigned long) heapStart; if (heapSize == 0) heapSize = ramSpace; |