Commit 992f48a036cccf7101e31bf3e5d901ce5320e886

Authored by blueswir1
1 parent b227a8e9

Support for 32 bit ABI on 64 bit targets (only enabled Sparc64)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3396 c046a42c-6fe2-441c-8c8c-71466251a162
Makefile.target
... ... @@ -31,7 +31,10 @@ CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH)
31 31 endif
32 32 ifdef CONFIG_LINUX_USER
33 33 VPATH+=:$(SRC_PATH)/linux-user
34   -CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH)
  34 +ifndef TARGET_ABI_DIR
  35 + TARGET_ABI_DIR=$(TARGET_ARCH)
  36 +endif
  37 +CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
35 38 endif
36 39 BASE_CFLAGS=
37 40 BASE_LDFLAGS=
... ... @@ -66,6 +69,11 @@ ifeq ($(TARGET_ARCH),mips64)
66 69 TARGET_ARCH2=mips64el
67 70 endif
68 71 endif
  72 +ifeq ($(TARGET_ARCH),sparc64)
  73 + ifeq ($(TARGET_ABI_DIR),sparc)
  74 + TARGET_ARCH2=sparc32plus
  75 + endif
  76 +endif
69 77 QEMU_USER=qemu-$(TARGET_ARCH2)
70 78 # system emulator name
71 79 ifdef CONFIG_SOFTMMU
... ...
configure
... ... @@ -504,7 +504,7 @@ if test -z "$target_list" ; then
504 504 fi
505 505 # the following are Linux specific
506 506 if [ "$linux_user" = "yes" ] ; then
507   - target_list="i386-linux-user arm-linux-user armeb-linux-user sparc-linux-user mips-linux-user mipsel-linux-user m68k-linux-user alpha-linux-user sh4-linux-user ppc-linux-user ppc64-linux-user x86_64-linux-user cris-linux-user $target_list"
  507 + target_list="i386-linux-user arm-linux-user armeb-linux-user sparc-linux-user sparc64-linux-user sparc32plus-linux-user mips-linux-user mipsel-linux-user m68k-linux-user alpha-linux-user sh4-linux-user ppc-linux-user ppc64-linux-user x86_64-linux-user cris-linux-user $target_list"
508 508 fi
509 509 # the following are Darwin specific
510 510 if [ "$darwin_user" = "yes" ] ; then
... ... @@ -933,6 +933,7 @@ target_bigendian="no"
933 933 [ "$target_cpu" = "armeb" ] && target_bigendian=yes
934 934 [ "$target_cpu" = "sparc" ] && target_bigendian=yes
935 935 [ "$target_cpu" = "sparc64" ] && target_bigendian=yes
  936 +[ "$target_cpu" = "sparc32plus" ] && target_bigendian=yes
936 937 [ "$target_cpu" = "ppc" ] && target_bigendian=yes
937 938 [ "$target_cpu" = "ppcemb" ] && target_bigendian=yes
938 939 [ "$target_cpu" = "ppc64" ] && target_bigendian=yes
... ... @@ -1026,6 +1027,13 @@ elif test "$target_cpu" = "sparc64" ; then
1026 1027 echo "#define TARGET_SPARC 1" >> $config_h
1027 1028 echo "#define TARGET_SPARC64 1" >> $config_h
1028 1029 elfload32="yes"
  1030 +elif test "$target_cpu" = "sparc32plus" ; then
  1031 + echo "TARGET_ARCH=sparc64" >> $config_mak
  1032 + echo "TARGET_ABI_DIR=sparc" >> $config_mak
  1033 + echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
  1034 + echo "#define TARGET_SPARC 1" >> $config_h
  1035 + echo "#define TARGET_SPARC64 1" >> $config_h
  1036 + echo "#define TARGET_ABI32 1" >> $config_h
1029 1037 elif test "$target_cpu" = "ppc" ; then
1030 1038 echo "TARGET_ARCH=ppc" >> $config_mak
1031 1039 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
... ... @@ -1113,7 +1121,7 @@ if test "$target_darwin_user" = "yes" ; then
1113 1121 echo "#define CONFIG_DARWIN_USER 1" >> $config_h
1114 1122 fi
1115 1123  
1116   -if test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" -o "$target_cpu" = "sparc" -o "$target_cpu" = "sparc64" -o "$target_cpu" = "m68k" -o "$target_cpu" = "mips" -o "$target_cpu" = "mipsel" -o "$target_cpu" = "mipsn32" -o "$target_cpu" = "mipsn32el" -o "$target_cpu" = "mips64" -o "$target_cpu" = "mips64el"; then
  1124 +if test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" -o "$target_cpu" = "sparc" -o "$target_cpu" = "sparc64" -o "$target_cpu" = "sparc32plus" -o "$target_cpu" = "m68k" -o "$target_cpu" = "mips" -o "$target_cpu" = "mipsel" -o "$target_cpu" = "mipsn32" -o "$target_cpu" = "mipsn32el" -o "$target_cpu" = "mips64" -o "$target_cpu" = "mips64el"; then
