Skip to content

Commit bce9ae9

Browse files
committed
Prefer direct use of 'asm volatile' over LIBC_INLINE_ASM.
1 parent 7754b30 commit bce9ae9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libc/src/sys/mman/linux/x86_64/pkey_common.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ constexpr int BITS_PER_KEY = 2;
3232
LIBC_INLINE uint32_t read_prku() {
3333
uint32_t pkru = 0;
3434
uint32_t edx = 0;
35-
LIBC_INLINE_ASM("rdpkru" : "=a"(pkru), "=d"(edx) : "c"(0));
35+
asm volatile("rdpkru" : "=a"(pkru), "=d"(edx) : "c"(0));
3636
return pkru;
3737
}
3838

3939
// This will SIGILL on CPUs that don't support PKU / OSPKE,
4040
// but this case should never be reached as a prior pkey_alloc invocation
4141
// would have failed more gracefully.
4242
LIBC_INLINE void write_prku(uint32_t pkru) {
43-
LIBC_INLINE_ASM("wrpkru" : : "a"(pkru), "d"(0), "c"(0));
43+
asm volatile("wrpkru" : : "a"(pkru), "d"(0), "c"(0));
4444
}
4545

4646
} // namespace internal

0 commit comments

Comments
 (0)