mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-30 09:04:07 +02:00
Gcc cleanup
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5589 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
12b2b6c416
commit
6a28ac4441
@ -79,8 +79,8 @@ ASM_PFX(BackFromUserCode):
|
|||||||
.byte 0x16 # push ss
|
.byte 0x16 # push ss
|
||||||
.byte 0xe # push cs
|
.byte 0xe # push cs
|
||||||
.byte 0x66
|
.byte 0x66
|
||||||
call @Base # push eip
|
call L_Base # push eip
|
||||||
@Base:
|
L_Base:
|
||||||
.byte 0x66
|
.byte 0x66
|
||||||
pushq $0 # reserved high order 32 bits of EFlags
|
pushq $0 # reserved high order 32 bits of EFlags
|
||||||
.byte 0x66, 0x9c # pushfd actually
|
.byte 0x66, 0x9c # pushfd actually
|
||||||
@ -93,17 +93,17 @@ ASM_PFX(BackFromUserCode):
|
|||||||
.byte 0x66,0xba # mov edx, imm32
|
.byte 0x66,0xba # mov edx, imm32
|
||||||
_ThunkAttr: .space 4
|
_ThunkAttr: .space 4
|
||||||
testb $THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15, %dl
|
testb $THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15, %dl
|
||||||
jz @1
|
jz L_1
|
||||||
movl $0x15cd2401,%eax # mov ax, 2401h & int 15h
|
movl $0x15cd2401,%eax # mov ax, 2401h & int 15h
|
||||||
cli # disable interrupts
|
cli # disable interrupts
|
||||||
jnc @2
|
jnc L_2
|
||||||
@1:
|
L_1:
|
||||||
testb $THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL, %dl
|
testb $THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL, %dl
|
||||||
jz @2
|
jz L_2
|
||||||
inb $0x92,%al
|
inb $0x92,%al
|
||||||
orb $2,%al
|
orb $2,%al
|
||||||
outb %al, $0x92 # deactivate A20M#
|
outb %al, $0x92 # deactivate A20M#
|
||||||
@2:
|
L_2:
|
||||||
movl %ss,%eax
|
movl %ss,%eax
|
||||||
lea IA32_REGS_SIZE(%esp), %bp
|
lea IA32_REGS_SIZE(%esp), %bp
|
||||||
#
|
#
|
||||||
@ -116,9 +116,9 @@ _ThunkAttr: .space 4
|
|||||||
addw %ax,%bp # add ebp, eax
|
addw %ax,%bp # add ebp, eax
|
||||||
movw %cs,%ax
|
movw %cs,%ax
|
||||||
shlw $4,%ax
|
shlw $4,%ax
|
||||||
lea (@64BitCode - @Base)(%ebx, %eax), %ax
|
lea (L_64BitCode - L_Base)(%ebx, %eax), %ax
|
||||||
.byte 0x66,0x2e,0x89,0x87 # mov cs:[bx + (@64Eip - @Base)], eax
|
.byte 0x66,0x2e,0x89,0x87 # mov cs:[bx + (L_64Eip - L_Base)], eax
|
||||||
.word @64Eip - @Base
|
.word L_64Eip - L_Base
|
||||||
.byte 0x66,0xb8 # mov eax, imm32
|
.byte 0x66,0xb8 # mov eax, imm32
|
||||||
SavedCr4: .space 4
|
SavedCr4: .space 4
|
||||||
movq %rax, %cr4
|
movq %rax, %cr4
|
||||||
@ -126,7 +126,7 @@ SavedCr4: .space 4
|
|||||||
# rdi in the instruction below is indeed bx in 16-bit code
|
# rdi in the instruction below is indeed bx in 16-bit code
|
||||||
#
|
#
|
||||||
.byte 0x66,0x2e # 2eh is "cs:" segment override
|
.byte 0x66,0x2e # 2eh is "cs:" segment override
|
||||||
lgdt (SavedGdt - @Base)(%rdi)
|
lgdt (SavedGdt - L_Base)(%rdi)
|
||||||
.byte 0x66
|
.byte 0x66
|
||||||
movl $0xc0000080,%ecx
|
movl $0xc0000080,%ecx
|
||||||
rdmsr
|
rdmsr
|
||||||
@ -135,10 +135,10 @@ SavedCr4: .space 4
|
|||||||
.byte 0x66,0xb8 # mov eax, imm32
|
.byte 0x66,0xb8 # mov eax, imm32
|
||||||
SavedCr0: .space 4
|
SavedCr0: .space 4
|
||||||
movq %rax, %cr0
|
movq %rax, %cr0
|
||||||
.byte 0x66,0xea # jmp far cs:@64Bit
|
.byte 0x66,0xea # jmp far cs:L_64Bit
|
||||||
@64Eip: .space 4
|
L_64Eip: .space 4
|
||||||
SavedCs: .space 2
|
SavedCs: .space 2
|
||||||
@64BitCode:
|
L_64BitCode:
|
||||||
movq %r8, %rsp
|
movq %r8, %rsp
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@ -170,16 +170,16 @@ ASM_PFX(ToUserCode):
|
|||||||
movl %esi,%ss # set up 16-bit stack segment
|
movl %esi,%ss # set up 16-bit stack segment
|
||||||
movw %bx,%sp # set up 16-bit stack pointer
|
movw %bx,%sp # set up 16-bit stack pointer
|
||||||
.byte 0x66 # make the following call 32-bit
|
.byte 0x66 # make the following call 32-bit
|
||||||
call @Base1 # push eip
|
call L_Base1 # push eip
|
||||||
@Base1:
|
L_Base1:
|
||||||
popw %bp # ebp <- address of @Base1
|
popw %bp # ebp <- address of L_Base1
|
||||||
pushq (IA32_REGS_SIZE + 2)(%esp)
|
pushq (IA32_REGS_SIZE + 2)(%esp)
|
||||||
lea 0x0c(%rsi), %eax
|
lea 0x0c(%rsi), %eax
|
||||||
pushq %rax
|
pushq %rax
|
||||||
lret # execution begins at next instruction
|
lret # execution begins at next instruction
|
||||||
@RealMode:
|
L_RealMode:
|
||||||
.byte 0x66,0x2e # CS and operand size override
|
.byte 0x66,0x2e # CS and operand size override
|
||||||
lidt (_16Idtr - @Base1)(%rsi)
|
lidt (_16Idtr - L_Base1)(%rsi)
|
||||||
.byte 0x66,0x61 # popad
|
.byte 0x66,0x61 # popad
|
||||||
.byte 0x1f # pop ds
|
.byte 0x1f # pop ds
|
||||||
.byte 0x7 # pop es
|
.byte 0x7 # pop es
|
||||||
@ -273,14 +273,14 @@ ASM_PFX(InternalAsmThunk16):
|
|||||||
movl %edx,%ss
|
movl %edx,%ss
|
||||||
pushfq
|
pushfq
|
||||||
lea -8(%rdx), %edx
|
lea -8(%rdx), %edx
|
||||||
lea @RetFromRealMode, %r8
|
lea L_RetFromRealMode, %r8
|
||||||
pushq %r8
|
pushq %r8
|
||||||
movl %cs, %r8d
|
movl %cs, %r8d
|
||||||
movw %r8w, (SavedCs - SavedCr4)(%rcx)
|
movw %r8w, (SavedCs - SavedCr4)(%rcx)
|
||||||
movq %rsp, %r8
|
movq %rsp, %r8
|
||||||
.byte 0xff, 0x69 # jmp (_EntryPoint - SavedCr4)(%rcx)
|
.byte 0xff, 0x69 # jmp (_EntryPoint - SavedCr4)(%rcx)
|
||||||
.byte _EntryPoint - SavedCr4
|
.byte _EntryPoint - SavedCr4
|
||||||
@RetFromRealMode:
|
L_RetFromRealMode:
|
||||||
popfq
|
popfq
|
||||||
lidt 0x38(%rsp)
|
lidt 0x38(%rsp)
|
||||||
lea -IA32_REGS_SIZE(%rbp), %eax
|
lea -IA32_REGS_SIZE(%rbp), %eax
|
||||||
|
Loading…
x
Reference in New Issue
Block a user