Skip to content

Commit 9691cde

Browse files
devnexenVexu
authored andcommitted
std: mcontext layout for x86 and fixing few x86_64 fields types for
FreeBSD
1 parent 1d322fe commit 9691cde

File tree

1 file changed

+37
-5
lines changed

1 file changed

+37
-5
lines changed

lib/std/c/freebsd.zig

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,15 +1391,47 @@ pub const mcontext_t = switch (builtin.cpu.arch) {
13911391
rflags: u64,
13921392
rsp: u64,
13931393
ss: u64,
1394-
len: u64,
1395-
fpformat: u64,
1396-
ownedfp: u64,
1397-
fpstate: [64]u64 align(16),
1394+
len: c_long,
1395+
fpformat: c_long,
1396+
ownedfp: c_long,
1397+
fpstate: [64]c_long align(16),
13981398
fsbase: u64,
13991399
gsbase: u64,
14001400
xfpustate: u64,
14011401
xfpustate_len: u64,
1402-
spare: [4]u64,
1402+
spare: [4]c_long,
1403+
},
1404+
.x86 => extern struct {
1405+
onstack: u32,
1406+
gs: u32,
1407+
fs: u32,
1408+
es: u32,
1409+
ds: u32,
1410+
edi: u32,
1411+
esi: u32,
1412+
ebp: u32,
1413+
isp: u32,
1414+
ebx: u32,
1415+
edx: u32,
1416+
ecx: u32,
1417+
eax: u32,
1418+
trapno: u32,
1419+
err: u32,
1420+
eip: u32,
1421+
cs: u32,
1422+
eflags: u32,
1423+
esp: u32,
1424+
ss: u32,
1425+
len: c_int,
1426+
fpformat: c_int,
1427+
ownedfp: c_int,
1428+
flags: u32,
1429+
fpstate: [128]c_int align(16),
1430+
fsbase: u32,
1431+
gsbase: u32,
1432+
xpustate: u32,
1433+
xpustate_len: u32,
1434+
spare2: [4]c_int,
14031435
},
14041436
.aarch64 => extern struct {
14051437
gpregs: extern struct {

0 commit comments

Comments
 (0)