diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/build/mkrules/hbfw/fsp/makefile | 4 | ||||
-rwxr-xr-x | src/build/mkrules/hbfw/makefile | 16 | ||||
-rw-r--r-- | src/include/usr/targeting/common/pointer.H | 88 | ||||
-rw-r--r-- | src/usr/targeting/attrrp.C | 2 |
4 files changed, 70 insertions, 40 deletions
diff --git a/src/build/mkrules/hbfw/fsp/makefile b/src/build/mkrules/hbfw/fsp/makefile index e7feea64d..3d78b85a9 100755 --- a/src/build/mkrules/hbfw/fsp/makefile +++ b/src/build/mkrules/hbfw/fsp/makefile @@ -39,6 +39,10 @@ EXPSHLIB_SUBDIRS += targeting STANDARD_SUBDIRS += targeting RUNBVT_SUBDIRS += +.elseif(${CONTEXT} == "x86.nfp") + +.include "makefile.nfp" + .endif .include <${RULES_MK}> diff --git a/src/build/mkrules/hbfw/makefile b/src/build/mkrules/hbfw/makefile index f42390815..e7d1328e3 100755 --- a/src/build/mkrules/hbfw/makefile +++ b/src/build/mkrules/hbfw/makefile @@ -27,10 +27,6 @@ # NOTE: Do NOT modify this file in CMVC directly! It comes from the Hostboot # repository and will be overwritten. -STANDARD_SUBDIRS += \ - img \ - simics - # Process the fsp subtree .if(${CONTEXT:R} == "ppc") @@ -39,17 +35,17 @@ EXPINC_SUBDIRS += fsp OBJECTS_SUBDIRS += EXPLIB_SUBDIRS += EXPSHLIB_SUBDIRS += fsp -STANDARD_SUBDIRS += fsp +STANDARD_SUBDIRS += fsp img simics RUNBVT_SUBDIRS += .elseif(${CONTEXT} == "x86.nfp") -EXPINC_SUBDIRS += nfp +EXPINC_SUBDIRS += fsp OBJECTS_SUBDIRS += -EXPLIB_SUBDIRS += nfp -EXPSHLIB_SUBDIRS += nfp -STANDARD_SUBDIRS += nfp -RUNBVT_SUBDIRS += +EXPLIB_SUBDIRS += fsp +EXPSHLIB_SUBDIRS += fsp +STANDARD_SUBDIRS += fsp +RUNBVT_SUBDIRS += .endif diff --git a/src/include/usr/targeting/common/pointer.H b/src/include/usr/targeting/common/pointer.H index f5d919ab6..e42c59218 100644 --- a/src/include/usr/targeting/common/pointer.H +++ b/src/include/usr/targeting/common/pointer.H @@ -1,26 +1,26 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/include/usr/targeting/common/pointer.H $ -// -// IBM CONFIDENTIAL -// -// COPYRIGHT International Business Machines Corp. 2012 -// -// p1 -// -// Object Code Only (OCO) source materials -// Licensed Internal Code Source Materials -// IBM HostBoot Licensed Internal Code -// -// The source code for this program is not published or other- -// wise divested of its trade secrets, irrespective of what has -// been deposited with the U.S. Copyright Office. -// -// Origin: 30 -// -// IBM_PROLOG_END - +/* IBM_PROLOG_BEGIN_TAG + * This is an automatically generated prolog. + * + * $Source: src/include/usr/targeting/common/pointer.H $ + * + * IBM CONFIDENTIAL + * + * COPYRIGHT International Business Machines Corp. 2012 + * + * p1 + * + * Object Code Only (OCO) source materials + * Licensed Internal Code Source Materials + * IBM HostBoot Licensed Internal Code + * + * The source code for this program is not published or other- + * wise divested of its trade secrets, irrespective of what has + * been deposited with the U.S. Copyright Office. + * + * Origin: 30 + * + * IBM_PROLOG_END_TAG + */ #ifndef __TARGETING_COMMON_POINTER_H #define __TARGETING_COMMON_POINTER_H @@ -44,11 +44,41 @@ template<typename T> union AbstractPointer { uint64_t raw; ///< Raw value of the container - struct + + /** + * @brief Returns the AbstractPointer as a platform specific pointer + * + * @return Platform specific pointer whose type matches the underlying + * template type + */ + operator T*() const + { + return reinterpret_cast<T*>(raw); + } + + /** + * @brief Returns the AbstractPointer as a platform specific pointer + * incremented by the specified amount. Note that the pointer + * will increment differently, based on the underlying type. + * + * @return Incremented, platform specific pointer whose type matches the + * underlying template type + */ + T* inc(const size_t i_inc) const { - uint8_t doNotUse[sizeof(uint64_t)-sizeof(void*)]; ///< Do no use - T* ptr; ///< Pointer to instance of type T - }; + return reinterpret_cast<T*>(raw) + i_inc; + } + + /** + * @brief Returns the AbstractPointer as a uint64_t, which has the same + * value as a platform specific pointer converted to a uint64_t + * + * @return uint64_t value of the converted platform specific pointer + */ + operator uint64_t() const + { + return reinterpret_cast<uint64_t>(reinterpret_cast<T*>(raw)); + } }; /** @@ -61,7 +91,7 @@ union AbstractPointer * @return T* pointer customized to the platform */ #define TARG_TO_PLAT_PTR(__PTR__) \ - ((__PTR__).ptr) + ((__PTR__)) /** * @biref Macro which accepts an AbstractPointer<T>, customizes the pointer to @@ -78,7 +108,7 @@ union AbstractPointer * number of times */ #define TARG_TO_PLAT_PTR_AND_INC(__PTR__,__NUM_INCS__) \ - ((__PTR__).ptr + __NUM_INCS__) + ((__PTR__).inc( __NUM_INCS__)) } // End namespace Targeting diff --git a/src/usr/targeting/attrrp.C b/src/usr/targeting/attrrp.C index 1c5bbab7b..5daf7de10 100644 --- a/src/usr/targeting/attrrp.C +++ b/src/usr/targeting/attrrp.C @@ -345,7 +345,7 @@ namespace TARGETING // cache is of a different type, we first cast to extract the // real pointer, then recast it into the cache iv_sections[i].vmmAddress = - reinterpret_cast<uint64_t>( + static_cast<uint64_t>( TARG_TO_PLAT_PTR(l_header->vmmBaseAddress)) + l_header->vmmSectionOffset*i; iv_sections[i].pnorAddress = l_pnorSectionInfo.vaddr + |