diff options
Diffstat (limited to 'src/import/chips/p9/utils')
5 files changed, 62 insertions, 13 deletions
diff --git a/src/import/chips/p9/utils/imageProcs/p9_infrastruct_help.H b/src/import/chips/p9/utils/imageProcs/p9_infrastruct_help.H index bc3784869..501047505 100644 --- a/src/import/chips/p9/utils/imageProcs/p9_infrastruct_help.H +++ b/src/import/chips/p9/utils/imageProcs/p9_infrastruct_help.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ +/* Contributors Listed Below - COPYRIGHT 2016,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -25,7 +25,11 @@ #ifndef _P9_INFRASTRUCT_HELP_H_ #define _P9_INFRASTRUCT_HELP_H_ -#include <stdint.h> +#ifdef WIN32 + #include "win32_stdint.h" +#else + #include <stdint.h> +#endif #include <stdlib.h> #include <stdio.h> #include <string.h> @@ -71,9 +75,15 @@ enum MODEBUILD #define MY_ERR(_fmt_, _args_...) FAPI_INF(_fmt_, ##_args_) #define MY_DBG(_fmt_, _args_...) FAPI_DBG(_fmt_, ##_args_) #else - #define MY_INF(_fmt_, _args_...) printf(_fmt_, ##_args_) - #define MY_ERR(_fmt_, _args_...) printf(_fmt_, ##_args_) - #define MY_DBG(_fmt_, _args_...) printf(_fmt_, ##_args_) + #ifdef WIN32 + #define MY_INF(...) { printf(__VA_ARGS__); } + #define MY_ERR(...) { printf(__VA_ARGS__); } + #define MY_DBG(...) { printf(__VA_ARGS__); } + #else + #define MY_INF(_fmt_, _args_...) printf(_fmt_, ##_args_) + #define MY_ERR(_fmt_, _args_...) printf(_fmt_, ##_args_) + #define MY_DBG(_fmt_, _args_...) printf(_fmt_, ##_args_) + #endif #endif diff --git a/src/import/chips/p9/utils/imageProcs/p9_ringId.H b/src/import/chips/p9/utils/imageProcs/p9_ringId.H index 325c3c0b5..f41dbb0ca 100644 --- a/src/import/chips/p9/utils/imageProcs/p9_ringId.H +++ b/src/import/chips/p9/utils/imageProcs/p9_ringId.H @@ -26,10 +26,15 @@ #ifndef _P9_RINGID_H_ #define _P9_RINGID_H_ -#include <stdint.h> -#include <stddef.h> -#include <p9_ring_id.h> +#ifdef WIN32 + #include "win32_stdint.h" + #include "p9_ring_id.h" +#else + #include <stdint.h> + #include <stddef.h> + #include <p9_ring_id.h> +#endif // General Ring ID list structure typedef struct diff --git a/src/import/chips/p9/utils/imageProcs/p9_ring_identification.C b/src/import/chips/p9/utils/imageProcs/p9_ring_identification.C index 511b314c7..c14f84b05 100644 --- a/src/import/chips/p9/utils/imageProcs/p9_ring_identification.C +++ b/src/import/chips/p9/utils/imageProcs/p9_ring_identification.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ +/* Contributors Listed Below - COPYRIGHT 2016,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -22,7 +22,17 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ -#include <p9_ring_identification.H> +#ifdef WIN32 + #include "win32_stdint.h" + #include "p9_ring_identification.H" +#else + #ifdef __sun + #include <sys/int_types.h> + #include "p9_ring_identification.H" + #else + #include <p9_ring_identification.H> + #endif +#endif const RingIdList RING_ID_LIST_PDG[] = { @@ -151,10 +161,17 @@ const VPDRingList ALL_VPD_RINGS[NUM_OF_VPD_TYPES] = {RING_ID_LIST_PDR, (sizeof(RING_ID_LIST_PDR) / sizeof(RING_ID_LIST_PDR[0]))}, }; +#if defined(WIN32) || defined(__sun) +const uint32_t RING_ID_LIST_PG_SIZE = sizeof(RING_ID_LIST_PDG) / sizeof( + RING_ID_LIST_PDG[0]); +const uint32_t RING_ID_LIST_PR_SIZE = sizeof(RING_ID_LIST_PDR) / sizeof( + RING_ID_LIST_PDR[0]); +#endif const uint32_t RING_ID_LIST_CORE_SIZE = 4; +//@TODO: This function will be used in RTC158106 (VPD insertion ordering). // get_vpd_ring_list_entry() retrieves the MVPD list entry based on either a ringName // or a ringId. If both are supplied, only the ringName is used. If ringName==NULL, // then the ringId is used. A pointer to the RingIdList is returned. diff --git a/src/import/chips/p9/utils/imageProcs/p9_ring_identification.H b/src/import/chips/p9/utils/imageProcs/p9_ring_identification.H index 188bcaf7e..42b8141e2 100644 --- a/src/import/chips/p9/utils/imageProcs/p9_ring_identification.H +++ b/src/import/chips/p9/utils/imageProcs/p9_ring_identification.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ +/* Contributors Listed Below - COPYRIGHT 2016,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -26,7 +26,15 @@ #ifndef _P9_RING_IDENT_H_ #define _P9_RING_IDENT_H_ #include <stddef.h> -#include <stdint.h> +#ifdef WIN32 + #include "win32_stdint.h" +#else + #ifdef __sun + #include <sys/int_types.h> + #else + #include <stdint.h> + #endif +#endif #include <stdlib.h> #include <string.h> #include <p9_ring_id.h> @@ -54,6 +62,10 @@ extern const VPDRingList ALL_VPD_RINGS[]; extern const uint32_t RING_ID_LIST_CHIP_SIZE, RING_ID_LIST_CORE_SIZE, RING_ID_LIST_CME_SIZE, RING_ID_LIST_CC_SIZE; +#if defined(WIN32) || defined(__sun) + extern const RingIdList RING_ID_LIST_PDG[], RING_ID_LIST_PDR[]; + extern const uint32_t RING_ID_LIST_PG_SIZE, RING_ID_LIST_PR_SIZE; +#endif // Enumerated VPD keyword values. // Note! This is DIFFERENT from the MvpdKeyword list in fapiMvpdAccess.H which diff --git a/src/import/chips/p9/utils/imageProcs/p9_tor.C b/src/import/chips/p9/utils/imageProcs/p9_tor.C index 92738a319..19f348d13 100644 --- a/src/import/chips/p9/utils/imageProcs/p9_tor.C +++ b/src/import/chips/p9/utils/imageProcs/p9_tor.C @@ -23,6 +23,12 @@ /* */ /* IBM_PROLOG_END_TAG */ +#ifdef WIN32 + #include "endian.h" +#else + #include <endian.h> +#endif + // IMPORTANT notice on usage of io_RingType and io_instanceId arguments // // io_RingTyp @@ -35,7 +41,6 @@ // While using tor_tor_get_block_of_rings and tor_get_single_ring API, // it is used pass by value // -#include <endian.h> #include "p9_ringId.H" #include "p9_tor.H" #include "p9_xip_image.h" |