Skip to content

Commit

Permalink
Auto merge of #3166 - kxxt:riscv64gc-userregs, r=JohnTitor
Browse files Browse the repository at this point in the history
Add user_regs_struct for riscv32/64

Copied from C header: https://elixir.bootlin.com/linux/latest/source/arch/riscv/include/uapi/asm/ptrace.h
  • Loading branch information
bors committed Mar 29, 2023
2 parents 21d90af + 7c5c2c5 commit 3a6c1c4
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,41 @@ s! {
pub l_len: ::off64_t,
pub l_pid: ::pid_t,
}

pub struct user_regs_struct {
pub pc: ::c_ulong,
pub ra: ::c_ulong,
pub sp: ::c_ulong,
pub gp: ::c_ulong,
pub tp: ::c_ulong,
pub t0: ::c_ulong,
pub t1: ::c_ulong,
pub t2: ::c_ulong,
pub s0: ::c_ulong,
pub s1: ::c_ulong,
pub a0: ::c_ulong,
pub a1: ::c_ulong,
pub a2: ::c_ulong,
pub a3: ::c_ulong,
pub a4: ::c_ulong,
pub a5: ::c_ulong,
pub a6: ::c_ulong,
pub a7: ::c_ulong,
pub s2: ::c_ulong,
pub s3: ::c_ulong,
pub s4: ::c_ulong,
pub s5: ::c_ulong,
pub s6: ::c_ulong,
pub s7: ::c_ulong,
pub s8: ::c_ulong,
pub s9: ::c_ulong,
pub s10: ::c_ulong,
pub s11: ::c_ulong,
pub t3: ::c_ulong,
pub t4: ::c_ulong,
pub t5: ::c_ulong,
pub t6: ::c_ulong,
}
}

pub const O_LARGEFILE: ::c_int = 0;
Expand Down
35 changes: 35 additions & 0 deletions src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,41 @@ s! {
pub l_len: ::off64_t,
pub l_pid: ::pid_t,
}

pub struct user_regs_struct {
pub pc: ::c_ulong,
pub ra: ::c_ulong,
pub sp: ::c_ulong,
pub gp: ::c_ulong,
pub tp: ::c_ulong,
pub t0: ::c_ulong,
pub t1: ::c_ulong,
pub t2: ::c_ulong,
pub s0: ::c_ulong,
pub s1: ::c_ulong,
pub a0: ::c_ulong,
pub a1: ::c_ulong,
pub a2: ::c_ulong,
pub a3: ::c_ulong,
pub a4: ::c_ulong,
pub a5: ::c_ulong,
pub a6: ::c_ulong,
pub a7: ::c_ulong,
pub s2: ::c_ulong,
pub s3: ::c_ulong,
pub s4: ::c_ulong,
pub s5: ::c_ulong,
pub s6: ::c_ulong,
pub s7: ::c_ulong,
pub s8: ::c_ulong,
pub s9: ::c_ulong,
pub s10: ::c_ulong,
pub s11: ::c_ulong,
pub t3: ::c_ulong,
pub t4: ::c_ulong,
pub t5: ::c_ulong,
pub t6: ::c_ulong,
}
}

pub const POSIX_FADV_DONTNEED: ::c_int = 4;
Expand Down

0 comments on commit 3a6c1c4

Please sign in to comment.