Skip to content

Commit 4238054

Browse files
committed
Auto merge of #2838 - devnexen:linux_followup_prctl, r=JohnTitor
linux prctl add speculation control flags
2 parents 29217b9 + 6bc25bc commit 4238054

File tree

1 file changed

+13
-0
lines changed
  • src/unix/linux_like/linux/gnu/b64/x86_64

1 file changed

+13
-0
lines changed

src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,19 @@ pub const PTRACE_PEEKSIGINFO_SHARED: ::c_uint = 1;
626626
pub const PTRACE_SYSEMU: ::c_uint = 31;
627627
pub const PTRACE_SYSEMU_SINGLESTEP: ::c_uint = 32;
628628

629+
pub const PR_GET_SPECULATION_CTRL: ::c_int = 52;
630+
pub const PR_SET_SPECULATION_CTRL: ::c_int = 53;
631+
pub const PR_SPEC_NOT_AFFECTED: ::c_uint = 0;
632+
pub const PR_SPEC_PRCTL: ::c_uint = 1 << 0;
633+
pub const PR_SPEC_ENABLE: ::c_uint = 1 << 1;
634+
pub const PR_SPEC_DISABLE: ::c_uint = 1 << 2;
635+
pub const PR_SPEC_FORCE_DISABLE: ::c_uint = 1 << 3;
636+
pub const PR_SPEC_DISABLE_NOEXEC: ::c_uint = 1 << 4;
637+
pub const PR_SPEC_STORE_BYPASS: ::c_int = 0;
638+
pub const PR_SPEC_INDIRECT_BRANCH: ::c_int = 1;
639+
// FIXME: perharps for later
640+
//pub const PR_SPEC_L1D_FLUSH: ::c_int = 2;
641+
629642
pub const MCL_CURRENT: ::c_int = 0x0001;
630643
pub const MCL_FUTURE: ::c_int = 0x0002;
631644

0 commit comments

Comments
 (0)