uint32 pvr;\r
} cpu_info_t;\r
\r
-cpu_info_t cpu_info_list[] = {\r
+const cpu_info_t cpu_info_list[] = {\r
#if defined(CFG_MPC5516)\r
{\r
.name = "MPC5516",\r
#endif\r
};\r
\r
-core_info_t core_info_list[] = {\r
+const core_info_t core_info_list[] = {\r
#if defined(CFG_MPC5516)\r
{\r
.name = "CORE_E200Z1",\r
#define ARRAY_SIZE(_x) (sizeof(_x)/sizeof((_x)[0]))\r
#endif\r
\r
-static cpu_info_t *Mcu_IdentifyCpu(uint32 pvr)\r
+static const cpu_info_t *Mcu_IdentifyCpu(uint32 pvr)\r
{\r
int i;\r
\r
return NULL;\r
}\r
\r
-static core_info_t *Mcu_IdentifyCore(uint32 pvr)\r
+static const core_info_t *Mcu_IdentifyCore(uint32 pvr)\r
{\r
int i;\r
\r
static uint32 Mcu_CheckCpu( void ) {\r
uint32 pvr;\r
uint32 pir;\r
- cpu_info_t *cpuType;\r
- core_info_t *coreType;\r
+ const cpu_info_t *cpuType;\r
+ const core_info_t *coreType;\r
\r
// We have to registers to read here, PIR and PVR\r
pir = get_spr(SPR_PIR);\r
extab : {} \r
extabindex : {}\r
.sdata2 : {} /* SHF_ALLOC + possibly SHF_WRITE (prob. ReadOnly)*/\r
- .sbss2 : {} /* SHF_ALLOC + SHF_WRITE , e.g const int apa = 0;*/\r
- . = ALIGN(0x10);\r
+ .sbss2 : {} /* SHF_ALLOC + SHF_WRITE , e.g const int apa = 0;*/\r
+ . = ALIGN(0x10); /* Section alignment is 0x10 */ \r
__DATA_ROM = .;\r
.=.+SIZEOF(.data);\r
+ . = ALIGN(0x10); /* Section alignment is 0x10 */\r
__SDATA = .;\r
.=.+SIZEOF(.sdata);\r
+ . = ALIGN(0x10); /* Section alignment is 0x10 */\r
__SDATA0 = .;\r
.=.+SIZEOF(.PPC.EMB.sdata0);\r
} > flash\r
__BSS_END = .;\r
.PPC.EMB.sdata0 LOAD(ADDR(__SDATA0)) : {} /* Small data with offset to 0 */ \r
.PPC.EMB.sbss0 : {}\r
- .ramlog (DATA) : { *(.ramlog) }\r
+ .ramlog : { *(.ramlog_data) *(.ramlog_bss) }\r
_heap_addr = .; \r
} > sram\r
} \r
*
*/\r
\r
-\r
-\r
#if defined(__GNUC__)\r
\r
#define SECTION_RAMLOG __attribute__ ((section (".ramlog")))\r
\r
#elif defined(__CWCC__)\r
\r
- #pragma section RW ".ramlog" ".ramlog"\r
+/* The compiler manual states:\r
+ * The section name specified in the\r
+ * __declspec(section <section_name>) statement must be the\r
+ * name of an initialized data section. It is an error to use the uninitialized\r
+ * data section name.\r
+ *\r
+ * NOTE!! The initialized data section name is __declspec() does not mean that\r
+ * it will end up in that section, if its BSS data it will end-up in\r
+ * ramlog_bss instead.\r
+ *\r
+ * NOTE!! Naming the initialized and uninitialized data section to the same\r
+ * name will generate strange linker warnings (sometimes)\r
+ */\r
\r
- #define SECTION_RAMLOG __declspec(section ".ramlog")\r
+ #pragma section RW ".ramlog_data" ".ramlog_bss"\r
+ #define SECTION_RAMLOG __declspec(section ".ramlog_data")\r
\r
\r
#endif\r
cflags-y += -proc=5565\r
cflags-y += -fp=soft\r
cflags-y += -use_isel=on\r
-cflags-y += -sdata=0xFFFF -sdata2=16\r
+#cflags-y += -sdata=0xFFFF -sdata2=16\r
+cflags-y += -sdata=0xFFFF -sdata2=0\r
\r
#cflags-y += -fno-strict-aliasing\r
#cflags-y += -fno-builtin\r
}\r
#endif\r
\r
-#define TEST_DATA 12345\r
-int test_data = TEST_DATA;\r
-int test_bss = 0;\r
+#define TEST_DATA 0x12345\r
+#define TEST_SDATA2 0x3344\r
+volatile int test_data = TEST_DATA;\r
+volatile int test_bss = 0;\r
+#if defined(CFG_PPC) && defined(__CWCC__)\r
+/* Note! It does not matter if the data is initialized to 0,\r
+ * it still sbss2.
+ */\r
+volatile const int test_sbss2;\r
\r
+/* Initialized small data */\r
+volatile const int test_sdata2 = TEST_SDATA2;\r
+#endif\r
\r
-void noooo( void ) {\r
- while(1) {}\r
-}\r
+\r
+#define BAD_LINK_FILE() while(1) {}\r
\r
extern void EcuM_Init();\r
int main( void )\r
{\r
+ /* Check link file */\r
+ if (TEST_DATA != test_data) {\r
+ BAD_LINK_FILE();\r
+ }\r
+\r
+ if (test_bss != 0) {\r
+ BAD_LINK_FILE();\r
+ }\r
+\r
+#if defined(CFG_PPC) && defined(__CWCC__)\r
+ /* check sdata2 */\r
+ if (test_sdata2 != TEST_SDATA2) {\r
+ BAD_LINK_FILE();\r
+ }\r
+#endif\r
+\r
+#if defined(CFG_PPC) && defined(__CWCC__)\r
+ /* check sdata2 */\r
+ if (test_sbss2 != 0) {\r
+ BAD_LINK_FILE();\r
+ }\r
+#endif\r
+\r
EcuM_Init();\r
\r
}\r
*/\r
void StartOS(AppModeType Mode) {\r
\r
- /* Check link file */\r
- if (TEST_DATA != test_data) {\r
- noooo();\r
- }\r
-\r
- if (test_bss != 0) {\r
- noooo();\r
- }\r
-\r
Os_Sys.appMode = Mode;\r
\r
Os_CfgValidate();\r