diff options
author | xli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-02-02 02:50:13 +0000 |
---|---|---|
committer | xli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-02-02 02:50:13 +0000 |
commit | 3401c092e4e98b97bcf86d9aa2500d5ee7b3b8cf (patch) | |
tree | 11694e4fd270c6594b3ae0fa54a173a5346af3a1 /EdkModulePkg | |
parent | db6efc11d350c27308e6e08d542f3f6ef17cd64f (diff) | |
download | edk2-platforms-3401c092e4e98b97bcf86d9aa2500d5ee7b3b8cf.tar.xz |
Make EDK Module Package pass Intel IPF compiler with /Ox switch.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2346 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkModulePkg')
-rw-r--r-- | EdkModulePkg/Bus/Pci/Undi/RuntimeDxe/E100b.c | 2 | ||||
-rw-r--r-- | EdkModulePkg/Core/DxeIplPeim/Ipf/ImageRead.c | 2 | ||||
-rw-r--r-- | EdkModulePkg/Universal/Ebc/Dxe/EbcExecute.c | 2 | ||||
-rw-r--r-- | EdkModulePkg/Universal/PCD/Pei/Pcd.c | 127 | ||||
-rw-r--r-- | EdkModulePkg/Universal/PCD/Pei/Service.c | 135 | ||||
-rw-r--r-- | EdkModulePkg/Universal/PCD/Pei/Service.h | 13 |
6 files changed, 144 insertions, 137 deletions
diff --git a/EdkModulePkg/Bus/Pci/Undi/RuntimeDxe/E100b.c b/EdkModulePkg/Bus/Pci/Undi/RuntimeDxe/E100b.c index ed396fd342..bca0add42c 100644 --- a/EdkModulePkg/Bus/Pci/Undi/RuntimeDxe/E100b.c +++ b/EdkModulePkg/Bus/Pci/Undi/RuntimeDxe/E100b.c @@ -581,7 +581,7 @@ Returns: //
TxCB *cmd_ptr;
UINT8 *data_ptr;
- INT16 Index;
+ volatile INT16 Index;
UINT8 my_filter;
cmd_ptr = GetFreeCB (AdapterInfo);
diff --git a/EdkModulePkg/Core/DxeIplPeim/Ipf/ImageRead.c b/EdkModulePkg/Core/DxeIplPeim/Ipf/ImageRead.c index 3131533b2a..b04c9a7e1b 100644 --- a/EdkModulePkg/Core/DxeIplPeim/Ipf/ImageRead.c +++ b/EdkModulePkg/Core/DxeIplPeim/Ipf/ImageRead.c @@ -50,7 +50,7 @@ Returns: {
CHAR8 *Destination8;
CHAR8 *Source8;
- UINTN Length;
+ volatile UINTN Length;
Destination8 = Buffer;
Source8 = (CHAR8 *) ((UINTN) FileHandle + FileOffset);
diff --git a/EdkModulePkg/Universal/Ebc/Dxe/EbcExecute.c b/EdkModulePkg/Universal/Ebc/Dxe/EbcExecute.c index 5e6b3e3a8f..4b020cb6da 100644 --- a/EdkModulePkg/Universal/Ebc/Dxe/EbcExecute.c +++ b/EdkModulePkg/Universal/Ebc/Dxe/EbcExecute.c @@ -4541,7 +4541,7 @@ Returns: --*/
{
UINTN Data;
- UINT32 Size;
+ volatile UINT32 Size;
UINT8 *FromPtr;
UINT8 *ToPtr;
//
diff --git a/EdkModulePkg/Universal/PCD/Pei/Pcd.c b/EdkModulePkg/Universal/PCD/Pei/Pcd.c index b8ed5b2119..daaba4b539 100644 --- a/EdkModulePkg/Universal/PCD/Pei/Pcd.c +++ b/EdkModulePkg/Universal/PCD/Pei/Pcd.c @@ -667,3 +667,130 @@ PeiPcdGetNextTokenSpace ( }
+UINTN
+GetPtrTypeSize (
+ IN UINTN LocalTokenNumberTableIdx,
+ OUT UINTN *MaxSize,
+ IN PEI_PCD_DATABASE *Database
+ )
+{
+ INTN SizeTableIdx;
+ UINTN LocalTokenNumber;
+ SKU_ID *SkuIdTable;
+ SIZE_INFO *SizeTable;
+ UINTN i;
+
+ SizeTableIdx = GetSizeTableIndex (LocalTokenNumberTableIdx, Database);
+
+ LocalTokenNumber = Database->Init.LocalTokenNumberTable[LocalTokenNumberTableIdx];
+
+ ASSERT ((LocalTokenNumber & PCD_DATUM_TYPE_ALL_SET) == PCD_DATUM_TYPE_POINTER);
+
+ SizeTable = Database->Init.SizeTable;
+
+ *MaxSize = SizeTable[SizeTableIdx];
+ //
+ // SizeTable only contain record for PCD_DATUM_TYPE_POINTER type
+ // PCD entry.
+ //
+ if (LocalTokenNumber & PCD_TYPE_VPD) {
+ //
+ // We have only one entry for VPD enabled PCD entry:
+ // 1) MAX Size.
+ // We consider current size is equal to MAX size.
+ //
+ return *MaxSize;
+ } else {
+ if ((LocalTokenNumber & PCD_TYPE_SKU_ENABLED) == 0) {
+ //
+ // We have only two entry for Non-Sku enabled PCD entry:
+ // 1) MAX SIZE
+ // 2) Current Size
+ //
+ return SizeTable[SizeTableIdx + 1];
+ } else {
+ //
+ // We have these entry for SKU enabled PCD entry
+ // 1) MAX SIZE
+ // 2) Current Size for each SKU_ID (It is equal to MaxSku).
+ //
+ SkuIdTable = GetSkuIdArray (LocalTokenNumberTableIdx, Database);
+ for (i = 0; i < SkuIdTable[0]; i++) {
+ if (SkuIdTable[1 + i] == Database->Init.SystemSkuId) {
+ return SizeTable[SizeTableIdx + 1 + i];
+ }
+ }
+ return SizeTable[SizeTableIdx + 1];
+ }
+ }
+}
+
+
+
+BOOLEAN
+SetPtrTypeSize (
+ IN UINTN LocalTokenNumberTableIdx,
+ IN OUT UINTN *CurrentSize,
+ IN PEI_PCD_DATABASE *Database
+ )
+{
+ INTN SizeTableIdx;
+ UINTN LocalTokenNumber;
+ SKU_ID *SkuIdTable;
+ SIZE_INFO *SizeTable;
+ UINTN i;
+ UINTN MaxSize;
+
+ SizeTableIdx = GetSizeTableIndex (LocalTokenNumberTableIdx, Database);
+
+ LocalTokenNumber = Database->Init.LocalTokenNumberTable[LocalTokenNumberTableIdx];
+
+ ASSERT ((LocalTokenNumber & PCD_DATUM_TYPE_ALL_SET) == PCD_DATUM_TYPE_POINTER);
+
+ SizeTable = Database->Init.SizeTable;
+
+ MaxSize = SizeTable[SizeTableIdx];
+ //
+ // SizeTable only contain record for PCD_DATUM_TYPE_POINTER type
+ // PCD entry.
+ //
+ if (LocalTokenNumber & PCD_TYPE_VPD) {
+ //
+ // We shouldn't come here as we don't support SET for VPD
+ //
+ ASSERT (FALSE);
+ return FALSE;
+ } else {
+ if ((*CurrentSize > MaxSize) ||
+ (*CurrentSize == MAX_ADDRESS)) {
+ *CurrentSize = MaxSize;
+ return FALSE;
+ }
+
+ if ((LocalTokenNumber & PCD_TYPE_SKU_ENABLED) == 0) {
+ //
+ // We have only two entry for Non-Sku enabled PCD entry:
+ // 1) MAX SIZE
+ // 2) Current Size
+ //
+ SizeTable[SizeTableIdx + 1] = (SIZE_INFO) *CurrentSize;
+ return TRUE;
+ } else {
+ //
+ // We have these entry for SKU enabled PCD entry
+ // 1) MAX SIZE
+ // 2) Current Size for each SKU_ID (It is equal to MaxSku).
+ //
+ SkuIdTable = GetSkuIdArray (LocalTokenNumberTableIdx, Database);
+ for (i = 0; i < SkuIdTable[0]; i++) {
+ if (SkuIdTable[1 + i] == Database->Init.SystemSkuId) {
+ SizeTable[SizeTableIdx + 1 + i] = (SIZE_INFO) *CurrentSize;
+ return TRUE;
+ }
+ }
+ SizeTable[SizeTableIdx + 1] = (SIZE_INFO) *CurrentSize;
+ return TRUE;
+ }
+ }
+
+}
diff --git a/EdkModulePkg/Universal/PCD/Pei/Service.c b/EdkModulePkg/Universal/PCD/Pei/Service.c index c228d3b383..e705c283cb 100644 --- a/EdkModulePkg/Universal/PCD/Pei/Service.c +++ b/EdkModulePkg/Universal/PCD/Pei/Service.c @@ -652,7 +652,7 @@ GetPcdDatabase ( }
-STATIC
+
SKU_ID *
GetSkuIdArray (
IN UINTN LocalTokenNumberTableIdx,
@@ -673,7 +673,7 @@ GetSkuIdArray ( }
-STATIC
+
UINTN
GetSizeTableIndex (
IN UINTN LocalTokenNumberTableIdx,
@@ -726,134 +726,3 @@ GetSizeTableIndex ( return SizeTableIdx;
}
-
-
-
-
-UINTN
-GetPtrTypeSize (
- IN UINTN LocalTokenNumberTableIdx,
- OUT UINTN *MaxSize,
- IN PEI_PCD_DATABASE *Database
- )
-{
- INTN SizeTableIdx;
- UINTN LocalTokenNumber;
- SKU_ID *SkuIdTable;
- SIZE_INFO *SizeTable;
- UINTN i;
-
- SizeTableIdx = GetSizeTableIndex (LocalTokenNumberTableIdx, Database);
-
- LocalTokenNumber = Database->Init.LocalTokenNumberTable[LocalTokenNumberTableIdx];
-
- ASSERT ((LocalTokenNumber & PCD_DATUM_TYPE_ALL_SET) == PCD_DATUM_TYPE_POINTER);
-
- SizeTable = Database->Init.SizeTable;
-
- *MaxSize = SizeTable[SizeTableIdx];
- //
- // SizeTable only contain record for PCD_DATUM_TYPE_POINTER type
- // PCD entry.
- //
- if (LocalTokenNumber & PCD_TYPE_VPD) {
- //
- // We have only one entry for VPD enabled PCD entry:
- // 1) MAX Size.
- // We consider current size is equal to MAX size.
- //
- return *MaxSize;
- } else {
- if ((LocalTokenNumber & PCD_TYPE_SKU_ENABLED) == 0) {
- //
- // We have only two entry for Non-Sku enabled PCD entry:
- // 1) MAX SIZE
- // 2) Current Size
- //
- return SizeTable[SizeTableIdx + 1];
- } else {
- //
- // We have these entry for SKU enabled PCD entry
- // 1) MAX SIZE
- // 2) Current Size for each SKU_ID (It is equal to MaxSku).
- //
- SkuIdTable = GetSkuIdArray (LocalTokenNumberTableIdx, Database);
- for (i = 0; i < SkuIdTable[0]; i++) {
- if (SkuIdTable[1 + i] == Database->Init.SystemSkuId) {
- return SizeTable[SizeTableIdx + 1 + i];
- }
- }
- return SizeTable[SizeTableIdx + 1];
- }
- }
-}
-
-
-
-BOOLEAN
-SetPtrTypeSize (
- IN UINTN LocalTokenNumberTableIdx,
- IN OUT UINTN *CurrentSize,
- IN PEI_PCD_DATABASE *Database
- )
-{
- INTN SizeTableIdx;
- UINTN LocalTokenNumber;
- SKU_ID *SkuIdTable;
- SIZE_INFO *SizeTable;
- UINTN i;
- UINTN MaxSize;
-
- SizeTableIdx = GetSizeTableIndex (LocalTokenNumberTableIdx, Database);
-
- LocalTokenNumber = Database->Init.LocalTokenNumberTable[LocalTokenNumberTableIdx];
-
- ASSERT ((LocalTokenNumber & PCD_DATUM_TYPE_ALL_SET) == PCD_DATUM_TYPE_POINTER);
-
- SizeTable = Database->Init.SizeTable;
-
- MaxSize = SizeTable[SizeTableIdx];
- //
- // SizeTable only contain record for PCD_DATUM_TYPE_POINTER type
- // PCD entry.
- //
- if (LocalTokenNumber & PCD_TYPE_VPD) {
- //
- // We shouldn't come here as we don't support SET for VPD
- //
- ASSERT (FALSE);
- return FALSE;
- } else {
- if ((*CurrentSize > MaxSize) ||
- (*CurrentSize == MAX_ADDRESS)) {
- *CurrentSize = MaxSize;
- return FALSE;
- }
-
- if ((LocalTokenNumber & PCD_TYPE_SKU_ENABLED) == 0) {
- //
- // We have only two entry for Non-Sku enabled PCD entry:
- // 1) MAX SIZE
- // 2) Current Size
- //
- SizeTable[SizeTableIdx + 1] = (SIZE_INFO) *CurrentSize;
- return TRUE;
- } else {
- //
- // We have these entry for SKU enabled PCD entry
- // 1) MAX SIZE
- // 2) Current Size for each SKU_ID (It is equal to MaxSku).
- //
- SkuIdTable = GetSkuIdArray (LocalTokenNumberTableIdx, Database);
- for (i = 0; i < SkuIdTable[0]; i++) {
- if (SkuIdTable[1 + i] == Database->Init.SystemSkuId) {
- SizeTable[SizeTableIdx + 1 + i] = (SIZE_INFO) *CurrentSize;
- return TRUE;
- }
- }
- SizeTable[SizeTableIdx + 1] = (SIZE_INFO) *CurrentSize;
- return TRUE;
- }
- }
-
-}
diff --git a/EdkModulePkg/Universal/PCD/Pei/Service.h b/EdkModulePkg/Universal/PCD/Pei/Service.h index 674197b0cf..093c37149c 100644 --- a/EdkModulePkg/Universal/PCD/Pei/Service.h +++ b/EdkModulePkg/Universal/PCD/Pei/Service.h @@ -415,8 +415,19 @@ BuildPcdDatabase ( )
;
+SKU_ID *
+GetSkuIdArray (
+ IN UINTN LocalTokenNumberTableIdx,
+ IN PEI_PCD_DATABASE *Database
+ )
+;
-
+UINTN
+GetSizeTableIndex (
+ IN UINTN LocalTokenNumberTableIdx,
+ IN PEI_PCD_DATABASE *Database
+ )
+;
UINTN
GetPtrTypeSize (
|