Skip to content

Commit

Permalink
Fix Sentinel Compile Error
Browse files Browse the repository at this point in the history
GCC intermitently reports MASTER_PROCESSOR_CHIP_TARGET_SENTINEL
as being multiply-defined. Indeed it has, but the error only shows
up when other errors are present. This commit fixes the underlying
coding problem that exposes the GCC annoyance. Also, there is the
added benefit that the symbol no longer uses duplicate space for
every source file that uses the targeting service.

Change-Id: I96dfaad210ab3e16b173c7482708ca1b66f14524
RTC:000000
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/35589
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Reviewed-by: Stephen M. Cprek <smcprek@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
popfuture authored and dcrowell77 committed Feb 1, 2017
1 parent dd31bfd commit 917f945
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/include/usr/targeting/common/targetservice.H
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,2016 */
/* Contributors Listed Below - COPYRIGHT 2012,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -134,10 +134,7 @@ namespace TARGETING
* DD framework to bring PNOR device driver online. Note this target
* cannot be used as input to any target service APIs.
*/
static Target* const MASTER_PROCESSOR_CHIP_TARGET_SENTINEL
= (sizeof(void*) == 4) ?
reinterpret_cast<TARGETING::Target* const>(0xFFFFFFFF)
: reinterpret_cast<TARGETING::Target* const>(0xFFFFFFFFFFFFFFFFULL);
extern Target* const MASTER_PROCESSOR_CHIP_TARGET_SENTINEL;

/**
* @brief TargetService class
Expand Down
7 changes: 7 additions & 0 deletions src/usr/targeting/common/targutilbase.C
Expand Up @@ -27,6 +27,13 @@
namespace TARGETING
{


// master sentinel defined here to make available before targeting is up
Target* const MASTER_PROCESSOR_CHIP_TARGET_SENTINEL
= (sizeof(void*) == 4) ?
reinterpret_cast<TARGETING::Target* const>(0xFFFFFFFF)
: reinterpret_cast<TARGETING::Target* const>(0xFFFFFFFFFFFFFFFFULL);

/**
* @brief Safely fetch the HUID of a Target
*/
Expand Down

0 comments on commit 917f945

Please sign in to comment.