+++ /dev/null
-;\r
-; This file contains an 'Intel Sample Driver' and is\r
-; licensed for Intel CPUs and chipsets under the terms of your\r
-; license agreement with Intel or your vendor. This file may\r
-; be modified by the user, subject to additional terms of the\r
-; license agreement\r
-;\r
-;\r
-; Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved\r
-; \r\r
-; SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-; \r\r
-;\r
-\r
-;Module Name:\r
-;\r
-; CpuIA32.c\r
-;\r
-;Abstract:\r
-;\r
-;--*/\r
-\r
-;#include "CpuIA32.h"\r
-\r
-;---------------------------------------------------------------------------\r
- .586p\r
- .model flat,C\r
- .code\r
-\r
-;---------------------------------------------------------------------------\r
-;VOID\r
-;EfiHalt (\r
-; VOID\r
-;)\r
-EfiHalt PROC C PUBLIC\r
- hlt\r
- ret\r
-EfiHalt ENDP\r
-\r
-;VOID\r
-;EfiWbinvd (\r
-; VOID\r
-;)\r
-EfiWbinvd PROC C PUBLIC\r
- wbinvd\r
- ret\r
-EfiWbinvd ENDP\r
-\r
-;VOID\r
-;EfiInvd (\r
-; VOID\r
-;)\r
-EfiInvd PROC C PUBLIC\r
- invd\r
- ret\r
-EfiInvd ENDP\r
-\r
-;VOID\r
-;EfiCpuid (IN UINT32 RegisterInEax,\r
-; OUT EFI_CPUID_REGISTER *Reg OPTIONAL)\r
-EfiCpuid PROC C PUBLIC\r
- push ebp\r
- mov ebp, esp\r
- push ebx\r
- push esi\r
- push edi\r
- pushad\r
-\r
- mov eax, dword ptr[ebp + 8] ;egisterInEax\r
- cpuid\r
- cmp dword ptr[ebp + 0Ch], 0 ; Reg\r
- je @F\r
- mov edi,dword ptr [ebp+0Ch] ; Reg\r
-\r
- mov dword ptr [edi],eax ; Reg->RegEax\r
- mov dword ptr [edi+4],ebx ; Reg->RegEbx\r
- mov dword ptr [edi+8],ecx ; Reg->RegEcx\r
- mov dword ptr [edi+0Ch],edx ; Reg->RegEdx\r
-\r
-@@:\r
- popad\r
- pop edi\r
- pop esi\r
- pop ebx\r
- pop ebp\r
-\r
- ret\r
-EfiCpuid ENDP\r
-\r
-\r
-;UINT64\r
-;EfiReadMsr (\r
-; IN UINT32 Index\r
-; );\r
-EfiReadMsr PROC C PUBLIC\r
- mov ecx, dword ptr [esp + 4]; Index\r
- rdmsr\r
- ret\r
-EfiReadMsr ENDP\r
-\r
-;VOID\r
-;EfiWriteMsr (\r
-; IN UINT32 Index,\r
-; IN UINT64 Value\r
-; );\r
-EfiWriteMsr PROC C PUBLIC\r
- mov ecx, dword ptr [esp+4]; Index\r
- mov eax, dword ptr [esp+8]; DWORD PTR Value[0]\r
- mov edx, dword ptr [esp+0Ch]; DWORD PTR Value[4]\r
- wrmsr\r
- ret\r
-EfiWriteMsr ENDP\r
-\r
-;UINT64\r
-;EfiReadTsc (\r
-; VOID\r
-; )\r
-EfiReadTsc PROC C PUBLIC\r
- rdtsc\r
- ret\r
-EfiReadTsc ENDP\r
-\r
-;VOID\r
-;EfiDisableCache (\r
-; VOID\r
-;)\r
-EfiDisableCache PROC C PUBLIC\r
- mov eax, cr0\r
- bswap eax\r
- and al, 60h\r
- cmp al, 60h\r
- je @F\r
- mov eax, cr0\r
- or eax, 060000000h\r
- mov cr0, eax\r
- wbinvd\r
-@@:\r
- ret\r
-EfiDisableCache ENDP\r
-\r
-;VOID\r
-;EfiEnableCache (\r
-; VOID\r
-; )\r
-EfiEnableCache PROC C PUBLIC\r
- wbinvd\r
- mov eax, cr0\r
- and eax, 09fffffffh\r
- mov cr0, eax\r
- ret\r
-EfiEnableCache ENDP\r
-\r
-;UINT32\r
-;EfiGetEflags (\r
-; VOID\r
-; )\r
-EfiGetEflags PROC C PUBLIC\r
- pushfd\r
- pop eax\r
- ret\r
-EfiGetEflags ENDP\r
-\r
-;VOID\r
-;EfiDisableInterrupts (\r
-; VOID\r
-; )\r
-EfiDisableInterrupts PROC C PUBLIC\r
- cli\r
- ret\r
-EfiDisableInterrupts ENDP\r
-\r
-;VOID\r
-;EfiEnableInterrupts (\r
-; VOID\r
-; )\r
-EfiEnableInterrupts PROC C 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
-EfiCpuidExt PROC C PUBLIC USES ebx edi esi\r
- pushad\r
-\r
- mov eax, dword ptr [esp + 30h] ; RegisterInEax\r
- mov ecx, dword ptr [esp + 34h] ; CacheLevel\r
- cpuid\r
- mov edi, dword ptr [esp + 38h] ; DWORD PTR Regs\r
-\r
- mov dword ptr [edi], eax ; Reg->RegEax\r
- mov dword ptr [edi + 4], ebx ; Reg->RegEbx\r
- mov dword ptr [edi + 8], ecx ; Reg->RegEcx\r
- mov dword ptr [edi + 0Ch], edx ; Reg->RegEdx\r
-\r
- popad\r
- ret\r
-EfiCpuidExt ENDP\r
-\r
- END\r
-\r