Root/m1/patches/rtems/lm32-stack-alignment.patch

Source at commit f6fd776f528905e346c7f1caec97945535c7ca43 created 8 years 4 months ago.
By Werner Almesberger, m1/patches/rtems/: Milkymist-specific patches are in upstream (update by Xiangfu)
1This patch is under review:
2https://www.rtems.org/bugzilla/show_bug.cgi?id=1956
3
4The comments in cpukit/score/cpu/lm32/rtems/score/cpu.h state that
5CPU_STACK_ALIGNMENT should either be 0 or >= CPU_ALIGNMENT. The
6latter was 8, the former is 4.
7
8Further investigation revealed that, contrary to what the comment
9says, 0 is not a valid value for CPU_STACK_ALIGNMENT.
10
11This patch sets CPU_ALIGNMENT to 4, since we don't have any machine
12word larger than that. (doubles and long longs are handled by
13software and either extremely slow already or rare.)
14
15The patch also corrects the misleading comment before
16CPU_STACK_ALIGNMENT.
17
18I'm not sure if this fix has any real-life impact on M1 behaviour,
19but I guess it can't hurt.
20
21- Werner
22
23Index: 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

Archive Download this file

Branches:
master



interactive