Skip to content

Commit

Permalink
Add a global to track when targeting has been loaded
Browse files Browse the repository at this point in the history
This commit adds a global that keeps track of when targeting has
loaded along with functions to get and set this global.

Change-Id: Iddd65018918089163ebc03f042bfdd1bed31e730
RTC:165205
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/37595
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Reviewed-by: Stephen M. Cprek <smcprek@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
mabaiocchi authored and dcrowell77 committed Mar 8, 2017
1 parent 2475464 commit e7b1c85
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 2 deletions.
23 changes: 22 additions & 1 deletion src/include/util/misc.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* COPYRIGHT International Business Machines Corp. 2014 */
/* Contributors Listed Below - COPYRIGHT 2014,2017 */
/* [+] 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. */
Expand Down Expand Up @@ -34,6 +36,25 @@ namespace Util
* @return bool true if running in simics; otherwise false
*/
bool isSimicsRunning( void );

/**
* @brief Determines if Targeting code has been loaded
*
* @param[in] void
*
* @return bool true if Targeting is loaded; otherwise false
*/
bool isTargetingLoaded( void );

/**
* @brief Sets global that Targeting code has been loaded
* NOTE: this should only be called once by targeting
*
* @param[in] void
*
* @return N/A
*/
void setIsTargetingLoaded( void );
};

#endif
Expand Down
17 changes: 16 additions & 1 deletion src/lib/utilmisc.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* COPYRIGHT International Business Machines Corp. 2014 */
/* Contributors Listed Below - COPYRIGHT 2014,2017 */
/* [+] 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. */
Expand Down Expand Up @@ -41,5 +43,18 @@ bool isSimicsRunning()
return simics;
}

static bool g_isTargetingLoaded = false;

bool isTargetingLoaded()
{
return g_isTargetingLoaded;
}

void setIsTargetingLoaded()
{
g_isTargetingLoaded = true;
}


};

4 changes: 4 additions & 0 deletions src/usr/targeting/targetservicestart.C
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
#include <devicefw/userif.H>
#include <config.h>
#include <initservice/initserviceif.H>
#include <util/misc.H>

#ifdef CONFIG_DRTM
#include <secureboot/drtm.H>
Expand Down Expand Up @@ -177,6 +178,9 @@ static void initTargeting(errlHndl_t& io_pError)
// call ErrlManager function - tell him that TARG is ready!
ERRORLOG::ErrlManager::errlResourceReady(ERRORLOG::TARG);
#endif

// set global that TARG is ready
Util::setIsTargetingLoaded();
}

TARG_EXIT();
Expand Down

0 comments on commit e7b1c85

Please sign in to comment.