Skip to content
Snippets Groups Projects
Commit 080cc036fb63 authored by H.J. Lu's avatar H.J. Lu
Browse files

liblzma: Enable Intel CET in x86 CRC assembly codes

When Intel CET is enabled, we need to include <cet.h> in assembly codes
to mark Intel CET support and add _CET_ENDBR to indirect jump targets.

Tested on Intel Tiger Lake under CET enabled Linux.
parent 21d1e6dc97e8
No related branches found
No related tags found
No related merge requests found
......@@ -51,6 +51,14 @@
* extern uint32_t lzma_crc32(const uint8_t *buf, size_t size, uint32_t crc);
*/
/* When Intel CET is enabled, include <cet.h> in assembly code to mark
Intel CET support. */
#ifdef __CET__
# include <cet.h>
#else
# define _CET_ENDBR
#endif
/*
* On some systems, the functions need to be prefixed. The prefix is
* usually an underscore.
......@@ -83,6 +91,7 @@
ALIGN(4, 16)
LZMA_CRC32:
_CET_ENDBR
/*
* Register usage:
* %eax crc
......
......@@ -41,6 +41,14 @@
* extern uint64_t lzma_crc64(const uint8_t *buf, size_t size, uint64_t crc);
*/
/* When Intel CET is enabled, include <cet.h> in assembly code to mark
Intel CET support. */
#ifdef __CET__
# include <cet.h>
#else
# define _CET_ENDBR
#endif
/*
* On some systems, the functions need to be prefixed. The prefix is
* usually an underscore.
......@@ -73,6 +81,7 @@
ALIGN(4, 16)
LZMA_CRC64:
_CET_ENDBR
/*
* Register usage:
* %eax crc LSB
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment