diff options
author | WANG Rui <wangrui@loongson.cn> | 2023-05-11 21:40:38 +0800 |
---|---|---|
committer | WANG Rui <wangrui@loongson.cn> | 2023-05-12 10:17:46 +0800 |
commit | aaaa9d4eb234808e29d8927754145480d2de550c (patch) | |
tree | 687d275ab1d683ec1a267f41d7219c9563b49faf /src/unix/linux_like/linux | |
parent | e06d9052aac1185201ef0f46f15d745e412388d0 (diff) | |
download | rust-libc-aaaa9d4eb234808e29d8927754145480d2de550c.tar.gz |
Fix loongarch64 bindings
Diffstat (limited to 'src/unix/linux_like/linux')
-rw-r--r-- | src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs | 8 | ||||
-rw-r--r-- | src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs | 23 |
2 files changed, 26 insertions, 5 deletions
diff --git a/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs b/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs index 4cae9c1c35..dc191f51fd 100644 --- a/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs +++ b/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs @@ -17,10 +17,10 @@ s! { #[repr(align(16))] pub struct mcontext_t { - pub sc_pc: ::c_ulonglong, - pub sc_regs: [::c_ulonglong; 32], - pub sc_flags: ::c_ulong, - pub sc_extcontext: [u64; 0], + pub __pc: ::c_ulonglong, + pub __gregs: [::c_ulonglong; 32], + pub __flags: ::c_uint, + pub __extcontext: [::c_ulonglong; 0], } #[repr(align(8))] diff --git a/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs b/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs index af2825b600..ea59181bcd 100644 --- a/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs +++ b/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs @@ -189,6 +189,21 @@ s! { __unused4: ::c_ulong, __unused5: ::c_ulong } + + pub struct user_regs_struct { + pub regs: [u64; 32], + pub orig_a0: u64, + pub csr_era: u64, + pub csr_badv: u64, + pub reserved: [u64; 10], + + } + + pub struct user_fp_struct { + pub fpr: [u64; 32], + pub fcc: u64, + pub fcsr: u32, + } } pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; @@ -549,7 +564,7 @@ pub const SYS_landlock_add_rule: ::c_long = 445; pub const SYS_landlock_restrict_self: ::c_long = 446; pub const SYS_process_mrelease: ::c_long = 448; pub const SYS_futex_waitv: ::c_long = 449; -//pub const SYS_set_mempolicy_home_node: ::c_long = 450; +pub const SYS_set_mempolicy_home_node: ::c_long = 450; pub const POSIX_FADV_DONTNEED: ::c_int = 4; pub const POSIX_FADV_NOREUSE: ::c_int = 5; @@ -684,6 +699,8 @@ pub const ENOTRECOVERABLE: ::c_int = 131; pub const ERFKILL: ::c_int = 132; pub const EHWPOISON: ::c_int = 133; +pub const MADV_SOFT_OFFLINE: ::c_int = 101; + pub const MAP_NORESERVE: ::c_int = 0x4000; pub const MAP_ANONYMOUS: ::c_int = 0x0020; pub const MAP_ANON: ::c_int = 0x0020; @@ -695,6 +712,7 @@ pub const MAP_POPULATE: ::c_int = 0x8000; pub const MAP_NONBLOCK: ::c_int = 0x10000; pub const MAP_STACK: ::c_int = 0x20000; pub const MAP_HUGETLB: ::c_int = 0x40000; +pub const MAP_SYNC: ::c_int = 0x080000; pub const MCL_CURRENT: ::c_int = 0x0001; pub const MCL_FUTURE: ::c_int = 0x0002; pub const MCL_ONFAULT: ::c_int = 0x0004; @@ -746,6 +764,8 @@ pub const PTRACE_GETFPXREGS: ::c_uint = 18; pub const PTRACE_SETFPXREGS: ::c_uint = 19; pub const PTRACE_GETREGS: ::c_uint = 12; pub const PTRACE_SETREGS: ::c_uint = 13; +pub const PTRACE_SYSEMU: ::c_uint = 31; +pub const PTRACE_SYSEMU_SINGLESTEP: ::c_uint = 32; pub const RTLD_DEEPBIND: ::c_int = 0x8; pub const RTLD_GLOBAL: ::c_int = 0x100; @@ -846,6 +866,7 @@ pub const ECHOPRT: ::tcflag_t = 0x00000400; pub const ECHOCTL: ::tcflag_t = 0x00000200; pub const ISIG: ::tcflag_t = 0x00000001; pub const ICANON: ::tcflag_t = 0x00000002; +pub const XCASE: ::tcflag_t = 0x00000004; pub const PENDIN: ::tcflag_t = 0x00004000; pub const NOFLSH: ::tcflag_t = 0x00000080; |