mirror of https://gitee.com/openkylin/qemu.git
linux-user: Reindent elfload.c.
Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
This commit is contained in:
parent
e167d46c7a
commit
d97ef72eed
|
@ -36,9 +36,8 @@
|
||||||
*/
|
*/
|
||||||
enum {
|
enum {
|
||||||
ADDR_NO_RANDOMIZE = 0x0040000, /* disable randomization of VA space */
|
ADDR_NO_RANDOMIZE = 0x0040000, /* disable randomization of VA space */
|
||||||
FDPIC_FUNCPTRS = 0x0080000, /* userspace function ptrs point to descriptors
|
FDPIC_FUNCPTRS = 0x0080000, /* userspace function ptrs point to
|
||||||
* (signal handling)
|
descriptors (signal handling) */
|
||||||
*/
|
|
||||||
MMAP_PAGE_ZERO = 0x0100000,
|
MMAP_PAGE_ZERO = 0x0100000,
|
||||||
ADDR_COMPAT_LAYOUT = 0x0200000,
|
ADDR_COMPAT_LAYOUT = 0x0200000,
|
||||||
READ_IMPLIES_EXEC = 0x0400000,
|
READ_IMPLIES_EXEC = 0x0400000,
|
||||||
|
@ -61,8 +60,7 @@ enum {
|
||||||
PER_LINUX_FDPIC = 0x0000 | FDPIC_FUNCPTRS,
|
PER_LINUX_FDPIC = 0x0000 | FDPIC_FUNCPTRS,
|
||||||
PER_SVR4 = 0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
|
PER_SVR4 = 0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
|
||||||
PER_SVR3 = 0x0002 | STICKY_TIMEOUTS | SHORT_INODE,
|
PER_SVR3 = 0x0002 | STICKY_TIMEOUTS | SHORT_INODE,
|
||||||
PER_SCOSVR3 = 0x0003 | STICKY_TIMEOUTS |
|
PER_SCOSVR3 = 0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS | SHORT_INODE,
|
||||||
WHOLE_SECONDS | SHORT_INODE,
|
|
||||||
PER_OSR5 = 0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS,
|
PER_OSR5 = 0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS,
|
||||||
PER_WYSEV386 = 0x0004 | STICKY_TIMEOUTS | SHORT_INODE,
|
PER_WYSEV386 = 0x0004 | STICKY_TIMEOUTS | SHORT_INODE,
|
||||||
PER_ISCR4 = 0x0005 | STICKY_TIMEOUTS,
|
PER_ISCR4 = 0x0005 | STICKY_TIMEOUTS,
|
||||||
|
@ -201,7 +199,8 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env)
|
||||||
#define ELF_DATA ELFDATA2LSB
|
#define ELF_DATA ELFDATA2LSB
|
||||||
#define ELF_ARCH EM_386
|
#define ELF_ARCH EM_386
|
||||||
|
|
||||||
static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop)
|
static inline void init_thread(struct target_pt_regs *regs,
|
||||||
|
struct image_info *infop)
|
||||||
{
|
{
|
||||||
regs->esp = infop->start_stack;
|
regs->esp = infop->start_stack;
|
||||||
regs->eip = infop->entry;
|
regs->eip = infop->entry;
|
||||||
|
@ -267,7 +266,8 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env)
|
||||||
#endif
|
#endif
|
||||||
#define ELF_ARCH EM_ARM
|
#define ELF_ARCH EM_ARM
|
||||||
|
|
||||||
static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop)
|
static inline void init_thread(struct target_pt_regs *regs,
|
||||||
|
struct image_info *infop)
|
||||||
{
|
{
|
||||||
abi_long stack = infop->start_stack;
|
abi_long stack = infop->start_stack;
|
||||||
memset(regs, 0, sizeof(*regs));
|
memset(regs, 0, sizeof(*regs));
|
||||||
|
@ -357,7 +357,8 @@ enum
|
||||||
|
|
||||||
#define STACK_BIAS 2047
|
#define STACK_BIAS 2047
|
||||||
|
|
||||||
static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop)
|
static inline void init_thread(struct target_pt_regs *regs,
|
||||||
|
struct image_info *infop)
|
||||||
{
|
{
|
||||||
#ifndef TARGET_ABI32
|
#ifndef TARGET_ABI32
|
||||||
regs->tstate = 0;
|
regs->tstate = 0;
|
||||||
|
@ -384,7 +385,8 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i
|
||||||
#define ELF_DATA ELFDATA2MSB
|
#define ELF_DATA ELFDATA2MSB
|
||||||
#define ELF_ARCH EM_SPARC
|
#define ELF_ARCH EM_SPARC
|
||||||
|
|
||||||
static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop)
|
static inline void init_thread(struct target_pt_regs *regs,
|
||||||
|
struct image_info *infop)
|
||||||
{
|
{
|
||||||
regs->psr = 0;
|
regs->psr = 0;
|
||||||
regs->pc = infop->entry;
|
regs->pc = infop->entry;
|
||||||
|
@ -559,7 +561,8 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env)
|
||||||
#endif
|
#endif
|
||||||
#define ELF_ARCH EM_MIPS
|
#define ELF_ARCH EM_MIPS
|
||||||
|
|
||||||
static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop)
|
static inline void init_thread(struct target_pt_regs *regs,
|
||||||
|
struct image_info *infop)
|
||||||
{
|
{
|
||||||
regs->cp0_status = 2 << CP0St_KSU;
|
regs->cp0_status = 2 << CP0St_KSU;
|
||||||
regs->cp0_epc = infop->entry;
|
regs->cp0_epc = infop->entry;
|
||||||
|
@ -626,7 +629,8 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env)
|
||||||
#define ELF_DATA ELFDATA2MSB
|
#define ELF_DATA ELFDATA2MSB
|
||||||
#define ELF_ARCH EM_MICROBLAZE
|
#define ELF_ARCH EM_MICROBLAZE
|
||||||
|
|
||||||
static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop)
|
static inline void init_thread(struct target_pt_regs *regs,
|
||||||
|
struct image_info *infop)
|
||||||
{
|
{
|
||||||
regs->pc = infop->entry;
|
regs->pc = infop->entry;
|
||||||
regs->r1 = infop->start_stack;
|
regs->r1 = infop->start_stack;
|
||||||
|
@ -665,7 +669,8 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env)
|
||||||
#define ELF_DATA ELFDATA2LSB
|
#define ELF_DATA ELFDATA2LSB
|
||||||
#define ELF_ARCH EM_SH
|
#define ELF_ARCH EM_SH
|
||||||
|
|
||||||
static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop)
|
static inline void init_thread(struct target_pt_regs *regs,
|
||||||
|
struct image_info *infop)
|
||||||
{
|
{
|
||||||
/* Check other registers XXXXX */
|
/* Check other registers XXXXX */
|
||||||
regs->pc = infop->entry;
|
regs->pc = infop->entry;
|
||||||
|
@ -687,7 +692,8 @@ enum {
|
||||||
TARGET_REG_SYSCALL = 22
|
TARGET_REG_SYSCALL = 22
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env)
|
static inline void elf_core_copy_regs(target_elf_gregset_t *regs,
|
||||||
|
const CPUState *env)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -719,7 +725,8 @@ static inline void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState
|
||||||
#define ELF_DATA ELFDATA2LSB
|
#define ELF_DATA ELFDATA2LSB
|
||||||
#define ELF_ARCH EM_CRIS
|
#define ELF_ARCH EM_CRIS
|
||||||
|
|
||||||
static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop)
|
static inline void init_thread(struct target_pt_regs *regs,
|
||||||
|
struct image_info *infop)
|
||||||
{
|
{
|
||||||
regs->erp = infop->entry;
|
regs->erp = infop->entry;
|
||||||
}
|
}
|
||||||
|
@ -741,7 +748,8 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i
|
||||||
/* ??? Does this need to do anything?
|
/* ??? Does this need to do anything?
|
||||||
#define ELF_PLAT_INIT(_r) */
|
#define ELF_PLAT_INIT(_r) */
|
||||||
|
|
||||||
static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop)
|
static inline void init_thread(struct target_pt_regs *regs,
|
||||||
|
struct image_info *infop)
|
||||||
{
|
{
|
||||||
regs->usp = infop->start_stack;
|
regs->usp = infop->start_stack;
|
||||||
regs->sr = 0;
|
regs->sr = 0;
|
||||||
|
@ -791,7 +799,8 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env)
|
||||||
#define ELF_DATA ELFDATA2MSB
|
#define ELF_DATA ELFDATA2MSB
|
||||||
#define ELF_ARCH EM_ALPHA
|
#define ELF_ARCH EM_ALPHA
|
||||||
|
|
||||||
static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop)
|
static inline void init_thread(struct target_pt_regs *regs,
|
||||||
|
struct image_info *infop)
|
||||||
{
|
{
|
||||||
regs->pc = infop->entry;
|
regs->pc = infop->entry;
|
||||||
regs->ps = 8;
|
regs->ps = 8;
|
||||||
|
@ -1888,7 +1897,6 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs,
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_ELF_CORE_DUMP
|
#ifdef USE_ELF_CORE_DUMP
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Definitions to generate Intel SVR4-like core files.
|
* Definitions to generate Intel SVR4-like core files.
|
||||||
* These mostly have the same names as the SVR4 types with "target_elf_"
|
* These mostly have the same names as the SVR4 types with "target_elf_"
|
||||||
|
|
Loading…
Reference in New Issue