Rename dirs
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@16 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
37
MdePkg/Library/BaseLib/X64/CpuBreakpoint.asm
Normal file
37
MdePkg/Library/BaseLib/X64/CpuBreakpoint.asm
Normal file
@@ -0,0 +1,37 @@
|
||||
;------------------------------------------------------------------------------ ;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; CpuBreakpoint.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; CpuBreakpoint function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; VOID
|
||||
; EFIAPI
|
||||
; CpuBreakpoint (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
CpuBreakpoint PROC
|
||||
int 3
|
||||
ret
|
||||
CpuBreakpoint ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/CpuFlushTlb.asm
Normal file
38
MdePkg/Library/BaseLib/X64/CpuFlushTlb.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------ ;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; CpuFlushTlb.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; CpuFlushTlb function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; VOID
|
||||
; EFIAPI
|
||||
; CpuFlushTlb (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
CpuFlushTlb PROC
|
||||
mov rax, cr3
|
||||
mov cr3, rax
|
||||
ret
|
||||
CpuFlushTlb ENDP
|
||||
|
||||
END
|
62
MdePkg/Library/BaseLib/X64/CpuId.asm
Normal file
62
MdePkg/Library/BaseLib/X64/CpuId.asm
Normal file
@@ -0,0 +1,62 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; CpuId.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmCpuid function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; VOID
|
||||
; EFIAPI
|
||||
; AsmCpuid (
|
||||
; IN UINT32 RegisterInEax,
|
||||
; OUT UINT32 *RegisterOutEax OPTIONAL,
|
||||
; OUT UINT32 *RegisterOutEbx OPTIONAL,
|
||||
; OUT UINT32 *RegisterOutEcx OPTIONAL,
|
||||
; OUT UINT32 *RegisterOutEdx OPTIONAL
|
||||
; )
|
||||
;------------------------------------------------------------------------------
|
||||
AsmCpuid PROC USES rbx
|
||||
mov eax, ecx
|
||||
push rdx
|
||||
push rax ; save Index on stack
|
||||
cpuid
|
||||
test r9, r9
|
||||
jz @F
|
||||
mov [r9], ecx
|
||||
@@:
|
||||
pop rcx
|
||||
jrcxz @F
|
||||
mov [rcx], eax
|
||||
@@:
|
||||
mov rcx, r8
|
||||
jrcxz @F
|
||||
mov [rcx], ebx
|
||||
@@:
|
||||
mov rcx, [rsp + 30h]
|
||||
jrcxz @F
|
||||
mov [rcx], edx
|
||||
@@:
|
||||
pop rax ; restore Index to rax as return value
|
||||
ret
|
||||
AsmCpuid ENDP
|
||||
|
||||
END
|
37
MdePkg/Library/BaseLib/X64/CpuPause.asm
Normal file
37
MdePkg/Library/BaseLib/X64/CpuPause.asm
Normal file
@@ -0,0 +1,37 @@
|
||||
;------------------------------------------------------------------------------ ;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; CpuPause.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; CpuPause function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; VOID
|
||||
; EFIAPI
|
||||
; CpuPause (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
CpuPause PROC
|
||||
pause
|
||||
ret
|
||||
CpuPause ENDP
|
||||
|
||||
END
|
37
MdePkg/Library/BaseLib/X64/CpuSleep.asm
Normal file
37
MdePkg/Library/BaseLib/X64/CpuSleep.asm
Normal file
@@ -0,0 +1,37 @@
|
||||
;------------------------------------------------------------------------------ ;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; CpuSleep.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; CpuSleep function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; VOID
|
||||
; EFIAPI
|
||||
; CpuSleep (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
CpuSleep PROC
|
||||
hlt
|
||||
ret
|
||||
CpuSleep ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/DisableInterrupts.asm
Normal file
38
MdePkg/Library/BaseLib/X64/DisableInterrupts.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; DisableInterrupts.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; DisableInterrupts function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; VOID
|
||||
; EFIAPI
|
||||
; DisableInterrupts (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
DisableInterrupts PROC
|
||||
cli
|
||||
ret
|
||||
DisableInterrupts ENDP
|
||||
|
||||
END
|
54
MdePkg/Library/BaseLib/X64/DisablePaging64.asm
Normal file
54
MdePkg/Library/BaseLib/X64/DisablePaging64.asm
Normal file
@@ -0,0 +1,54 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; DisablePaging64.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmDisablePaging64 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
InternalX86DisablePaging64 PROC
|
||||
cli
|
||||
shl rcx, 32
|
||||
lea ecx, @F
|
||||
push rcx
|
||||
mov ebx, edx
|
||||
mov esi, r8d
|
||||
mov edi, r9d
|
||||
mov eax, [rsp + 28h]
|
||||
retf
|
||||
@@:
|
||||
mov esp, eax ; set up new stack
|
||||
mov rax, cr0
|
||||
btr eax, 31
|
||||
mov cr0, rax ; disable paging
|
||||
mov ecx, 0c0000080h
|
||||
rdmsr
|
||||
and ah, NOT 1 ; clear LME
|
||||
wrmsr
|
||||
mov rax, cr4
|
||||
and al, NOT (1 SHL 5) ; clear PAE
|
||||
mov cr4, rax
|
||||
push rdi
|
||||
push rsi
|
||||
call rbx
|
||||
jmp $
|
||||
InternalX86DisablePaging64 ENDP
|
||||
|
||||
END
|
39
MdePkg/Library/BaseLib/X64/EnableDisableInterrupts.asm
Normal file
39
MdePkg/Library/BaseLib/X64/EnableDisableInterrupts.asm
Normal file
@@ -0,0 +1,39 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; EnableDisableInterrupts.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; EnableDisableInterrupts function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; VOID
|
||||
; EFIAPI
|
||||
; EnableDisableInterrupts (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
EnableDisableInterrupts PROC
|
||||
sti
|
||||
cli
|
||||
ret
|
||||
EnableDisableInterrupts ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/EnableInterrupts.asm
Normal file
38
MdePkg/Library/BaseLib/X64/EnableInterrupts.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; EnableInterrupts.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; EnableInterrupts function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; VOID
|
||||
; EFIAPI
|
||||
; EnableInterrupts (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
EnableInterrupts PROC
|
||||
sti
|
||||
ret
|
||||
EnableInterrupts ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/FlushCacheLine.asm
Normal file
38
MdePkg/Library/BaseLib/X64/FlushCacheLine.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; FlushCacheLine.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmFlushCacheLine function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; VOID
|
||||
; EFIAPI
|
||||
; AsmFlushCacheLine (
|
||||
; IN VOID *LinearAddress
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmFlushCacheLine PROC
|
||||
clflush [rcx]
|
||||
ret
|
||||
AsmFlushCacheLine ENDP
|
||||
|
||||
END
|
31
MdePkg/Library/BaseLib/X64/FxRestore.asm
Normal file
31
MdePkg/Library/BaseLib/X64/FxRestore.asm
Normal file
@@ -0,0 +1,31 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; FxRestore.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmFxRestore function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
InternalX86FxRestore PROC
|
||||
fxrstor [rcx]
|
||||
ret
|
||||
InternalX86FxRestore ENDP
|
||||
|
||||
END
|
31
MdePkg/Library/BaseLib/X64/FxSave.asm
Normal file
31
MdePkg/Library/BaseLib/X64/FxSave.asm
Normal file
@@ -0,0 +1,31 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; FxSave.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmFxSave function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
InternalX86FxSave PROC
|
||||
fxsave [rcx]
|
||||
ret
|
||||
InternalX86FxSave ENDP
|
||||
|
||||
END
|
41
MdePkg/Library/BaseLib/X64/InterlockedCompareExchange32.asm
Normal file
41
MdePkg/Library/BaseLib/X64/InterlockedCompareExchange32.asm
Normal file
@@ -0,0 +1,41 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; InterlockedCompareExchange32.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; InterlockedCompareExchange32 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINT32
|
||||
; EFIAPI
|
||||
; InterlockedCompareExchange32 (
|
||||
; IN UINT32 *Value,
|
||||
; IN UINT32 CompareValue,
|
||||
; IN UINT32 ExchangeValue
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
InternalSyncCompareExchange32 PROC
|
||||
mov eax, edx
|
||||
lock cmpxchg [rcx], r8d
|
||||
ret
|
||||
InternalSyncCompareExchange32 ENDP
|
||||
|
||||
END
|
41
MdePkg/Library/BaseLib/X64/InterlockedCompareExchange64.asm
Normal file
41
MdePkg/Library/BaseLib/X64/InterlockedCompareExchange64.asm
Normal file
@@ -0,0 +1,41 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; InterlockedCompareExchange64.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; InterlockedCompareExchange64 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINT64
|
||||
; EFIAPI
|
||||
; InterlockedCompareExchange64 (
|
||||
; IN UINT64 *Value,
|
||||
; IN UINT64 CompareValue,
|
||||
; IN UINT64 ExchangeValue
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
InternalSyncCompareExchange64 PROC
|
||||
mov rax, rdx
|
||||
lock cmpxchg [rcx], r8
|
||||
ret
|
||||
InternalSyncCompareExchange64 ENDP
|
||||
|
||||
END
|
39
MdePkg/Library/BaseLib/X64/InterlockedDecrement.asm
Normal file
39
MdePkg/Library/BaseLib/X64/InterlockedDecrement.asm
Normal file
@@ -0,0 +1,39 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; InterlockedDecrement.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; InterlockedDecrement function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINT32
|
||||
; EFIAPI
|
||||
; InterlockedDecrement (
|
||||
; IN UINT32 *Value
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
InternalSyncDecrement PROC
|
||||
lock dec dword ptr [rcx]
|
||||
mov eax, [rcx]
|
||||
ret
|
||||
InternalSyncDecrement ENDP
|
||||
|
||||
END
|
39
MdePkg/Library/BaseLib/X64/InterlockedIncrement.asm
Normal file
39
MdePkg/Library/BaseLib/X64/InterlockedIncrement.asm
Normal file
@@ -0,0 +1,39 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; InterlockedIncrement.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; InterlockedIncrement function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINT32
|
||||
; EFIAPI
|
||||
; InterlockedIncrement (
|
||||
; IN UINT32 *Value
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
InternalSyncIncrement PROC
|
||||
lock inc dword ptr [rcx]
|
||||
mov eax, [rcx]
|
||||
ret
|
||||
InternalSyncIncrement ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/Invd.asm
Normal file
38
MdePkg/Library/BaseLib/X64/Invd.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; Invd.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmInvd function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; VOID
|
||||
; EFIAPI
|
||||
; AsmInvd (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmInvd PROC
|
||||
invd
|
||||
ret
|
||||
AsmInvd ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/LongJump.asm
Normal file
38
MdePkg/Library/BaseLib/X64/LongJump.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; LongJump.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; Implementation of LongJump() on x64.
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
LongJump PROC
|
||||
mov rbx, [rcx]
|
||||
mov rsp, [rcx + 8]
|
||||
mov rbp, [rcx + 10h]
|
||||
mov rdi, [rcx + 18h]
|
||||
mov rsi, [rcx + 20h]
|
||||
mov r12, [rcx + 28h]
|
||||
mov r13, [rcx + 30h]
|
||||
mov r14, [rcx + 38h]
|
||||
mov r15, [rcx + 40h]
|
||||
mov rax, rdx
|
||||
jmp qword ptr [rcx + 48h]
|
||||
LongJump ENDP
|
||||
|
||||
END
|
43
MdePkg/Library/BaseLib/X64/Monitor.asm
Normal file
43
MdePkg/Library/BaseLib/X64/Monitor.asm
Normal file
@@ -0,0 +1,43 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; Monitor.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmMonitor function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINT64
|
||||
; EFIAPI
|
||||
; AsmMonitor (
|
||||
; IN UINTN Eax,
|
||||
; IN UINTN Ecx,
|
||||
; IN UINTN Edx
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmMonitor PROC
|
||||
mov eax, ecx
|
||||
mov ecx, edx
|
||||
mov edx, r8d
|
||||
DB 0fh, 1, 0c8h
|
||||
ret
|
||||
AsmMonitor ENDP
|
||||
|
||||
END
|
41
MdePkg/Library/BaseLib/X64/Mwait.asm
Normal file
41
MdePkg/Library/BaseLib/X64/Mwait.asm
Normal file
@@ -0,0 +1,41 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; Mwait.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmMwait function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINT64
|
||||
; EFIAPI
|
||||
; AsmMwait (
|
||||
; IN UINTN Eax,
|
||||
; IN UINTN Ecx
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmMwait PROC
|
||||
mov eax, ecx
|
||||
mov ecx, edx
|
||||
DB 0fh, 1, 0c9h
|
||||
ret
|
||||
AsmMwait ENDP
|
||||
|
||||
END
|
54
MdePkg/Library/BaseLib/X64/Non-existing.c
Normal file
54
MdePkg/Library/BaseLib/X64/Non-existing.c
Normal file
@@ -0,0 +1,54 @@
|
||||
/** @file
|
||||
Non-existing BaseLib functions on x64
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name: Non-existing.c
|
||||
|
||||
**/
|
||||
|
||||
#include "../BaseLibInternals.h"
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
InternalX86EnablePaging32 (
|
||||
IN SWITCH_STACK_ENTRY_POINT EntryPoint,
|
||||
IN VOID *Context1, OPTIONAL
|
||||
IN VOID *Context2, OPTIONAL
|
||||
IN VOID *NewStack
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
}
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
InternalX86DisablePaging32 (
|
||||
IN SWITCH_STACK_ENTRY_POINT EntryPoint,
|
||||
IN VOID *Context1, OPTIONAL
|
||||
IN VOID *Context2, OPTIONAL
|
||||
IN VOID *NewStack
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
}
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
InternalX86EnablePaging64 (
|
||||
IN UINT16 Cs,
|
||||
IN UINT64 EntryPoint,
|
||||
IN UINT64 Context1, OPTIONAL
|
||||
IN UINT64 Context2, OPTIONAL
|
||||
IN UINT64 NewStack
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
}
|
38
MdePkg/Library/BaseLib/X64/ReadCr0.asm
Normal file
38
MdePkg/Library/BaseLib/X64/ReadCr0.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadCr0.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadCr0 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmReadCr0 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmReadCr0 PROC
|
||||
mov rax, cr0
|
||||
ret
|
||||
AsmReadCr0 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/ReadCr2.asm
Normal file
38
MdePkg/Library/BaseLib/X64/ReadCr2.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadCr2.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadCr2 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmReadCr2 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmReadCr2 PROC
|
||||
mov rax, cr2
|
||||
ret
|
||||
AsmReadCr2 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/ReadCr3.asm
Normal file
38
MdePkg/Library/BaseLib/X64/ReadCr3.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadCr3.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadCr3 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmReadCr3 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmReadCr3 PROC
|
||||
mov rax, cr3
|
||||
ret
|
||||
AsmReadCr3 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/ReadCr4.asm
Normal file
38
MdePkg/Library/BaseLib/X64/ReadCr4.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadCr4.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadCr4 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmReadCr4 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmReadCr4 PROC
|
||||
mov rax, cr4
|
||||
ret
|
||||
AsmReadCr4 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/ReadCs.asm
Normal file
38
MdePkg/Library/BaseLib/X64/ReadCs.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadCs.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadCs function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINT16
|
||||
; EFIAPI
|
||||
; AsmReadCs (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmReadCs PROC
|
||||
mov ax, cs
|
||||
ret
|
||||
AsmReadCs ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/ReadDr0.asm
Normal file
38
MdePkg/Library/BaseLib/X64/ReadDr0.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadDr0.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadDr0 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmReadDr0 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmReadDr0 PROC
|
||||
mov rax, dr0
|
||||
ret
|
||||
AsmReadDr0 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/ReadDr1.asm
Normal file
38
MdePkg/Library/BaseLib/X64/ReadDr1.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadDr1.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadDr1 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmReadDr1 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmReadDr1 PROC
|
||||
mov rax, dr1
|
||||
ret
|
||||
AsmReadDr1 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/ReadDr2.asm
Normal file
38
MdePkg/Library/BaseLib/X64/ReadDr2.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadDr2.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadDr2 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmReadDr2 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmReadDr2 PROC
|
||||
mov rax, dr2
|
||||
ret
|
||||
AsmReadDr2 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/ReadDr3.asm
Normal file
38
MdePkg/Library/BaseLib/X64/ReadDr3.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadDr3.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadDr3 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmReadDr3 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmReadDr3 PROC
|
||||
mov rax, dr3
|
||||
ret
|
||||
AsmReadDr3 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/ReadDr4.asm
Normal file
38
MdePkg/Library/BaseLib/X64/ReadDr4.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadDr4.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadDr4 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmReadDr4 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmReadDr4 PROC
|
||||
DB 0fh, 21h, 0e0h
|
||||
ret
|
||||
AsmReadDr4 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/ReadDr5.asm
Normal file
38
MdePkg/Library/BaseLib/X64/ReadDr5.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadDr5.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadDr5 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmReadDr5 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmReadDr5 PROC
|
||||
DB 0fh, 21h, 0e8h
|
||||
ret
|
||||
AsmReadDr5 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/ReadDr6.asm
Normal file
38
MdePkg/Library/BaseLib/X64/ReadDr6.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadDr6.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadDr6 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmReadDr6 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmReadDr6 PROC
|
||||
mov rax, dr6
|
||||
ret
|
||||
AsmReadDr6 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/ReadDr7.asm
Normal file
38
MdePkg/Library/BaseLib/X64/ReadDr7.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadDr7.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadDr7 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmReadDr7 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmReadDr7 PROC
|
||||
mov rax, dr7
|
||||
ret
|
||||
AsmReadDr7 ENDP
|
||||
|
||||
END
|
39
MdePkg/Library/BaseLib/X64/ReadDs.asm
Normal file
39
MdePkg/Library/BaseLib/X64/ReadDs.asm
Normal file
@@ -0,0 +1,39 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadDs.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadDs function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINT16
|
||||
; EFIAPI
|
||||
; AsmReadDs (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmReadDs PROC
|
||||
mov ax, ds
|
||||
ret
|
||||
AsmReadDs ENDP
|
||||
|
||||
END
|
||||
|
39
MdePkg/Library/BaseLib/X64/ReadEflags.asm
Normal file
39
MdePkg/Library/BaseLib/X64/ReadEflags.asm
Normal file
@@ -0,0 +1,39 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadEflags.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadEflags function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmReadEflags (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmReadEflags PROC
|
||||
pushfq
|
||||
pop rax
|
||||
ret
|
||||
AsmReadEflags ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/ReadEs.asm
Normal file
38
MdePkg/Library/BaseLib/X64/ReadEs.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadEs.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadEs function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINT16
|
||||
; EFIAPI
|
||||
; AsmReadEs (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmReadEs PROC
|
||||
mov ax, es
|
||||
ret
|
||||
AsmReadEs ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/ReadFs.asm
Normal file
38
MdePkg/Library/BaseLib/X64/ReadFs.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadFs.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadFs function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINT16
|
||||
; EFIAPI
|
||||
; AsmReadFs (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmReadFs PROC
|
||||
mov ax, fs
|
||||
ret
|
||||
AsmReadFs ENDP
|
||||
|
||||
END
|
31
MdePkg/Library/BaseLib/X64/ReadGdtr.asm
Normal file
31
MdePkg/Library/BaseLib/X64/ReadGdtr.asm
Normal file
@@ -0,0 +1,31 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadGdtr.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadGdtr function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
InternalX86ReadGdtr PROC
|
||||
sgdt fword ptr [rcx]
|
||||
ret
|
||||
InternalX86ReadGdtr ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/ReadGs.asm
Normal file
38
MdePkg/Library/BaseLib/X64/ReadGs.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadGs.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadGs function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINT16
|
||||
; EFIAPI
|
||||
; AsmReadGs (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmReadGs PROC
|
||||
mov ax, gs
|
||||
ret
|
||||
AsmReadGs ENDP
|
||||
|
||||
END
|
31
MdePkg/Library/BaseLib/X64/ReadIdtr.asm
Normal file
31
MdePkg/Library/BaseLib/X64/ReadIdtr.asm
Normal file
@@ -0,0 +1,31 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadIdtr.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadIdtr function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
InternalX86ReadIdtr PROC
|
||||
sidt fword ptr [rcx]
|
||||
ret
|
||||
InternalX86ReadIdtr ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/ReadLdtr.asm
Normal file
38
MdePkg/Library/BaseLib/X64/ReadLdtr.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadLdtr.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadLdtr function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINT16
|
||||
; EFIAPI
|
||||
; AsmReadLdtr (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmReadLdtr PROC
|
||||
sldt eax
|
||||
ret
|
||||
AsmReadLdtr ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/ReadMm0.asm
Normal file
38
MdePkg/Library/BaseLib/X64/ReadMm0.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadMm0.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadMm0 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmReadMm0 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmReadMm0 PROC
|
||||
DB 48h, 0fh, 7eh, 0c0h
|
||||
ret
|
||||
AsmReadMm0 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/ReadMm1.asm
Normal file
38
MdePkg/Library/BaseLib/X64/ReadMm1.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadMm1.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadMm1 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmReadMm1 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmReadMm1 PROC
|
||||
DB 48h, 0fh, 7eh, 0c8h
|
||||
ret
|
||||
AsmReadMm1 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/ReadMm2.asm
Normal file
38
MdePkg/Library/BaseLib/X64/ReadMm2.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadMm2.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadMm2 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmReadMm2 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmReadMm2 PROC
|
||||
DB 48h, 0fh, 7eh, 0d0h
|
||||
ret
|
||||
AsmReadMm2 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/ReadMm3.asm
Normal file
38
MdePkg/Library/BaseLib/X64/ReadMm3.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadMm3.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadMm3 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmReadMm3 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmReadMm3 PROC
|
||||
DB 48h, 0fh, 7eh, 0d8h
|
||||
ret
|
||||
AsmReadMm3 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/ReadMm4.asm
Normal file
38
MdePkg/Library/BaseLib/X64/ReadMm4.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadMm4.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadMm4 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmReadMm4 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmReadMm4 PROC
|
||||
DB 48h, 0fh, 7eh, 0e0h
|
||||
ret
|
||||
AsmReadMm4 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/ReadMm5.asm
Normal file
38
MdePkg/Library/BaseLib/X64/ReadMm5.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadMm5.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadMm5 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmReadMm5 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmReadMm5 PROC
|
||||
DB 48h, 0fh, 7eh, 0e8h
|
||||
ret
|
||||
AsmReadMm5 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/ReadMm6.asm
Normal file
38
MdePkg/Library/BaseLib/X64/ReadMm6.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadMm6.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadMm6 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmReadMm6 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmReadMm6 PROC
|
||||
DB 48h, 0fh, 7eh, 0f0h
|
||||
ret
|
||||
AsmReadMm6 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/ReadMm7.asm
Normal file
38
MdePkg/Library/BaseLib/X64/ReadMm7.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadMm7.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadMm7 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmReadMm7 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmReadMm7 PROC
|
||||
DB 48h, 0fh, 7eh, 0f8h
|
||||
ret
|
||||
AsmReadMm7 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/ReadMsr32.asm
Normal file
38
MdePkg/Library/BaseLib/X64/ReadMsr32.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadMsr32.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadMsr32 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINT32
|
||||
; EFIAPI
|
||||
; AsmReadMsr32 (
|
||||
; IN UINT32 Index
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmReadMsr32 PROC
|
||||
rdmsr
|
||||
ret
|
||||
AsmReadMsr32 ENDP
|
||||
|
||||
END
|
40
MdePkg/Library/BaseLib/X64/ReadMsr64.asm
Normal file
40
MdePkg/Library/BaseLib/X64/ReadMsr64.asm
Normal file
@@ -0,0 +1,40 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadMsr64.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadMsr64 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINT64
|
||||
; EFIAPI
|
||||
; AsmReadMsr64 (
|
||||
; IN UINT32 Index
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmReadMsr64 PROC
|
||||
rdmsr
|
||||
shl rax, 20h
|
||||
shrd rax, rdx, 20h
|
||||
ret
|
||||
AsmReadMsr64 ENDP
|
||||
|
||||
END
|
43
MdePkg/Library/BaseLib/X64/ReadPmc.asm
Normal file
43
MdePkg/Library/BaseLib/X64/ReadPmc.asm
Normal file
@@ -0,0 +1,43 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadPmc.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadPmc function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINT64
|
||||
; EFIAPI
|
||||
; AsmReadPmc (
|
||||
; IN UINT32 PmcIndex
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmReadPmc PROC
|
||||
rdpmc
|
||||
shl ecx, 1
|
||||
jnc @F
|
||||
shl rax, 20h
|
||||
shrd rax, rdx, 20h
|
||||
@@:
|
||||
ret
|
||||
AsmReadPmc ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/ReadSs.asm
Normal file
38
MdePkg/Library/BaseLib/X64/ReadSs.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadSs.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadSs function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINT16
|
||||
; EFIAPI
|
||||
; AsmReadSs (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmReadSs PROC
|
||||
mov ax, ss
|
||||
ret
|
||||
AsmReadSs ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/ReadTr.asm
Normal file
38
MdePkg/Library/BaseLib/X64/ReadTr.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadTr.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadTr function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINT16
|
||||
; EFIAPI
|
||||
; AsmReadTr (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmReadTr PROC
|
||||
str eax
|
||||
ret
|
||||
AsmReadTr ENDP
|
||||
|
||||
END
|
40
MdePkg/Library/BaseLib/X64/ReadTsc.asm
Normal file
40
MdePkg/Library/BaseLib/X64/ReadTsc.asm
Normal file
@@ -0,0 +1,40 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; ReadTsc.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmReadTsc function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINT64
|
||||
; EFIAPI
|
||||
; AsmReadTsc (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmReadTsc PROC
|
||||
rdtsc
|
||||
shl rax, 20h
|
||||
shrd rax, rdx, 20h
|
||||
ret
|
||||
AsmReadTsc ENDP
|
||||
|
||||
END
|
40
MdePkg/Library/BaseLib/X64/SetJump.asm
Normal file
40
MdePkg/Library/BaseLib/X64/SetJump.asm
Normal file
@@ -0,0 +1,40 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; SetJump.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; Implementation of SetJump() on x64.
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
SetJump PROC
|
||||
pop rdx
|
||||
mov [rcx], rbx
|
||||
mov [rcx + 8], rsp
|
||||
mov [rcx + 10h], rbp
|
||||
mov [rcx + 18h], rdi
|
||||
mov [rcx + 20h], rsi
|
||||
mov [rcx + 28h], r12
|
||||
mov [rcx + 30h], r13
|
||||
mov [rcx + 38h], r14
|
||||
mov [rcx + 40h], r15
|
||||
mov [rcx + 48h], rdx
|
||||
xor rax, rax
|
||||
jmp rdx
|
||||
SetJump ENDP
|
||||
|
||||
END
|
47
MdePkg/Library/BaseLib/X64/SwitchStack.asm
Normal file
47
MdePkg/Library/BaseLib/X64/SwitchStack.asm
Normal file
@@ -0,0 +1,47 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; SwitchStack.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Routine Description:
|
||||
;
|
||||
; Routine for switching stacks with 1 parameter
|
||||
;
|
||||
; Arguments:
|
||||
;
|
||||
; (rcx) EntryPoint - Entry point with new stack.
|
||||
; (rdx) Context - Parameter for entry point.
|
||||
; (r8) Context2 - Parameter2 for entry point.
|
||||
; (r9) NewStack - Pointer to new stack.
|
||||
;
|
||||
; Returns:
|
||||
;
|
||||
; None
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
SwitchStack PROC
|
||||
mov rax, rcx
|
||||
mov rcx, rdx
|
||||
mov rdx, r8
|
||||
lea rsp, [r9 - 20h]
|
||||
call rax
|
||||
SwitchStack ENDP
|
||||
|
||||
END
|
189
MdePkg/Library/BaseLib/X64/Thunk16.asm
Normal file
189
MdePkg/Library/BaseLib/X64/Thunk16.asm
Normal file
@@ -0,0 +1,189 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; Thunk.asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; Real mode thunk
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.data
|
||||
|
||||
NullSegSel DQ 0
|
||||
_16CsSegSel LABEL QWORD
|
||||
DW -1
|
||||
DW 0
|
||||
DB 0
|
||||
DB 9bh
|
||||
DB 8fh ; 16-bit segment
|
||||
DB 0
|
||||
_16BitDsSel LABEL QWORD
|
||||
DW -1
|
||||
DW 0
|
||||
DB 0
|
||||
DB 93h
|
||||
DB 8fh ; 16-bit segment
|
||||
DB 0
|
||||
GdtEnd LABEL QWORD
|
||||
|
||||
.const
|
||||
|
||||
_16Gdtr LABEL FWORD
|
||||
DW offset GdtEnd - offset NullSegSel - 1
|
||||
DQ offset NullSegSel
|
||||
|
||||
_16Idtr FWORD (1 SHL 10) - 1
|
||||
|
||||
.code
|
||||
|
||||
IA32_REGS STRUC 4t
|
||||
_EDI DD ?
|
||||
_ESI DD ?
|
||||
_EBP DD ?
|
||||
_ESP DD ?
|
||||
_EBX DD ?
|
||||
_EDX DD ?
|
||||
_ECX DD ?
|
||||
_EAX DD ?
|
||||
_DS DW ?
|
||||
_ES DW ?
|
||||
_FS DW ?
|
||||
_GS DW ?
|
||||
_RFLAGS DQ ?
|
||||
_EIP DD ?
|
||||
_CS DW ?
|
||||
_SS DW ?
|
||||
IA32_REGS ENDS
|
||||
|
||||
InternalAsmThunk16 PROC USES rbp rbx rsi rdi r12 r13 r14 r15
|
||||
mov eax, ds
|
||||
push rax
|
||||
mov eax, es
|
||||
push rax
|
||||
push fs
|
||||
push gs
|
||||
mov rsi, rcx ; rsi <- RegSet
|
||||
push sizeof (IA32_REGS)
|
||||
pop rcx
|
||||
movzx r8, (IA32_REGS ptr [rsi])._SS
|
||||
xor rdi, rdi
|
||||
mov edi, (IA32_REGS ptr [rsi])._ESP
|
||||
sub rdi, rcx ; reserve space on realmode stack
|
||||
push rdi ; save stack offset
|
||||
imul rax, r8, 16
|
||||
add rdi, rax ; rdi <- linear address of 16-bit stack
|
||||
rep movsb ; copy RegSet
|
||||
mov rsi, r8 ; si <- 16-bit stack segment
|
||||
pop rbx ; rbx <- 16-bit stack offset
|
||||
mov rdi, rdx ; rdi <- realmode patch
|
||||
lea eax, @BackToThunk ; rax <- address to back from real mode
|
||||
push rax ; use in a far return
|
||||
mov eax, cs
|
||||
mov [rsp + 4], eax ; save CS
|
||||
lea eax, @16Return ; thus @Return must < 4GB
|
||||
stosd ; set ret address offset
|
||||
xor eax, eax
|
||||
stosw ; set ret CS base to 0
|
||||
mov eax, esp
|
||||
stosd ; rsp must < 4GB
|
||||
mov eax, ss
|
||||
stosd
|
||||
mov rax, cr0
|
||||
mov ecx, eax ; ecx <- CR0
|
||||
and ecx, 7ffffffeh ; clear PE, PG bits
|
||||
stosd
|
||||
mov rax, cr4
|
||||
mov ebp, eax
|
||||
and ebp, 300h ; clear all but PCE and OSFXSR bits
|
||||
stosd
|
||||
sidt fword ptr [rsp + 70h] ; use parameter space to save IDTR
|
||||
sgdt fword ptr [rdi]
|
||||
lea edi, _16Idtr
|
||||
lea eax, @16Start ; rax <- seg:offset of @16Start
|
||||
push rax
|
||||
mov dword ptr [rsp + 4], 8
|
||||
push 10h
|
||||
pop rax ; rax <- 10h as dataseg selector
|
||||
lgdt _16Gdtr
|
||||
retf
|
||||
@16Start: ; 16-bit starts here
|
||||
mov ss, eax ; set SS to be a 16-bit segment
|
||||
mov cr0, rcx ; disable protected mode
|
||||
mov cr4, rbp
|
||||
DB 66h
|
||||
mov ecx, 0c0000080h
|
||||
rdmsr
|
||||
and ah, NOT 1 ; clear LME
|
||||
wrmsr
|
||||
mov ss, esi ; set up 16-bit stack
|
||||
mov sp, bx ; mov esp, ebx actually
|
||||
lidt fword ptr [edi]
|
||||
DB 66h, 61h ; popad
|
||||
DB 1fh ; pop ds
|
||||
DB 7 ; pop es
|
||||
pop fs
|
||||
pop gs
|
||||
add sp, 8 ; skip _RFLAGS
|
||||
DB 66h
|
||||
retf ; transfer control to 16-bit code
|
||||
@16Return:
|
||||
DB 66h
|
||||
push 0 ; high order 32 bits of rflags
|
||||
pushf ; pushfd actually
|
||||
push gs
|
||||
push fs
|
||||
DB 6 ; push es
|
||||
DB 1eh ; push ds
|
||||
DB 66h, 60h ; pushad
|
||||
DB 67h, 66h, 0c5h, 74h, 24h, 30h ; lds esi, [esp + 12*4]
|
||||
DB 66h
|
||||
mov eax, [esi + 12]
|
||||
mov cr4, rax ; restore CR4
|
||||
DB 66h
|
||||
lgdt fword ptr [esi + 16]
|
||||
DB 66h
|
||||
mov ecx, 0c0000080h
|
||||
rdmsr
|
||||
or ah, 1 ; set LME
|
||||
wrmsr
|
||||
DB 66h
|
||||
mov eax, [esi + 8]
|
||||
mov cr0, rax ; restore CR0
|
||||
xor ax, ax ; xor eax, eax actually
|
||||
mov eax, ss
|
||||
mov dword ptr (IA32_REGS ptr [esp])._SS, eax
|
||||
shl ax, 4 ; shl eax, 4 actually
|
||||
add ax, sp ; add eax, esp actually
|
||||
add sp, sizeof (IA32_REGS) ; add esp, sizeof (IA32_REGS)
|
||||
DB 66h
|
||||
mov dword ptr (IA32_REGS ptr [esp - sizeof (IA32_REGS)])._ESP, esp
|
||||
DB 66h
|
||||
lss esp, fword ptr [esi] ; restore protected mode stack
|
||||
DB 66h
|
||||
retf ; go back to protected mode
|
||||
@BackToThunk:
|
||||
lidt fword ptr [rsp + 68h] ; restore protected mode IDTR
|
||||
shl rax, 32
|
||||
shr rax, 32 ; clear high order 32 bits of RAX
|
||||
pop gs
|
||||
pop fs
|
||||
pop rcx
|
||||
mov es, ecx
|
||||
pop rcx
|
||||
mov ds, ecx
|
||||
ret
|
||||
InternalAsmThunk16 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/Wbinvd.asm
Normal file
38
MdePkg/Library/BaseLib/X64/Wbinvd.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; Wbinvd.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmWbinvd function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; VOID
|
||||
; EFIAPI
|
||||
; AsmWbinvd (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmWbinvd PROC
|
||||
wbinvd
|
||||
ret
|
||||
AsmWbinvd ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/WriteCr0.asm
Normal file
38
MdePkg/Library/BaseLib/X64/WriteCr0.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; WriteCr0.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmWriteCr0 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmWriteCr0 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmWriteCr0 PROC
|
||||
mov cr0, rcx
|
||||
ret
|
||||
AsmWriteCr0 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/WriteCr2.asm
Normal file
38
MdePkg/Library/BaseLib/X64/WriteCr2.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; WriteCr2.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmWriteCr2 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmWriteCr2 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmWriteCr2 PROC
|
||||
mov cr2, rcx
|
||||
ret
|
||||
AsmWriteCr2 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/WriteCr3.asm
Normal file
38
MdePkg/Library/BaseLib/X64/WriteCr3.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; WriteCr3.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmWriteCr3 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmWriteCr3 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmWriteCr3 PROC
|
||||
mov cr3, rcx
|
||||
ret
|
||||
AsmWriteCr3 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/WriteCr4.asm
Normal file
38
MdePkg/Library/BaseLib/X64/WriteCr4.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; WriteCr4.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmWriteCr4 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmWriteCr4 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmWriteCr4 PROC
|
||||
mov cr4, rcx
|
||||
ret
|
||||
AsmWriteCr4 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/WriteDr0.asm
Normal file
38
MdePkg/Library/BaseLib/X64/WriteDr0.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; WriteDr0.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmWriteDr0 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmWriteDr0 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmWriteDr0 PROC
|
||||
mov dr0, rcx
|
||||
ret
|
||||
AsmWriteDr0 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/WriteDr1.asm
Normal file
38
MdePkg/Library/BaseLib/X64/WriteDr1.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; WriteDr1.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmWriteDr1 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmWriteDr1 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmWriteDr1 PROC
|
||||
mov dr1, rcx
|
||||
ret
|
||||
AsmWriteDr1 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/WriteDr2.asm
Normal file
38
MdePkg/Library/BaseLib/X64/WriteDr2.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; WriteDr2.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmWriteDr2 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmWriteDr2 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmWriteDr2 PROC
|
||||
mov dr2, rcx
|
||||
ret
|
||||
AsmWriteDr2 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/WriteDr3.asm
Normal file
38
MdePkg/Library/BaseLib/X64/WriteDr3.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; WriteDr3.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmWriteDr3 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmWriteDr3 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmWriteDr3 PROC
|
||||
mov dr3, rcx
|
||||
ret
|
||||
AsmWriteDr3 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/WriteDr4.asm
Normal file
38
MdePkg/Library/BaseLib/X64/WriteDr4.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; WriteDr4.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmWriteDr4 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmWriteDr4 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmWriteDr4 PROC
|
||||
DB 0fh, 23h, 0e1h
|
||||
ret
|
||||
AsmWriteDr4 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/WriteDr5.asm
Normal file
38
MdePkg/Library/BaseLib/X64/WriteDr5.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; WriteDr5.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmWriteDr5 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmWriteDr5 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmWriteDr5 PROC
|
||||
DB 0fh, 23h, 0e9h
|
||||
ret
|
||||
AsmWriteDr5 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/WriteDr6.asm
Normal file
38
MdePkg/Library/BaseLib/X64/WriteDr6.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; WriteDr6.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmWriteDr6 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmWriteDr6 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmWriteDr6 PROC
|
||||
mov dr6, rcx
|
||||
ret
|
||||
AsmWriteDr6 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/WriteDr7.asm
Normal file
38
MdePkg/Library/BaseLib/X64/WriteDr7.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; WriteDr7.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmWriteDr7 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmWriteDr7 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmWriteDr7 PROC
|
||||
mov dr7, rcx
|
||||
ret
|
||||
AsmWriteDr7 ENDP
|
||||
|
||||
END
|
31
MdePkg/Library/BaseLib/X64/WriteGdtr.asm
Normal file
31
MdePkg/Library/BaseLib/X64/WriteGdtr.asm
Normal file
@@ -0,0 +1,31 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; WriteGdtr.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmWriteGdtr function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
InternalX86WriteGdtr PROC
|
||||
lgdt fword ptr [rcx]
|
||||
ret
|
||||
InternalX86WriteGdtr ENDP
|
||||
|
||||
END
|
31
MdePkg/Library/BaseLib/X64/WriteIdtr.asm
Normal file
31
MdePkg/Library/BaseLib/X64/WriteIdtr.asm
Normal file
@@ -0,0 +1,31 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; WriteIdtr.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmWriteIdtr function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
InternalX86WriteIdtr PROC
|
||||
lidt fword ptr [rcx]
|
||||
ret
|
||||
InternalX86WriteIdtr ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/WriteLdtr.asm
Normal file
38
MdePkg/Library/BaseLib/X64/WriteLdtr.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; WriteLdtr.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmWriteLdtr function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; VOID
|
||||
; EFIAPI
|
||||
; AsmWriteLdtr (
|
||||
; IN UINT16 Ldtr
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmWriteLdtr PROC
|
||||
lldt cx
|
||||
ret
|
||||
AsmWriteLdtr ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/WriteMm0.asm
Normal file
38
MdePkg/Library/BaseLib/X64/WriteMm0.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; WriteMm0.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmWriteMm0 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmWriteMm0 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmWriteMm0 PROC
|
||||
DB 48h, 0fh, 6eh, 0c1h
|
||||
ret
|
||||
AsmWriteMm0 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/WriteMm1.asm
Normal file
38
MdePkg/Library/BaseLib/X64/WriteMm1.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; WriteMm1.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmWriteMm1 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmWriteMm1 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmWriteMm1 PROC
|
||||
DB 48h, 0fh, 6eh, 0c9h
|
||||
ret
|
||||
AsmWriteMm1 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/WriteMm2.asm
Normal file
38
MdePkg/Library/BaseLib/X64/WriteMm2.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; WriteMm2.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmWriteMm2 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmWriteMm2 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmWriteMm2 PROC
|
||||
DB 48h, 0fh, 6eh, 0d1h
|
||||
ret
|
||||
AsmWriteMm2 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/WriteMm3.asm
Normal file
38
MdePkg/Library/BaseLib/X64/WriteMm3.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; WriteMm3.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmWriteMm3 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmWriteMm3 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmWriteMm3 PROC
|
||||
DB 48h, 0fh, 6eh, 0d9h
|
||||
ret
|
||||
AsmWriteMm3 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/WriteMm4.asm
Normal file
38
MdePkg/Library/BaseLib/X64/WriteMm4.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; WriteMm4.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmWriteMm4 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmWriteMm4 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmWriteMm4 PROC
|
||||
DB 48h, 0fh, 6eh, 0e1h
|
||||
ret
|
||||
AsmWriteMm4 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/WriteMm5.asm
Normal file
38
MdePkg/Library/BaseLib/X64/WriteMm5.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; WriteMm5.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmWriteMm5 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmWriteMm5 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmWriteMm5 PROC
|
||||
DB 48h, 0fh, 6eh, 0e9h
|
||||
ret
|
||||
AsmWriteMm5 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/WriteMm6.asm
Normal file
38
MdePkg/Library/BaseLib/X64/WriteMm6.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; WriteMm6.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmWriteMm6 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmWriteMm6 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmWriteMm6 PROC
|
||||
DB 48h, 0fh, 6eh, 0f1h
|
||||
ret
|
||||
AsmWriteMm6 ENDP
|
||||
|
||||
END
|
38
MdePkg/Library/BaseLib/X64/WriteMm7.asm
Normal file
38
MdePkg/Library/BaseLib/X64/WriteMm7.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; WriteMm7.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmWriteMm7 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EFIAPI
|
||||
; AsmWriteMm7 (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmWriteMm7 PROC
|
||||
DB 48h, 0fh, 6eh, 0f9h
|
||||
ret
|
||||
AsmWriteMm7 ENDP
|
||||
|
||||
END
|
41
MdePkg/Library/BaseLib/X64/WriteMsr32.asm
Normal file
41
MdePkg/Library/BaseLib/X64/WriteMsr32.asm
Normal file
@@ -0,0 +1,41 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; WriteMsr32.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmWriteMsr32 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINT32
|
||||
; EFIAPI
|
||||
; AsmWriteMsr32 (
|
||||
; IN UINT32 Index,
|
||||
; IN UINT32 Value
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmWriteMsr32 PROC
|
||||
mov eax, edx
|
||||
xor edx, edx
|
||||
wrmsr
|
||||
ret
|
||||
AsmWriteMsr32 ENDP
|
||||
|
||||
END
|
43
MdePkg/Library/BaseLib/X64/WriteMsr64.asm
Normal file
43
MdePkg/Library/BaseLib/X64/WriteMsr64.asm
Normal file
@@ -0,0 +1,43 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2006, Intel Corporation
|
||||
; All rights reserved. This program and the accompanying materials
|
||||
; 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
|
||||
; http://opensource.org/licenses/bsd-license.php
|
||||
;
|
||||
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;
|
||||
; Module Name:
|
||||
;
|
||||
; WriteMsr64.Asm
|
||||
;
|
||||
; Abstract:
|
||||
;
|
||||
; AsmWriteMsr64 function
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
.code
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINT64
|
||||
; EFIAPI
|
||||
; AsmWriteMsr64 (
|
||||
; IN UINT32 Index,
|
||||
; IN UINT64 Value
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
AsmWriteMsr64 PROC
|
||||
push rdx
|
||||
mov eax, edx
|
||||
shr rdx, 20h
|
||||
wrmsr
|
||||
pop rax
|
||||
ret
|
||||
AsmWriteMsr64 ENDP
|
||||
|
||||
END
|
Reference in New Issue
Block a user