mirror of https://github.com/acidanthera/audk.git
ArmPkg: Fixed unsigned type to be architecture independent
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14181 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
2614b0c474
commit
c63626b7d3
|
@ -189,7 +189,7 @@ LinuxLoaderConfig (
|
||||||
Print (L"[%d] Update Linux Boot Entry\n",LINUX_LOADER_UPDATE);
|
Print (L"[%d] Update Linux Boot Entry\n",LINUX_LOADER_UPDATE);
|
||||||
|
|
||||||
Print (L"Option: ");
|
Print (L"Option: ");
|
||||||
Status = GetHIInputInteger (&Choice);
|
Status = GetHIInputInteger ((UINTN*)&Choice);
|
||||||
if (Status == EFI_INVALID_PARAMETER) {
|
if (Status == EFI_INVALID_PARAMETER) {
|
||||||
Print (L"\n");
|
Print (L"\n");
|
||||||
return Status;
|
return Status;
|
||||||
|
@ -268,7 +268,7 @@ LinuxLoaderConfig (
|
||||||
|
|
||||||
do {
|
do {
|
||||||
Print (L"Update Boot Entry: ");
|
Print (L"Update Boot Entry: ");
|
||||||
Status = GetHIInputInteger (&Choice);
|
Status = GetHIInputInteger ((UINTN*)&Choice);
|
||||||
if (Status == EFI_INVALID_PARAMETER) {
|
if (Status == EFI_INVALID_PARAMETER) {
|
||||||
Print (L"\n");
|
Print (L"\n");
|
||||||
return Status;
|
return Status;
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
Support a Semi Host file system over a debuggers JTAG
|
Support a Semi Host file system over a debuggers JTAG
|
||||||
|
|
||||||
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
||||||
|
Portions copyright (c) 2011, 2012, ARM Ltd. All rights reserved.<BR>
|
||||||
|
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -73,7 +74,7 @@ typedef struct {
|
||||||
EFI_FILE File;
|
EFI_FILE File;
|
||||||
CHAR8 *FileName;
|
CHAR8 *FileName;
|
||||||
UINT32 Position;
|
UINT32 Position;
|
||||||
UINT32 SemihostHandle;
|
UINTN SemihostHandle;
|
||||||
BOOLEAN IsRoot;
|
BOOLEAN IsRoot;
|
||||||
} SEMIHOST_FCB;
|
} SEMIHOST_FCB;
|
||||||
|
|
||||||
|
@ -152,7 +153,7 @@ FileOpen (
|
||||||
{
|
{
|
||||||
SEMIHOST_FCB *FileFcb = NULL;
|
SEMIHOST_FCB *FileFcb = NULL;
|
||||||
EFI_STATUS Status = EFI_SUCCESS;
|
EFI_STATUS Status = EFI_SUCCESS;
|
||||||
UINT32 SemihostHandle;
|
UINTN SemihostHandle;
|
||||||
CHAR8 *AsciiFileName;
|
CHAR8 *AsciiFileName;
|
||||||
CHAR8 *AsciiPtr;
|
CHAR8 *AsciiPtr;
|
||||||
UINTN Length;
|
UINTN Length;
|
||||||
|
@ -360,7 +361,7 @@ FileSetPosition (
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
SEMIHOST_FCB *Fcb = NULL;
|
SEMIHOST_FCB *Fcb = NULL;
|
||||||
UINT32 Length;
|
UINTN Length;
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
|
||||||
Fcb = SEMIHOST_FCB_FROM_THIS(File);
|
Fcb = SEMIHOST_FCB_FROM_THIS(File);
|
||||||
|
@ -395,7 +396,7 @@ GetFileInfo (
|
||||||
UINTN NameSize = 0;
|
UINTN NameSize = 0;
|
||||||
UINTN ResultSize;
|
UINTN ResultSize;
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
UINT32 Length;
|
UINTN Length;
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
|
||||||
if (Fcb->IsRoot == TRUE) {
|
if (Fcb->IsRoot == TRUE) {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
||||||
|
Portions copyright (c) 2011, 2012, ARM Ltd. All rights reserved.<BR>
|
||||||
|
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
|
@ -38,38 +39,38 @@ RETURN_STATUS
|
||||||
SemihostFileOpen (
|
SemihostFileOpen (
|
||||||
IN CHAR8 *FileName,
|
IN CHAR8 *FileName,
|
||||||
IN UINT32 Mode,
|
IN UINT32 Mode,
|
||||||
OUT UINT32 *FileHandle
|
OUT UINTN *FileHandle
|
||||||
);
|
);
|
||||||
|
|
||||||
RETURN_STATUS
|
RETURN_STATUS
|
||||||
SemihostFileSeek (
|
SemihostFileSeek (
|
||||||
IN UINT32 FileHandle,
|
IN UINTN FileHandle,
|
||||||
IN UINT32 Offset
|
IN UINTN Offset
|
||||||
);
|
);
|
||||||
|
|
||||||
RETURN_STATUS
|
RETURN_STATUS
|
||||||
SemihostFileRead (
|
SemihostFileRead (
|
||||||
IN UINT32 FileHandle,
|
IN UINTN FileHandle,
|
||||||
IN OUT UINT32 *Length,
|
IN OUT UINTN *Length,
|
||||||
OUT VOID *Buffer
|
OUT VOID *Buffer
|
||||||
);
|
);
|
||||||
|
|
||||||
RETURN_STATUS
|
RETURN_STATUS
|
||||||
SemihostFileWrite (
|
SemihostFileWrite (
|
||||||
IN UINT32 FileHandle,
|
IN UINTN FileHandle,
|
||||||
IN OUT UINT32 *Length,
|
IN OUT UINTN *Length,
|
||||||
IN VOID *Buffer
|
IN VOID *Buffer
|
||||||
);
|
);
|
||||||
|
|
||||||
RETURN_STATUS
|
RETURN_STATUS
|
||||||
SemihostFileClose (
|
SemihostFileClose (
|
||||||
IN UINT32 FileHandle
|
IN UINTN FileHandle
|
||||||
);
|
);
|
||||||
|
|
||||||
RETURN_STATUS
|
RETURN_STATUS
|
||||||
SemihostFileLength (
|
SemihostFileLength (
|
||||||
IN UINT32 FileHandle,
|
IN UINTN FileHandle,
|
||||||
OUT UINT32 *Length
|
OUT UINTN *Length
|
||||||
);
|
);
|
||||||
|
|
||||||
RETURN_STATUS
|
RETURN_STATUS
|
||||||
|
|
|
@ -170,7 +170,7 @@ PrepareFdt (
|
||||||
IN EFI_PHYSICAL_ADDRESS InitrdImage,
|
IN EFI_PHYSICAL_ADDRESS InitrdImage,
|
||||||
IN UINTN InitrdImageSize,
|
IN UINTN InitrdImageSize,
|
||||||
IN OUT EFI_PHYSICAL_ADDRESS *FdtBlobBase,
|
IN OUT EFI_PHYSICAL_ADDRESS *FdtBlobBase,
|
||||||
IN OUT UINT32 *FdtBlobSize
|
IN OUT UINTN *FdtBlobSize
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
|
|
@ -150,7 +150,7 @@ PrepareFdt (
|
||||||
IN EFI_PHYSICAL_ADDRESS InitrdImage,
|
IN EFI_PHYSICAL_ADDRESS InitrdImage,
|
||||||
IN UINTN InitrdImageSize,
|
IN UINTN InitrdImageSize,
|
||||||
IN OUT EFI_PHYSICAL_ADDRESS *FdtBlobBase,
|
IN OUT EFI_PHYSICAL_ADDRESS *FdtBlobBase,
|
||||||
IN OUT UINT32 *FdtBlobSize
|
IN OUT UINTN *FdtBlobSize
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -221,7 +221,7 @@ GetImageContext (
|
||||||
ImageContext->ImageRead = PeCoffLoaderImageReadFromMemory;
|
ImageContext->ImageRead = PeCoffLoaderImageReadFromMemory;
|
||||||
|
|
||||||
Status = PeCoffLoaderGetImageInfo (ImageContext);
|
Status = PeCoffLoaderGetImageInfo (ImageContext);
|
||||||
if (!EFI_ERROR(Status) && ((VOID*)ImageContext->DebugDirectoryEntryRva != NULL)) {
|
if (!EFI_ERROR(Status) && ((VOID*)(UINTN)ImageContext->DebugDirectoryEntryRva != NULL)) {
|
||||||
ImageAddress = ImageContext->ImageAddress;
|
ImageAddress = ImageContext->ImageAddress;
|
||||||
if (ImageContext->IsTeImage) {
|
if (ImageContext->IsTeImage) {
|
||||||
ImageAddress += sizeof (EFI_TE_IMAGE_HEADER) - ((EFI_TE_IMAGE_HEADER*)EfiImage)->StrippedSize;
|
ImageAddress += sizeof (EFI_TE_IMAGE_HEADER) - ((EFI_TE_IMAGE_HEADER*)EfiImage)->StrippedSize;
|
||||||
|
@ -285,8 +285,8 @@ InitializeDebugAgent (
|
||||||
|
|
||||||
// Now we've got UART, make the check:
|
// Now we've got UART, make the check:
|
||||||
// - The Vector table must be 32-byte aligned
|
// - The Vector table must be 32-byte aligned
|
||||||
ASSERT(((UINT32)DebugAgentVectorTable & ARM_VECTOR_TABLE_ALIGNMENT) == 0);
|
ASSERT(((UINTN)DebugAgentVectorTable & ARM_VECTOR_TABLE_ALIGNMENT) == 0);
|
||||||
ArmWriteVBar ((UINT32)DebugAgentVectorTable);
|
ArmWriteVBar ((UINTN)DebugAgentVectorTable);
|
||||||
|
|
||||||
// We use InitFlag to know if DebugAgent has been intialized from
|
// We use InitFlag to know if DebugAgent has been intialized from
|
||||||
// Sec (DEBUG_AGENT_INIT_PREMEM_SEC) or PrePi (DEBUG_AGENT_INIT_POSTMEM_SEC)
|
// Sec (DEBUG_AGENT_INIT_PREMEM_SEC) or PrePi (DEBUG_AGENT_INIT_POSTMEM_SEC)
|
||||||
|
@ -295,7 +295,7 @@ InitializeDebugAgent (
|
||||||
//
|
//
|
||||||
// Get the Sec or PrePeiCore module (defined as SEC type module)
|
// Get the Sec or PrePeiCore module (defined as SEC type module)
|
||||||
//
|
//
|
||||||
Status = GetFfsFile ((EFI_FIRMWARE_VOLUME_HEADER*)PcdGet32(PcdSecureFvBaseAddress), EFI_FV_FILETYPE_SECURITY_CORE, &FfsHeader);
|
Status = GetFfsFile ((EFI_FIRMWARE_VOLUME_HEADER*)(UINTN)PcdGet32(PcdSecureFvBaseAddress), EFI_FV_FILETYPE_SECURITY_CORE, &FfsHeader);
|
||||||
if (!EFI_ERROR(Status)) {
|
if (!EFI_ERROR(Status)) {
|
||||||
Status = GetImageContext (FfsHeader,&ImageContext);
|
Status = GetImageContext (FfsHeader,&ImageContext);
|
||||||
if (!EFI_ERROR(Status)) {
|
if (!EFI_ERROR(Status)) {
|
||||||
|
@ -306,7 +306,7 @@ InitializeDebugAgent (
|
||||||
//
|
//
|
||||||
// Get the PrePi or PrePeiCore module (defined as SEC type module)
|
// Get the PrePi or PrePeiCore module (defined as SEC type module)
|
||||||
//
|
//
|
||||||
Status = GetFfsFile ((EFI_FIRMWARE_VOLUME_HEADER*)PcdGet32(PcdFvBaseAddress), EFI_FV_FILETYPE_SECURITY_CORE, &FfsHeader);
|
Status = GetFfsFile ((EFI_FIRMWARE_VOLUME_HEADER*)(UINTN)PcdGet32(PcdFvBaseAddress), EFI_FV_FILETYPE_SECURITY_CORE, &FfsHeader);
|
||||||
if (!EFI_ERROR(Status)) {
|
if (!EFI_ERROR(Status)) {
|
||||||
Status = GetImageContext (FfsHeader,&ImageContext);
|
Status = GetImageContext (FfsHeader,&ImageContext);
|
||||||
if (!EFI_ERROR(Status)) {
|
if (!EFI_ERROR(Status)) {
|
||||||
|
@ -317,7 +317,7 @@ InitializeDebugAgent (
|
||||||
//
|
//
|
||||||
// Get the PeiCore module (defined as PEI_CORE type module)
|
// Get the PeiCore module (defined as PEI_CORE type module)
|
||||||
//
|
//
|
||||||
Status = GetFfsFile ((EFI_FIRMWARE_VOLUME_HEADER*)PcdGet32(PcdFvBaseAddress), EFI_FV_FILETYPE_PEI_CORE, &FfsHeader);
|
Status = GetFfsFile ((EFI_FIRMWARE_VOLUME_HEADER*)(UINTN)PcdGet32(PcdFvBaseAddress), EFI_FV_FILETYPE_PEI_CORE, &FfsHeader);
|
||||||
if (!EFI_ERROR(Status)) {
|
if (!EFI_ERROR(Status)) {
|
||||||
Status = GetImageContext (FfsHeader,&ImageContext);
|
Status = GetImageContext (FfsHeader,&ImageContext);
|
||||||
if (!EFI_ERROR(Status)) {
|
if (!EFI_ERROR(Status)) {
|
||||||
|
|
|
@ -36,9 +36,9 @@ typedef struct {
|
||||||
|
|
||||||
CHAR8 *
|
CHAR8 *
|
||||||
GetImageName (
|
GetImageName (
|
||||||
IN UINT32 FaultAddress,
|
IN UINTN FaultAddress,
|
||||||
OUT UINT32 *ImageBase,
|
OUT UINTN *ImageBase,
|
||||||
OUT UINT32 *PeCoffSizeOfHeaders
|
OUT UINTN *PeCoffSizeOfHeaders
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -26,9 +26,9 @@
|
||||||
**/
|
**/
|
||||||
CHAR8 *
|
CHAR8 *
|
||||||
GetImageName (
|
GetImageName (
|
||||||
IN UINT32 FaultAddress,
|
IN UINTN FaultAddress,
|
||||||
OUT UINT32 *ImageBase,
|
OUT UINTN *ImageBase,
|
||||||
OUT UINT32 *PeCoffSizeOfHeaders
|
OUT UINTN *PeCoffSizeOfHeaders
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -62,9 +62,9 @@ DefaultExceptionHandlerConstructor (
|
||||||
**/
|
**/
|
||||||
CHAR8 *
|
CHAR8 *
|
||||||
GetImageName (
|
GetImageName (
|
||||||
IN UINT32 FaultAddress,
|
IN UINTN FaultAddress,
|
||||||
OUT UINT32 *ImageBase,
|
OUT UINTN *ImageBase,
|
||||||
OUT UINT32 *PeCoffSizeOfHeaders
|
OUT UINTN *PeCoffSizeOfHeaders
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_DEBUG_IMAGE_INFO *DebugTable;
|
EFI_DEBUG_IMAGE_INFO *DebugTable;
|
||||||
|
@ -83,7 +83,7 @@ GetImageName (
|
||||||
(DebugTable->NormalImage->LoadedImageProtocolInstance != NULL)) {
|
(DebugTable->NormalImage->LoadedImageProtocolInstance != NULL)) {
|
||||||
if ((Address >= (CHAR8 *)DebugTable->NormalImage->LoadedImageProtocolInstance->ImageBase) &&
|
if ((Address >= (CHAR8 *)DebugTable->NormalImage->LoadedImageProtocolInstance->ImageBase) &&
|
||||||
(Address <= ((CHAR8 *)DebugTable->NormalImage->LoadedImageProtocolInstance->ImageBase + DebugTable->NormalImage->LoadedImageProtocolInstance->ImageSize))) {
|
(Address <= ((CHAR8 *)DebugTable->NormalImage->LoadedImageProtocolInstance->ImageBase + DebugTable->NormalImage->LoadedImageProtocolInstance->ImageSize))) {
|
||||||
*ImageBase = (UINT32)DebugTable->NormalImage->LoadedImageProtocolInstance->ImageBase;
|
*ImageBase = (UINTN)DebugTable->NormalImage->LoadedImageProtocolInstance->ImageBase;
|
||||||
*PeCoffSizeOfHeaders = PeCoffGetSizeOfHeaders ((VOID *)(UINTN)*ImageBase);
|
*PeCoffSizeOfHeaders = PeCoffGetSizeOfHeaders ((VOID *)(UINTN)*ImageBase);
|
||||||
return PeCoffLoaderGetPdbPointer (DebugTable->NormalImage->LoadedImageProtocolInstance->ImageBase);
|
return PeCoffLoaderGetPdbPointer (DebugTable->NormalImage->LoadedImageProtocolInstance->ImageBase);
|
||||||
}
|
}
|
||||||
|
@ -93,3 +93,4 @@ GetImageName (
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ RETURN_STATUS
|
||||||
SemihostFileOpen (
|
SemihostFileOpen (
|
||||||
IN CHAR8 *FileName,
|
IN CHAR8 *FileName,
|
||||||
IN UINT32 Mode,
|
IN UINT32 Mode,
|
||||||
OUT UINT32 *FileHandle
|
OUT UINTN *FileHandle
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
SEMIHOST_FILE_OPEN_BLOCK OpenBlock;
|
SEMIHOST_FILE_OPEN_BLOCK OpenBlock;
|
||||||
|
@ -56,8 +56,8 @@ SemihostFileOpen (
|
||||||
|
|
||||||
RETURN_STATUS
|
RETURN_STATUS
|
||||||
SemihostFileSeek (
|
SemihostFileSeek (
|
||||||
IN UINT32 FileHandle,
|
IN UINTN FileHandle,
|
||||||
IN UINT32 Offset
|
IN UINTN Offset
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
SEMIHOST_FILE_SEEK_BLOCK SeekBlock;
|
SEMIHOST_FILE_SEEK_BLOCK SeekBlock;
|
||||||
|
@ -77,8 +77,8 @@ SemihostFileSeek (
|
||||||
|
|
||||||
RETURN_STATUS
|
RETURN_STATUS
|
||||||
SemihostFileRead (
|
SemihostFileRead (
|
||||||
IN UINT32 FileHandle,
|
IN UINTN FileHandle,
|
||||||
IN OUT UINT32 *Length,
|
IN OUT UINTN *Length,
|
||||||
OUT VOID *Buffer
|
OUT VOID *Buffer
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
@ -105,8 +105,8 @@ SemihostFileRead (
|
||||||
|
|
||||||
RETURN_STATUS
|
RETURN_STATUS
|
||||||
SemihostFileWrite (
|
SemihostFileWrite (
|
||||||
IN UINT32 FileHandle,
|
IN UINTN FileHandle,
|
||||||
IN OUT UINT32 *Length,
|
IN OUT UINTN *Length,
|
||||||
IN VOID *Buffer
|
IN VOID *Buffer
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
@ -127,7 +127,7 @@ SemihostFileWrite (
|
||||||
|
|
||||||
RETURN_STATUS
|
RETURN_STATUS
|
||||||
SemihostFileClose (
|
SemihostFileClose (
|
||||||
IN UINT32 FileHandle
|
IN UINTN FileHandle
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
INT32 Result = Semihost_SYS_CLOSE(&FileHandle);
|
INT32 Result = Semihost_SYS_CLOSE(&FileHandle);
|
||||||
|
@ -141,8 +141,8 @@ SemihostFileClose (
|
||||||
|
|
||||||
RETURN_STATUS
|
RETURN_STATUS
|
||||||
SemihostFileLength (
|
SemihostFileLength (
|
||||||
IN UINT32 FileHandle,
|
IN UINTN FileHandle,
|
||||||
OUT UINT32 *Length
|
OUT UINTN *Length
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
INT32 Result;
|
INT32 Result;
|
||||||
|
|
Loading…
Reference in New Issue