#\r
# save orignal GDTR and CS\r
#\r
- movq %ds, %rax\r
+ movl %ds, %eax\r
push %rax\r
- movq %cs, %rax\r
+ movl %cs, %eax\r
push %rax\r
subq $0x10, %rsp\r
sgdt (%rsp)\r
# Reload original DS/ES/SS\r
#\r
pop %rcx\r
- movq %rcx, %ds\r
- movq %rcx, %es\r
- movq %rcx, %ss\r
+ movl %ecx, %ds\r
+ movl %ecx, %es\r
+ movl %ecx, %ss\r
ret\r
\r
#------------------------------------------------------------------------------\r
\r
\r
-.equ VacantFlag, 0x0\r
-.equ NotVacantFlag, 0xff\r
-\r
-.equ LockLocation, RendezvousFunnelProcEnd - RendezvousFunnelProcStart\r
-.equ StackStartAddressLocation, RendezvousFunnelProcEnd - RendezvousFunnelProcStart + 0x08\r
-.equ StackSizeLocation, RendezvousFunnelProcEnd - RendezvousFunnelProcStart + 0x10\r
-.equ CProcedureLocation, RendezvousFunnelProcEnd - RendezvousFunnelProcStart + 0x18\r
-.equ GdtrLocation, RendezvousFunnelProcEnd - RendezvousFunnelProcStart + 0x20\r
-.equ IdtrLocation, RendezvousFunnelProcEnd - RendezvousFunnelProcStart + 0x2A\r
-.equ BufferStartLocation, RendezvousFunnelProcEnd - RendezvousFunnelProcStart + 0x34\r
-.equ Cr3OffsetLocation, RendezvousFunnelProcEnd - RendezvousFunnelProcStart + 0x38\r
-.equ ProcessorNumberLocation, RendezvousFunnelProcEnd - RendezvousFunnelProcStart + 0x38\r
+.set VacantFlag, 0x0\r
+.set NotVacantFlag, 0xff\r
+\r
+.set LockLocation, RendezvousFunnelProcEnd - RendezvousFunnelProcStart\r
+.set StackStartAddressLocation, RendezvousFunnelProcEnd - RendezvousFunnelProcStart + 0x08\r
+.set StackSizeLocation, RendezvousFunnelProcEnd - RendezvousFunnelProcStart + 0x10\r
+.set CProcedureLocation, RendezvousFunnelProcEnd - RendezvousFunnelProcStart + 0x18\r
+.set GdtrLocation, RendezvousFunnelProcEnd - RendezvousFunnelProcStart + 0x20\r
+.set IdtrLocation, RendezvousFunnelProcEnd - RendezvousFunnelProcStart + 0x2A\r
+.set BufferStartLocation, RendezvousFunnelProcEnd - RendezvousFunnelProcStart + 0x34\r
+.set Cr3OffsetLocation, RendezvousFunnelProcEnd - RendezvousFunnelProcStart + 0x38\r
+.set ProcessorNumberLocation, RendezvousFunnelProcEnd - RendezvousFunnelProcStart + 0x38\r
\r
#-------------------------------------------------------------------------------------\r
\r
# comments here for definition of address map\r
ASM_GLOBAL ASM_PFX(AsmGetAddressMap)\r
ASM_PFX(AsmGetAddressMap):\r
-\r
+#ifdef __APPLE__\r
+ int $3\r
+#else\r
movq $RendezvousFunnelProcStart, %rax\r
movq %rax, (%rcx)\r
movq $(ProtectedModeStart - RendezvousFunnelProcStart), 0x08(%rcx)\r
movq $(LongModeStart - RendezvousFunnelProcStart), 0x18(%rcx)\r
movq $(LONG_JUMP - RendezvousFunnelProcStart), 0x20(%rcx)\r
movq $(RendezvousFunnelProcEnd - RendezvousFunnelProcStart), 0x28(%rcx)\r
-\r
+#endif\r
ret\r
popq %rcx\r
popq %rax # restore all volatile registers\r
jnz L1\r
+#ifdef __APPLE__\r
+ int $3\r
+#else\r
jmpq *ASM_PFX(mOriginalHandler)\r
+#endif\r
L1:\r
addq $0x08, %rsp # skip error code for PF\r
iretq\r
#include EFI_PROTOCOL_DEFINITION (Hii)\r
#endif\r
\r
-STATIC\r
-CHAR_W *\r
-GetFlagsAndWidth (\r
- IN CHAR_W *Format,\r
- OUT UINTN *Flags,\r
- OUT UINTN *Width,\r
- IN OUT VA_LIST *Marker\r
- );\r
\r
STATIC\r
UINTN\r
UINTN BufferLeft;\r
UINT64 Value;\r
EFI_GUID *TmpGUID;\r
+ BOOLEAN Done;\r
\r
//\r
// Process the format string. Stop if Buffer is over run.\r
//\r
// Now it's time to parse what follows after %\r
//\r
- Format = GetFlagsAndWidth (Format, &Flags, &Width, &Marker);\r
+ Flags = 0;\r
+ Width = 0;\r
+ for (Done = FALSE; !Done;) {\r
+ Format++;\r
+ \r
+ switch (*Format) {\r
+ \r
+ case '-':\r
+ Flags |= LEFT_JUSTIFY;\r
+ break;\r
+ \r
+ case '+':\r
+ Flags |= PREFIX_SIGN;\r
+ break;\r
+ \r
+ case ' ':\r
+ Flags |= PREFIX_BLANK;\r
+ break;\r
+ \r
+ case ',':\r
+ Flags |= COMMA_TYPE;\r
+ break;\r
+ \r
+ case 'L':\r
+ case 'l':\r
+ Flags |= LONG_TYPE;\r
+ break;\r
+ \r
+ case '*':\r
+ Width = VA_ARG (Marker, UINTN);\r
+ break;\r
+ \r
+ case '0':\r
+ Flags |= PREFIX_ZERO;\r
+ \r
+ case '1':\r
+ case '2':\r
+ case '3':\r
+ case '4':\r
+ case '5':\r
+ case '6':\r
+ case '7':\r
+ case '8':\r
+ case '9':\r
+ Count = 0;\r
+ do {\r
+ Count = (Count * 10) +*Format - '0';\r
+ Format++;\r
+ } while ((*Format >= '0') && (*Format <= '9'));\r
+ Format--;\r
+ Width = Count;\r
+ break;\r
+ \r
+ default:\r
+ Done = TRUE;\r
+ }\r
+ }\r
+\r
switch (*Format) {\r
case 'p':\r
//\r
return &Buffer[Index] - StartOfBuffer;\r
}\r
\r
-STATIC\r
-CHAR_W *\r
-GetFlagsAndWidth (\r
- IN CHAR_W *Format,\r
- OUT UINTN *Flags,\r
- OUT UINTN *Width,\r
- IN OUT VA_LIST *Marker\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- VSPrint worker function that parses flag and width information from the \r
- Format string and returns the next index into the Format string that needs\r
- to be parsed. See file headed for details of Flag and Width.\r
-\r
-Arguments:\r
-\r
- Format - Current location in the VSPrint format string.\r
-\r
- Flags - Returns flags\r
-\r
- Width - Returns width of element\r
-\r
- Marker - Vararg list that may be paritally consumed and returned.\r
-\r
-Returns: \r
-\r
- Pointer indexed into the Format string for all the information parsed\r
- by this routine.\r
-\r
---*/\r
-{\r
- UINTN Count;\r
- BOOLEAN Done;\r
-\r
- *Flags = 0;\r
- *Width = 0;\r
- for (Done = FALSE; !Done;) {\r
- Format++;\r
-\r
- switch (*Format) {\r
-\r
- case '-':\r
- *Flags |= LEFT_JUSTIFY;\r
- break;\r
-\r
- case '+':\r
- *Flags |= PREFIX_SIGN;\r
- break;\r
-\r
- case ' ':\r
- *Flags |= PREFIX_BLANK;\r
- break;\r
-\r
- case ',':\r
- *Flags |= COMMA_TYPE;\r
- break;\r
-\r
- case 'L':\r
- case 'l':\r
- *Flags |= LONG_TYPE;\r
- break;\r
-\r
- case '*':\r
- *Width = VA_ARG (*Marker, UINTN);\r
- break;\r
-\r
- case '0':\r
- *Flags |= PREFIX_ZERO;\r
-\r
- case '1':\r
- case '2':\r
- case '3':\r
- case '4':\r
- case '5':\r
- case '6':\r
- case '7':\r
- case '8':\r
- case '9':\r
- Count = 0;\r
- do {\r
- Count = (Count * 10) +*Format - '0';\r
- Format++;\r
- } while ((*Format >= '0') && (*Format <= '9'));\r
- Format--;\r
- *Width = Count;\r
- break;\r
-\r
- default:\r
- Done = TRUE;\r
- }\r
- }\r
-\r
- return Format;\r
-}\r
-\r
STATIC\r
UINTN\r
GuidToString (\r
#include "Print.h"\r
\r
\r
-STATIC\r
-CHAR_W *\r
-GetFlagsAndWidth (\r
- IN CHAR_W *Format, \r
- OUT UINTN *Flags, \r
- OUT UINTN *Width,\r
- IN OUT VA_LIST *Marker\r
- );\r
-\r
STATIC\r
UINTN\r
GuidToString (\r
UINTN BufferLeft;\r
UINT64 Value;\r
EFI_GUID *TmpGUID;\r
+ BOOLEAN Done;\r
\r
//\r
// Process the format string. Stop if Buffer is over run.\r
\r
//\r
// Now it's time to parse what follows after %\r
- //\r
- Format = GetFlagsAndWidth (Format, &Flags, &Width, &Marker);\r
+ // \r
+ Flags = 0;\r
+ Width = 0;\r
+ for (Done = FALSE; !Done; ) {\r
+ Format++;\r
+ \r
+ switch (*Format) {\r
+ \r
+ case '-': Flags |= LEFT_JUSTIFY; break;\r
+ case '+': Flags |= PREFIX_SIGN; break;\r
+ case ' ': Flags |= PREFIX_BLANK; break;\r
+ case ',': Flags |= COMMA_TYPE; break;\r
+ case 'L':\r
+ case 'l': Flags |= LONG_TYPE; break;\r
+ \r
+ case '*':\r
+ Width = VA_ARG (Marker, UINTN);\r
+ break;\r
+ \r
+ case '0':\r
+ Flags |= PREFIX_ZERO;\r
+ case '1':\r
+ case '2':\r
+ case '3':\r
+ case '4':\r
+ case '5':\r
+ case '6':\r
+ case '7':\r
+ case '8':\r
+ case '9':\r
+ Count = 0;\r
+ do {\r
+ Count = (Count * 10) + *Format - '0';\r
+ Format++;\r
+ } while ((*Format >= '0') && (*Format <= '9'));\r
+ Format--;\r
+ Width = Count;\r
+ break;\r
+ \r
+ default:\r
+ Done = TRUE;\r
+ }\r
+ }\r
+\r
switch (*Format) {\r
case 'p':\r
//\r
return &Buffer[Index] - StartOfBuffer;\r
}\r
\r
-\r
-\r
-STATIC\r
-CHAR_W *\r
-GetFlagsAndWidth (\r
- IN CHAR_W *Format, \r
- OUT UINTN *Flags, \r
- OUT UINTN *Width,\r
- IN OUT VA_LIST *Marker\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- VSPrint worker function that parses flag and width information from the \r
- Format string and returns the next index into the Format string that needs\r
- to be parsed. See file headed for details of Flag and Width.\r
-\r
-Arguments:\r
-\r
- Format - Current location in the VSPrint format string.\r
-\r
- Flags - Returns flags\r
-\r
- Width - Returns width of element\r
-\r
- Marker - Vararg list that may be paritally consumed and returned.\r
-\r
-Returns: \r
-\r
- Pointer indexed into the Format string for all the information parsed\r
- by this routine.\r
-\r
---*/\r
-{\r
- UINTN Count;\r
- BOOLEAN Done;\r
-\r
- *Flags = 0;\r
- *Width = 0;\r
- for (Done = FALSE; !Done; ) {\r
- Format++;\r
-\r
- switch (*Format) {\r
-\r
- case '-': *Flags |= LEFT_JUSTIFY; break;\r
- case '+': *Flags |= PREFIX_SIGN; break;\r
- case ' ': *Flags |= PREFIX_BLANK; break;\r
- case ',': *Flags |= COMMA_TYPE; break;\r
- case 'L':\r
- case 'l': *Flags |= LONG_TYPE; break;\r
-\r
- case '*':\r
- *Width = VA_ARG (*Marker, UINTN);\r
- break;\r
-\r
- case '0':\r
- *Flags |= PREFIX_ZERO;\r
- case '1':\r
- case '2':\r
- case '3':\r
- case '4':\r
- case '5':\r
- case '6':\r
- case '7':\r
- case '8':\r
- case '9':\r
- Count = 0;\r
- do {\r
- Count = (Count * 10) + *Format - '0';\r
- Format++;\r
- } while ((*Format >= '0') && (*Format <= '9'));\r
- Format--;\r
- *Width = Count;\r
- break;\r
-\r
- default:\r
- Done = TRUE;\r
- }\r
- }\r
- return Format;\r
-}\r
-\r
STATIC\r
UINTN\r
GuidToString (\r
ASM_PFX(AsmMwait):\r
mov %ecx,%eax\r
mov %edx,%ecx\r
- mwait %rax,%rcx\r
+ mwait \r
ret\r
#
#------------------------------------------------------------------------------
#include <EdkIIGlueBase.h>
-.extern InternalAssertJumpBuffer;
+
.globl ASM_PFX(SetJump)
ASM_PFX(SetJump):
push %rcx
add $0xffffffffffffffe0,%rsp
- call _InternalAssertJumpBuffer
+ call ASM_PFX(InternalAssertJumpBuffer)
add $0x20,%rsp
pop %rcx
pop %rdx
.globl ASM_PFX(InternalAsmThunk16)\r
\r
# define the structure of IA32_REGS\r
-.equ _EDI, 0 #size 4\r
-.equ _ESI, 4 #size 4\r
-.equ _EBP, 8 #size 4\r
-.equ _ESP, 12 #size 4\r
-.equ _EBX, 16 #size 4\r
-.equ _EDX, 20 #size 4\r
-.equ _ECX, 24 #size 4\r
-.equ _EAX, 28 #size 4\r
-.equ _DS, 32 #size 2\r
-.equ _ES, 34 #size 2\r
-.equ _FS, 36 #size 2\r
-.equ _GS, 38 #size 2\r
-.equ _EFLAGS, 40 #size 8\r
-.equ _EIP, 48 #size 4\r
-.equ _CS, 52 #size 2\r
-.equ _SS, 54 #size 2\r
-.equ IA32_REGS_SIZE, 56\r
+.set _EDI, 0 #size 4\r
+.set _ESI, 4 #size 4\r
+.set _EBP, 8 #size 4\r
+.set _ESP, 12 #size 4\r
+.set _EBX, 16 #size 4\r
+.set _EDX, 20 #size 4\r
+.set _ECX, 24 #size 4\r
+.set _EAX, 28 #size 4\r
+.set _DS, 32 #size 2\r
+.set _ES, 34 #size 2\r
+.set _FS, 36 #size 2\r
+.set _GS, 38 #size 2\r
+.set _EFLAGS, 40 #size 8\r
+.set _EIP, 48 #size 4\r
+.set _CS, 52 #size 2\r
+.set _SS, 54 #size 2\r
+.set IA32_REGS_SIZE, 56\r
\r
.data\r
-\r
+ \r
+#ifndef __APPLE__\r
ASM_PFX(m16Size): .word ASM_PFX(InternalAsmThunk16) - ASM_PFX(m16Start)\r
ASM_PFX(mThunk16Attr): .word _ThunkAttr - ASM_PFX(m16Start)\r
ASM_PFX(m16Gdt): .word ASM_PFX(NullSeg) - ASM_PFX(m16Start)\r
ASM_PFX(m16GdtrBase): .word _16GdtrBase - ASM_PFX(m16Start)\r
ASM_PFX(mTransition): .word _EntryPoint - ASM_PFX(m16Start)\r
+#endif\r
\r
.text\r
\r
#------------------------------------------------------------------------------\r
.globl ASM_PFX(BackFromUserCode)\r
ASM_PFX(BackFromUserCode):\r
+#ifdef __APPLE__\r
+ int $3\r
+#else\r
#\r
# The order of saved registers on the stack matches the order they appears\r
# in IA32_REGS structure. This facilitates wrapper function to extract them\r
.byte 0x67,0xbc # mov esp, imm32\r
SavedSp: .space 4 # restore stack\r
nop\r
+#endif\r
ret\r
\r
+#ifndef __APPLE__\r
_EntryPoint: .long ASM_PFX(ToUserCode) - ASM_PFX(m16Start)\r
.word CODE16\r
_16Gdtr: .word GDT_SIZE - 1\r
_16GdtrBase: .quad ASM_PFX(NullSeg)\r
_16Idtr: .word 0x3ff\r
.long 0\r
+#endif\r
\r
#------------------------------------------------------------------------------\r
# _ToUserCode() takes control in real mode before passing control to user code.\r
#------------------------------------------------------------------------------\r
.globl ASM_PFX(ToUserCode)\r
ASM_PFX(ToUserCode):\r
+#ifdef __APPLE__\r
+ int $3\r
+#else\r
movl %edx,%ss # set new segment selectors\r
movl %edx,%ds\r
movl %edx,%es\r
.byte 0x66, 0x9d # popfd\r
leaw 4(%esp),%sp # skip high order 32 bits of EFlags\r
.byte 0x66 # make the following retf 32-bit\r
- lret # transfer control to user code\r
+#endif\r
+ lret # transfer control to user code\r
\r
-.equ CODE16, ASM_PFX(_16Code) - .\r
-.equ DATA16, ASM_PFX(_16Data) - .\r
-.equ DATA32, ASM_PFX(_32Data) - .\r
+.set CODE16, ASM_PFX(_16Code) - .\r
+.set DATA16, ASM_PFX(_16Data) - .\r
+.set DATA32, ASM_PFX(_32Data) - .\r
\r
ASM_PFX(NullSeg): .quad 0\r
ASM_PFX(_16Code):\r
.byte 0xcf # 16-bit segment, 4GB limit\r
.byte 0\r
\r
-.equ GDT_SIZE, . - ASM_PFX(NullSeg)\r
+.set GDT_SIZE, . - ASM_PFX(NullSeg)\r
\r
#------------------------------------------------------------------------------\r
# IA32_REGISTER_SET *\r
\r
.globl ASM_PFX(InternalAsmThunk16)\r
ASM_PFX(InternalAsmThunk16):\r
+#ifdef __APPLE__\r
+ int $3\r
+#else\r
pushq %rbp\r
pushq %rbx\r
pushq %rsi\r
popq %rsi\r
popq %rbx\r
popq %rbp\r
-\r
+#endif\r
ret\r
\r
*ErrorLevel = DebugInfo->ErrorLevel;\r
\r
+#ifdef __APPLE__\r
+ // This is non portable C code you can't assume VA_LIST is pointer\r
+ return FALSE;\r
+#else\r
//\r
// The first 12 * UINTN bytes of the string are really an \r
// argument stack to support varargs on the Format string.\r
//\r
*Marker = (VA_LIST) (DebugInfo + 1);\r
+#endif\r
*Format = (CHAR8 *)(((UINT64 *)*Marker) + 12);\r
\r
return TRUE;\r
// The first 12 * UINTN bytes of the string are really an \r
// argument stack to support varargs on the Format string.\r
//\r
+#ifdef __APPLE__\r
+ // This is non portable C code you can't assume VA_LIST is pointer\r
+ return FALSE;\r
+#else\r
*Marker = (VA_LIST) (DebugInfo + 1);\r
+#endif\r
*Format = (CHAR8 *)(((UINT64 *)*Marker) + 12);\r
\r
return TRUE;\r
// The first 12 * UINTN bytes of the string are really an\r
// argument stack to support varargs on the Format string.\r
//\r
+#ifdef __APPLE__\r
+ // This is non portable C code you can't assume VA_LIST is pointer\r
+ return FALSE;\r
+#else\r
*Marker = (VA_LIST) (DebugInfo + 1);\r
+#endif\r
*Format = (CHAR8 *)(((UINT64 *)*Marker) + 12);\r
\r
return TRUE;\r
// The first 12 * UINTN bytes of the string are really an \r
// arguement stack to support varargs on the Format string.\r
//\r
-#ifdef EFIARM\r
+#if (defined (EFIARM) || defined(__APPLE__))\r
// It is not legal C code to case VA_LIST to a pointer. VA_LIST can \r
// be a structure. \r
+ return FALSE;\r
#else\r
*Marker = (VA_LIST) (DebugInfo + 1);\r
*Format = (CHAR8 *)(((UINT64 *)*Marker) + 12);\r
#include "PeiLib.h"\r
#include "Print.h"\r
\r
-STATIC\r
-CHAR8 *\r
-GetFlagsAndWidth (\r
- IN CHAR8 *Format, \r
- OUT UINTN *Flags, \r
- OUT UINTN *Width,\r
- IN OUT VA_LIST *Marker\r
- );\r
\r
STATIC\r
UINTN\r
UINTN BufferLeft;\r
UINT64 Value;\r
EFI_GUID *TmpGUID;\r
-\r
+ BOOLEAN Done;\r
+ \r
//\r
// Process the format string. Stop if Buffer is over run.\r
//\r
\r
//\r
// Now it's time to parse what follows after %\r
- //\r
- Format = GetFlagsAndWidth (Format, &Flags, &Width, &Marker);\r
+ // \r
+ Flags = 0;\r
+ Width = 0;\r
+ for (Done = FALSE; !Done; ) {\r
+ Format++;\r
+ \r
+ switch (*Format) {\r
+ \r
+ case '-': Flags |= LEFT_JUSTIFY; break;\r
+ case '+': Flags |= PREFIX_SIGN; break;\r
+ case ' ': Flags |= PREFIX_BLANK; break;\r
+ case ',': Flags |= COMMA_TYPE; break;\r
+ case 'L':\r
+ case 'l': Flags |= LONG_TYPE; break;\r
+ \r
+ case '*':\r
+ Width = VA_ARG (Marker, UINTN);\r
+ break;\r
+ \r
+ case '0':\r
+ Flags |= PREFIX_ZERO;\r
+ case '1':\r
+ case '2':\r
+ case '3':\r
+ case '4':\r
+ case '5':\r
+ case '6':\r
+ case '7':\r
+ case '8':\r
+ case '9':\r
+ Count = 0;\r
+ do {\r
+ Count = (Count * 10) + *Format - '0';\r
+ Format++;\r
+ } while ((*Format >= '0') && (*Format <= '9'));\r
+ Format--;\r
+ Width = Count;\r
+ break;\r
+ \r
+ default:\r
+ Done = TRUE;\r
+ }\r
+ }\r
+\r
switch (*Format) {\r
case 'p':\r
//\r
\r
\r
\r
-STATIC\r
-CHAR8 *\r
-GetFlagsAndWidth (\r
- IN CHAR8 *Format, \r
- OUT UINTN *Flags, \r
- OUT UINTN *Width,\r
- IN OUT VA_LIST *Marker\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- AvSPrint worker function that parses flag and width information from the \r
- Format string and returns the next index into the Format string that needs\r
- to be parsed. See file headed for details of Flag and Width.\r
-\r
-Arguments:\r
-\r
- Format - Current location in the AvSPrint format string.\r
-\r
- Flags - Returns flags\r
-\r
- Width - Returns width of element\r
-\r
- Marker - Vararg list that may be paritally consumed and returned.\r
-\r
-Returns: \r
-\r
- Pointer indexed into the Format string for all the information parsed\r
- by this routine.\r
-\r
---*/\r
-{\r
- UINTN Count;\r
- BOOLEAN Done;\r
-\r
- *Flags = 0;\r
- *Width = 0;\r
- for (Done = FALSE; !Done; ) {\r
- Format++;\r
-\r
- switch (*Format) {\r
-\r
- case '-': *Flags |= LEFT_JUSTIFY; break;\r
- case '+': *Flags |= PREFIX_SIGN; break;\r
- case ' ': *Flags |= PREFIX_BLANK; break;\r
- case ',': *Flags |= COMMA_TYPE; break;\r
- case 'L':\r
- case 'l': *Flags |= LONG_TYPE; break;\r
-\r
- case '*':\r
- *Width = VA_ARG (*Marker, UINTN);\r
- break;\r
-\r
- case '0':\r
- *Flags |= PREFIX_ZERO;\r
- case '1':\r
- case '2':\r
- case '3':\r
- case '4':\r
- case '5':\r
- case '6':\r
- case '7':\r
- case '8':\r
- case '9':\r
- Count = 0;\r
- do {\r
- Count = (Count * 10) + *Format - '0';\r
- Format++;\r
- } while ((*Format >= '0') && (*Format <= '9'));\r
- Format--;\r
- *Width = Count;\r
- break;\r
-\r
- default:\r
- Done = TRUE;\r
- }\r
- }\r
- return Format;\r
-}\r
-\r
static CHAR8 mHexStr[] = { '0','1','2','3','4','5','6','7',\r
'8','9','A','B','C','D','E','F' };\r
\r
#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:
mov %r13,0x40(%rdx)
mov %r14,0x48(%rdx)
mov %r15,0x50(%rdx)
- #; save non-volatile fp registers\r
- stmxcsr 0x60(%rdx)\r
- lea 0x68(%rdx), %rax\r
- movdqu %xmm6, (%rax) \r
- movdqu %xmm7, 0x10(%rax)\r
- movdqu %xmm8, 0x20(%rax)\r
- movdqu %xmm9, 0x30(%rax)\r
- movdqu %xmm10, 0x40(%rax)\r
- movdqu %xmm11, 0x50(%rax)\r
- movdqu %xmm12, 0x60(%rax)\r
- movdqu %xmm13, 0x70(%rax)\r
- movdqu %xmm14, 0x80(%rax)\r
- movdqu %xmm15, 0x90(%rax)\r
+ #; 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
#
ASM_PFX(TransferControlLongJump):
# set return from SetJump to EFI_WARN_RETURN_FROM_LONG_JUMP
- #; load non-volatile fp registers\r
- ldmxcsr 0x60(%rdx)\r
- lea 0x68(%rdx), %rax\r
- movdqu (%rax), %xmm6\r
- movdqu 0x10(%rax), %xmm7\r
- movdqu 0x20(%rax), %xmm8\r
- movdqu 0x30(%rax), %xmm9\r
- movdqu 0x40(%rax), %xmm10\r
- movdqu 0x50(%rax), %xmm11\r
- movdqu 0x60(%rax), %xmm12\r
- movdqu 0x70(%rax), %xmm13\r
- movdqu 0x80(%rax), %xmm14\r
- movdqu 0x90(%rax), %xmm15\r
+ #; 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
#*****************************************************************************\r
#include <EfiBind.h>\r
\r
-\r
+#ifndef __APPLE__\r
\r
.data\r
\r
_16Idtr:\r
.word 0x3ff #FWORD (1 SHL 10) - 1\r
.byte 0x00\r
+\r
+#endif\r