From bf485f857adec16e7ecb2a3dcc77c416c79b7a29 Mon Sep 17 00:00:00 2001 From: Mark Wenning Date: Fri, 1 Feb 2013 12:41:10 -0600 Subject: Add system-wide constants to specify the maximum number of procs possible in the system Change-Id: I6759b15c3f31f9e8ba219b0f9661a6c947eb94d6 RTC: 61361 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/3082 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III --- src/include/sys/misc.h | 18 +++++++++++++++++ .../hwp/build_winkle_images/build_winkle_images.C | 23 +++++++--------------- src/usr/runtime/populate_attributes.C | 15 +++++++------- 3 files changed, 32 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/include/sys/misc.h b/src/include/sys/misc.h index 8c119aca5..a4ae8d006 100644 --- a/src/include/sys/misc.h +++ b/src/include/sys/misc.h @@ -25,6 +25,24 @@ #include +/** + * @enum p8SystemConsts + * + * system-wide constants: + * - please add as necessary + * + */ + +enum p8SystemConsts +{ + /// max possible processors in a P8 system + P8_MAX_PROCS = 8, + /// max EX (cores available in a processor ) + P8_MAX_EX_PER_PROC = 16, + +}; + + /** * @enum ShutdownStatus * diff --git a/src/usr/hwpf/hwp/build_winkle_images/build_winkle_images.C b/src/usr/hwpf/hwp/build_winkle_images/build_winkle_images.C index bd63fe764..23dc77ad6 100644 --- a/src/usr/hwpf/hwp/build_winkle_images/build_winkle_images.C +++ b/src/usr/hwpf/hwp/build_winkle_images/build_winkle_images.C @@ -35,9 +35,9 @@ /******************************************************************************/ #include -#include // cpu_thread_count() -#include // PORE image -#include // mm_linear_map +#include // cpu_thread_count(), P8_MAX_PROCS +#include // PORE image +#include // mm_linear_map #include #include @@ -96,9 +96,6 @@ using namespace DeviceFW; * * @return NULL if success, errorlog if failure * - * @todo $$ Add code to UNload this image/module when all the - * HWP's are finished. - * */ errlHndl_t loadPoreImage( const TARGETING::Target *i_CpuTarget, const char *& o_rporeAddr, @@ -259,7 +256,7 @@ errlHndl_t applyPoreGenCpuRegs( TARGETING::Target *i_cpuTarget, if( !(en_threads & (0x8000000000000000>>l_threadId)) ) { continue; - } + } TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "applyPoreGenCpuRegs: core=0x%x,thread=0x%x: ", @@ -324,7 +321,6 @@ void* call_host_build_winkle( void *io_pArgs ) size_t l_poreSize = 0; void *l_pRealMemBase = reinterpret_cast( OUTPUT_PORE_IMG_ADDR ) ; - ISTEP_ERROR::IStepError l_StepError; TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, @@ -333,15 +329,10 @@ void* call_host_build_winkle( void *io_pArgs ) // @@@@@ CUSTOM BLOCK: @@@@@ do { - // @todo Issue 61361 - // Should be a system-wide constant stating the maximum number of procs - // in the system. In the meantime: - const uint64_t MAX_POSSIBLE_PROCS_IN_P8_SYSTEM = 8; - // Get a chunk of real memory big enough to store all the possible // SLW images. - const uint64_t l_RealMemSize = ( (MAX_OUTPUT_PORE_IMG_IN_MB*1*MEGABYTE) * - MAX_POSSIBLE_PROCS_IN_P8_SYSTEM ); + const uint64_t l_RealMemSize = ((MAX_OUTPUT_PORE_IMG_IN_MB*1*MEGABYTE) * + P8_MAX_PROCS ); TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "Got realmem to store all SLW images, size=0x%lx", @@ -594,7 +585,7 @@ void* call_proc_set_pore_bar( void *io_pArgs ) // write the HUID of the core we are writing to TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, - "Set pore bar for " + "Set pore bar for " "target HUID %.8X", TARGETING::get_huid(l_procChip)); // cast OUR type of target to a FAPI type of target. diff --git a/src/usr/runtime/populate_attributes.C b/src/usr/runtime/populate_attributes.C index 05fc98ff6..30514ca6b 100644 --- a/src/usr/runtime/populate_attributes.C +++ b/src/usr/runtime/populate_attributes.C @@ -27,6 +27,7 @@ * @brief Populate attributes for runtime HostServices code */ +#include #include #include #include @@ -160,14 +161,12 @@ struct system_data_t struct node_data_t { enum { - MAX_PROCS = 8, - MAX_PROCS_RSV = 16, //leave space for double - MAX_EX_PER_PROC = 16, - MAX_EX_RSV = MAX_PROCS_RSV*MAX_EX_PER_PROC, + MAX_PROCS_RSV = P8_MAX_PROCS*2, //leave space for double + MAX_EX_RSV = MAX_PROCS_RSV*P8_MAX_EX_PER_PROC, NUM_PROC_ATTRIBUTES = 125, NUM_EX_ATTRIBUTES = 10, MAX_ATTRIBUTES = MAX_PROCS_RSV*NUM_PROC_ATTRIBUTES + - MAX_PROCS_RSV*MAX_EX_PER_PROC*NUM_EX_ATTRIBUTES + MAX_EX_RSV*NUM_EX_ATTRIBUTES }; // header data that HostServices uses @@ -175,9 +174,9 @@ struct node_data_t // actual data content hsvc_proc_header_t procs[MAX_PROCS_RSV]; - hsvc_ex_header_t ex[MAX_PROCS_RSV*MAX_EX_PER_PROC]; + hsvc_ex_header_t ex[MAX_EX_RSV]; hsvc_attr_header_t procAttrHeaders[MAX_PROCS_RSV][NUM_PROC_ATTRIBUTES]; - hsvc_attr_header_t exAttrHeaders[MAX_PROCS_RSV*MAX_EX_PER_PROC][NUM_EX_ATTRIBUTES]; + hsvc_attr_header_t exAttrHeaders[MAX_EX_RSV][NUM_EX_ATTRIBUTES]; char attributes[MAX_ATTRIBUTES*sizeof(uint32_t)]; }; @@ -417,7 +416,7 @@ errlHndl_t populate_node_attributes( uint64_t i_nodeNum ) EMPTY_ATTRIBUTE; TRACFCOMP( g_trac_runtime, "populate_node_attributes> PROC:%d (%.8X) : numAttr=%d", procid, TARGETING::get_huid(all_procs[p]), node_data->procs[p].numAttr ); - + // Make sure we don't overrun our space assert( *_num_attr < node_data_t::NUM_PROC_ATTRIBUTES ); -- cgit v1.2.3