Commit 40a6f647 authored by James Morrissey's avatar James Morrissey Committed by Dan Handley
Browse files

Fix asserts appearing in release builds

Also fix warnings generated in release builds when assert code
is absent.

Change-Id: I45b9173d3888f9e93e98eb5b4fdc06727ba5cbf4
parent df64a55b
...@@ -154,6 +154,8 @@ ifneq (${DEBUG}, 0) ...@@ -154,6 +154,8 @@ ifneq (${DEBUG}, 0)
CFLAGS += -g CFLAGS += -g
# -save-temps -fverbose-asm # -save-temps -fverbose-asm
ASFLAGS += -g -Wa,--gdwarf-2 ASFLAGS += -g -Wa,--gdwarf-2
else
CFLAGS += -DNDEBUG=1
endif endif
......
...@@ -47,7 +47,9 @@ void bl1_arch_next_el_setup(void); ...@@ -47,7 +47,9 @@ void bl1_arch_next_el_setup(void);
******************************************************************************/ ******************************************************************************/
void bl1_main(void) void bl1_main(void)
{ {
#if DEBUG
unsigned long sctlr_el3 = read_sctlr(); unsigned long sctlr_el3 = read_sctlr();
#endif
unsigned long bl2_base; unsigned long bl2_base;
unsigned int load_type = TOP_LOAD, spsr; unsigned int load_type = TOP_LOAD, spsr;
meminfo *bl1_tzram_layout; meminfo *bl1_tzram_layout;
......
...@@ -272,8 +272,9 @@ unsigned long load_image(meminfo *mem_layout, ...@@ -272,8 +272,9 @@ unsigned long load_image(meminfo *mem_layout,
unsigned int load_type, unsigned int load_type,
unsigned long fixed_addr) unsigned long fixed_addr)
{ {
unsigned long temp_image_base, image_base; unsigned long temp_image_base = 0;
long offset; unsigned long image_base = 0;
long offset = 0;
int image_flen; int image_flen;
/* Find the size of the image */ /* Find the size of the image */
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include <psci.h> #include <psci.h>
#include <psci_private.h> #include <psci_private.h>
#include <runtime_svc.h> #include <runtime_svc.h>
#include "debug.h"
/******************************************************************************* /*******************************************************************************
* Arrays that contains information needs to resume a cpu's execution when woken * Arrays that contains information needs to resume a cpu's execution when woken
...@@ -511,7 +512,8 @@ void psci_afflvl_power_on_finish(unsigned long mpidr, ...@@ -511,7 +512,8 @@ void psci_afflvl_power_on_finish(unsigned long mpidr,
start_afflvl, start_afflvl,
end_afflvl, end_afflvl,
mpidr_nodes); mpidr_nodes);
assert (rc == PSCI_E_SUCCESS); if (rc != PSCI_E_SUCCESS)
panic();
/* /*
* This function acquires the lock corresponding to each affinity * This function acquires the lock corresponding to each affinity
...@@ -529,7 +531,8 @@ void psci_afflvl_power_on_finish(unsigned long mpidr, ...@@ -529,7 +531,8 @@ void psci_afflvl_power_on_finish(unsigned long mpidr,
end_afflvl, end_afflvl,
pon_handlers, pon_handlers,
mpidr); mpidr);
assert (rc == PSCI_E_SUCCESS); if (rc != PSCI_E_SUCCESS)
panic();
/* /*
* This loop releases the lock corresponding to each affinity level * This loop releases the lock corresponding to each affinity level
......
...@@ -255,7 +255,7 @@ static unsigned int psci_init_aff_map(unsigned long mpidr, ...@@ -255,7 +255,7 @@ static unsigned int psci_init_aff_map(unsigned long mpidr,
******************************************************************************/ ******************************************************************************/
void psci_setup(unsigned long mpidr) void psci_setup(unsigned long mpidr)
{ {
int afflvl, affmap_idx, rc, max_afflvl; int afflvl, affmap_idx, max_afflvl;
aff_map_node *node; aff_map_node *node;
/* Initialize psci's internal state */ /* Initialize psci's internal state */
...@@ -314,8 +314,7 @@ void psci_setup(unsigned long mpidr) ...@@ -314,8 +314,7 @@ void psci_setup(unsigned long mpidr)
psci_set_state(node, PSCI_STATE_ON); psci_set_state(node, PSCI_STATE_ON);
} }
rc = platform_setup_pm(&psci_plat_pm_ops); platform_setup_pm(&psci_plat_pm_ops);
assert(rc == 0);
assert(psci_plat_pm_ops); assert(psci_plat_pm_ops);
return; return;
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <bl_common.h> #include <bl_common.h>
/* Included only for error codes */ /* Included only for error codes */
#include <psci.h> #include <psci.h>
#include "debug.h"
unsigned char platform_normal_stacks[PLATFORM_STACK_SIZE][PLATFORM_CORE_COUNT] unsigned char platform_normal_stacks[PLATFORM_STACK_SIZE][PLATFORM_CORE_COUNT]
__attribute__ ((aligned(PLATFORM_CACHE_LINE_SIZE), __attribute__ ((aligned(PLATFORM_CACHE_LINE_SIZE),
...@@ -534,8 +535,8 @@ int platform_config_setup(void) ...@@ -534,8 +535,8 @@ int platform_config_setup(void)
bld = (sys_id >> SYS_ID_BLD_SHIFT) & SYS_ID_BLD_MASK; bld = (sys_id >> SYS_ID_BLD_SHIFT) & SYS_ID_BLD_MASK;
arch = (sys_id >> SYS_ID_ARCH_SHIFT) & SYS_ID_ARCH_MASK; arch = (sys_id >> SYS_ID_ARCH_SHIFT) & SYS_ID_ARCH_MASK;
assert(rev == REV_FVP); if ((rev != REV_FVP) || (arch != ARCH_MODEL))
assert(arch == ARCH_MODEL); panic();
/* /*
* The build field in the SYS_ID tells which variant of the GIC * The build field in the SYS_ID tells which variant of the GIC
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment