Partially make EdkModulePkg pass intel IPF compiler with /W4 /WX switched on.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2313 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
xli24
2007-01-25 06:15:58 +00:00
parent 582510249f
commit 1cc8ee7861
123 changed files with 1256 additions and 851 deletions

View File

@@ -136,7 +136,7 @@ CoreProcessFvImageFile (
IN EFI_GUID *DriverName
);
STATIC
VOID
CoreAcquireDispatcherLock (
VOID
@@ -161,6 +161,7 @@ Returns:
CoreAcquireLock (&mDispatcherLock);
}
STATIC
VOID
CoreReleaseDispatcherLock (
VOID
@@ -184,7 +185,7 @@ Returns:
CoreReleaseLock (&mDispatcherLock);
}
STATIC
EFI_STATUS
CoreGetDepexSectionAndPreProccess (
IN EFI_CORE_DRIVER_ENTRY *DriverEntry
@@ -593,7 +594,7 @@ Returns:
}
}
STATIC
BOOLEAN
FvHasBeenProcessed (
IN EFI_HANDLE FvHandle
@@ -628,7 +629,7 @@ Returns:
return FALSE;
}
STATIC
VOID
FvIsBeingProcesssed (
IN EFI_HANDLE FvHandle

View File

@@ -432,7 +432,7 @@ Returns:
break;
default:
return FALSE;
goto Done;
}
//
@@ -445,6 +445,8 @@ Returns:
//
Iterator++;
}
Done:
return FALSE;
}

View File

