]> xenbits.xensource.com Git - unikraft/libs/newlib.git/commitdiff
sys/user.h: Import from musl
authorCostin Lupu <costin.lupu@cs.pub.ro>
Thu, 22 Aug 2019 10:10:50 +0000 (13:10 +0300)
committerCostin Lupu <costin.lupu@cs.pub.ro>
Mon, 26 Aug 2019 13:46:44 +0000 (16:46 +0300)
Copied as is from the official musl git mirror
git://git.musl-libc.org/musl, commit 6fcb440d.

Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
Reviewed-by: Charalampos Mainas <charalampos.mainas@neclab.eu>
musl-imported/arch/x86_64/bits/user.h [new file with mode: 0644]
musl-imported/include/sys/user.h [new file with mode: 0644]

diff --git a/musl-imported/arch/x86_64/bits/user.h b/musl-imported/arch/x86_64/bits/user.h
new file mode 100644 (file)
index 0000000..4073cc0
--- /dev/null
@@ -0,0 +1,41 @@
+#undef __WORDSIZE
+#define __WORDSIZE 64
+
+typedef struct user_fpregs_struct {
+       uint16_t cwd, swd, ftw, fop;
+       uint64_t rip, rdp;
+       uint32_t mxcsr, mxcr_mask;
+       uint32_t st_space[32], xmm_space[64], padding[24];
+} elf_fpregset_t;
+
+struct user_regs_struct {
+       unsigned long r15, r14, r13, r12, rbp, rbx, r11, r10, r9, r8;
+       unsigned long rax, rcx, rdx, rsi, rdi, orig_rax, rip;
+       unsigned long cs, eflags, rsp, ss, fs_base, gs_base, ds, es, fs, gs;
+};
+#define ELF_NGREG 27
+typedef unsigned long long elf_greg_t, elf_gregset_t[ELF_NGREG];
+
+struct user {
+       struct user_regs_struct         regs;
+       int                             u_fpvalid;
+       struct user_fpregs_struct       i387;
+       unsigned long                   u_tsize;
+       unsigned long                   u_dsize;
+       unsigned long                   u_ssize;
+       unsigned long                   start_code;
+       unsigned long                   start_stack;
+       long                            signal;
+       int                             reserved;
+       struct user_regs_struct         *u_ar0;
+       struct user_fpregs_struct       *u_fpstate;
+       unsigned long                   magic;
+       char                            u_comm[32];
+       unsigned long                   u_debugreg[8];
+};
+
+#define PAGE_MASK              (~(PAGESIZE-1))
+#define NBPG                   PAGESIZE
+#define UPAGES                 1
+#define HOST_TEXT_START_ADDR   (u.start_code)
+#define HOST_STACK_END_ADDR    (u.start_stack + u.u_ssize * NBPG)
diff --git a/musl-imported/include/sys/user.h b/musl-imported/include/sys/user.h
new file mode 100644 (file)
index 0000000..96a0340
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef _SYS_USER_H
+#define _SYS_USER_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <limits.h>
+#include <stdint.h>
+#include <unistd.h>
+
+#include <bits/user.h>
+
+#ifdef __cplusplus
+}
+#endif
+#endif