]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/Ia32/WriteDr4.c
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / WriteDr4.c
1 /** @file
2 AsmWriteDr4 function
3
4 Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 /**
10 Writes a value to Debug Register 4 (DR4).
11
12 Writes and returns a new value to DR4. This function is only available on
13 IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
14
15 @param Value The value to write to Dr4.
16
17 @return The value written to Debug Register 4 (DR4).
18
19 **/
20 UINTN
21 EFIAPI
22 AsmWriteDr4 (
23 IN UINTN Value
24 )
25 {
26 _asm {
27 mov eax, Value
28 _emit 0x0f // mov dr4, eax
29 _emit 0x23
30 _emit 0xe0
31 }
32 }
33