summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorClaus Michael Olsen <cmolsen@us.ibm.com>2016-09-11 12:12:09 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-02-22 14:08:02 -0500
commit4d144fd0ec9620cd96dd0e7a5565980e7cefe056 (patch)
treec2f00f46d414e16a69b6c449615278c9aa058c33 /src
parentd7e00d057567432edf0807648d3a54254298a922 (diff)
downloadtalos-hostboot-4d144fd0ec9620cd96dd0e7a5565980e7cefe056.tar.gz
talos-hostboot-4d144fd0ec9620cd96dd0e7a5565980e7cefe056.zip
xip_customize: MVPD compatible file set.
Change-Id: Ib3b7aeb8045a28ca05d33370c1ef1dcb9ba1fb64 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/29448 Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: Martin Gloff <mgloff@us.ibm.com> Reviewed-by: Michael C. Sgro <mcs793@us.ibm.com> Reviewed-by: Martin Peschke <mpeschke@de.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/29450 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/import/chips/p9/procedures/hwp/customize/p9_xip_customize.C95
-rw-r--r--src/import/chips/p9/procedures/hwp/customize/p9_xip_customize.H21
-rw-r--r--src/import/chips/p9/utils/imageProcs/p9_infrastruct_help.H20
-rw-r--r--src/import/chips/p9/utils/imageProcs/p9_ringId.H11
-rw-r--r--src/import/chips/p9/utils/imageProcs/p9_ring_identification.C21
-rw-r--r--src/import/chips/p9/utils/imageProcs/p9_ring_identification.H16
-rw-r--r--src/import/chips/p9/utils/imageProcs/p9_tor.C7
-rw-r--r--src/import/chips/p9/xip/p9_xip_image.c17
-rw-r--r--src/import/chips/p9/xip/p9_xip_image.h6
9 files changed, 173 insertions, 41 deletions
diff --git a/src/import/chips/p9/procedures/hwp/customize/p9_xip_customize.C b/src/import/chips/p9/procedures/hwp/customize/p9_xip_customize.C
index 496a94dda..9e9293f50 100644
--- a/src/import/chips/p9/procedures/hwp/customize/p9_xip_customize.C
+++ b/src/import/chips/p9/procedures/hwp/customize/p9_xip_customize.C
@@ -22,6 +22,19 @@
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */
+#ifdef WIN32
+#include "win32_stdint.h"
+#include "endian.h"
+#include "win_sim_fapi.h"
+#include "p9_xip_customize.H"
+#include "p9_xip_image.h"
+#include "p9_ring_identification.H"
+#include "p9_tor.H"
+#include "p9_scan_compression.H"
+#include "p9_infrastruct_help.H"
+
+using namespace fapi2;
+#else
#include <p9_xip_customize.H>
#include <p9_xip_image.h>
#include <p9_ring_identification.H>
@@ -149,6 +162,7 @@ fapi_try_exit:
return fapi2::current_err;
}
+#endif
// Function: _fetch_and_insert_vpd_rings()
//
@@ -165,9 +179,13 @@ fapi_try_exit:
// const RingIdList i_ring: The ring ID list (#G or #R list)
// uint32_t& io_bootCoreMask: Desired (in) and actual (out) boot cores.
//
-
+#ifdef WIN32
+ReturnCode _fetch_and_insert_vpd_rings(
+ int& i_proc_target,
+#else
fapi2::ReturnCode _fetch_and_insert_vpd_rings(
const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_proc_target,
+#endif
void* i_ringSection,
uint32_t& io_ringSectionSize,
uint32_t i_maxRingSectionSize,
@@ -228,12 +246,16 @@ fapi2::ReturnCode _fetch_and_insert_vpd_rings(
for (l_evenOdd = 0; l_evenOdd < l_ringsPerChipletId; l_evenOdd++)
{
- FAPI_INF("_fetch_and_insert_vpd_rings: (ringId,chipletId) = (0x%02X,0x%02x)",
- i_ring.ringId, l_chipletId);
-
- auto l_vpdRingSize = i_vpdRingSize;
+#ifdef WIN32
+ uint16_t l_vpdRingSize = i_vpdRingSize;
+#else
+ uint32_t l_vpdRingSize = i_vpdRingSize;
+#endif
MvpdKeyword l_mvpdKeyword;
+ FAPI_INF("_fetch_and_insert_vpd_rings: (ringId,chipletId) = (0x%02x,0x%02x)",
+ i_ring.ringId, l_chipletId);
+
switch (i_ring.vpdKeyword)
{
case VPD_KEYWORD_PDG: // #G Time rings
@@ -575,7 +597,7 @@ fapi2::ReturnCode _fetch_and_insert_vpd_rings(
} // End if(redundant)
}
- else if (l_fapiRc.isRC(RC_MVPD_RING_NOT_FOUND))
+ else if ((uint32_t)l_fapiRc == RC_MVPD_RING_NOT_FOUND)
{
// No match, do nothing. Next chipletId.
@@ -595,11 +617,10 @@ fapi2::ReturnCode _fetch_and_insert_vpd_rings(
//--------------------------
// Handle other error cases
//--------------------------
-
// getMvpdRing failed due to insufficient ring buffer space.
// Assumption here is that getMvpdRing returns required buffer size
// in l_vpdRingSize (and which it does!).
- FAPI_ASSERT( !l_fapiRc.isRC(RC_MVPD_RING_BUFFER_TOO_SMALL),
+ FAPI_ASSERT( (uint32_t)l_fapiRc != RC_MVPD_RING_BUFFER_TOO_SMALL,
fapi2::XIPC_MVPD_RING_SIZE_TOO_BIG().
set_CHIP_TARGET(i_proc_target).
set_RING_ID(i_ring.ringId).
@@ -611,7 +632,7 @@ fapi2::ReturnCode _fetch_and_insert_vpd_rings(
l_vpdRingSize, i_vpdRingSize );
// getMvpdRing failed due to invalid record data magic word.
- FAPI_ASSERT( !l_fapiRc.isRC(RC_MVPD_INVALID_RS4_HEADER),
+ FAPI_ASSERT( (uint32_t)l_fapiRc != RC_MVPD_INVALID_RS4_HEADER,
fapi2::XIPC_MVPD_INVALID_RECORD_DATA().
set_CHIP_TARGET(i_proc_target).
set_RING_ID(i_ring.ringId).
@@ -621,8 +642,19 @@ fapi2::ReturnCode _fetch_and_insert_vpd_rings(
// getMvpdRing failed for some other reason aside from above handled cases.
if (l_fapiRc != fapi2::FAPI2_RC_SUCCESS)
{
+#ifdef WIN32
+
+ if (l_fapiRc == SKIP_RING_ID )
+ {
+ l_fapiRc = fapi2::FAPI2_RC_SUCCESS;
+ FAPI_DBG("N/A MVPD ring for chiptype: ringId=0x%02X, chipletId=0x%02X ",
+ i_ring.ringId, l_chipletId);
+ }
+
+#else
FAPI_ERR("_fetch_and_insert_vpd_rings(): getMvpdRing failed "
" w/rc=0x%08X", (uint64_t)l_fapiRc);
+#endif
fapi2::current_err = l_fapiRc;
goto fapi_try_exit;
}
@@ -638,7 +670,7 @@ fapi_try_exit:
FAPI_DBG("Exiting _fetch_and_insert_vpd_rings");
return fapi2::current_err;
-}
+} // End of _fetch_and_insert_vpd_rings()
@@ -656,8 +688,13 @@ fapi_try_exit:
// uint32_t i_ringBufSize2: Size of ring work buffer.
// uint32_t& io_bootCoreMask: Desired (in) and actual (out) boot cores.
//
+#ifdef WIN32
+int fetch_and_insert_vpd_rings(
+ int i_proc_target,
+#else
fapi2::ReturnCode fetch_and_insert_vpd_rings(
const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_proc_target,
+#endif
void* i_ringSection,
uint32_t& io_ringSectionSize, // Running size
uint32_t i_maxRingSectionSize, // Max size
@@ -737,7 +774,6 @@ fapi2::ReturnCode fetch_and_insert_vpd_rings(
l_ring_id_list[iRing].vpdRingClass == VPD_RING_CLASS_EX_INS ||
l_ring_id_list[iRing].vpdRingClass == VPD_RING_CLASS_EC_INS)
{
-
FAPI_TRY( _fetch_and_insert_vpd_rings( i_proc_target,
i_ringSection,
io_ringSectionSize,
@@ -765,12 +801,17 @@ fapi_try_exit:
FAPI_DBG("Exiting fetch_and_insert_vpd_rings");
return fapi2::current_err;
-}
+} // End of fetch_and_insert_vpd_rings()
+#ifndef WIN32
fapi2::ReturnCode p9_xip_customize (
const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_proc_target,
+#else
+ReturnCode p9_xip_customize (
+ int& i_proc_target,
+#endif
void* io_image,
uint32_t& io_imageSize, // In: Max, Out: Actual
void* io_ringSectionBuf,
@@ -783,11 +824,15 @@ fapi2::ReturnCode p9_xip_customize (
uint32_t i_ringBufSize2,
uint32_t& io_bootCoreMask ) // Bits(8:31) = EC00:EC23
{
+#ifndef WIN32
fapi2::ReturnCode l_fapiRc = fapi2::FAPI2_RC_SUCCESS;
fapi2::ReturnCode l_fapiRc2 = fapi2::FAPI2_RC_SUCCESS;
- int l_rc = 0; // Non-fapi RC
-
const fapi2::Target<fapi2::TARGET_TYPE_SYSTEM> FAPI_SYSTEM;
+#else
+ ReturnCode l_fapiRc = fapi2::FAPI2_RC_SUCCESS;
+ ReturnCode l_fapiRc2 = fapi2::FAPI2_RC_SUCCESS;
+#endif
+ int l_rc = 0; // Non-fapi RC
P9XipSection l_xipRingsSection;
uint32_t l_inputImageSize;
@@ -873,16 +918,16 @@ fapi2::ReturnCode p9_xip_customize (
(uintptr_t)i_ringBufSize1,
(uintptr_t)i_ringBufSize2 );
-
FAPI_DBG("Input image size: %d", l_inputImageSize);
-
///////////////////////////////////////////////////////////////////////////
// CUSTOMIZE item: Write mailbox attributes
// System phase: HB_SBE
///////////////////////////////////////////////////////////////////////////
+#ifndef WIN32
+
if (i_sysPhase == SYSPHASE_HB_SBE)
{
FAPI_TRY(writeMboxRegs(i_proc_target, io_image),
@@ -968,6 +1013,8 @@ fapi2::ReturnCode p9_xip_customize (
}
+#endif
+
///////////////////////////////////////////////////////////////////////////
@@ -1062,6 +1109,7 @@ fapi2::ReturnCode p9_xip_customize (
FAPI_DBG("Image size before any VPD updates: %d", l_currentImageSize);
+#ifndef WIN32
// Adjust the local size of MAX_SEEPROM_IMAGE_SIZE to accommodate enlarged image for Cronus
l_fapiRc2 = FAPI_ATTR_GET(fapi2::ATTR_MAX_SBE_SEEPROM_SIZE, FAPI_SYSTEM, attrMaxSbeSeepromSize);
@@ -1095,6 +1143,9 @@ fapi2::ReturnCode p9_xip_customize (
}
FAPI_DBG("Platform adjusted MAX_SEEPROM_IMAGE_SIZE: %d", l_maxImageSize);
+#else
+ l_maxImageSize = MAX_SEEPROM_IMAGE_SIZE;
+#endif
// Make sure current image size isn't already too big for Seeprom
FAPI_ASSERT( l_currentImageSize <= l_maxImageSize,
@@ -1202,6 +1253,8 @@ fapi2::ReturnCode p9_xip_customize (
if (l_fapiRc)
{
+#ifndef WIN32
+
if (l_fapiRc.isRC(RC_XIPC_IMAGE_WOULD_OVERFLOW))
{
FAPI_INF("p9_xip_customize(): Image is full. Ran out of space appending VPD rings"
@@ -1258,6 +1311,9 @@ fapi2::ReturnCode p9_xip_customize (
}
+#else
+ FAPI_INF("fetch_and_insert_vpd_rings returned error rc=0x%08x", l_fapiRc);
+#endif
fapi2::current_err = l_fapiRc;
goto fapi_try_exit;
@@ -1369,6 +1425,7 @@ fapi2::ReturnCode p9_xip_customize (
l_hwRingsSection = (void*)((uintptr_t)io_image + l_xipRingsSection.iv_offset);
+#ifndef WIN32
// Extract the DD level to enable retrieval of correct CME/SGPE ring blocks
l_fapiRc = FAPI_ATTR_GET_PRIVILEGED(fapi2::ATTR_EC, i_proc_target, attrDdLevel);
@@ -1377,6 +1434,9 @@ fapi2::ReturnCode p9_xip_customize (
set_CHIP_TARGET(i_proc_target).
set_OCCURRENCE(1),
"FAPI_ATTR_GET(ATTR_EC) failed." );
+#else
+ attrDdLevel = g_ddLevel;
+#endif
FAPI_DBG("attrDdLevel = 0x%x", attrDdLevel);
@@ -1443,7 +1503,7 @@ fapi2::ReturnCode p9_xip_customize (
if (l_fapiRc)
{
- FAPI_ASSERT( !l_fapiRc.isRC(RC_XIPC_IMAGE_WOULD_OVERFLOW),
+ FAPI_ASSERT( (uint32_t)l_fapiRc != RC_XIPC_IMAGE_WOULD_OVERFLOW,
fapi2::XIPC_IMAGE_WOULD_OVERFLOW_BEFORE_REACHING_MIN_ECS().
set_CHIP_TARGET(i_proc_target).
set_REQUESTED_BOOT_CORE_MASK(l_requestedBootCoreMask).
@@ -1473,6 +1533,7 @@ fapi2::ReturnCode p9_xip_customize (
set_OCCURRENCE(1),
"Caller bug: Caller supplied unsupported value of sysPhase (=%d)",
i_sysPhase );
+
break;
}
diff --git a/src/import/chips/p9/procedures/hwp/customize/p9_xip_customize.H b/src/import/chips/p9/procedures/hwp/customize/p9_xip_customize.H
index 1d9082f56..0b6de8a23 100644
--- a/src/import/chips/p9/procedures/hwp/customize/p9_xip_customize.H
+++ b/src/import/chips/p9/procedures/hwp/customize/p9_xip_customize.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016 */
+/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -25,6 +25,7 @@
#ifndef _P9_XIP_CUSTOMIZE_
#define _P9_XIP_CUSTOMIZE_
+#ifndef WIN32
#include <fapi2.H>
typedef fapi2::ReturnCode (*p9_xip_customize_FP_t) (
@@ -109,4 +110,22 @@ extern "C"
uint32_t& io_bootCoreMask);
}
+#else
+extern "C" {
+ int p9_xip_customize (
+ int& i_proc_target,
+ void* i_image,
+ uint32_t& io_imageSize,
+ void* i_ringSectionBuf,
+ uint32_t& io_ringSectionBufSize,
+ uint8_t i_sysPhase,
+ uint8_t i_modeBuild,
+ void* i_ringBuf1,
+ uint32_t i_ringBufSize1,
+ void* i_ringBuf2,
+ uint32_t i_ringBufSize2,
+ uint32_t& io_bootCoreMask);
+}
+#endif
+
#endif
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"
diff --git a/src/import/chips/p9/xip/p9_xip_image.c b/src/import/chips/p9/xip/p9_xip_image.c
index 32518c7d6..4e11f40f7 100644
--- a/src/import/chips/p9/xip/p9_xip_image.c
+++ b/src/import/chips/p9/xip/p9_xip_image.c
@@ -37,20 +37,19 @@
/// ensure that no memory outside of the putative bounds of the image is ever
/// referenced during validation.
-#ifndef PLIC_MODULE
- #include <stddef.h>
- #include <stdint.h>
- #include <stdlib.h>
- #include <string.h>
-#endif // PLIC_MODULE
-
#include <stddef.h>
-#include <stdint.h>
+#ifdef _WIN32
+ #include "win32_stdint.h"
+ #include "endian.h"
+#else
+ #include <stdint.h>
+ #include <endian.h>
+#endif
#include <stdlib.h>
#include <string.h>
-#include <endian.h>
#include "p9_xip_image.h"
+
////////////////////////////////////////////////////////////////////////////
// Local Functions
////////////////////////////////////////////////////////////////////////////
diff --git a/src/import/chips/p9/xip/p9_xip_image.h b/src/import/chips/p9/xip/p9_xip_image.h
index 70357c8f5..b314cd54b 100644
--- a/src/import/chips/p9/xip/p9_xip_image.h
+++ b/src/import/chips/p9/xip/p9_xip_image.h
@@ -244,8 +244,12 @@ typedef enum {
////////////////////////////////////////////////////////////////////////////
#ifndef __ASSEMBLER__
-#include <stddef.h>
+#ifdef _WIN32
+#include "win32_stdint.h"
+#else
#include <stdint.h>
+#endif
+#include <stddef.h>
#ifdef __cplusplus
extern "C" {
OpenPOWER on IntegriCloud