Werner's Miscellanea
Sign in or create your account | Project List | Help
Werner's Miscellanea Git Source Tree
Root/
| 1 | This patch is under review: |
| 2 | https://www.rtems.org/bugzilla/show_bug.cgi?id=1956 |
| 3 | |
| 4 | The comments in cpukit/score/cpu/lm32/rtems/score/cpu.h state that |
| 5 | CPU_STACK_ALIGNMENT should either be 0 or >= CPU_ALIGNMENT. The |
| 6 | latter was 8, the former is 4. |
| 7 | |
| 8 | Further investigation revealed that, contrary to what the comment |
| 9 | says, 0 is not a valid value for CPU_STACK_ALIGNMENT. |
| 10 | |
| 11 | This patch sets CPU_ALIGNMENT to 4, since we don't have any machine |
| 12 | word larger than that. (doubles and long longs are handled by |
| 13 | software and either extremely slow already or rare.) |
| 14 | |
| 15 | The patch also corrects the misleading comment before |
| 16 | CPU_STACK_ALIGNMENT. |
| 17 | |
| 18 | I'm not sure if this fix has any real-life impact on M1 behaviour, |
| 19 | but I guess it can't hurt. |
| 20 | |
| 21 | - Werner |
| 22 | |
| 23 | Index: rtems/cpukit/score/cpu/lm32/rtems/score/cpu.h |
| 24 | =================================================================== |
| 25 | --- rtems.orig/cpukit/score/cpu/lm32/rtems/score/cpu.h 2011-11-12 03:01:35.000000000 -0300 |
| 26 | +++ rtems/cpukit/score/cpu/lm32/rtems/score/cpu.h 2011-11-12 03:03:46.000000000 -0300 |
| 27 | @@ -637,7 +637,7 @@ |
| 28 | * |
| 29 | * XXX document implementation including references if appropriate |
| 30 | */ |
| 31 | -#define CPU_ALIGNMENT 8 |
| 32 | +#define CPU_ALIGNMENT 4 |
| 33 | |
| 34 | /** |
| 35 | * This number corresponds to the byte alignment requirement for the |
| 36 | @@ -687,9 +687,10 @@ |
| 37 | * stack. This alignment requirement may be stricter than that for the |
| 38 | * data types alignment specified by @ref CPU_ALIGNMENT. If the |
| 39 | * @ref CPU_ALIGNMENT is strict enough for the stack, then this should be |
| 40 | - * set to 0. |
| 41 | + * set to @ref CPU_ALIGNMENT. |
| 42 | * |
| 43 | - * @note This must be a power of 2 either 0 or greater than @ref CPU_ALIGNMENT. |
| 44 | + * @note This must be a power of 2 either equal to or greater than |
| 45 | + * @ref CPU_ALIGNMENT. |
| 46 | * |
| 47 | * Port Specific Information: |
| 48 | * |
| 49 |
Branches:
master
