Fix CRLF format

Signed-off-by: Tian, Hot <hot.tian@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15172 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Tian, Hot 2014-01-23 05:27:14 +00:00 committed by hhtian
parent 675723cbca
commit 2b53e39435
50 changed files with 2643 additions and 2643 deletions

View File

@ -1,70 +1,70 @@
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; ;
; Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR> ; Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials ; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License ; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at ; which accompanies this distribution. The full text of the license may be found at
; http://opensource.org/licenses/bsd-license.php ; http://opensource.org/licenses/bsd-license.php
; ;
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
; ;
; Module Name: ; Module Name:
; ;
; PageFaultHandler.asm ; PageFaultHandler.asm
; ;
; Abstract: ; Abstract:
; ;
; Defines page fault handler used to hook SMM IDT ; Defines page fault handler used to hook SMM IDT
; ;
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
EXTERN mOriginalHandler:QWORD EXTERN mOriginalHandler:QWORD
EXTERN PageFaultHandler:PROC EXTERN PageFaultHandler:PROC
.code .code
PageFaultHandlerHook PROC PageFaultHandlerHook PROC
push rax ; save all volatile registers push rax ; save all volatile registers
push rcx push rcx
push rdx push rdx
push r8 push r8
push r9 push r9
push r10 push r10
push r11 push r11
add rsp, -10h * 6 - 8 ; reserve memory to store XMM registers and make address 16-byte alignment add rsp, -10h * 6 - 8 ; reserve memory to store XMM registers and make address 16-byte alignment
movdqa [rsp], xmm0 movdqa [rsp], xmm0
movdqa [rsp + 10h], xmm1 movdqa [rsp + 10h], xmm1
movdqa [rsp + 20h], xmm2 movdqa [rsp + 20h], xmm2
movdqa [rsp + 30h], xmm3 movdqa [rsp + 30h], xmm3
movdqa [rsp + 40h], xmm4 movdqa [rsp + 40h], xmm4
movdqa [rsp + 50h], xmm5 movdqa [rsp + 50h], xmm5
add rsp, -20h add rsp, -20h
call PageFaultHandler call PageFaultHandler
add rsp, 20h add rsp, 20h
movdqa xmm0, [rsp] movdqa xmm0, [rsp]
movdqa xmm1, [rsp + 10h] movdqa xmm1, [rsp + 10h]
movdqa xmm2, [rsp + 20h] movdqa xmm2, [rsp + 20h]
movdqa xmm3, [rsp + 30h] movdqa xmm3, [rsp + 30h]
movdqa xmm4, [rsp + 40h] movdqa xmm4, [rsp + 40h]
movdqa xmm5, [rsp + 50h] movdqa xmm5, [rsp + 50h]
add rsp, 10h * 6 + 8 add rsp, 10h * 6 + 8
test al, al ; set ZF flag test al, al ; set ZF flag
pop r11 pop r11
pop r10 pop r10
pop r9 pop r9
pop r8 pop r8
pop rdx pop rdx
pop rcx pop rcx
pop rax ; restore all volatile registers pop rax ; restore all volatile registers
jnz @F ; check ZF flag jnz @F ; check ZF flag
jmp mOriginalHandler jmp mOriginalHandler
@@: @@:
add rsp, 08h ; skip error code for PF add rsp, 08h ; skip error code for PF
iretq iretq
PageFaultHandlerHook ENDP PageFaultHandlerHook ENDP
END END

View File

@ -1,42 +1,42 @@
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; ;
; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> ; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials ; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License ; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at ; which accompanies this distribution. The full text of the license may be found at
; http://opensource.org/licenses/bsd-license.php ; http://opensource.org/licenses/bsd-license.php
; ;
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
; ;
; Module Name: ; Module Name:
; ;
; CpuIdEx.Asm ; CpuIdEx.Asm
; ;
; Abstract: ; Abstract:
; ;
; AsmCpuidEx function ; AsmCpuidEx function
; ;
; Notes: ; Notes:
; ;
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
.686 .686
.model flat,C .model flat,C
.code .code
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; UINT32 ; UINT32
; EFIAPI ; EFIAPI
; AsmCpuidEx ( ; AsmCpuidEx (
; IN UINT32 RegisterInEax, ; IN UINT32 RegisterInEax,
; IN UINT32 RegisterInEcx, ; IN UINT32 RegisterInEcx,
; OUT UINT32 *RegisterOutEax OPTIONAL, ; OUT UINT32 *RegisterOutEax OPTIONAL,
; OUT UINT32 *RegisterOutEbx OPTIONAL, ; OUT UINT32 *RegisterOutEbx OPTIONAL,
; OUT UINT32 *RegisterOutEcx OPTIONAL, ; OUT UINT32 *RegisterOutEcx OPTIONAL,
; OUT UINT32 *RegisterOutEdx OPTIONAL ; OUT UINT32 *RegisterOutEdx OPTIONAL
; ) ; )
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
AsmCpuidEx PROC USES ebx AsmCpuidEx PROC USES ebx
push ebp push ebp
mov ebp, esp mov ebp, esp
@ -64,5 +64,5 @@ AsmCpuidEx PROC USES ebx
leave leave
ret ret
AsmCpuidEx ENDP AsmCpuidEx ENDP
END END

View File

@ -1,26 +1,26 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# CpuBreakpoint.S # CpuBreakpoint.S
# #
# Abstract: # Abstract:
# #
# Implementation of CpuBreakpoint() on x86_64 # Implementation of CpuBreakpoint() on x86_64
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
.globl ASM_PFX(CpuBreakpoint) .globl ASM_PFX(CpuBreakpoint)
ASM_PFX(CpuBreakpoint): ASM_PFX(CpuBreakpoint):
int $0x3 int $0x3
ret ret

View File

@ -1,62 +1,62 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# CpuId.S # CpuId.S
# #
# Abstract: # Abstract:
# #
# AsmCpuid function # AsmCpuid function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# AsmCpuid ( # AsmCpuid (
# IN UINT32 RegisterInEax, # IN UINT32 RegisterInEax,
# OUT UINT32 *RegisterOutEax OPTIONAL, # OUT UINT32 *RegisterOutEax OPTIONAL,
# OUT UINT32 *RegisterOutEbx OPTIONAL, # OUT UINT32 *RegisterOutEbx OPTIONAL,
# OUT UINT32 *RegisterOutEcx OPTIONAL, # OUT UINT32 *RegisterOutEcx OPTIONAL,
# OUT UINT32 *RegisterOutEdx OPTIONAL # OUT UINT32 *RegisterOutEdx OPTIONAL
# ) # )
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(AsmCpuid) .globl ASM_PFX(AsmCpuid)
ASM_PFX(AsmCpuid): ASM_PFX(AsmCpuid):
push %rbx push %rbx
mov %ecx, %eax mov %ecx, %eax
push %rax # save Index on stack push %rax # save Index on stack
push %rdx push %rdx
cpuid cpuid
test %r9, %r9 test %r9, %r9
jz L1 jz L1
mov %ecx, (%r9) mov %ecx, (%r9)
L1: L1:
pop %rcx pop %rcx
jrcxz L2 jrcxz L2
mov %eax, (%rcx) mov %eax, (%rcx)
L2: L2:
mov %r8, %rcx mov %r8, %rcx
jrcxz L3 jrcxz L3
mov %ebx, (%rcx) mov %ebx, (%rcx)
L3: L3:
mov 0x38(%rsp), %rcx mov 0x38(%rsp), %rcx
jrcxz L4 jrcxz L4
mov %edx, (%rcx) mov %edx, (%rcx)
L4: L4:
pop %rax # restore Index to rax as return value pop %rax # restore Index to rax as return value
pop %rbx pop %rbx
ret ret

View File

@ -1,63 +1,63 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# CpuIdEx.Asm # CpuIdEx.Asm
# #
# Abstract: # Abstract:
# #
# AsmCpuidEx function # AsmCpuidEx function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT32 # UINT32
# EFIAPI # EFIAPI
# AsmCpuidEx ( # AsmCpuidEx (
# IN UINT32 RegisterInEax, # IN UINT32 RegisterInEax,
# IN UINT32 RegisterInEcx, # IN UINT32 RegisterInEcx,
# OUT UINT32 *RegisterOutEax OPTIONAL, # OUT UINT32 *RegisterOutEax OPTIONAL,
# OUT UINT32 *RegisterOutEbx OPTIONAL, # OUT UINT32 *RegisterOutEbx OPTIONAL,
# OUT UINT32 *RegisterOutEcx OPTIONAL, # OUT UINT32 *RegisterOutEcx OPTIONAL,
# OUT UINT32 *RegisterOutEdx OPTIONAL # OUT UINT32 *RegisterOutEdx OPTIONAL
# ) # )
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(AsmCpuidEx) .globl ASM_PFX(AsmCpuidEx)
ASM_PFX(AsmCpuidEx): ASM_PFX(AsmCpuidEx):
push %rbx push %rbx
movl %ecx,%eax movl %ecx,%eax
movl %edx,%ecx movl %edx,%ecx
push %rax push %rax
cpuid cpuid
mov 0x38(%rsp), %r10 mov 0x38(%rsp), %r10
test %r10, %r10 test %r10, %r10
jz L1 jz L1
mov %ecx,(%r10) mov %ecx,(%r10)
L1: L1:
mov %r8, %rcx mov %r8, %rcx
jrcxz L2 jrcxz L2
movl %eax,(%rcx) movl %eax,(%rcx)
L2: L2:
mov %r9, %rcx mov %r9, %rcx
jrcxz L3 jrcxz L3
mov %ebx, (%rcx) mov %ebx, (%rcx)
L3: L3:
mov 0x40(%rsp), %rcx mov 0x40(%rsp), %rcx
jrcxz L4 jrcxz L4
mov %edx, (%rcx) mov %edx, (%rcx)
L4: L4:
pop %rax pop %rax
pop %rbx pop %rbx
ret ret

View File

@ -1,66 +1,66 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# DisablePaging64.S # DisablePaging64.S
# #
# Abstract: # Abstract:
# #
# AsmDisablePaging64 function # AsmDisablePaging64 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# InternalX86DisablePaging64 ( # InternalX86DisablePaging64 (
# IN UINT16 Cs, %rdi # IN UINT16 Cs, %rdi
# IN UINT64 EntryPoint, %rsi # IN UINT64 EntryPoint, %rsi
# IN UINT64 Context1, OPTIONAL %rdx # IN UINT64 Context1, OPTIONAL %rdx
# IN UINT32 Context2, OPTIONAL %rcx # IN UINT32 Context2, OPTIONAL %rcx
# IN UINT64 NewStack %r8 # IN UINT64 NewStack %r8
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(InternalX86DisablePaging64) .globl ASM_PFX(InternalX86DisablePaging64)
ASM_PFX(InternalX86DisablePaging64): ASM_PFX(InternalX86DisablePaging64):
cli cli
shl $0x20,%rcx shl $0x20,%rcx
lea (%rip), %eax lea (%rip), %eax
mov %eax,%ecx mov %eax,%ecx
push %rcx push %rcx
mov %edx,%ebx mov %edx,%ebx
mov %r8d,%esi mov %r8d,%esi
mov %r9d,%edi mov %r9d,%edi
mov 0x28(%rsp),%eax mov 0x28(%rsp),%eax
lret lret
L1: L1:
mov %eax,%esp mov %eax,%esp
mov %cr0,%rax mov %cr0,%rax
btr $0x1f,%eax btr $0x1f,%eax
mov %rax,%cr0 mov %rax,%cr0
mov $0xc0000080,%ecx mov $0xc0000080,%ecx
rdmsr rdmsr
and $0xfe,%ah and $0xfe,%ah
wrmsr wrmsr
mov %cr4,%rax mov %cr4,%rax
and $0xdf,%al and $0xdf,%al
mov %rax,%cr4 mov %rax,%cr4
push %rdi push %rdi
push %rsi push %rsi
callq *%rbx callq *%rbx
jmp . jmp .

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# EnableDisableInterrupts.S # EnableDisableInterrupts.S
# #
# Abstract: # Abstract:
# #
# EnableDisableInterrupts function # EnableDisableInterrupts function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# EnableDisableInterrupts ( # EnableDisableInterrupts (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(EnableDisableInterrupts) .globl ASM_PFX(EnableDisableInterrupts)
ASM_PFX(EnableDisableInterrupts): ASM_PFX(EnableDisableInterrupts):
sti sti
cli cli
ret ret

View File

@ -1,35 +1,35 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# EnableInterrupts.S # EnableInterrupts.S
# #
# Abstract: # Abstract:
# #
# EnableInterrupts function # EnableInterrupts function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# EnableInterrupts ( # EnableInterrupts (
# VOID # VOID
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(EnableInterrupts) .globl ASM_PFX(EnableInterrupts)
ASM_PFX(EnableInterrupts): ASM_PFX(EnableInterrupts):
sti sti
ret ret

View File

@ -1,61 +1,61 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# EnablePaging64.S # EnablePaging64.S
# #
# Abstract: # Abstract:
# #
# AsmEnablePaging64 function # AsmEnablePaging64 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# InternalX86EnablePaging64 ( # InternalX86EnablePaging64 (
# IN UINT16 Cs, %rdi # IN UINT16 Cs, %rdi
# IN UINT64 EntryPoint, %rsi # IN UINT64 EntryPoint, %rsi
# IN UINT64 Context1, OPTIONAL %rdx # IN UINT64 Context1, OPTIONAL %rdx
# IN UINT64 Context2, OPTIONAL %rcx # IN UINT64 Context2, OPTIONAL %rcx
# IN UINT64 NewStack %r8 # IN UINT64 NewStack %r8
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(InternalX86EnablePaging64) .globl ASM_PFX(InternalX86EnablePaging64)
ASM_PFX(InternalX86EnablePaging64): ASM_PFX(InternalX86EnablePaging64):
cli cli
pop %rax pop %rax
callq Base callq Base
Base: Base:
addl $(L1-Base),(%rsp) addl $(L1-Base),(%rsp)
mov %cr4,%rax mov %cr4,%rax
or $0x20,%al or $0x20,%al
mov %rax,%cr4 mov %rax,%cr4
mov $0xc0000080,%ecx mov $0xc0000080,%ecx
rdmsr rdmsr
or $0x1,%ah or $0x1,%ah
wrmsr wrmsr
mov %cr0,%rax mov %cr0,%rax
bts $0x1f,%eax bts $0x1f,%eax
mov %rax,%cr0 mov %rax,%cr0
lret lret
L1: L1:
addr32 mov (%esp),%rbx addr32 mov (%esp),%rbx
addr32 mov 0x8(%esp),%rcx addr32 mov 0x8(%esp),%rcx
addr32 mov 0x10(%esp),%rdx addr32 mov 0x10(%esp),%rdx
addr32 mov 0x18(%esp),%rsp addr32 mov 0x18(%esp),%rsp
add $-0x20,%rsp add $-0x20,%rsp
callq *%rbx callq *%rbx
jmp . jmp .

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# FlushCacheLine.S # FlushCacheLine.S
# #
# Abstract: # Abstract:
# #
# AsmFlushCacheLine function # AsmFlushCacheLine function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID * # VOID *
# EFIAPI # EFIAPI
# AsmFlushCacheLine ( # AsmFlushCacheLine (
# IN VOID *LinearAddress # IN VOID *LinearAddress
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(AsmFlushCacheLine) .globl ASM_PFX(AsmFlushCacheLine)
ASM_PFX(AsmFlushCacheLine): ASM_PFX(AsmFlushCacheLine):
clflush (%rdi) clflush (%rdi)
mov %rdi, %rax mov %rdi, %rax
ret ret

