| ... | @@ -2172,6 +2172,30 @@ pub const PROC = struct { | ... | @@ -2172,6 +2172,30 @@ pub const PROC = struct { |
| 2172 | pub const WX_MAPPINGS_PERMIT = 0x0001; | 2172 | pub const WX_MAPPINGS_PERMIT = 0x0001; |
| 2173 | pub const WX_MAPPINGS_DISALLOW_EXEC = 0x0002; | 2173 | pub const WX_MAPPINGS_DISALLOW_EXEC = 0x0002; |
| 2174 | pub const WX_MAPPINGS_ENFORCE = 0x80000000; | 2174 | 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 | }; |
| 2175 | }; | 2199 | }; |
| 2176 | | 2200 | |
| 2177 | pub const PPROT = struct { | 2201 | pub const PPROT = struct { |