diff options
author | Nathan Froyd <froydnj@codesourcery.com> | 2009-12-11 09:04:46 -0800 |
---|---|---|
committer | Aurelien Jarno <aurelien@aurel32.net> | 2009-12-19 20:29:18 +0100 |
commit | ea544f93a402ecd3305fe15c1102d2c701bf3e1b (patch) | |
tree | 42dce85b7f50d57bd5ceda24955a5013ba811721 /linux-user | |
parent | 64a6f4a745145bbb10834f607bd7e7c379dd996d (diff) | |
download | qemu-ea544f93a402ecd3305fe15c1102d2c701bf3e1b.tar.gz qemu-ea544f93a402ecd3305fe15c1102d2c701bf3e1b.tar.bz2 qemu-ea544f93a402ecd3305fe15c1102d2c701bf3e1b.zip |
linux-user: commonify definitions of target typedefs
There's no sense in separately declaring target_{elf_greg,uid,gid,pid}_t
for every architecture. Just declare them once with appropriate
USE_UID16 handling.
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'linux-user')
-rw-r--r-- | linux-user/elfload.c | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 987354192a..7e591aa235 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -97,6 +97,16 @@ enum { #define ELIBBAD 80 #endif +typedef target_ulong target_elf_greg_t; +#ifdef USE_UID16 +typedef uint16_t target_uid_t; +typedef uint16_t target_gid_t; +#else +typedef uint32_t target_uid_t; +typedef uint32_t target_gid_t; +#endif +typedef int32_t target_pid_t; + #ifdef TARGET_I386 #define ELF_PLATFORM get_elf_platform() @@ -134,11 +144,6 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i regs->rip = infop->entry; } -typedef target_ulong target_elf_greg_t; -typedef uint32_t target_uid_t; -typedef uint32_t target_gid_t; -typedef int32_t target_pid_t; - #define ELF_NREG 27 typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; @@ -211,11 +216,6 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i regs->edx = 0; } -typedef target_ulong target_elf_greg_t; -typedef uint16_t target_uid_t; -typedef uint16_t target_gid_t; -typedef int32_t target_pid_t; - #define ELF_NREG 17 typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; @@ -286,11 +286,6 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i regs->ARM_r10 = infop->start_data; } -typedef uint32_t target_elf_greg_t; -typedef uint16_t target_uid_t; -typedef uint16_t target_gid_t; -typedef int32_t target_pid_t; - #define ELF_NREG 18 typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; @@ -1776,13 +1771,6 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs, * #define ELF_NREG <number of registers> * typedef taret_elf_greg_t target_elf_gregset_t[ELF_NREG]; * - * Then define following types to match target types. Actual types can - * be found from linux kernel (arch/<ARCH>/include/asm/posix_types.h): - * - * typedef <target_uid_type> target_uid_t; - * typedef <target_gid_type> target_gid_t; - * typedef <target_pid_type> target_pid_t; - * * Last step is to implement target specific function that copies registers * from given cpu into just specified register set. Prototype is: * |