]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/Ia32/WriteCr0.c
MdePkg/BaseLib: Support IA32 processors without CLFLUSH
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / WriteCr0.c
CommitLineData
e1f414b6 1/** @file\r
2 AsmWriteCr0 function\r
3\r
bb817c56
HT
4 Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
5 This program and the accompanying materials\r
e1f414b6 6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
e4a34497 8 http://opensource.org/licenses/bsd-license.php.\r
e1f414b6 9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
42eedea9 15/**\r
16 Writes a value to Control Register 0 (CR0).\r
17\r
18 Writes and returns a new value to CR0. This function is only available on\r
030cd1a2 19 IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.\r
42eedea9 20\r
44b013bd 21 @param Value The value to write to CR0.\r
42eedea9 22\r
23 @return The value written to CR0.\r
24\r
25**/\r
e1f414b6 26UINTN\r
27EFIAPI\r
28AsmWriteCr0 (\r
29 UINTN Value\r
30 )\r
31{\r
32 _asm {\r
33 mov eax, Value\r
34 mov cr0, eax\r
35 }\r
36}\r
37\r