@@ -96,7 +96,7 @@ Returns:
return EFI_SUCCESS;
}
STATIC
VOID
EFIAPI
GenericArchProtocolNotify (

View File

@@ -87,7 +87,7 @@ UINT32 mEventTable[] = {
EFI_EVENT_TIMER | EFI_EVENT_NOTIFY_WAIT,
};
STATIC
VOID
CoreAcquireEventLock (
VOID
@@ -111,7 +111,7 @@ Returns:
CoreAcquireLock (&gEventQueueLock);
}
STATIC
VOID
CoreReleaseEventLock (
VOID
@@ -232,8 +232,8 @@ Returns:
}
VOID
STATIC
VOID
CoreNotifyEvent (
IN IEVENT *Event
)

View File

@@ -143,7 +143,7 @@ Returns:
}
}
STATIC
BOOLEAN
VerifyHeaderChecksum (
IN EFI_FFS_FILE_HEADER *FfsHeader
@@ -172,7 +172,7 @@ Returns:
HeaderChecksum = (UINT8)(HeaderChecksum + ptr[Index]);
}
HeaderChecksum = HeaderChecksum - FfsHeader->State - FfsHeader->IntegrityCheck.Checksum.File;
HeaderChecksum = (UINT8) (HeaderChecksum - FfsHeader->State - FfsHeader->IntegrityCheck.Checksum.File);
if (HeaderChecksum == 0) {
return TRUE;

View File

@@ -61,7 +61,7 @@ EFI_GCD_MAP_ENTRY mGcdMemorySpaceMapEntryTemplate = {
0,
0,
EfiGcdMemoryTypeNonExistent,
0,
(EFI_GCD_IO_TYPE) 0,
NULL,
NULL
};
@@ -73,7 +73,7 @@ EFI_GCD_MAP_ENTRY mGcdIoSpaceMapEntryTemplate = {
0,
0,
0,
0,
(EFI_GCD_MEMORY_TYPE) 0,
EfiGcdIoTypeNonExistent,
NULL,
NULL
@@ -136,7 +136,7 @@ Returns:
}
STATIC
VOID
CoreAcquireGcdIoLock (
VOID
@@ -157,7 +157,7 @@ Returns:
CoreAcquireLock (&mGcdIoSpaceLock);
}
STATIC
VOID
CoreReleaseGcdIoLock (
VOID
@@ -183,6 +183,7 @@ Returns:
//
// GCD Initialization Worker Functions
//
STATIC
UINT64
AlignValue (
IN UINT64 Value,
@@ -217,6 +218,7 @@ Returns:
return Value & (~AlignmentMask);
}
STATIC
UINT64
PageAlignAddress (
IN UINT64 Value
@@ -240,6 +242,7 @@ Returns:
return AlignValue (Value, EFI_PAGE_SHIFT, TRUE);
}
STATIC
UINT64
PageAlignLength (
IN UINT64 Value
@@ -266,6 +269,7 @@ Returns:
//
// GCD Memory Space Worker Functions
//
STATIC
EFI_STATUS
CoreAllocateGcdMapEntry (
IN OUT EFI_GCD_MAP_ENTRY **TopEntry,
@@ -303,6 +307,7 @@ Returns:
return EFI_SUCCESS;
}
STATIC
EFI_STATUS
CoreInsertGcdMapEntry (
IN LIST_ENTRY *Link,
@@ -359,6 +364,7 @@ Returns:
return EFI_SUCCESS;
}
STATIC
EFI_STATUS
CoreMergeGcdMapEntry (
IN LIST_ENTRY *Link,
@@ -440,6 +446,7 @@ Returns:
return EFI_SUCCESS;
}
STATIC
EFI_STATUS
CoreCleanupGcdMapEntry (
IN EFI_GCD_MAP_ENTRY *TopEntry,
@@ -491,6 +498,7 @@ Returns:
return EFI_SUCCESS;
}
STATIC
EFI_STATUS
CoreSearchGcdMapEntry (
IN EFI_PHYSICAL_ADDRESS BaseAddress,
@@ -551,6 +559,7 @@ Returns:
return EFI_NOT_FOUND;
}
STATIC
UINTN
CoreCountGcdMapEntry (
IN LIST_ENTRY *Map
@@ -584,7 +593,7 @@ Returns:
}
STATIC
UINT64
ConverToCpuArchAttributes (
UINT64 Attributes
@@ -629,7 +638,7 @@ Returns:
}
STATIC
EFI_STATUS
CoreConvertSpace (
IN UINTN Operation,
@@ -897,6 +906,7 @@ Done:
return Status;
}
STATIC
EFI_STATUS
CoreAllocateSpaceCheckEntry (
IN UINTN Operation,
@@ -950,6 +960,7 @@ Returns:
return EFI_SUCCESS;
}
STATIC
EFI_STATUS
CoreAllocateSpace (
IN UINTN Operation,
@@ -1218,7 +1229,7 @@ Done:
return Status;
}
STATIC
EFI_STATUS
CoreInternalAddMemorySpace (
IN EFI_GCD_MEMORY_TYPE GcdMemoryType,
@@ -1257,7 +1268,7 @@ Returns:
return EFI_INVALID_PARAMETER;
}
return CoreConvertSpace (GCD_ADD_MEMORY_OPERATION, GcdMemoryType, 0, BaseAddress, Length, Capabilities, 0);
return CoreConvertSpace (GCD_ADD_MEMORY_OPERATION, GcdMemoryType, (EFI_GCD_IO_TYPE) 0, BaseAddress, Length, Capabilities, 0);
}
//
@@ -1310,7 +1321,7 @@ Returns:
GCD_ALLOCATE_MEMORY_OPERATION,
GcdAllocateType,
GcdMemoryType,
0,
(EFI_GCD_IO_TYPE) 0,
Alignment,
Length,
BaseAddress,
@@ -1427,7 +1438,7 @@ Returns:
--*/
{
return CoreConvertSpace (GCD_FREE_MEMORY_OPERATION, 0, 0, BaseAddress, Length, 0, 0);
return CoreConvertSpace (GCD_FREE_MEMORY_OPERATION, (EFI_GCD_MEMORY_TYPE) 0, (EFI_GCD_IO_TYPE) 0, BaseAddress, Length, 0, 0);
}
EFI_STATUS
@@ -1454,9 +1465,10 @@ Returns:
--*/
{
return CoreConvertSpace (GCD_REMOVE_MEMORY_OPERATION, 0, 0, BaseAddress, Length, 0, 0);
return CoreConvertSpace (GCD_REMOVE_MEMORY_OPERATION, (EFI_GCD_MEMORY_TYPE) 0, (EFI_GCD_IO_TYPE) 0, BaseAddress, Length, 0, 0);
}
STATIC
VOID
BuildMemoryDescriptor (
IN OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR *Descriptor,
@@ -1574,7 +1586,7 @@ Returns:
--*/
{
return CoreConvertSpace (GCD_SET_ATTRIBUTES_MEMORY_OPERATION, 0, 0, BaseAddress, Length, 0, Attributes);
return CoreConvertSpace (GCD_SET_ATTRIBUTES_MEMORY_OPERATION, (EFI_GCD_MEMORY_TYPE) 0, (EFI_GCD_IO_TYPE) 0, BaseAddress, Length, 0, Attributes);
}
EFI_STATUS
@@ -1687,7 +1699,7 @@ Returns:
if (GcdIoType <= EfiGcdIoTypeNonExistent || GcdIoType >= EfiGcdIoTypeMaximum) {
return EFI_INVALID_PARAMETER;
}
return CoreConvertSpace (GCD_ADD_IO_OPERATION, 0, GcdIoType, BaseAddress, Length, 0, 0);
return CoreConvertSpace (GCD_ADD_IO_OPERATION, (EFI_GCD_MEMORY_TYPE) 0, GcdIoType, BaseAddress, Length, 0, 0);
}
EFI_STATUS
@@ -1736,7 +1748,7 @@ Returns:
return CoreAllocateSpace (
GCD_ALLOCATE_IO_OPERATION,
GcdAllocateType,
0,
(EFI_GCD_MEMORY_TYPE) 0,
GcdIoType,
Alignment,
Length,
@@ -1770,7 +1782,7 @@ Returns:
--*/
{
return CoreConvertSpace (GCD_FREE_IO_OPERATION, 0, 0, BaseAddress, Length, 0, 0);
return CoreConvertSpace (GCD_FREE_IO_OPERATION, (EFI_GCD_MEMORY_TYPE) 0, (EFI_GCD_IO_TYPE) 0, BaseAddress, Length, 0, 0);
}
EFI_STATUS
@@ -1797,9 +1809,10 @@ Returns:
--*/
{
return CoreConvertSpace (GCD_REMOVE_IO_OPERATION, 0, 0, BaseAddress, Length, 0, 0);
return CoreConvertSpace (GCD_REMOVE_IO_OPERATION, (EFI_GCD_MEMORY_TYPE) 0, (EFI_GCD_IO_TYPE) 0, BaseAddress, Length, 0, 0);
}
STATIC
VOID
BuildIoDescriptor (
IN EFI_GCD_IO_SPACE_DESCRIPTOR *Descriptor,
@@ -1964,6 +1977,7 @@ Done:
return Status;
}
STATIC
UINT64
CoreConvertResourceDescriptorHobAttributesToCapabilities (
EFI_GCD_MEMORY_TYPE GcdMemoryType,

View File

@@ -149,6 +149,7 @@ Returns:
return ReturnStatus;
}
STATIC
VOID
AddSortedDriverBindingProtocol (
IN EFI_HANDLE DriverBindingHandle,
@@ -265,8 +266,6 @@ Returns:
EFI_STATUS Status;
UINTN Index;
EFI_HANDLE DriverImageHandle;
UINTN PlatformDriverOverrideHandleCount;
EFI_HANDLE *PlatformDriverOverrideHandleBuffer;
EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL *PlatformDriverOverride;
EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL *BusSpecificDriverOverride;
UINTN DriverBindingHandleCount;
@@ -290,8 +289,6 @@ Returns:
//
DriverBindingHandleCount = 0;
DriverBindingHandleBuffer = NULL;
PlatformDriverOverrideHandleCount = 0;
PlatformDriverOverrideHandleBuffer = NULL;
NumberOfSortedDriverBindingProtocols = 0;
SortedDriverBindingProtocols = NULL;

View File

@@ -978,6 +978,7 @@ Returns:
return Status;
}
STATIC
PROTOCOL_INTERFACE *
CoreGetProtocolInterface (
IN EFI_HANDLE UserHandle,

View File

@@ -254,7 +254,7 @@ Returns:
if (Image->ImageContext.ImageAddress >= 0x100000 || Image->ImageContext.RelocationsStripped) {
Status = CoreAllocatePages (
AllocateAddress,
Image->ImageContext.ImageCodeMemoryType,
(EFI_MEMORY_TYPE) (Image->ImageContext.ImageCodeMemoryType),
Image->NumberOfPages,
&Image->ImageContext.ImageAddress
);
@@ -262,7 +262,7 @@ Returns:
if (EFI_ERROR (Status) && !Image->ImageContext.RelocationsStripped) {
Status = CoreAllocatePages (
AllocateAnyPages,
Image->ImageContext.ImageCodeMemoryType,
(EFI_MEMORY_TYPE) (Image->ImageContext.ImageCodeMemoryType),
Image->NumberOfPages,
&Image->ImageContext.ImageAddress
);
@@ -389,8 +389,8 @@ Returns:
Image->Type = Image->ImageContext.ImageType;
Image->Info.ImageBase = (VOID *)(UINTN)Image->ImageContext.ImageAddress;
Image->Info.ImageSize = Image->ImageContext.ImageSize;
Image->Info.ImageCodeType = Image->ImageContext.ImageCodeMemoryType;
Image->Info.ImageDataType = Image->ImageContext.ImageDataMemoryType;
Image->Info.ImageCodeType = (EFI_MEMORY_TYPE) (Image->ImageContext.ImageCodeMemoryType);
Image->Info.ImageDataType = (EFI_MEMORY_TYPE) (Image->ImageContext.ImageDataMemoryType);
if (Attribute & EFI_LOAD_PE_IMAGE_ATTRIBUTE_RUNTIME_REGISTRATION) {
if (Image->ImageContext.ImageType == EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER) {
//
@@ -514,7 +514,7 @@ Returns:
return Image;
}
STATIC
EFI_STATUS
CoreLoadImageCommon (
IN BOOLEAN BootPolicy,

View File

@@ -308,7 +308,7 @@ Returns:
//
// Make sure the memory type in the gMemoryTypeInformation[] array is valid
//
Type = gMemoryTypeInformation[Index].Type;
Type = (EFI_MEMORY_TYPE) (gMemoryTypeInformation[Index].Type);
if (Type < 0 || Type > EfiMaxMemoryType) {
continue;
}
@@ -333,7 +333,7 @@ Returns:
//
// Make sure the memory type in the gMemoryTypeInformation[] array is valid
//
Type = gMemoryTypeInformation[FreeIndex].Type;
Type = (EFI_MEMORY_TYPE) (gMemoryTypeInformation[FreeIndex].Type);
if (Type < 0 || Type > EfiMaxMemoryType) {
continue;
}
@@ -376,7 +376,7 @@ Returns:
//
// Make sure the memory type in the gMemoryTypeInformation[] array is valid
//
Type = gMemoryTypeInformation[Index].Type;
Type = (EFI_MEMORY_TYPE) (gMemoryTypeInformation[Index].Type);
if (Type < 0 || Type > EfiMaxMemoryType) {
continue;
}
@@ -394,7 +394,7 @@ Returns:
// If the number of pages reserved for a memory type is 0, then all allocations for that type
// should be in the default range.
//
for (Type = 0; Type < EfiMaxMemoryType; Type++) {
for (Type = (EFI_MEMORY_TYPE) 0; Type < EfiMaxMemoryType; Type++) {
for (Index = 0; gMemoryTypeInformation[Index].Type != EfiMaxMemoryType; Index++) {
if (Type == (EFI_MEMORY_TYPE)gMemoryTypeInformation[Index].Type) {
mMemoryTypeStatistics[Type].InformationIndex = Index;
@@ -1457,7 +1457,6 @@ Returns:
--*/
{
EFI_STATUS Status;
UINT64 Start;
//
@@ -1471,7 +1470,7 @@ Returns:
if (Start == 0) {
DEBUG ((EFI_D_ERROR | EFI_D_PAGE, "AllocatePoolPages: failed to allocate %d pages\n", NumberOfPages));
} else {
Status = CoreConvertPages (Start, NumberOfPages, PoolType);
CoreConvertPages (Start, NumberOfPages, PoolType);
}
return (VOID *)(UINTN)Start;

View File

@@ -111,7 +111,7 @@ Returns:
for (Type=0; Type < EfiMaxMemoryType; Type++) {
PoolHead[Type].Signature = 0;
PoolHead[Type].Used = 0;
PoolHead[Type].MemoryType = Type;
PoolHead[Type].MemoryType = (EFI_MEMORY_TYPE) Type;
for (Index=0; Index < MAX_POOL_LIST; Index++) {
InitializeListHead (&PoolHead[Type].FreeList[Index]);
}
@@ -119,7 +119,7 @@ Returns:
InitializeListHead (&PoolHeadList);
}
STATIC
POOL *
LookupPoolHead (
IN EFI_MEMORY_TYPE MemoryType