From 4f0d349dcdddc9a7af330dbb55416f38e5632838 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Thu, 27 Feb 2020 10:32:47 -0500 Subject: [PATCH] Fix #139, compiler warnings on mcp750 PSP Patches for the MCP750 PSP to avoid some compiler warnings that show up when building with strict flags --- fsw/mcp750-vxworks/src/cfe_psp_memory.c | 4 +++- fsw/mcp750-vxworks/src/cfe_psp_start.c | 9 ++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/fsw/mcp750-vxworks/src/cfe_psp_memory.c b/fsw/mcp750-vxworks/src/cfe_psp_memory.c index 17c903ca..7211c55b 100644 --- a/fsw/mcp750-vxworks/src/cfe_psp_memory.c +++ b/fsw/mcp750-vxworks/src/cfe_psp_memory.c @@ -59,7 +59,9 @@ /* ** Define the cFE Core loadable module name */ -#define CFE_MODULE_NAME "cfe-core.o" +#define CFE_MODULE_NAME_DEFAULT "cfe-core.o" + +static char CFE_MODULE_NAME[] = CFE_MODULE_NAME_DEFAULT; /* diff --git a/fsw/mcp750-vxworks/src/cfe_psp_start.c b/fsw/mcp750-vxworks/src/cfe_psp_start.c index e70e9cb8..cbd6675c 100644 --- a/fsw/mcp750-vxworks/src/cfe_psp_start.c +++ b/fsw/mcp750-vxworks/src/cfe_psp_start.c @@ -98,6 +98,7 @@ void CFE_PSP_Main( void ) uint32 reset_type; uint32 reset_subtype; char reset_register; + cpuaddr memaddr; int32 Status; @@ -128,8 +129,14 @@ void CFE_PSP_Main( void ) /* ** Setup the pointer to the reserved area in vxWorks. ** This must be done before any of the reset variables are used. + ** + ** Note: this uses a "cpuaddr" (integer address) as an intermediate + ** to avoid a warning about alignment. The output of sysMemTop() + ** should be aligned to hold any data type, being the very start + ** of the memory space. */ - CFE_PSP_ReservedMemoryPtr = (CFE_PSP_ReservedMemory_t *)sysMemTop(); + memaddr = (cpuaddr) sysMemTop(); + CFE_PSP_ReservedMemoryPtr = (CFE_PSP_ReservedMemory_t *) memaddr; /* ** Determine Reset type by reading the hardware reset register.