EdkCompatabilityPkg: Fix build issues with X64 clang
Removed passing VA_LIST and some assembly language compatability issues. Did not fix ReportStatusCode passing VA_LIST (non-ANSI C Code), and some of the assembler was not not ported and int 3 was inserted, as it likely is not needed. signed-off-by: andrewfish reviewed-by: lgao4 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12006 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -58,14 +58,6 @@ Abstract:
|
||||
#include "PeiLib.h"
|
||||
#include "Print.h"
|
||||
|
||||
STATIC
|
||||
CHAR8 *
|
||||
GetFlagsAndWidth (
|
||||
IN CHAR8 *Format,
|
||||
OUT UINTN *Flags,
|
||||
OUT UINTN *Width,
|
||||
IN OUT VA_LIST *Marker
|
||||
);
|
||||
|
||||
STATIC
|
||||
UINTN
|
||||
@@ -195,7 +187,8 @@ Returns:
|
||||
UINTN BufferLeft;
|
||||
UINT64 Value;
|
||||
EFI_GUID *TmpGUID;
|
||||
|
||||
BOOLEAN Done;
|
||||
|
||||
//
|
||||
// Process the format string. Stop if Buffer is over run.
|
||||
//
|
||||
@@ -218,8 +211,50 @@ Returns:
|
||||
|
||||
//
|
||||
// Now it's time to parse what follows after %
|
||||
//
|
||||
Format = GetFlagsAndWidth (Format, &Flags, &Width, &Marker);
|
||||
//
|
||||
Flags = 0;
|
||||
Width = 0;
|
||||
for (Done = FALSE; !Done; ) {
|
||||
Format++;
|
||||
|
||||
switch (*Format) {
|
||||
|
||||
case '-': Flags |= LEFT_JUSTIFY; break;
|
||||
case '+': Flags |= PREFIX_SIGN; break;
|
||||
case ' ': Flags |= PREFIX_BLANK; break;
|
||||
case ',': Flags |= COMMA_TYPE; break;
|
||||
case 'L':
|
||||
case 'l': Flags |= LONG_TYPE; break;
|
||||
|
||||
case '*':
|
||||
Width = VA_ARG (Marker, UINTN);
|
||||
break;
|
||||
|
||||
case '0':
|
||||
Flags |= PREFIX_ZERO;
|
||||
case '1':
|
||||
case '2':
|
||||
case '3':
|
||||
case '4':
|
||||
case '5':
|
||||
case '6':
|
||||
case '7':
|
||||
case '8':
|
||||
case '9':
|
||||
Count = 0;
|
||||
do {
|
||||
Count = (Count * 10) + *Format - '0';
|
||||
Format++;
|
||||
} while ((*Format >= '0') && (*Format <= '9'));
|
||||
Format--;
|
||||
Width = Count;
|
||||
break;
|
||||
|
||||
default:
|
||||
Done = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
switch (*Format) {
|
||||
case 'p':
|
||||
//
|
||||
@@ -367,87 +402,6 @@ Returns:
|
||||
|
||||
|
||||
|
||||
STATIC
|
||||
CHAR8 *
|
||||
GetFlagsAndWidth (
|
||||
IN CHAR8 *Format,
|
||||
OUT UINTN *Flags,
|
||||
OUT UINTN *Width,
|
||||
IN OUT VA_LIST *Marker
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
AvSPrint worker function that parses flag and width information from the
|
||||
Format string and returns the next index into the Format string that needs
|
||||
to be parsed. See file headed for details of Flag and Width.
|
||||
|
||||
Arguments:
|
||||
|
||||
Format - Current location in the AvSPrint format string.
|
||||
|
||||
Flags - Returns flags
|
||||
|
||||
Width - Returns width of element
|
||||
|
||||
Marker - Vararg list that may be paritally consumed and returned.
|
||||
|
||||
Returns:
|
||||
|
||||
Pointer indexed into the Format string for all the information parsed
|
||||
by this routine.
|
||||
|
||||
--*/
|
||||
{
|
||||
UINTN Count;
|
||||
BOOLEAN Done;
|
||||
|
||||
*Flags = 0;
|
||||
*Width = 0;
|
||||
for (Done = FALSE; !Done; ) {
|
||||
Format++;
|
||||
|
||||
switch (*Format) {
|
||||
|
||||
case '-': *Flags |= LEFT_JUSTIFY; break;
|
||||
case '+': *Flags |= PREFIX_SIGN; break;
|
||||
case ' ': *Flags |= PREFIX_BLANK; break;
|
||||
case ',': *Flags |= COMMA_TYPE; break;
|
||||
case 'L':
|
||||
case 'l': *Flags |= LONG_TYPE; break;
|
||||
|
||||
case '*':
|
||||
*Width = VA_ARG (*Marker, UINTN);
|
||||
break;
|
||||
|
||||
case '0':
|
||||
*Flags |= PREFIX_ZERO;
|
||||
case '1':
|
||||
case '2':
|
||||
case '3':
|
||||
case '4':
|
||||
case '5':
|
||||
case '6':
|
||||
case '7':
|
||||
case '8':
|
||||
case '9':
|
||||
Count = 0;
|
||||
do {
|
||||
Count = (Count * 10) + *Format - '0';
|
||||
Format++;
|
||||
} while ((*Format >= '0') && (*Format <= '9'));
|
||||
Format--;
|
||||
*Width = Count;
|
||||
break;
|
||||
|
||||
default:
|
||||
Done = TRUE;
|
||||
}
|
||||
}
|
||||
return Format;
|
||||
}
|
||||
|
||||
static CHAR8 mHexStr[] = { '0','1','2','3','4','5','6','7',
|
||||
'8','9','A','B','C','D','E','F' };
|
||||
|
||||
|
@@ -59,8 +59,8 @@ ASM_PFX(SwitchStacks):
|
||||
#SwitchStacks ENDP
|
||||
|
||||
|
||||
.equ EFI_SUCCESS, 0
|
||||
.equ EFI_WARN_RETURN_FROM_LONG_JUMP, 5
|
||||
.set EFI_SUCCESS, 0
|
||||
.set EFI_WARN_RETURN_FROM_LONG_JUMP, 5
|
||||
|
||||
#
|
||||
#Routine Description:
|
||||
@@ -99,19 +99,19 @@ ASM_PFX(TransferControlSetJump):
|
||||
mov %r13,0x40(%rdx)
|
||||
mov %r14,0x48(%rdx)
|
||||
mov %r15,0x50(%rdx)
|
||||
#; save non-volatile fp registers
|
||||
stmxcsr 0x60(%rdx)
|
||||
lea 0x68(%rdx), %rax
|
||||
movdqu %xmm6, (%rax)
|
||||
movdqu %xmm7, 0x10(%rax)
|
||||
movdqu %xmm8, 0x20(%rax)
|
||||
movdqu %xmm9, 0x30(%rax)
|
||||
movdqu %xmm10, 0x40(%rax)
|
||||
movdqu %xmm11, 0x50(%rax)
|
||||
movdqu %xmm12, 0x60(%rax)
|
||||
movdqu %xmm13, 0x70(%rax)
|
||||
movdqu %xmm14, 0x80(%rax)
|
||||
movdqu %xmm15, 0x90(%rax)
|
||||
#; save non-volatile fp registers
|
||||
stmxcsr 0x60(%rdx)
|
||||
lea 0x68(%rdx), %rax
|
||||
movdqu %xmm6, (%rax)
|
||||
movdqu %xmm7, 0x10(%rax)
|
||||
movdqu %xmm8, 0x20(%rax)
|
||||
movdqu %xmm9, 0x30(%rax)
|
||||
movdqu %xmm10, 0x40(%rax)
|
||||
movdqu %xmm11, 0x50(%rax)
|
||||
movdqu %xmm12, 0x60(%rax)
|
||||
movdqu %xmm13, 0x70(%rax)
|
||||
movdqu %xmm14, 0x80(%rax)
|
||||
movdqu %xmm15, 0x90(%rax)
|
||||
mov (%rsp),%rax
|
||||
mov %rax,0x58(%rdx)
|
||||
mov $0x0,%rax
|
||||
@@ -129,19 +129,19 @@ ASM_PFX(TransferControlSetJump):
|
||||
#
|
||||
ASM_PFX(TransferControlLongJump):
|
||||
# set return from SetJump to EFI_WARN_RETURN_FROM_LONG_JUMP
|
||||
#; load non-volatile fp registers
|
||||
ldmxcsr 0x60(%rdx)
|
||||
lea 0x68(%rdx), %rax
|
||||
movdqu (%rax), %xmm6
|
||||
movdqu 0x10(%rax), %xmm7
|
||||
movdqu 0x20(%rax), %xmm8
|
||||
movdqu 0x30(%rax), %xmm9
|
||||
movdqu 0x40(%rax), %xmm10
|
||||
movdqu 0x50(%rax), %xmm11
|
||||
movdqu 0x60(%rax), %xmm12
|
||||
movdqu 0x70(%rax), %xmm13
|
||||
movdqu 0x80(%rax), %xmm14
|
||||
movdqu 0x90(%rax), %xmm15
|
||||
#; load non-volatile fp registers
|
||||
ldmxcsr 0x60(%rdx)
|
||||
lea 0x68(%rdx), %rax
|
||||
movdqu (%rax), %xmm6
|
||||
movdqu 0x10(%rax), %xmm7
|
||||
movdqu 0x20(%rax), %xmm8
|
||||
movdqu 0x30(%rax), %xmm9
|
||||
movdqu 0x40(%rax), %xmm10
|
||||
movdqu 0x50(%rax), %xmm11
|
||||
movdqu 0x60(%rax), %xmm12
|
||||
movdqu 0x70(%rax), %xmm13
|
||||
movdqu 0x80(%rax), %xmm14
|
||||
movdqu 0x90(%rax), %xmm15
|
||||
mov $0x5,%rax
|
||||
mov (%rdx),%rbx
|
||||
mov 0x8(%rdx),%rsp
|
||||
|
Reference in New Issue
Block a user