authorgravatar for quae@daurnimator.comdaurnimator <quae@daurnimator.com> 2020-11-04 22:39:35+11:00
committergravatar for quae@daurnimator.comdaurnimator <quae@daurnimator.com> 2020-11-04 22:39:35+11:00
logb42ffbe9e82896c55c68412f99463f54c5e56f21
treed25de4820c2f8acc24d59e4c90e12473a2732239
parentb90fb1e96b2c3edd2fb9e8884e64944692d5dd7f
signaturelock-open Commit is signed but in an unrecognized format.

std: use PR enum as only location of opcode numbers


1 files changed, 50 insertions(+), 50 deletions(-)

lib/std/os/bits/linux/prctl.zig+50-50
......@@ -86,27 +86,27 @@ pub const PR = extern enum(i32) {
8686 _,
8787};
8888
89pub const PR_SET_PDEATHSIG = 1;
90pub const PR_GET_PDEATHSIG = 2;
89pub const PR_SET_PDEATHSIG = @enumToInt(PR.PR_SET_PDEATHSIG);
90pub const PR_GET_PDEATHSIG = @enumToInt(PR.PR_GET_PDEATHSIG);
9191
92pub const PR_GET_DUMPABLE = 3;
93pub const PR_SET_DUMPABLE = 4;
92pub const PR_GET_DUMPABLE = @enumToInt(PR.PR_GET_DUMPABLE);
93pub const PR_SET_DUMPABLE = @enumToInt(PR.PR_SET_DUMPABLE);
9494
95pub const PR_GET_UNALIGN = 5;
96pub const PR_SET_UNALIGN = 6;
95pub const PR_GET_UNALIGN = @enumToInt(PR.PR_GET_UNALIGN);
96pub const PR_SET_UNALIGN = @enumToInt(PR.PR_SET_UNALIGN);
9797pub const PR_UNALIGN_NOPRINT = 1;
9898pub const PR_UNALIGN_SIGBUS = 2;
9999
100pub const PR_GET_KEEPCAPS = 7;
101pub const PR_SET_KEEPCAPS = 8;
100pub const PR_GET_KEEPCAPS = @enumToInt(PR.PR_GET_KEEPCAPS);
101pub const PR_SET_KEEPCAPS = @enumToInt(PR.PR_SET_KEEPCAPS);
102102
103pub const PR_GET_FPEMU = 9;
104pub const PR_SET_FPEMU = 10;
103pub const PR_GET_FPEMU = @enumToInt(PR.PR_GET_FPEMU);
104pub const PR_SET_FPEMU = @enumToInt(PR.PR_SET_FPEMU);
105105pub const PR_FPEMU_NOPRINT = 1;
106106pub const PR_FPEMU_SIGFPE = 2;
107107
108pub const PR_GET_FPEXC = 11;
109pub const PR_SET_FPEXC = 12;
108pub const PR_GET_FPEXC = @enumToInt(PR.PR_GET_FPEXC);
109pub const PR_SET_FPEXC = @enumToInt(PR.PR_SET_FPEXC);
110110pub const PR_FP_EXC_SW_ENABLE = 0x80;
111111pub const PR_FP_EXC_DIV = 0x010000;
112112pub const PR_FP_EXC_OVF = 0x020000;
......@@ -118,41 +118,41 @@ pub const PR_FP_EXC_NONRECOV = 1;
118118pub const PR_FP_EXC_ASYNC = 2;
119119pub const PR_FP_EXC_PRECISE = 3;
120120
121pub const PR_GET_TIMING = 13;
122pub const PR_SET_TIMING = 14;
121pub const PR_GET_TIMING = @enumToInt(PR.PR_GET_TIMING);
122pub const PR_SET_TIMING = @enumToInt(PR.PR_SET_TIMING);
123123pub const PR_TIMING_STATISTICAL = 0;
124124pub const PR_TIMING_TIMESTAMP = 1;
125125
126pub const PR_SET_NAME = 15;
127pub const PR_GET_NAME = 16;
126pub const PR_SET_NAME = @enumToInt(PR.PR_SET_NAME);
127pub const PR_GET_NAME = @enumToInt(PR.PR_GET_NAME);
128128
129pub const PR_GET_ENDIAN = 19;
130pub const PR_SET_ENDIAN = 20;
129pub const PR_GET_ENDIAN = @enumToInt(PR.PR_GET_ENDIAN);
130pub const PR_SET_ENDIAN = @enumToInt(PR.PR_SET_ENDIAN);
131131pub const PR_ENDIAN_BIG = 0;
132132pub const PR_ENDIAN_LITTLE = 1;
133133pub const PR_ENDIAN_PPC_LITTLE = 2;
134134
135pub const PR_GET_SECCOMP = 21;
136pub const PR_SET_SECCOMP = 22;
135pub const PR_GET_SECCOMP = @enumToInt(PR.PR_GET_SECCOMP);
136pub const PR_SET_SECCOMP = @enumToInt(PR.PR_SET_SECCOMP);
137137
138pub const PR_CAPBSET_READ = 23;
139pub const PR_CAPBSET_DROP = 24;
138pub const PR_CAPBSET_READ = @enumToInt(PR.PR_CAPBSET_READ);
139pub const PR_CAPBSET_DROP = @enumToInt(PR.PR_CAPBSET_DROP);
140140
141pub const PR_GET_TSC = 25;
142pub const PR_SET_TSC = 26;
141pub const PR_GET_TSC = @enumToInt(PR.PR_GET_TSC);
142pub const PR_SET_TSC = @enumToInt(PR.PR_SET_TSC);
143143pub const PR_TSC_ENABLE = 1;
144144pub const PR_TSC_SIGSEGV = 2;
145145
146pub const PR_GET_SECUREBITS = 27;
147pub const PR_SET_SECUREBITS = 28;
146pub const PR_GET_SECUREBITS = @enumToInt(PR.PR_GET_SECUREBITS);
147pub const PR_SET_SECUREBITS = @enumToInt(PR.PR_SET_SECUREBITS);
148148
149pub const PR_SET_TIMERSLACK = 29;
150pub const PR_GET_TIMERSLACK = 30;
149pub const PR_SET_TIMERSLACK = @enumToInt(PR.PR_SET_TIMERSLACK);
150pub const PR_GET_TIMERSLACK = @enumToInt(PR.PR_GET_TIMERSLACK);
151151
152pub const PR_TASK_PERF_EVENTS_DISABLE = 31;
153pub const PR_TASK_PERF_EVENTS_ENABLE = 32;
152pub const PR_TASK_PERF_EVENTS_DISABLE = @enumToInt(PR.PR_TASK_PERF_EVENTS_DISABLE);
153pub const PR_TASK_PERF_EVENTS_ENABLE = @enumToInt(PR.PR_TASK_PERF_EVENTS_ENABLE);
154154
155pub const PR_MCE_KILL = 33;
155pub const PR_MCE_KILL = @enumToInt(PR.PR_MCE_KILL);
156156pub const PR_MCE_KILL_CLEAR = 0;
157157pub const PR_MCE_KILL_SET = 1;
158158
......@@ -160,9 +160,9 @@ pub const PR_MCE_KILL_LATE = 0;
160160pub const PR_MCE_KILL_EARLY = 1;
161161pub const PR_MCE_KILL_DEFAULT = 2;
162162
163pub const PR_MCE_KILL_GET = 34;
163pub const PR_MCE_KILL_GET = @enumToInt(PR.PR_MCE_KILL_GET);
164164
165pub const PR_SET_MM = 35;
165pub const PR_SET_MM = @enumToInt(PR.PR_SET_MM);
166166pub const PR_SET_MM_START_CODE = 1;
167167pub const PR_SET_MM_END_CODE = 2;
168168pub const PR_SET_MM_START_DATA = 3;
......@@ -196,42 +196,42 @@ pub const prctl_mm_map = extern struct {
196196 exe_fd: u32,
197197};
198198
199pub const PR_SET_PTRACER = 0x59616d61;
199pub const PR_SET_PTRACER = @enumToInt(PR.PR_SET_PTRACER);
200200pub const PR_SET_PTRACER_ANY = std.math.maxInt(c_ulong);
201201
202pub const PR_SET_CHILD_SUBREAPER = 36;
203pub const PR_GET_CHILD_SUBREAPER = 37;
202pub const PR_SET_CHILD_SUBREAPER = @enumToInt(PR.PR_SET_CHILD_SUBREAPER);
203pub const PR_GET_CHILD_SUBREAPER = @enumToInt(PR.PR_GET_CHILD_SUBREAPER);
204204
205pub const PR_SET_NO_NEW_PRIVS = 38;
206pub const PR_GET_NO_NEW_PRIVS = 39;
205pub const PR_SET_NO_NEW_PRIVS = @enumToInt(PR.PR_SET_NO_NEW_PRIVS);
206pub const PR_GET_NO_NEW_PRIVS = @enumToInt(PR.PR_GET_NO_NEW_PRIVS);
207207
208pub const PR_GET_TID_ADDRESS = 40;
208pub const PR_GET_TID_ADDRESS = @enumToInt(PR.PR_GET_TID_ADDRESS);
209209
210pub const PR_SET_THP_DISABLE = 41;
211pub const PR_GET_THP_DISABLE = 42;
210pub const PR_SET_THP_DISABLE = @enumToInt(PR.PR_SET_THP_DISABLE);
211pub const PR_GET_THP_DISABLE = @enumToInt(PR.PR_GET_THP_DISABLE);
212212
213pub const PR_MPX_ENABLE_MANAGEMENT = 43;
214pub const PR_MPX_DISABLE_MANAGEMENT = 44;
213pub const PR_MPX_ENABLE_MANAGEMENT = @enumToInt(PR.PR_MPX_ENABLE_MANAGEMENT);
214pub const PR_MPX_DISABLE_MANAGEMENT = @enumToInt(PR.PR_MPX_DISABLE_MANAGEMENT);
215215
216pub const PR_SET_FP_MODE = 45;
217pub const PR_GET_FP_MODE = 46;
216pub const PR_SET_FP_MODE = @enumToInt(PR.PR_SET_FP_MODE);
217pub const PR_GET_FP_MODE = @enumToInt(PR.PR_GET_FP_MODE);
218218pub const PR_FP_MODE_FR = 1 << 0;
219219pub const PR_FP_MODE_FRE = 1 << 1;
220220
221pub const PR_CAP_AMBIENT = 47;
221pub const PR_CAP_AMBIENT = @enumToInt(PR.PR_CAP_AMBIENT);
222222pub const PR_CAP_AMBIENT_IS_SET = 1;
223223pub const PR_CAP_AMBIENT_RAISE = 2;
224224pub const PR_CAP_AMBIENT_LOWER = 3;
225225pub const PR_CAP_AMBIENT_CLEAR_ALL = 4;
226226
227pub const PR_SVE_SET_VL = 50;
227pub const PR_SVE_SET_VL = @enumToInt(PR.PR_SVE_SET_VL);
228228pub const PR_SVE_SET_VL_ONEXEC = 1 << 18;
229pub const PR_SVE_GET_VL = 51;
229pub const PR_SVE_GET_VL = @enumToInt(PR.PR_SVE_GET_VL);
230230pub const PR_SVE_VL_LEN_MASK = 0xffff;
231231pub const PR_SVE_VL_INHERIT = 1 << 17;
232232
233pub const PR_GET_SPECULATION_CTRL = 52;
234pub const PR_SET_SPECULATION_CTRL = 53;
233pub const PR_GET_SPECULATION_CTRL = @enumToInt(PR.PR_GET_SPECULATION_CTRL);
234pub const PR_SET_SPECULATION_CTRL = @enumToInt(PR.PR_SET_SPECULATION_CTRL);
235235pub const PR_SPEC_STORE_BYPASS = 0;
236236pub const PR_SPEC_NOT_AFFECTED = 0;
237237pub const PR_SPEC_PRCTL = 1 << 0;