summaryrefslogtreecommitdiffstats
path: root/src/occ
diff options
context:
space:
mode:
authorFadi Kassem <fmkassem@us.ibm.com>2015-07-13 17:08:32 -0500
committerGuillermo J. Silva <guilsilv@us.ibm.com>2015-07-14 20:25:47 -0500
commit07aca8e99a96063771d107d8589811e9b12f4cb1 (patch)
tree42874048f5aa8fe0f96347198bf0a7739dd339a9 /src/occ
parent6dc5fe658d5dfbb6b1a69b63c53633039ca28668 (diff)
downloadtalos-occ-07aca8e99a96063771d107d8589811e9b12f4cb1.tar.gz
talos-occ-07aca8e99a96063771d107d8589811e9b12f4cb1.zip
Fix to make OCC successfully build using gcc4.9+
Change-Id: I1f7f34c3873a7c06983b14eac27a691ee52b17bc Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/19076 Tested-by: FSP CI Jenkins Reviewed-by: ANDRES A. LUGO-REYES <aalugore@us.ibm.com> Reviewed-by: Guillermo J. Silva <guilsilv@us.ibm.com> Tested-by: Guillermo J. Silva <guilsilv@us.ibm.com>
Diffstat (limited to 'src/occ')
-rwxr-xr-xsrc/occ/amec/amec_amester.c2
-rwxr-xr-xsrc/occ/amec/amec_data.c9
-rwxr-xr-xsrc/occ/amec/amec_sensors_power.c5
-rwxr-xr-xsrc/occ/aplt/appletManager.c18
-rwxr-xr-xsrc/occ/homer.c8
5 files changed, 20 insertions, 22 deletions
diff --git a/src/occ/amec/amec_amester.c b/src/occ/amec/amec_amester.c
index ac6cbd8..c565912 100755
--- a/src/occ/amec/amec_amester.c
+++ b/src/occ/amec/amec_amester.c
@@ -1232,7 +1232,6 @@ void amec_tb_cmd_set_config(const IPMIMsg_t *i_psMsg,
UINT16 l_oca_n;
UINT16 l_num_index;
UINT16 l_field_index;
- UINT16 l_oca_index;
UINT8 l_valid_sockets = 0;
UINT32 l_socket_bitmap = 0;
UINT16 l_parm_n;
@@ -1317,7 +1316,6 @@ void amec_tb_cmd_set_config(const IPMIMsg_t *i_psMsg,
l_num_index = 12; // start of sensor numbers
l_field_index = 12 + 2 * l_sensors_n; // start of sensor fields
l_parm_index = l_field_index + l_sensors_n; // start of parameters
- l_oca_index = l_parm_index + 2 * l_parm_n; // start of SCOMs
// Read sensor configuration
for(l_i = 0; l_i < l_sensors_n; l_i++)
diff --git a/src/occ/amec/amec_data.c b/src/occ/amec/amec_data.c
index 2556f5f..33142e1 100755
--- a/src/occ/amec/amec_data.c
+++ b/src/occ/amec/amec_data.c
@@ -92,19 +92,10 @@ errlHndl_t AMEC_data_write_fcurr(const OCC_MODE i_mode)
/* Local Variables */
/*------------------------------------------------------------------------*/
errlHndl_t l_err = NULL;
- OCC_MODE l_mode = i_mode;
/*------------------------------------------------------------------------*/
/* Code */
/*------------------------------------------------------------------------*/
- // We'll never actually get a dynamic power save data package so just
- // use turbo as our mode if in dynamic power save since it
- // will have appropriate frequency.
- if((i_mode == OCC_MODE_DYN_POWER_SAVE) ||
- (i_mode == OCC_MODE_DYN_POWER_SAVE_FP))
- {
- l_mode = OCC_MODE_TURBO;
- }
// If we're active we need to load this new range into DVFS MIN/MAX
if(CURRENT_STATE() == OCC_STATE_ACTIVE)
diff --git a/src/occ/amec/amec_sensors_power.c b/src/occ/amec/amec_sensors_power.c
index c123906..8d08db3 100755
--- a/src/occ/amec/amec_sensors_power.c
+++ b/src/occ/amec/amec_sensors_power.c
@@ -457,7 +457,6 @@ void amec_update_vrm_sensors(void)
int l_minus_np1_regmode = 0;
int l_minus_n_regmode = 0;
static uint8_t L_error_count = 0;
- uint8_t l_pin = 0;
uint8_t l_pin_value = 1; // active low, so set default to high
uint8_t l_vrhot_count = 0;
errlHndl_t l_err = NULL;
@@ -487,9 +486,6 @@ void amec_update_vrm_sensors(void)
L_error_count = 0;
G_thrm_fru_data[DATA_FRU_VRM].read_failure = 0;
- // Obtain the 'fan_full_speed' GPIO from APSS
- l_pin = G_sysConfigData.apss_gpio_map.fans_full_speed;
-
// No longer reading gpio from APSS in GA1 due to instability in
// APSS composite mode
//apss_gpio_get(l_pin, &l_pin_value);
@@ -630,7 +626,6 @@ void amec_update_external_voltage()
// End Function Specification
void amec_update_current_sensor(void)
{
- uint8_t i;
uint32_t result32; //temporary result
uint16_t l_pow_reg_input_dW = AMECSENSOR_PTR(PWR250USVDD0)->sample * 10; // convert to dW by *10.
uint16_t l_vdd_reg = AMECSENSOR_PTR(VOLT250USP0V0)->sample;
diff --git a/src/occ/aplt/appletManager.c b/src/occ/aplt/appletManager.c
index edc9953..e2e70df 100755
--- a/src/occ/aplt/appletManager.c
+++ b/src/occ/aplt/appletManager.c
@@ -5,10 +5,10 @@
/* */
/* OpenPOWER OnChipController Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2014 */
-/* [+] Google Inc. */
+/* Contributors Listed Below - COPYRIGHT 2011,2015 */
/* [+] International Business Machines Corp. */
/* */
+/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
/* You may obtain a copy of the License at */
@@ -156,7 +156,15 @@ errlHndl_t initAppletAddr( void ) INIT_SECTION;
// image in main memory
//
// End Function Specification
-errlHndl_t initAppletAddr( void )
+//
+
+// NOTE: Optimization of O1 is needed for this function due to the l_bootLoaderHeader pointer
+// pointing to a 0 address (which is considered NULL by the compiler) and thus with newer
+// gcc compilers (4.9.0 and above), a new optimization flag issolate-erroneous-paths-dereference
+// the compiler will set a trap in the code that will stop it from running.
+// Setting the Optimization to 1 will disable this flag when compiling with gcc 4.9 and above.
+
+errlHndl_t __attribute__((optimize("O1"))) initAppletAddr( void )
{
errlHndl_t l_err = NULL;
// 1. Applets count = OCC_APLT_TEST
@@ -164,7 +172,7 @@ errlHndl_t initAppletAddr( void )
// 3. Skip first 2 ( boot, main ) addresses
imageHdr_t *l_bootLoaderHeader = (void *) 0;
imageHdr_t *l_mainAppHeader = (void *)l_bootLoaderHeader +
- l_bootLoaderHeader-> image_size;
+ l_bootLoaderHeader->image_size;
imageHdr_t *l_appHeader = (void *) l_mainAppHeader +
l_mainAppHeader->image_size;
@@ -181,7 +189,7 @@ errlHndl_t initAppletAddr( void )
// 5a. Value of l_appHeader should be reasonable.
// Means that image sizes should be non-zero.
// TODO: Check l_appHeader vs. max. sane memory address.
- if( l_bootLoaderHeader-> image_size == 0 )
+ if( l_bootLoaderHeader->image_size == 0 )
{
l_foundInvalid = TRUE;
TRAC_ERR("Bad image size in boot loader header. applet count: %d", l_cnt);
diff --git a/src/occ/homer.c b/src/occ/homer.c
index 67ada05..a0331ce 100755
--- a/src/occ/homer.c
+++ b/src/occ/homer.c
@@ -51,7 +51,13 @@
* End Function Specification
*/
-homer_rc_t homer_hd_map_read_unmap(const homer_read_var_t i_id,
+// NOTE: Optimization of O1 is needed for this function due to the l_bootLoaderHeader pointer
+// pointing to a 0 address (which is considered NULL by the compiler) and thus with newer
+// gcc compilers (4.9.0 and above), a new optimization flag issolate-erroneous-paths-dereference
+// the compiler will set a trap in the code that will stop it from running.
+// Setting the Optimization to 1 will disable this flag when compiling with gcc 4.9 and above.
+
+homer_rc_t __attribute__((optimize("O1"))) homer_hd_map_read_unmap(const homer_read_var_t i_id,
void * const o_host_data,
int * const o_ssx_rc)
{
OpenPOWER on IntegriCloud