Commit e2e6d3ae authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

headers: Split */types.h headers

The 2nd big splitting patch -- move most of the code that is
infect-related and doesn't know about criu internals (like
protobuf) out of types.h headers.

This is also big and fat patch, but it just moves the code
around. Applies on top of sigframe extracting patch.

Travis: https://travis-ci.org/xemul/criu/builds/171439595Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-and-ported-on-dev-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 443f2489
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include <linux/elf.h> #include <linux/elf.h>
#include "asm/types.h" #include "types.h"
#include "asm/restorer.h" #include "asm/restorer.h"
#include "common/compiler.h" #include "common/compiler.h"
#include "ptrace.h" #include "ptrace.h"
......
#ifndef UAPI_COMPEL_ASM_TYPES_H__
#define UAPI_COMPEL_ASM_TYPES_H__
#include <stdint.h>
#include <signal.h>
#include <sys/mman.h>
#include <asm/ptrace.h>
#include "common/page.h"
#define SIGMAX 64
#define SIGMAX_OLD 31
/*
* Copied from the Linux kernel header arch/arm64/include/uapi/asm/ptrace.h
*
* A thread ARM CPU context
*/
typedef struct user_pt_regs user_regs_struct_t;
typedef struct user_fpsimd_state user_fpregs_struct_t;
#define REG_RES(r) ((uint64_t)(r).regs[0])
#define REG_IP(r) ((uint64_t)(r).pc)
#define REG_SYSCALL_NR(r) ((uint64_t)(r).regs[8])
/*
* Range for task size calculated from the following Linux kernel files:
* arch/arm64/include/asm/memory.h
* arch/arm64/Kconfig
*
* TODO: handle 32 bit tasks
*/
#define TASK_SIZE_MIN (1UL << 39)
#define TASK_SIZE_MAX (1UL << 48)
static inline unsigned long task_size(void)
{
unsigned long task_size;
for (task_size = TASK_SIZE_MIN; task_size < TASK_SIZE_MAX; task_size <<= 1)
if (munmap((void *)task_size, page_size()))
break;
return task_size;
}
#define AT_VECTOR_SIZE 40
typedef uint64_t auxv_t;
typedef uint64_t tls_t;
#define ARCH_SI_TRAP TRAP_BRKPT
#define __NR(syscall, compat) __NR_##syscall
#endif /* UAPI_COMPEL_ASM_TYPES_H__ */
...@@ -11,9 +11,6 @@ ...@@ -11,9 +11,6 @@
#include "asm/int.h" #include "asm/int.h"
#define SIGMAX 64
#define SIGMAX_OLD 31
typedef void rt_signalfn_t(int, siginfo_t *, void *); typedef void rt_signalfn_t(int, siginfo_t *, void *);
typedef rt_signalfn_t *rt_sighandler_t; typedef rt_signalfn_t *rt_sighandler_t;
...@@ -38,44 +35,6 @@ typedef struct { ...@@ -38,44 +35,6 @@ typedef struct {
k_rtsigset_t rt_sa_mask; k_rtsigset_t rt_sa_mask;
} rt_sigaction_t; } rt_sigaction_t;
/*
* Copied from the Linux kernel header arch/arm64/include/uapi/asm/ptrace.h
*
* A thread ARM CPU context
*/
typedef struct user_pt_regs user_regs_struct_t;
typedef struct user_fpsimd_state user_fpregs_struct_t;
#define REG_RES(regs) ((u64)(regs).regs[0])
#define REG_IP(regs) ((u64)(regs).pc)
#define REG_SYSCALL_NR(regs) ((u64)(regs).regs[8])
/*
* Range for task size calculated from the following Linux kernel files:
* arch/arm64/include/asm/memory.h
* arch/arm64/Kconfig
*
* TODO: handle 32 bit tasks
*/
#define TASK_SIZE_MIN (1UL << 39)
#define TASK_SIZE_MAX (1UL << 48)
int munmap(void *addr, size_t length);
static inline unsigned long task_size(void) {
unsigned long task_size;
for (task_size = TASK_SIZE_MIN; task_size < TASK_SIZE_MAX; task_size <<= 1)
if (munmap((void *)task_size, page_size()))
break;
return task_size;
}
#define AT_VECTOR_SIZE 40
typedef UserAarch64RegsEntry UserRegsEntry; typedef UserAarch64RegsEntry UserRegsEntry;
#define CORE_ENTRY__MARCH CORE_ENTRY__MARCH__AARCH64 #define CORE_ENTRY__MARCH CORE_ENTRY__MARCH__AARCH64
...@@ -84,9 +43,6 @@ typedef UserAarch64RegsEntry UserRegsEntry; ...@@ -84,9 +43,6 @@ typedef UserAarch64RegsEntry UserRegsEntry;
#define TI_SP(core) ((core)->ti_aarch64->gpregs->sp) #define TI_SP(core) ((core)->ti_aarch64->gpregs->sp)
typedef uint64_t auxv_t;
typedef uint64_t tls_t;
static inline void *decode_pointer(uint64_t v) { return (void*)v; } static inline void *decode_pointer(uint64_t v) { return (void*)v; }
static inline uint64_t encode_pointer(void *p) { return (uint64_t)p; } static inline uint64_t encode_pointer(void *p) { return (uint64_t)p; }
......
#include "asm/types.h" #include "asm/types.h"
#include "asm/infect-types.h"
#include "asm/sigframe.h" #include "asm/sigframe.h"
int sigreturn_prep_fpu_frame(struct rt_sigframe *sigframe, int sigreturn_prep_fpu_frame(struct rt_sigframe *sigframe,
......
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include "asm/types.h" #include "types.h"
#include "asm/restorer.h" #include "asm/restorer.h"
#include "common/compiler.h" #include "common/compiler.h"
#include "ptrace.h" #include "ptrace.h"
......
#ifndef UAPI_COMPEL_ASM_TYPES_H__
#define UAPI_COMPEL_ASM_TYPES_H__
#include <stdint.h>
#include <sys/mman.h>
#include "common/page.h"
#define SIGMAX 64
#define SIGMAX_OLD 31
/*
* Copied from the Linux kernel header arch/arm/include/asm/ptrace.h
*
* A thread ARM CPU context
*/
typedef struct {
long uregs[18];
} user_regs_struct_t;
typedef struct user_vfp user_fpregs_struct_t;
#define ARM_cpsr uregs[16]
#define ARM_pc uregs[15]
#define ARM_lr uregs[14]
#define ARM_sp uregs[13]
#define ARM_ip uregs[12]
#define ARM_fp uregs[11]
#define ARM_r10 uregs[10]
#define ARM_r9 uregs[9]
#define ARM_r8 uregs[8]
#define ARM_r7 uregs[7]
#define ARM_r6 uregs[6]
#define ARM_r5 uregs[5]
#define ARM_r4 uregs[4]
#define ARM_r3 uregs[3]
#define ARM_r2 uregs[2]
#define ARM_r1 uregs[1]
#define ARM_r0 uregs[0]
#define ARM_ORIG_r0 uregs[17]
/* Copied from arch/arm/include/asm/user.h */
struct user_vfp {
unsigned long long fpregs[32];
unsigned long fpscr;
};
struct user_vfp_exc {
unsigned long fpexc;
unsigned long fpinst;
unsigned long fpinst2;
};
#define REG_RES(regs) ((regs).ARM_r0)
#define REG_IP(regs) ((regs).ARM_pc)
#define REG_SYSCALL_NR(regs) ((regs).ARM_r7)
/*
* Range for task size calculated from the following Linux kernel files:
* arch/arm/include/asm/memory.h
* arch/arm/Kconfig (PAGE_OFFSET values in Memory split section)
*/
#define TASK_SIZE_MIN 0x3f000000
#define TASK_SIZE_MAX 0xbf000000
#define SZ_1G 0x40000000
static inline unsigned long task_size(void)
{
unsigned long task_size;
for (task_size = TASK_SIZE_MIN; task_size < TASK_SIZE_MAX; task_size += SZ_1G)
if (munmap((void *)task_size, page_size()))
break;
return task_size;
}
#define AT_VECTOR_SIZE 40
typedef uint32_t auxv_t;
typedef uint32_t tls_t;
#define ARCH_SI_TRAP TRAP_BRKPT
#define __NR(syscall, compat) __NR_##syscall
#endif /* UAPI_COMPEL_ASM_TYPES_H__ */
...@@ -9,12 +9,6 @@ ...@@ -9,12 +9,6 @@
#include "bitops.h" #include "bitops.h"
#include "asm/int.h" #include "asm/int.h"
#define SIGMAX 64
#define SIGMAX_OLD 31
#define MAJOR(dev) ((dev)>>8)
#define MINOR(dev) ((dev) & 0xff)
typedef void rt_signalfn_t(int, siginfo_t *, void *); typedef void rt_signalfn_t(int, siginfo_t *, void *);
typedef rt_signalfn_t *rt_sighandler_t; typedef rt_signalfn_t *rt_sighandler_t;
...@@ -39,79 +33,6 @@ typedef struct { ...@@ -39,79 +33,6 @@ typedef struct {
k_rtsigset_t rt_sa_mask; k_rtsigset_t rt_sa_mask;
} rt_sigaction_t; } rt_sigaction_t;
/*
* Copied from the Linux kernel header arch/arm/include/asm/ptrace.h
*
* A thread ARM CPU context
*/
typedef struct {
long uregs[18];
} user_regs_struct_t;
typedef struct user_vfp user_fpregs_struct_t;
#define ARM_cpsr uregs[16]
#define ARM_pc uregs[15]
#define ARM_lr uregs[14]
#define ARM_sp uregs[13]
#define ARM_ip uregs[12]
#define ARM_fp uregs[11]
#define ARM_r10 uregs[10]
#define ARM_r9 uregs[9]
#define ARM_r8 uregs[8]
#define ARM_r7 uregs[7]
#define ARM_r6 uregs[6]
#define ARM_r5 uregs[5]
#define ARM_r4 uregs[4]
#define ARM_r3 uregs[3]
#define ARM_r2 uregs[2]
#define ARM_r1 uregs[1]
#define ARM_r0 uregs[0]
#define ARM_ORIG_r0 uregs[17]
/* Copied from arch/arm/include/asm/user.h */
struct user_vfp {
unsigned long long fpregs[32];
unsigned long fpscr;
};
struct user_vfp_exc {
unsigned long fpexc;
unsigned long fpinst;
unsigned long fpinst2;
};
#define REG_RES(regs) ((regs).ARM_r0)
#define REG_IP(regs) ((regs).ARM_pc)
#define REG_SYSCALL_NR(regs) ((regs).ARM_r7)
/*
* Range for task size calculated from the following Linux kernel files:
* arch/arm/include/asm/memory.h
* arch/arm/Kconfig (PAGE_OFFSET values in Memory split section)
*/
#define TASK_SIZE_MIN 0x3f000000
#define TASK_SIZE_MAX 0xbf000000
#define SZ_1G 0x40000000
int munmap(void *addr, size_t length);
static inline unsigned long task_size(void)
{
unsigned long task_size;
for (task_size = TASK_SIZE_MIN; task_size < TASK_SIZE_MAX; task_size += SZ_1G)
if (munmap((void *)task_size, page_size()))
break;
return task_size;
}
#define AT_VECTOR_SIZE 40
typedef UserArmRegsEntry UserRegsEntry; typedef UserArmRegsEntry UserRegsEntry;
#define CORE_ENTRY__MARCH CORE_ENTRY__MARCH__ARM #define CORE_ENTRY__MARCH CORE_ENTRY__MARCH__ARM
...@@ -120,9 +41,6 @@ typedef UserArmRegsEntry UserRegsEntry; ...@@ -120,9 +41,6 @@ typedef UserArmRegsEntry UserRegsEntry;
#define TI_SP(core) ((core)->ti_arm->gpregs->sp) #define TI_SP(core) ((core)->ti_arm->gpregs->sp)
typedef u32 auxv_t;
typedef u32 tls_t;
static inline void *decode_pointer(u64 v) { return (void*)(u32)v; } static inline void *decode_pointer(u64 v) { return (void*)(u32)v; }
static inline u64 encode_pointer(void *p) { return (u32)p; } static inline u64 encode_pointer(void *p) { return (u32)p; }
......
#include "asm/types.h" #include "asm/types.h"
#include "asm/infect-types.h"
#include "asm/sigframe.h" #include "asm/sigframe.h"
int sigreturn_prep_fpu_frame(struct rt_sigframe *sigframe, int sigreturn_prep_fpu_frame(struct rt_sigframe *sigframe,
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include <asm/unistd.h> #include <asm/unistd.h>
#include <sys/uio.h> #include <sys/uio.h>
#include "asm/types.h" #include "types.h"
#include "asm/fpu.h" #include "asm/fpu.h"
#include "asm/restorer.h" #include "asm/restorer.h"
......
#ifndef UAPI_COMPEL_ASM_TYPES_H__
#define UAPI_COMPEL_ASM_TYPES_H__
#include <stdbool.h>
#include <signal.h>
#include <stdint.h>
#define SIGMAX_OLD 31
#define SIGMAX 64
/*
* Copied from kernel header arch/powerpc/include/uapi/asm/ptrace.h
*/
typedef struct {
unsigned long gpr[32];
unsigned long nip;
unsigned long msr;
unsigned long orig_gpr3; /* Used for restarting system calls */
unsigned long ctr;
unsigned long link;
unsigned long xer;
unsigned long ccr;
unsigned long softe; /* Soft enabled/disabled */
unsigned long trap; /* Reason for being here */
/*
* N.B. for critical exceptions on 4xx, the dar and dsisr
* fields are overloaded to hold srr0 and srr1.
*/
unsigned long dar; /* Fault registers */
unsigned long dsisr; /* on 4xx/Book-E used for ESR */
unsigned long result; /* Result of a system call */
} user_regs_struct_t;
#define NVSXREG 32
#define USER_FPREGS_FL_FP 0x00001
#define USER_FPREGS_FL_ALTIVEC 0x00002
#define USER_FPREGS_FL_VSX 0x00004
#define USER_FPREGS_FL_TM 0x00010
#ifndef NT_PPC_TM_SPR
# define NT_PPC_TM_CGPR 0x108 /* TM checkpointed GPR Registers */
# define NT_PPC_TM_CFPR 0x109 /* TM checkpointed FPR Registers */
# define NT_PPC_TM_CVMX 0x10a /* TM checkpointed VMX Registers */
# define NT_PPC_TM_CVSX 0x10b /* TM checkpointed VSX Registers */
# define NT_PPC_TM_SPR 0x10c /* TM Special Purpose Registers */
#endif
#define MSR_TMA (1UL<<34) /* bit 29 Trans Mem state: Transactional */
#define MSR_TMS (1UL<<33) /* bit 30 Trans Mem state: Suspended */
#define MSR_TM (1UL<<32) /* bit 31 Trans Mem Available */
#define MSR_VEC (1UL<<25)
#define MSR_VSX (1UL<<23)
#define MSR_TM_ACTIVE(x) ((((x) & MSR_TM) && ((x)&(MSR_TMA|MSR_TMS))) != 0)
typedef struct {
uint64_t fpregs[NFPREG];
__vector128 vrregs[NVRREG];
uint64_t vsxregs[NVSXREG];
int flags;
struct tm_regs {
int flags;
struct {
uint64_t tfhar, texasr, tfiar;
} tm_spr_regs;
user_regs_struct_t regs;
uint64_t fpregs[NFPREG];
__vector128 vrregs[NVRREG];
uint64_t vsxregs[NVSXREG];
} tm;
} user_fpregs_struct_t;
#define REG_RES(regs) ((uint64_t)(regs).gpr[3])
#define REG_IP(regs) ((uint64_t)(regs).nip)
#define REG_SYSCALL_NR(regs) ((uint64_t)(regs).gpr[0])
/*
* Copied from the following kernel header files :
* include/linux/auxvec.h
* arch/powerpc/include/uapi/asm/auxvec.h
* include/linux/mm_types.h
*/
#define AT_VECTOR_SIZE_BASE 20
#define AT_VECTOR_SIZE_ARCH 6
#define AT_VECTOR_SIZE (2*(AT_VECTOR_SIZE_ARCH + AT_VECTOR_SIZE_BASE + 1))
typedef uint64_t auxv_t;
/* Not used but the structure parasite_dump_thread needs a tls_t field */
typedef uint64_t tls_t;
/*
* Copied for the Linux kernel arch/powerpc/include/asm/processor.h
*
* NOTE: 32bit tasks are not supported.
*/
#define TASK_SIZE_USER64 (0x0000400000000000UL)
#define TASK_SIZE TASK_SIZE_USER64
static inline unsigned long task_size(void) { return TASK_SIZE; }
#define ARCH_SI_TRAP TRAP_BRKPT
#define __NR(syscall, compat) __NR_##syscall
#endif /* UAPI_COMPEL_ASM_TYPES_H__ */
...@@ -18,9 +18,6 @@ typedef rt_signalfn_t *rt_sighandler_t; ...@@ -18,9 +18,6 @@ typedef rt_signalfn_t *rt_sighandler_t;
typedef void rt_restorefn_t(void); typedef void rt_restorefn_t(void);
typedef rt_restorefn_t *rt_sigrestore_t; typedef rt_restorefn_t *rt_sigrestore_t;
#define SIGMAX_OLD 31
#define SIGMAX 64
/*Copied from the Linux kernel arch/powerpc/include/uapi/asm/signal.h */ /*Copied from the Linux kernel arch/powerpc/include/uapi/asm/signal.h */
#define _KNSIG 64 #define _KNSIG 64
#define _NSIG_BPW 64 #define _NSIG_BPW 64
...@@ -40,89 +37,13 @@ typedef struct { ...@@ -40,89 +37,13 @@ typedef struct {
k_rtsigset_t rt_sa_mask; /* mask last for extensibility */ k_rtsigset_t rt_sa_mask; /* mask last for extensibility */
} rt_sigaction_t; } rt_sigaction_t;
/*
* Copied from kernel header arch/powerpc/include/uapi/asm/ptrace.h
*/
typedef struct {
unsigned long gpr[32];
unsigned long nip;
unsigned long msr;
unsigned long orig_gpr3; /* Used for restarting system calls */
unsigned long ctr;
unsigned long link;
unsigned long xer;
unsigned long ccr;
unsigned long softe; /* Soft enabled/disabled */
unsigned long trap; /* Reason for being here */
/* N.B. for critical exceptions on 4xx, the dar and dsisr
fields are overloaded to hold srr0 and srr1. */
unsigned long dar; /* Fault registers */
unsigned long dsisr; /* on 4xx/Book-E used for ESR */
unsigned long result; /* Result of a system call */
} user_regs_struct_t;
#define NVSXREG 32
#define USER_FPREGS_FL_FP 0x00001
#define USER_FPREGS_FL_ALTIVEC 0x00002
#define USER_FPREGS_FL_VSX 0x00004
#define USER_FPREGS_FL_TM 0x00010
typedef struct {
uint64_t fpregs[NFPREG];
__vector128 vrregs[NVRREG];
uint64_t vsxregs[NVSXREG];
int flags;
struct tm_regs {
int flags;
struct {
uint64_t tfhar, texasr, tfiar;
} tm_spr_regs;
user_regs_struct_t regs;
uint64_t fpregs[NFPREG];
__vector128 vrregs[NVRREG];
uint64_t vsxregs[NVSXREG];
} tm;
} user_fpregs_struct_t;
typedef UserPpc64RegsEntry UserRegsEntry; typedef UserPpc64RegsEntry UserRegsEntry;
#define CORE_ENTRY__MARCH CORE_ENTRY__MARCH__PPC64 #define CORE_ENTRY__MARCH CORE_ENTRY__MARCH__PPC64
#define REG_RES(regs) ((u64)(regs).gpr[3])
#define REG_IP(regs) ((u64)(regs).nip)
#define REG_SYSCALL_NR(regs) ((u64)(regs).gpr[0])
#define CORE_THREAD_ARCH_INFO(core) core->ti_ppc64 #define CORE_THREAD_ARCH_INFO(core) core->ti_ppc64
/*
* Copied from the following kernel header files :
* include/linux/auxvec.h
* arch/powerpc/include/uapi/asm/auxvec.h
* include/linux/mm_types.h
*/
#define AT_VECTOR_SIZE_BASE 20
#define AT_VECTOR_SIZE_ARCH 6
#define AT_VECTOR_SIZE (2*(AT_VECTOR_SIZE_ARCH + AT_VECTOR_SIZE_BASE + 1))
typedef uint64_t auxv_t;
/* Not used but the structure parasite_dump_thread needs a tls_t field */
typedef uint64_t tls_t;
/*
* Copied for the Linux kernel arch/powerpc/include/asm/processor.h
*
* NOTE: 32bit tasks are not supported.
*/
#define TASK_SIZE_USER64 (0x0000400000000000UL)
#define TASK_SIZE TASK_SIZE_USER64
static inline unsigned long task_size(void) { return TASK_SIZE; }
static inline void *decode_pointer(uint64_t v) { return (void*)v; } static inline void *decode_pointer(uint64_t v) { return (void*)v; }
static inline uint64_t encode_pointer(void *p) { return (uint64_t)p; } static inline uint64_t encode_pointer(void *p) { return (uint64_t)p; }
......
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
#include <sys/user.h> #include <sys/user.h>
#include <sys/mman.h> #include <sys/mman.h>
#include "types.h"
#include "asm/processor-flags.h" #include "asm/processor-flags.h"
#include "asm/restorer.h" #include "asm/restorer.h"
#include "asm/types.h"
#include "asm/fpu.h" #include "asm/fpu.h"
#include "cr_options.h" #include "cr_options.h"
......
#ifndef UAPI_COMPEL_ASM_TYPES_H__
#define UAPI_COMPEL_ASM_TYPES_H__
#include <stdint.h>
#include <stdbool.h>
#include <signal.h>
#include "common/page.h"
#include "syscall-types.h"
#define SIGMAX 64
#define SIGMAX_OLD 31
typedef struct {
unsigned long r15;
unsigned long r14;
unsigned long r13;
unsigned long r12;
unsigned long bp;
unsigned long bx;
unsigned long r11;
unsigned long r10;
unsigned long r9;
unsigned long r8;
unsigned long ax;
unsigned long cx;
unsigned long dx;
unsigned long si;
unsigned long di;
unsigned long orig_ax;
unsigned long ip;
unsigned long cs;
unsigned long flags;
unsigned long sp;
unsigned long ss;
unsigned long fs_base;
unsigned long gs_base;
unsigned long ds;
unsigned long es;
unsigned long fs;
unsigned long gs;
} user_regs_struct_t;
#if 0
typedef struct {
unsigned short cwd;
unsigned short swd;
unsigned short twd; /* Note this is not the same as
the 32bit/x87/FSAVE twd */
unsigned short fop;
u64 rip;
u64 rdp;
u32 mxcsr;
u32 mxcsr_mask;
u32 st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */
u32 xmm_space[64]; /* 16*16 bytes for each XMM-reg = 256 bytes */
u32 padding[24];
} user_fpregs_struct_t;
#endif
typedef struct xsave_struct user_fpregs_struct_t;
#ifdef CONFIG_X86_64
# define TASK_SIZE ((1UL << 47) - PAGE_SIZE)
#else
/*
* Task size may be limited to 3G but we need a
* higher limit, because it's backward compatible.
*/
# define TASK_SIZE (0xffffe000)
#endif
static inline unsigned long task_size(void) { return TASK_SIZE; }
typedef uint64_t auxv_t;
typedef uint32_t tls_t;
#define REG_RES(regs) ((regs).ax)
#define REG_IP(regs) ((regs).ip)
#define REG_SYSCALL_NR(regs) ((regs).orig_ax)
#define AT_VECTOR_SIZE 44
#endif /* UAPI_COMPEL_ASM_TYPES_H__ */
...@@ -10,12 +10,6 @@ ...@@ -10,12 +10,6 @@
#include "images/core.pb-c.h" #include "images/core.pb-c.h"
#define SIGMAX 64
#define SIGMAX_OLD 31
#define MAJOR(dev) ((dev)>>8)
#define MINOR(dev) ((dev) & 0xff)
typedef void rt_signalfn_t(int, siginfo_t *, void *); typedef void rt_signalfn_t(int, siginfo_t *, void *);
typedef rt_signalfn_t *rt_sighandler_t; typedef rt_signalfn_t *rt_sighandler_t;
...@@ -53,78 +47,8 @@ typedef struct { ...@@ -53,78 +47,8 @@ typedef struct {
unsigned int lm:1; unsigned int lm:1;
} user_desc_t; } user_desc_t;
typedef struct {
unsigned long r15;
unsigned long r14;
unsigned long r13;
unsigned long r12;
unsigned long bp;
unsigned long bx;
unsigned long r11;
unsigned long r10;
unsigned long r9;
unsigned long r8;
unsigned long ax;
unsigned long cx;
unsigned long dx;
unsigned long si;
unsigned long di;
unsigned long orig_ax;
unsigned long ip;
unsigned long cs;
unsigned long flags;
unsigned long sp;
unsigned long ss;
unsigned long fs_base;
unsigned long gs_base;
unsigned long ds;
unsigned long es;
unsigned long fs;
unsigned long gs;
} user_regs_struct_t;
#if 0
typedef struct {
unsigned short cwd;
unsigned short swd;
unsigned short twd; /* Note this is not the same as
the 32bit/x87/FSAVE twd */
unsigned short fop;
u64 rip;
u64 rdp;
u32 mxcsr;
u32 mxcsr_mask;
u32 st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */
u32 xmm_space[64]; /* 16*16 bytes for each XMM-reg = 256 bytes */
u32 padding[24];
} user_fpregs_struct_t;
#endif
typedef struct xsave_struct user_fpregs_struct_t;
#ifdef CONFIG_X86_64
# define TASK_SIZE ((1UL << 47) - PAGE_SIZE)
#else
/*
* Task size may be limited to 3G but we need a
* higher limit, because it's backward compatible.
*/
# define TASK_SIZE (0xffffe000)
#endif
static inline unsigned long task_size(void) { return TASK_SIZE; }
typedef u64 auxv_t;
typedef u32 tls_t;
#define REG_RES(regs) ((regs).ax)
#define REG_IP(regs) ((regs).ip)
#define REG_SYSCALL_NR(regs) ((regs).orig_ax)
#define CORE_ENTRY__MARCH CORE_ENTRY__MARCH__X86_64 #define CORE_ENTRY__MARCH CORE_ENTRY__MARCH__X86_64
#define AT_VECTOR_SIZE 44
#define CORE_THREAD_ARCH_INFO(core) core->thread_info #define CORE_THREAD_ARCH_INFO(core) core->thread_info
typedef UserX86RegsEntry UserRegsEntry; typedef UserX86RegsEntry UserRegsEntry;
......
#include <asm/prctl.h> #include <asm/prctl.h>
#include <unistd.h> #include <unistd.h>
#include "types.h"
#include "restorer.h" #include "restorer.h"
#include "asm/restorer.h" #include "asm/restorer.h"
#include "asm/fpu.h" #include "asm/fpu.h"
......
#ifndef __CR_INC_RESTORE_H__ #ifndef __CR_INC_RESTORE_H__
#define __CR_INC_RESTORE_H__ #define __CR_INC_RESTORE_H__
#include "types.h"
#include "asm/restore.h" #include "asm/restore.h"
#endif #endif
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <limits.h> #include <limits.h>
#include <sys/resource.h> #include <sys/resource.h>
#include "types.h"
#include "int.h" #include "int.h"
#include "types.h" #include "types.h"
#include "common/compiler.h" #include "common/compiler.h"
...@@ -13,7 +14,6 @@ ...@@ -13,7 +14,6 @@
#include "util.h" #include "util.h"
#include "asm/restorer.h" #include "asm/restorer.h"
#include "config.h" #include "config.h"
#include "posix-timer.h" #include "posix-timer.h"
#include "timerfd.h" #include "timerfd.h"
#include "shmem.h" #include "shmem.h"
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <sched.h> #include <sched.h>
#include <time.h> #include <time.h>
#include <fcntl.h> #include <fcntl.h>
#include "int.h"
struct cap_header { struct cap_header {
u32 version; u32 version;
......
#ifndef __CR_INC_TYPES_H__ #ifndef __CR_INC_TYPES_H__
#define __CR_INC_TYPES_H__ #define __CR_INC_TYPES_H__
#include "asm/infect-types.h"
#include "asm/types.h" #include "asm/types.h"
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment