Last change
on this file was 105670, checked in by vboxsync, 8 months ago |
Devices/EFI/FirmwareNew: Merge edk2-stable-202405 and make it build on aarch64, bugref:4643
|
-
Property svn:eol-style
set to
native
-
Property svn:mime-type
set to
text/x-asm
|
File size:
780 bytes
|
Line | |
---|
1 | ;------------------------------------------------------------------------------ ;
|
---|
2 | ; Copyright (c) 2019 - 2023, Intel Corporation. All rights reserved.<BR>
|
---|
3 | ; SPDX-License-Identifier: BSD-2-Clause-Patent
|
---|
4 | ;
|
---|
5 | ;-------------------------------------------------------------------------------
|
---|
6 |
|
---|
7 | %include "Nasm.inc"
|
---|
8 | %include "Cet.inc"
|
---|
9 |
|
---|
10 | SECTION .text
|
---|
11 |
|
---|
12 | global ASM_PFX(DisableCet)
|
---|
13 | ASM_PFX(DisableCet):
|
---|
14 |
|
---|
15 | ; Skip the pushed data for call
|
---|
16 | mov eax, 1
|
---|
17 | incsspd eax
|
---|
18 |
|
---|
19 | mov eax, cr4
|
---|
20 | btr eax, CR4_CET_BIT ; clear CET
|
---|
21 | mov cr4, eax
|
---|
22 | ret
|
---|
23 |
|
---|
24 | global ASM_PFX(EnableCet)
|
---|
25 | ASM_PFX(EnableCet):
|
---|
26 |
|
---|
27 | mov eax, cr4
|
---|
28 | bts eax, CR4_CET_BIT ; set CET
|
---|
29 | mov cr4, eax
|
---|
30 |
|
---|
31 | ; use jmp to skip the check for ret
|
---|
32 | pop eax
|
---|
33 | jmp eax
|
---|
34 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.