]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Renamed remotely
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 27 Sep 2008 05:28:51 +0000 (05:28 +0000)
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 27 Sep 2008 05:28:51 +0000 (05:28 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6018 6f19259b-4bc3-4df7-8a09-765794883524

EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/X64/Cpu.S [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/X64/Cpu.asm [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/x64/Cpu.S [deleted file]
EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/x64/Cpu.asm [deleted file]

diff --git a/EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/X64/Cpu.S b/EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/X64/Cpu.S
new file mode 100644 (file)
index 0000000..3920804
--- /dev/null
@@ -0,0 +1,208 @@
+#------------------------------------------------------------------------------
+#*
+#*   Copyright (c) 2008, 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:
+#*
+#*    Cpu.asm
+#*  
+#*   Abstract:
+#*  
+#------------------------------------------------------------------------------
+#include <EfiBind.h>
+
+.globl ASM_PFX(EfiHalt)
+.globl ASM_PFX(EfiWbinvd)
+.globl ASM_PFX(EfiInvd)
+.globl ASM_PFX(EfiCpuid)
+.globl ASM_PFX(EfiReadTsc)
+.globl ASM_PFX(EfiDisableCache)
+.globl ASM_PFX(EfiEnableCache)
+.globl ASM_PFX(EfiReadMsr)
+.globl ASM_PFX(EfiGetEflags)
+.globl ASM_PFX(EfiDisableInterrupts)
+.globl ASM_PFX(EfiEnableInterrupts)
+.globl ASM_PFX(EfiCpuidExt)
+
+.text
+
+
+#------------------------------------------------------------------------------
+#  VOID
+#  EfiHalt (
+#    VOID
+#    )
+#------------------------------------------------------------------------------
+ASM_PFX(EfiHalt):
+    hlt
+    retq
+
+
+#------------------------------------------------------------------------------
+#  VOID
+#  EfiWbinvd (
+#    VOID
+#    )
+#------------------------------------------------------------------------------
+ASM_PFX(EfiWbinvd):
+    wbinvd
+    retq
+
+
+#------------------------------------------------------------------------------
+#  VOID
+#  EfiInvd (
+#    VOID
+#    )
+#------------------------------------------------------------------------------
+ASM_PFX(EfiInvd):
+    invd
+    retq
+
+#------------------------------------------------------------------------------
+#  VOID
+#  EfiCpuid (
+#    IN   UINT32              RegisterInEax,          // rcx   
+#    OUT  EFI_CPUID_REGISTER  *Reg           OPTIONAL // rdx  
+#    )
+#------------------------------------------------------------------------------
+ASM_PFX(EfiCpuid):
+      push   %rbx\r
+      mov    %rdx,%r8\r
+      mov    %rcx,%rax\r
+      cpuid  \r
+      cmp    $0x0,%r8\r
+      je     _Exit\r
+      mov    %eax,(%r8)\r
+      mov    %ebx,0x4(%r8)\r
+      mov    %ecx,0x8(%r8)\r
+      mov    %edx,0xc(%r8)
+_Exit:      
+      pop    %rbx
+      retq
+
+#------------------------------------------------------------------------------
+#  UINT64
+#  EfiReadMsr (
+#    IN   UINT32  Index,  // rcx
+#    )
+#------------------------------------------------------------------------------
+ASM_PFX(EfiReadMsr):
+      rdmsr  \r
+      shl    $0x20,%rdx\r
+      or     %rdx,%rax\r
+      retq   \r
+      
+#------------------------------------------------------------------------------
+#  VOID
+#  EfiWriteMsr (
+#    IN   UINT32  Index,  // rcx
+#    IN   UINT64  Value   // rdx
+#    )
+#------------------------------------------------------------------------------
+ASM_PFX(EfiWriteMsr):
+      mov    %rdx,%rax\r
+      sar    $0x20,%rdx\r
+      wrmsr  \r
+      retq 
+
+#------------------------------------------------------------------------------
+# UINT64
+# EfiReadTsc (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+ASM_PFX(EfiReadTsc):
+      rdtsc  \r
+      shl    $0x20,%rax\r
+      shrd   $0x20,%rdx,%rax\r
+      retq   \r
+
+#------------------------------------------------------------------------------
+# VOID
+# EfiDisableCache (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+ASM_PFX(EfiDisableCache):
+# added a check to see if cache is already disabled. If it is, then skip.
+      mov    %cr0,%rax\r
+      and    $0x60000000,%rax\r
+      cmp    $0x0,%rax\r
+      jne    1f\r
+      mov    %cr0,%rax\r
+      or     $0x60000000,%rax\r
+      mov    %rax,%cr0\r
+      wbinvd \r
+1:
+      retq   \r
+
+#------------------------------------------------------------------------------
+# VOID
+# EfiEnableCache (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+ASM_PFX(EfiEnableCache):
+      invd   \r
+      mov    %cr0,%rax\r
+      and    $0xffffffff9fffffff,%rax\r
+      mov    %rax,%cr0\r
+      retq   \r
+
+#------------------------------------------------------------------------------
+# UINTN
+# EfiGetEflags (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+ASM_PFX(EfiGetEflags):
+      pushfq \r
+      pop    %rax\r
+      retq   \r
+
+#------------------------------------------------------------------------------
+# VOID
+# EfiDisableInterrupts (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+ASM_PFX(EfiDisableInterrupts):
+    cli
+    ret
+
+#------------------------------------------------------------------------------
+# VOID
+# EfiEnableInterrupts (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+ASM_PFX(EfiEnableInterrupts):
+    sti
+    ret
+#------------------------------------------------------------------------------
+#  VOID
+#  EfiCpuidExt (
+#    IN   UINT32              RegisterInEax,
+#    IN   UINT32              CacheLevel,
+#    OUT  EFI_CPUID_REGISTER  *Regs              
+#    )
+#------------------------------------------------------------------------------
+ASM_PFX(EfiCpuidExt):
+      push   %rbx\r
+      mov    %rcx,%rax\r
+      mov    %rdx,%rcx\r
+      cpuid  \r
+      mov    %eax,(%r8)\r
+      mov    %ebx,0x4(%r8)\r
+      mov    %ecx,0x8(%r8)\r
+      mov    %edx,0xc(%r8)\r
+      pop    %rbx\r
+      retq   \r
diff --git a/EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/X64/Cpu.asm b/EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/X64/Cpu.asm
new file mode 100644 (file)
index 0000000..5ed3eea
--- /dev/null
@@ -0,0 +1,215 @@
+TITLE   Cpu.asm: Assembly code for the x64 resources\r
+\r
+;------------------------------------------------------------------------------\r
+;*\r
+;*   Copyright (c) 2005 - 2007, Intel Corporation                                                         \r
+;*   All rights reserved. This program and the accompanying materials                          \r
+;*   are licensed and made available under the terms and conditions of the BSD License         \r
+;*   which accompanies this distribution.  The full text of the license may be found at        \r
+;*   http://opensource.org/licenses/bsd-license.php                                            \r
+;*                                                                                             \r
+;*   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+;*   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+;*   \r
+;*   Module Name:\r
+;*\r
+;*    Cpu.asm\r
+;*  \r
+;*   Abstract:\r
+;*  \r
+;------------------------------------------------------------------------------\r
+\r
+text    SEGMENT\r
+\r
\r
+;------------------------------------------------------------------------------\r
+;  VOID\r
+;  EfiHalt (\r
+;    VOID\r
+;    )\r
+;------------------------------------------------------------------------------\r
+EfiHalt PROC    PUBLIC\r
+    hlt\r
+    ret\r
+EfiHalt ENDP\r
+\r
+\r
+;------------------------------------------------------------------------------\r
+;  VOID\r
+;  EfiWbinvd (\r
+;    VOID\r
+;    )\r
+;------------------------------------------------------------------------------\r
+EfiWbinvd PROC    PUBLIC\r
+    wbinvd\r
+    ret\r
+EfiWbinvd ENDP\r
+\r
+\r
+;------------------------------------------------------------------------------\r
+;  VOID\r
+;  EfiInvd (\r
+;    VOID\r
+;    )\r
+;------------------------------------------------------------------------------\r
+EfiInvd PROC    PUBLIC\r
+    invd\r
+    ret\r
+EfiInvd ENDP\r
+\r
+;------------------------------------------------------------------------------\r
+;  VOID\r
+;  EfiCpuid (\r
+;    IN   UINT32              RegisterInEax,          // rcx   \r
+;    OUT  EFI_CPUID_REGISTER  *Reg           OPTIONAL // rdx  \r
+;    )\r
+;------------------------------------------------------------------------------\r
+EfiCpuid PROC   PUBLIC\r
+    push  rbx\r
+    \r
+    mov   r8,   rdx         ; r8 = *Reg\r
+    mov   rax,  rcx         ; RegisterInEax\r
+    cpuid\r
+    cmp   r8,   0\r
+    je    _Exit\r
+    mov   [r8 +  0], eax    ; Reg->RegEax\r
+    mov   [r8 +  4], ebx    ; Reg->RegEbx\r
+    mov   [r8 +  8], ecx    ; Reg->RegEcx\r
+    mov   [r8 + 12], edx    ; Reg->RegEdx\r
+    \r
+_Exit:\r
+    pop   rbx\r
+    ret\r
+EfiCpuid  ENDP\r
+\r
+;------------------------------------------------------------------------------\r
+;  UINT64\r
+;  EfiReadMsr (\r
+;    IN   UINT32  Index,  // rcx\r
+;    )\r
+;------------------------------------------------------------------------------\r
+EfiReadMsr PROC  PUBLIC \r
+    rdmsr\r
+    sal     rdx, 32   ; edx:eax -> rax\r
+    or      rax, rdx  ; rax = edx:eax\r
+    ret\r
+EfiReadMsr  ENDP\r
+\r
+;------------------------------------------------------------------------------\r
+;  VOID\r
+;  EfiWriteMsr (\r
+;    IN   UINT32  Index,  // rcx\r
+;    IN   UINT64  Value   // rdx\r
+;    )\r
+;------------------------------------------------------------------------------\r
+EfiWriteMsr PROC   PUBLIC\r
+    mov     rax,  rdx   ; rdx = Value\r
+    sar     rdx,  32    ; convert rdx to edx upper 32-bits    \r
+    wrmsr               ; wrmsr[ecx] result = edx:eax\r
+    ret\r
+EfiWriteMsr  ENDP\r
+\r
+\r
+;------------------------------------------------------------------------------\r
+; UINT64\r
+; EfiReadTsc (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+EfiReadTsc PROC    PUBLIC\r
+    rdtsc\r
+    shl     rax, 32\r
+    shrd    rax, rdx, 32\r
+    ret\r
+EfiReadTsc  ENDP\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EfiDisableCache (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+EfiDisableCache PROC    PUBLIC\r
+; added a check to see if cache is already disabled. If it is, then skip.\r
+    mov   rax, cr0\r
+    and   rax, 060000000h     \r
+    cmp   rax, 0\r
+    jne   @f\r
+    mov   rax, cr0\r
+    or    rax, 060000000h     \r
+    mov   cr0, rax\r
+    wbinvd\r
+@@:\r
+    ret\r
+EfiDisableCache ENDP\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EfiEnableCache (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+EfiEnableCache PROC    PUBLIC\r
+    invd\r
+    mov   rax, cr0\r
+    and   rax, 09fffffffh         \r
+    mov   cr0, rax\r
+    ret\r
+EfiEnableCache ENDP\r
+\r
+;------------------------------------------------------------------------------\r
+; UINTN\r
+; EfiGetEflags (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+EfiGetEflags PROC    PUBLIC\r
+    pushfq\r
+    pop   rax\r
+    ret\r
+EfiGetEflags  ENDP\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EfiDisableInterrupts (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+EfiDisableInterrupts PROC    PUBLIC\r
+    cli\r
+    ret\r
+EfiDisableInterrupts  ENDP\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EfiEnableInterrupts (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+EfiEnableInterrupts PROC    PUBLIC\r
+    sti\r
+    ret\r
+EfiEnableInterrupts  ENDP\r
+;------------------------------------------------------------------------------\r
+;  VOID\r
+;  EfiCpuidExt (\r
+;    IN   UINT32              RegisterInEax,\r
+;    IN   UINT32              CacheLevel,\r
+;    OUT  EFI_CPUID_REGISTER  *Regs              \r
+;    )\r
+;------------------------------------------------------------------------------\r
+EfiCpuidExt PROC    PUBLIC\r
+     push   rbx\r
+     mov    rax, rcx          ; rax = RegisterInEax\r
+     mov    rcx, rdx          ; rcx = CacheLevel\r
+     \r
+     cpuid\r
+     mov    [r8 + 0 ],  eax   ; Reg->RegEax\r
+     mov    [r8 + 4 ],  ebx   ; Reg->RegEbx\r
+     mov    [r8 + 8 ],  ecx   ; Reg->RegEcx\r
+     mov    [r8 + 12],  edx   ; Reg->RegEdx\r
+    \r
+     pop rbx\r
+     ret\r
+EfiCpuidExt  ENDP\r
+END\r
diff --git a/EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/x64/Cpu.S b/EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/x64/Cpu.S
deleted file mode 100644 (file)
index 3920804..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-#------------------------------------------------------------------------------
-#*
-#*   Copyright (c) 2008, 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:
-#*
-#*    Cpu.asm
-#*  
-#*   Abstract:
-#*  
-#------------------------------------------------------------------------------
-#include <EfiBind.h>
-
-.globl ASM_PFX(EfiHalt)
-.globl ASM_PFX(EfiWbinvd)
-.globl ASM_PFX(EfiInvd)
-.globl ASM_PFX(EfiCpuid)
-.globl ASM_PFX(EfiReadTsc)
-.globl ASM_PFX(EfiDisableCache)
-.globl ASM_PFX(EfiEnableCache)
-.globl ASM_PFX(EfiReadMsr)
-.globl ASM_PFX(EfiGetEflags)
-.globl ASM_PFX(EfiDisableInterrupts)
-.globl ASM_PFX(EfiEnableInterrupts)
-.globl ASM_PFX(EfiCpuidExt)
-
-.text
-
-
-#------------------------------------------------------------------------------
-#  VOID
-#  EfiHalt (
-#    VOID
-#    )
-#------------------------------------------------------------------------------
-ASM_PFX(EfiHalt):
-    hlt
-    retq
-
-
-#------------------------------------------------------------------------------
-#  VOID
-#  EfiWbinvd (
-#    VOID
-#    )
-#------------------------------------------------------------------------------
-ASM_PFX(EfiWbinvd):
-    wbinvd
-    retq
-
-
-#------------------------------------------------------------------------------
-#  VOID
-#  EfiInvd (
-#    VOID
-#    )
-#------------------------------------------------------------------------------
-ASM_PFX(EfiInvd):
-    invd
-    retq
-
-#------------------------------------------------------------------------------
-#  VOID
-#  EfiCpuid (
-#    IN   UINT32              RegisterInEax,          // rcx   
-#    OUT  EFI_CPUID_REGISTER  *Reg           OPTIONAL // rdx  
-#    )
-#------------------------------------------------------------------------------
-ASM_PFX(EfiCpuid):
-      push   %rbx\r
-      mov    %rdx,%r8\r
-      mov    %rcx,%rax\r
-      cpuid  \r
-      cmp    $0x0,%r8\r
-      je     _Exit\r
-      mov    %eax,(%r8)\r
-      mov    %ebx,0x4(%r8)\r
-      mov    %ecx,0x8(%r8)\r
-      mov    %edx,0xc(%r8)
-_Exit:      
-      pop    %rbx
-      retq
-
-#------------------------------------------------------------------------------
-#  UINT64
-#  EfiReadMsr (
-#    IN   UINT32  Index,  // rcx
-#    )
-#------------------------------------------------------------------------------
-ASM_PFX(EfiReadMsr):
-      rdmsr  \r
-      shl    $0x20,%rdx\r
-      or     %rdx,%rax\r
-      retq   \r
-      
-#------------------------------------------------------------------------------
-#  VOID
-#  EfiWriteMsr (
-#    IN   UINT32  Index,  // rcx
-#    IN   UINT64  Value   // rdx
-#    )
-#------------------------------------------------------------------------------
-ASM_PFX(EfiWriteMsr):
-      mov    %rdx,%rax\r
-      sar    $0x20,%rdx\r
-      wrmsr  \r
-      retq 
-
-#------------------------------------------------------------------------------
-# UINT64
-# EfiReadTsc (
-#   VOID
-#   );
-#------------------------------------------------------------------------------
-ASM_PFX(EfiReadTsc):
-      rdtsc  \r
-      shl    $0x20,%rax\r
-      shrd   $0x20,%rdx,%rax\r
-      retq   \r
-
-#------------------------------------------------------------------------------
-# VOID
-# EfiDisableCache (
-#   VOID
-#   );
-#------------------------------------------------------------------------------
-ASM_PFX(EfiDisableCache):
-# added a check to see if cache is already disabled. If it is, then skip.
-      mov    %cr0,%rax\r
-      and    $0x60000000,%rax\r
-      cmp    $0x0,%rax\r
-      jne    1f\r
-      mov    %cr0,%rax\r
-      or     $0x60000000,%rax\r
-      mov    %rax,%cr0\r
-      wbinvd \r
-1:
-      retq   \r
-
-#------------------------------------------------------------------------------
-# VOID
-# EfiEnableCache (
-#   VOID
-#   );
-#------------------------------------------------------------------------------
-ASM_PFX(EfiEnableCache):
-      invd   \r
-      mov    %cr0,%rax\r
-      and    $0xffffffff9fffffff,%rax\r
-      mov    %rax,%cr0\r
-      retq   \r
-
-#------------------------------------------------------------------------------
-# UINTN
-# EfiGetEflags (
-#   VOID
-#   );
-#------------------------------------------------------------------------------
-ASM_PFX(EfiGetEflags):
-      pushfq \r
-      pop    %rax\r
-      retq   \r
-
-#------------------------------------------------------------------------------
-# VOID
-# EfiDisableInterrupts (
-#   VOID
-#   );
-#------------------------------------------------------------------------------
-ASM_PFX(EfiDisableInterrupts):
-    cli
-    ret
-
-#------------------------------------------------------------------------------
-# VOID
-# EfiEnableInterrupts (
-#   VOID
-#   );
-#------------------------------------------------------------------------------
-ASM_PFX(EfiEnableInterrupts):
-    sti
-    ret
-#------------------------------------------------------------------------------
-#  VOID
-#  EfiCpuidExt (
-#    IN   UINT32              RegisterInEax,
-#    IN   UINT32              CacheLevel,
-#    OUT  EFI_CPUID_REGISTER  *Regs              
-#    )
-#------------------------------------------------------------------------------
-ASM_PFX(EfiCpuidExt):
-      push   %rbx\r
-      mov    %rcx,%rax\r
-      mov    %rdx,%rcx\r
-      cpuid  \r
-      mov    %eax,(%r8)\r
-      mov    %ebx,0x4(%r8)\r
-      mov    %ecx,0x8(%r8)\r
-      mov    %edx,0xc(%r8)\r
-      pop    %rbx\r
-      retq   \r
diff --git a/EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/x64/Cpu.asm b/EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/x64/Cpu.asm
deleted file mode 100644 (file)
index 5ed3eea..0000000
+++ /dev/null
@@ -1,215 +0,0 @@
-TITLE   Cpu.asm: Assembly code for the x64 resources\r
-\r
-;------------------------------------------------------------------------------\r
-;*\r
-;*   Copyright (c) 2005 - 2007, Intel Corporation                                                         \r
-;*   All rights reserved. This program and the accompanying materials                          \r
-;*   are licensed and made available under the terms and conditions of the BSD License         \r
-;*   which accompanies this distribution.  The full text of the license may be found at        \r
-;*   http://opensource.org/licenses/bsd-license.php                                            \r
-;*                                                                                             \r
-;*   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-;*   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-;*   \r
-;*   Module Name:\r
-;*\r
-;*    Cpu.asm\r
-;*  \r
-;*   Abstract:\r
-;*  \r
-;------------------------------------------------------------------------------\r
-\r
-text    SEGMENT\r
-\r
\r
-;------------------------------------------------------------------------------\r
-;  VOID\r
-;  EfiHalt (\r
-;    VOID\r
-;    )\r
-;------------------------------------------------------------------------------\r
-EfiHalt PROC    PUBLIC\r
-    hlt\r
-    ret\r
-EfiHalt ENDP\r
-\r
-\r
-;------------------------------------------------------------------------------\r
-;  VOID\r
-;  EfiWbinvd (\r
-;    VOID\r
-;    )\r
-;------------------------------------------------------------------------------\r
-EfiWbinvd PROC    PUBLIC\r
-    wbinvd\r
-    ret\r
-EfiWbinvd ENDP\r
-\r
-\r
-;------------------------------------------------------------------------------\r
-;  VOID\r
-;  EfiInvd (\r
-;    VOID\r
-;    )\r
-;------------------------------------------------------------------------------\r
-EfiInvd PROC    PUBLIC\r
-    invd\r
-    ret\r
-EfiInvd ENDP\r
-\r
-;------------------------------------------------------------------------------\r
-;  VOID\r
-;  EfiCpuid (\r
-;    IN   UINT32              RegisterInEax,          // rcx   \r
-;    OUT  EFI_CPUID_REGISTER  *Reg           OPTIONAL // rdx  \r
-;    )\r
-;------------------------------------------------------------------------------\r
-EfiCpuid PROC   PUBLIC\r
-    push  rbx\r
-    \r
-    mov   r8,   rdx         ; r8 = *Reg\r
-    mov   rax,  rcx         ; RegisterInEax\r
-    cpuid\r
-    cmp   r8,   0\r
-    je    _Exit\r
-    mov   [r8 +  0], eax    ; Reg->RegEax\r
-    mov   [r8 +  4], ebx    ; Reg->RegEbx\r
-    mov   [r8 +  8], ecx    ; Reg->RegEcx\r
-    mov   [r8 + 12], edx    ; Reg->RegEdx\r
-    \r
-_Exit:\r
-    pop   rbx\r
-    ret\r
-EfiCpuid  ENDP\r
-\r
-;------------------------------------------------------------------------------\r
-;  UINT64\r
-;  EfiReadMsr (\r
-;    IN   UINT32  Index,  // rcx\r
-;    )\r
-;------------------------------------------------------------------------------\r
-EfiReadMsr PROC  PUBLIC \r
-    rdmsr\r
-    sal     rdx, 32   ; edx:eax -> rax\r
-    or      rax, rdx  ; rax = edx:eax\r
-    ret\r
-EfiReadMsr  ENDP\r
-\r
-;------------------------------------------------------------------------------\r
-;  VOID\r
-;  EfiWriteMsr (\r
-;    IN   UINT32  Index,  // rcx\r
-;    IN   UINT64  Value   // rdx\r
-;    )\r
-;------------------------------------------------------------------------------\r
-EfiWriteMsr PROC   PUBLIC\r
-    mov     rax,  rdx   ; rdx = Value\r
-    sar     rdx,  32    ; convert rdx to edx upper 32-bits    \r
-    wrmsr               ; wrmsr[ecx] result = edx:eax\r
-    ret\r
-EfiWriteMsr  ENDP\r
-\r
-\r
-;------------------------------------------------------------------------------\r
-; UINT64\r
-; EfiReadTsc (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-EfiReadTsc PROC    PUBLIC\r
-    rdtsc\r
-    shl     rax, 32\r
-    shrd    rax, rdx, 32\r
-    ret\r
-EfiReadTsc  ENDP\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EfiDisableCache (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-EfiDisableCache PROC    PUBLIC\r
-; added a check to see if cache is already disabled. If it is, then skip.\r
-    mov   rax, cr0\r
-    and   rax, 060000000h     \r
-    cmp   rax, 0\r
-    jne   @f\r
-    mov   rax, cr0\r
-    or    rax, 060000000h     \r
-    mov   cr0, rax\r
-    wbinvd\r
-@@:\r
-    ret\r
-EfiDisableCache ENDP\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EfiEnableCache (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-EfiEnableCache PROC    PUBLIC\r
-    invd\r
-    mov   rax, cr0\r
-    and   rax, 09fffffffh         \r
-    mov   cr0, rax\r
-    ret\r
-EfiEnableCache ENDP\r
-\r
-;------------------------------------------------------------------------------\r
-; UINTN\r
-; EfiGetEflags (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-EfiGetEflags PROC    PUBLIC\r
-    pushfq\r
-    pop   rax\r
-    ret\r
-EfiGetEflags  ENDP\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EfiDisableInterrupts (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-EfiDisableInterrupts PROC    PUBLIC\r
-    cli\r
-    ret\r
-EfiDisableInterrupts  ENDP\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EfiEnableInterrupts (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-EfiEnableInterrupts PROC    PUBLIC\r
-    sti\r
-    ret\r
-EfiEnableInterrupts  ENDP\r
-;------------------------------------------------------------------------------\r
-;  VOID\r
-;  EfiCpuidExt (\r
-;    IN   UINT32              RegisterInEax,\r
-;    IN   UINT32              CacheLevel,\r
-;    OUT  EFI_CPUID_REGISTER  *Regs              \r
-;    )\r
-;------------------------------------------------------------------------------\r
-EfiCpuidExt PROC    PUBLIC\r
-     push   rbx\r
-     mov    rax, rcx          ; rax = RegisterInEax\r
-     mov    rcx, rdx          ; rcx = CacheLevel\r
-     \r
-     cpuid\r
-     mov    [r8 + 0 ],  eax   ; Reg->RegEax\r
-     mov    [r8 + 4 ],  ebx   ; Reg->RegEbx\r
-     mov    [r8 + 8 ],  ecx   ; Reg->RegEcx\r
-     mov    [r8 + 12],  edx   ; Reg->RegEdx\r
-    \r
-     pop rbx\r
-     ret\r
-EfiCpuidExt  ENDP\r
-END\r