Skip to content

Commit

Permalink
ArmPkg/Library/SemihostLib: Removed depenencies on Uefi.h (Base library)
Browse files Browse the repository at this point in the history
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13065 6f19259b-4bc3-4df7-8a09-765794883524
  • Loading branch information
oliviermartin committed Feb 28, 2012
1 parent 68dda85 commit afb9f4d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
14 changes: 7 additions & 7 deletions ArmPkg/Include/Library/SemihostLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,45 +34,45 @@ SemihostConnectionSupported (
VOID
);

EFI_STATUS
RETURN_STATUS
SemihostFileOpen (
IN CHAR8 *FileName,
IN UINT32 Mode,
OUT UINT32 *FileHandle
);

EFI_STATUS
RETURN_STATUS
SemihostFileSeek (
IN UINT32 FileHandle,
IN UINT32 Offset
);

EFI_STATUS
RETURN_STATUS
SemihostFileRead (
IN UINT32 FileHandle,
IN OUT UINT32 *Length,
OUT VOID *Buffer
);

EFI_STATUS
RETURN_STATUS
SemihostFileWrite (
IN UINT32 FileHandle,
IN OUT UINT32 *Length,
IN VOID *Buffer
);

EFI_STATUS
RETURN_STATUS
SemihostFileClose (
IN UINT32 FileHandle
);

EFI_STATUS
RETURN_STATUS
SemihostFileLength (
IN UINT32 FileHandle,
OUT UINT32 *Length
);

EFI_STATUS
RETURN_STATUS
SemihostFileRemove (
IN CHAR8 *FileName
);
Expand Down
50 changes: 25 additions & 25 deletions ArmPkg/Library/SemihostLib/Arm/SemihostLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include <Uefi.h>
#include <Base.h>

#include <Library/BaseLib.h>
#include <Library/SemihostLib.h>
Expand All @@ -26,7 +26,7 @@ SemihostConnectionSupported (
return SEMIHOST_SUPPORTED;
}

EFI_STATUS
RETURN_STATUS
SemihostFileOpen (
IN CHAR8 *FileName,
IN UINT32 Mode,
Expand All @@ -37,7 +37,7 @@ SemihostFileOpen (
INT32 Result;

if (FileHandle == NULL) {
return EFI_INVALID_PARAMETER;
return RETURN_INVALID_PARAMETER;
}

OpenBlock.FileName = FileName;
Expand All @@ -47,14 +47,14 @@ SemihostFileOpen (
Result = Semihost_SYS_OPEN(&OpenBlock);

if (Result == -1) {
return EFI_NOT_FOUND;
return RETURN_NOT_FOUND;
} else {
*FileHandle = Result;
return EFI_SUCCESS;
return RETURN_SUCCESS;
}
}

EFI_STATUS
RETURN_STATUS
SemihostFileSeek (
IN UINT32 FileHandle,
IN UINT32 Offset
Expand All @@ -69,13 +69,13 @@ SemihostFileSeek (
Result = Semihost_SYS_SEEK(&SeekBlock);

if (Result == 0) {
return EFI_SUCCESS;
return RETURN_SUCCESS;
} else {
return EFI_ABORTED;
return RETURN_ABORTED;
}
}

EFI_STATUS
RETURN_STATUS
SemihostFileRead (
IN UINT32 FileHandle,
IN OUT UINT32 *Length,
Expand All @@ -86,7 +86,7 @@ SemihostFileRead (
UINT32 Result;

if ((Length == NULL) || (Buffer == NULL)) {
return EFI_INVALID_PARAMETER;
return RETURN_INVALID_PARAMETER;
}

ReadBlock.Handle = FileHandle;
Expand All @@ -96,14 +96,14 @@ SemihostFileRead (
Result = Semihost_SYS_READ(&ReadBlock);

if (Result == *Length) {
return EFI_ABORTED;
return RETURN_ABORTED;
} else {
*Length -= Result;
return EFI_SUCCESS;
return RETURN_SUCCESS;
}
}

EFI_STATUS
RETURN_STATUS
SemihostFileWrite (
IN UINT32 FileHandle,
IN OUT UINT32 *Length,
Expand All @@ -113,7 +113,7 @@ SemihostFileWrite (
SEMIHOST_FILE_READ_WRITE_BLOCK WriteBlock;

if ((Length == NULL) || (Buffer == NULL)) {
return EFI_INVALID_PARAMETER;
return RETURN_INVALID_PARAMETER;
}

WriteBlock.Handle = FileHandle;
Expand All @@ -122,24 +122,24 @@ SemihostFileWrite (

*Length = Semihost_SYS_WRITE(&WriteBlock);

return EFI_SUCCESS;
return RETURN_SUCCESS;
}

EFI_STATUS
RETURN_STATUS
SemihostFileClose (
IN UINT32 FileHandle
)
{
INT32 Result = Semihost_SYS_CLOSE(&FileHandle);

if (Result == -1) {
return EFI_INVALID_PARAMETER;
return RETURN_INVALID_PARAMETER;
} else {
return EFI_SUCCESS;
return RETURN_SUCCESS;
}
}

EFI_STATUS
RETURN_STATUS
SemihostFileLength (
IN UINT32 FileHandle,
OUT UINT32 *Length
Expand All @@ -148,20 +148,20 @@ SemihostFileLength (
INT32 Result;

if (Length == NULL) {
return EFI_INVALID_PARAMETER;
return RETURN_INVALID_PARAMETER;
}

Result = Semihost_SYS_FLEN(&FileHandle);

if (Result == -1) {
return EFI_ABORTED;
return RETURN_ABORTED;
} else {
*Length = Result;
return EFI_SUCCESS;
return RETURN_SUCCESS;
}
}

EFI_STATUS
RETURN_STATUS
SemihostFileRemove (
IN CHAR8 *FileName
)
Expand All @@ -175,9 +175,9 @@ SemihostFileRemove (
Result = Semihost_SYS_REMOVE(&RemoveBlock);

if (Result == 0) {
return EFI_SUCCESS;
return RETURN_SUCCESS;
} else {
return EFI_ABORTED;
return RETURN_ABORTED;
}
}

Expand Down

0 comments on commit afb9f4d

Please sign in to comment.