add x86_sregs into x86_user_context

x86_sregs contains the registers which are included in user_regs_struct
but not included in x86_basic_regs.
This commit is contained in:
NAKAMURA Gou
2015-02-25 18:25:39 +09:00
parent 4aa8ba2eef
commit b66b950129
3 changed files with 37 additions and 5 deletions

View File

@@ -25,7 +25,19 @@ typedef struct x86_kregs ihk_mc_kernel_context_t;
/* XXX: User context should contain floating point registers */
struct x86_user_context {
struct x86_basic_regs gpr;
struct x86_sregs sr;
/* 16-byte boundary here */
uint8_t is_gpr_valid;
uint8_t is_sr_valid;
uint8_t spare_flags6;
uint8_t spare_flags5;
uint8_t spare_flags4;
uint8_t spare_flags3;
uint8_t spare_flags2;
uint8_t spare_flags1;
struct x86_basic_regs gpr; /* must be last */
/* 16-byte boundary here */
};
typedef struct x86_user_context ihk_mc_user_context_t;

View File

@@ -184,6 +184,15 @@ struct x86_basic_regs {
unsigned long rip, cs, rflags, rsp, ss;
};
struct x86_sregs {
unsigned long fs_base;
unsigned long gs_base;
unsigned long ds;
unsigned long es;
unsigned long fs;
unsigned long gs;
};
#define REGS_GET_STACK_POINTER(regs) (((struct x86_regs *)regs)->rsp)
/*