mirror of https://github.com/acidanthera/audk.git
ArmPkg/Library/SemihostLib: Removed depenencies on Uefi.h (Base library)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13065 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
68dda854c6
commit
afb9f4da94
|
@ -34,45 +34,45 @@ SemihostConnectionSupported (
|
||||||
VOID
|
VOID
|
||||||
);
|
);
|
||||||
|
|
||||||
EFI_STATUS
|
RETURN_STATUS
|
||||||
SemihostFileOpen (
|
SemihostFileOpen (
|
||||||
IN CHAR8 *FileName,
|
IN CHAR8 *FileName,
|
||||||
IN UINT32 Mode,
|
IN UINT32 Mode,
|
||||||
OUT UINT32 *FileHandle
|
OUT UINT32 *FileHandle
|
||||||
);
|
);
|
||||||
|
|
||||||
EFI_STATUS
|
RETURN_STATUS
|
||||||
SemihostFileSeek (
|
SemihostFileSeek (
|
||||||
IN UINT32 FileHandle,
|
IN UINT32 FileHandle,
|
||||||
IN UINT32 Offset
|
IN UINT32 Offset
|
||||||
);
|
);
|
||||||
|
|
||||||
EFI_STATUS
|
RETURN_STATUS
|
||||||
SemihostFileRead (
|
SemihostFileRead (
|
||||||
IN UINT32 FileHandle,
|
IN UINT32 FileHandle,
|
||||||
IN OUT UINT32 *Length,
|
IN OUT UINT32 *Length,
|
||||||
OUT VOID *Buffer
|
OUT VOID *Buffer
|
||||||
);
|
);
|
||||||
|
|
||||||
EFI_STATUS
|
RETURN_STATUS
|
||||||
SemihostFileWrite (
|
SemihostFileWrite (
|
||||||
IN UINT32 FileHandle,
|
IN UINT32 FileHandle,
|
||||||
IN OUT UINT32 *Length,
|
IN OUT UINT32 *Length,
|
||||||
IN VOID *Buffer
|
IN VOID *Buffer
|
||||||
);
|
);
|
||||||
|
|
||||||
EFI_STATUS
|
RETURN_STATUS
|
||||||
SemihostFileClose (
|
SemihostFileClose (
|
||||||
IN UINT32 FileHandle
|
IN UINT32 FileHandle
|
||||||
);
|
);
|
||||||
|
|
||||||
EFI_STATUS
|
RETURN_STATUS
|
||||||
SemihostFileLength (
|
SemihostFileLength (
|
||||||
IN UINT32 FileHandle,
|
IN UINT32 FileHandle,
|
||||||
OUT UINT32 *Length
|
OUT UINT32 *Length
|
||||||
);
|
);
|
||||||
|
|
||||||
EFI_STATUS
|
RETURN_STATUS
|
||||||
SemihostFileRemove (
|
SemihostFileRemove (
|
||||||
IN CHAR8 *FileName
|
IN CHAR8 *FileName
|
||||||
);
|
);
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
#include <Uefi.h>
|
#include <Base.h>
|
||||||
|
|
||||||
#include <Library/BaseLib.h>
|
#include <Library/BaseLib.h>
|
||||||
#include <Library/SemihostLib.h>
|
#include <Library/SemihostLib.h>
|
||||||
|
@ -26,7 +26,7 @@ SemihostConnectionSupported (
|
||||||
return SEMIHOST_SUPPORTED;
|
return SEMIHOST_SUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
EFI_STATUS
|
RETURN_STATUS
|
||||||
SemihostFileOpen (
|
SemihostFileOpen (
|
||||||
IN CHAR8 *FileName,
|
IN CHAR8 *FileName,
|
||||||
IN UINT32 Mode,
|
IN UINT32 Mode,
|
||||||
|
@ -37,7 +37,7 @@ SemihostFileOpen (
|
||||||
INT32 Result;
|
INT32 Result;
|
||||||
|
|
||||||
if (FileHandle == NULL) {
|
if (FileHandle == NULL) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return RETURN_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
OpenBlock.FileName = FileName;
|
OpenBlock.FileName = FileName;
|
||||||
|
@ -47,14 +47,14 @@ SemihostFileOpen (
|
||||||
Result = Semihost_SYS_OPEN(&OpenBlock);
|
Result = Semihost_SYS_OPEN(&OpenBlock);
|
||||||
|
|
||||||
if (Result == -1) {
|
if (Result == -1) {
|
||||||
return EFI_NOT_FOUND;
|
return RETURN_NOT_FOUND;
|
||||||
} else {
|
} else {
|
||||||
*FileHandle = Result;
|
*FileHandle = Result;
|
||||||
return EFI_SUCCESS;
|
return RETURN_SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EFI_STATUS
|
RETURN_STATUS
|
||||||
SemihostFileSeek (
|
SemihostFileSeek (
|
||||||
IN UINT32 FileHandle,
|
IN UINT32 FileHandle,
|
||||||
IN UINT32 Offset
|
IN UINT32 Offset
|
||||||
|
@ -69,13 +69,13 @@ SemihostFileSeek (
|
||||||
Result = Semihost_SYS_SEEK(&SeekBlock);
|
Result = Semihost_SYS_SEEK(&SeekBlock);
|
||||||
|
|
||||||
if (Result == 0) {
|
if (Result == 0) {
|
||||||
return EFI_SUCCESS;
|
return RETURN_SUCCESS;
|
||||||
} else {
|
} else {
|
||||||
return EFI_ABORTED;
|
return RETURN_ABORTED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EFI_STATUS
|
RETURN_STATUS
|
||||||
SemihostFileRead (
|
SemihostFileRead (
|
||||||
IN UINT32 FileHandle,
|
IN UINT32 FileHandle,
|
||||||
IN OUT UINT32 *Length,
|
IN OUT UINT32 *Length,
|
||||||
|
@ -86,7 +86,7 @@ SemihostFileRead (
|
||||||
UINT32 Result;
|
UINT32 Result;
|
||||||
|
|
||||||
if ((Length == NULL) || (Buffer == NULL)) {
|
if ((Length == NULL) || (Buffer == NULL)) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return RETURN_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReadBlock.Handle = FileHandle;
|
ReadBlock.Handle = FileHandle;
|
||||||
|
@ -96,14 +96,14 @@ SemihostFileRead (
|
||||||
Result = Semihost_SYS_READ(&ReadBlock);
|
Result = Semihost_SYS_READ(&ReadBlock);
|
||||||
|
|
||||||
if (Result == *Length) {
|
if (Result == *Length) {
|
||||||
return EFI_ABORTED;
|
return RETURN_ABORTED;
|
||||||
} else {
|
} else {
|
||||||
*Length -= Result;
|
*Length -= Result;
|
||||||
return EFI_SUCCESS;
|
return RETURN_SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EFI_STATUS
|
RETURN_STATUS
|
||||||
SemihostFileWrite (
|
SemihostFileWrite (
|
||||||
IN UINT32 FileHandle,
|
IN UINT32 FileHandle,
|
||||||
IN OUT UINT32 *Length,
|
IN OUT UINT32 *Length,
|
||||||
|
@ -113,7 +113,7 @@ SemihostFileWrite (
|
||||||
SEMIHOST_FILE_READ_WRITE_BLOCK WriteBlock;
|
SEMIHOST_FILE_READ_WRITE_BLOCK WriteBlock;
|
||||||
|
|
||||||
if ((Length == NULL) || (Buffer == NULL)) {
|
if ((Length == NULL) || (Buffer == NULL)) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return RETURN_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
WriteBlock.Handle = FileHandle;
|
WriteBlock.Handle = FileHandle;
|
||||||
|
@ -122,10 +122,10 @@ SemihostFileWrite (
|
||||||
|
|
||||||
*Length = Semihost_SYS_WRITE(&WriteBlock);
|
*Length = Semihost_SYS_WRITE(&WriteBlock);
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return RETURN_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
EFI_STATUS
|
RETURN_STATUS
|
||||||
SemihostFileClose (
|
SemihostFileClose (
|
||||||
IN UINT32 FileHandle
|
IN UINT32 FileHandle
|
||||||
)
|
)
|
||||||
|
@ -133,13 +133,13 @@ SemihostFileClose (
|
||||||
INT32 Result = Semihost_SYS_CLOSE(&FileHandle);
|
INT32 Result = Semihost_SYS_CLOSE(&FileHandle);
|
||||||
|
|
||||||
if (Result == -1) {
|
if (Result == -1) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return RETURN_INVALID_PARAMETER;
|
||||||
} else {
|
} else {
|
||||||
return EFI_SUCCESS;
|
return RETURN_SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EFI_STATUS
|
RETURN_STATUS
|
||||||
SemihostFileLength (
|
SemihostFileLength (
|
||||||
IN UINT32 FileHandle,
|
IN UINT32 FileHandle,
|
||||||
OUT UINT32 *Length
|
OUT UINT32 *Length
|
||||||
|
@ -148,20 +148,20 @@ SemihostFileLength (
|
||||||
INT32 Result;
|
INT32 Result;
|
||||||
|
|
||||||
if (Length == NULL) {
|
if (Length == NULL) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return RETURN_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
Result = Semihost_SYS_FLEN(&FileHandle);
|
Result = Semihost_SYS_FLEN(&FileHandle);
|
||||||
|
|
||||||
if (Result == -1) {
|
if (Result == -1) {
|
||||||
return EFI_ABORTED;
|
return RETURN_ABORTED;
|
||||||
} else {
|
} else {
|
||||||
*Length = Result;
|
*Length = Result;
|
||||||
return EFI_SUCCESS;
|
return RETURN_SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EFI_STATUS
|
RETURN_STATUS
|
||||||
SemihostFileRemove (
|
SemihostFileRemove (
|
||||||
IN CHAR8 *FileName
|
IN CHAR8 *FileName
|
||||||
)
|
)
|
||||||
|
@ -175,9 +175,9 @@ SemihostFileRemove (
|
||||||
Result = Semihost_SYS_REMOVE(&RemoveBlock);
|
Result = Semihost_SYS_REMOVE(&RemoveBlock);
|
||||||
|
|
||||||
if (Result == 0) {
|
if (Result == 0) {
|
||||||
return EFI_SUCCESS;
|
return RETURN_SUCCESS;
|
||||||
} else {
|
} else {
|
||||||
return EFI_ABORTED;
|
return RETURN_ABORTED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue