hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 4db28160f3273a1f84d64337571590c5206e6483
parent 427a6415e8d9efca788943b9ab0c5fd43a07e552
Author: Drew DeVault <sir@cmpwn.com>
Date:   Tue,  2 Jan 2024 13:50:28 +0100

rt: add ucontext structures for +openbsd

Signed-off-by: Drew DeVault <sir@cmpwn.com>

Diffstat:
Art/+openbsd/+aarch64.ha | 12++++++++++++
Art/+openbsd/+riscv64.ha | 20++++++++++++++++++++
Art/+openbsd/+x86_64.ha | 50++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 82 insertions(+), 0 deletions(-)

diff --git a/rt/+openbsd/+aarch64.ha b/rt/+openbsd/+aarch64.ha @@ -0,0 +1,12 @@ +export type sigcontext = struct { + __sc_unused: int, + sc_mask: int, + sc_sp: u64, + sc_lr: u64, + sc_elr: u64, + sc_spsr: u64, + sc_x: [30]u64, + sc_cookie: u64, +}; + +export type ucontext = sigcontext; diff --git a/rt/+openbsd/+riscv64.ha b/rt/+openbsd/+riscv64.ha @@ -0,0 +1,20 @@ +export type sigcontext = struct { + __sc_unused: int, + sc_mask: int, + + sc_ra: u64, + sc_sp: u64, + sc_gp: u64, + sc_tp: u64, + sc_t: [7]u64, + sc_s: [12]u64, + sc_a: [8]u64, + sc_sepc: u64, + + sc_f: [32]u64, + sc_fcsr: u64, + + sc_cookie: u64, +}; + +export type ucontext = sigcontext; diff --git a/rt/+openbsd/+x86_64.ha b/rt/+openbsd/+x86_64.ha @@ -0,0 +1,50 @@ +export type sigcontext = struct { + sc_rdi: u64, + sc_rsi: u64, + sc_rdx: u64, + sc_rcx: u64, + sc_r8: u64, + sc_r9: u64, + sc_r10: u64, + sc_r11: u64, + sc_r12: u64, + sc_r13: u64, + sc_r14: u64, + sc_r15: u64, + sc_rbp: u64, + sc_rbx: u64, + sc_rax: u64, + sc_gs: u64, + sc_fs: u64, + sc_es: u64, + sc_ds: u64, + sc_trapno: u64, + sc_err: u64, + sc_rip: u64, + sc_cs: u64, + sc_rflags: u64, + sc_rsp: u64, + sc_ss: u64, + + sc_fpstate: *fxsave64, + __sc_unused: int, + sc_mask: int, + sc_cookie: i64, +}; + +export type fxsave64 = struct { + fx_fcw: u16, + fx_fsw: u16, + fx_ftw: u8, + fx_unused1: u8, + fx_fop: u16, + fx_rip: u64, + fx_rdp: u64, + fx_mxcsr: u32, + fx_mxcsr_mask: u32, + fx_st: [8][2]u64, + fx_xmm: [16][2]u64, + fx_unused3: [96]u8, +}; + +export type ucontext = sigcontext;