authorgravatar for devnexen@gmail.comDavid Carlier <devnexen@gmail.com> 2023-04-26 22:04:55+01:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2023-04-30 12:28:36+03:00
log3fb93fc8f2d3e755492a495fa69f65ae6615cab6
tree6eef38f210dd021ff19c43b281439edfcda8d876
parent4f248e1b519b001cee67e461068245c142d38e73

std.c: freebsd add procctl exclusive x86_64 flags


1 files changed, 24 insertions(+), 0 deletions(-)

lib/std/c/freebsd.zig+24
......@@ -2172,6 +2172,30 @@ pub const PROC = struct {
21722172 pub const WX_MAPPINGS_PERMIT = 0x0001;
21732173 pub const WX_MAPPINGS_DISALLOW_EXEC = 0x0002;
21742174 pub const WX_MAPPINGS_ENFORCE = 0x80000000;
2175 pub const PROCCTL_MD_MIN = 0x10000000;
2176 // x86_64-only constants
2177 pub const KPTI = switch (builtin.cpu.arch) {
2178 .x86_64 => struct {
2179 pub const CTL = PROC.PROCCTL_MD_MIND;
2180 pub const STATUS = PROC.PROCCTL_MD_MIND + 1;
2181 pub const CTL_ENABLE_ON_EXEC = 1;
2182 pub const CTL_DISABLE_ON_EXEC = 2;
2183 pub const STATUS_ACTIVE = 0x80000000;
2184 },
2185 else => void,
2186 };
2187 pub const LA = switch (builtin.cpu.arch) {
2188 .x86_64 => struct {
2189 pub const CTL = PROC.PROCCTL_MD_MIND + 2;
2190 pub const STATUS = PROC.PROCCTL_MD_MIND + 3;
2191 pub const CTL_LA48_ON_EXEC = 1;
2192 pub const CTL_LA57_ON_EXEC = 2;
2193 pub const CTL_DEFAULT_ON_EXEC = 3;
2194 pub const STATUS_LA48 = 0x01000000;
2195 pub const STATUS_LA57 = 0x02000000;
2196 },
2197 else => void,
2198 };
21752199};
21762200
21772201pub const PPROT = struct {