-#------------------------------------------------------------------------------
-#*
-#* 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):
+#------------------------------------------------------------------------------\r
+#*\r
+#* Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>\r
+#* 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
+#include <EfiBind.h>\r
+\r
+.globl ASM_PFX(EfiHalt)\r
+.globl ASM_PFX(EfiWbinvd)\r
+.globl ASM_PFX(EfiInvd)\r
+.globl ASM_PFX(EfiCpuid)\r
+.globl ASM_PFX(EfiReadTsc)\r
+.globl ASM_PFX(EfiDisableCache)\r
+.globl ASM_PFX(EfiEnableCache)\r
+.globl ASM_PFX(EfiReadMsr)\r
+.globl ASM_PFX(EfiGetEflags)\r
+.globl ASM_PFX(EfiDisableInterrupts)\r
+.globl ASM_PFX(EfiEnableInterrupts)\r
+.globl ASM_PFX(EfiCpuidExt)\r
+\r
+.text\r
+\r
+\r
+#------------------------------------------------------------------------------\r
+# VOID\r
+# EfiHalt (\r
+# VOID\r
+# )\r
+#------------------------------------------------------------------------------\r
+ASM_PFX(EfiHalt):\r
+ hlt\r
+ retq\r
+\r
+\r
+#------------------------------------------------------------------------------\r
+# VOID\r
+# EfiWbinvd (\r
+# VOID\r
+# )\r
+#------------------------------------------------------------------------------\r
+ASM_PFX(EfiWbinvd):\r
+ wbinvd\r
+ retq\r
+\r
+\r
+#------------------------------------------------------------------------------\r
+# VOID\r
+# EfiInvd (\r
+# VOID\r
+# )\r
+#------------------------------------------------------------------------------\r
+ASM_PFX(EfiInvd):\r
+ invd\r
+ retq\r
+\r
+#------------------------------------------------------------------------------\r
+# VOID\r
+# EfiCpuid (\r
+# IN UINT32 RegisterInEax, // rcx \r
+# OUT EFI_CPUID_REGISTER *Reg OPTIONAL // rdx \r
+# )\r
+#------------------------------------------------------------------------------\r
+ASM_PFX(EfiCpuid):\r
push %rbx\r
mov %rdx,%r8\r
mov %rcx,%rax\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):
+ mov %edx,0xc(%r8)\r
+_Exit: \r
+ pop %rbx\r
+ retq\r
+\r
+#------------------------------------------------------------------------------\r
+# UINT64\r
+# EfiReadMsr (\r
+# IN UINT32 Index, // rcx\r
+# )\r
+#------------------------------------------------------------------------------\r
+ASM_PFX(EfiReadMsr):\r
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):
+ \r
+#------------------------------------------------------------------------------\r
+# VOID\r
+# EfiWriteMsr (\r
+# IN UINT32 Index, // rcx\r
+# IN UINT64 Value // rdx\r
+# )\r
+#------------------------------------------------------------------------------\r
+ASM_PFX(EfiWriteMsr):\r
mov %rdx,%rax\r
sar $0x20,%rdx\r
wrmsr \r
- retq
-
-#------------------------------------------------------------------------------
-# UINT64
-# EfiReadTsc (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(EfiReadTsc):
+ retq \r
+\r
+#------------------------------------------------------------------------------\r
+# UINT64\r
+# EfiReadTsc (\r
+# VOID\r
+# );\r
+#------------------------------------------------------------------------------\r
+ASM_PFX(EfiReadTsc):\r
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.
+\r
+#------------------------------------------------------------------------------\r
+# VOID\r
+# EfiDisableCache (\r
+# VOID\r
+# );\r
+#------------------------------------------------------------------------------\r
+ASM_PFX(EfiDisableCache):\r
+# added a check to see if cache is already disabled. If it is, then skip.\r
mov %cr0,%rax\r
and $0x60000000,%rax\r
cmp $0x0,%rax\r
or $0x60000000,%rax\r
mov %rax,%cr0\r
wbinvd \r
-1:
+1:\r
retq \r
-
-#------------------------------------------------------------------------------
-# VOID
-# EfiEnableCache (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(EfiEnableCache):
+\r
+#------------------------------------------------------------------------------\r
+# VOID\r
+# EfiEnableCache (\r
+# VOID\r
+# );\r
+#------------------------------------------------------------------------------\r
+ASM_PFX(EfiEnableCache):\r
invd \r
mov %cr0,%rax\r
and $0xffffffff9fffffff,%rax\r
mov %rax,%cr0\r
retq \r
-
-#------------------------------------------------------------------------------
-# UINTN
-# EfiGetEflags (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(EfiGetEflags):
+\r
+#------------------------------------------------------------------------------\r
+# UINTN\r
+# EfiGetEflags (\r
+# VOID\r
+# );\r
+#------------------------------------------------------------------------------\r
+ASM_PFX(EfiGetEflags):\r
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):
+\r
+#------------------------------------------------------------------------------\r
+# VOID\r
+# EfiDisableInterrupts (\r
+# VOID\r
+# );\r
+#------------------------------------------------------------------------------\r
+ASM_PFX(EfiDisableInterrupts):\r
+ cli\r
+ ret\r
+\r
+#------------------------------------------------------------------------------\r
+# VOID\r
+# EfiEnableInterrupts (\r
+# VOID\r
+# );\r
+#------------------------------------------------------------------------------\r
+ASM_PFX(EfiEnableInterrupts):\r
+ sti\r
+ ret\r
+#------------------------------------------------------------------------------\r
+# VOID\r
+# EfiCpuidExt (\r
+# IN UINT32 RegisterInEax,\r
+# IN UINT32 CacheLevel,\r
+# OUT EFI_CPUID_REGISTER *Regs \r
+# )\r
+#------------------------------------------------------------------------------\r
+ASM_PFX(EfiCpuidExt):\r
push %rbx\r
mov %rcx,%rax\r
mov %rdx,%rcx\r