View File

@ -1,35 +1,35 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# FxRestore.S # FxRestore.S
# #
# Abstract: # Abstract:
# #
# AsmFxRestore function # AsmFxRestore function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# InternalX86FxRestore ( # InternalX86FxRestore (
# IN CONST IA32_FX_BUFFER *Buffer # IN CONST IA32_FX_BUFFER *Buffer
# )# # )#
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(InternalX86FxRestore) .globl ASM_PFX(InternalX86FxRestore)
ASM_PFX(InternalX86FxRestore): ASM_PFX(InternalX86FxRestore):
fxrstor (%rcx) fxrstor (%rcx)
ret ret

View File

@ -1,35 +1,35 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# FxSave.S # FxSave.S
# #
# Abstract: # Abstract:
# #
# AsmFxSave function # AsmFxSave function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# InternalX86FxSave ( # InternalX86FxSave (
# OUT IA32_FX_BUFFER *Buffer # OUT IA32_FX_BUFFER *Buffer
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(InternalX86FxSave) .globl ASM_PFX(InternalX86FxSave)
ASM_PFX(InternalX86FxSave): ASM_PFX(InternalX86FxSave):
fxsave (%rcx) fxsave (%rcx)
ret ret

View File

@ -1,38 +1,38 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# InterlockedCompareExchange64.S # InterlockedCompareExchange64.S
# #
# Abstract: # Abstract:
# #
# InterlockedCompareExchange64 function # InterlockedCompareExchange64 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT64 # UINT64
# EFIAPI # EFIAPI
# InterlockedCompareExchange64 ( # InterlockedCompareExchange64 (
# IN UINT64 *Value, # IN UINT64 *Value,
# IN UINT64 CompareValue, # IN UINT64 CompareValue,
# IN UINT64 ExchangeValue # IN UINT64 ExchangeValue
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(InternalSyncCompareExchange64) .globl ASM_PFX(InternalSyncCompareExchange64)
ASM_PFX(InternalSyncCompareExchange64): ASM_PFX(InternalSyncCompareExchange64):
mov %rsi, %rax mov %rsi, %rax
lock cmpxchg %rdx,(%rdi) lock cmpxchg %rdx,(%rdi)
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# InterlockedDecrement.S # InterlockedDecrement.S
# #
# Abstract: # Abstract:
# #
# InterlockedDecrement function # InterlockedDecrement function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT32 # UINT32
# EFIAPI # EFIAPI
# InterlockedDecrement ( # InterlockedDecrement (
# IN UINT32 *Value # IN UINT32 *Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(InternalSyncDecrement) .globl ASM_PFX(InternalSyncDecrement)
ASM_PFX(InternalSyncDecrement): ASM_PFX(InternalSyncDecrement):
lock decl (%rcx) lock decl (%rcx)
mov (%rcx), %eax mov (%rcx), %eax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# InterlockedIncrement.S # InterlockedIncrement.S
# #
# Abstract: # Abstract:
# #
# InterlockedIncrement function # InterlockedIncrement function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT32 # UINT32
# EFIAPI # EFIAPI
# InterlockedIncrement ( # InterlockedIncrement (
# IN UINT32 *Value # IN UINT32 *Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(InternalSyncIncrement) .globl ASM_PFX(InternalSyncIncrement)
ASM_PFX(InternalSyncIncrement): ASM_PFX(InternalSyncIncrement):
lock incl (%rcx) lock incl (%rcx)
mov (%rcx), %eax mov (%rcx), %eax
ret ret

View File

@ -1,35 +1,35 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# Invd.S # Invd.S
# #
# Abstract: # Abstract:
# #
# AsmInvd function # AsmInvd function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# AsmInvd ( # AsmInvd (
# VOID # VOID
# )# # )#
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(AsmInvd) .globl ASM_PFX(AsmInvd)
ASM_PFX(AsmInvd): ASM_PFX(AsmInvd):
invd invd
ret ret

View File

@ -1,54 +1,54 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# SetJump.S # SetJump.S
# #
# Abstract: # Abstract:
# #
# Implementation of SetJump() on x86_64 # Implementation of SetJump() on x86_64
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
.globl ASM_PFX(SetJump) .globl ASM_PFX(SetJump)
ASM_PFX(SetJump): ASM_PFX(SetJump):
push %rcx push %rcx
add $0xffffffffffffffe0,%rsp add $0xffffffffffffffe0,%rsp
call ASM_PFX(InternalAssertJumpBuffer) call ASM_PFX(InternalAssertJumpBuffer)
add $0x20,%rsp add $0x20,%rsp
pop %rcx pop %rcx
pop %rdx pop %rdx
mov %rbx,(%rcx) mov %rbx,(%rcx)
mov %rsp,0x8(%rcx) mov %rsp,0x8(%rcx)
mov %rbp,0x10(%rcx) mov %rbp,0x10(%rcx)
mov %rdi,0x18(%rcx) mov %rdi,0x18(%rcx)
mov %rsi,0x20(%rcx) mov %rsi,0x20(%rcx)
mov %r12,0x28(%rcx) mov %r12,0x28(%rcx)
mov %r13,0x30(%rcx) mov %r13,0x30(%rcx)
mov %r14,0x38(%rcx) mov %r14,0x38(%rcx)
mov %r15,0x40(%rcx) mov %r15,0x40(%rcx)
mov %rdx,0x48(%rcx) mov %rdx,0x48(%rcx)
# save non-volatile fp registers # save non-volatile fp registers
stmxcsr 0x50(%rcx) stmxcsr 0x50(%rcx)
movdqu %xmm6, 0x58(%rcx) movdqu %xmm6, 0x58(%rcx)
movdqu %xmm7, 0x68(%rcx) movdqu %xmm7, 0x68(%rcx)
movdqu %xmm8, 0x78(%rcx) movdqu %xmm8, 0x78(%rcx)
movdqu %xmm9, 0x88(%rcx) movdqu %xmm9, 0x88(%rcx)
movdqu %xmm10, 0x98(%rcx) movdqu %xmm10, 0x98(%rcx)
movdqu %xmm11, 0xA8(%rcx) movdqu %xmm11, 0xA8(%rcx)
movdqu %xmm12, 0xB8(%rcx) movdqu %xmm12, 0xB8(%rcx)
movdqu %xmm13, 0xC8(%rcx) movdqu %xmm13, 0xC8(%rcx)
movdqu %xmm14, 0xD8(%rcx) movdqu %xmm14, 0xD8(%rcx)
movdqu %xmm15, 0xE8(%rcx) movdqu %xmm15, 0xE8(%rcx)
xor %rax,%rax xor %rax,%rax
jmpq *%rdx jmpq *%rdx

View File

@ -1,44 +1,44 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# SwitchStack.S # SwitchStack.S
# #
# Abstract: # Abstract:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# Routine Description: # Routine Description:
# #
# Routine for switching stacks with 1 parameter # Routine for switching stacks with 1 parameter
# #
# Arguments: # Arguments:
# #
# (rdi) EntryPoint - Entry point with new stack. # (rdi) EntryPoint - Entry point with new stack.
# (rsi) Context1 - Parameter1 for entry point. # (rsi) Context1 - Parameter1 for entry point.
# (rdx) Context2 - Parameter2 for entry point. # (rdx) Context2 - Parameter2 for entry point.
# (rcx) NewStack - Pointer to new stack. # (rcx) NewStack - Pointer to new stack.
# #
# Returns: # Returns:
# #
# None # None
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(InternalSwitchStack) .globl ASM_PFX(InternalSwitchStack)
ASM_PFX(InternalSwitchStack): ASM_PFX(InternalSwitchStack):
mov %rcx, %rax mov %rcx, %rax
mov %rdx, %rcx mov %rdx, %rcx
mov %r8, %rdx mov %r8, %rdx
lea -0x20(%r9), %rsp lea -0x20(%r9), %rsp
call *%rax call *%rax

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteCr0.S # WriteCr0.S
# #
# Abstract: # Abstract:
# #
# AsmWriteCr0 function # AsmWriteCr0 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINTN # UINTN
# EFIAPI # EFIAPI
# AsmWriteCr0 ( # AsmWriteCr0 (
# UINTN Cr0 # UINTN Cr0
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(AsmWriteCr0) .globl ASM_PFX(AsmWriteCr0)
ASM_PFX(AsmWriteCr0): ASM_PFX(AsmWriteCr0):
mov %rcx,%cr0 mov %rcx,%cr0
mov %rcx,%rax mov %rcx,%rax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteCr2.S # WriteCr2.S
# #
# Abstract: # Abstract:
# #
# AsmWriteCr2 function # AsmWriteCr2 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINTN # UINTN
# EFIAPI # EFIAPI
# AsmWriteCr2 ( # AsmWriteCr2 (
# UINTN Cr2 # UINTN Cr2
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(AsmWriteCr2) .globl ASM_PFX(AsmWriteCr2)
ASM_PFX(AsmWriteCr2): ASM_PFX(AsmWriteCr2):
mov %rcx,%cr2 mov %rcx,%cr2
mov %rcx,%rax mov %rcx,%rax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteCr3.S # WriteCr3.S
# #
# Abstract: # Abstract:
# #
# AsmWriteCr3 function # AsmWriteCr3 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINTN # UINTN
# EFIAPI # EFIAPI
# AsmWriteCr3 ( # AsmWriteCr3 (
# UINTN Cr3 # UINTN Cr3
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(AsmWriteCr3) .globl ASM_PFX(AsmWriteCr3)
ASM_PFX(AsmWriteCr3): ASM_PFX(AsmWriteCr3):
mov %rcx,%cr3 mov %rcx,%cr3
mov %rcx,%rax mov %rcx,%rax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteCr4.S # WriteCr4.S
# #
# Abstract: # Abstract:
# #
# AsmWriteCr4 function # AsmWriteCr4 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINTN # UINTN
# EFIAPI # EFIAPI
# AsmWriteCr4 ( # AsmWriteCr4 (
# UINTN Cr4 # UINTN Cr4
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(AsmWriteCr4) .globl ASM_PFX(AsmWriteCr4)
ASM_PFX(AsmWriteCr4): ASM_PFX(AsmWriteCr4):
mov %rcx,%cr4 mov %rcx,%cr4
mov %rcx,%rax mov %rcx,%rax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteDr4.S # WriteDr4.S
# #
# Abstract: # Abstract:
# #
# AsmWriteDr4 function # AsmWriteDr4 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINTN # UINTN
# EFIAPI # EFIAPI
# AsmWriteDr4 ( # AsmWriteDr4 (
# IN UINTN Value # IN UINTN Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(AsmWriteDr4) .globl ASM_PFX(AsmWriteDr4)
ASM_PFX(AsmWriteDr4): ASM_PFX(AsmWriteDr4):
mov %rcx, %dr4 mov %rcx, %dr4
mov %rcx, %rax mov %rcx, %rax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteDr5.S # WriteDr5.S
# #
# Abstract: # Abstract:
# #
# AsmWriteDr5 function # AsmWriteDr5 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINTN # UINTN
# EFIAPI # EFIAPI
# AsmWriteDr5 ( # AsmWriteDr5 (
# IN UINTN Value # IN UINTN Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(AsmWriteDr5) .globl ASM_PFX(AsmWriteDr5)
ASM_PFX(AsmWriteDr5): ASM_PFX(AsmWriteDr5):
mov %rcx, %dr5 mov %rcx, %dr5
mov %rcx, %rax mov %rcx, %rax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteDr6.S # WriteDr6.S
# #
# Abstract: # Abstract:
# #
# AsmWriteDr6 function # AsmWriteDr6 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINTN # UINTN
# EFIAPI # EFIAPI
# AsmWriteDr6 ( # AsmWriteDr6 (
# IN UINTN Value # IN UINTN Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(AsmWriteDr6) .globl ASM_PFX(AsmWriteDr6)
ASM_PFX(AsmWriteDr6): ASM_PFX(AsmWriteDr6):
mov %rcx, %dr6 mov %rcx, %dr6
mov %rcx, %rax mov %rcx, %rax
ret ret

View File

@ -1,36 +1,36 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteDr7.S # WriteDr7.S
# #
# Abstract: # Abstract:
# #
# AsmWriteDr7 function # AsmWriteDr7 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINTN # UINTN
# EFIAPI # EFIAPI
# AsmWriteDr7 ( # AsmWriteDr7 (
# IN UINTN Value # IN UINTN Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(AsmWriteDr7) .globl ASM_PFX(AsmWriteDr7)
ASM_PFX(AsmWriteDr7): ASM_PFX(AsmWriteDr7):
mov %rcx, %dr7 mov %rcx, %dr7
mov %rcx, %rax mov %rcx, %rax
ret ret

View File

@ -1,35 +1,35 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteGdtr.S # WriteGdtr.S
# #
# Abstract: # Abstract:
# #
# AsmWriteGdtr function # AsmWriteGdtr function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# InternalX86WriteGdtr ( # InternalX86WriteGdtr (
# IN CONST IA32_DESCRIPTOR *Idtr # IN CONST IA32_DESCRIPTOR *Idtr
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(InternalX86WriteGdtr) .globl ASM_PFX(InternalX86WriteGdtr)
ASM_PFX(InternalX86WriteGdtr): ASM_PFX(InternalX86WriteGdtr):
lgdt (%rcx) lgdt (%rcx)
ret ret

View File

@ -1,35 +1,35 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteIdtr.S # WriteIdtr.S
# #
# Abstract: # Abstract:
# #
# AsmWriteIdtr function # AsmWriteIdtr function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# InternalX86WriteIdtr ( # InternalX86WriteIdtr (
# IN CONST IA32_DESCRIPTOR *Idtr # IN CONST IA32_DESCRIPTOR *Idtr
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(InternalX86WriteIdtr) .globl ASM_PFX(InternalX86WriteIdtr)
ASM_PFX(InternalX86WriteIdtr): ASM_PFX(InternalX86WriteIdtr):
lidt (%rcx) lidt (%rcx)
ret ret