1117 1125 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
1118 1126 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
1119 1127 fi
... ...
linux-user/alpha/syscall.h
... ... @@ -2,40 +2,40 @@
2 2 #define __USER_DS (1)
3 3  
4 4 struct target_pt_regs {
5   - target_ulong r0;
6   - target_ulong r1;
7   - target_ulong r2;
8   - target_ulong r3;
9   - target_ulong r4;
10   - target_ulong r5;
11   - target_ulong r6;
12   - target_ulong r7;
13   - target_ulong r8;
14   - target_ulong r19;
15   - target_ulong r20;
16   - target_ulong r21;
17   - target_ulong r22;
18   - target_ulong r23;
19   - target_ulong r24;
20   - target_ulong r25;
21   - target_ulong r26;
22   - target_ulong r27;
23   - target_ulong r28;
24   - target_ulong hae;
  5 + abi_ulong r0;
  6 + abi_ulong r1;
  7 + abi_ulong r2;
  8 + abi_ulong r3;
  9 + abi_ulong r4;
  10 + abi_ulong r5;
  11 + abi_ulong r6;
  12 + abi_ulong r7;
  13 + abi_ulong r8;
  14 + abi_ulong r19;
  15 + abi_ulong r20;
  16 + abi_ulong r21;
  17 + abi_ulong r22;
  18 + abi_ulong r23;
  19 + abi_ulong r24;
  20 + abi_ulong r25;
  21 + abi_ulong r26;
  22 + abi_ulong r27;
  23 + abi_ulong r28;
  24 + abi_ulong hae;
25 25 /* JRP - These are the values provided to a0-a2 by PALcode */
26   - target_ulong trap_a0;
27   - target_ulong trap_a1;
28   - target_ulong trap_a2;
  26 + abi_ulong trap_a0;
  27 + abi_ulong trap_a1;
  28 + abi_ulong trap_a2;
29 29 /* These are saved by PAL-code: */
30   - target_ulong ps;
31   - target_ulong pc;
32   - target_ulong gp;
33   - target_ulong r16;
34   - target_ulong r17;
35   - target_ulong r18;
  30 + abi_ulong ps;
  31 + abi_ulong pc;
  32 + abi_ulong gp;
  33 + abi_ulong r16;
  34 + abi_ulong r17;
  35 + abi_ulong r18;
36 36 /* Those is needed by qemu to temporary store the user stack pointer */
37   - target_ulong usp;
38   - target_ulong unique;
  37 + abi_ulong usp;
  38 + abi_ulong unique;
39 39 };
40 40  
41 41 #define UNAME_MACHINE "alpha"
... ...
linux-user/alpha/target_signal.h
... ... @@ -6,9 +6,9 @@
6 6 /* this struct defines a stack used during syscall handling */
7 7  
8 8 typedef struct target_sigaltstack {
9   - target_ulong ss_sp;
10   - target_long ss_flags;
11   - target_ulong ss_size;
  9 + abi_ulong ss_sp;
  10 + abi_long ss_flags;
  11 + abi_ulong ss_size;
12 12 } target_stack_t;
13 13  
14 14  
... ... @@ -21,7 +21,7 @@ typedef struct target_sigaltstack {
21 21 #define TARGET_MINSIGSTKSZ 4096
22 22 #define TARGET_SIGSTKSZ 16384
23 23  
24   -static inline target_ulong get_sp_from_cpustate(CPUAlphaState *state)
  24 +static inline abi_ulong get_sp_from_cpustate(CPUAlphaState *state)
25 25 {
26 26 return state->ir[IR_SP];
27 27 }
... ...
linux-user/arm/syscall.h
... ... @@ -3,7 +3,7 @@
3 3 stack during a system call. */
4 4  
5 5 struct target_pt_regs {
6   - target_long uregs[18];
  6 + abi_long uregs[18];
7 7 };
8 8  
9 9 #define ARM_cpsr uregs[16]
... ...
linux-user/arm/target_signal.h
... ... @@ -6,9 +6,9 @@
6 6 /* this struct defines a stack used during syscall handling */
7 7  
8 8 typedef struct target_sigaltstack {
9   - target_ulong ss_sp;
10   - target_long ss_flags;
11   - target_ulong ss_size;
  9 + abi_ulong ss_sp;
  10 + abi_long ss_flags;
  11 + abi_ulong ss_size;
12 12 } target_stack_t;
13 13  
14 14  
... ... @@ -21,7 +21,7 @@ typedef struct target_sigaltstack {
21 21 #define TARGET_MINSIGSTKSZ 2048
22 22 #define TARGET_SIGSTKSZ 8192
23 23  
24   -static inline target_ulong get_sp_from_cpustate(CPUARMState *state)
  24 +static inline abi_ulong get_sp_from_cpustate(CPUARMState *state)
25 25 {
26 26 return state->regs[13];
27 27 }
... ...
linux-user/cris/target_signal.h
... ... @@ -6,9 +6,9 @@
6 6 /* this struct defines a stack used during syscall handling */
7 7  
8 8 typedef struct target_sigaltstack {
9   - target_ulong ss_sp;
10   - target_ulong ss_size;
11   - target_long ss_flags;
  9 + abi_ulong ss_sp;
  10 + abi_ulong ss_size;
  11 + abi_long ss_flags;
12 12 } target_stack_t;
13 13  
14 14  
... ... @@ -21,7 +21,7 @@ typedef struct target_sigaltstack {
21 21 #define TARGET_MINSIGSTKSZ 2048
22 22 #define TARGET_SIGSTKSZ 8192
23 23  
24   -static inline target_ulong get_sp_from_cpustate(CPUCRISState *state)
  24 +static inline abi_ulong get_sp_from_cpustate(CPUCRISState *state)
25 25 {
26 26 return state->regs[14];
27 27 }
... ...
linux-user/elfload.c
... ... @@ -172,7 +172,7 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i
172 172  
173 173 static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop)
174 174 {
175   - target_long stack = infop->start_stack;
  175 + abi_long stack = infop->start_stack;
176 176 memset(regs, 0, sizeof(*regs));
177 177 regs->ARM_cpsr = 0x10;
178 178 if (infop->entry & 1)
... ... @@ -214,7 +214,11 @@ enum
214 214  
215 215 #define ELF_START_MMAP 0x80000000
216 216  
  217 +#ifndef TARGET_ABI32
217 218 #define elf_check_arch(x) ( (x) == EM_SPARCV9 || (x) == EM_SPARC32PLUS )
  219 +#else
  220 +#define elf_check_arch(x) ( (x) == EM_SPARC32PLUS || (x) == EM_SPARC )
  221 +#endif
218 222  
219 223 #define ELF_CLASS ELFCLASS64
220 224 #define ELF_DATA ELFDATA2MSB
... ... @@ -224,14 +228,20 @@ enum
224 228  
225 229 static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop)
226 230 {
  231 +#ifndef TARGET_ABI32
227 232 regs->tstate = 0;
  233 +#endif
228 234 regs->pc = infop->entry;
229 235 regs->npc = regs->pc + 4;
230 236 regs->y = 0;
  237 +#ifdef TARGET_ABI32
  238 + regs->u_regs[14] = infop->start_stack - 16 * 4;
  239 +#else
231 240 if (personality(infop->personality) == PER_LINUX32)
232 241 regs->u_regs[14] = infop->start_stack - 16 * 4;
233 242 else
234 243 regs->u_regs[14] = infop->start_stack - 16 * 8 - STACK_BIAS;
  244 +#endif
235 245 }
236 246  
237 247 #else
... ... @@ -313,10 +323,10 @@ do { \
313 323  
314 324 static inline void init_thread(struct target_pt_regs *_regs, struct image_info *infop)
315 325 {
316   - target_ulong pos = infop->start_stack;
317   - target_ulong tmp;
  326 + abi_ulong pos = infop->start_stack;
  327 + abi_ulong tmp;
318 328 #ifdef TARGET_PPC64
319   - target_ulong entry, toc;
  329 + abi_ulong entry, toc;
320 330 #endif
321 331  
322 332 _regs->msr = 1 << MSR_PR; /* Set user mode */
... ... @@ -333,9 +343,9 @@ static inline void init_thread(struct target_pt_regs *_regs, struct image_info *
333 343 * execution of PPC BSD programs.
334 344 */
335 345 _regs->gpr[3] = tgetl(pos);
336   - pos += sizeof(target_ulong);
  346 + pos += sizeof(abi_ulong);
337 347 _regs->gpr[4] = pos;
338   - for (tmp = 1; tmp != 0; pos += sizeof(target_ulong))
  348 + for (tmp = 1; tmp != 0; pos += sizeof(abi_ulong))
339 349 tmp = ldl(pos);
340 350 _regs->gpr[5] = pos;
341 351 }
... ... @@ -475,9 +485,9 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i
475 485 #define ELF_HWCAP 0
476 486 #endif
477 487  
478   -#ifdef OVERRIDE_ELF_CLASS
  488 +#ifdef TARGET_ABI32
479 489 #undef ELF_CLASS
480   -#define ELF_CLASS OVERRIDE_ELF_CLASS
  490 +#define ELF_CLASS ELFCLASS32
481 491 #undef bswaptls
482 492 #define bswaptls(ptr) bswap32s(ptr)
483 493 #endif
... ... @@ -588,8 +598,8 @@ static void bswap_sym(struct elf_sym *sym)
588 598 * to be put directly into the top of new user memory.
589 599 *
590 600 */
591   -static target_ulong copy_elf_strings(int argc,char ** argv, void **page,
592   - target_ulong p)
  601 +static abi_ulong copy_elf_strings(int argc,char ** argv, void **page,
  602 + abi_ulong p)
593 603 {
594 604 char *tmp, *tmp1, *pag = NULL;
595 605 int len, offset = 0;
... ... @@ -638,10 +648,10 @@ static target_ulong copy_elf_strings(int argc,char ** argv, void **page,
638 648 return p;
639 649 }
640 650  
641   -static target_ulong setup_arg_pages(target_ulong p, struct linux_binprm *bprm,
642   - struct image_info *info)
  651 +static abi_ulong setup_arg_pages(abi_ulong p, struct linux_binprm *bprm,
  652 + struct image_info *info)
643 653 {
644   - target_ulong stack_base, size, error;
  654 + abi_ulong stack_base, size, error;
645 655 int i;
646 656  
647 657 /* Create enough stack to hold everything. If we don't use
... ... @@ -677,7 +687,7 @@ static target_ulong setup_arg_pages(target_ulong p, struct linux_binprm *bprm,
677 687 return p;
678 688 }
679 689  
680   -static void set_brk(target_ulong start, target_ulong end)
  690 +static void set_brk(abi_ulong start, abi_ulong end)
681 691 {
682 692 /* page-align the start and end addresses... */
683 693 start = HOST_PAGE_ALIGN(start);
... ... @@ -696,9 +706,9 @@ static void set_brk(target_ulong start, target_ulong end)
696 706 /* We need to explicitly zero any fractional pages after the data
697 707 section (i.e. bss). This would contain the junk from the file that
698 708 should not be in memory. */
699   -static void padzero(target_ulong elf_bss, target_ulong last_bss)
  709 +static void padzero(abi_ulong elf_bss, abi_ulong last_bss)
700 710 {
701   - target_ulong nbyte;
  711 + abi_ulong nbyte;
702 712  
703 713 if (elf_bss >= last_bss)
704 714 return;
... ... @@ -709,7 +719,7 @@ static void padzero(target_ulong elf_bss, target_ulong last_bss)
709 719 patch target_mmap(), but it is more complicated as the file
710 720 size must be known */
711 721 if (qemu_real_host_page_size < qemu_host_page_size) {
712   - target_ulong end_addr, end_addr1;
  722 + abi_ulong end_addr, end_addr1;
713 723 end_addr1 = (elf_bss + qemu_real_host_page_size - 1) &
714 724 ~(qemu_real_host_page_size - 1);
715 725 end_addr = HOST_PAGE_ALIGN(elf_bss);
... ... @@ -731,16 +741,16 @@ static void padzero(target_ulong elf_bss, target_ulong last_bss)
731 741 }
732 742  
733 743  
734   -static target_ulong create_elf_tables(target_ulong p, int argc, int envc,
735   - struct elfhdr * exec,
736   - target_ulong load_addr,
737   - target_ulong load_bias,
738   - target_ulong interp_load_addr, int ibcs,
739   - struct image_info *info)
  744 +static abi_ulong create_elf_tables(abi_ulong p, int argc, int envc,
  745 + struct elfhdr * exec,
  746 + abi_ulong load_addr,
  747 + abi_ulong load_bias,
  748 + abi_ulong interp_load_addr, int ibcs,
  749 + struct image_info *info)
740 750 {
741   - target_ulong sp;
  751 + abi_ulong sp;
742 752 int size;
743   - target_ulong u_platform;
  753 + abi_ulong u_platform;
744 754 const char *k_platform;
745 755 const int n = sizeof(elf_addr_t);
746 756  
... ... @@ -756,7 +766,7 @@ static target_ulong create_elf_tables(target_ulong p, int argc, int envc,
756 766 /*
757 767 * Force 16 byte _final_ alignment here for generality.
758 768 */
759   - sp = sp &~ (target_ulong)15;
  769 + sp = sp &~ (abi_ulong)15;
760 770 size = (DLINFO_ITEMS + 1) * 2;
761 771 if (k_platform)
762 772 size += 2;
... ... @@ -786,18 +796,18 @@ static target_ulong create_elf_tables(target_ulong p, int argc, int envc,
786 796 NEW_AUX_ENT (AT_NULL, 0);
787 797  
788 798 /* There must be exactly DLINFO_ITEMS entries here. */
789   - NEW_AUX_ENT(AT_PHDR, (target_ulong)(load_addr + exec->e_phoff));
790   - NEW_AUX_ENT(AT_PHENT, (target_ulong)(sizeof (struct elf_phdr)));
791   - NEW_AUX_ENT(AT_PHNUM, (target_ulong)(exec->e_phnum));
792   - NEW_AUX_ENT(AT_PAGESZ, (target_ulong)(TARGET_PAGE_SIZE));
793   - NEW_AUX_ENT(AT_BASE, (target_ulong)(interp_load_addr));
794   - NEW_AUX_ENT(AT_FLAGS, (target_ulong)0);
  799 + NEW_AUX_ENT(AT_PHDR, (abi_ulong)(load_addr + exec->e_phoff));
  800 + NEW_AUX_ENT(AT_PHENT, (abi_ulong)(sizeof (struct elf_phdr)));
  801 + NEW_AUX_ENT(AT_PHNUM, (abi_ulong)(exec->e_phnum));
  802 + NEW_AUX_ENT(AT_PAGESZ, (abi_ulong)(TARGET_PAGE_SIZE));
  803 + NEW_AUX_ENT(AT_BASE, (abi_ulong)(interp_load_addr));
  804 + NEW_AUX_ENT(AT_FLAGS, (abi_ulong)0);
795 805 NEW_AUX_ENT(AT_ENTRY, load_bias + exec->e_entry);
796   - NEW_AUX_ENT(AT_UID, (target_ulong) getuid());
797   - NEW_AUX_ENT(AT_EUID, (target_ulong) geteuid());
798   - NEW_AUX_ENT(AT_GID, (target_ulong) getgid());
799   - NEW_AUX_ENT(AT_EGID, (target_ulong) getegid());
800   - NEW_AUX_ENT(AT_HWCAP, (target_ulong) ELF_HWCAP);
  806 + NEW_AUX_ENT(AT_UID, (abi_ulong) getuid());
  807 + NEW_AUX_ENT(AT_EUID, (abi_ulong) geteuid());
  808 + NEW_AUX_ENT(AT_GID, (abi_ulong) getgid());
  809 + NEW_AUX_ENT(AT_EGID, (abi_ulong) getegid());
  810 + NEW_AUX_ENT(AT_HWCAP, (abi_ulong) ELF_HWCAP);
801 811 if (k_platform)
802 812 NEW_AUX_ENT(AT_PLATFORM, u_platform);
803 813 #ifdef ARCH_DLINFO
... ... @@ -814,17 +824,17 @@ static target_ulong create_elf_tables(target_ulong p, int argc, int envc,
814 824 }
815 825  
816 826  
817   -static target_ulong load_elf_interp(struct elfhdr * interp_elf_ex,
818   - int interpreter_fd,
819   - target_ulong *interp_load_addr)
  827 +static abi_ulong load_elf_interp(struct elfhdr * interp_elf_ex,
  828 + int interpreter_fd,
  829 + abi_ulong *interp_load_addr)
820 830 {
821 831 struct elf_phdr *elf_phdata = NULL;
822 832 struct elf_phdr *eppnt;
823   - target_ulong load_addr = 0;
  833 + abi_ulong load_addr = 0;
824 834 int load_addr_set = 0;
825 835 int retval;
826   - target_ulong last_bss, elf_bss;
827   - target_ulong error;
  836 + abi_ulong last_bss, elf_bss;
  837 + abi_ulong error;
828 838 int i;
829 839  
830 840 elf_bss = 0;
... ... @@ -838,20 +848,20 @@ static target_ulong load_elf_interp(struct elfhdr * interp_elf_ex,
838 848 if ((interp_elf_ex->e_type != ET_EXEC &&
839 849 interp_elf_ex->e_type != ET_DYN) ||
840 850 !elf_check_arch(interp_elf_ex->e_machine)) {
841   - return ~((target_ulong)0UL);
  851 + return ~((abi_ulong)0UL);
842 852 }
843 853  
844 854  
845 855 /* Now read in all of the header information */
846 856  
847 857 if (sizeof(struct elf_phdr) * interp_elf_ex->e_phnum > TARGET_PAGE_SIZE)
848   - return ~(target_ulong)0UL;
  858 + return ~(abi_ulong)0UL;
849 859  
850 860 elf_phdata = (struct elf_phdr *)
851 861 malloc(sizeof(struct elf_phdr) * interp_elf_ex->e_phnum);
852 862  
853 863 if (!elf_phdata)
854   - return ~((target_ulong)0UL);
  864 + return ~((abi_ulong)0UL);
855 865  
856 866 /*
857 867 * If the size of this structure has changed, then punt, since
... ... @@ -859,7 +869,7 @@ static target_ulong load_elf_interp(struct elfhdr * interp_elf_ex,
859 869 */
860 870 if (interp_elf_ex->e_phentsize != sizeof(struct elf_phdr)) {
861 871 free(elf_phdata);
862   - return ~((target_ulong)0UL);
  872 + return ~((abi_ulong)0UL);
863 873 }
864 874  
865 875 retval = lseek(interpreter_fd, interp_elf_ex->e_phoff, SEEK_SET);
... ... @@ -900,8 +910,8 @@ static target_ulong load_elf_interp(struct elfhdr * interp_elf_ex,
900 910 if (eppnt->p_type == PT_LOAD) {
901 911 int elf_type = MAP_PRIVATE | MAP_DENYWRITE;
902 912 int elf_prot = 0;
903   - target_ulong vaddr = 0;
904   - target_ulong k;
  913 + abi_ulong vaddr = 0;
  914 + abi_ulong k;
905 915  
906 916 if (eppnt->p_flags & PF_R) elf_prot = PROT_READ;
907 917 if (eppnt->p_flags & PF_W) elf_prot |= PROT_WRITE;
... ... @@ -921,7 +931,7 @@ static target_ulong load_elf_interp(struct elfhdr * interp_elf_ex,
921 931 /* Real error */
922 932 close(interpreter_fd);
923 933 free(elf_phdata);
924   - return ~((target_ulong)0UL);
  934 + return ~((abi_ulong)0UL);
925 935 }
926 936  
927 937 if (!load_addr_set && interp_elf_ex->e_type == ET_DYN) {
... ... @@ -966,7 +976,7 @@ static target_ulong load_elf_interp(struct elfhdr * interp_elf_ex,
966 976 free(elf_phdata);
967 977  
968 978 *interp_load_addr = load_addr;
969   - return ((target_ulong) interp_elf_ex->e_entry) + load_addr;
  979 + return ((abi_ulong) interp_elf_ex->e_entry) + load_addr;
970 980 }
971 981  
972 982 /* Best attempt to load symbols from this ELF object. */
... ... @@ -1054,22 +1064,22 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs,
1054 1064 struct elfhdr interp_elf_ex;
1055 1065 struct exec interp_ex;
1056 1066 int interpreter_fd = -1; /* avoid warning */
1057   - target_ulong load_addr, load_bias;
  1067 + abi_ulong load_addr, load_bias;
1058 1068 int load_addr_set = 0;
1059 1069 unsigned int interpreter_type = INTERPRETER_NONE;
1060 1070 unsigned char ibcs2_interpreter;
1061 1071 int i;
1062   - target_ulong mapped_addr;
  1072 + abi_ulong mapped_addr;
1063 1073 struct elf_phdr * elf_ppnt;
1064 1074 struct elf_phdr *elf_phdata;
1065   - target_ulong elf_bss, k, elf_brk;
  1075 + abi_ulong elf_bss, k, elf_brk;
1066 1076 int retval;
1067 1077 char * elf_interpreter;
1068   - target_ulong elf_entry, interp_load_addr = 0;
  1078 + abi_ulong elf_entry, interp_load_addr = 0;
1069 1079 int status;
1070   - target_ulong start_code, end_code, start_data, end_data;
1071   - target_ulong reloc_func_desc = 0;
1072   - target_ulong elf_stack;
  1080 + abi_ulong start_code, end_code, start_data, end_data;
  1081 + abi_ulong reloc_func_desc = 0;
  1082 + abi_ulong elf_stack;
1073 1083 char passed_fileno[6];
1074 1084  
1075 1085 ibcs2_interpreter = 0;
... ... @@ -1125,9 +1135,9 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs,
1125 1135 elf_brk = 0;
1126 1136  
1127 1137  
1128   - elf_stack = ~((target_ulong)0UL);
  1138 + elf_stack = ~((abi_ulong)0UL);
1129 1139 elf_interpreter = NULL;
1130   - start_code = ~((target_ulong)0UL);
  1140 + start_code = ~((abi_ulong)0UL);
1131 1141 end_code = 0;
1132 1142 start_data = 0;
1133 1143 end_data = 0;
... ... @@ -1263,9 +1273,9 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs,
1263 1273 /* OK, This is the point of no return */
1264 1274 info->end_data = 0;
1265 1275 info->end_code = 0;
1266   - info->start_mmap = (target_ulong)ELF_START_MMAP;
  1276 + info->start_mmap = (abi_ulong)ELF_START_MMAP;
1267 1277 info->mmap = 0;
1268   - elf_entry = (target_ulong) elf_ex.e_entry;
  1278 + elf_entry = (abi_ulong) elf_ex.e_entry;
1269 1279  
1270 1280 /* Do this so that we can load the interpreter, if need be. We will
1271 1281 change some of these later */
... ... @@ -1282,7 +1292,7 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs,
1282 1292 for(i = 0, elf_ppnt = elf_phdata; i < elf_ex.e_phnum; i++, elf_ppnt++) {
1283 1293 int elf_prot = 0;
1284 1294 int elf_flags = 0;
1285   - target_ulong error;
  1295 + abi_ulong error;
1286 1296  
1287 1297 if (elf_ppnt->p_type != PT_LOAD)
1288 1298 continue;
... ... @@ -1374,7 +1384,7 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs,
1374 1384 close(interpreter_fd);
1375 1385 free(elf_interpreter);
1376 1386  
1377   - if (elf_entry == ~((target_ulong)0UL)) {
  1387 + if (elf_entry == ~((abi_ulong)0UL)) {
1378 1388 printf("Unable to load interpreter\n");
1379 1389 free(elf_phdata);
1380 1390 exit(-1);
... ...
linux-user/elfload32.c
1   -#define OVERRIDE_ELF_CLASS ELFCLASS32
  1 +#define TARGET_ABI32
2 2 #define load_elf_binary load_elf_binary32
3 3 #define do_init_thread do_init_thread32
4 4  
... ...
linux-user/flat.h
... ... @@ -22,25 +22,25 @@
22 22  
23 23 struct flat_hdr {
24 24 char magic[4];
25   - target_ulong rev; /* version (as above) */
26   - target_ulong entry; /* Offset of first executable instruction
27   - with text segment from beginning of file */
28   - target_ulong data_start; /* Offset of data segment from beginning of
29   - file */
30   - target_ulong data_end; /* Offset of end of data segment
31   - from beginning of file */
32   - target_ulong bss_end; /* Offset of end of bss segment from beginning
33   - of file */
  25 + abi_ulong rev; /* version (as above) */
  26 + abi_ulong entry; /* Offset of first executable instruction
  27 + with text segment from beginning of file */
  28 + abi_ulong data_start; /* Offset of data segment from beginning of
  29 + file */
  30 + abi_ulong data_end; /* Offset of end of data segment
  31 + from beginning of file */
  32 + abi_ulong bss_end; /* Offset of end of bss segment from beginning
  33 + of file */
34 34  
35 35 /* (It is assumed that data_end through bss_end forms the bss segment.) */
36 36  
37   - target_ulong stack_size; /* Size of stack, in bytes */
38   - target_ulong reloc_start; /* Offset of relocation records from
39   - beginning of file */
40   - target_ulong reloc_count; /* Number of relocation records */
41   - target_ulong flags;
42   - target_ulong build_date; /* When the program/library was built */
43   - target_ulong filler[5]; /* Reservered, set to zero */
  37 + abi_ulong stack_size; /* Size of stack, in bytes */
  38 + abi_ulong reloc_start; /* Offset of relocation records from
  39 + beginning of file */
  40 + abi_ulong reloc_count; /* Number of relocation records */
  41 + abi_ulong flags;
  42 + abi_ulong build_date; /* When the program/library was built */
  43 + abi_ulong filler[5]; /* Reservered, set to zero */
44 44 };
45 45  
46 46 #define FLAT_FLAG_RAM 0x0001 /* load program entirely into RAM */
... ...
linux-user/flatload.c
... ... @@ -63,13 +63,13 @@
63 63 #define UNLOADED_LIB 0x7ff000ff /* Placeholder for unused library */
64 64  
65 65 struct lib_info {
66   - target_ulong start_code; /* Start of text segment */
67   - target_ulong start_data; /* Start of data segment */
68   - target_ulong end_data; /* Start of bss section */
69   - target_ulong start_brk; /* End of data segment */
70   - target_ulong text_len; /* Length of text segment */
71   - target_ulong entry; /* Start address for this module */
72   - target_ulong build_date; /* When this one was compiled */
  66 + abi_ulong start_code; /* Start of text segment */
  67 + abi_ulong start_data; /* Start of data segment */
  68 + abi_ulong end_data; /* Start of bss section */
  69 + abi_ulong start_brk; /* End of data segment */
  70 + abi_ulong text_len; /* Length of text segment */
  71 + abi_ulong entry; /* Start address for this module */
  72 + abi_ulong build_date; /* When this one was compiled */
73 73 short loaded; /* Has this library been loaded? */
74 74 };
75 75  
... ... @@ -89,7 +89,7 @@ struct linux_binprm;
89 89 */
90 90  
91 91 /* Push a block of strings onto the guest stack. */
92   -static target_ulong copy_strings(target_ulong p, int n, char **s)
  92 +static abi_ulong copy_strings(abi_ulong p, int n, char **s)
93 93 {
94 94 int len;
95 95  
... ... @@ -102,8 +102,8 @@ static target_ulong copy_strings(target_ulong p, int n, char **s)
102 102 return p;
103 103 }
104 104  
105   -int target_pread(int fd, target_ulong ptr, target_ulong len,
106   - target_ulong offset)
  105 +int target_pread(int fd, abi_ulong ptr, abi_ulong len,
  106 + abi_ulong offset)
107 107 {
108 108 void *buf;
109 109 int ret;
... ... @@ -262,15 +262,15 @@ out:
262 262  
263 263 /****************************************************************************/
264 264  
265   -static target_ulong
266   -calc_reloc(target_ulong r, struct lib_info *p, int curid, int internalp)
  265 +static abi_ulong
  266 +calc_reloc(abi_ulong r, struct lib_info *p, int curid, int internalp)
267 267 {
268   - target_ulong addr;
  268 + abi_ulong addr;
269 269 int id;
270   - target_ulong start_brk;
271   - target_ulong start_data;
272   - target_ulong text_len;
273   - target_ulong start_code;
  270 + abi_ulong start_brk;
  271 + abi_ulong start_data;
  272 + abi_ulong text_len;
  273 + abi_ulong start_code;
274 274  
275 275 #ifdef CONFIG_BINFMT_SHARED_FLAT
276 276 #error needs checking
... ... @@ -381,19 +381,19 @@ void old_reloc(struct lib_info *libinfo, uint32_t rl)
381 381 /****************************************************************************/
382 382  
383 383 static int load_flat_file(struct linux_binprm * bprm,
384   - struct lib_info *libinfo, int id, target_ulong *extra_stack)
  384 + struct lib_info *libinfo, int id, abi_ulong *extra_stack)
385 385 {
386 386 struct flat_hdr * hdr;
387   - target_ulong textpos = 0, datapos = 0, result;
388   - target_ulong realdatastart = 0;
389   - target_ulong text_len, data_len, bss_len, stack_len, flags;
390   - target_ulong memp = 0; /* for finding the brk area */
391   - target_ulong extra;
392   - target_ulong reloc = 0, rp;
  387 + abi_ulong textpos = 0, datapos = 0, result;
  388 + abi_ulong realdatastart = 0;
  389 + abi_ulong text_len, data_len, bss_len, stack_len, flags;
  390 + abi_ulong memp = 0; /* for finding the brk area */
  391 + abi_ulong extra;
  392 + abi_ulong reloc = 0, rp;
393 393 int i, rev, relocs = 0;
394   - target_ulong fpos;
395   - target_ulong start_code, end_code;
396   - target_ulong indx_len;
  394 + abi_ulong fpos;
  395 + abi_ulong start_code, end_code;
  396 + abi_ulong indx_len;
397 397  
398 398 hdr = ((struct flat_hdr *) bprm->buf); /* exec-header */
399 399  
... ... @@ -440,14 +440,14 @@ static int load_flat_file(struct linux_binprm * bprm,
440 440 /*
441 441 * calculate the extra space we need to map in
442 442 */
443   - extra = relocs * sizeof(target_ulong);
  443 + extra = relocs * sizeof(abi_ulong);
444 444 if (extra < bss_len + stack_len)
445 445 extra = bss_len + stack_len;
446 446  
447 447 /* Add space for library base pointers. Make sure this does not
448 448 misalign the doesn't misalign the data segment. */
449   - indx_len = MAX_SHARED_LIBS * sizeof(target_ulong);
450   - indx_len = (indx_len + 15) & ~(target_ulong)15;
  449 + indx_len = MAX_SHARED_LIBS * sizeof(abi_ulong);
  450 + indx_len = (indx_len + 15) & ~(abi_ulong)15;
451 451  
452 452 /*
453 453 * there are a couple of cases here, the separate code/data
... ... @@ -485,12 +485,12 @@ static int load_flat_file(struct linux_binprm * bprm,
485 485 #ifdef CONFIG_BINFMT_ZFLAT
486 486 if (flags & FLAT_FLAG_GZDATA) {
487 487 result = decompress_exec(bprm, fpos, (char *) datapos,
488   - data_len + (relocs * sizeof(target_ulong)))
  488 + data_len + (relocs * sizeof(abi_ulong)))
489 489 } else
490 490 #endif
491 491 {
492 492 result = target_pread(bprm->fd, datapos,
493   - data_len + (relocs * sizeof(target_ulong)),
  493 + data_len + (relocs * sizeof(abi_ulong)),
494 494 fpos);
495 495 }
496 496 if (result < 0) {
... ... @@ -544,7 +544,7 @@ static int load_flat_file(struct linux_binprm * bprm,
544 544 text_len, 0);
545 545 if (result >= 0) {
546 546 result = target_pread(bprm->fd, datapos,
547   - data_len + (relocs * sizeof(target_ulong)),
  547 + data_len + (relocs * sizeof(abi_ulong)),
548 548 ntohl(hdr->data_start));
549 549 }
550 550 }
... ... @@ -597,7 +597,7 @@ static int load_flat_file(struct linux_binprm * bprm,
597 597 if (flags & FLAT_FLAG_GOTPIC) {
598 598 rp = datapos;
599 599 while (1) {
600   - target_ulong addr;
  600 + abi_ulong addr;
601 601 addr = tgetl(rp);
602 602 if (addr == -1)
603 603 break;
... ... @@ -607,7 +607,7 @@ static int load_flat_file(struct linux_binprm * bprm,
607 607 return -ENOEXEC;
608 608 tputl(rp, addr);
609 609 }
610   - rp += sizeof(target_ulong);
  610 + rp += sizeof(abi_ulong);
611 611 }
612 612 }
613 613  
... ... @@ -624,12 +624,12 @@ static int load_flat_file(struct linux_binprm * bprm,
624 624 */
625 625 if (rev > OLD_FLAT_VERSION) {
626 626 for (i = 0; i < relocs; i++) {
627   - target_ulong addr, relval;
  627 + abi_ulong addr, relval;
628 628  
629 629 /* Get the address of the pointer to be
630 630 relocated (of course, the address has to be
631 631 relocated first). */
632   - relval = tgetl(reloc + i * sizeof (target_ulong));
  632 + relval = tgetl(reloc + i * sizeof (abi_ulong));
633 633 addr = flat_get_relocate_addr(relval);
634 634 rp = calc_reloc(addr, libinfo, id, 1);
635 635 if (rp == RELOC_FAILED)
... ... @@ -657,8 +657,8 @@ static int load_flat_file(struct linux_binprm * bprm,
657 657 }
658 658 } else {
659 659 for (i = 0; i < relocs; i++) {
660   - target_ulong relval;
661   - relval = tgetl(reloc + i * sizeof (target_ulong));
  660 + abi_ulong relval;
  661 + relval = tgetl(reloc + i * sizeof (abi_ulong));
662 662 old_reloc(&libinfo[0], relval);
663 663 }
664 664 }
... ... @@ -712,10 +712,10 @@ int load_flt_binary(struct linux_binprm * bprm, struct target_pt_regs * regs,
712 712 struct image_info * info)
713 713 {
714 714 struct lib_info libinfo[MAX_SHARED_LIBS];
715   - target_ulong p = bprm->p;
716   - target_ulong stack_len;
717   - target_ulong start_addr;
718   - target_ulong sp;
  715 + abi_ulong p = bprm->p;
  716 + abi_ulong stack_len;
  717 + abi_ulong start_addr;
  718 + abi_ulong sp;
719 719 int res;
720 720 int i, j;
721 721  
... ... @@ -740,7 +740,7 @@ int load_flt_binary(struct linux_binprm * bprm, struct target_pt_regs * regs,
740 740 /* Update data segment pointers for all libraries */
741 741 for (i=0; i<MAX_SHARED_LIBS; i++) {
742 742 if (libinfo[i].loaded) {
743   - target_ulong p;
  743 + abi_ulong p;
744 744 p = libinfo[i].start_data;
745 745 for (j=0; j<MAX_SHARED_LIBS; j++) {
746 746 p -= 4;
... ... @@ -758,12 +758,12 @@ int load_flt_binary(struct linux_binprm * bprm, struct target_pt_regs * regs,
758 758 p = copy_strings(p, bprm->envc, bprm->envp);
759 759 p = copy_strings(p, bprm->argc, bprm->argv);
760 760 /* Align stack. */
761   - sp = p & ~(target_ulong)(sizeof(target_ulong) - 1);
  761 + sp = p & ~(abi_ulong)(sizeof(abi_ulong) - 1);
762 762 /* Enforce final stack alignment of 16 bytes. This is sufficient
763 763 for all current targets, and excess alignment is harmless. */
764 764 stack_len = bprm->envc + bprm->argc + 2;
765 765 stack_len += 3; /* argc, arvg, argp */
766   - stack_len *= sizeof(target_ulong);
  766 + stack_len *= sizeof(abi_ulong);
767 767 if ((sp + stack_len) & 15)
768 768 sp -= 16 - ((sp + stack_len) & 15);
769 769 sp = loader_build_argptr(bprm->envc, bprm->argc, sp, p, 1);
... ...
linux-user/i386/syscall.h
... ... @@ -31,7 +31,7 @@ struct target_pt_regs {
31 31  
32 32 struct target_modify_ldt_ldt_s {
33 33 unsigned int entry_number;
34   - target_ulong base_addr;
  34 + abi_ulong base_addr;
35 35 unsigned int limit;
36 36 unsigned int flags;
37 37 };
... ... @@ -79,22 +79,22 @@ struct target_vm86_regs {
79 79 /*
80 80 * normal regs, with special meaning for the segment descriptors..
81 81 */
82   - target_long ebx;
83   - target_long ecx;
84   - target_long edx;
85   - target_long esi;
86   - target_long edi;
87   - target_long ebp;
88   - target_long eax;
89   - target_long __null_ds;
90   - target_long __null_es;
91   - target_long __null_fs;
92   - target_long __null_gs;
93   - target_long orig_eax;
94   - target_long eip;
  82 + abi_long ebx;
  83 + abi_long ecx;
  84 + abi_long edx;
  85 + abi_long esi;
  86 + abi_long edi;
  87 + abi_long ebp;
  88 + abi_long eax;
  89 + abi_long __null_ds;
  90 + abi_long __null_es;
  91 + abi_long __null_fs;
  92 + abi_long __null_gs;
  93 + abi_long orig_eax;
  94 + abi_long eip;
95 95 unsigned short cs, __csh;
96   - target_long eflags;
97   - target_long esp;
  96 + abi_long eflags;
  97 + abi_long esp;
98 98 unsigned short ss, __ssh;
99 99 /*
100 100 * these are specific to v86 mode:
... ... @@ -106,14 +106,14 @@ struct target_vm86_regs {
106 106 };
107 107  
108 108 struct target_revectored_struct {
109   - target_ulong __map[8]; /* 256 bits */
  109 + abi_ulong __map[8]; /* 256 bits */
110 110 };
111 111  
112 112 struct target_vm86_struct {
113 113 struct target_vm86_regs regs;
114   - target_ulong flags;
115   - target_ulong screen_bitmap;
116   - target_ulong cpu_type;
  114 + abi_ulong flags;
  115 + abi_ulong screen_bitmap;
  116 + abi_ulong cpu_type;
117 117 struct target_revectored_struct int_revectored;
118 118 struct target_revectored_struct int21_revectored;
119 119 };
... ... @@ -124,7 +124,7 @@ struct target_vm86_struct {
124 124 #define TARGET_VM86_SCREEN_BITMAP 0x0001
125 125  
126 126 struct target_vm86plus_info_struct {
127   - target_ulong flags;
  127 + abi_ulong flags;
128 128 #define TARGET_force_return_for_pic (1 << 0)
129 129 #define TARGET_vm86dbg_active (1 << 1) /* for debugger */
130 130 #define TARGET_vm86dbg_TFpendig (1 << 2) /* for debugger */
... ... @@ -134,9 +134,9 @@ struct target_vm86plus_info_struct {
134 134  
135 135 struct target_vm86plus_struct {
136 136 struct target_vm86_regs regs;
137   - target_ulong flags;
138   - target_ulong screen_bitmap;
139   - target_ulong cpu_type;
  137 + abi_ulong flags;
  138 + abi_ulong screen_bitmap;
  139 + abi_ulong cpu_type;
140 140 struct target_revectored_struct int_revectored;
141 141 struct target_revectored_struct int21_revectored;
142 142 struct target_vm86plus_info_struct vm86plus;
... ...
linux-user/i386/target_signal.h
... ... @@ -6,9 +6,9 @@
6 6 /* this struct defines a stack used during syscall handling */
7 7  
8 8 typedef struct target_sigaltstack {
9   - target_ulong ss_sp;
10   - target_long ss_flags;
11   - target_ulong ss_size;
  9 + abi_ulong ss_sp;
  10 + abi_long ss_flags;
  11 + abi_ulong ss_size;
12 12 } target_stack_t;
13 13  
14 14  
... ... @@ -21,7 +21,7 @@ typedef struct target_sigaltstack {
21 21 #define TARGET_MINSIGSTKSZ 2048
22 22 #define TARGET_SIGSTKSZ 8192
23 23  
24   -static inline target_ulong get_sp_from_cpustate(CPUX86State *state)
  24 +static inline abi_ulong get_sp_from_cpustate(CPUX86State *state)
25 25 {
26 26 return state->regs[R_ESP];
27 27 }
... ...
linux-user/linuxload.c
... ... @@ -13,7 +13,7 @@
13 13 #define NGROUPS 32
14 14  
15 15 /* ??? This should really be somewhere else. */
16   -void memcpy_to_target(target_ulong dest, const void *src,
  16 +void memcpy_to_target(abi_ulong dest, const void *src,
17 17 unsigned long len)
18 18 {
19 19 void *host_ptr;
... ... @@ -109,12 +109,12 @@ static int prepare_binprm(struct linux_binprm *bprm)
109 109 }
110 110  
111 111 /* Construct the envp and argv tables on the target stack. */
112   -target_ulong loader_build_argptr(int envc, int argc, target_ulong sp,
113   - target_ulong stringp, int push_ptr)
  112 +abi_ulong loader_build_argptr(int envc, int argc, abi_ulong sp,
  113 + abi_ulong stringp, int push_ptr)
114 114 {
115   - int n = sizeof(target_ulong);
116   - target_ulong envp;
117   - target_ulong argv;
  115 + int n = sizeof(abi_ulong);
  116 + abi_ulong envp;
  117 + abi_ulong argv;
118 118  
119 119 sp -= (envc + 1) * n;
120 120 envp = sp;
... ...
linux-user/m68k/syscall.h
... ... @@ -3,14 +3,14 @@
3 3 stack during a system call. */
4 4  
5 5 struct target_pt_regs {
6   - target_long d1, d2, d3, d4, d5, d6, d7;
7   - target_long a0, a1, a2, a3, a4, a5, a6;
8   - target_ulong d0;
9   - target_ulong usp;
10   - target_ulong orig_d0;
  6 + abi_long d1, d2, d3, d4, d5, d6, d7;
  7 + abi_long a0, a1, a2, a3, a4, a5, a6;
  8 + abi_ulong d0;
  9 + abi_ulong usp;
  10 + abi_ulong orig_d0;
11 11 int16_t stkadj;
12 12 uint16_t sr;
13   - target_ulong pc;
  13 + abi_ulong pc;
14 14 uint16_t fntvex;
15 15 uint16_t __fill;
16 16 };
... ...
linux-user/m68k/target_signal.h
... ... @@ -6,9 +6,9 @@
6 6 /* this struct defines a stack used during syscall handling */
7 7  
8 8 typedef struct target_sigaltstack {
9   - target_ulong ss_sp;
10   - target_long ss_flags;
11   - target_ulong ss_size;
  9 + abi_ulong ss_sp;
  10 + abi_long ss_flags;
  11 + abi_ulong ss_size;
12 12 } target_stack_t;
13 13  
14 14  
... ...
linux-user/main.c
... ... @@ -168,7 +168,7 @@ static void set_idt(int n, unsigned int dpl)
168 168 void cpu_loop(CPUX86State *env)
169 169 {
170 170 int trapnr;
171   - target_ulong pc;
  171 + abi_ulong pc;
172 172 target_siginfo_t info;
173 173  
174 174 for(;;) {
... ... @@ -305,11 +305,11 @@ void cpu_loop(CPUX86State *env)
305 305 #ifdef TARGET_ARM
306 306  
307 307 /* XXX: find a better solution */
308   -extern void tb_invalidate_page_range(target_ulong start, target_ulong end);
  308 +extern void tb_invalidate_page_range(abi_ulong start, abi_ulong end);
309 309  
310   -static void arm_cache_flush(target_ulong start, target_ulong last)
  310 +static void arm_cache_flush(abi_ulong start, abi_ulong last)
311 311 {
312   - target_ulong addr, last1;
  312 + abi_ulong addr, last1;
313 313  
314 314 if (last < start)
315 315 return;
... ... @@ -474,7 +474,7 @@ static inline int get_reg_index(CPUSPARCState *env, int cwp, int index)
474 474 static inline void save_window_offset(CPUSPARCState *env, int cwp1)
475 475 {
476 476 unsigned int i;
477   - target_ulong sp_ptr;
  477 + abi_ulong sp_ptr;
478 478  
479 479 sp_ptr = env->regbase[get_reg_index(env, cwp1, 6)];
480 480 #if defined(DEBUG_WIN)
... ... @@ -483,7 +483,7 @@ static inline void save_window_offset(CPUSPARCState *env, int cwp1)
483 483 #endif
484 484 for(i = 0; i < 16; i++) {
485 485 tputl(sp_ptr, env->regbase[get_reg_index(env, cwp1, 8 + i)]);
486   - sp_ptr += sizeof(target_ulong);
  486 + sp_ptr += sizeof(abi_ulong);
487 487 }
488 488 }
489 489  
... ... @@ -505,7 +505,7 @@ static void save_window(CPUSPARCState *env)
505 505 static void restore_window(CPUSPARCState *env)
506 506 {
507 507 unsigned int new_wim, i, cwp1;
508   - target_ulong sp_ptr;
  508 + abi_ulong sp_ptr;
509 509  
510 510 new_wim = ((env->wim << 1) | (env->wim >> (NWINDOWS - 1))) &
511 511 ((1LL << NWINDOWS) - 1);
... ... @@ -519,7 +519,7 @@ static void restore_window(CPUSPARCState *env)
519 519 #endif
520 520 for(i = 0; i < 16; i++) {
521 521 env->regbase[get_reg_index(env, cwp1, 8 + i)] = tgetl(sp_ptr);
522   - sp_ptr += sizeof(target_ulong);
  522 + sp_ptr += sizeof(abi_ulong);
523 523 }
524 524 env->wim = new_wim;
525 525 #ifdef TARGET_SPARC64
... ... @@ -572,14 +572,14 @@ void cpu_loop (CPUSPARCState *env)
572 572 env->regwptr[2], env->regwptr[3],
573 573 env->regwptr[4], env->regwptr[5]);
574 574 if ((unsigned int)ret >= (unsigned int)(-515)) {
575   -#ifdef TARGET_SPARC64
  575 +#if defined(TARGET_SPARC64) && !defined(TARGET_ABI32)
576 576 env->xcc |= PSR_CARRY;
577 577 #else
578 578 env->psr |= PSR_CARRY;
579 579 #endif
580 580 ret = -ret;
581 581 } else {
582   -#ifdef TARGET_SPARC64
  582 +#if defined(TARGET_SPARC64) && !defined(TARGET_ABI32)
583 583 env->xcc &= ~PSR_CARRY;
584 584 #else
585 585 env->psr &= ~PSR_CARRY;
... ... @@ -591,6 +591,9 @@ void cpu_loop (CPUSPARCState *env)
591 591 env->npc = env->npc + 4;
592 592 break;
593 593 case 0x83: /* flush windows */
  594 +#ifdef TARGET_ABI32
  595 + case 0x103:
  596 +#endif
594 597 flush_windows(env);
595 598 /* next instruction */
596 599 env->pc = env->npc;
... ... @@ -1489,8 +1492,8 @@ void cpu_loop(CPUMIPSState *env)
1489 1492 ret = -ENOSYS;
1490 1493 } else {
1491 1494 int nb_args;
1492   - target_ulong sp_reg;
1493   - target_ulong arg5 = 0, arg6 = 0, arg7 = 0, arg8 = 0;
  1495 + abi_ulong sp_reg;
  1496 + abi_ulong arg5 = 0, arg6 = 0, arg7 = 0, arg8 = 0;
1494 1497  
1495 1498 nb_args = mips_syscall_args[syscall_num];
1496 1499 sp_reg = env->gpr[29][env->current_tc];
... ... @@ -2239,7 +2242,7 @@ int main(int argc, char **argv)
2239 2242 int i;
2240 2243  
2241 2244 for(i = 0; i < 28; i++) {
2242   - env->ir[i] = ((target_ulong *)regs)[i];
  2245 + env->ir[i] = ((abi_ulong *)regs)[i];
2243 2246 }
2244 2247 env->ipr[IPR_USP] = regs->usp;
2245 2248 env->ir[30] = regs->usp;
... ...
linux-user/mips/syscall.h
... ... @@ -4,18 +4,18 @@
4 4  
5 5 struct target_pt_regs {
6 6 /* Pad bytes for argument save space on the stack. */
7   - target_ulong pad0[6];
  7 + abi_ulong pad0[6];
8 8  
9 9 /* Saved main processor registers. */
10   - target_ulong regs[32];
  10 + abi_ulong regs[32];
11 11  
12 12 /* Saved special registers. */
13   - target_ulong cp0_status;
14   - target_ulong lo;
15   - target_ulong hi;
16   - target_ulong cp0_badvaddr;
17   - target_ulong cp0_cause;
18   - target_ulong cp0_epc;
  13 + abi_ulong cp0_status;
  14 + abi_ulong lo;
  15 + abi_ulong hi;
  16 + abi_ulong cp0_badvaddr;
  17 + abi_ulong cp0_cause;
  18 + abi_ulong cp0_epc;
19 19 };
20 20  
21 21 /* Target errno definitions taken from asm-mips/errno.h */
... ...
linux-user/mips/target_signal.h
... ... @@ -6,9 +6,9 @@
6 6 /* this struct defines a stack used during syscall handling */
7 7  
8 8 typedef struct target_sigaltstack {
9   - target_long ss_sp;
10   - target_ulong ss_size;
11   - target_long ss_flags;
  9 + abi_long ss_sp;
  10 + abi_ulong ss_size;
  11 + abi_long ss_flags;
12 12 } target_stack_t;
13 13  
14 14  
... ... @@ -21,7 +21,7 @@ typedef struct target_sigaltstack {
21 21 #define TARGET_MINSIGSTKSZ 2048
22 22 #define TARGET_SIGSTKSZ 8192
23 23  
24   -static inline target_ulong get_sp_from_cpustate(CPUMIPSState *state)
  24 +static inline abi_ulong get_sp_from_cpustate(CPUMIPSState *state)
25 25 {
26 26 return state->gpr[29][state->current_tc];
27 27 }
... ...
linux-user/mips64/syscall.h
... ... @@ -4,15 +4,15 @@
4 4  
5 5 struct target_pt_regs {
6 6 /* Saved main processor registers. */
7   - target_ulong regs[32];
  7 + abi_ulong regs[32];
8 8  
9 9 /* Saved special registers. */
10   - target_ulong cp0_status;
11   - target_ulong lo;
12   - target_ulong hi;
13   - target_ulong cp0_badvaddr;
14   - target_ulong cp0_cause;
15   - target_ulong cp0_epc;
  10 + abi_ulong cp0_status;
  11 + abi_ulong lo;
  12 + abi_ulong hi;
  13 + abi_ulong cp0_badvaddr;
  14 + abi_ulong cp0_cause;
  15 + abi_ulong cp0_epc;
16 16 };
17 17  
18 18 /* Target errno definitions taken from asm-mips/errno.h */
... ...
linux-user/mips64/target_signal.h
... ... @@ -6,9 +6,9 @@
6 6 /* this struct defines a stack used during syscall handling */
7 7  
8 8 typedef struct target_sigaltstack {
9   - target_long ss_sp;
10   - target_ulong ss_size;
11   - target_long ss_flags;
  9 + abi_long ss_sp;
  10 + abi_ulong ss_size;
  11 + abi_long ss_flags;
12 12 } target_stack_t;
13 13  
14 14  
... ... @@ -21,7 +21,7 @@ typedef struct target_sigaltstack {
21 21 #define TARGET_MINSIGSTKSZ 2048
22 22 #define TARGET_SIGSTKSZ 8192
23 23  
24   -static inline target_ulong get_sp_from_cpustate(CPUMIPSState *state)
  24 +static inline abi_ulong get_sp_from_cpustate(CPUMIPSState *state)
25 25 {
26 26 return state->gpr[29][state->current_tc];
27 27 }
... ...
linux-user/mmap.c
... ... @@ -30,9 +30,9 @@
30 30 //#define DEBUG_MMAP
31 31  
32 32 /* NOTE: all the constants are the HOST ones, but addresses are target. */
33   -int target_mprotect(target_ulong start, target_ulong len, int prot)
  33 +int target_mprotect(abi_ulong start, abi_ulong len, int prot)
34 34 {
35   - target_ulong end, host_start, host_end, addr;
  35 + abi_ulong end, host_start, host_end, addr;
36 36 int prot1, ret;
37 37  
38 38 #ifdef DEBUG_MMAP
... ... @@ -96,11 +96,11 @@ int target_mprotect(target_ulong start, target_ulong len, int prot)
96 96 }
97 97  
98 98 /* map an incomplete host page */
99   -static int mmap_frag(target_ulong real_start,
100   - target_ulong start, target_ulong end,
101   - int prot, int flags, int fd, target_ulong offset)
  99 +static int mmap_frag(abi_ulong real_start,
  100 + abi_ulong start, abi_ulong end,
  101 + int prot, int flags, int fd, abi_ulong offset)
102 102 {
103   - target_ulong real_end, ret, addr;
  103 + abi_ulong real_end, ret, addr;
104 104 void *host_start;
105 105 int prot1, prot_new;
106 106  
... ... @@ -152,17 +152,17 @@ static int mmap_frag(target_ulong real_start,
152 152 }
153 153  
154 154 /* NOTE: all the constants are the HOST ones */
155   -target_long target_mmap(target_ulong start, target_ulong len, int prot,
156   - int flags, int fd, target_ulong offset)
  155 +abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
  156 + int flags, int fd, abi_ulong offset)
157 157 {
158   - target_ulong ret, end, real_start, real_end, retaddr, host_offset, host_len;
  158 + abi_ulong ret, end, real_start, real_end, retaddr, host_offset, host_len;
159 159 unsigned long host_start;
160 160 #if defined(__alpha__) || defined(__sparc__) || defined(__x86_64__) || \
161 161 defined(__ia64) || defined(__mips__)
162   - static target_ulong last_start = 0x40000000;
  162 + static abi_ulong last_start = 0x40000000;
163 163 #elif defined(__CYGWIN__)
164 164 /* Cygwin doesn't have a whole lot of address space. */
165   - static target_ulong last_start = 0x18000000;
  165 + static abi_ulong last_start = 0x18000000;
166 166 #endif
167 167  
168 168 #ifdef DEBUG_MMAP
... ... @@ -228,7 +228,7 @@ target_long target_mmap(target_ulong start, target_ulong len, int prot,
228 228 * TARGET_PAGE_SIZE, see exec.c. qemu_real_host_page_size is the
229 229 * hosts real page size.
230 230 */
231   - target_ulong host_end;
  231 + abi_ulong host_end;
232 232 unsigned long host_aligned_start;
233 233  
234 234 host_len = HOST_PAGE_ALIGN(host_len + qemu_host_page_size
... ... @@ -354,9 +354,9 @@ target_long target_mmap(target_ulong start, target_ulong len, int prot,
354 354 return start;
355 355 }
356 356  
357   -int target_munmap(target_ulong start, target_ulong len)
  357 +int target_munmap(abi_ulong start, abi_ulong len)
358 358 {
359   - target_ulong end, real_start, real_end, addr;
  359 + abi_ulong end, real_start, real_end, addr;
360 360 int prot, ret;
361 361  
362 362 #ifdef DEBUG_MMAP
... ... @@ -408,9 +408,9 @@ int target_munmap(target_ulong start, target_ulong len)
408 408  
409 409 /* XXX: currently, we only handle MAP_ANONYMOUS and not MAP_FIXED
410 410 blocks which have been allocated starting on a host page */
411   -target_long target_mremap(target_ulong old_addr, target_ulong old_size,
412   - target_ulong new_size, unsigned long flags,
413   - target_ulong new_addr)
  411 +abi_long target_mremap(abi_ulong old_addr, abi_ulong old_size,
  412 + abi_ulong new_size, unsigned long flags,
  413 + abi_ulong new_addr)
414 414 {
415 415 int prot;
416 416 unsigned long host_addr;
... ... @@ -426,9 +426,9 @@ target_long target_mremap(target_ulong old_addr, target_ulong old_size,
426 426 return new_addr;
427 427 }
428 428  
429   -int target_msync(target_ulong start, target_ulong len, int flags)
  429 +int target_msync(abi_ulong start, abi_ulong len, int flags)
430 430 {
431   - target_ulong end;
  431 + abi_ulong end;
432 432  
433 433 if (start & ~TARGET_PAGE_MASK)
434 434 return -EINVAL;
... ...
linux-user/ppc/syscall.h
... ... @@ -44,7 +44,7 @@ struct target_pt_regs {
44 44  
45 45 /* ioctls */
46 46 struct target_revectored_struct {
47   - target_ulong __map[8]; /* 256 bits */
  47 + abi_ulong __map[8]; /* 256 bits */
48 48 };
49 49  
50 50 /*
... ...
linux-user/ppc/target_signal.h
... ... @@ -6,9 +6,9 @@
6 6 /* this struct defines a stack used during syscall handling */
7 7  
8 8 typedef struct target_sigaltstack {
9   - target_ulong ss_sp;
10   - target_long ss_flags;
11   - target_ulong ss_size;
  9 + abi_ulong ss_sp;
  10 + abi_long ss_flags;
  11 + abi_ulong ss_size;
12 12 } target_stack_t;
13 13  
14 14  
... ... @@ -21,7 +21,7 @@ typedef struct target_sigaltstack {
21 21 #define TARGET_MINSIGSTKSZ 2048
22 22 #define TARGET_SIGSTKSZ 8192
23 23  
24   -static inline target_ulong get_sp_from_cpustate(CPUPPCState *state)
  24 +static inline abi_ulong get_sp_from_cpustate(CPUPPCState *state)
25 25 {
26 26 return state->gpr[1];
27 27 }
... ...
linux-user/ppc64/syscall.h
... ... @@ -44,7 +44,7 @@ struct target_pt_regs {
44 44  
45 45 /* ioctls */
46 46 struct target_revectored_struct {
47   - target_ulong __map[8]; /* 256 bits */
  47 + abi_ulong __map[8]; /* 256 bits */
48 48 };
49 49  
50 50 /*
... ...
linux-user/ppc64/target_signal.h
... ... @@ -6,9 +6,9 @@
6 6 /* this struct defines a stack used during syscall handling */
7 7  
8 8 typedef struct target_sigaltstack {
9   - target_ulong ss_sp;
10   - target_long ss_flags;
11   - target_ulong ss_size;
  9 + abi_ulong ss_sp;
  10 + abi_long ss_flags;
  11 + abi_ulong ss_size;
12 12 } target_stack_t;
13 13  
14 14  
... ... @@ -21,7 +21,7 @@ typedef struct target_sigaltstack {
21 21 #define TARGET_MINSIGSTKSZ 2048
22 22 #define TARGET_SIGSTKSZ 8192
23 23  
24   -static inline target_ulong get_sp_from_cpustate(CPUPPCState *state)
  24 +static inline abi_ulong get_sp_from_cpustate(CPUPPCState *state)
25 25 {
26 26 return state->gpr[1];
27 27 }
... ...
linux-user/qemu.h
1 1 #ifndef QEMU_H
2 2 #define QEMU_H
3 3  
4   -#include "thunk.h"
5   -
6 4 #include <signal.h>
7 5 #include <string.h>
8   -#include "syscall_defs.h"
9 6  
10 7 #include "cpu.h"
  8 +
  9 +#ifdef TARGET_ABI32
  10 +typedef uint32_t abi_ulong;
  11 +typedef int32_t abi_long;
  12 +#define TARGET_ABI_BITS 32
  13 +#else
  14 +typedef target_ulong abi_ulong;
  15 +typedef target_long abi_long;
  16 +#define TARGET_ABI_BITS TARGET_LONG_BITS
  17 +#endif
  18 +
  19 +#include "thunk.h"
  20 +#include "syscall_defs.h"
11 21 #include "syscall.h"
12 22 #include "target_signal.h"
13 23 #include "gdbstub.h"
... ... @@ -17,20 +27,20 @@
17 27 * task_struct fields in the kernel
18 28 */
19 29 struct image_info {
20   - target_ulong load_addr;
21   - target_ulong start_code;
22   - target_ulong end_code;
23   - target_ulong start_data;
24   - target_ulong end_data;
25   - target_ulong start_brk;
26   - target_ulong brk;
27   - target_ulong start_mmap;
28   - target_ulong mmap;
29   - target_ulong rss;
30   - target_ulong start_stack;
31   - target_ulong entry;
32   - target_ulong code_offset;
33   - target_ulong data_offset;
  30 + abi_ulong load_addr;
  31 + abi_ulong start_code;
  32 + abi_ulong end_code;
  33 + abi_ulong start_data;
  34 + abi_ulong end_data;
  35 + abi_ulong start_brk;
  36 + abi_ulong brk;
  37 + abi_ulong start_mmap;
  38 + abi_ulong mmap;
  39 + abi_ulong rss;
  40 + abi_ulong start_stack;
  41 + abi_ulong entry;
  42 + abi_ulong code_offset;
  43 + abi_ulong data_offset;
34 44 char **host_argv;
35 45 int personality;
36 46 };
... ... @@ -67,7 +77,7 @@ typedef struct TaskState {
67 77 int swi_errno;
68 78 #endif
69 79 #if defined(TARGET_I386) && !defined(TARGET_X86_64)
70   - target_ulong target_v86;
  80 + abi_ulong target_v86;
71 81 struct vm86_saved_state vm86_saved_regs;
72 82 struct target_vm86plus_struct vm86plus;
73 83 uint32_t v86flags;
... ... @@ -105,7 +115,7 @@ extern const char *qemu_uname_release;
105 115 struct linux_binprm {
106 116 char buf[128];
107 117 void *page[MAX_ARG_PAGES];
108   - target_ulong p;
  118 + abi_ulong p;
109 119 int fd;
110 120 int e_uid, e_gid;
111 121 int argc, envc;
... ... @@ -115,8 +125,8 @@ struct linux_binprm {
115 125 };
116 126  
117 127 void do_init_thread(struct target_pt_regs *regs, struct image_info *infop);
118   -target_ulong loader_build_argptr(int envc, int argc, target_ulong sp,
119   - target_ulong stringp, int push_ptr);
  128 +abi_ulong loader_build_argptr(int envc, int argc, abi_ulong sp,
  129 + abi_ulong stringp, int push_ptr);
120 130 int loader_exec(const char * filename, char ** argv, char ** envp,
121 131 struct target_pt_regs * regs, struct image_info *infop);
122 132  
... ... @@ -130,14 +140,14 @@ int load_elf_binary_multi(struct linux_binprm *bprm,
130 140 struct image_info *info);
131 141 #endif
132 142  
133   -void memcpy_to_target(target_ulong dest, const void *src,
  143 +void memcpy_to_target(abi_ulong dest, const void *src,
134 144 unsigned long len);
135   -void target_set_brk(target_ulong new_brk);
136   -target_long do_brk(target_ulong new_brk);
  145 +void target_set_brk(abi_ulong new_brk);
  146 +abi_long do_brk(abi_ulong new_brk);
137 147 void syscall_init(void);
138   -target_long do_syscall(void *cpu_env, int num, target_long arg1,
139   - target_long arg2, target_long arg3, target_long arg4,
140   - target_long arg5, target_long arg6);
  148 +abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
  149 + abi_long arg2, abi_long arg3, abi_long arg4,
  150 + abi_long arg5, abi_long arg6);
141 151 void gemu_log(const char *fmt, ...) __attribute__((format(printf,1,2)));
142 152 extern CPUState *global_env;
143 153 void cpu_loop(CPUState *env);
... ... @@ -157,28 +167,28 @@ long do_sigreturn(CPUState *env);
157 167 long do_rt_sigreturn(CPUState *env);
158 168 int do_sigaltstack(const struct target_sigaltstack *uss,
159 169 struct target_sigaltstack *uoss,
160   - target_ulong sp);
  170 + abi_ulong sp);
161 171  
162 172 #ifdef TARGET_I386
163 173 /* vm86.c */
164 174 void save_v86_state(CPUX86State *env);
165 175 void handle_vm86_trap(CPUX86State *env, int trapno);
166 176 void handle_vm86_fault(CPUX86State *env);
167   -int do_vm86(CPUX86State *env, long subfunction, target_ulong v86_addr);
  177 +int do_vm86(CPUX86State *env, long subfunction, abi_ulong v86_addr);
168 178 #elif defined(TARGET_SPARC64)
169 179 void sparc64_set_context(CPUSPARCState *env);
170 180 void sparc64_get_context(CPUSPARCState *env);
171 181 #endif
172 182  
173 183 /* mmap.c */
174   -int target_mprotect(target_ulong start, target_ulong len, int prot);
175   -target_long target_mmap(target_ulong start, target_ulong len, int prot,
176   - int flags, int fd, target_ulong offset);
177   -int target_munmap(target_ulong start, target_ulong len);
178   -target_long target_mremap(target_ulong old_addr, target_ulong old_size,
179   - target_ulong new_size, unsigned long flags,
180   - target_ulong new_addr);
181   -int target_msync(target_ulong start, target_ulong len, int flags);
  184 +int target_mprotect(abi_ulong start, abi_ulong len, int prot);
  185 +abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
  186 + int flags, int fd, abi_ulong offset);
  187 +int target_munmap(abi_ulong start, abi_ulong len);
  188 +abi_long target_mremap(abi_ulong old_addr, abi_ulong old_size,
  189 + abi_ulong new_size, unsigned long flags,
  190 + abi_ulong new_addr);
  191 +int target_msync(abi_ulong start, abi_ulong len, int flags);
182 192  
183 193 /* user access */
184 194  
... ... @@ -260,7 +270,7 @@ int target_msync(target_ulong start, target_ulong len, int flags);
260 270  
261 271 /* Lock an area of guest memory into the host. If copy is true then the
262 272 host area will have the same contents as the guest. */
263   -static inline void *lock_user(target_ulong guest_addr, long len, int copy)
  273 +static inline void *lock_user(abi_ulong guest_addr, long len, int copy)
264 274 {
265 275 #ifdef DEBUG_REMAP
266 276 void *addr;
... ... @@ -277,8 +287,8 @@ static inline void *lock_user(target_ulong guest_addr, long len, int copy)
277 287  
278 288 /* Unlock an area of guest memory. The first LEN bytes must be flushed back
279 289 to guest memory. */
280   -static inline void unlock_user(void *host_addr, target_ulong guest_addr,
281   - long len)
  290 +static inline void unlock_user(void *host_addr, abi_ulong guest_addr,
  291 + long len)
282 292 {
283 293 #ifdef DEBUG_REMAP
284 294 if (host_addr == g2h(guest_addr))
... ... @@ -290,13 +300,13 @@ static inline void unlock_user(void *host_addr, target_ulong guest_addr,
290 300 }
291 301  
292 302 /* Return the length of a string in target memory. */
293   -static inline int target_strlen(target_ulong ptr)
  303 +static inline int target_strlen(abi_ulong ptr)
294 304 {
295 305 return strlen(g2h(ptr));
296 306 }
297 307  
298 308 /* Like lock_user but for null terminated strings. */
299   -static inline void *lock_user_string(target_ulong guest_addr)
  309 +static inline void *lock_user_string(abi_ulong guest_addr)
300 310 {
301 311 long len;
302 312 len = target_strlen(guest_addr) + 1;
... ... @@ -317,7 +327,7 @@ static inline void *lock_user_string(target_ulong guest_addr)
317 327 #define tput32(addr, val) stl(addr, val)
318 328 #define tget64(addr) ldq(addr)
319 329 #define tput64(addr, val) stq(addr, val)
320   -#if TARGET_LONG_BITS == 64
  330 +#if TARGET_ABI_BITS == 64
321 331 #define tgetl(addr) ldq(addr)
322 332 #define tputl(addr, val) stq(addr, val)
323 333 #else
... ...
linux-user/sh4/target_signal.h
... ... @@ -6,9 +6,9 @@
6 6 /* this struct defines a stack used during syscall handling */
7 7  
8 8 typedef struct target_sigaltstack {
9   - target_ulong ss_sp;
10   - target_long ss_flags;
11   - target_ulong ss_size;
  9 + abi_ulong ss_sp;
  10 + abi_long ss_flags;
  11 + abi_ulong ss_size;
12 12 } target_stack_t;
13 13  
14 14  
... ...
linux-user/signal.c
... ... @@ -26,8 +26,8 @@
26 26 #include <errno.h>
27 27 #include <sys/ucontext.h>
28 28  
29   -#include "target_signal.h"
30 29 #include "qemu.h"
  30 +#include "target_signal.h"
31 31  
32 32 //#define DEBUG_SIGNAL
33 33  
... ... @@ -134,12 +134,12 @@ static void host_to_target_sigset_internal(target_sigset_t *d,
134 134 if (sigmask & (1 << i))
135 135 target_sigmask |= 1 << (host_to_target_signal(i + 1) - 1);
136 136 }
137   -#if TARGET_LONG_BITS == 32 && HOST_LONG_BITS == 32
  137 +#if TARGET_ABI_BITS == 32 && HOST_LONG_BITS == 32
138 138 d->sig[0] = target_sigmask;
139 139 for(i = 1;i < TARGET_NSIG_WORDS; i++) {
140 140 d->sig[i] = ((unsigned long *)s)[i];
141 141 }
142   -#elif TARGET_LONG_BITS == 32 && HOST_LONG_BITS == 64 && TARGET_NSIG_WORDS == 2
  142 +#elif TARGET_ABI_BITS == 32 && HOST_LONG_BITS == 64 && TARGET_NSIG_WORDS == 2
143 143 d->sig[0] = target_sigmask;
144 144 d->sig[1] = sigmask >> 32;
145 145 #else
... ... @@ -161,7 +161,7 @@ void target_to_host_sigset_internal(sigset_t *d, const target_sigset_t *s)
161 161 {
162 162 int i;
163 163 unsigned long sigmask;
164   - target_ulong target_sigmask;
  164 + abi_ulong target_sigmask;
165 165  
166 166 target_sigmask = s->sig[0];
167 167 sigmask = 0;
... ... @@ -169,16 +169,16 @@ void target_to_host_sigset_internal(sigset_t *d, const target_sigset_t *s)
169 169 if (target_sigmask & (1 << i))
170 170 sigmask |= 1 << (target_to_host_signal(i + 1) - 1);
171 171 }
172   -#if TARGET_LONG_BITS == 32 && HOST_LONG_BITS == 32
  172 +#if TARGET_ABI_BITS == 32 && HOST_LONG_BITS == 32
173 173 ((unsigned long *)d)[0] = sigmask;
174 174 for(i = 1;i < TARGET_NSIG_WORDS; i++) {
175 175 ((unsigned long *)d)[i] = s->sig[i];
176 176 }
177   -#elif TARGET_LONG_BITS == 32 && HOST_LONG_BITS == 64 && TARGET_NSIG_WORDS == 2
  177 +#elif TARGET_ABI_BITS == 32 && HOST_LONG_BITS == 64 && TARGET_NSIG_WORDS == 2
178 178 ((unsigned long *)d)[0] = sigmask | ((unsigned long)(s->sig[1]) << 32);
179 179 #else
180 180 #warning target_to_host_sigset
181   -#endif /* TARGET_LONG_BITS */
  181 +#endif /* TARGET_ABI_BITS */
182 182 }
183 183  
184 184 void target_to_host_sigset(sigset_t *d, const target_sigset_t *s)
... ... @@ -191,7 +191,7 @@ void target_to_host_sigset(sigset_t *d, const target_sigset_t *s)
191 191 target_to_host_sigset_internal(d, &s1);
192 192 }
193 193  
194   -void host_to_target_old_sigset(target_ulong *old_sigset,
  194 +void host_to_target_old_sigset(abi_ulong *old_sigset,
195 195 const sigset_t *sigset)
196 196 {
197 197 target_sigset_t d;
... ... @@ -200,7 +200,7 @@ void host_to_target_old_sigset(target_ulong *old_sigset,
200 200 }
201 201  
202 202 void target_to_host_old_sigset(sigset_t *sigset,
203   - const target_ulong *old_sigset)
  203 + const abi_ulong *old_sigset)
204 204 {
205 205 target_sigset_t d;
206 206 int i;
... ... @@ -233,7 +233,7 @@ static inline void host_to_target_siginfo_noswap(target_siginfo_t *tinfo,
233 233 tinfo->_sifields._rt._uid = info->si_uid;
234 234 /* XXX: potential problem if 64 bit */
235 235 tinfo->_sifields._rt._sigval.sival_ptr =
236   - (target_ulong)info->si_value.sival_ptr;
  236 + (abi_ulong)info->si_value.sival_ptr;
237 237 }
238 238 }
239 239  
... ... @@ -355,7 +355,7 @@ int queue_signal(int sig, target_siginfo_t *info)
355 355 {
356 356 struct emulated_sigaction *k;
357 357 struct sigqueue *q, **pq;
358   - target_ulong handler;
  358 + abi_ulong handler;
359 359  
360 360 #if defined(DEBUG_SIGNAL)
361 361 fprintf(stderr, "queue_signal: sig=%d\n",
... ... @@ -440,7 +440,7 @@ static void host_signal_handler(int host_signum, siginfo_t *info,
440 440  
441 441 int do_sigaltstack(const struct target_sigaltstack *uss,
442 442 struct target_sigaltstack *uoss,
443   - target_ulong sp)
  443 + abi_ulong sp)
444 444 {
445 445 int ret;
446 446 struct target_sigaltstack oss;
... ... @@ -579,29 +579,29 @@ struct target_fpxreg {
579 579 };
580 580  
581 581 struct target_xmmreg {
582   - target_ulong element[4];
  582 + abi_ulong element[4];
583 583 };
584 584  
585 585 struct target_fpstate {
586 586 /* Regular FPU environment */
587   - target_ulong cw;
588   - target_ulong sw;
589   - target_ulong tag;
590   - target_ulong ipoff;
591   - target_ulong cssel;
592   - target_ulong dataoff;
593   - target_ulong datasel;
  587 + abi_ulong cw;
  588 + abi_ulong sw;
  589 + abi_ulong tag;
  590 + abi_ulong ipoff;
  591 + abi_ulong cssel;
  592 + abi_ulong dataoff;
  593 + abi_ulong datasel;
594 594 struct target_fpreg _st[8];
595 595 uint16_t status;
596 596 uint16_t magic; /* 0xffff = regular FPU data only */
597 597  
598 598 /* FXSR FPU environment */
599   - target_ulong _fxsr_env[6]; /* FXSR FPU env is ignored */
600   - target_ulong mxcsr;
601   - target_ulong reserved;
  599 + abi_ulong _fxsr_env[6]; /* FXSR FPU env is ignored */
  600 + abi_ulong mxcsr;
  601 + abi_ulong reserved;
602 602 struct target_fpxreg _fxsr_st[8]; /* FXSR FPU reg data is ignored */
603 603 struct target_xmmreg _xmm[8];
604   - target_ulong padding[56];
  604 + abi_ulong padding[56];
605 605 };
606 606  
607 607 #define X86_FXSR_MAGIC 0x0000
... ... @@ -611,29 +611,29 @@ struct target_sigcontext {
611 611 uint16_t fs, __fsh;
612 612 uint16_t es, __esh;
613 613 uint16_t ds, __dsh;
614   - target_ulong edi;
615   - target_ulong esi;
616   - target_ulong ebp;
617   - target_ulong esp;
618   - target_ulong ebx;
619   - target_ulong edx;
620   - target_ulong ecx;
621   - target_ulong eax;
622   - target_ulong trapno;
623   - target_ulong err;
624   - target_ulong eip;
  614 + abi_ulong edi;
  615 + abi_ulong esi;
  616 + abi_ulong ebp;
  617 + abi_ulong esp;
  618 + abi_ulong ebx;
  619 + abi_ulong edx;
  620 + abi_ulong ecx;
  621 + abi_ulong eax;
  622 + abi_ulong trapno;
  623 + abi_ulong err;
  624 + abi_ulong eip;
625 625 uint16_t cs, __csh;
626   - target_ulong eflags;
627   - target_ulong esp_at_signal;
  626 + abi_ulong eflags;
  627 + abi_ulong esp_at_signal;
628 628 uint16_t ss, __ssh;
629   - target_ulong fpstate; /* pointer */
630   - target_ulong oldmask;
631   - target_ulong cr2;
  629 + abi_ulong fpstate; /* pointer */
  630 + abi_ulong oldmask;
  631 + abi_ulong cr2;
632 632 };
633 633  
634 634 struct target_ucontext {
635   - target_ulong tuc_flags;
636   - target_ulong tuc_link;
  635 + abi_ulong tuc_flags;
  636 + abi_ulong tuc_link;
637 637 target_stack_t tuc_stack;
638 638 struct target_sigcontext tuc_mcontext;
639 639 target_sigset_t tuc_sigmask; /* mask last for extensibility */
... ... @@ -641,20 +641,20 @@ struct target_ucontext {
641 641  
642 642 struct sigframe
643 643 {
644   - target_ulong pretcode;
  644 + abi_ulong pretcode;
645 645 int sig;
646 646 struct target_sigcontext sc;
647 647 struct target_fpstate fpstate;
648   - target_ulong extramask[TARGET_NSIG_WORDS-1];
  648 + abi_ulong extramask[TARGET_NSIG_WORDS-1];
649 649 char retcode[8];
650 650 };
651 651  
652 652 struct rt_sigframe
653 653 {
654   - target_ulong pretcode;
  654 + abi_ulong pretcode;
655 655 int sig;
656   - target_ulong pinfo;
657   - target_ulong puc;
  656 + abi_ulong pinfo;
  657 + abi_ulong puc;
658 658 struct target_siginfo info;
659 659 struct target_ucontext uc;
660 660 struct target_fpstate fpstate;
... ... @@ -813,8 +813,8 @@ static void setup_rt_frame(int sig, struct emulated_sigaction *ka,
813 813 ? current->exec_domain->signal_invmap[sig]
814 814 : */sig),
815 815 &frame->sig);
816   - err |= __put_user((target_ulong)&frame->info, &frame->pinfo);
817   - err |= __put_user((target_ulong)&frame->uc, &frame->puc);
  816 + err |= __put_user((abi_ulong)&frame->info, &frame->pinfo);
  817 + err |= __put_user((abi_ulong)&frame->uc, &frame->puc);
818 818 err |= copy_siginfo_to_user(&frame->info, info);
819 819 if (err)
820 820 goto give_sigsegv;
... ... @@ -977,32 +977,32 @@ badframe:
977 977 #elif defined(TARGET_ARM)
978 978  
979 979 struct target_sigcontext {
980   - target_ulong trap_no;
981   - target_ulong error_code;
982   - target_ulong oldmask;
983   - target_ulong arm_r0;
984   - target_ulong arm_r1;
985   - target_ulong arm_r2;
986   - target_ulong arm_r3;
987   - target_ulong arm_r4;
988   - target_ulong arm_r5;
989   - target_ulong arm_r6;
990   - target_ulong arm_r7;
991   - target_ulong arm_r8;
992   - target_ulong arm_r9;
993   - target_ulong arm_r10;
994   - target_ulong arm_fp;
995   - target_ulong arm_ip;
996   - target_ulong arm_sp;
997   - target_ulong arm_lr;
998   - target_ulong arm_pc;
999   - target_ulong arm_cpsr;
1000   - target_ulong fault_address;
  980 + abi_ulong trap_no;
  981 + abi_ulong error_code;
  982 + abi_ulong oldmask;
  983 + abi_ulong arm_r0;
  984 + abi_ulong arm_r1;
  985 + abi_ulong arm_r2;
  986 + abi_ulong arm_r3;
  987 + abi_ulong arm_r4;
  988 + abi_ulong arm_r5;
  989 + abi_ulong arm_r6;
  990 + abi_ulong arm_r7;
  991 + abi_ulong arm_r8;
  992 + abi_ulong arm_r9;
  993 + abi_ulong arm_r10;
  994 + abi_ulong arm_fp;
  995 + abi_ulong arm_ip;
  996 + abi_ulong arm_sp;
  997 + abi_ulong arm_lr;
  998 + abi_ulong arm_pc;
  999 + abi_ulong arm_cpsr;
  1000 + abi_ulong fault_address;
1001 1001 };
1002 1002  
1003 1003 struct target_ucontext {
1004   - target_ulong tuc_flags;
1005   - target_ulong tuc_link;
  1004 + abi_ulong tuc_flags;
  1005 + abi_ulong tuc_link;
1006 1006 target_stack_t tuc_stack;
1007 1007 struct target_sigcontext tuc_mcontext;
1008 1008 target_sigset_t tuc_sigmask; /* mask last for extensibility */
... ... @@ -1011,8 +1011,8 @@ struct target_ucontext {
1011 1011 struct sigframe
1012 1012 {
1013 1013 struct target_sigcontext sc;
1014   - target_ulong extramask[TARGET_NSIG_WORDS-1];
1015   - target_ulong retcode;
  1014 + abi_ulong extramask[TARGET_NSIG_WORDS-1];
  1015 + abi_ulong retcode;
1016 1016 };
1017 1017  
1018 1018 struct rt_sigframe
... ... @@ -1021,7 +1021,7 @@ struct rt_sigframe
1021 1021 void *puc;
1022 1022 struct target_siginfo info;
1023 1023 struct target_ucontext uc;
1024   - target_ulong retcode;
  1024 + abi_ulong retcode;
1025 1025 };
1026 1026  
1027 1027 #define TARGET_CONFIG_CPU_32 1
... ... @@ -1039,7 +1039,7 @@ struct rt_sigframe
1039 1039 #define SWI_THUMB_SIGRETURN (0xdf00 << 16 | 0x2700 | (TARGET_NR_sigreturn))
1040 1040 #define SWI_THUMB_RT_SIGRETURN (0xdf00 << 16 | 0x2700 | (TARGET_NR_rt_sigreturn))
1041 1041  
1042   -static const target_ulong retcodes[4] = {
  1042 +static const abi_ulong retcodes[4] = {
1043 1043 SWI_SYS_SIGRETURN, SWI_THUMB_SIGRETURN,
1044 1044 SWI_SYS_RT_SIGRETURN, SWI_THUMB_RT_SIGRETURN
1045 1045 };
... ... @@ -1105,14 +1105,14 @@ get_sigframe(struct emulated_sigaction *ka, CPUState *regs, int framesize)
1105 1105  
1106 1106 static int
1107 1107 setup_return(CPUState *env, struct emulated_sigaction *ka,
1108   - target_ulong *rc, void *frame, int usig)
  1108 + abi_ulong *rc, void *frame, int usig)
1109 1109 {
1110   - target_ulong handler = (target_ulong)ka->sa._sa_handler;
1111   - target_ulong retcode;
  1110 + abi_ulong handler = (abi_ulong)ka->sa._sa_handler;
  1111 + abi_ulong retcode;
1112 1112 int thumb = 0;
1113 1113 #if defined(TARGET_CONFIG_CPU_32)
1114 1114 #if 0
1115   - target_ulong cpsr = env->cpsr;
  1115 + abi_ulong cpsr = env->cpsr;
1116 1116  
1117 1117 /*
1118 1118 * Maybe we need to deliver a 32-bit signal to a 26-bit task.
... ... @@ -1138,7 +1138,7 @@ setup_return(CPUState *env, struct emulated_sigaction *ka,
1138 1138 #endif /* TARGET_CONFIG_CPU_32 */
1139 1139  
1140 1140 if (ka->sa.sa_flags & TARGET_SA_RESTORER) {
1141   - retcode = (target_ulong)ka->sa.sa_restorer;
  1141 + retcode = (abi_ulong)ka->sa.sa_restorer;
1142 1142 } else {
1143 1143 unsigned int idx = thumb;
1144 1144  
... ... @@ -1148,10 +1148,10 @@ setup_return(CPUState *env, struct emulated_sigaction *ka,
1148 1148 if (__put_user(retcodes[idx], rc))
1149 1149 return 1;
1150 1150 #if 0
1151   - flush_icache_range((target_ulong)rc,
1152   - (target_ulong)(rc + 1));
  1151 + flush_icache_range((abi_ulong)rc,
  1152 + (abi_ulong)(rc + 1));
1153 1153 #endif
1154   - retcode = ((target_ulong)rc) + thumb;
  1154 + retcode = ((abi_ulong)rc) + thumb;
1155 1155 }
1156 1156  
1157 1157 env->regs[0] = usig;
... ... @@ -1197,8 +1197,8 @@ static void setup_rt_frame(int usig, struct emulated_sigaction *ka,
1197 1197 if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame)))
1198 1198 return /* 1 */;
1199 1199  
1200   - __put_user_error(&frame->info, (target_ulong *)&frame->pinfo, err);
1201   - __put_user_error(&frame->uc, (target_ulong *)&frame->puc, err);
  1200 + __put_user_error(&frame->info, (abi_ulong *)&frame->pinfo, err);
  1201 + __put_user_error(&frame->uc, (abi_ulong *)&frame->puc, err);
1202 1202 err |= copy_siginfo_to_user(&frame->info, info);
1203 1203  
1204 1204 /* Clear all the bits of the ucontext we don't use. */
... ... @@ -1229,8 +1229,8 @@ static void setup_rt_frame(int usig, struct emulated_sigaction *ka,
1229 1229 * arguments for the signal handler.
1230 1230 * -- Peter Maydell <pmaydell@chiark.greenend.org.uk> 2000-12-06
1231 1231 */
1232   - env->regs[1] = (target_ulong)frame->pinfo;
1233   - env->regs[2] = (target_ulong)frame->puc;
  1232 + env->regs[1] = (abi_ulong)frame->pinfo;
  1233 + env->regs[2] = (abi_ulong)frame->puc;
1234 1234 }
1235 1235  
1236 1236 // return err;
... ... @@ -1360,48 +1360,48 @@ badframe:
1360 1360  
1361 1361 /* This is what SunOS does, so shall I. */
1362 1362 struct target_sigcontext {
1363   - target_ulong sigc_onstack; /* state to restore */
  1363 + abi_ulong sigc_onstack; /* state to restore */
1364 1364  
1365   - target_ulong sigc_mask; /* sigmask to restore */
1366   - target_ulong sigc_sp; /* stack pointer */
1367   - target_ulong sigc_pc; /* program counter */
1368   - target_ulong sigc_npc; /* next program counter */
1369   - target_ulong sigc_psr; /* for condition codes etc */
1370   - target_ulong sigc_g1; /* User uses these two registers */
1371   - target_ulong sigc_o0; /* within the trampoline code. */
  1365 + abi_ulong sigc_mask; /* sigmask to restore */
  1366 + abi_ulong sigc_sp; /* stack pointer */
  1367 + abi_ulong sigc_pc; /* program counter */
  1368 + abi_ulong sigc_npc; /* next program counter */
  1369 + abi_ulong sigc_psr; /* for condition codes etc */
  1370 + abi_ulong sigc_g1; /* User uses these two registers */
  1371 + abi_ulong sigc_o0; /* within the trampoline code. */
1372 1372  
1373 1373 /* Now comes information regarding the users window set
1374 1374 * at the time of the signal.
1375 1375 */
1376   - target_ulong sigc_oswins; /* outstanding windows */
  1376 + abi_ulong sigc_oswins; /* outstanding windows */
1377 1377  
1378 1378 /* stack ptrs for each regwin buf */
1379 1379 char *sigc_spbuf[__SUNOS_MAXWIN];
1380 1380  
1381 1381 /* Windows to restore after signal */
1382 1382 struct {
1383   - target_ulong locals[8];
1384   - target_ulong ins[8];
  1383 + abi_ulong locals[8];
  1384 + abi_ulong ins[8];
1385 1385 } sigc_wbuf[__SUNOS_MAXWIN];
1386 1386 };
1387 1387 /* A Sparc stack frame */
1388 1388 struct sparc_stackf {
1389   - target_ulong locals[8];
1390   - target_ulong ins[6];
  1389 + abi_ulong locals[8];
  1390 + abi_ulong ins[6];
1391 1391 struct sparc_stackf *fp;
1392   - target_ulong callers_pc;
  1392 + abi_ulong callers_pc;
1393 1393 char *structptr;
1394   - target_ulong xargs[6];
1395   - target_ulong xxargs[1];
  1394 + abi_ulong xargs[6];
  1395 + abi_ulong xxargs[1];
1396 1396 };
1397 1397  
1398 1398 typedef struct {
1399 1399 struct {
1400   - target_ulong psr;
1401   - target_ulong pc;
1402   - target_ulong npc;
1403   - target_ulong y;
1404   - target_ulong u_regs[16]; /* globals and ins */
  1400 + abi_ulong psr;
  1401 + abi_ulong pc;
  1402 + abi_ulong npc;
  1403 + abi_ulong y;
  1404 + abi_ulong u_regs[16]; /* globals and ins */
1405 1405 } si_regs;
1406 1406 int si_mask;
1407 1407 } __siginfo_t;
... ... @@ -1421,15 +1421,15 @@ struct target_signal_frame {
1421 1421 struct sparc_stackf ss;
1422 1422 __siginfo_t info;
1423 1423 qemu_siginfo_fpu_t *fpu_save;
1424   - target_ulong insns[2] __attribute__ ((aligned (8)));
1425   - target_ulong extramask[TARGET_NSIG_WORDS - 1];
1426   - target_ulong extra_size; /* Should be 0 */
  1424 + abi_ulong insns[2] __attribute__ ((aligned (8)));
  1425 + abi_ulong extramask[TARGET_NSIG_WORDS - 1];
  1426 + abi_ulong extra_size; /* Should be 0 */
1427 1427 qemu_siginfo_fpu_t fpu_state;
1428 1428 };
1429 1429 struct target_rt_signal_frame {
1430 1430 struct sparc_stackf ss;
1431 1431 siginfo_t info;
1432   - target_ulong regs[20];
  1432 + abi_ulong regs[20];
1433 1433 sigset_t mask;
1434 1434 qemu_siginfo_fpu_t *fpu_save;
1435 1435 unsigned int insns[2];
... ... @@ -1468,7 +1468,7 @@ static inline void *get_sigframe(struct emulated_sigaction *sa, CPUState *env, u
1468 1468 }
1469 1469  
1470 1470 static int
1471   -setup___siginfo(__siginfo_t *si, CPUState *env, target_ulong mask)
  1471 +setup___siginfo(__siginfo_t *si, CPUState *env, abi_ulong mask)
1472 1472 {
1473 1473 int err = 0, i;
1474 1474  
... ... @@ -1634,7 +1634,7 @@ long do_sigreturn(CPUState *env)
1634 1634 uint32_t up_psr, pc, npc;
1635 1635 target_sigset_t set;
1636 1636 sigset_t host_set;
1637   - target_ulong fpu_save;
  1637 + abi_ulong fpu_save;
1638 1638 int err, i;
1639 1639  
1640 1640 sf = (struct target_signal_frame *)g2h(env->regwptr[UREG_FP]);
... ... @@ -1676,7 +1676,7 @@ long do_sigreturn(CPUState *env)
1676 1676 err |= __get_user(env->regwptr[i + UREG_I0], &sf->info.si_regs.u_regs[i+8]);
1677 1677 }
1678 1678  
1679   - err |= __get_user(fpu_save, (target_ulong *)&sf->fpu_save);
  1679 + err |= __get_user(fpu_save, (abi_ulong *)&sf->fpu_save);
1680 1680  
1681 1681 //if (fpu_save)
1682 1682 // err |= restore_fpu_state(env, fpu_save);
... ... @@ -1729,11 +1729,11 @@ long do_rt_sigreturn(CPUState *env)
1729 1729 #define MC_O7 18
1730 1730 #define MC_NGREG 19
1731 1731  
1732   -typedef target_ulong target_mc_greg_t;
  1732 +typedef abi_ulong target_mc_greg_t;
1733 1733 typedef target_mc_greg_t target_mc_gregset_t[MC_NGREG];
1734 1734  
1735 1735 struct target_mc_fq {
1736   - target_ulong *mcfq_addr;
  1736 + abi_ulong *mcfq_addr;
1737 1737 uint32_t mcfq_insn;
1738 1738 };
1739 1739  
... ... @@ -1743,9 +1743,9 @@ struct target_mc_fpu {
1743 1743 uint64_t dregs[32];
1744 1744 //uint128_t qregs[16];
1745 1745 } mcfpu_fregs;
1746   - target_ulong mcfpu_fsr;
1747   - target_ulong mcfpu_fprs;
1748   - target_ulong mcfpu_gsr;
  1746 + abi_ulong mcfpu_fsr;
  1747 + abi_ulong mcfpu_fprs;
  1748 + abi_ulong mcfpu_gsr;
1749 1749 struct target_mc_fq *mcfpu_fq;
1750 1750 unsigned char mcfpu_qcnt;
1751 1751 unsigned char mcfpu_qentsz;
... ... @@ -1762,15 +1762,15 @@ typedef struct {
1762 1762  
1763 1763 struct target_ucontext {
1764 1764 struct target_ucontext *uc_link;
1765   - target_ulong uc_flags;
  1765 + abi_ulong uc_flags;
1766 1766 target_sigset_t uc_sigmask;
1767 1767 target_mcontext_t uc_mcontext;
1768 1768 };
1769 1769  
1770 1770 /* A V9 register window */
1771 1771 struct target_reg_window {
1772   - target_ulong locals[8];
1773   - target_ulong ins[8];
  1772 + abi_ulong locals[8];
  1773 + abi_ulong ins[8];
1774 1774 };
1775 1775  
1776 1776 #define TARGET_STACK_BIAS 2047
... ... @@ -1781,12 +1781,12 @@ void sparc64_set_context(CPUSPARCState *env)
1781 1781 struct target_ucontext *ucp = (struct target_ucontext *)
1782 1782 env->regwptr[UREG_I0];
1783 1783 target_mc_gregset_t *grp;
1784   - target_ulong pc, npc, tstate;
1785   - target_ulong fp, i7;
  1784 + abi_ulong pc, npc, tstate;
  1785 + abi_ulong fp, i7;
1786 1786 unsigned char fenab;
1787 1787 int err;
1788 1788 unsigned int i;
1789   - target_ulong *src, *dst;
  1789 + abi_ulong *src, *dst;
1790 1790  
1791 1791 grp = &ucp->uc_mcontext.mc_gregs;
1792 1792 err = get_user(pc, &((*grp)[MC_PC]));
... ... @@ -1803,7 +1803,7 @@ void sparc64_set_context(CPUSPARCState *env)
1803 1803 } else {
1804 1804 src = &ucp->uc_sigmask;
1805 1805 dst = &target_set;
1806   - for (i = 0; i < sizeof(target_sigset_t) / sizeof(target_ulong);
  1806 + for (i = 0; i < sizeof(target_sigset_t) / sizeof(abi_ulong);
1807 1807 i++, dst++, src++)
1808 1808 err |= get_user(dst, src);
1809 1809 if (err)
... ... @@ -1866,10 +1866,10 @@ void sparc64_get_context(CPUSPARCState *env)
1866 1866 env->regwptr[UREG_I0];
1867 1867 target_mc_gregset_t *grp;
1868 1868 target_mcontext_t *mcp;
1869   - target_ulong fp, i7;
  1869 + abi_ulong fp, i7;
1870 1870 int err;
1871 1871 unsigned int i;
1872   - target_ulong *src, *dst;
  1872 + abi_ulong *src, *dst;
1873 1873 target_sigset_t target_set;
1874 1874 sigset_t set;
1875 1875  
... ... @@ -1886,11 +1886,11 @@ void sparc64_get_context(CPUSPARCState *env)
1886 1886 host_to_target_sigset_internal(&target_set, &set);
1887 1887 if (TARGET_NSIG_WORDS == 1)
1888 1888 err |= put_user(target_set.sig[0],
1889   - (target_ulong *)&ucp->uc_sigmask);
  1889 + (abi_ulong *)&ucp->uc_sigmask);
1890 1890 else {
1891 1891 src = &target_set;
1892 1892 dst = &ucp->uc_sigmask;
1893   - for (i = 0; i < sizeof(target_sigset_t) / sizeof(target_ulong);
  1893 + for (i = 0; i < sizeof(target_sigset_t) / sizeof(abi_ulong);
1894 1894 i++, dst++, src++)
1895 1895 err |= put_user(src, dst);
1896 1896 if (err)
... ... @@ -2354,7 +2354,7 @@ long do_rt_sigreturn(CPUState *env)
2354 2354 void process_pending_signals(void *cpu_env)
2355 2355 {
2356 2356 int sig;
2357   - target_ulong handler;
  2357 + abi_ulong handler;
2358 2358 sigset_t set, old_set;
2359 2359 target_sigset_t target_old_set;
2360 2360 struct emulated_sigaction *k;
... ...
linux-user/sparc/syscall.h
1 1 struct target_pt_regs {
2   - target_ulong psr;
3   - target_ulong pc;
4   - target_ulong npc;
5   - target_ulong y;
6   - target_ulong u_regs[16];
  2 + abi_ulong psr;
  3 + abi_ulong pc;
  4 + abi_ulong npc;
  5 + abi_ulong y;
  6 + abi_ulong u_regs[16];
7 7 };
8 8  
9 9 #define UNAME_MACHINE "sun4"
... ...
linux-user/sparc/target_signal.h
... ... @@ -6,9 +6,9 @@
6 6 /* this struct defines a stack used during syscall handling */
7 7  
8 8 typedef struct target_sigaltstack {
9   - target_ulong ss_sp;
10   - target_long ss_flags;
11   - target_ulong ss_size;
  9 + abi_ulong ss_sp;
  10 + abi_long ss_flags;
  11 + abi_ulong ss_size;
12 12 } target_stack_t;
13 13  
14 14  
... ... @@ -28,7 +28,7 @@ typedef struct target_sigaltstack {
28 28 #define UREG_FP UREG_I6
29 29 #endif
30 30  
31   -static inline target_ulong get_sp_from_cpustate(CPUSPARCState *state)
  31 +static inline abi_ulong get_sp_from_cpustate(CPUSPARCState *state)
32 32 {
33 33 return state->regwptr[UREG_FP];
34 34 }
... ...
linux-user/sparc64/syscall.h
1 1 struct target_pt_regs {
2   - target_ulong u_regs[16];
3   - target_ulong tstate;
4   - target_ulong pc;
5   - target_ulong npc;
6   - target_ulong y;
7   - target_ulong fprs;
  2 + abi_ulong u_regs[16];
  3 + abi_ulong tstate;
  4 + abi_ulong pc;
  5 + abi_ulong npc;
  6 + abi_ulong y;
  7 + abi_ulong fprs;
8 8 };
9 9  
10 10 #define UNAME_MACHINE "sun4u"
... ...
linux-user/sparc64/target_signal.h
... ... @@ -6,9 +6,9 @@
6 6 /* this struct defines a stack used during syscall handling */
7 7  
8 8 typedef struct target_sigaltstack {
9   - target_ulong ss_sp;
10   - target_long ss_flags;
11   - target_ulong ss_size;
  9 + abi_ulong ss_sp;
  10 + abi_long ss_flags;
  11 + abi_ulong ss_size;
12 12 } target_stack_t;
13 13  
14 14  
... ... @@ -28,7 +28,7 @@ typedef struct target_sigaltstack {
28 28 #define UREG_FP UREG_I6
29 29 #endif
30 30  
31   -static inline target_ulong get_sp_from_cpustate(CPUSPARCState *state)
  31 +static inline abi_ulong get_sp_from_cpustate(CPUSPARCState *state)
32 32 {
33 33 return state->regwptr[UREG_FP];
34 34 }
... ...
linux-user/syscall.c
... ... @@ -368,7 +368,7 @@ static inline int host_to_target_errno(int err)
368 368 return err;
369 369 }
370 370  
371   -static inline target_long get_errno(target_long ret)
  371 +static inline abi_long get_errno(abi_long ret)
372 372 {
373 373 if (ret == -1)
374 374 return -host_to_target_errno(errno);
... ... @@ -376,23 +376,23 @@ static inline target_long get_errno(target_long ret)
376 376 return ret;
377 377 }
378 378  
379   -static inline int is_error(target_long ret)
  379 +static inline int is_error(abi_long ret)
380 380 {
381   - return (target_ulong)ret >= (target_ulong)(-4096);
  381 + return (abi_ulong)ret >= (abi_ulong)(-4096);
382 382 }
383 383  
384   -static target_ulong target_brk;
385   -static target_ulong target_original_brk;
  384 +static abi_ulong target_brk;
  385 +static abi_ulong target_original_brk;
386 386  
387   -void target_set_brk(target_ulong new_brk)
  387 +void target_set_brk(abi_ulong new_brk)
388 388 {
389 389 target_original_brk = target_brk = HOST_PAGE_ALIGN(new_brk);
390 390 }
391 391  
392   -target_long do_brk(target_ulong new_brk)
  392 +abi_long do_brk(abi_ulong new_brk)
393 393 {
394   - target_ulong brk_page;
395   - target_long mapped_addr;
  394 + abi_ulong brk_page;
  395 + abi_long mapped_addr;
396 396 int new_alloc_size;
397 397  
398 398 if (!new_brk)
... ... @@ -422,7 +422,7 @@ target_long do_brk(target_ulong new_brk)
422 422 }
423 423  
424 424 static inline fd_set *target_to_host_fds(fd_set *fds,
425   - target_long *target_fds, int n)
  425 + abi_long *target_fds, int n)
426 426 {
427 427 #if !defined(BSWAP_NEEDED) && !defined(WORDS_BIGENDIAN)
428 428 return (fd_set *)target_fds;
... ... @@ -431,8 +431,8 @@ static inline fd_set *target_to_host_fds(fd_set *fds,
431 431 if (target_fds) {
432 432 FD_ZERO(fds);
433 433 for(i = 0;i < n; i++) {
434   - b = (tswapl(target_fds[i / TARGET_LONG_BITS]) >>
435   - (i & (TARGET_LONG_BITS - 1))) & 1;
  434 + b = (tswapl(target_fds[i / TARGET_ABI_BITS]) >>
  435 + (i & (TARGET_ABI_BITS - 1))) & 1;
436 436 if (b)
437 437 FD_SET(i, fds);
438 438 }
... ... @@ -443,21 +443,21 @@ static inline fd_set *target_to_host_fds(fd_set *fds,
443 443 #endif
444 444 }
445 445  
446   -static inline void host_to_target_fds(target_long *target_fds,
  446 +static inline void host_to_target_fds(abi_long *target_fds,
447 447 fd_set *fds, int n)
448 448 {
449 449 #if !defined(BSWAP_NEEDED) && !defined(WORDS_BIGENDIAN)
450 450 /* nothing to do */
451 451 #else
452 452 int i, nw, j, k;
453   - target_long v;
  453 + abi_long v;
454 454  
455 455 if (target_fds) {
456   - nw = (n + TARGET_LONG_BITS - 1) / TARGET_LONG_BITS;
  456 + nw = (n + TARGET_ABI_BITS - 1) / TARGET_ABI_BITS;
457 457 k = 0;
458 458 for(i = 0;i < nw; i++) {
459 459 v = 0;
460   - for(j = 0; j < TARGET_LONG_BITS; j++) {
  460 + for(j = 0; j < TARGET_ABI_BITS; j++) {
461 461 v |= ((FD_ISSET(k, fds) != 0) << j);
462 462 k++;
463 463 }
... ... @@ -473,7 +473,7 @@ static inline void host_to_target_fds(target_long *target_fds,
473 473 #define HOST_HZ 100
474 474 #endif
475 475  
476   -static inline target_long host_to_target_clock_t(long ticks)
  476 +static inline abi_long host_to_target_clock_t(long ticks)
477 477 {
478 478 #if HOST_HZ == TARGET_HZ
479 479 return ticks;
... ... @@ -482,7 +482,7 @@ static inline target_long host_to_target_clock_t(long ticks)
482 482 #endif
483 483 }
484 484  
485   -static inline void host_to_target_rusage(target_ulong target_addr,
  485 +static inline void host_to_target_rusage(abi_ulong target_addr,
486 486 const struct rusage *rusage)
487 487 {
488 488 struct target_rusage *target_rusage;
... ... @@ -510,7 +510,7 @@ static inline void host_to_target_rusage(target_ulong target_addr,
510 510 }
511 511  
512 512 static inline void target_to_host_timeval(struct timeval *tv,
513   - target_ulong target_addr)
  513 + abi_ulong target_addr)
514 514 {
515 515 struct target_timeval *target_tv;
516 516  
... ... @@ -520,7 +520,7 @@ static inline void target_to_host_timeval(struct timeval *tv,
520 520 unlock_user_struct(target_tv, target_addr, 0);
521 521 }
522 522  
523   -static inline void host_to_target_timeval(target_ulong target_addr,
  523 +static inline void host_to_target_timeval(abi_ulong target_addr,
524 524 const struct timeval *tv)
525 525 {
526 526 struct target_timeval *target_tv;
... ... @@ -532,33 +532,33 @@ static inline void host_to_target_timeval(target_ulong target_addr,
532 532 }
533 533  
534 534  
535   -static target_long do_select(int n,
536   - target_ulong rfd_p, target_ulong wfd_p,
537   - target_ulong efd_p, target_ulong target_tv)
  535 +static abi_long do_select(int n,
  536 + abi_ulong rfd_p, abi_ulong wfd_p,
  537 + abi_ulong efd_p, abi_ulong target_tv)
538 538 {
539 539 fd_set rfds, wfds, efds;
540 540 fd_set *rfds_ptr, *wfds_ptr, *efds_ptr;
541   - target_long *target_rfds, *target_wfds, *target_efds;
  541 + abi_long *target_rfds, *target_wfds, *target_efds;
542 542 struct timeval tv, *tv_ptr;
543   - target_long ret;
  543 + abi_long ret;
544 544 int ok;
545 545  
546 546 if (rfd_p) {
547   - target_rfds = lock_user(rfd_p, sizeof(target_long) * n, 1);
  547 + target_rfds = lock_user(rfd_p, sizeof(abi_long) * n, 1);
548 548 rfds_ptr = target_to_host_fds(&rfds, target_rfds, n);
549 549 } else {
550 550 target_rfds = NULL;
551 551 rfds_ptr = NULL;
552 552 }
553 553 if (wfd_p) {
554   - target_wfds = lock_user(wfd_p, sizeof(target_long) * n, 1);
  554 + target_wfds = lock_user(wfd_p, sizeof(abi_long) * n, 1);
555 555 wfds_ptr = target_to_host_fds(&wfds, target_wfds, n);
556 556 } else {
557 557 target_wfds = NULL;
558 558 wfds_ptr = NULL;
559 559 }
560 560 if (efd_p) {
561   - target_efds = lock_user(efd_p, sizeof(target_long) * n, 1);
  561 + target_efds = lock_user(efd_p, sizeof(abi_long) * n, 1);
562 562 efds_ptr = target_to_host_fds(&efds, target_efds, n);
563 563 } else {
564 564 target_efds = NULL;
... ... @@ -584,17 +584,17 @@ static target_long do_select(int n,
584 584 }
585 585 }
586 586 if (target_rfds)
587   - unlock_user(target_rfds, rfd_p, ok ? sizeof(target_long) * n : 0);
  587 + unlock_user(target_rfds, rfd_p, ok ? sizeof(abi_long) * n : 0);
588 588 if (target_wfds)
589   - unlock_user(target_wfds, wfd_p, ok ? sizeof(target_long) * n : 0);
  589 + unlock_user(target_wfds, wfd_p, ok ? sizeof(abi_long) * n : 0);
590 590 if (target_efds)
591   - unlock_user(target_efds, efd_p, ok ? sizeof(target_long) * n : 0);
  591 + unlock_user(target_efds, efd_p, ok ? sizeof(abi_long) * n : 0);
592 592  
593 593 return ret;
594 594 }
595 595  
596 596 static inline void target_to_host_sockaddr(struct sockaddr *addr,
597   - target_ulong target_addr,
  597 + abi_ulong target_addr,
598 598 socklen_t len)
599 599 {
600 600 struct target_sockaddr *target_saddr;
... ... @@ -605,7 +605,7 @@ static inline void target_to_host_sockaddr(struct sockaddr *addr,
605 605 unlock_user(target_saddr, target_addr, 0);
606 606 }
607 607  
608   -static inline void host_to_target_sockaddr(target_ulong target_addr,
  608 +static inline void host_to_target_sockaddr(abi_ulong target_addr,
609 609 struct sockaddr *addr,
610 610 socklen_t len)
611 611 {
... ... @@ -706,10 +706,10 @@ static inline void host_to_target_cmsg(struct target_msghdr *target_msgh,
706 706 msgh->msg_controllen = tswapl(space);
707 707 }
708 708  
709   -static target_long do_setsockopt(int sockfd, int level, int optname,
710   - target_ulong optval, socklen_t optlen)
  709 +static abi_long do_setsockopt(int sockfd, int level, int optname,
  710 + abi_ulong optval, socklen_t optlen)
711 711 {
712   - target_long ret;
  712 + abi_long ret;
713 713 int val;
714 714  
715 715 switch(level) {
... ... @@ -827,10 +827,10 @@ static target_long do_setsockopt(int sockfd, int level, int optname,
827 827 return ret;
828 828 }
829 829  
830   -static target_long do_getsockopt(int sockfd, int level, int optname,
831   - target_ulong optval, target_ulong optlen)
  830 +static abi_long do_getsockopt(int sockfd, int level, int optname,
  831 + abi_ulong optval, abi_ulong optlen)
832 832 {
833   - target_long ret;
  833 + abi_long ret;
834 834 int len, lv, val;
835 835  
836 836 switch(level) {
... ... @@ -916,11 +916,11 @@ static target_long do_getsockopt(int sockfd, int level, int optname,
916 916 return ret;
917 917 }
918 918  
919   -static void lock_iovec(struct iovec *vec, target_ulong target_addr,
  919 +static void lock_iovec(struct iovec *vec, abi_ulong target_addr,
920 920 int count, int copy)
921 921 {
922 922 struct target_iovec *target_vec;
923   - target_ulong base;
  923 + abi_ulong base;
924 924 int i;
925 925  
926 926 target_vec = lock_user(target_addr, count * sizeof(struct target_iovec), 1);
... ... @@ -932,11 +932,11 @@ static void lock_iovec(struct iovec *vec, target_ulong target_addr,
932 932 unlock_user (target_vec, target_addr, 0);
933 933 }
934 934  
935   -static void unlock_iovec(struct iovec *vec, target_ulong target_addr,
  935 +static void unlock_iovec(struct iovec *vec, abi_ulong target_addr,
936 936 int count, int copy)
937 937 {
938 938 struct target_iovec *target_vec;
939   - target_ulong base;
  939 + abi_ulong base;
940 940 int i;
941 941  
942 942 target_vec = lock_user(target_addr, count * sizeof(struct target_iovec), 1);
... ... @@ -947,7 +947,7 @@ static void unlock_iovec(struct iovec *vec, target_ulong target_addr,
947 947 unlock_user (target_vec, target_addr, 0);
948 948 }
949 949  
950   -static target_long do_socket(int domain, int type, int protocol)
  950 +static abi_long do_socket(int domain, int type, int protocol)
951 951 {
952 952 #if defined(TARGET_MIPS)
953 953 switch(type) {
... ... @@ -974,8 +974,8 @@ static target_long do_socket(int domain, int type, int protocol)
974 974 return get_errno(socket(domain, type, protocol));
975 975 }
976 976  
977   -static target_long do_bind(int sockfd, target_ulong target_addr,
978   - socklen_t addrlen)
  977 +static abi_long do_bind(int sockfd, abi_ulong target_addr,
  978 + socklen_t addrlen)
979 979 {
980 980 void *addr = alloca(addrlen);
981 981  
... ... @@ -983,8 +983,8 @@ static target_long do_bind(int sockfd, target_ulong target_addr,
983 983 return get_errno(bind(sockfd, addr, addrlen));
984 984 }
985 985  
986   -static target_long do_connect(int sockfd, target_ulong target_addr,
987   - socklen_t addrlen)
  986 +static abi_long do_connect(int sockfd, abi_ulong target_addr,
  987 + socklen_t addrlen)
988 988 {
989 989 void *addr = alloca(addrlen);
990 990  
... ... @@ -992,15 +992,15 @@ static target_long do_connect(int sockfd, target_ulong target_addr,
992 992 return get_errno(connect(sockfd, addr, addrlen));
993 993 }
994 994  
995   -static target_long do_sendrecvmsg(int fd, target_ulong target_msg,
996   - int flags, int send)
  995 +static abi_long do_sendrecvmsg(int fd, abi_ulong target_msg,
  996 + int flags, int send)
997 997 {
998   - target_long ret;
  998 + abi_long ret;
999 999 struct target_msghdr *msgp;
1000 1000 struct msghdr msg;
1001 1001 int count;
1002 1002 struct iovec *vec;
1003   - target_ulong target_vec;
  1003 + abi_ulong target_vec;
1004 1004  
1005 1005 lock_user_struct(msgp, target_msg, 1);
1006 1006 if (msgp->msg_name) {
... ... @@ -1035,12 +1035,12 @@ static target_long do_sendrecvmsg(int fd, target_ulong target_msg,
1035 1035 return ret;
1036 1036 }
1037 1037  
1038   -static target_long do_accept(int fd, target_ulong target_addr,
1039   - target_ulong target_addrlen)
  1038 +static abi_long do_accept(int fd, abi_ulong target_addr,
  1039 + abi_ulong target_addrlen)
1040 1040 {
1041 1041 socklen_t addrlen = tget32(target_addrlen);
1042 1042 void *addr = alloca(addrlen);
1043   - target_long ret;
  1043 + abi_long ret;
1044 1044  
1045 1045 ret = get_errno(accept(fd, addr, &addrlen));
1046 1046 if (!is_error(ret)) {
... ... @@ -1050,12 +1050,12 @@ static target_long do_accept(int fd, target_ulong target_addr,
1050 1050 return ret;
1051 1051 }
1052 1052  
1053   -static target_long do_getpeername(int fd, target_ulong target_addr,
1054   - target_ulong target_addrlen)
  1053 +static abi_long do_getpeername(int fd, abi_ulong target_addr,
  1054 + abi_ulong target_addrlen)
1055 1055 {
1056 1056 socklen_t addrlen = tget32(target_addrlen);
1057 1057 void *addr = alloca(addrlen);
1058   - target_long ret;
  1058 + abi_long ret;
1059 1059  
1060 1060 ret = get_errno(getpeername(fd, addr, &addrlen));
1061 1061 if (!is_error(ret)) {
... ... @@ -1065,12 +1065,12 @@ static target_long do_getpeername(int fd, target_ulong target_addr,
1065 1065 return ret;
1066 1066 }
1067 1067  
1068   -static target_long do_getsockname(int fd, target_ulong target_addr,
1069   - target_ulong target_addrlen)
  1068 +static abi_long do_getsockname(int fd, abi_ulong target_addr,
  1069 + abi_ulong target_addrlen)
1070 1070 {
1071 1071 socklen_t addrlen = tget32(target_addrlen);
1072 1072 void *addr = alloca(addrlen);
1073   - target_long ret;
  1073 + abi_long ret;
1074 1074  
1075 1075 ret = get_errno(getsockname(fd, addr, &addrlen));
1076 1076 if (!is_error(ret)) {
... ... @@ -1080,11 +1080,11 @@ static target_long do_getsockname(int fd, target_ulong target_addr,
1080 1080 return ret;
1081 1081 }
1082 1082  
1083   -static target_long do_socketpair(int domain, int type, int protocol,
1084   - target_ulong target_tab)
  1083 +static abi_long do_socketpair(int domain, int type, int protocol,
  1084 + abi_ulong target_tab)
1085 1085 {
1086 1086 int tab[2];
1087   - target_long ret;
  1087 + abi_long ret;
1088 1088  
1089 1089 ret = get_errno(socketpair(domain, type, protocol, tab));
1090 1090 if (!is_error(ret)) {
... ... @@ -1094,12 +1094,12 @@ static target_long do_socketpair(int domain, int type, int protocol,
1094 1094 return ret;
1095 1095 }
1096 1096  
1097   -static target_long do_sendto(int fd, target_ulong msg, size_t len, int flags,
1098   - target_ulong target_addr, socklen_t addrlen)
  1097 +static abi_long do_sendto(int fd, abi_ulong msg, size_t len, int flags,
  1098 + abi_ulong target_addr, socklen_t addrlen)
1099 1099 {
1100 1100 void *addr;
1101 1101 void *host_msg;
1102   - target_long ret;
  1102 + abi_long ret;
1103 1103  
1104 1104 host_msg = lock_user(msg, len, 1);
1105 1105 if (target_addr) {
... ... @@ -1113,14 +1113,14 @@ static target_long do_sendto(int fd, target_ulong msg, size_t len, int flags,
1113 1113 return ret;
1114 1114 }
1115 1115  
1116   -static target_long do_recvfrom(int fd, target_ulong msg, size_t len, int flags,
1117   - target_ulong target_addr,
1118   - target_ulong target_addrlen)
  1116 +static abi_long do_recvfrom(int fd, abi_ulong msg, size_t len, int flags,
  1117 + abi_ulong target_addr,
  1118 + abi_ulong target_addrlen)
1119 1119 {
1120 1120 socklen_t addrlen;
1121 1121 void *addr;
1122 1122 void *host_msg;
1123   - target_long ret;
  1123 + abi_long ret;
1124 1124  
1125 1125 host_msg = lock_user(msg, len, 0);
1126 1126 if (target_addr) {
... ... @@ -1144,10 +1144,10 @@ static target_long do_recvfrom(int fd, target_ulong msg, size_t len, int flags,
1144 1144 }
1145 1145  
1146 1146 #ifdef TARGET_NR_socketcall
1147   -static target_long do_socketcall(int num, target_ulong vptr)
  1147 +static abi_long do_socketcall(int num, abi_ulong vptr)
1148 1148 {
1149   - target_long ret;
1150   - const int n = sizeof(target_ulong);
  1149 + abi_long ret;
  1150 + const int n = sizeof(abi_ulong);
1151 1151  
1152 1152 switch(num) {
1153 1153 case SOCKOP_socket:
... ... @@ -1161,7 +1161,7 @@ static target_long do_socketcall(int num, target_ulong vptr)
1161 1161 case SOCKOP_bind:
1162 1162 {
1163 1163 int sockfd = tgetl(vptr);
1164   - target_ulong target_addr = tgetl(vptr + n);
  1164 + abi_ulong target_addr = tgetl(vptr + n);
1165 1165 socklen_t addrlen = tgetl(vptr + 2 * n);
1166 1166 ret = do_bind(sockfd, target_addr, addrlen);
1167 1167 }
... ... @@ -1169,7 +1169,7 @@ static target_long do_socketcall(int num, target_ulong vptr)
1169 1169 case SOCKOP_connect:
1170 1170 {
1171 1171 int sockfd = tgetl(vptr);
1172   - target_ulong target_addr = tgetl(vptr + n);
  1172 + abi_ulong target_addr = tgetl(vptr + n);
1173 1173 socklen_t addrlen = tgetl(vptr + 2 * n);
1174 1174 ret = do_connect(sockfd, target_addr, addrlen);
1175 1175 }
... ... @@ -1184,24 +1184,24 @@ static target_long do_socketcall(int num, target_ulong vptr)
1184 1184 case SOCKOP_accept:
1185 1185 {
1186 1186 int sockfd = tgetl(vptr);
1187   - target_ulong target_addr = tgetl(vptr + n);
1188   - target_ulong target_addrlen = tgetl(vptr + 2 * n);
  1187 + abi_ulong target_addr = tgetl(vptr + n);
  1188 + abi_ulong target_addrlen = tgetl(vptr + 2 * n);
1189 1189 ret = do_accept(sockfd, target_addr, target_addrlen);
1190 1190 }
1191 1191 break;
1192 1192 case SOCKOP_getsockname:
1193 1193 {
1194 1194 int sockfd = tgetl(vptr);
1195   - target_ulong target_addr = tgetl(vptr + n);
1196   - target_ulong target_addrlen = tgetl(vptr + 2 * n);
  1195 + abi_ulong target_addr = tgetl(vptr + n);
  1196 + abi_ulong target_addrlen = tgetl(vptr + 2 * n);
1197 1197 ret = do_getsockname(sockfd, target_addr, target_addrlen);
1198 1198 }
1199 1199 break;
1200 1200 case SOCKOP_getpeername:
1201 1201 {
1202 1202 int sockfd = tgetl(vptr);
1203   - target_ulong target_addr = tgetl(vptr + n);
1204   - target_ulong target_addrlen = tgetl(vptr + 2 * n);
  1203 + abi_ulong target_addr = tgetl(vptr + n);
  1204 + abi_ulong target_addrlen = tgetl(vptr + 2 * n);
1205 1205 ret = do_getpeername(sockfd, target_addr, target_addrlen);
1206 1206 }
1207 1207 break;
... ... @@ -1210,14 +1210,14 @@ static target_long do_socketcall(int num, target_ulong vptr)
1210 1210 int domain = tgetl(vptr);
1211 1211 int type = tgetl(vptr + n);
1212 1212 int protocol = tgetl(vptr + 2 * n);
1213   - target_ulong tab = tgetl(vptr + 3 * n);
  1213 + abi_ulong tab = tgetl(vptr + 3 * n);
1214 1214 ret = do_socketpair(domain, type, protocol, tab);
1215 1215 }
1216 1216 break;
1217 1217 case SOCKOP_send:
1218 1218 {
1219 1219 int sockfd = tgetl(vptr);
1220   - target_ulong msg = tgetl(vptr + n);
  1220 + abi_ulong msg = tgetl(vptr + n);
1221 1221 size_t len = tgetl(vptr + 2 * n);
1222 1222 int flags = tgetl(vptr + 3 * n);
1223 1223 ret = do_sendto(sockfd, msg, len, flags, 0, 0);
... ... @@ -1226,7 +1226,7 @@ static target_long do_socketcall(int num, target_ulong vptr)
1226 1226 case SOCKOP_recv:
1227 1227 {
1228 1228 int sockfd = tgetl(vptr);
1229   - target_ulong msg = tgetl(vptr + n);
  1229 + abi_ulong msg = tgetl(vptr + n);
1230 1230 size_t len = tgetl(vptr + 2 * n);
1231 1231 int flags = tgetl(vptr + 3 * n);
1232 1232 ret = do_recvfrom(sockfd, msg, len, flags, 0, 0);
... ... @@ -1235,10 +1235,10 @@ static target_long do_socketcall(int num, target_ulong vptr)
1235 1235 case SOCKOP_sendto:
1236 1236 {
1237 1237 int sockfd = tgetl(vptr);
1238   - target_ulong msg = tgetl(vptr + n);
  1238 + abi_ulong msg = tgetl(vptr + n);
1239 1239 size_t len = tgetl(vptr + 2 * n);
1240 1240 int flags = tgetl(vptr + 3 * n);
1241   - target_ulong addr = tgetl(vptr + 4 * n);
  1241 + abi_ulong addr = tgetl(vptr + 4 * n);
1242 1242 socklen_t addrlen = tgetl(vptr + 5 * n);
1243 1243 ret = do_sendto(sockfd, msg, len, flags, addr, addrlen);
1244 1244 }
... ... @@ -1246,11 +1246,11 @@ static target_long do_socketcall(int num, target_ulong vptr)
1246 1246 case SOCKOP_recvfrom:
1247 1247 {
1248 1248 int sockfd = tgetl(vptr);
1249   - target_ulong msg = tgetl(vptr + n);
  1249 + abi_ulong msg = tgetl(vptr + n);
1250 1250 size_t len = tgetl(vptr + 2 * n);
1251 1251 int flags = tgetl(vptr + 3 * n);
1252   - target_ulong addr = tgetl(vptr + 4 * n);
1253   - target_ulong addrlen = tgetl(vptr + 5 * n);
  1252 + abi_ulong addr = tgetl(vptr + 4 * n);
  1253 + abi_ulong addrlen = tgetl(vptr + 5 * n);
1254 1254 ret = do_recvfrom(sockfd, msg, len, flags, addr, addrlen);
1255 1255 }
1256 1256 break;
... ... @@ -1266,7 +1266,7 @@ static target_long do_socketcall(int num, target_ulong vptr)
1266 1266 case SOCKOP_recvmsg:
1267 1267 {
1268 1268 int fd;
1269   - target_ulong target_msg;
  1269 + abi_ulong target_msg;
1270 1270 int flags;
1271 1271  
1272 1272 fd = tgetl(vptr);
... ... @@ -1282,7 +1282,7 @@ static target_long do_socketcall(int num, target_ulong vptr)
1282 1282 int sockfd = tgetl(vptr);
1283 1283 int level = tgetl(vptr + n);
1284 1284 int optname = tgetl(vptr + 2 * n);
1285   - target_ulong optval = tgetl(vptr + 3 * n);
  1285 + abi_ulong optval = tgetl(vptr + 3 * n);
1286 1286 socklen_t optlen = tgetl(vptr + 4 * n);
1287 1287  
1288 1288 ret = do_setsockopt(sockfd, level, optname, optval, optlen);
... ... @@ -1293,8 +1293,8 @@ static target_long do_socketcall(int num, target_ulong vptr)
1293 1293 int sockfd = tgetl(vptr);
1294 1294 int level = tgetl(vptr + n);
1295 1295 int optname = tgetl(vptr + 2 * n);
1296   - target_ulong optval = tgetl(vptr + 3 * n);
1297   - target_ulong poptlen = tgetl(vptr + 4 * n);
  1296 + abi_ulong optval = tgetl(vptr + 3 * n);
  1297 + abi_ulong poptlen = tgetl(vptr + 4 * n);
1298 1298  
1299 1299 ret = do_getsockopt(sockfd, level, optname, optval, poptlen);
1300 1300 }
... ... @@ -1318,33 +1318,33 @@ static struct shm_region {
1318 1318  
1319 1319 struct target_ipc_perm
1320 1320 {
1321   - target_long __key;
1322   - target_ulong uid;
1323   - target_ulong gid;
1324   - target_ulong cuid;
1325   - target_ulong cgid;
  1321 + abi_long __key;
  1322 + abi_ulong uid;
  1323 + abi_ulong gid;
  1324 + abi_ulong cuid;
  1325 + abi_ulong cgid;
1326 1326 unsigned short int mode;
1327 1327 unsigned short int __pad1;
1328 1328 unsigned short int __seq;
1329 1329 unsigned short int __pad2;
1330   - target_ulong __unused1;
1331   - target_ulong __unused2;
  1330 + abi_ulong __unused1;
  1331 + abi_ulong __unused2;
1332 1332 };
1333 1333  
1334 1334 struct target_semid_ds
1335 1335 {
1336 1336 struct target_ipc_perm sem_perm;
1337   - target_ulong sem_otime;
1338   - target_ulong __unused1;
1339   - target_ulong sem_ctime;
1340   - target_ulong __unused2;
1341   - target_ulong sem_nsems;
1342   - target_ulong __unused3;
1343   - target_ulong __unused4;
  1337 + abi_ulong sem_otime;
  1338 + abi_ulong __unused1;
  1339 + abi_ulong sem_ctime;
  1340 + abi_ulong __unused2;
  1341 + abi_ulong sem_nsems;
  1342 + abi_ulong __unused3;
  1343 + abi_ulong __unused4;
1344 1344 };
1345 1345  
1346 1346 static inline void target_to_host_ipc_perm(struct ipc_perm *host_ip,
1347   - target_ulong target_addr)
  1347 + abi_ulong target_addr)
1348 1348 {
1349 1349 struct target_ipc_perm *target_ip;
1350 1350 struct target_semid_ds *target_sd;
... ... @@ -1360,7 +1360,7 @@ static inline void target_to_host_ipc_perm(struct ipc_perm *host_ip,
1360 1360 unlock_user_struct(target_sd, target_addr, 0);
1361 1361 }
1362 1362  
1363   -static inline void host_to_target_ipc_perm(target_ulong target_addr,
  1363 +static inline void host_to_target_ipc_perm(abi_ulong target_addr,
1364 1364 struct ipc_perm *host_ip)
1365 1365 {
1366 1366 struct target_ipc_perm *target_ip;
... ... @@ -1378,7 +1378,7 @@ static inline void host_to_target_ipc_perm(target_ulong target_addr,
1378 1378 }
1379 1379  
1380 1380 static inline void target_to_host_semid_ds(struct semid_ds *host_sd,
1381   - target_ulong target_addr)
  1381 + abi_ulong target_addr)
1382 1382 {
1383 1383 struct target_semid_ds *target_sd;
1384 1384  
... ... @@ -1390,7 +1390,7 @@ static inline void target_to_host_semid_ds(struct semid_ds *host_sd,
1390 1390 unlock_user_struct(target_sd, target_addr, 0);
1391 1391 }
1392 1392  
1393   -static inline void host_to_target_semid_ds(target_ulong target_addr,
  1393 +static inline void host_to_target_semid_ds(abi_ulong target_addr,
1394 1394 struct semid_ds *host_sd)
1395 1395 {
1396 1396 struct target_semid_ds *target_sd;
... ... @@ -1411,13 +1411,13 @@ union semun {
1411 1411  
1412 1412 union target_semun {
1413 1413 int val;
1414   - target_long buf;
  1414 + abi_long buf;
1415 1415 unsigned short int *array;
1416 1416 };
1417 1417  
1418 1418 static inline void target_to_host_semun(int cmd,
1419 1419 union semun *host_su,
1420   - target_ulong target_addr,
  1420 + abi_ulong target_addr,
1421 1421 struct semid_ds *ds)
1422 1422 {
1423 1423 union target_semun *target_su;
... ... @@ -1448,7 +1448,7 @@ static inline void target_to_host_semun(int cmd,
1448 1448 }
1449 1449  
1450 1450 static inline void host_to_target_semun(int cmd,
1451   - target_ulong target_addr,
  1451 + abi_ulong target_addr,
1452 1452 union semun *host_su,
1453 1453 struct semid_ds *ds)
1454 1454 {
... ... @@ -1478,13 +1478,13 @@ static inline void host_to_target_semun(int cmd,
1478 1478 }
1479 1479 }
1480 1480  
1481   -static inline target_long do_semctl(int first, int second, int third,
1482   - target_long ptr)
  1481 +static inline abi_long do_semctl(int first, int second, int third,
  1482 + abi_long ptr)
1483 1483 {
1484 1484 union semun arg;
1485 1485 struct semid_ds dsarg;
1486 1486 int cmd = third&0xff;
1487   - target_long ret = 0;
  1487 + abi_long ret = 0;
1488 1488  
1489 1489 switch( cmd ) {
1490 1490 case GETVAL:
... ... @@ -1527,23 +1527,23 @@ static inline target_long do_semctl(int first, int second, int third,
1527 1527 struct target_msqid_ds
1528 1528 {
1529 1529 struct target_ipc_perm msg_perm;
1530   - target_ulong msg_stime;
1531   - target_ulong __unused1;
1532   - target_ulong msg_rtime;
1533   - target_ulong __unused2;
1534   - target_ulong msg_ctime;
1535   - target_ulong __unused3;
1536   - target_ulong __msg_cbytes;
1537   - target_ulong msg_qnum;
1538   - target_ulong msg_qbytes;
1539   - target_ulong msg_lspid;
1540   - target_ulong msg_lrpid;
1541   - target_ulong __unused4;
1542   - target_ulong __unused5;
  1530 + abi_ulong msg_stime;
  1531 + abi_ulong __unused1;
  1532 + abi_ulong msg_rtime;
  1533 + abi_ulong __unused2;
  1534 + abi_ulong msg_ctime;
  1535 + abi_ulong __unused3;
  1536 + abi_ulong __msg_cbytes;
  1537 + abi_ulong msg_qnum;
  1538 + abi_ulong msg_qbytes;
  1539 + abi_ulong msg_lspid;
  1540 + abi_ulong msg_lrpid;
  1541 + abi_ulong __unused4;
  1542 + abi_ulong __unused5;
1543 1543 };
1544 1544  
1545 1545 static inline void target_to_host_msqid_ds(struct msqid_ds *host_md,
1546   - target_ulong target_addr)
  1546 + abi_ulong target_addr)
1547 1547 {
1548 1548 struct target_msqid_ds *target_md;
1549 1549  
... ... @@ -1560,7 +1560,7 @@ static inline void target_to_host_msqid_ds(struct msqid_ds *host_md,
1560 1560 unlock_user_struct(target_md, target_addr, 0);
1561 1561 }
1562 1562  
1563   -static inline void host_to_target_msqid_ds(target_ulong target_addr,
  1563 +static inline void host_to_target_msqid_ds(abi_ulong target_addr,
1564 1564 struct msqid_ds *host_md)
1565 1565 {
1566 1566 struct target_msqid_ds *target_md;
... ... @@ -1578,11 +1578,11 @@ static inline void host_to_target_msqid_ds(target_ulong target_addr,
1578 1578 unlock_user_struct(target_md, target_addr, 1);
1579 1579 }
1580 1580  
1581   -static inline target_long do_msgctl(int first, int second, target_long ptr)
  1581 +static inline abi_long do_msgctl(int first, int second, abi_long ptr)
1582 1582 {
1583 1583 struct msqid_ds dsarg;
1584 1584 int cmd = second&0xff;
1585   - target_long ret = 0;
  1585 + abi_long ret = 0;
1586 1586 switch( cmd ) {
1587 1587 case IPC_STAT:
1588 1588 case IPC_SET:
... ... @@ -1596,16 +1596,16 @@ static inline target_long do_msgctl(int first, int second, target_long ptr)
1596 1596 }
1597 1597  
1598 1598 struct target_msgbuf {
1599   - target_ulong mtype;
  1599 + abi_ulong mtype;
1600 1600 char mtext[1];
1601 1601 };
1602 1602  
1603   -static inline target_long do_msgsnd(int msqid, target_long msgp,
1604   - unsigned int msgsz, int msgflg)
  1603 +static inline abi_long do_msgsnd(int msqid, abi_long msgp,
  1604 + unsigned int msgsz, int msgflg)
1605 1605 {
1606 1606 struct target_msgbuf *target_mb;
1607 1607 struct msgbuf *host_mb;
1608   - target_long ret = 0;
  1608 + abi_long ret = 0;
1609 1609  
1610 1610 lock_user_struct(target_mb,msgp,0);
1611 1611 host_mb = malloc(msgsz+sizeof(long));
... ... @@ -1618,13 +1618,13 @@ static inline target_long do_msgsnd(int msqid, target_long msgp,
1618 1618 return ret;
1619 1619 }
1620 1620  
1621   -static inline target_long do_msgrcv(int msqid, target_long msgp,
1622   - unsigned int msgsz, int msgtype,
1623   - int msgflg)
  1621 +static inline abi_long do_msgrcv(int msqid, abi_long msgp,
  1622 + unsigned int msgsz, int msgtype,
  1623 + int msgflg)
1624 1624 {
1625 1625 struct target_msgbuf *target_mb;
1626 1626 struct msgbuf *host_mb;
1627   - target_long ret = 0;
  1627 + abi_long ret = 0;
1628 1628  
1629 1629 lock_user_struct(target_mb, msgp, 0);
1630 1630 host_mb = malloc(msgsz+sizeof(long));
... ... @@ -1639,12 +1639,12 @@ static inline target_long do_msgrcv(int msqid, target_long msgp,
1639 1639 }
1640 1640  
1641 1641 /* ??? This only works with linear mappings. */
1642   -static target_long do_ipc(unsigned int call, int first,
1643   - int second, int third,
1644   - target_long ptr, target_long fifth)
  1642 +static abi_long do_ipc(unsigned int call, int first,
  1643 + int second, int third,
  1644 + abi_long ptr, abi_long fifth)
1645 1645 {
1646 1646 int version;
1647   - target_long ret = 0;
  1647 + abi_long ret = 0;
1648 1648 unsigned long raddr;
1649 1649 struct shmid_ds shm_info;
1650 1650 int i;
... ... @@ -1722,7 +1722,7 @@ static target_long do_ipc(unsigned int call, int first,
1722 1722 break;
1723 1723 }
1724 1724 }
1725   - if (put_user(raddr, (target_ulong *)third))
  1725 + if (put_user(raddr, (abi_ulong *)third))
1726 1726 return -EFAULT;
1727 1727 ret = 0;
1728 1728 break;
... ... @@ -1803,11 +1803,11 @@ IOCTLEntry ioctl_entries[] = {
1803 1803 };
1804 1804  
1805 1805 /* ??? Implement proper locking for ioctls. */
1806   -static target_long do_ioctl(int fd, target_long cmd, target_long arg)
  1806 +static abi_long do_ioctl(int fd, abi_long cmd, abi_long arg)
1807 1807 {
1808 1808 const IOCTLEntry *ie;
1809 1809 const argtype *arg_type;
1810   - target_long ret;
  1810 + abi_long ret;
1811 1811 uint8_t buf_temp[MAX_STRUCT_SIZE];
1812 1812 int target_size;
1813 1813 void *argptr;
... ... @@ -2088,7 +2088,7 @@ static bitmask_transtbl fcntl_flags_tbl[] = {
2088 2088 /* NOTE: there is really one LDT for all the threads */
2089 2089 uint8_t *ldt_table;
2090 2090  
2091   -static int read_ldt(target_ulong ptr, unsigned long bytecount)
  2091 +static int read_ldt(abi_ulong ptr, unsigned long bytecount)
2092 2092 {
2093 2093 int size;
2094 2094 void *p;
... ... @@ -2107,7 +2107,7 @@ static int read_ldt(target_ulong ptr, unsigned long bytecount)
2107 2107  
2108 2108 /* XXX: add locking support */
2109 2109 static int write_ldt(CPUX86State *env,
2110   - target_ulong ptr, unsigned long bytecount, int oldmode)
  2110 + abi_ulong ptr, unsigned long bytecount, int oldmode)
2111 2111 {
2112 2112 struct target_modify_ldt_ldt_s ldt_info;
2113 2113 struct target_modify_ldt_ldt_s *target_ldt_info;
... ... @@ -2188,7 +2188,7 @@ install:
2188 2188 }
2189 2189  
2190 2190 /* specific and weird i386 syscalls */
2191   -int do_modify_ldt(CPUX86State *env, int func, target_ulong ptr, unsigned long bytecount)
  2191 +int do_modify_ldt(CPUX86State *env, int func, abi_ulong ptr, unsigned long bytecount)
2192 2192 {
2193 2193 int ret = -ENOSYS;
2194 2194  
... ... @@ -2220,7 +2220,7 @@ static int clone_func(void *arg)
2220 2220 return 0;
2221 2221 }
2222 2222  
2223   -int do_fork(CPUState *env, unsigned int flags, target_ulong newsp)
  2223 +int do_fork(CPUState *env, unsigned int flags, abi_ulong newsp)
2224 2224 {
2225 2225 int ret;
2226 2226 TaskState *ts;
... ... @@ -2310,13 +2310,13 @@ int do_fork(CPUState *env, unsigned int flags, target_ulong newsp)
2310 2310 return ret;
2311 2311 }
2312 2312  
2313   -static target_long do_fcntl(int fd, int cmd, target_ulong arg)
  2313 +static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)
2314 2314 {
2315 2315 struct flock fl;
2316 2316 struct target_flock *target_fl;
2317 2317 struct flock64 fl64;
2318 2318 struct target_flock64 *target_fl64;
2319   - target_long ret;
  2319 + abi_long ret;
2320 2320  
2321 2321 switch(cmd) {
2322 2322 case TARGET_F_GETLK:
... ... @@ -2475,7 +2475,7 @@ void syscall_init(void)
2475 2475 }
2476 2476 }
2477 2477  
2478   -#if TARGET_LONG_BITS == 32
  2478 +#if TARGET_ABI_BITS == 32
2479 2479 static inline uint64_t target_offset64(uint32_t word0, uint32_t word1)
2480 2480 {
2481 2481 #ifdef TARGET_WORDS_BIG_ENDIAN
... ... @@ -2484,18 +2484,18 @@ static inline uint64_t target_offset64(uint32_t word0, uint32_t word1)
2484 2484 return ((uint64_t)word1 << 32) | word0;
2485 2485 #endif
2486 2486 }
2487   -#else /* TARGET_LONG_BITS == 32 */
  2487 +#else /* TARGET_ABI_BITS == 32 */
2488 2488 static inline uint64_t target_offset64(uint64_t word0, uint64_t word1)
2489 2489 {
2490 2490 return word0;
2491 2491 }
2492   -#endif /* TARGET_LONG_BITS != 32 */
  2492 +#endif /* TARGET_ABI_BITS != 32 */
2493 2493  
2494 2494 #ifdef TARGET_NR_truncate64
2495   -static inline target_long target_truncate64(void *cpu_env, const char *arg1,
2496   - target_long arg2,
2497   - target_long arg3,
2498   - target_long arg4)
  2495 +static inline abi_long target_truncate64(void *cpu_env, const char *arg1,
  2496 + abi_long arg2,
  2497 + abi_long arg3,
  2498 + abi_long arg4)
2499 2499 {
2500 2500 #ifdef TARGET_ARM
2501 2501 if (((CPUARMState *)cpu_env)->eabi)
... ... @@ -2509,10 +2509,10 @@ static inline target_long target_truncate64(void *cpu_env, const char *arg1,
2509 2509 #endif
2510 2510  
2511 2511 #ifdef TARGET_NR_ftruncate64
2512   -static inline target_long target_ftruncate64(void *cpu_env, target_long arg1,
2513   - target_long arg2,
2514   - target_long arg3,
2515   - target_long arg4)
  2512 +static inline abi_long target_ftruncate64(void *cpu_env, abi_long arg1,
  2513 + abi_long arg2,
  2514 + abi_long arg3,
  2515 + abi_long arg4)
2516 2516 {
2517 2517 #ifdef TARGET_ARM
2518 2518 if (((CPUARMState *)cpu_env)->eabi)
... ... @@ -2526,7 +2526,7 @@ static inline target_long target_ftruncate64(void *cpu_env, target_long arg1,
2526 2526 #endif
2527 2527  
2528 2528 static inline void target_to_host_timespec(struct timespec *host_ts,
2529   - target_ulong target_addr)
  2529 + abi_ulong target_addr)
2530 2530 {
2531 2531 struct target_timespec *target_ts;
2532 2532  
... ... @@ -2536,7 +2536,7 @@ static inline void target_to_host_timespec(struct timespec *host_ts,
2536 2536 unlock_user_struct(target_ts, target_addr, 0);
2537 2537 }
2538 2538  
2539   -static inline void host_to_target_timespec(target_ulong target_addr,
  2539 +static inline void host_to_target_timespec(abi_ulong target_addr,
2540 2540 struct timespec *host_ts)
2541 2541 {
2542 2542 struct target_timespec *target_ts;
... ... @@ -2547,11 +2547,11 @@ static inline void host_to_target_timespec(target_ulong target_addr,
2547 2547 unlock_user_struct(target_ts, target_addr, 1);
2548 2548 }
2549 2549  
2550   -target_long do_syscall(void *cpu_env, int num, target_long arg1,
2551   - target_long arg2, target_long arg3, target_long arg4,
2552   - target_long arg5, target_long arg6)
  2550 +abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
  2551 + abi_long arg2, abi_long arg3, abi_long arg4,
  2552 + abi_long arg5, abi_long arg6)
2553 2553 {
2554   - target_long ret;
  2554 + abi_long ret;
2555 2555 struct stat st;
2556 2556 struct statfs stfs;
2557 2557 void *p;
... ... @@ -2687,10 +2687,10 @@ target_long do_syscall(void *cpu_env, int num, target_long arg1,
2687 2687 {
2688 2688 char **argp, **envp;
2689 2689 int argc, envc;
2690   - target_ulong gp;
2691   - target_ulong guest_argp;
2692   - target_ulong guest_envp;
2693   - target_ulong addr;
  2690 + abi_ulong gp;
  2691 + abi_ulong guest_argp;
  2692 + abi_ulong guest_envp;
  2693 + abi_ulong addr;
2694 2694 char **q;
2695 2695  
2696 2696 argc = 0;
... ... @@ -2706,7 +2706,7 @@ target_long do_syscall(void *cpu_env, int num, target_long arg1,
2706 2706 envp = alloca((envc + 1) * sizeof(void *));
2707 2707  
2708 2708 for (gp = guest_argp, q = argp; ;
2709   - gp += sizeof(target_ulong), q++) {
  2709 + gp += sizeof(abi_ulong), q++) {
2710 2710 addr = tgetl(gp);
2711 2711 if (!addr)
2712 2712 break;
... ... @@ -2715,7 +2715,7 @@ target_long do_syscall(void *cpu_env, int num, target_long arg1,
2715 2715 *q = NULL;
2716 2716  
2717 2717 for (gp = guest_envp, q = envp; ;
2718   - gp += sizeof(target_ulong), q++) {
  2718 + gp += sizeof(abi_ulong), q++) {
2719 2719 addr = tgetl(gp);
2720 2720 if (!addr)
2721 2721 break;
... ... @@ -2728,12 +2728,12 @@ target_long do_syscall(void *cpu_env, int num, target_long arg1,
2728 2728 unlock_user(p, arg1, 0);
2729 2729  
2730 2730 for (gp = guest_argp, q = argp; *q;
2731   - gp += sizeof(target_ulong), q++) {
  2731 + gp += sizeof(abi_ulong), q++) {
2732 2732 addr = tgetl(gp);
2733 2733 unlock_user(*q, addr, 0);
2734 2734 }
2735 2735 for (gp = guest_envp, q = envp; *q;
2736   - gp += sizeof(target_ulong), q++) {
  2736 + gp += sizeof(abi_ulong), q++) {
2737 2737 addr = tgetl(gp);
2738 2738 unlock_user(*q, addr, 0);
2739 2739 }
... ... @@ -3163,7 +3163,7 @@ target_long do_syscall(void *cpu_env, int num, target_long arg1,
3163 3163 case TARGET_NR_sgetmask:
3164 3164 {
3165 3165 sigset_t cur_set;
3166   - target_ulong target_set;
  3166 + abi_ulong target_set;
3167 3167 sigprocmask(0, NULL, &cur_set);
3168 3168 host_to_target_old_sigset(&target_set, &cur_set);
3169 3169 ret = target_set;
... ... @@ -3174,7 +3174,7 @@ target_long do_syscall(void *cpu_env, int num, target_long arg1,
3174 3174 case TARGET_NR_ssetmask:
3175 3175 {
3176 3176 sigset_t set, oset, cur_set;
3177   - target_ulong target_set = arg1;
  3177 + abi_ulong target_set = arg1;
3178 3178 sigprocmask(0, NULL, &cur_set);
3179 3179 target_to_host_old_sigset(&set, &target_set);
3180 3180 sigorset(&set, &set, &cur_set);
... ... @@ -3407,7 +3407,7 @@ target_long do_syscall(void *cpu_env, int num, target_long arg1,
3407 3407 case TARGET_NR_select:
3408 3408 {
3409 3409 struct target_sel_arg_struct *sel;
3410   - target_ulong inp, outp, exp, tvp;
  3410 + abi_ulong inp, outp, exp, tvp;
3411 3411 long nsel;
3412 3412  
3413 3413 lock_user_struct(sel, arg1, 1);
... ... @@ -3510,9 +3510,9 @@ target_long do_syscall(void *cpu_env, int num, target_long arg1,
3510 3510 case TARGET_NR_mmap:
3511 3511 #if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_M68K) || defined(TARGET_CRIS)
3512 3512 {
3513   - target_ulong *v;
3514   - target_ulong v1, v2, v3, v4, v5, v6;
3515   - v = lock_user(arg1, 6 * sizeof(target_ulong), 1);
  3513 + abi_ulong *v;
  3514 + abi_ulong v1, v2, v3, v4, v5, v6;
  3515 + v = lock_user(arg1, 6 * sizeof(abi_ulong), 1);
3516 3516 v1 = tswapl(v[0]);
3517 3517 v2 = tswapl(v[1]);
3518 3518 v3 = tswapl(v[2]);
... ... @@ -3829,7 +3829,7 @@ target_long do_syscall(void *cpu_env, int num, target_long arg1,
3829 3829 struct target_stat *target_st;
3830 3830  
3831 3831 lock_user_struct(target_st, arg2, 0);
3832   -#if defined(TARGET_MIPS) || defined(TARGET_SPARC64)
  3832 +#if defined(TARGET_MIPS) || (defined(TARGET_SPARC64) && !defined(TARGET_ABI32))
3833 3833 target_st->st_dev = tswap32(st.st_dev);
3834 3834 #else
3835 3835 target_st->st_dev = tswap16(st.st_dev);
... ... @@ -3839,7 +3839,7 @@ target_long do_syscall(void *cpu_env, int num, target_long arg1,
3839 3839 target_st->st_mode = tswapl(st.st_mode); /* XXX: check this */
3840 3840 target_st->st_uid = tswap32(st.st_uid);
3841 3841 target_st->st_gid = tswap32(st.st_gid);
3842   -#elif defined(TARGET_SPARC64)
  3842 +#elif defined(TARGET_SPARC64) && !defined(TARGET_ABI32)
3843 3843 target_st->st_mode = tswap32(st.st_mode);
3844 3844 target_st->st_uid = tswap32(st.st_uid);
3845 3845 target_st->st_gid = tswap32(st.st_gid);
... ... @@ -3852,7 +3852,7 @@ target_long do_syscall(void *cpu_env, int num, target_long arg1,
3852 3852 /* If this is the same on PPC, then just merge w/ the above ifdef */
3853 3853 target_st->st_nlink = tswapl(st.st_nlink);
3854 3854 target_st->st_rdev = tswapl(st.st_rdev);
3855   -#elif defined(TARGET_SPARC64)
  3855 +#elif defined(TARGET_SPARC64) && !defined(TARGET_ABI32)
3856 3856 target_st->st_nlink = tswap32(st.st_nlink);
3857 3857 target_st->st_rdev = tswap32(st.st_rdev);
3858 3858 #else
... ... @@ -3892,9 +3892,9 @@ target_long do_syscall(void *cpu_env, int num, target_long arg1,
3892 3892 case TARGET_NR_wait4:
3893 3893 {
3894 3894 int status;
3895   - target_long status_ptr = arg2;
  3895 + abi_long status_ptr = arg2;
3896 3896 struct rusage rusage, *rusage_ptr;
3897   - target_ulong target_rusage = arg4;
  3897 + abi_ulong target_rusage = arg4;
3898 3898 if (target_rusage)
3899 3899 rusage_ptr = &rusage;
3900 3900 else
... ... @@ -4045,14 +4045,14 @@ target_long do_syscall(void *cpu_env, int num, target_long arg1,
4045 4045 break;
4046 4046 #endif
4047 4047 case TARGET_NR_getdents:
4048   -#if TARGET_LONG_SIZE != 4
  4048 +#if TARGET_ABI_BITS != 32
4049 4049 goto unimplemented;
4050 4050 #warning not supported
4051   -#elif TARGET_LONG_SIZE == 4 && HOST_LONG_SIZE == 8
  4051 +#elif TARGET_ABI_BITS == 32 && HOST_LONG_BITS == 64
4052 4052 {
4053 4053 struct target_dirent *target_dirp;
4054 4054 struct dirent *dirp;
4055   - target_long count = arg3;
  4055 + abi_long count = arg3;
4056 4056  
4057 4057 dirp = malloc(count);
4058 4058 if (!dirp)
... ... @@ -4072,11 +4072,11 @@ target_long do_syscall(void *cpu_env, int num, target_long arg1,
4072 4072 tde = target_dirp;
4073 4073 while (len > 0) {
4074 4074 reclen = de->d_reclen;
4075   - treclen = reclen - (2 * (sizeof(long) - sizeof(target_long)));
  4075 + treclen = reclen - (2 * (sizeof(long) - sizeof(abi_long)));
4076 4076 tde->d_reclen = tswap16(treclen);
4077 4077 tde->d_ino = tswapl(de->d_ino);
4078 4078 tde->d_off = tswapl(de->d_off);
4079   - tnamelen = treclen - (2 * sizeof(target_long) + 2);
  4079 + tnamelen = treclen - (2 * sizeof(abi_long) + 2);
4080 4080 if (tnamelen > 256)
4081 4081 tnamelen = 256;
4082 4082 /* XXX: may not be correct */
... ... @@ -4094,7 +4094,7 @@ target_long do_syscall(void *cpu_env, int num, target_long arg1,
4094 4094 #else
4095 4095 {
4096 4096 struct dirent *dirp;
4097   - target_long count = arg3;
  4097 + abi_long count = arg3;
4098 4098  
4099 4099 dirp = lock_user(arg2, count, 0);
4100 4100 ret = get_errno(sys_getdents(arg1, dirp, count));
... ... @@ -4122,7 +4122,7 @@ target_long do_syscall(void *cpu_env, int num, target_long arg1,
4122 4122 case TARGET_NR_getdents64:
4123 4123 {
4124 4124 struct dirent64 *dirp;
4125   - target_long count = arg3;
  4125 + abi_long count = arg3;
4126 4126 dirp = lock_user(arg2, count, 0);
4127 4127 ret = get_errno(sys_getdents64(arg1, dirp, count));
4128 4128 if (!is_error(ret)) {
... ... @@ -4742,7 +4742,7 @@ target_long do_syscall(void *cpu_env, int num, target_long arg1,
4742 4742 ret = get_errno(0);
4743 4743 break;
4744 4744 #endif
4745   -#if TARGET_LONG_BITS == 32
  4745 +#if TARGET_ABI_BITS == 32
4746 4746 case TARGET_NR_fcntl64:
4747 4747 {
4748 4748 int cmd;
... ...
linux-user/syscall_defs.h
... ... @@ -105,13 +105,13 @@ struct target_sockaddr {
105 105 };
106 106  
107 107 struct target_timeval {
108   - target_long tv_sec;
109   - target_long tv_usec;
  108 + abi_long tv_sec;
  109 + abi_long tv_usec;
110 110 };
111 111  
112 112 struct target_timespec {
113   - target_long tv_sec;
114   - target_long tv_nsec;
  113 + abi_long tv_sec;
  114 + abi_long tv_nsec;
115 115 };
116 116  
117 117 struct target_itimerval {
... ... @@ -119,7 +119,7 @@ struct target_itimerval {
119 119 struct target_timeval it_value;
120 120 };
121 121  
122   -typedef target_long target_clock_t;
  122 +typedef abi_long target_clock_t;
123 123  
124 124 #define TARGET_HZ 100
125 125  
... ... @@ -131,33 +131,33 @@ struct target_tms {
131 131 };
132 132  
133 133 struct target_utimbuf {
134   - target_long actime;
135   - target_long modtime;
  134 + abi_long actime;
  135 + abi_long modtime;
136 136 };
137 137  
138 138 struct target_sel_arg_struct {
139   - target_long n;
140   - target_long inp, outp, exp;
141   - target_long tvp;
  139 + abi_long n;
  140 + abi_long inp, outp, exp;
  141 + abi_long tvp;
142 142 };
143 143  
144 144 struct target_iovec {
145   - target_long iov_base; /* Starting address */
146   - target_long iov_len; /* Number of bytes */
  145 + abi_long iov_base; /* Starting address */
  146 + abi_long iov_len; /* Number of bytes */
147 147 };
148 148  
149 149 struct target_msghdr {
150   - target_long msg_name; /* Socket name */
151   - int msg_namelen; /* Length of name */
152   - target_long msg_iov; /* Data blocks */
153   - target_long msg_iovlen; /* Number of blocks */
154   - target_long msg_control; /* Per protocol magic (eg BSD file descriptor passing) */
155   - target_long msg_controllen; /* Length of cmsg list */
  150 + abi_long msg_name; /* Socket name */
  151 + int msg_namelen; /* Length of name */
  152 + abi_long msg_iov; /* Data blocks */
  153 + abi_long msg_iovlen; /* Number of blocks */
  154 + abi_long msg_control; /* Per protocol magic (eg BSD file descriptor passing) */
  155 + abi_long msg_controllen; /* Length of cmsg list */
156 156 unsigned int msg_flags;
157 157 };
158 158  
159 159 struct target_cmsghdr {
160   - target_long cmsg_len;
  160 + abi_long cmsg_len;
161 161 int cmsg_level;
162 162 int cmsg_type;
163 163 };
... ... @@ -167,8 +167,8 @@ struct target_cmsghdr {
167 167 #define TARGET_CMSG_FIRSTHDR(mhdr) \
168 168 ((size_t) tswapl((mhdr)->msg_controllen) >= sizeof (struct target_cmsghdr) \
169 169 ? (struct target_cmsghdr *) tswapl((mhdr)->msg_control) : (struct target_cmsghdr *) NULL)
170   -#define TARGET_CMSG_ALIGN(len) (((len) + sizeof (target_long) - 1) \
171   - & (size_t) ~(sizeof (target_long) - 1))
  170 +#define TARGET_CMSG_ALIGN(len) (((len) + sizeof (abi_long) - 1) \
  171 + & (size_t) ~(sizeof (abi_long) - 1))
172 172 #define TARGET_CMSG_SPACE(len) (TARGET_CMSG_ALIGN (len) \
173 173 + TARGET_CMSG_ALIGN (sizeof (struct target_cmsghdr)))
174 174 #define TARGET_CMSG_LEN(len) (TARGET_CMSG_ALIGN (sizeof (struct target_cmsghdr)) + (len))
... ... @@ -191,20 +191,20 @@ __target_cmsg_nxthdr (struct target_msghdr *__mhdr, struct target_cmsghdr *__cms
191 191 struct target_rusage {
192 192 struct target_timeval ru_utime; /* user time used */
193 193 struct target_timeval ru_stime; /* system time used */
194   - target_long ru_maxrss; /* maximum resident set size */
195   - target_long ru_ixrss; /* integral shared memory size */
196   - target_long ru_idrss; /* integral unshared data size */
197   - target_long ru_isrss; /* integral unshared stack size */
198   - target_long ru_minflt; /* page reclaims */
199   - target_long ru_majflt; /* page faults */
200   - target_long ru_nswap; /* swaps */
201   - target_long ru_inblock; /* block input operations */
202   - target_long ru_oublock; /* block output operations */
203   - target_long ru_msgsnd; /* messages sent */
204   - target_long ru_msgrcv; /* messages received */
205   - target_long ru_nsignals; /* signals received */
206   - target_long ru_nvcsw; /* voluntary context switches */
207   - target_long ru_nivcsw; /* involuntary " */
  194 + abi_long ru_maxrss; /* maximum resident set size */
  195 + abi_long ru_ixrss; /* integral shared memory size */
  196 + abi_long ru_idrss; /* integral unshared data size */
  197 + abi_long ru_isrss; /* integral unshared stack size */
  198 + abi_long ru_minflt; /* page reclaims */
  199 + abi_long ru_majflt; /* page faults */
  200 + abi_long ru_nswap; /* swaps */
  201 + abi_long ru_inblock; /* block input operations */
  202 + abi_long ru_oublock; /* block output operations */
  203 + abi_long ru_msgsnd; /* messages sent */
  204 + abi_long ru_msgrcv; /* messages received */
  205 + abi_long ru_nsignals; /* signals received */
  206 + abi_long ru_nvcsw; /* voluntary context switches */
  207 + abi_long ru_nivcsw; /* involuntary " */
208 208 };
209 209  
210 210 typedef struct {
... ... @@ -225,8 +225,8 @@ struct kernel_statfs {
225 225 };
226 226  
227 227 struct target_dirent {
228   - target_long d_ino;
229   - target_long d_off;
  228 + abi_long d_ino;
  229 + abi_long d_off;
230 230 unsigned short d_reclen;
231 231 char d_name[256]; /* We must not include limits.h! */
232 232 };
... ... @@ -241,20 +241,20 @@ struct target_dirent64 {
241 241  
242 242  
243 243 /* mostly generic signal stuff */
244   -#define TARGET_SIG_DFL ((target_long)0) /* default signal handling */
245   -#define TARGET_SIG_IGN ((target_long)1) /* ignore signal */
246   -#define TARGET_SIG_ERR ((target_long)-1) /* error return from signal */
  244 +#define TARGET_SIG_DFL ((abi_long)0) /* default signal handling */
  245 +#define TARGET_SIG_IGN ((abi_long)1) /* ignore signal */
  246 +#define TARGET_SIG_ERR ((abi_long)-1) /* error return from signal */
247 247  
248 248 #ifdef TARGET_MIPS
249 249 #define TARGET_NSIG 128
250 250 #else
251 251 #define TARGET_NSIG 64
252 252 #endif
253   -#define TARGET_NSIG_BPW TARGET_LONG_BITS
  253 +#define TARGET_NSIG_BPW TARGET_ABI_BITS
254 254 #define TARGET_NSIG_WORDS (TARGET_NSIG / TARGET_NSIG_BPW)
255 255  
256 256 typedef struct {
257   - target_ulong sig[TARGET_NSIG_WORDS];
  257 + abi_ulong sig[TARGET_NSIG_WORDS];
258 258 } target_sigset_t;
259 259  
260 260 #ifdef BSWAP_NEEDED
... ... @@ -271,7 +271,7 @@ static inline void tswap_sigset(target_sigset_t *d, const target_sigset_t *s)
271 271 }
272 272 #endif
273 273  
274   -static inline void target_siginitset(target_sigset_t *d, target_ulong set)
  274 +static inline void target_siginitset(target_sigset_t *d, abi_ulong set)
275 275 {
276 276 int i;
277 277 d->sig[0] = set;
... ... @@ -281,10 +281,10 @@ static inline void target_siginitset(target_sigset_t *d, target_ulong set)
281 281  
282 282 void host_to_target_sigset(target_sigset_t *d, const sigset_t *s);
283 283 void target_to_host_sigset(sigset_t *d, const target_sigset_t *s);
284   -void host_to_target_old_sigset(target_ulong *old_sigset,
  284 +void host_to_target_old_sigset(abi_ulong *old_sigset,
285 285 const sigset_t *sigset);
286 286 void target_to_host_old_sigset(sigset_t *sigset,
287   - const target_ulong *old_sigset);
  287 + const abi_ulong *old_sigset);
288 288 struct target_sigaction;
289 289 int do_sigaction(int sig, const struct target_sigaction *act,
290 290 struct target_sigaction *oact);
... ... @@ -453,40 +453,40 @@ struct target_sigaction {
453 453 #if defined(TARGET_MIPSN32)
454 454 uint32_t _sa_handler;
455 455 #else
456   - target_ulong _sa_handler;
  456 + abi_ulong _sa_handler;
457 457 #endif
458 458 target_sigset_t sa_mask;
459 459 };
460 460  
461 461 #else
462 462 struct target_old_sigaction {
463   - target_ulong _sa_handler;
464   - target_ulong sa_mask;
465   - target_ulong sa_flags;
466   - target_ulong sa_restorer;
  463 + abi_ulong _sa_handler;
  464 + abi_ulong sa_mask;
  465 + abi_ulong sa_flags;
  466 + abi_ulong sa_restorer;
467 467 };
468 468  
469 469 struct target_sigaction {
470   - target_ulong _sa_handler;
471   - target_ulong sa_flags;
472   - target_ulong sa_restorer;
  470 + abi_ulong _sa_handler;
  471 + abi_ulong sa_flags;
  472 + abi_ulong sa_restorer;
473 473 target_sigset_t sa_mask;
474 474 };
475 475 #endif
476 476  
477 477 typedef union target_sigval {
478 478 int sival_int;
479   - target_ulong sival_ptr;
  479 + abi_ulong sival_ptr;
480 480 } target_sigval_t;
481 481 #if 0
482 482 #if defined (TARGET_SPARC)
483 483 typedef struct {
484 484 struct {
485   - target_ulong psr;
486   - target_ulong pc;
487   - target_ulong npc;
488   - target_ulong y;
489   - target_ulong u_regs[16]; /* globals and ins */
  485 + abi_ulong psr;
  486 + abi_ulong pc;
  487 + abi_ulong npc;
  488 + abi_ulong y;
  489 + abi_ulong u_regs[16]; /* globals and ins */
490 490 } si_regs;
491 491 int si_mask;
492 492 } __siginfo_t;
... ... @@ -544,7 +544,7 @@ typedef struct target_siginfo {
544 544  
545 545 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
546 546 struct {
547   - target_ulong _addr; /* faulting insn/memory ref. */
  547 + abi_ulong _addr; /* faulting insn/memory ref. */
548 548 } _sigfault;
549 549  
550 550 /* SIGPOLL */
... ... @@ -614,8 +614,8 @@ typedef struct target_siginfo {
614 614 #endif /* defined(TARGET_I386) || defined(TARGET_ARM) */
615 615  
616 616 struct target_rlimit {
617   - target_ulong rlim_cur;
618   - target_ulong rlim_max;
  617 + abi_ulong rlim_cur;
  618 + abi_ulong rlim_max;
619 619 };
620 620  
621 621 struct target_pollfd {
... ... @@ -888,24 +888,24 @@ struct target_winsize {
888 888 struct target_stat {
889 889 unsigned short st_dev;
890 890 unsigned short __pad1;
891   - target_ulong st_ino;
  891 + abi_ulong st_ino;
892 892 unsigned short st_mode;
893 893 unsigned short st_nlink;
894 894 unsigned short st_uid;
895 895 unsigned short st_gid;
896 896 unsigned short st_rdev;
897 897 unsigned short __pad2;
898   - target_ulong st_size;
899   - target_ulong st_blksize;
900   - target_ulong st_blocks;
901   - target_ulong target_st_atime;
902   - target_ulong __unused1;
903   - target_ulong target_st_mtime;
904   - target_ulong __unused2;
905   - target_ulong target_st_ctime;
906   - target_ulong __unused3;
907   - target_ulong __unused4;
908   - target_ulong __unused5;
  898 + abi_ulong st_size;
  899 + abi_ulong st_blksize;
  900 + abi_ulong st_blocks;
  901 + abi_ulong target_st_atime;
  902 + abi_ulong __unused1;
  903 + abi_ulong target_st_mtime;
  904 + abi_ulong __unused2;
  905 + abi_ulong target_st_ctime;
  906 + abi_ulong __unused3;
  907 + abi_ulong __unused4;
  908 + abi_ulong __unused5;
909 909 };
910 910  
911 911 /* This matches struct stat64 in glibc2.1, hence the absolutely
... ... @@ -916,31 +916,31 @@ struct target_stat64 {
916 916 unsigned char __pad0[10];
917 917  
918 918 #define TARGET_STAT64_HAS_BROKEN_ST_INO 1
919   - target_ulong __st_ino;
  919 + abi_ulong __st_ino;
920 920  
921 921 unsigned int st_mode;
922 922 unsigned int st_nlink;
923 923  
924   - target_ulong st_uid;
925   - target_ulong st_gid;
  924 + abi_ulong st_uid;
  925 + abi_ulong st_gid;
926 926  
927 927 unsigned short st_rdev;
928 928 unsigned char __pad3[10];
929 929  
930 930 long long st_size;
931   - target_ulong st_blksize;
  931 + abi_ulong st_blksize;
932 932  
933   - target_ulong st_blocks; /* Number 512-byte blocks allocated. */
934   - target_ulong __pad4; /* future possible st_blocks high bits */
  933 + abi_ulong st_blocks; /* Number 512-byte blocks allocated. */
  934 + abi_ulong __pad4; /* future possible st_blocks high bits */
935 935  
936   - target_ulong target_st_atime;
937   - target_ulong __pad5;
  936 + abi_ulong target_st_atime;
  937 + abi_ulong __pad5;
938 938  
939   - target_ulong target_st_mtime;
940   - target_ulong __pad6;
  939 + abi_ulong target_st_mtime;
  940 + abi_ulong __pad6;
941 941  
942   - target_ulong target_st_ctime;
943   - target_ulong __pad7; /* will be high 32 bits of ctime someday */
  942 + abi_ulong target_st_ctime;
  943 + abi_ulong __pad7; /* will be high 32 bits of ctime someday */
944 944  
945 945 unsigned long long st_ino;
946 946 } __attribute__((packed));
... ... @@ -949,50 +949,50 @@ struct target_stat64 {
949 949 struct target_eabi_stat64 {
950 950 unsigned long long st_dev;
951 951 unsigned int __pad1;
952   - target_ulong __st_ino;
  952 + abi_ulong __st_ino;
953 953 unsigned int st_mode;
954 954 unsigned int st_nlink;
955 955  
956   - target_ulong st_uid;
957   - target_ulong st_gid;
  956 + abi_ulong st_uid;
  957 + abi_ulong st_gid;
958 958  
959 959 unsigned long long st_rdev;
960 960 unsigned int __pad2[2];
961 961  
962 962 long long st_size;
963   - target_ulong st_blksize;
  963 + abi_ulong st_blksize;
964 964 unsigned int __pad3;
965 965 unsigned long long st_blocks;
966 966  
967   - target_ulong target_st_atime;
968   - target_ulong target_st_atime_nsec;
  967 + abi_ulong target_st_atime;
  968 + abi_ulong target_st_atime_nsec;
969 969  
970   - target_ulong target_st_mtime;
971   - target_ulong target_st_mtime_nsec;
  970 + abi_ulong target_st_mtime;
  971 + abi_ulong target_st_mtime_nsec;
972 972  
973   - target_ulong target_st_ctime;
974   - target_ulong target_st_ctime_nsec;
  973 + abi_ulong target_st_ctime;
  974 + abi_ulong target_st_ctime_nsec;
975 975  
976 976 unsigned long long st_ino;
977 977 } __attribute__ ((packed));
978 978 #endif
979 979  
980   -#elif defined(TARGET_SPARC64)
  980 +#elif defined(TARGET_SPARC64) && !defined(TARGET_ABI32)
981 981 struct target_stat {
982 982 unsigned int st_dev;
983   - target_ulong st_ino;
  983 + abi_ulong st_ino;
984 984 unsigned int st_mode;
985 985 unsigned int st_nlink;
986 986 unsigned int st_uid;
987 987 unsigned int st_gid;
988 988 unsigned int st_rdev;
989   - target_long st_size;
990   - target_long target_st_atime;
991   - target_long target_st_mtime;
992   - target_long target_st_ctime;
993   - target_long st_blksize;
994   - target_long st_blocks;
995   - target_ulong __unused4[2];
  989 + abi_long st_size;
  990 + abi_long target_st_atime;
  991 + abi_long target_st_mtime;
  992 + abi_long target_st_ctime;
  993 + abi_long st_blksize;
  994 + abi_long st_blocks;
  995 + abi_ulong __unused4[2];
996 996 };
997 997  
998 998 struct target_stat64 {
... ... @@ -1016,38 +1016,38 @@ struct target_stat64 {
1016 1016 unsigned char __pad4[4];
1017 1017 unsigned int st_blocks;
1018 1018  
1019   - target_ulong target_st_atime;
1020   - target_ulong __unused1;
  1019 + abi_ulong target_st_atime;
  1020 + abi_ulong __unused1;
1021 1021  
1022   - target_ulong target_st_mtime;
1023   - target_ulong __unused2;
  1022 + abi_ulong target_st_mtime;
  1023 + abi_ulong __unused2;
1024 1024  
1025   - target_ulong target_st_ctime;
1026   - target_ulong __unused3;
  1025 + abi_ulong target_st_ctime;
  1026 + abi_ulong __unused3;
1027 1027  
1028   - target_ulong __unused4[3];
  1028 + abi_ulong __unused4[3];
1029 1029 };
1030 1030  
1031 1031 #elif defined(TARGET_SPARC)
1032 1032  
1033 1033 struct target_stat {
1034 1034 unsigned short st_dev;
1035   - target_ulong st_ino;
  1035 + abi_ulong st_ino;
1036 1036 unsigned short st_mode;
1037 1037 short st_nlink;
1038 1038 unsigned short st_uid;
1039 1039 unsigned short st_gid;
1040 1040 unsigned short st_rdev;
1041   - target_long st_size;
1042   - target_long target_st_atime;
1043   - target_ulong __unused1;
1044   - target_long target_st_mtime;
1045   - target_ulong __unused2;
1046   - target_long target_st_ctime;
1047   - target_ulong __unused3;
1048   - target_long st_blksize;
1049   - target_long st_blocks;
1050   - target_ulong __unused4[2];
  1041 + abi_long st_size;
  1042 + abi_long target_st_atime;
  1043 + abi_ulong __unused1;
  1044 + abi_long target_st_mtime;
  1045 + abi_ulong __unused2;
  1046 + abi_long target_st_ctime;
  1047 + abi_ulong __unused3;
  1048 + abi_long st_blksize;
  1049 + abi_long st_blocks;
  1050 + abi_ulong __unused4[2];
1051 1051 };
1052 1052  
1053 1053 struct target_stat64 {
... ... @@ -1090,23 +1090,23 @@ struct target_stat64 {
1090 1090  
1091 1091 struct target_stat {
1092 1092 unsigned short st_dev;
1093   - target_ulong st_ino;
  1093 + abi_ulong st_ino;
1094 1094 unsigned int st_mode;
1095 1095 unsigned short st_nlink;
1096 1096 unsigned int st_uid;
1097 1097 unsigned int st_gid;
1098 1098 unsigned short st_rdev;
1099   - target_ulong st_size;
1100   - target_ulong st_blksize;
1101   - target_ulong st_blocks;
1102   - target_ulong target_st_atime;
1103   - target_ulong __unused1;
1104   - target_ulong target_st_mtime;
1105   - target_ulong __unused2;
1106   - target_ulong target_st_ctime;
1107   - target_ulong __unused3;
1108   - target_ulong __unused4;
1109   - target_ulong __unused5;
  1099 + abi_ulong st_size;
  1100 + abi_ulong st_blksize;
  1101 + abi_ulong st_blocks;
  1102 + abi_ulong target_st_atime;
  1103 + abi_ulong __unused1;
  1104 + abi_ulong target_st_mtime;
  1105 + abi_ulong __unused2;
  1106 + abi_ulong target_st_ctime;
  1107 + abi_ulong __unused3;
  1108 + abi_ulong __unused4;
  1109 + abi_ulong __unused5;
1110 1110 };
1111 1111  
1112 1112 struct target_stat64 {
... ... @@ -1119,17 +1119,17 @@ struct target_stat64 {
1119 1119 unsigned long long st_rdev;
1120 1120 long long pad0;
1121 1121 long long st_size;
1122   - target_ulong st_blksize;
1123   - target_ulong pad1;
  1122 + abi_ulong st_blksize;
  1123 + abi_ulong pad1;
1124 1124 long long st_blocks; /* Number 512-byte blocks allocated. */
1125   - target_ulong target_st_atime;
1126   - target_ulong target_st_atime_nsec;
1127   - target_ulong target_st_mtime;
1128   - target_ulong target_st_mtime_nsec;
1129   - target_ulong target_st_ctime;
1130   - target_ulong target_st_ctime_nsec;
1131   - target_ulong __unused4;
1132   - target_ulong __unused5;
  1125 + abi_ulong target_st_atime;
  1126 + abi_ulong target_st_atime_nsec;
  1127 + abi_ulong target_st_mtime;
  1128 + abi_ulong target_st_mtime_nsec;
  1129 + abi_ulong target_st_ctime;
  1130 + abi_ulong target_st_ctime_nsec;
  1131 + abi_ulong __unused4;
  1132 + abi_ulong __unused5;
1133 1133 };
1134 1134  
1135 1135 #elif defined(TARGET_M68K)
... ... @@ -1137,24 +1137,24 @@ struct target_stat64 {
1137 1137 struct target_stat {
1138 1138 unsigned short st_dev;
1139 1139 unsigned short __pad1;
1140   - target_ulong st_ino;
  1140 + abi_ulong st_ino;
1141 1141 unsigned short st_mode;
1142 1142 unsigned short st_nlink;
1143 1143 unsigned short st_uid;
1144 1144 unsigned short st_gid;
1145 1145 unsigned short st_rdev;
1146 1146 unsigned short __pad2;
1147   - target_ulong st_size;
1148   - target_ulong st_blksize;
1149   - target_ulong st_blocks;
1150   - target_ulong target_st_atime;
1151   - target_ulong __unused1;
1152   - target_ulong target_st_mtime;
1153   - target_ulong __unused2;
1154   - target_ulong target_st_ctime;
1155   - target_ulong __unused3;
1156   - target_ulong __unused4;
1157   - target_ulong __unused5;
  1147 + abi_ulong st_size;
  1148 + abi_ulong st_blksize;
  1149 + abi_ulong st_blocks;
  1150 + abi_ulong target_st_atime;
  1151 + abi_ulong __unused1;
  1152 + abi_ulong target_st_mtime;
  1153 + abi_ulong __unused2;
  1154 + abi_ulong target_st_ctime;
  1155 + abi_ulong __unused3;
  1156 + abi_ulong __unused4;
  1157 + abi_ulong __unused5;
1158 1158 };
1159 1159  
1160 1160 /* This matches struct stat64 in glibc2.1, hence the absolutely
... ... @@ -1165,31 +1165,31 @@ struct target_stat64 {
1165 1165 unsigned char __pad1[2];
1166 1166  
1167 1167 #define TARGET_STAT64_HAS_BROKEN_ST_INO 1
1168   - target_ulong __st_ino;
  1168 + abi_ulong __st_ino;
1169 1169  
1170 1170 unsigned int st_mode;
1171 1171 unsigned int st_nlink;
1172 1172  
1173   - target_ulong st_uid;
1174   - target_ulong st_gid;
  1173 + abi_ulong st_uid;
  1174 + abi_ulong st_gid;
1175 1175  
1176 1176 unsigned long long st_rdev;
1177 1177 unsigned char __pad3[2];
1178 1178  
1179 1179 long long st_size;
1180   - target_ulong st_blksize;
  1180 + abi_ulong st_blksize;
1181 1181  
1182   - target_ulong __pad4; /* future possible st_blocks high bits */
1183   - target_ulong st_blocks; /* Number 512-byte blocks allocated. */
  1182 + abi_ulong __pad4; /* future possible st_blocks high bits */
  1183 + abi_ulong st_blocks; /* Number 512-byte blocks allocated. */
1184 1184  
1185   - target_ulong target_st_atime;
1186   - target_ulong target_st_atime_nsec;
  1185 + abi_ulong target_st_atime;
  1186 + abi_ulong target_st_atime_nsec;
1187 1187  
1188   - target_ulong target_st_mtime;
1189   - target_ulong target_st_mtime_nsec;
  1188 + abi_ulong target_st_mtime;
  1189 + abi_ulong target_st_mtime_nsec;
1190 1190  
1191   - target_ulong target_st_ctime;
1192   - target_ulong target_st_ctime_nsec;
  1191 + abi_ulong target_st_ctime;
  1192 + abi_ulong target_st_ctime_nsec;
1193 1193  
1194 1194 unsigned long long st_ino;
1195 1195 } __attribute__((packed));
... ... @@ -1201,7 +1201,7 @@ struct target_stat {
1201 1201 unsigned int st_dev;
1202 1202 unsigned int st_pad0[3]; /* Reserved for st_dev expansion */
1203 1203  
1204   - target_ulong st_ino;
  1204 + abi_ulong st_ino;
1205 1205  
1206 1206 unsigned int st_mode;
1207 1207 unsigned int st_nlink;
... ... @@ -1212,7 +1212,7 @@ struct target_stat {
1212 1212 unsigned int st_rdev;
1213 1213 unsigned int st_pad1[3]; /* Reserved for st_rdev expansion */
1214 1214  
1215   - target_ulong st_size;
  1215 + abi_ulong st_size;
1216 1216  
1217 1217 /*
1218 1218 * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
... ... @@ -1230,7 +1230,7 @@ struct target_stat {
1230 1230 unsigned int st_blksize;
1231 1231 unsigned int st_pad2;
1232 1232  
1233   - target_ulong st_blocks;
  1233 + abi_ulong st_blocks;
1234 1234 };
1235 1235  
1236 1236 #elif defined(TARGET_MIPSN32)
... ... @@ -1308,29 +1308,29 @@ struct target_stat64 {
1308 1308  
1309 1309 struct target_stat {
1310 1310 unsigned st_dev;
1311   - target_long st_pad1[3]; /* Reserved for network id */
1312   - target_ulong st_ino;
  1311 + abi_long st_pad1[3]; /* Reserved for network id */
  1312 + abi_ulong st_ino;
1313 1313 unsigned int st_mode;
1314 1314 unsigned int st_nlink;
1315 1315 int st_uid;
1316 1316 int st_gid;
1317 1317 unsigned st_rdev;
1318   - target_long st_pad2[2];
1319   - target_long st_size;
1320   - target_long st_pad3;
  1318 + abi_long st_pad2[2];
  1319 + abi_long st_size;
  1320 + abi_long st_pad3;
1321 1321 /*
1322 1322 * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
1323 1323 * but we don't have it under Linux.
1324 1324 */
1325   - target_long target_st_atime;
1326   - target_long target_st_atime_nsec;
1327   - target_long target_st_mtime;
1328   - target_long target_st_mtime_nsec;
1329   - target_long target_st_ctime;
1330   - target_long target_st_ctime_nsec;
1331   - target_long st_blksize;
1332   - target_long st_blocks;
1333   - target_long st_pad4[14];
  1325 + abi_long target_st_atime;
  1326 + abi_long target_st_atime_nsec;
  1327 + abi_long target_st_mtime;
  1328 + abi_long target_st_mtime_nsec;
  1329 + abi_long target_st_ctime;
  1330 + abi_long target_st_ctime_nsec;
  1331 + abi_long st_blksize;
  1332 + abi_long st_blocks;
  1333 + abi_long st_pad4[14];
1334 1334 };
1335 1335  
1336 1336 /*
... ... @@ -1340,8 +1340,8 @@ struct target_stat {
1340 1340 */
1341 1341  
1342 1342 struct target_stat64 {
1343   - target_ulong st_dev;
1344   - target_ulong st_pad0[3]; /* Reserved for st_dev expansion */
  1343 + abi_ulong st_dev;
  1344 + abi_ulong st_pad0[3]; /* Reserved for st_dev expansion */
1345 1345  
1346 1346 uint64_t st_ino;
1347 1347  
... ... @@ -1351,8 +1351,8 @@ struct target_stat64 {
1351 1351 int st_uid;
1352 1352 int st_gid;
1353 1353  
1354   - target_ulong st_rdev;
1355   - target_ulong st_pad1[3]; /* Reserved for st_rdev expansion */
  1354 + abi_ulong st_rdev;
  1355 + abi_ulong st_pad1[3]; /* Reserved for st_rdev expansion */
1356 1356  
1357 1357 int64_t st_size;
1358 1358  
... ... @@ -1360,17 +1360,17 @@ struct target_stat64 {
1360 1360 * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
1361 1361 * but we don't have it under Linux.
1362 1362 */
1363   - target_long target_st_atime;
1364   - target_ulong target_st_atime_nsec; /* Reserved for st_atime expansion */
  1363 + abi_long target_st_atime;
  1364 + abi_ulong target_st_atime_nsec; /* Reserved for st_atime expansion */
1365 1365  
1366   - target_long target_st_mtime;
1367   - target_ulong target_st_mtime_nsec; /* Reserved for st_mtime expansion */
  1366 + abi_long target_st_mtime;
  1367 + abi_ulong target_st_mtime_nsec; /* Reserved for st_mtime expansion */
1368 1368  
1369   - target_long target_st_ctime;
1370   - target_ulong target_st_ctime_nsec; /* Reserved for st_ctime expansion */
  1369 + abi_long target_st_ctime;
  1370 + abi_ulong target_st_ctime_nsec; /* Reserved for st_ctime expansion */
1371 1371  
1372   - target_ulong st_blksize;
1373   - target_ulong st_pad2;
  1372 + abi_ulong st_blksize;
  1373 + abi_ulong st_pad2;
1374 1374  
1375 1375 int64_t st_blocks;
1376 1376 };
... ... @@ -1385,10 +1385,10 @@ struct target_stat {
1385 1385 unsigned int st_uid;
1386 1386 unsigned int st_gid;
1387 1387 unsigned int st_rdev;
1388   - target_long st_size;
1389   - target_ulong target_st_atime;
1390   - target_ulong target_st_mtime;
1391   - target_ulong target_st_ctime;
  1388 + abi_long st_size;
  1389 + abi_ulong target_st_atime;
  1390 + abi_ulong target_st_mtime;
  1391 + abi_ulong target_st_ctime;
1392 1392 unsigned int st_blksize;
1393 1393 unsigned int st_blocks;
1394 1394 unsigned int st_flags;
... ... @@ -1396,11 +1396,11 @@ struct target_stat {
1396 1396 };
1397 1397  
1398 1398 struct target_stat64 {
1399   - target_ulong st_dev;
1400   - target_ulong st_ino;
1401   - target_ulong st_rdev;
1402   - target_long st_size;
1403   - target_ulong st_blocks;
  1399 + abi_ulong st_dev;
  1400 + abi_ulong st_ino;
  1401 + abi_ulong st_rdev;
  1402 + abi_long st_size;
  1403 + abi_ulong st_blocks;
1404 1404  
1405 1405 unsigned int st_mode;
1406 1406 unsigned int st_uid;
... ... @@ -1409,36 +1409,36 @@ struct target_stat64 {
1409 1409 unsigned int st_nlink;
1410 1410 unsigned int __pad0;
1411 1411  
1412   - target_ulong target_st_atime;
1413   - target_ulong target_st_atime_nsec;
1414   - target_ulong target_st_mtime;
1415   - target_ulong target_st_mtime_nsec;
1416   - target_ulong target_st_ctime;
1417   - target_ulong target_st_ctime_nsec;
1418   - target_long __unused[3];
  1412 + abi_ulong target_st_atime;
  1413 + abi_ulong target_st_atime_nsec;
  1414 + abi_ulong target_st_mtime;
  1415 + abi_ulong target_st_mtime_nsec;
  1416 + abi_ulong target_st_ctime;
  1417 + abi_ulong target_st_ctime_nsec;
  1418 + abi_long __unused[3];
1419 1419 };
1420 1420  
1421 1421 #elif defined(TARGET_SH4)
1422 1422  
1423 1423 struct target_stat {
1424   - target_ulong st_dev;
1425   - target_ulong st_ino;
  1424 + abi_ulong st_dev;
  1425 + abi_ulong st_ino;
1426 1426 unsigned short st_mode;
1427 1427 unsigned short st_nlink;
1428 1428 unsigned short st_uid;
1429 1429 unsigned short st_gid;
1430   - target_ulong st_rdev;
1431   - target_ulong st_size;
1432   - target_ulong st_blksize;
1433   - target_ulong st_blocks;
1434   - target_ulong target_st_atime;
1435   - target_ulong target_st_atime_nsec;
1436   - target_ulong target_st_mtime;
1437   - target_ulong target_st_mtime_nsec;
1438   - target_ulong target_st_ctime;
1439   - target_ulong target_st_ctime_nsec;
1440   - target_ulong __unused4;
1441   - target_ulong __unused5;
  1430 + abi_ulong st_rdev;
  1431 + abi_ulong st_size;
  1432 + abi_ulong st_blksize;
  1433 + abi_ulong st_blocks;
  1434 + abi_ulong target_st_atime;
  1435 + abi_ulong target_st_atime_nsec;
  1436 + abi_ulong target_st_mtime;
  1437 + abi_ulong target_st_mtime_nsec;
  1438 + abi_ulong target_st_ctime;
  1439 + abi_ulong target_st_ctime_nsec;
  1440 + abi_ulong __unused4;
  1441 + abi_ulong __unused5;
1442 1442 };
1443 1443  
1444 1444 /* This matches struct stat64 in glibc2.1, hence the absolutely
... ... @@ -1449,30 +1449,30 @@ struct target_stat64 {
1449 1449 unsigned char __pad0[4];
1450 1450  
1451 1451 #define TARGET_STAT64_HAS_BROKEN_ST_INO 1
1452   - target_ulong __st_ino;
  1452 + abi_ulong __st_ino;
1453 1453  
1454 1454 unsigned int st_mode;
1455 1455 unsigned int st_nlink;
1456 1456  
1457   - target_ulong st_uid;
1458   - target_ulong st_gid;
  1457 + abi_ulong st_uid;
  1458 + abi_ulong st_gid;
1459 1459  
1460 1460 unsigned long long st_rdev;
1461 1461 unsigned char __pad3[4];
1462 1462  
1463 1463 long long st_size;
1464   - target_ulong st_blksize;
  1464 + abi_ulong st_blksize;
1465 1465  
1466 1466 unsigned long long st_blocks; /* Number 512-byte blocks allocated. */
1467 1467  
1468   - target_ulong target_st_atime;
1469   - target_ulong target_st_atime_nsec;
  1468 + abi_ulong target_st_atime;
  1469 + abi_ulong target_st_atime_nsec;
1470 1470  
1471   - target_ulong target_st_mtime;
1472   - target_ulong target_st_mtime_nsec;
  1471 + abi_ulong target_st_mtime;
  1472 + abi_ulong target_st_mtime_nsec;
1473 1473  
1474   - target_ulong target_st_ctime;
1475   - target_ulong target_st_ctime_nsec;
  1474 + abi_ulong target_st_ctime;
  1475 + abi_ulong target_st_ctime_nsec;
1476 1476  
1477 1477 unsigned long long st_ino;
1478 1478 };
... ... @@ -1504,19 +1504,19 @@ struct target_statfs {
1504 1504 };
1505 1505 #else
1506 1506 struct target_statfs {
1507   - target_long f_type;
1508   - target_long f_bsize;
1509   - target_long f_frsize; /* Fragment size - unsupported */
1510   - target_long f_blocks;
1511   - target_long f_bfree;
1512   - target_long f_files;
1513   - target_long f_ffree;
1514   - target_long f_bavail;
  1507 + abi_long f_type;
  1508 + abi_long f_bsize;
  1509 + abi_long f_frsize; /* Fragment size - unsupported */
  1510 + abi_long f_blocks;
  1511 + abi_long f_bfree;
  1512 + abi_long f_files;
  1513 + abi_long f_ffree;
  1514 + abi_long f_bavail;
1515 1515  
1516 1516 /* Linux specials */
1517 1517 target_fsid_t f_fsid;
1518   - target_long f_namelen;
1519   - target_long f_spare[6];
  1518 + abi_long f_namelen;
  1519 + abi_long f_spare[6];
1520 1520 };
1521 1521 #endif
1522 1522  
... ... @@ -1688,8 +1688,8 @@ struct target_statfs64 {
1688 1688 struct target_flock {
1689 1689 short l_type;
1690 1690 short l_whence;
1691   - target_ulong l_start;
1692   - target_ulong l_len;
  1691 + abi_ulong l_start;
  1692 + abi_ulong l_len;
1693 1693 int l_pid;
1694 1694 };
1695 1695  
... ... @@ -1856,20 +1856,20 @@ struct target_eabi_flock64 {
1856 1856 #define TARGET_VFAT_IOCTL_READDIR_SHORT TARGET_IORU('r', 2)
1857 1857  
1858 1858 struct target_sysinfo {
1859   - target_long uptime; /* Seconds since boot */
1860   - target_ulong loads[3]; /* 1, 5, and 15 minute load averages */
1861   - target_ulong totalram; /* Total usable main memory size */
1862   - target_ulong freeram; /* Available memory size */
1863   - target_ulong sharedram; /* Amount of shared memory */
1864   - target_ulong bufferram; /* Memory used by buffers */
1865   - target_ulong totalswap; /* Total swap space size */
1866   - target_ulong freeswap; /* swap space still available */
  1859 + abi_long uptime; /* Seconds since boot */
  1860 + abi_ulong loads[3]; /* 1, 5, and 15 minute load averages */
  1861 + abi_ulong totalram; /* Total usable main memory size */
  1862 + abi_ulong freeram; /* Available memory size */
  1863 + abi_ulong sharedram; /* Amount of shared memory */
  1864 + abi_ulong bufferram; /* Memory used by buffers */
  1865 + abi_ulong totalswap; /* Total swap space size */
  1866 + abi_ulong freeswap; /* swap space still available */
1867 1867 unsigned short procs; /* Number of current processes */
1868 1868 unsigned short pad; /* explicit padding for m68k */
1869   - target_ulong totalhigh; /* Total high memory size */
1870   - target_ulong freehigh; /* Available high memory size */
  1869 + abi_ulong totalhigh; /* Total high memory size */
  1870 + abi_ulong freehigh; /* Available high memory size */
1871 1871 unsigned int mem_unit; /* Memory unit size in bytes */
1872   - char _f[20-2*sizeof(target_long)-sizeof(int)]; /* Padding: libc5 uses this.. */
  1872 + char _f[20-2*sizeof(abi_long)-sizeof(int)]; /* Padding: libc5 uses this.. */
1873 1873 };
1874 1874  
1875 1875 #include "socket.h"
... ...
linux-user/vm86.c
... ... @@ -381,7 +381,7 @@ void handle_vm86_fault(CPUX86State *env)
381 381 }
382 382 }
383 383  
384   -int do_vm86(CPUX86State *env, long subfunction, target_ulong vm86_addr)
  384 +int do_vm86(CPUX86State *env, long subfunction, abi_ulong vm86_addr)
385 385 {
386 386 TaskState *ts = env->opaque;
387 387 struct target_vm86plus_struct * target_v86;
... ...
linux-user/x86_64/syscall.h
... ... @@ -2,30 +2,30 @@
2 2 #define __USER_DS (0x2B)
3 3  
4 4 struct target_pt_regs {
5   - target_ulong r15;
6   - target_ulong r14;
7   - target_ulong r13;
8   - target_ulong r12;
9   - target_ulong rbp;
10   - target_ulong rbx;
  5 + abi_ulong r15;
  6 + abi_ulong r14;
  7 + abi_ulong r13;
  8 + abi_ulong r12;
  9 + abi_ulong rbp;
  10 + abi_ulong rbx;
11 11 /* arguments: non interrupts/non tracing syscalls only save upto here*/
12   - target_ulong r11;
13   - target_ulong r10;
14   - target_ulong r9;
15   - target_ulong r8;
16   - target_ulong rax;
17   - target_ulong rcx;
18   - target_ulong rdx;
19   - target_ulong rsi;
20   - target_ulong rdi;
21   - target_ulong orig_rax;
  12 + abi_ulong r11;
  13 + abi_ulong r10;
  14 + abi_ulong r9;
  15 + abi_ulong r8;
  16 + abi_ulong rax;
  17 + abi_ulong rcx;
  18 + abi_ulong rdx;
  19 + abi_ulong rsi;
  20 + abi_ulong rdi;
  21 + abi_ulong orig_rax;
22 22 /* end of arguments */
23 23 /* cpu exception frame or undefined */
24   - target_ulong rip;
25   - target_ulong cs;
26   - target_ulong eflags;
27   - target_ulong rsp;
28   - target_ulong ss;
  24 + abi_ulong rip;
  25 + abi_ulong cs;
  26 + abi_ulong eflags;
  27 + abi_ulong rsp;
  28 + abi_ulong ss;
29 29 /* top of stack page */
30 30 };
31 31  
... ... @@ -41,7 +41,7 @@ struct target_pt_regs {
41 41 #if 0 // Redefine this
42 42 struct target_modify_ldt_ldt_s {
43 43 unsigned int entry_number;
44   - target_ulong base_addr;
  44 + abi_ulong base_addr;
45 45 unsigned int limit;
46 46 unsigned int seg_32bit:1;
47 47 unsigned int contents:2;
... ... @@ -54,7 +54,7 @@ struct target_modify_ldt_ldt_s {
54 54 #else
55 55 struct target_modify_ldt_ldt_s {
56 56 unsigned int entry_number;
57   - target_ulong base_addr;
  57 + abi_ulong base_addr;
58 58 unsigned int limit;
59 59 unsigned int flags;
60 60 };
... ... @@ -71,8 +71,8 @@ struct target_ipc64_perm
71 71 unsigned short __pad1;
72 72 unsigned short seq;
73 73 unsigned short __pad2;
74   - target_ulong __unused1;
75   - target_ulong __unused2;
  74 + abi_ulong __unused1;
  75 + abi_ulong __unused2;
76 76 };
77 77  
78 78 struct target_msqid64_ds {
... ... @@ -80,13 +80,13 @@ struct target_msqid64_ds {
80 80 unsigned int msg_stime; /* last msgsnd time */
81 81 unsigned int msg_rtime; /* last msgrcv time */
82 82 unsigned int msg_ctime; /* last change time */
83   - target_ulong msg_cbytes; /* current number of bytes on queue */
84   - target_ulong msg_qnum; /* number of messages in queue */
85   - target_ulong msg_qbytes; /* max number of bytes on queue */
  83 + abi_ulong msg_cbytes; /* current number of bytes on queue */
  84 + abi_ulong msg_qnum; /* number of messages in queue */
  85 + abi_ulong msg_qbytes; /* max number of bytes on queue */
86 86 unsigned int msg_lspid; /* pid of last msgsnd */
87 87 unsigned int msg_lrpid; /* last receive pid */
88   - target_ulong __unused4;
89   - target_ulong __unused5;
  88 + abi_ulong __unused4;
  89 + abi_ulong __unused5;
90 90 };
91 91  
92 92 #define UNAME_MACHINE "x86_64"
... ...
linux-user/x86_64/target_signal.h
... ... @@ -6,9 +6,9 @@
6 6 /* this struct defines a stack used during syscall handling */
7 7  
8 8 typedef struct target_sigaltstack {
9   - target_ulong ss_sp;
10   - target_long ss_flags;
11   - target_ulong ss_size;
  9 + abi_ulong ss_sp;
  10 + abi_long ss_flags;
  11 + abi_ulong ss_size;
12 12 } target_stack_t;
13 13  
14 14  
... ... @@ -21,7 +21,7 @@ typedef struct target_sigaltstack {
21 21 #define TARGET_MINSIGSTKSZ 2048
22 22 #define TARGET_SIGSTKSZ 8192
23 23  
24   -static inline target_ulong get_sp_from_cpustate(CPUX86State *state)
  24 +static inline abi_ulong get_sp_from_cpustate(CPUX86State *state)
25 25 {
26 26 return state->regs[R_ESP];
27 27 }
... ...
target-sparc/op_mem.h
  1 +#ifdef TARGET_ABI32
  2 +#define ADDR(x) ((x) & 0xffffffff)
  3 +#else
  4 +#define ADDR(x) (x)
  5 +#endif
  6 +
1 7 /*** Integer load ***/
2 8 #define SPARC_LD_OP(name, qp) \
3 9 void OPPROTO glue(glue(op_, name), MEMSUFFIX)(void) \
4 10 { \
5   - T1 = (target_ulong)glue(qp, MEMSUFFIX)(T0); \
  11 + T1 = (target_ulong)glue(qp, MEMSUFFIX)(ADDR(T0)); \
6 12 }
7 13  
8 14 #define SPARC_LD_OP_S(name, qp) \
9 15 void OPPROTO glue(glue(op_, name), MEMSUFFIX)(void) \
10 16 { \
11   - T1 = (target_long)glue(qp, MEMSUFFIX)(T0); \
  17 + T1 = (target_long)glue(qp, MEMSUFFIX)(ADDR(T0)); \
12 18 }
13 19  
14 20 #define SPARC_ST_OP(name, op) \
15 21 void OPPROTO glue(glue(op_, name), MEMSUFFIX)(void) \
16 22 { \
17   - glue(op, MEMSUFFIX)(T0, T1); \
  23 + glue(op, MEMSUFFIX)(ADDR(T0), T1); \
18 24 }
19 25  
20 26 SPARC_LD_OP(ld, ldl);
... ... @@ -30,60 +36,60 @@ SPARC_ST_OP(sth, stw);
30 36  
31 37 void OPPROTO glue(op_std, MEMSUFFIX)(void)
32 38 {
33   - glue(stl, MEMSUFFIX)(T0, T1);
34   - glue(stl, MEMSUFFIX)((T0 + 4), T2);
  39 + glue(stl, MEMSUFFIX)(ADDR(T0), T1);
  40 + glue(stl, MEMSUFFIX)((ADDR(T0 + 4)), T2);
35 41 }
36 42  
37 43 void OPPROTO glue(op_ldstub, MEMSUFFIX)(void)
38 44 {
39   - T1 = glue(ldub, MEMSUFFIX)(T0);
40   - glue(stb, MEMSUFFIX)(T0, 0xff); /* XXX: Should be Atomically */
  45 + T1 = glue(ldub, MEMSUFFIX)(ADDR(T0));
  46 + glue(stb, MEMSUFFIX)(ADDR(T0), 0xff); /* XXX: Should be Atomically */
41 47 }
42 48  
43 49 void OPPROTO glue(op_swap, MEMSUFFIX)(void)
44 50 {
45   - target_ulong tmp = glue(ldl, MEMSUFFIX)(T0);
46   - glue(stl, MEMSUFFIX)(T0, T1); /* XXX: Should be Atomically */
  51 + target_ulong tmp = glue(ldl, MEMSUFFIX)(ADDR(T0));
  52 + glue(stl, MEMSUFFIX)(ADDR(T0), T1); /* XXX: Should be Atomically */
47 53 T1 = tmp;
48 54 }
49 55  
50 56 void OPPROTO glue(op_ldd, MEMSUFFIX)(void)
51 57 {
52   - T1 = glue(ldl, MEMSUFFIX)(T0);
53   - T0 = glue(ldl, MEMSUFFIX)((T0 + 4));
  58 + T1 = glue(ldl, MEMSUFFIX)(ADDR(T0));
  59 + T0 = glue(ldl, MEMSUFFIX)((ADDR(T0 + 4)));
54 60 }
55 61  
56 62 /*** Floating-point store ***/
57 63 void OPPROTO glue(op_stf, MEMSUFFIX) (void)
58 64 {
59   - glue(stfl, MEMSUFFIX)(T0, FT0);
  65 + glue(stfl, MEMSUFFIX)(ADDR(T0), FT0);
60 66 }
61 67  
62 68 void OPPROTO glue(op_stdf, MEMSUFFIX) (void)
63 69 {
64   - glue(stfq, MEMSUFFIX)(T0, DT0);
  70 + glue(stfq, MEMSUFFIX)(ADDR(T0), DT0);
65 71 }
66 72  
67 73 /*** Floating-point load ***/
68 74 void OPPROTO glue(op_ldf, MEMSUFFIX) (void)
69 75 {
70   - FT0 = glue(ldfl, MEMSUFFIX)(T0);
  76 + FT0 = glue(ldfl, MEMSUFFIX)(ADDR(T0));
71 77 }
72 78  
73 79 void OPPROTO glue(op_lddf, MEMSUFFIX) (void)
74 80 {
75   - DT0 = glue(ldfq, MEMSUFFIX)(T0);
  81 + DT0 = glue(ldfq, MEMSUFFIX)(ADDR(T0));
76 82 }
77 83  
78 84 #ifdef TARGET_SPARC64
79 85 void OPPROTO glue(op_lduw, MEMSUFFIX)(void)
80 86 {
81   - T1 = (uint64_t)(glue(ldl, MEMSUFFIX)(T0) & 0xffffffff);
  87 + T1 = (uint64_t)(glue(ldl, MEMSUFFIX)(ADDR(T0)) & 0xffffffff);
82 88 }
83 89  
84 90 void OPPROTO glue(op_ldsw, MEMSUFFIX)(void)
85 91 {
86   - T1 = (int64_t)(glue(ldl, MEMSUFFIX)(T0) & 0xffffffff);
  92 + T1 = (int64_t)(glue(ldl, MEMSUFFIX)(ADDR(T0)) & 0xffffffff);
87 93 }
88 94  
89 95 SPARC_LD_OP(ldx, ldq);
... ...
... ... @@ -136,13 +136,13 @@ const argtype *thunk_convert(void *dst, const void *src,
136 136 case TYPE_ULONGLONG:
137 137 *(uint64_t *)dst = tswap64(*(uint64_t *)src);
138 138 break;
139   -#if HOST_LONG_BITS == 32 && TARGET_LONG_BITS == 32
  139 +#if HOST_LONG_BITS == 32 && TARGET_ABI_BITS == 32
140 140 case TYPE_LONG:
141 141 case TYPE_ULONG:
142 142 case TYPE_PTRVOID:
143 143 *(uint32_t *)dst = tswap32(*(uint32_t *)src);
144 144 break;
145   -#elif HOST_LONG_BITS == 64 && TARGET_LONG_BITS == 32
  145 +#elif HOST_LONG_BITS == 64 && TARGET_ABI_BITS == 32
146 146 case TYPE_LONG:
147 147 case TYPE_ULONG:
148 148 case TYPE_PTRVOID:
... ...
... ... @@ -98,7 +98,7 @@ static inline int thunk_type_size(const argtype *type_ptr, int is_host)
98 98 if (is_host) {
99 99 return HOST_LONG_SIZE;
100 100 } else {
101   - return TARGET_LONG_SIZE;
  101 + return TARGET_ABI_BITS / 8;
102 102 }
103 103 break;
104 104 case TYPE_ARRAY:
... ... @@ -135,7 +135,7 @@ static inline int thunk_type_align(const argtype *type_ptr, int is_host)
135 135 if (is_host) {
136 136 return HOST_LONG_SIZE;
137 137 } else {
138   - return TARGET_LONG_SIZE;
  138 + return TARGET_ABI_BITS / 8;
139 139 }
140 140 break;
141 141 case TYPE_ARRAY:
... ...