View File

@ -1,35 +1,35 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteLdtr.S # WriteLdtr.S
# #
# Abstract: # Abstract:
# #
# AsmWriteLdtr function # AsmWriteLdtr function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# AsmWriteLdtr ( # AsmWriteLdtr (
# IN UINT16 Ldtr # IN UINT16 Ldtr
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(AsmWriteLdtr); .globl ASM_PFX(AsmWriteLdtr);
ASM_PFX(AsmWriteLdtr): ASM_PFX(AsmWriteLdtr):
lldt %cx lldt %cx
ret ret

View File

@ -1,35 +1,35 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteMm0.S # WriteMm0.S
# #
# Abstract: # Abstract:
# #
# AsmWriteMm0 function # AsmWriteMm0 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# AsmWriteMm0 ( # AsmWriteMm0 (
# IN UINT64 Value # IN UINT64 Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(AsmWriteMm0); .globl ASM_PFX(AsmWriteMm0);
ASM_PFX(AsmWriteMm0): ASM_PFX(AsmWriteMm0):
movd %rcx, %xmm0 movd %rcx, %xmm0
ret ret

View File

@ -1,35 +1,35 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteMm1.S # WriteMm1.S
# #
# Abstract: # Abstract:
# #
# AsmWriteMm1 function # AsmWriteMm1 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# AsmWriteMm1 ( # AsmWriteMm1 (
# IN UINT64 Value # IN UINT64 Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(AsmWriteMm1); .globl ASM_PFX(AsmWriteMm1);
ASM_PFX(AsmWriteMm1): ASM_PFX(AsmWriteMm1):
movd %rcx, %mm1 movd %rcx, %mm1
ret ret

View File

@ -1,35 +1,35 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteMm2.S # WriteMm2.S
# #
# Abstract: # Abstract:
# #
# AsmWriteMm2 function # AsmWriteMm2 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# AsmWriteMm2 ( # AsmWriteMm2 (
# IN UINT64 Value # IN UINT64 Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(AsmWriteMm2) .globl ASM_PFX(AsmWriteMm2)
ASM_PFX(AsmWriteMm2): ASM_PFX(AsmWriteMm2):
movd %rcx, %mm2 movd %rcx, %mm2
ret ret

View File

@ -1,35 +1,35 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteMm3.S # WriteMm3.S
# #
# Abstract: # Abstract:
# #
# AsmWriteMm3 function # AsmWriteMm3 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# AsmWriteMm3 ( # AsmWriteMm3 (
# IN UINT64 Value # IN UINT64 Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(AsmWriteMm3) .globl ASM_PFX(AsmWriteMm3)
ASM_PFX(AsmWriteMm3): ASM_PFX(AsmWriteMm3):
movd %rcx, %mm3 movd %rcx, %mm3
ret ret

View File

@ -1,35 +1,35 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteMm4.S # WriteMm4.S
# #
# Abstract: # Abstract:
# #
# AsmWriteMm4 function # AsmWriteMm4 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# AsmWriteMm4 ( # AsmWriteMm4 (
# IN UINT64 Value # IN UINT64 Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(AsmWriteMm4) .globl ASM_PFX(AsmWriteMm4)
ASM_PFX(AsmWriteMm4): ASM_PFX(AsmWriteMm4):
movd %rcx, %mm4 movd %rcx, %mm4
ret ret

View File

@ -1,35 +1,35 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteMm5.S # WriteMm5.S
# #
# Abstract: # Abstract:
# #
# AsmWriteMm5 function # AsmWriteMm5 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# AsmWriteMm5 ( # AsmWriteMm5 (
# IN UINT64 Value # IN UINT64 Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(AsmWriteMm5) .globl ASM_PFX(AsmWriteMm5)
ASM_PFX(AsmWriteMm5): ASM_PFX(AsmWriteMm5):
movd %rcx, %mm5 movd %rcx, %mm5
ret ret

View File

@ -1,35 +1,35 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteMm6.S # WriteMm6.S
# #
# Abstract: # Abstract:
# #
# AsmWriteMm6 function # AsmWriteMm6 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# AsmWriteMm6 ( # AsmWriteMm6 (
# IN UINT64 Value # IN UINT64 Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(AsmWriteMm6) .globl ASM_PFX(AsmWriteMm6)
ASM_PFX(AsmWriteMm6): ASM_PFX(AsmWriteMm6):
movd %rcx, %mm6 movd %rcx, %mm6
ret ret

View File

@ -1,35 +1,35 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteMm7.S # WriteMm7.S
# #
# Abstract: # Abstract:
# #
# AsmWriteMm7 function # AsmWriteMm7 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# AsmWriteMm7 ( # AsmWriteMm7 (
# IN UINT64 Value # IN UINT64 Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(AsmWriteMm7) .globl ASM_PFX(AsmWriteMm7)
ASM_PFX(AsmWriteMm7): ASM_PFX(AsmWriteMm7):
movd %rcx, %mm7 movd %rcx, %mm7
ret ret

View File

@ -1,39 +1,39 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# WriteMsr64.S # WriteMsr64.S
# #
# Abstract: # Abstract:
# #
# AsmWriteMsr64 function # AsmWriteMsr64 function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EdkIIGlueBase.h> #include <EdkIIGlueBase.h>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT64 # UINT64
# EFIAPI # EFIAPI
# AsmWriteMsr64 ( # AsmWriteMsr64 (
# IN UINT32 Index, # IN UINT32 Index,
# IN UINT64 Value # IN UINT64 Value
# ); # );
# TODO: # TODO:
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(AsmWriteMsr64) .globl ASM_PFX(AsmWriteMsr64)
ASM_PFX(AsmWriteMsr64): ASM_PFX(AsmWriteMsr64):
mov %rdx, %rax mov %rdx, %rax
shr $0x20, %rdx shr $0x20, %rdx
wrmsr wrmsr
ret ret

View File

@ -1,66 +1,66 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# EfiCopyMemRep1.S # EfiCopyMemRep1.S
# #
# Abstract: # Abstract:
# #
# CopyMem function # CopyMem function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EfiBind.h> #include <EfiBind.h>
.code: .code:
.globl ASM_PFX(EfiCommonLibCopyMem) .globl ASM_PFX(EfiCommonLibCopyMem)
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EfiCommonLibCopyMem ( # EfiCommonLibCopyMem (
# OUT VOID *Destination, # OUT VOID *Destination,
# IN VOID *Source, # IN VOID *Source,
# IN UINTN Count # IN UINTN Count
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
ASM_PFX(EfiCommonLibCopyMem): ASM_PFX(EfiCommonLibCopyMem):
push %rsi push %rsi
push %rdi push %rdi
cmp %rcx,%rdx cmp %rcx,%rdx
je CopyMemDone je CopyMemDone
cmp $0x0,%r8 cmp $0x0,%r8
je CopyMemDone je CopyMemDone
mov %rdx,%rsi mov %rdx,%rsi
mov %rcx,%rdi mov %rcx,%rdi
lea -1(%r8,%rsi,1),%r9 lea -1(%r8,%rsi,1),%r9
cmp %rdi,%rsi cmp %rdi,%rsi
jae CopyBytes jae CopyBytes
cmp %rdi,%r9 cmp %rdi,%r9
jb CopyBytes jb CopyBytes
mov %r9,%rsi mov %r9,%rsi
lea -1(%r8,%rdi,1),%rdi lea -1(%r8,%rdi,1),%rdi
std std
CopyBytes: CopyBytes:
mov %r8,%rcx mov %r8,%rcx
rep movsb %ds:(%rsi),%es:(%rdi) rep movsb %ds:(%rsi),%es:(%rdi)
cld cld
CopyMemDone: CopyMemDone:
pop %rdi pop %rdi
pop %rsi pop %rsi
retq retq

View File

@ -1,54 +1,54 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# EfiSetMemRep4.S # EfiSetMemRep4.S
# #
# Abstract: # Abstract:
# #
# SetMem function # SetMem function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EfiBind.h> #include <EfiBind.h>
.code: .code:
.globl ASM_PFX(EfiCommonLibCopyMem) .globl ASM_PFX(EfiCommonLibCopyMem)
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EfiCommonLibSetMem ( # EfiCommonLibSetMem (
# OUT VOID *Buffer, # OUT VOID *Buffer,
# IN UINTN Size, # IN UINTN Size,
# IN UINT8 Value # IN UINT8 Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
ASM_PFX(EfiCommonLibSetMem): ASM_PFX(EfiCommonLibSetMem):
push %rdi push %rdi
cmp $0x0,%rdx cmp $0x0,%rdx
je SetDone je SetDone
mov %rcx,%rdi mov %rcx,%rdi
mov %r8b,%al mov %r8b,%al
mov %al,%ah mov %al,%ah
shrd $0x10,%eax,%ecx shrd $0x10,%eax,%ecx
shld $0x10,%ecx,%eax shld $0x10,%ecx,%eax
mov %rdx,%rcx mov %rdx,%rcx
shr $0x2,%rcx shr $0x2,%rcx
rep stos %eax,%es:(%rdi) rep stos %eax,%es:(%rdi)
mov %rdx,%rcx mov %rdx,%rcx
and $0x3,%rcx and $0x3,%rcx
rep stos %al,%es:(%rdi) rep stos %al,%es:(%rdi)
SetDone: SetDone:
pop %rdi pop %rdi
retq retq

View File

@ -1,46 +1,46 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# EfiZeroMemRep4.S # EfiZeroMemRep4.S
# #
# Abstract: # Abstract:
# #
# ZeroMem function # ZeroMem function
# #
# Notes: # Notes:
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EfiBind.h> #include <EfiBind.h>
.code: .code:
.globl ASM_PFX(EfiCommonLibZeroMem) .globl ASM_PFX(EfiCommonLibZeroMem)
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EfiCommonLibZeroMem ( # EfiCommonLibZeroMem (
# IN VOID *Buffer, # IN VOID *Buffer,
# IN UINTN Size # IN UINTN Size
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
ASM_PFX(EfiCommonLibZeroMem): ASM_PFX(EfiCommonLibZeroMem):
push %rdi push %rdi
xor %rax,%rax xor %rax,%rax
mov %rcx,%rdi mov %rcx,%rdi
mov %rdx,%rcx mov %rdx,%rcx
shr $0x2,%rcx shr $0x2,%rcx
and $0x3,%rdx and $0x3,%rdx
rep stos %eax,%es:(%rdi) rep stos %eax,%es:(%rdi)
mov %rdx,%rcx mov %rdx,%rcx
rep stos %al,%es:(%rdi) rep stos %al,%es:(%rdi)
pop %rdi pop %rdi
retq retq

View File

@ -1,207 +1,207 @@
# #
# Copyright (c) 2004, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# ProcessorAsms.Asm # ProcessorAsms.Asm
# #
# #
# #
#include "EfiBind.h" #include "EfiBind.h"
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.686P: .686P:
.MMX: .MMX:
#.MODEL SMALL #.MODEL SMALL
.CODE: .CODE:
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.globl ASM_PFX(TransferControlSetJump) .globl ASM_PFX(TransferControlSetJump)
.globl ASM_PFX(TransferControlLongJump) .globl ASM_PFX(TransferControlLongJump)
.globl ASM_PFX(SwitchStacks) .globl ASM_PFX(SwitchStacks)
.globl ASM_PFX(SwitchIplStacks) .globl ASM_PFX(SwitchIplStacks)
#define EFI_SUCCESS 0 #define EFI_SUCCESS 0
#define EFI_WARN_RETURN_FROM_LONG_JUMP 5 #define EFI_WARN_RETURN_FROM_LONG_JUMP 5
# #
# typedef struct { # typedef struct {
# UINT32 ebx; # UINT32 ebx;
# UINT32 esi; # UINT32 esi;
# UINT32 edi; # UINT32 edi;
# UINT32 ebp; # UINT32 ebp;
# UINT32 esp; # UINT32 esp;
# UINT32 eip; # UINT32 eip;
#} EFI_JUMP_BUFFER; #} EFI_JUMP_BUFFER;
# #
#typedef #typedef
#EFI_STATUS #EFI_STATUS
#(EFIAPI *EFI_PEI_TRANSFER_CONTROL_SET_JUMP) ( #(EFIAPI *EFI_PEI_TRANSFER_CONTROL_SET_JUMP) (
# IN EFI_PEI_TRANSFER_CONTROL_PROTOCOL *This, # IN EFI_PEI_TRANSFER_CONTROL_PROTOCOL *This,
# OUT EFI_JUMP_BUFFER *Context # OUT EFI_JUMP_BUFFER *Context
# ); # );
# #
#Routine Description: #Routine Description:
# #
# This routine implements the IA32 variant of the SetJump call. Its # This routine implements the IA32 variant of the SetJump call. Its
# responsibility is to store system state information for a possible # responsibility is to store system state information for a possible
# subsequent LongJump. # subsequent LongJump.
# #
#Arguments: #Arguments:
# #
# Pointer to CPU context save buffer. # Pointer to CPU context save buffer.
# #
#Returns: #Returns:
# #
# EFI_SUCCESS # EFI_SUCCESS
# #
ASM_PFX(TransferControlSetJump): ASM_PFX(TransferControlSetJump):
push %ebp push %ebp
mov %esp,%ebp mov %esp,%ebp
mov 0x8(%ebp),%eax mov 0x8(%ebp),%eax
mov 0xc(%ebp),%ecx mov 0xc(%ebp),%ecx
mov %ebx,(%ecx) mov %ebx,(%ecx)
mov %esi,0x4(%ecx) mov %esi,0x4(%ecx)
mov %edi,0x8(%ecx) mov %edi,0x8(%ecx)
mov 0x0(%ebp),%eax mov 0x0(%ebp),%eax
mov %eax,0xc(%ecx) mov %eax,0xc(%ecx)
lea 0x4(%ebp),%eax lea 0x4(%ebp),%eax
mov %eax,0x10(%ecx) mov %eax,0x10(%ecx)
mov 0x4(%ebp),%eax mov 0x4(%ebp),%eax
mov %eax,0x14(%ecx) mov %eax,0x14(%ecx)
mov $0x0,%eax mov $0x0,%eax
leave leave
ret ret
#typedef #typedef
#EFI_STATUS #EFI_STATUS
#(EFIAPI *EFI_PEI_TRANSFER_CONTROL_LONG_JUMP) ( #(EFIAPI *EFI_PEI_TRANSFER_CONTROL_LONG_JUMP) (
# IN EFI_PEI_TRANSFER_CONTROL_PROTOCOL *This, # IN EFI_PEI_TRANSFER_CONTROL_PROTOCOL *This,
# IN EFI_JUMP_BUFFER *Context # IN EFI_JUMP_BUFFER *Context
# ); # );
# #
# Routine Description: # Routine Description:
# #
# This routine implements the IA32 variant of the LongJump call. Its # This routine implements the IA32 variant of the LongJump call. Its
# responsibility is restore the system state to the Context Buffer and # responsibility is restore the system state to the Context Buffer and
# pass control back. # pass control back.
# #
# Arguments: # Arguments:
# #
# Pointer to CPU context save buffer. # Pointer to CPU context save buffer.
# #
# Returns: # Returns:
# #
# EFI_WARN_RETURN_FROM_LONG_JUMP # EFI_WARN_RETURN_FROM_LONG_JUMP
# #
ASM_PFX(TransferControlLongJump): ASM_PFX(TransferControlLongJump):
push %ebp push %ebp
mov %esp,%ebp mov %esp,%ebp
push %ebx push %ebx
push %esi push %esi
push %edi push %edi
mov 0x8(%ebp),%eax mov 0x8(%ebp),%eax
mov $0x5,%eax mov $0x5,%eax
mov 0xc(%ebp),%ecx mov 0xc(%ebp),%ecx
mov (%ecx),%ebx mov (%ecx),%ebx
mov 0x4(%ecx),%esi mov 0x4(%ecx),%esi
mov 0x8(%ecx),%edi mov 0x8(%ecx),%edi
mov 0xc(%ecx),%ebp mov 0xc(%ecx),%ebp
mov 0x10(%ecx),%esp mov 0x10(%ecx),%esp
add $0x4,%esp add $0x4,%esp
jmp *0x14(%ecx) jmp *0x14(%ecx)
mov $0x5,%eax mov $0x5,%eax
pop %edi pop %edi
pop %esi pop %esi
pop %ebx pop %ebx
leave leave
ret ret
# #
# Routine Description: # Routine Description:
# This allows the caller to switch the stack and goes to the new entry point # This allows the caller to switch the stack and goes to the new entry point
# #
# Arguments: # Arguments:
# EntryPoint - Pointer to the location to enter # EntryPoint - Pointer to the location to enter
# Parameter - Parameter to pass in # Parameter - Parameter to pass in
# NewStack - New Location of the stack # NewStack - New Location of the stack
# NewBsp - New BSP # NewBsp - New BSP
# #
# Returns: # Returns:
# #
# Nothing. Goes to the Entry Point passing in the new parameters # Nothing. Goes to the Entry Point passing in the new parameters
# #
#SwitchStacks PROC C \ #SwitchStacks PROC C \
# EntryPoint:PTR DWORD, \ # EntryPoint:PTR DWORD, \
# Parameter:DWORD, \ # Parameter:DWORD, \
# NewStack:PTR DWORD, \ # NewStack:PTR DWORD, \
# NewBsp:PTR DWORD # NewBsp:PTR DWORD
ASM_PFX(SwitchStacks): ASM_PFX(SwitchStacks):
push %ebp push %ebp
mov %esp,%ebp mov %esp,%ebp
push %ebx push %ebx
mov 0x14(%ebp),%eax mov 0x14(%ebp),%eax
mov 0xc(%ebp),%ebx mov 0xc(%ebp),%ebx
mov 0x8(%ebp),%ecx mov 0x8(%ebp),%ecx
mov 0x10(%ebp),%eax mov 0x10(%ebp),%eax
mov %eax,%esp mov %eax,%esp
push %ebx push %ebx
push $0x0 push $0x0
jmp *%ecx jmp *%ecx
pop %ebx pop %ebx
leave leave
ret ret
# #
# Routine Description: # Routine Description:
# This allows the caller to switch the stack and goes to the new entry point # This allows the caller to switch the stack and goes to the new entry point
# #
# Arguments: # Arguments:
# EntryPoint - Pointer to the location to enter # EntryPoint - Pointer to the location to enter
# Parameter1/Parameter2 - Parameter to pass in # Parameter1/Parameter2 - Parameter to pass in
# NewStack - New Location of the stack # NewStack - New Location of the stack
# NewBsp - New BSP # NewBsp - New BSP
# #
# Returns: # Returns:
# #
# Nothing. Goes to the Entry Point passing in the new parameters # Nothing. Goes to the Entry Point passing in the new parameters
# #
#SwitchIplStacks PROC C \ #SwitchIplStacks PROC C \
# EntryPoint:PTR DWORD, \ # EntryPoint:PTR DWORD, \
# Parameter1:DWORD, \ # Parameter1:DWORD, \
# Parameter2:DWORD, \ # Parameter2:DWORD, \
# NewStack:PTR DWORD, \ # NewStack:PTR DWORD, \
# NewBsp:PTR DWORD # NewBsp:PTR DWORD
ASM_PFX(SwitchIplStacks): ASM_PFX(SwitchIplStacks):
push %ebp push %ebp
mov %esp,%ebp mov %esp,%ebp
push %ebx push %ebx
mov 0x18(%ebp),%eax mov 0x18(%ebp),%eax
mov 0xc(%ebp),%ebx mov 0xc(%ebp),%ebx
mov 0x10(%ebp),%edx mov 0x10(%ebp),%edx
mov 0x8(%ebp),%ecx mov 0x8(%ebp),%ecx
mov 0x14(%ebp),%eax mov 0x14(%ebp),%eax
mov %eax,%esp mov %eax,%esp
push %edx push %edx
push %ebx push %ebx
call *%ecx call *%ecx
pop %ebx pop %ebx
leave leave
ret ret
#SwitchIplStacks ENDP #SwitchIplStacks ENDP

View File

@ -1,161 +1,161 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# ProcessorAsms.S # ProcessorAsms.S
# #
# Abstract: # Abstract:
# This is separated from processor.c to allow this functions to be built with /O1 # This is separated from processor.c to allow this functions to be built with /O1
# #
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EfiBind.h> #include <EfiBind.h>
.text .text
.globl ASM_PFX(SwitchStacks) .globl ASM_PFX(SwitchStacks)
.globl ASM_PFX(TransferControlSetJump) .globl ASM_PFX(TransferControlSetJump)
.globl ASM_PFX(TransferControlLongJump) .globl ASM_PFX(TransferControlLongJump)
# #
# Routine Description: # Routine Description:
# This allows the caller to switch the stack and goes to the new entry point # This allows the caller to switch the stack and goes to the new entry point
# #
# Arguments: # Arguments:
# EntryPoint - Pointer to the location to enter // rcx # EntryPoint - Pointer to the location to enter // rcx
# Parameter - Parameter to pass in // rdx # Parameter - Parameter to pass in // rdx
# NewStack - New Location of the stack // r8 # NewStack - New Location of the stack // r8
# NewBsp - New BSP // r9 - not used # NewBsp - New BSP // r9 - not used
# #
# Returns: # Returns:
# Nothing. Goes to the Entry Point passing in the new parameters # Nothing. Goes to the Entry Point passing in the new parameters
# #
ASM_PFX(SwitchStacks): ASM_PFX(SwitchStacks):
# Adjust stack for # Adjust stack for
# 1) leave 4 registers space # 1) leave 4 registers space
# 2) let it 16 bytes aligned after call # 2) let it 16 bytes aligned after call
sub $0x20,%r8 sub $0x20,%r8
and -0x10,%r8w # do not assume 16 bytes aligned and -0x10,%r8w # do not assume 16 bytes aligned
mov %r8,%rsp mov %r8,%rsp
mov %rcx,%r10 mov %rcx,%r10
mov %rdx,%rcx mov %rdx,%rcx
callq *%r10 callq *%r10
# #
# no ret as we have a new stack and we jumped to the new location # no ret as we have a new stack and we jumped to the new location
# #
ret ret
#SwitchStacks ENDP #SwitchStacks ENDP
.set EFI_SUCCESS, 0 .set EFI_SUCCESS, 0
.set EFI_WARN_RETURN_FROM_LONG_JUMP, 5 .set EFI_WARN_RETURN_FROM_LONG_JUMP, 5
# #
#Routine Description: #Routine Description:
# #
# This routine implements the x64 variant of the SetJump call. Its # This routine implements the x64 variant of the SetJump call. Its
# responsibility is to store system state information for a possible # responsibility is to store system state information for a possible
# subsequent LongJump. # subsequent LongJump.
# #
#Arguments: #Arguments:
# #
# Pointer to CPU context save buffer. # Pointer to CPU context save buffer.
# #
#Returns: #Returns:
# #
# EFI_SUCCESS # EFI_SUCCESS
# #
# EFI_STATUS # EFI_STATUS
# EFIAPI # EFIAPI
# TransferControlLongJump ( # TransferControlLongJump (
# IN EFI_PEI_TRANSFER_CONTROL_PROTOCOL *This, # IN EFI_PEI_TRANSFER_CONTROL_PROTOCOL *This,
# IN EFI_JUMP_BUFFER *Jump # IN EFI_JUMP_BUFFER *Jump
# ); # );
# #
# rcx - *This # rcx - *This
# rdx - JumpBuffer # rdx - JumpBuffer
# #
ASM_PFX(TransferControlSetJump): ASM_PFX(TransferControlSetJump):
mov %rbx,(%rdx) mov %rbx,(%rdx)
mov %rsp,0x8(%rdx) mov %rsp,0x8(%rdx)
mov %rbp,0x10(%rdx) mov %rbp,0x10(%rdx)
mov %rdi,0x18(%rdx) mov %rdi,0x18(%rdx)
mov %rsi,0x20(%rdx) mov %rsi,0x20(%rdx)
mov %r10,0x28(%rdx) mov %r10,0x28(%rdx)
mov %r11,0x30(%rdx) mov %r11,0x30(%rdx)
mov %r12,0x38(%rdx) mov %r12,0x38(%rdx)
mov %r13,0x40(%rdx) mov %r13,0x40(%rdx)
mov %r14,0x48(%rdx) mov %r14,0x48(%rdx)
mov %r15,0x50(%rdx) mov %r15,0x50(%rdx)
#; save non-volatile fp registers #; save non-volatile fp registers
stmxcsr 0x60(%rdx) stmxcsr 0x60(%rdx)
lea 0x68(%rdx), %rax lea 0x68(%rdx), %rax
movdqu %xmm6, (%rax) movdqu %xmm6, (%rax)
movdqu %xmm7, 0x10(%rax) movdqu %xmm7, 0x10(%rax)
movdqu %xmm8, 0x20(%rax) movdqu %xmm8, 0x20(%rax)
movdqu %xmm9, 0x30(%rax) movdqu %xmm9, 0x30(%rax)
movdqu %xmm10, 0x40(%rax) movdqu %xmm10, 0x40(%rax)
movdqu %xmm11, 0x50(%rax) movdqu %xmm11, 0x50(%rax)
movdqu %xmm12, 0x60(%rax) movdqu %xmm12, 0x60(%rax)
movdqu %xmm13, 0x70(%rax) movdqu %xmm13, 0x70(%rax)
movdqu %xmm14, 0x80(%rax) movdqu %xmm14, 0x80(%rax)
movdqu %xmm15, 0x90(%rax) movdqu %xmm15, 0x90(%rax)
mov (%rsp),%rax mov (%rsp),%rax
mov %rax,0x58(%rdx) mov %rax,0x58(%rdx)
mov $0x0,%rax mov $0x0,%rax
retq retq
# #
# EFI_STATUS # EFI_STATUS
# EFIAPI # EFIAPI
# TransferControlLongJump ( # TransferControlLongJump (
# IN EFI_PEI_TRANSFER_CONTROL_PROTOCOL *This, // rcx # IN EFI_PEI_TRANSFER_CONTROL_PROTOCOL *This, // rcx
# IN EFI_JUMP_BUFFER *Jump // rdx # IN EFI_JUMP_BUFFER *Jump // rdx
# ); # );
# #
# #
ASM_PFX(TransferControlLongJump): ASM_PFX(TransferControlLongJump):
# set return from SetJump to EFI_WARN_RETURN_FROM_LONG_JUMP # set return from SetJump to EFI_WARN_RETURN_FROM_LONG_JUMP
#; load non-volatile fp registers #; load non-volatile fp registers
ldmxcsr 0x60(%rdx) ldmxcsr 0x60(%rdx)
lea 0x68(%rdx), %rax lea 0x68(%rdx), %rax
movdqu (%rax), %xmm6 movdqu (%rax), %xmm6
movdqu 0x10(%rax), %xmm7 movdqu 0x10(%rax), %xmm7
movdqu 0x20(%rax), %xmm8 movdqu 0x20(%rax), %xmm8
movdqu 0x30(%rax), %xmm9 movdqu 0x30(%rax), %xmm9
movdqu 0x40(%rax), %xmm10 movdqu 0x40(%rax), %xmm10
movdqu 0x50(%rax), %xmm11 movdqu 0x50(%rax), %xmm11
movdqu 0x60(%rax), %xmm12 movdqu 0x60(%rax), %xmm12
movdqu 0x70(%rax), %xmm13 movdqu 0x70(%rax), %xmm13
movdqu 0x80(%rax), %xmm14 movdqu 0x80(%rax), %xmm14
movdqu 0x90(%rax), %xmm15 movdqu 0x90(%rax), %xmm15
mov $0x5,%rax mov $0x5,%rax
mov (%rdx),%rbx mov (%rdx),%rbx
mov 0x8(%rdx),%rsp mov 0x8(%rdx),%rsp
mov 0x10(%rdx),%rbp mov 0x10(%rdx),%rbp
mov 0x18(%rdx),%rdi mov 0x18(%rdx),%rdi
mov 0x20(%rdx),%rsi mov 0x20(%rdx),%rsi
mov 0x28(%rdx),%r10 mov 0x28(%rdx),%r10
mov 0x30(%rdx),%r11 mov 0x30(%rdx),%r11
mov 0x38(%rdx),%r12 mov 0x38(%rdx),%r12
mov 0x40(%rdx),%r13 mov 0x40(%rdx),%r13
mov 0x48(%rdx),%r14 mov 0x48(%rdx),%r14
mov 0x50(%rdx),%r15 mov 0x50(%rdx),%r15
add $0x8,%rsp add $0x8,%rsp
jmpq *0x58(%rdx) jmpq *0x58(%rdx)
mov $0x5,%rax mov $0x5,%rax
retq retq

View File

@ -1,78 +1,78 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# SupportItpDebug.S # SupportItpDebug.S
# #
# Abstract: # Abstract:
# #
# This is the code for debuging X64, to add a break hook at loading every module # This is the code for debuging X64, to add a break hook at loading every module
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EfiBind.h> #include <EfiBind.h>
.text .text
.globl ASM_PFX(AsmEfiSetBreakSupport) .globl ASM_PFX(AsmEfiSetBreakSupport)
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# AsmEfiSetBreakSupport ( # AsmEfiSetBreakSupport (
# IN UINTN LoadAddr // rcx # IN UINTN LoadAddr // rcx
# ) # )
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
ASM_PFX(AsmEfiSetBreakSupport): ASM_PFX(AsmEfiSetBreakSupport):
movw $60000, %dx movw $60000, %dx
outl %eax, %dx outl %eax, %dx
nop nop
nop nop
nop nop
nop nop
nop nop
nop nop
nop nop
nop nop
nop nop
nop nop
nop nop
nop nop
nop nop
nop nop
nop nop
nop nop
nop nop
nop nop
nop nop
nop nop
nop nop
nop nop
nop nop
nop nop
nop nop
nop nop
nop nop
nop nop
nop nop
nop nop
nop nop
nop nop
nop nop
nop nop
nop nop
nop nop
ret ret

View File

@ -1,61 +1,61 @@
#/*++ #/*++
# #
#Copyright (c) 2008, Intel Corporation. All rights reserved.<BR> #Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
#This program and the accompanying materials #This program and the accompanying materials
#are licensed and made available under the terms and conditions of the BSD License #are licensed and made available under the terms and conditions of the BSD License
#which accompanies this distribution. The full text of the license may be found at #which accompanies this distribution. The full text of the license may be found at
#http://opensource.org/licenses/bsd-license.php #http://opensource.org/licenses/bsd-license.php
# #
#THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, #THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
#WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
#Module Name: #Module Name:
# #
#CpuFlushCache.c #CpuFlushCache.c
# #
#Abstract: #Abstract:
# #
#Cpu Flush Cache Function. #Cpu Flush Cache Function.
# #
#--*/ #--*/
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
#include <EfiBind.h> #include <EfiBind.h>
.586p: .586p:
#.MODEL flat,C #.MODEL flat,C
.code: .code:
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
.globl ASM_PFX(EfiCpuFlushCache) .globl ASM_PFX(EfiCpuFlushCache)
# #
#// #//
#// Cache Flush Routine. #// Cache Flush Routine.
#// #//
#EFI_STATUS #EFI_STATUS
#EfiCpuFlushCache ( #EfiCpuFlushCache (
#IN EFI_PHYSICAL_ADDRESS Start, #IN EFI_PHYSICAL_ADDRESS Start,
# IN UINT64 Length # IN UINT64 Length
#) #)
#/*++ #/*++
# #
#Routine Description: #Routine Description:
# #
#Flush cache with specified range. #Flush cache with specified range.
# #
#Arguments: #Arguments:
# #
#Start - Start address #Start - Start address
# Length - Length in bytes # Length - Length in bytes
# #
#Returns: #Returns:
# #
#Status code #Status code
# #
#EFI_SUCCESS - success #EFI_SUCCESS - success
# #
#--*/ #--*/
ASM_PFX(EfiCpuFlushCache): ASM_PFX(EfiCpuFlushCache):
wbinvd wbinvd
xorl %eax, %eax xorl %eax, %eax
ret ret

View File

@ -1,37 +1,37 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# Module Name: # Module Name:
# #
# RuntimeLibAsm.S # RuntimeLibAsm.S
# #
# Abstract: # Abstract:
# #
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <EfiBind.h> #include <EfiBind.h>
.text .text
.globl ASM_PFX(EfiCpuFlushCache) .globl ASM_PFX(EfiCpuFlushCache)
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#EFI_STATUS #EFI_STATUS
#EfiCpuFlushCache ( #EfiCpuFlushCache (
# IN EFI_PHYSICAL_ADDRESS Start, # IN EFI_PHYSICAL_ADDRESS Start,
# IN UINT64 Length # IN UINT64 Length
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
ASM_PFX(EfiCpuFlushCache): ASM_PFX(EfiCpuFlushCache):
wbinvd wbinvd
mov $0, %rax mov $0, %rax
ret ret

View File

@ -1,50 +1,50 @@
#***************************************************************************** #*****************************************************************************
#* #*
#* Copyright (c) 2008, Intel Corporation. All rights reserved.<BR> #* Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
#* This program and the accompanying materials #* This program and the accompanying materials
#* are licensed and made available under the terms and conditions of the BSD License #* are licensed and made available under the terms and conditions of the BSD License
#* which accompanies this distribution. The full text of the license may be found at #* which accompanies this distribution. The full text of the license may be found at
#* http://opensource.org/licenses/bsd-license.php #* http://opensource.org/licenses/bsd-license.php
#* #*
#* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, #* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
#* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#* #*
#* Module Name: #* Module Name:
#* #*
#* Fx.S #* Fx.S
#* #*
#* Abstract: #* Abstract:
#* #*
#* AsmFxRestore and AsmFxSave function #* AsmFxRestore and AsmFxSave function
#* #*
#***************************************************************************** #*****************************************************************************
#include <EfiBind.h> #include <EfiBind.h>
.globl ASM_PFX(AsmFxSave) .globl ASM_PFX(AsmFxSave)
.globl ASM_PFX(AsmFxRestore) .globl ASM_PFX(AsmFxRestore)
.text .text
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# AsmFxSave ( # AsmFxSave (
# OUT IA32_FX_BUFFER *Buffer # OUT IA32_FX_BUFFER *Buffer
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
ASM_PFX(AsmFxSave): ASM_PFX(AsmFxSave):
fxsave (%rcx) fxsave (%rcx)
retq retq
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# AsmFxRestore ( # AsmFxRestore (
# IN CONST IA32_FX_BUFFER *Buffer # IN CONST IA32_FX_BUFFER *Buffer
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
ASM_PFX(AsmFxRestore): ASM_PFX(AsmFxRestore):
fxrstor (%rcx) fxrstor (%rcx)
retq retq
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINTN # UINTN
# AsmGetEflags ( # AsmGetEflags (

View File

@ -1,20 +1,20 @@
/*++ /*++
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR> Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
VfrCompiler.h VfrCompiler.h
Abstract: Abstract:
--*/ --*/
#ifndef _VFRCOMPILER_H_ #ifndef _VFRCOMPILER_H_
@ -56,7 +56,7 @@ typedef struct {
INT8 PreprocessorOutputFileName[MAX_PATH]; INT8 PreprocessorOutputFileName[MAX_PATH];
INT8 VfrBaseFileName[MAX_PATH]; // name of input VFR file with no path or extension INT8 VfrBaseFileName[MAX_PATH]; // name of input VFR file with no path or extension
INT8 *IncludePaths; INT8 *IncludePaths;
bool SkipCPreprocessor; bool SkipCPreprocessor;
INT8 *CPreprocessorOptions; INT8 *CPreprocessorOptions;
} OPTIONS; } OPTIONS;

View File

@ -1,18 +1,18 @@
/*++ /*++
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR> Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
VfrSyntax.g VfrSyntax.g
Abstract: Abstract:
--*/ --*/
#header<< #header<<
@ -156,7 +156,7 @@ VfrParserStart (
#token Inventory("inventory") "inventory" #token Inventory("inventory") "inventory"
#token NonNvDataMap("_NON_NV_DATA_MAP") "_NON_NV_DATA_MAP" #token NonNvDataMap("_NON_NV_DATA_MAP") "_NON_NV_DATA_MAP"
#token Struct("struct") "struct" #token Struct("struct") "struct"
#token Boolean("BOOLEAN") "BOOLEAN" #token Boolean("BOOLEAN") "BOOLEAN"
#token Uint64("UINT64") "UINT64" #token Uint64("UINT64") "UINT64"
#token Uint32("UINT32") "UINT32" #token Uint32("UINT32") "UINT32"
#token Uint16("UINT16") "UINT16" #token Uint16("UINT16") "UINT16"
@ -198,7 +198,7 @@ VfrParserStart (
#token OptionOnlyFlag("OPTIONS_ONLY") "OPTIONS_ONLY" #token OptionOnlyFlag("OPTIONS_ONLY") "OPTIONS_ONLY"
#token Class("class") "class" #token Class("class") "class"
#token Subclass("subclass") "subclass" #token Subclass("subclass") "subclass"
#token ClassGuid("classguid") "classguid" #token ClassGuid("classguid") "classguid"
#token TypeDef("typedef") "typedef" #token TypeDef("typedef") "typedef"
#token Restore("restore") "restore" #token Restore("restore") "restore"
#token Save("save") "save" #token Save("save") "save"
@ -254,9 +254,9 @@ VfrParserStart (
// //
vfrProgram > [UINT8 Return] : vfrProgram > [UINT8 Return] :
<< <<
mParserStatus = 0; mParserStatus = 0;
mConstantOnlyInExpression = FALSE; mConstantOnlyInExpression = FALSE;
>> >>
( (
vfrPragmaPackDefinition vfrPragmaPackDefinition
@ -267,48 +267,48 @@ vfrProgram > [UINT8 Return] :
; ;
pragmaPackShowDef : pragmaPackShowDef :
L:"show" << mCVfrVarDataTypeDB.Pack (L->getLine(), VFR_PACK_SHOW); >> L:"show" << mCVfrVarDataTypeDB.Pack (L->getLine(), VFR_PACK_SHOW); >>
; ;
pragmaPackStackDef : pragmaPackStackDef :
<< <<
UINT32 LineNum; UINT32 LineNum;
UINT8 PackAction; UINT8 PackAction;
INT8 *Identifier = NULL; INT8 *Identifier = NULL;
UINT32 PackNumber = DEFAULT_PACK_ALIGN; UINT32 PackNumber = DEFAULT_PACK_ALIGN;
>> >>
( (
L1:"push" << LineNum = L1->getLine(); PackAction = VFR_PACK_PUSH; >> L1:"push" << LineNum = L1->getLine(); PackAction = VFR_PACK_PUSH; >>
| L2:"pop" << LineNum = L2->getLine(); PackAction = VFR_PACK_POP; >> | L2:"pop" << LineNum = L2->getLine(); PackAction = VFR_PACK_POP; >>
) )
{ {
"," ID:StringIdentifier << Identifier = ID->getText(); >> "," ID:StringIdentifier << Identifier = ID->getText(); >>
} }
{ {
"," N:Number << PackAction |= VFR_PACK_ASSIGN; PackNumber = _STOU32(N->getText()); >> "," N:Number << PackAction |= VFR_PACK_ASSIGN; PackNumber = _STOU32(N->getText()); >>
} }
<< mCVfrVarDataTypeDB.Pack (LineNum, PackAction, Identifier, PackNumber); >> << mCVfrVarDataTypeDB.Pack (LineNum, PackAction, Identifier, PackNumber); >>
; ;
pragmaPackNumber :
<<
UINT32 LineNum;
UINT32 PackNumber = DEFAULT_PACK_ALIGN;
>>
N:Number << LineNum = N->getLine(); PackNumber = _STOU32(N->getText()); >>
<< mCVfrVarDataTypeDB.Pack (LineNum, VFR_PACK_ASSIGN, NULL, PackNumber); >>
;
vfrPragmaPackDefinition :
"\#pragma" "pack" "\("
{
pragmaPackShowDef
| pragmaPackStackDef
| pragmaPackNumber
}
"\)"
;
pragmaPackNumber :
<<
UINT32 LineNum;
UINT32 PackNumber = DEFAULT_PACK_ALIGN;
>>
N:Number << LineNum = N->getLine(); PackNumber = _STOU32(N->getText()); >>
<< mCVfrVarDataTypeDB.Pack (LineNum, VFR_PACK_ASSIGN, NULL, PackNumber); >>
;
vfrPragmaPackDefinition :
"\#pragma" "pack" "\("
{
pragmaPackShowDef
| pragmaPackStackDef
| pragmaPackNumber
}
"\)"
;
vfrDataStructDefinition : vfrDataStructDefinition :
{ TypeDef } Struct << mCVfrVarDataTypeDB.DeclareDataTypeBegin (); >> { TypeDef } Struct << mCVfrVarDataTypeDB.DeclareDataTypeBegin (); >>
{ NonNvDataMap } { NonNvDataMap }
@ -433,86 +433,86 @@ dataStructFieldUser :
// the syntax of GUID definition // the syntax of GUID definition
// //
guidSubDefinition [EFI_GUID &Guid] : guidSubDefinition [EFI_GUID &Guid] :
G4:Number "," G5:Number "," G6:Number "," G7:Number "," G8:Number "," G9:Number "," G10:Number "," G11:Number G4:Number "," G5:Number "," G6:Number "," G7:Number "," G8:Number "," G9:Number "," G10:Number "," G11:Number
<< <<
Guid.Data4[0] = _STOU8(G4->getText()); Guid.Data4[0] = _STOU8(G4->getText());
Guid.Data4[1] = _STOU8(G5->getText()); Guid.Data4[1] = _STOU8(G5->getText());
Guid.Data4[2] = _STOU8(G6->getText()); Guid.Data4[2] = _STOU8(G6->getText());
Guid.Data4[3] = _STOU8(G7->getText()); Guid.Data4[3] = _STOU8(G7->getText());
Guid.Data4[4] = _STOU8(G8->getText()); Guid.Data4[4] = _STOU8(G8->getText());
Guid.Data4[5] = _STOU8(G9->getText()); Guid.Data4[5] = _STOU8(G9->getText());
Guid.Data4[6] = _STOU8(G10->getText()); Guid.Data4[6] = _STOU8(G10->getText());
Guid.Data4[7] = _STOU8(G11->getText()); Guid.Data4[7] = _STOU8(G11->getText());
>> >>
; ;
guidDefinition [EFI_GUID &Guid] : guidDefinition [EFI_GUID &Guid] :
OpenBrace OpenBrace
G1:Number "," G2:Number "," G3:Number "," G1:Number "," G2:Number "," G3:Number ","
<< <<
Guid.Data1 = _STOU32 (G1->getText()); Guid.Data1 = _STOU32 (G1->getText());
Guid.Data2 = _STOU16 (G2->getText()); Guid.Data2 = _STOU16 (G2->getText());
Guid.Data3 = _STOU16 (G3->getText()); Guid.Data3 = _STOU16 (G3->getText());
>> >>
( (
OpenBrace guidSubDefinition[Guid] CloseBrace OpenBrace guidSubDefinition[Guid] CloseBrace
| guidSubDefinition[Guid] | guidSubDefinition[Guid]
) )
CloseBrace CloseBrace
; ;
//***************************************************************************** //*****************************************************************************
// //
// the syntax of form set definition // the syntax of form set definition
// //
vfrFormSetDefinition : vfrFormSetDefinition :
<< <<
EFI_GUID Guid; EFI_GUID Guid;
EFI_GUID DefaultClassGuid = EFI_HII_PLATFORM_SETUP_FORMSET_GUID; EFI_GUID DefaultClassGuid = EFI_HII_PLATFORM_SETUP_FORMSET_GUID;
EFI_GUID ClassGuids[10]; EFI_GUID ClassGuids[10];
UINT8 ClassGuidNum = 0; UINT8 ClassGuidNum = 0;
CIfrFormSet *FSObj = NULL; CIfrFormSet *FSObj = NULL;
UINT16 C, SC; UINT16 C, SC;
>> >>
L:FormSet L:FormSet
Uuid "=" guidDefinition[Guid] "," Uuid "=" guidDefinition[Guid] ","
Title "=" "STRING_TOKEN" "\(" S1:Number "\)" "," Title "=" "STRING_TOKEN" "\(" S1:Number "\)" ","
Help "=" "STRING_TOKEN" "\(" S2:Number "\)" "," Help "=" "STRING_TOKEN" "\(" S2:Number "\)" ","
{ {
ClassGuid "=" guidDefinition[ClassGuids[ClassGuidNum]] << ++ClassGuidNum; >> ClassGuid "=" guidDefinition[ClassGuids[ClassGuidNum]] << ++ClassGuidNum; >>
( (
"\|" guidDefinition[ClassGuids[ClassGuidNum]] << ++ClassGuidNum; >> "\|" guidDefinition[ClassGuids[ClassGuidNum]] << ++ClassGuidNum; >>
)* )*
"," ","
} }
<< <<
switch (ClassGuidNum) { switch (ClassGuidNum) {
case 0: case 0:
FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET)); FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET));
FSObj->SetClassGuid(&DefaultClassGuid); FSObj->SetClassGuid(&DefaultClassGuid);
break; break;
case 1: case 1:
FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET)); FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET));
FSObj->SetClassGuid(&ClassGuids[0]); FSObj->SetClassGuid(&ClassGuids[0]);
break; break;
case 2: case 2:
FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + sizeof(EFI_GUID)); FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + sizeof(EFI_GUID));
FSObj->SetClassGuid(&ClassGuids[0]); FSObj->SetClassGuid(&ClassGuids[0]);
FSObj->SetClassGuid(&ClassGuids[1]); FSObj->SetClassGuid(&ClassGuids[1]);
break; break;
default: default:
FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + 2 * sizeof(EFI_GUID)); FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + 2 * sizeof(EFI_GUID));
FSObj->SetClassGuid(&ClassGuids[0]); FSObj->SetClassGuid(&ClassGuids[0]);
FSObj->SetClassGuid(&ClassGuids[1]); FSObj->SetClassGuid(&ClassGuids[1]);
FSObj->SetClassGuid(&ClassGuids[2]); FSObj->SetClassGuid(&ClassGuids[2]);
break; break;
} }
SET_LINE_INFO (*FSObj, L); SET_LINE_INFO (*FSObj, L);
FSObj->SetGuid (&Guid); FSObj->SetGuid (&Guid);
FSObj->SetFormSetTitle (_STOSID(S1->getText())); FSObj->SetFormSetTitle (_STOSID(S1->getText()));
FSObj->SetHelp (_STOSID(S2->getText())); FSObj->SetHelp (_STOSID(S2->getText()));
>> >>
{ {
Class "=" classDefinition[C] "," << {CIfrClass CObj; CObj.SetClass(C);} >> Class "=" classDefinition[C] "," << {CIfrClass CObj; CObj.SetClass(C);} >>
} }
@ -582,14 +582,14 @@ vfrStatementVarStoreLinear :
) )
{ Key "=" Number "," } // Key is used to assign Varid in Framework VFR but no use in UEFI2.1 VFR { Key "=" Number "," } // Key is used to assign Varid in Framework VFR but no use in UEFI2.1 VFR
{ {
VarId "=" ID:Number "," << VarId "=" ID:Number "," <<
_PCATCH( _PCATCH(
(INTN)(VarStoreId = _STOU16(ID->getText())) != 0, (INTN)(VarStoreId = _STOU16(ID->getText())) != 0,
(INTN)TRUE, (INTN)TRUE,
ID, ID,
"varid 0 is not allowed." "varid 0 is not allowed."
); );
>> >>
} }
Name "=" SN:StringIdentifier "," Name "=" SN:StringIdentifier ","
Uuid "=" guidDefinition[Guid] Uuid "=" guidDefinition[Guid]
@ -689,10 +689,10 @@ subclassDefinition[UINT16 & SubClass] :
; ;
vfrStatementDisableIfFormSet : vfrStatementDisableIfFormSet :
<< <<
CIfrDisableIf DIObj; CIfrDisableIf DIObj;
UINT32 ExpOpCount = 0; UINT32 ExpOpCount = 0;
>> >>
D:DisableIf << DIObj.SetLineNo(D->getLine()); >> D:DisableIf << DIObj.SetLineNo(D->getLine()); >>
vfrStatementExpression[0, ExpOpCount] ";" << mConstantOnlyInExpression = FALSE; >> vfrStatementExpression[0, ExpOpCount] ";" << mConstantOnlyInExpression = FALSE; >>
vfrFormSetList vfrFormSetList
@ -791,7 +791,7 @@ vfrStorageVarId[EFI_VARSTORE_INFO & Info, INT8 *&QuestVarIdStr] :
INT8 *VarStr = NULL; INT8 *VarStr = NULL;
INT8 *SName = NULL; INT8 *SName = NULL;
INT8 *TName = NULL; INT8 *TName = NULL;
EFI_IFR_TYPE_VALUE Dummy = {0}; EFI_IFR_TYPE_VALUE Dummy = {0};
>> >>
( (
SN1:StringIdentifier << SName = SN1->getText(); _STRCAT(&VarIdStr, SN1->getText()); >> SN1:StringIdentifier << SName = SN1->getText(); _STRCAT(&VarIdStr, SN1->getText()); >>
@ -832,19 +832,19 @@ vfrStorageVarId[EFI_VARSTORE_INFO & Info, INT8 *&QuestVarIdStr] :
case EFI_VFR_VARSTORE_BUFFER: case EFI_VFR_VARSTORE_BUFFER:
_PCATCH(mCVfrVarDataTypeDB.GetDataFieldInfo (VarStr, $Info.mInfo.mVarOffset, $Info.mVarType, $Info.mVarTotalSize), SN2->getLine()); _PCATCH(mCVfrVarDataTypeDB.GetDataFieldInfo (VarStr, $Info.mInfo.mVarOffset, $Info.mVarType, $Info.mVarTotalSize), SN2->getLine());
//_PCATCH(mCVfrDataStorage.BufferVarStoreRequestElementAdd (SName, Info), SN2); //_PCATCH(mCVfrDataStorage.BufferVarStoreRequestElementAdd (SName, Info), SN2);
_PCATCH((EFI_VFR_RETURN_CODE)gCVfrBufferConfig.Register ( _PCATCH((EFI_VFR_RETURN_CODE)gCVfrBufferConfig.Register (
SName, SName,
NULL), NULL),
SN2->getLine()); SN2->getLine());
_PCATCH((EFI_VFR_RETURN_CODE)gCVfrBufferConfig.Write ( _PCATCH((EFI_VFR_RETURN_CODE)gCVfrBufferConfig.Write (
'a', 'a',
SName, SName,
NULL, NULL,
$Info.mVarType, $Info.mVarType,
$Info.mInfo.mVarOffset, $Info.mInfo.mVarOffset,
$Info.mVarTotalSize, $Info.mVarTotalSize,
Dummy), Dummy),
SN2->getLine()); SN2->getLine());
break; break;
case EFI_VFR_VARSTORE_NAME: case EFI_VFR_VARSTORE_NAME:
default: break; default: break;
@ -863,10 +863,10 @@ vfrQuestionDataFieldName [EFI_QUESTION_ID &QId, UINT32 &Mask, INT8 *&VarIdStr, U
OpenBracket I1:Number CloseBracket << _STRCAT(&VarIdStr, "["); _STRCAT(&VarIdStr, I1->getText()); _STRCAT(&VarIdStr, "]"); >> OpenBracket I1:Number CloseBracket << _STRCAT(&VarIdStr, "["); _STRCAT(&VarIdStr, I1->getText()); _STRCAT(&VarIdStr, "]"); >>
<< mCVfrQuestionDB.GetQuestionId (NULL, VarIdStr, $QId, $Mask); >> << mCVfrQuestionDB.GetQuestionId (NULL, VarIdStr, $QId, $Mask); >>
) << ) <<
if (mConstantOnlyInExpression) { if (mConstantOnlyInExpression) {
_PCATCH(VFR_RETURN_CONSTANT_ONLY, LineNo); _PCATCH(VFR_RETURN_CONSTANT_ONLY, LineNo);
} }
>> >>
| |
( (
SN2:StringIdentifier << _STRCAT (&VarIdStr, SN2->getText()); LineNo = SN2->getLine(); >> SN2:StringIdentifier << _STRCAT (&VarIdStr, SN2->getText()); LineNo = SN2->getLine(); >>
@ -879,10 +879,10 @@ vfrQuestionDataFieldName [EFI_QUESTION_ID &QId, UINT32 &Mask, INT8 *&VarIdStr, U
)* )*
<< mCVfrQuestionDB.GetQuestionId (NULL, VarIdStr, $QId, $Mask); >> << mCVfrQuestionDB.GetQuestionId (NULL, VarIdStr, $QId, $Mask); >>
) << ) <<
if (mConstantOnlyInExpression) { if (mConstantOnlyInExpression) {
_PCATCH(VFR_RETURN_CONSTANT_ONLY, LineNo); _PCATCH(VFR_RETURN_CONSTANT_ONLY, LineNo);
} }
>> >>
; ;
vfrConstantValueField[UINT8 Type] > [EFI_IFR_TYPE_VALUE Value] : vfrConstantValueField[UINT8 Type] > [EFI_IFR_TYPE_VALUE Value] :
@ -949,10 +949,10 @@ vfrFormDefinition :
; ;
vfrStatementRules : vfrStatementRules :
<< <<
CIfrRule RObj; CIfrRule RObj;
UINT32 ExpOpCount = 0; UINT32 ExpOpCount = 0;
>> >>
R:Rule << RObj.SetLineNo(R->getLine()); >> R:Rule << RObj.SetLineNo(R->getLine()); >>
S1:StringIdentifier "," << S1:StringIdentifier "," <<
mCVfrRulesDB.RegisterRule (S1->getText()); mCVfrRulesDB.RegisterRule (S1->getText());
@ -977,15 +977,15 @@ vfrStatementDefault :
( (
vfrStatementValue "," << IsExp = TRUE; DObj.SetScope (1); CIfrEnd EndObj1; EndObj1.SetLineNo(D->getLine()); >> vfrStatementValue "," << IsExp = TRUE; DObj.SetScope (1); CIfrEnd EndObj1; EndObj1.SetLineNo(D->getLine()); >>
| "=" vfrConstantValueField[_GET_CURRQEST_DATATYPE()] > [Val] "," << | "=" vfrConstantValueField[_GET_CURRQEST_DATATYPE()] > [Val] "," <<
if (gCurrentMinMaxData != NULL && gCurrentMinMaxData->IsNumericOpcode()) { if (gCurrentMinMaxData != NULL && gCurrentMinMaxData->IsNumericOpcode()) {
//check default value is valid for Numeric Opcode //check default value is valid for Numeric Opcode
if (Val.u64 < gCurrentMinMaxData->GetMinData(_GET_CURRQEST_DATATYPE()) || Val.u64 > gCurrentMinMaxData->GetMaxData(_GET_CURRQEST_DATATYPE())) { if (Val.u64 < gCurrentMinMaxData->GetMinData(_GET_CURRQEST_DATATYPE()) || Val.u64 > gCurrentMinMaxData->GetMaxData(_GET_CURRQEST_DATATYPE())) {
_PCATCH (VFR_RETURN_INVALID_PARAMETER, D->getLine(), "Numeric default value must be between MinValue and MaxValue."); _PCATCH (VFR_RETURN_INVALID_PARAMETER, D->getLine(), "Numeric default value must be between MinValue and MaxValue.");
} }
} }
DObj.SetType (_GET_CURRQEST_DATATYPE()); DObj.SetType (_GET_CURRQEST_DATATYPE());
DObj.SetValue(Val); DObj.SetValue(Val);
>> >>
) )
{ {
DefaultStore "=" SN:StringIdentifier "," << _PCATCH(mCVfrDefaultStore.GetDefaultId (SN->getText(), &DefaultId), SN); DObj.SetDefaultId (DefaultId); >> DefaultStore "=" SN:StringIdentifier "," << _PCATCH(mCVfrDefaultStore.GetDefaultId (SN->getText(), &DefaultId), SN); DObj.SetDefaultId (DefaultId); >>
@ -999,9 +999,9 @@ vfrStatementDefault :
_GET_CURRQEST_VARTINFO(), _GET_CURRQEST_VARTINFO(),
VarStoreName, VarStoreName,
_GET_CURRQEST_DATATYPE (), _GET_CURRQEST_DATATYPE (),
Val), Val),
D->getLine() D->getLine()
); );
} }
>> >>
) )
@ -1045,13 +1045,13 @@ flagsField :
; ;
vfrStatementValue : vfrStatementValue :
<< <<
CIfrValue VObj; CIfrValue VObj;
UINT32 ExpOpCount = 0; UINT32 ExpOpCount = 0;
>> >>
V:Value << VObj.SetLineNo(V->getLine()); >> V:Value << VObj.SetLineNo(V->getLine()); >>
"=" vfrStatementExpression[0, ExpOpCount] "=" vfrStatementExpression[0, ExpOpCount]
<< { CIfrEnd EndObj; EndObj.SetLineNo(0); } >> << { CIfrEnd EndObj; EndObj.SetLineNo(0); } >>
; ;
vfrStatementSubTitle : vfrStatementSubTitle :
@ -1095,7 +1095,7 @@ vfrStatementStaticText :
<< <<
if (Flags & EFI_IFR_FLAG_CALLBACK) { if (Flags & EFI_IFR_FLAG_CALLBACK) {
CIfrAction AObj; CIfrAction AObj;
AObj.SetLineNo (T->getLine()); AObj.SetLineNo (T->getLine());
mCVfrQuestionDB.RegisterQuestion (NULL, NULL, QId); mCVfrQuestionDB.RegisterQuestion (NULL, NULL, QId);
AObj.SetQuestionId (QId); AObj.SetQuestionId (QId);
AObj.SetPrompt (_STOSID(S2->getText())); AObj.SetPrompt (_STOSID(S2->getText()));
@ -1287,46 +1287,46 @@ vfrStatementBooleanType :
vfrStatementCheckBox : vfrStatementCheckBox :
<< <<
CIfrCheckBox CBObj; CIfrCheckBox CBObj;
EFI_IFR_TYPE_VALUE Val = {0}; EFI_IFR_TYPE_VALUE Val = {0};
INT8 *VarStoreName = NULL; INT8 *VarStoreName = NULL;
>> >>
L:CheckBox << CBObj.SetLineNo(L->getLine()); >> L:CheckBox << CBObj.SetLineNo(L->getLine()); >>
vfrQuestionHeader[CBObj] "," vfrQuestionHeader[CBObj] ","
{ {
F:FLAGS "=" vfrCheckBoxFlags[CBObj, F->getLine()] "," F:FLAGS "=" vfrCheckBoxFlags[CBObj, F->getLine()] ","
<< <<
_PCATCH(mCVfrDataStorage.GetVarStoreName (_GET_CURRQEST_VARTINFO().mVarStoreId, &VarStoreName), VFR_RETURN_SUCCESS, L, "Failed to retrieve varstore name"); _PCATCH(mCVfrDataStorage.GetVarStoreName (_GET_CURRQEST_VARTINFO().mVarStoreId, &VarStoreName), VFR_RETURN_SUCCESS, L, "Failed to retrieve varstore name");
Val.b = TRUE; Val.b = TRUE;
if (CBObj.GetFlags () & 0x01) { if (CBObj.GetFlags () & 0x01) {
_PCATCH( _PCATCH(
mCVfrDefaultStore.BufferVarStoreAltConfigAdd ( mCVfrDefaultStore.BufferVarStoreAltConfigAdd (
EFI_HII_DEFAULT_CLASS_STANDARD, EFI_HII_DEFAULT_CLASS_STANDARD,
_GET_CURRQEST_VARTINFO(), _GET_CURRQEST_VARTINFO(),
VarStoreName, VarStoreName,
_GET_CURRQEST_DATATYPE (), _GET_CURRQEST_DATATYPE (),
Val Val
), ),
VFR_RETURN_SUCCESS, VFR_RETURN_SUCCESS,
L, L,
"No standard default storage found" "No standard default storage found"
); );
} }
if (CBObj.GetFlags () & 0x02) { if (CBObj.GetFlags () & 0x02) {
_PCATCH( _PCATCH(
mCVfrDefaultStore.BufferVarStoreAltConfigAdd ( mCVfrDefaultStore.BufferVarStoreAltConfigAdd (
EFI_HII_DEFAULT_CLASS_MANUFACTURING, EFI_HII_DEFAULT_CLASS_MANUFACTURING,
_GET_CURRQEST_VARTINFO(), _GET_CURRQEST_VARTINFO(),
VarStoreName, VarStoreName,
_GET_CURRQEST_DATATYPE (), _GET_CURRQEST_DATATYPE (),
Val Val
), ),
VFR_RETURN_SUCCESS, VFR_RETURN_SUCCESS,
L, L,
"No manufacturing default storage found" "No manufacturing default storage found"
); );
} }
>> >>
} }
{ {
Key "=" KN:Number "," << AssignQuestionKey (CBObj, KN); >> Key "=" KN:Number "," << AssignQuestionKey (CBObj, KN); >>
} }
@ -1535,25 +1535,25 @@ vfrNumericFlags [CIfrNumeric & NObj, UINT32 LineNum] :
<< <<
UINT8 LFlags = _GET_CURRQEST_DATATYPE() & EFI_IFR_NUMERIC_SIZE; UINT8 LFlags = _GET_CURRQEST_DATATYPE() & EFI_IFR_NUMERIC_SIZE;
UINT8 HFlags = 0; UINT8 HFlags = 0;
EFI_VFR_VARSTORE_TYPE VarStoreType = EFI_VFR_VARSTORE_INVALID; EFI_VFR_VARSTORE_TYPE VarStoreType = EFI_VFR_VARSTORE_INVALID;
>> >>
numericFlagsField[HFlags, LFlags] ( "\|" numericFlagsField[HFlags, LFlags] )* numericFlagsField[HFlags, LFlags] ( "\|" numericFlagsField[HFlags, LFlags] )*
<< <<
//check data type flag //check data type flag
VarStoreType = mCVfrDataStorage.GetVarStoreType (_GET_CURRQEST_VARTINFO().mVarStoreId); VarStoreType = mCVfrDataStorage.GetVarStoreType (_GET_CURRQEST_VARTINFO().mVarStoreId);
if (VarStoreType == EFI_VFR_VARSTORE_BUFFER || VarStoreType == EFI_VFR_VARSTORE_EFI) { if (VarStoreType == EFI_VFR_VARSTORE_BUFFER || VarStoreType == EFI_VFR_VARSTORE_EFI) {
if (_GET_CURRQEST_DATATYPE() != (LFlags & EFI_IFR_NUMERIC_SIZE)) { if (_GET_CURRQEST_DATATYPE() != (LFlags & EFI_IFR_NUMERIC_SIZE)) {
_PCATCH(VFR_RETURN_INVALID_PARAMETER, LineNum, "Numeric Flag is not same to Numeric VarData type"); _PCATCH(VFR_RETURN_INVALID_PARAMETER, LineNum, "Numeric Flag is not same to Numeric VarData type");
} }
} else { } else {
// update data type for name/value store // update data type for name/value store
UINT32 DataTypeSize; UINT32 DataTypeSize;
_GET_CURRQEST_VARTINFO().mVarType = LFlags & EFI_IFR_NUMERIC_SIZE; _GET_CURRQEST_VARTINFO().mVarType = LFlags & EFI_IFR_NUMERIC_SIZE;
mCVfrVarDataTypeDB.GetDataTypeSize (_GET_CURRQEST_DATATYPE(), &DataTypeSize); mCVfrVarDataTypeDB.GetDataTypeSize (_GET_CURRQEST_DATATYPE(), &DataTypeSize);
_GET_CURRQEST_VARTINFO().mVarTotalSize = DataTypeSize; _GET_CURRQEST_VARTINFO().mVarTotalSize = DataTypeSize;
} }
_PCATCH(NObj.SetFlags (HFlags, LFlags), LineNum); _PCATCH(NObj.SetFlags (HFlags, LFlags), LineNum);
>> >>
; ;
numericFlagsField [UINT8 & HFlags, UINT8 & LFlags] : numericFlagsField [UINT8 & HFlags, UINT8 & LFlags] :
@ -1561,10 +1561,10 @@ numericFlagsField [UINT8 & HFlags, UINT8 & LFlags] :
| "NUMERIC_SIZE_1" << $LFlags = ($LFlags & ~EFI_IFR_NUMERIC_SIZE) | EFI_IFR_NUMERIC_SIZE_1; >> | "NUMERIC_SIZE_1" << $LFlags = ($LFlags & ~EFI_IFR_NUMERIC_SIZE) | EFI_IFR_NUMERIC_SIZE_1; >>
| "NUMERIC_SIZE_2" << $LFlags = ($LFlags & ~EFI_IFR_NUMERIC_SIZE) | EFI_IFR_NUMERIC_SIZE_2; >> | "NUMERIC_SIZE_2" << $LFlags = ($LFlags & ~EFI_IFR_NUMERIC_SIZE) | EFI_IFR_NUMERIC_SIZE_2; >>
| "NUMERIC_SIZE_4" << $LFlags = ($LFlags & ~EFI_IFR_NUMERIC_SIZE) | EFI_IFR_NUMERIC_SIZE_4; >> | "NUMERIC_SIZE_4" << $LFlags = ($LFlags & ~EFI_IFR_NUMERIC_SIZE) | EFI_IFR_NUMERIC_SIZE_4; >>
| "NUMERIC_SIZE_8" << $LFlags = ($LFlags & ~EFI_IFR_NUMERIC_SIZE) | EFI_IFR_NUMERIC_SIZE_8; >> | "NUMERIC_SIZE_8" << $LFlags = ($LFlags & ~EFI_IFR_NUMERIC_SIZE) | EFI_IFR_NUMERIC_SIZE_8; >>
| "DISPLAY_INT_DEC" << $LFlags = ($LFlags & ~EFI_IFR_DISPLAY) | EFI_IFR_DISPLAY_INT_DEC; >> | "DISPLAY_INT_DEC" << $LFlags = ($LFlags & ~EFI_IFR_DISPLAY) | EFI_IFR_DISPLAY_INT_DEC; >>
| "DISPLAY_UINT_DEC" << $LFlags = ($LFlags & ~EFI_IFR_DISPLAY) | EFI_IFR_DISPLAY_UINT_DEC; >> | "DISPLAY_UINT_DEC" << $LFlags = ($LFlags & ~EFI_IFR_DISPLAY) | EFI_IFR_DISPLAY_UINT_DEC; >>
| "DISPLAY_UINT_HEX" << $LFlags = ($LFlags & ~EFI_IFR_DISPLAY) | EFI_IFR_DISPLAY_UINT_HEX; >> | "DISPLAY_UINT_HEX" << $LFlags = ($LFlags & ~EFI_IFR_DISPLAY) | EFI_IFR_DISPLAY_UINT_HEX; >>
| questionheaderFlagsField[HFlags] | questionheaderFlagsField[HFlags]
; ;
@ -1587,25 +1587,25 @@ vfrOneofFlagsField [CIfrOneOf & OObj, UINT32 LineNum] :
<< <<
UINT8 LFlags = _GET_CURRQEST_DATATYPE() & EFI_IFR_NUMERIC_SIZE; UINT8 LFlags = _GET_CURRQEST_DATATYPE() & EFI_IFR_NUMERIC_SIZE;
UINT8 HFlags = 0; UINT8 HFlags = 0;
EFI_VFR_VARSTORE_TYPE VarStoreType = EFI_VFR_VARSTORE_INVALID; EFI_VFR_VARSTORE_TYPE VarStoreType = EFI_VFR_VARSTORE_INVALID;
>> >>
numericFlagsField[HFlags, LFlags] ( "\|" numericFlagsField[HFlags, LFlags] )* numericFlagsField[HFlags, LFlags] ( "\|" numericFlagsField[HFlags, LFlags] )*
<< <<
//check data type flag //check data type flag
VarStoreType = mCVfrDataStorage.GetVarStoreType (_GET_CURRQEST_VARTINFO().mVarStoreId); VarStoreType = mCVfrDataStorage.GetVarStoreType (_GET_CURRQEST_VARTINFO().mVarStoreId);
if (VarStoreType == EFI_VFR_VARSTORE_BUFFER || VarStoreType == EFI_VFR_VARSTORE_EFI) { if (VarStoreType == EFI_VFR_VARSTORE_BUFFER || VarStoreType == EFI_VFR_VARSTORE_EFI) {
if (_GET_CURRQEST_DATATYPE() != (LFlags & EFI_IFR_NUMERIC_SIZE)) { if (_GET_CURRQEST_DATATYPE() != (LFlags & EFI_IFR_NUMERIC_SIZE)) {
_PCATCH(VFR_RETURN_INVALID_PARAMETER, LineNum, "Numeric Flag is not same to Numeric VarData type"); _PCATCH(VFR_RETURN_INVALID_PARAMETER, LineNum, "Numeric Flag is not same to Numeric VarData type");
} }
} else { } else {
// update data type for Name/Value store // update data type for Name/Value store
UINT32 DataTypeSize; UINT32 DataTypeSize;
_GET_CURRQEST_VARTINFO().mVarType = LFlags & EFI_IFR_NUMERIC_SIZE; _GET_CURRQEST_VARTINFO().mVarType = LFlags & EFI_IFR_NUMERIC_SIZE;
mCVfrVarDataTypeDB.GetDataTypeSize (_GET_CURRQEST_DATATYPE(), &DataTypeSize); mCVfrVarDataTypeDB.GetDataTypeSize (_GET_CURRQEST_DATATYPE(), &DataTypeSize);
_GET_CURRQEST_VARTINFO().mVarTotalSize = DataTypeSize; _GET_CURRQEST_VARTINFO().mVarTotalSize = DataTypeSize;
} }
_PCATCH(OObj.SetFlags (HFlags, LFlags), LineNum); _PCATCH(OObj.SetFlags (HFlags, LFlags), LineNum);
>> >>
; ;
vfrStatementStringType : vfrStatementStringType :
@ -1822,10 +1822,10 @@ vfrStatementStatList :
; ;
vfrStatementDisableIfStat : vfrStatementDisableIfStat :
<< <<
CIfrDisableIf DIObj; CIfrDisableIf DIObj;
UINT32 ExpOpCount = 0; UINT32 ExpOpCount = 0;
>> >>
L:DisableIf << DIObj.SetLineNo(L->getLine()); >> L:DisableIf << DIObj.SetLineNo(L->getLine()); >>
vfrStatementExpression[0, ExpOpCount] ";" << mConstantOnlyInExpression = FALSE; >> vfrStatementExpression[0, ExpOpCount] ";" << mConstantOnlyInExpression = FALSE; >>
( vfrStatementStatList )* ( vfrStatementStatList )*
@ -1834,10 +1834,10 @@ vfrStatementDisableIfStat :
; ;
vfrStatementSuppressIfStat : vfrStatementSuppressIfStat :
<< <<
CIfrSuppressIf SIObj; CIfrSuppressIf SIObj;
UINT32 ExpOpCount = 0; UINT32 ExpOpCount = 0;
>> >>
L:SuppressIf << SIObj.SetLineNo(L->getLine()); >> L:SuppressIf << SIObj.SetLineNo(L->getLine()); >>
{ FLAGS "=" flagsField ( "\|" flagsField )* "," } { FLAGS "=" flagsField ( "\|" flagsField )* "," }
vfrStatementExpression[0, ExpOpCount] ";" vfrStatementExpression[0, ExpOpCount] ";"
@ -1847,10 +1847,10 @@ vfrStatementSuppressIfStat :
; ;
vfrStatementGrayOutIfStat : vfrStatementGrayOutIfStat :
<< <<
CIfrGrayOutIf GOIObj; CIfrGrayOutIf GOIObj;
UINT32 ExpOpCount = 0; UINT32 ExpOpCount = 0;
>> >>
L:GrayOutIf << GOIObj.SetLineNo(L->getLine()); >> L:GrayOutIf << GOIObj.SetLineNo(L->getLine()); >>
{ FLAGS "=" flagsField ( "\|" flagsField )* "," } { FLAGS "=" flagsField ( "\|" flagsField )* "," }
vfrStatementExpression[0, ExpOpCount] vfrStatementExpression[0, ExpOpCount]
@ -1890,10 +1890,10 @@ vfrStatementLocked :
; ;
vfrStatementInconsistentIf : vfrStatementInconsistentIf :
<< <<
CIfrInconsistentIf IIObj; CIfrInconsistentIf IIObj;
UINT32 ExpOpCount = 0; UINT32 ExpOpCount = 0;
>> >>
L:InconsistentIf << IIObj.SetLineNo(L->getLine()); >> L:InconsistentIf << IIObj.SetLineNo(L->getLine()); >>
Prompt "=" "STRING_TOKEN" "\(" S:Number "\)" "," << IIObj.SetError (_STOSID(S->getText())); >> Prompt "=" "STRING_TOKEN" "\(" S:Number "\)" "," << IIObj.SetError (_STOSID(S->getText())); >>
{ FLAGS "=" flagsField ( "\|" flagsField )* "," } { FLAGS "=" flagsField ( "\|" flagsField )* "," }
@ -1902,10 +1902,10 @@ vfrStatementInconsistentIf :
; ;
vfrStatementNoSubmitIf : vfrStatementNoSubmitIf :
<< <<
CIfrNoSubmitIf NSIObj; CIfrNoSubmitIf NSIObj;
UINT32 ExpOpCount = 0; UINT32 ExpOpCount = 0;
>> >>
L:NoSubmitIf << NSIObj.SetLineNo(L->getLine()); >> L:NoSubmitIf << NSIObj.SetLineNo(L->getLine()); >>
Prompt "=" "STRING_TOKEN" "\(" S:Number "\)" "," << NSIObj.SetError (_STOSID(S->getText())); >> Prompt "=" "STRING_TOKEN" "\(" S:Number "\)" "," << NSIObj.SetError (_STOSID(S->getText())); >>
{ FLAGS "=" flagsField ( "\|" flagsField )* "," } { FLAGS "=" flagsField ( "\|" flagsField )* "," }
@ -1914,10 +1914,10 @@ vfrStatementNoSubmitIf :
; ;
vfrStatementDisableIfQuest : vfrStatementDisableIfQuest :
<< <<
CIfrDisableIf DIObj; CIfrDisableIf DIObj;
UINT32 ExpOpCount = 0; UINT32 ExpOpCount = 0;
>> >>
L:DisableIf << DIObj.SetLineNo(L->getLine()); >> L:DisableIf << DIObj.SetLineNo(L->getLine()); >>
vfrStatementExpression[0, ExpOpCount] ";" << mConstantOnlyInExpression = FALSE; >> vfrStatementExpression[0, ExpOpCount] ";" << mConstantOnlyInExpression = FALSE; >>
vfrStatementQuestionOptionList vfrStatementQuestionOptionList
@ -1937,10 +1937,10 @@ vfrStatementVarstoreDevice :
; ;
vfrStatementSuppressIfQuest : vfrStatementSuppressIfQuest :
<< <<
CIfrSuppressIf SIObj; CIfrSuppressIf SIObj;
UINT32 ExpOpCount = 0; UINT32 ExpOpCount = 0;
>> >>
L:SuppressIf << SIObj.SetLineNo(L->getLine()); >> L:SuppressIf << SIObj.SetLineNo(L->getLine()); >>
{ FLAGS "=" flagsField ( "\|" flagsField )* "," } { FLAGS "=" flagsField ( "\|" flagsField )* "," }
vfrStatementExpression[0, ExpOpCount] ";" vfrStatementExpression[0, ExpOpCount] ";"
@ -1962,30 +1962,30 @@ vfrStatementOneOfOption :
L:Option << OOOObj.SetLineNo(L->getLine()); >> L:Option << OOOObj.SetLineNo(L->getLine()); >>
Text "=" "STRING_TOKEN" "\(" S:Number "\)" "," << OOOObj.SetOption (_STOSID(S->getText())); >> Text "=" "STRING_TOKEN" "\(" S:Number "\)" "," << OOOObj.SetOption (_STOSID(S->getText())); >>
Value "=" vfrConstantValueField[_GET_CURRQEST_DATATYPE()] >[Val] "," Value "=" vfrConstantValueField[_GET_CURRQEST_DATATYPE()] >[Val] ","
<< <<
if (gCurrentMinMaxData != NULL) { if (gCurrentMinMaxData != NULL) {
//set min/max value for oneof opcode //set min/max value for oneof opcode
UINT64 Step = gCurrentMinMaxData->GetStepData(_GET_CURRQEST_DATATYPE()); UINT64 Step = gCurrentMinMaxData->GetStepData(_GET_CURRQEST_DATATYPE());
switch (_GET_CURRQEST_DATATYPE()) { switch (_GET_CURRQEST_DATATYPE()) {
case EFI_IFR_TYPE_NUM_SIZE_64: case EFI_IFR_TYPE_NUM_SIZE_64:
gCurrentMinMaxData->SetMinMaxStepData(Val.u64, Val.u64, Step); gCurrentMinMaxData->SetMinMaxStepData(Val.u64, Val.u64, Step);
break; break;
case EFI_IFR_TYPE_NUM_SIZE_32: case EFI_IFR_TYPE_NUM_SIZE_32:
gCurrentMinMaxData->SetMinMaxStepData(Val.u32, Val.u32, (UINT32) Step); gCurrentMinMaxData->SetMinMaxStepData(Val.u32, Val.u32, (UINT32) Step);
break; break;
case EFI_IFR_TYPE_NUM_SIZE_16: case EFI_IFR_TYPE_NUM_SIZE_16:
gCurrentMinMaxData->SetMinMaxStepData(Val.u16, Val.u16, (UINT16) Step); gCurrentMinMaxData->SetMinMaxStepData(Val.u16, Val.u16, (UINT16) Step);
break; break;
case EFI_IFR_TYPE_NUM_SIZE_8: case EFI_IFR_TYPE_NUM_SIZE_8:
gCurrentMinMaxData->SetMinMaxStepData(Val.u8, Val.u8, (UINT8) Step); gCurrentMinMaxData->SetMinMaxStepData(Val.u8, Val.u8, (UINT8) Step);
break; break;
default: default:
break; break;
} }
} }
OOOObj.SetType (_GET_CURRQEST_DATATYPE()); OOOObj.SetType (_GET_CURRQEST_DATATYPE());
OOOObj.SetValue (Val); OOOObj.SetValue (Val);
>> >>
F:FLAGS "=" vfrOneOfOptionFlags[OOOObj, F->getLine()] F:FLAGS "=" vfrOneOfOptionFlags[OOOObj, F->getLine()]
<< <<
if (OOOObj.GetFlags () & 0x10) { if (OOOObj.GetFlags () & 0x10) {
@ -2066,7 +2066,7 @@ vfrStatementInvalidHidden :
; ;
vfrStatementInvalidInconsistentIf : vfrStatementInvalidInconsistentIf :
<< UINT32 ExpOpCount = 0; >> << UINT32 ExpOpCount = 0; >>
InconsistentIf InconsistentIf
Prompt "=" "STRING_TOKEN" "\(" S:Number "\)" "," Prompt "=" "STRING_TOKEN" "\(" S:Number "\)" ","
{ FLAGS "=" flagsField ( "\|" flagsField )* "," } { FLAGS "=" flagsField ( "\|" flagsField )* "," }
@ -2237,28 +2237,28 @@ multdivmodTerm [UINT32 & RootLevel, UINT32 & ExpOpCount]:
L3:"%" castTerm[$RootLevel, $ExpOpCount] << $ExpOpCount++; CIfrModulo MObj(L3->getLine()); >> L3:"%" castTerm[$RootLevel, $ExpOpCount] << $ExpOpCount++; CIfrModulo MObj(L3->getLine()); >>
) )
)* )*
; ;
castTerm [UINT32 & RootLevel, UINT32 & ExpOpCount]: castTerm [UINT32 & RootLevel, UINT32 & ExpOpCount]:
<< UINT8 CastType = 0xFF; >> << UINT8 CastType = 0xFF; >>
( (
L:"\(" L:"\("
( (
Boolean << CastType = 0; >> Boolean << CastType = 0; >>
| Uint64 << CastType = 1; >> | Uint64 << CastType = 1; >>
| Uint32 << CastType = 1; >> | Uint32 << CastType = 1; >>
| Uint16 << CastType = 1; >> | Uint16 << CastType = 1; >>
| Uint8 << CastType = 1; >> | Uint8 << CastType = 1; >>
) )
"\)" "\)"
)* )*
atomTerm[$RootLevel, $ExpOpCount] atomTerm[$RootLevel, $ExpOpCount]
<< <<
switch (CastType) { switch (CastType) {
case 0: { CIfrToBoolean TBObj(L->getLine()); $ExpOpCount++; } break; case 0: { CIfrToBoolean TBObj(L->getLine()); $ExpOpCount++; } break;
case 1: { CIfrToUint TUObj(L->getLine()); $ExpOpCount++; } break; case 1: { CIfrToUint TUObj(L->getLine()); $ExpOpCount++; } break;
} }
>> >>
; ;
atomTerm [UINT32 & RootLevel, UINT32 & ExpOpCount]: atomTerm [UINT32 & RootLevel, UINT32 & ExpOpCount]:
@ -2544,7 +2544,7 @@ vfrExpressionUnaryOp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
| bitwisenotExp[$RootLevel, $ExpOpCount] | bitwisenotExp[$RootLevel, $ExpOpCount]
| question2refExp[$RootLevel, $ExpOpCount] | question2refExp[$RootLevel, $ExpOpCount]
| stringref2Exp[$RootLevel, $ExpOpCount] | stringref2Exp[$RootLevel, $ExpOpCount]
| toboolExp[$RootLevel, $ExpOpCount] | toboolExp[$RootLevel, $ExpOpCount]
| unintExp[$RootLevel, $ExpOpCount] | unintExp[$RootLevel, $ExpOpCount]
| toupperExp[$RootLevel, $ExpOpCount] | toupperExp[$RootLevel, $ExpOpCount]
| tolwerExp[$RootLevel, $ExpOpCount] | tolwerExp[$RootLevel, $ExpOpCount]
@ -2700,7 +2700,7 @@ class EfiVfrParser {
<< <<
private: private:
UINT8 mParserStatus; UINT8 mParserStatus;
BOOLEAN mConstantOnlyInExpression; BOOLEAN mConstantOnlyInExpression;
CVfrDefaultStore mCVfrDefaultStore; CVfrDefaultStore mCVfrDefaultStore;
CVfrVarDataTypeDB mCVfrVarDataTypeDB; CVfrVarDataTypeDB mCVfrVarDataTypeDB;
@ -2723,14 +2723,14 @@ private:
UINT8 _GET_CURRQEST_DATATYPE (); UINT8 _GET_CURRQEST_DATATYPE ();
UINT32 _GET_CURRQEST_VARSIZE (); UINT32 _GET_CURRQEST_VARSIZE ();
UINT32 _GET_CURRQEST_ARRAY_SIZE (); UINT32 _GET_CURRQEST_ARRAY_SIZE ();
public: public:
VOID _PCATCH (IN INTN, IN INTN, IN ANTLRTokenPtr, IN INT8 *); VOID _PCATCH (IN INTN, IN INTN, IN ANTLRTokenPtr, IN INT8 *);
VOID _PCATCH (IN EFI_VFR_RETURN_CODE); VOID _PCATCH (IN EFI_VFR_RETURN_CODE);
VOID _PCATCH (IN EFI_VFR_RETURN_CODE, IN ANTLRTokenPtr); VOID _PCATCH (IN EFI_VFR_RETURN_CODE, IN ANTLRTokenPtr);
VOID _PCATCH (IN EFI_VFR_RETURN_CODE, IN UINT32); VOID _PCATCH (IN EFI_VFR_RETURN_CODE, IN UINT32);
VOID _PCATCH (IN EFI_VFR_RETURN_CODE, IN UINT32, IN INT8 *); VOID _PCATCH (IN EFI_VFR_RETURN_CODE, IN UINT32, IN INT8 *);
VOID syn (ANTLRAbstractToken *, ANTLRChar *, SetWordType *, ANTLRTokenType, INT32); VOID syn (ANTLRAbstractToken *, ANTLRChar *, SetWordType *, ANTLRTokenType, INT32);
@ -2845,37 +2845,37 @@ EfiVfrParser::_GET_CURRQEST_VARSIZE (
return mCurrQestVarInfo.mVarTotalSize; return mCurrQestVarInfo.mVarTotalSize;
} }
UINT32 UINT32
EfiVfrParser::_GET_CURRQEST_ARRAY_SIZE ( EfiVfrParser::_GET_CURRQEST_ARRAY_SIZE (
VOID VOID
) )
{ {
UINT8 Size = 1; UINT8 Size = 1;
switch (mCurrQestVarInfo.mVarType) { switch (mCurrQestVarInfo.mVarType) {
case EFI_IFR_TYPE_NUM_SIZE_8: case EFI_IFR_TYPE_NUM_SIZE_8:
Size = 1; Size = 1;
break; break;
case EFI_IFR_TYPE_NUM_SIZE_16: case EFI_IFR_TYPE_NUM_SIZE_16:
Size = 2; Size = 2;
break; break;
case EFI_IFR_TYPE_NUM_SIZE_32: case EFI_IFR_TYPE_NUM_SIZE_32:
Size = 4; Size = 4;
break; break;
case EFI_IFR_TYPE_NUM_SIZE_64: case EFI_IFR_TYPE_NUM_SIZE_64:
Size = 8; Size = 8;
break; break;
default: default:
break; break;
} }
return (mCurrQestVarInfo.mVarTotalSize / Size); return (mCurrQestVarInfo.mVarTotalSize / Size);
} }
VOID VOID
EfiVfrParser::_PCATCH ( EfiVfrParser::_PCATCH (
IN INTN ReturnCode, IN INTN ReturnCode,
@ -2914,16 +2914,16 @@ EfiVfrParser::_PCATCH (
) )
{ {
mParserStatus += gCVfrErrorHandle.HandleError (ReturnCode, LineNum); mParserStatus += gCVfrErrorHandle.HandleError (ReturnCode, LineNum);
} }
VOID VOID
EfiVfrParser::_PCATCH ( EfiVfrParser::_PCATCH (
IN EFI_VFR_RETURN_CODE ReturnCode, IN EFI_VFR_RETURN_CODE ReturnCode,
IN UINT32 LineNum, IN UINT32 LineNum,
IN INT8 *ErrorMsg IN INT8 *ErrorMsg
) )
{ {
mParserStatus = mParserStatus + gCVfrErrorHandle.HandleError (ReturnCode, LineNum, ErrorMsg); mParserStatus = mParserStatus + gCVfrErrorHandle.HandleError (ReturnCode, LineNum, ErrorMsg);
} }
VOID VOID