Commit 92a343da3f50db3130f988b14650eb09e9748d11
1 parent
b8d3f5d1
New ppc64-linux-user target.
Allow use of PowerPC 970 for debugging (softmmu would not run, for now). git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3246 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
5 changed files
with
13 additions
and
39 deletions
configure
| @@ -501,7 +501,7 @@ if test -z "$target_list" ; then | @@ -501,7 +501,7 @@ if test -z "$target_list" ; then | ||
| 501 | fi | 501 | fi |
| 502 | # the following are Linux specific | 502 | # the following are Linux specific |
| 503 | if [ "$linux_user" = "yes" ] ; then | 503 | if [ "$linux_user" = "yes" ] ; then |
| 504 | - target_list="i386-linux-user arm-linux-user armeb-linux-user sparc-linux-user ppc-linux-user mips-linux-user mipsel-linux-user m68k-linux-user alpha-linux-user $target_list" | 504 | + target_list="i386-linux-user arm-linux-user armeb-linux-user sparc-linux-user ppc-linux-user mips-linux-user mipsel-linux-user m68k-linux-user alpha-linux-user ppc64-linux-user $target_list" |
| 505 | fi | 505 | fi |
| 506 | # the following are Darwin specific | 506 | # the following are Darwin specific |
| 507 | if [ "$darwin_user" = "yes" ] ; then | 507 | if [ "$darwin_user" = "yes" ] ; then |
linux-user/elfload.c
| @@ -1315,6 +1315,7 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs, | @@ -1315,6 +1315,7 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs, | ||
| 1315 | interp_load_addr, | 1315 | interp_load_addr, |
| 1316 | (interpreter_type == INTERPRETER_AOUT ? 0 : 1), | 1316 | (interpreter_type == INTERPRETER_AOUT ? 0 : 1), |
| 1317 | info); | 1317 | info); |
| 1318 | + info->load_addr = reloc_func_desc; | ||
| 1318 | info->start_brk = info->brk = elf_brk; | 1319 | info->start_brk = info->brk = elf_brk; |
| 1319 | info->end_code = end_code; | 1320 | info->end_code = end_code; |
| 1320 | info->start_code = start_code; | 1321 | info->start_code = start_code; |
linux-user/ppc64/syscall.h
| @@ -65,18 +65,21 @@ struct target_revectored_struct { | @@ -65,18 +65,21 @@ struct target_revectored_struct { | ||
| 65 | #define TARGET_SHMGET 23 | 65 | #define TARGET_SHMGET 23 |
| 66 | #define TARGET_SHMCTL 24 | 66 | #define TARGET_SHMCTL 24 |
| 67 | 67 | ||
| 68 | +#if 0 // To make it compile, even if the definition in syscall.c is bugged | ||
| 68 | struct target_msgbuf { | 69 | struct target_msgbuf { |
| 69 | int mtype; | 70 | int mtype; |
| 70 | char mtext[1]; | 71 | char mtext[1]; |
| 71 | }; | 72 | }; |
| 73 | +#endif | ||
| 72 | 74 | ||
| 73 | struct target_ipc_kludge { | 75 | struct target_ipc_kludge { |
| 74 | unsigned int msgp; /* Really (struct msgbuf *) */ | 76 | unsigned int msgp; /* Really (struct msgbuf *) */ |
| 75 | int msgtyp; | 77 | int msgtyp; |
| 76 | }; | 78 | }; |
| 77 | 79 | ||
| 80 | +#if 0 // To make it compile, even if the definition in syscall.c is bugged | ||
| 78 | struct target_ipc_perm { | 81 | struct target_ipc_perm { |
| 79 | - int key; | 82 | + int __key; |
| 80 | unsigned short uid; | 83 | unsigned short uid; |
| 81 | unsigned short gid; | 84 | unsigned short gid; |
| 82 | unsigned short cuid; | 85 | unsigned short cuid; |
| @@ -84,7 +87,9 @@ struct target_ipc_perm { | @@ -84,7 +87,9 @@ struct target_ipc_perm { | ||
| 84 | unsigned short mode; | 87 | unsigned short mode; |
| 85 | unsigned short seq; | 88 | unsigned short seq; |
| 86 | }; | 89 | }; |
| 90 | +#endif | ||
| 87 | 91 | ||
| 92 | +#if 0 // To make it compile, even if the definition in syscall.c is bugged | ||
| 88 | struct target_msqid_ds { | 93 | struct target_msqid_ds { |
| 89 | struct target_ipc_perm msg_perm; | 94 | struct target_ipc_perm msg_perm; |
| 90 | unsigned int msg_first; /* really struct target_msg* */ | 95 | unsigned int msg_first; /* really struct target_msg* */ |
| @@ -100,7 +105,9 @@ struct target_msqid_ds { | @@ -100,7 +105,9 @@ struct target_msqid_ds { | ||
| 100 | unsigned short msg_lspid; | 105 | unsigned short msg_lspid; |
| 101 | unsigned short msg_lrpid; | 106 | unsigned short msg_lrpid; |
| 102 | }; | 107 | }; |
| 108 | +#endif | ||
| 103 | 109 | ||
| 110 | +#if 0 // To make it compile, even if the definition in syscall.c is bugged | ||
| 104 | struct target_shmid_ds { | 111 | struct target_shmid_ds { |
| 105 | struct target_ipc_perm shm_perm; | 112 | struct target_ipc_perm shm_perm; |
| 106 | int shm_segsz; | 113 | int shm_segsz; |
| @@ -114,17 +121,10 @@ struct target_shmid_ds { | @@ -114,17 +121,10 @@ struct target_shmid_ds { | ||
| 114 | unsigned long *shm_pages; | 121 | unsigned long *shm_pages; |
| 115 | void *attaches; /* really struct shm_desc * */ | 122 | void *attaches; /* really struct shm_desc * */ |
| 116 | }; | 123 | }; |
| 124 | +#endif | ||
| 117 | 125 | ||
| 118 | #define TARGET_IPC_RMID 0 | 126 | #define TARGET_IPC_RMID 0 |
| 119 | #define TARGET_IPC_SET 1 | 127 | #define TARGET_IPC_SET 1 |
| 120 | #define TARGET_IPC_STAT 2 | 128 | #define TARGET_IPC_STAT 2 |
| 121 | 129 | ||
| 122 | -union target_semun { | ||
| 123 | - int val; | ||
| 124 | - unsigned int buf; /* really struct semid_ds * */ | ||
| 125 | - unsigned int array; /* really unsigned short * */ | ||
| 126 | - unsigned int __buf; /* really struct seminfo * */ | ||
| 127 | - unsigned int __pad; /* really void* */ | ||
| 128 | -}; | ||
| 129 | - | ||
| 130 | -#define UNAME_MACHINE "ppc" | 130 | +#define UNAME_MACHINE "ppc64" |
linux-user/qemu.h
| @@ -16,6 +16,7 @@ | @@ -16,6 +16,7 @@ | ||
| 16 | * task_struct fields in the kernel | 16 | * task_struct fields in the kernel |
| 17 | */ | 17 | */ |
| 18 | struct image_info { | 18 | struct image_info { |
| 19 | + target_ulong load_addr; | ||
| 19 | unsigned long start_code; | 20 | unsigned long start_code; |
| 20 | unsigned long end_code; | 21 | unsigned long end_code; |
| 21 | unsigned long start_data; | 22 | unsigned long start_data; |
target-ppc/translate_init.c
| @@ -3368,7 +3368,6 @@ static void init_proc_7455 (CPUPPCState *env) | @@ -3368,7 +3368,6 @@ static void init_proc_7455 (CPUPPCState *env) | ||
| 3368 | 3368 | ||
| 3369 | #if defined (TARGET_PPC64) | 3369 | #if defined (TARGET_PPC64) |
| 3370 | /* PowerPC 970 */ | 3370 | /* PowerPC 970 */ |
| 3371 | -#if defined (TODO) | ||
| 3372 | #define POWERPC_INSNS_970 (POWERPC_INSNS_WORKS | PPC_FLOAT_FSQRT | \ | 3371 | #define POWERPC_INSNS_970 (POWERPC_INSNS_WORKS | PPC_FLOAT_FSQRT | \ |
| 3373 | PPC_64B | PPC_ALTIVEC | \ | 3372 | PPC_64B | PPC_ALTIVEC | \ |
| 3374 | PPC_64_BRIDGE | PPC_SLBI) | 3373 | PPC_64_BRIDGE | PPC_SLBI) |
| @@ -3408,10 +3407,8 @@ static void init_proc_970 (CPUPPCState *env) | @@ -3408,10 +3407,8 @@ static void init_proc_970 (CPUPPCState *env) | ||
| 3408 | /* Allocate hardware IRQ controller */ | 3407 | /* Allocate hardware IRQ controller */ |
| 3409 | ppc970_irq_init(env); | 3408 | ppc970_irq_init(env); |
| 3410 | } | 3409 | } |
| 3411 | -#endif /* TODO */ | ||
| 3412 | 3410 | ||
| 3413 | /* PowerPC 970FX (aka G5) */ | 3411 | /* PowerPC 970FX (aka G5) */ |
| 3414 | -#if defined (TODO) | ||
| 3415 | #define POWERPC_INSNS_970FX (POWERPC_INSNS_WORKS | PPC_FLOAT_FSQRT | \ | 3412 | #define POWERPC_INSNS_970FX (POWERPC_INSNS_WORKS | PPC_FLOAT_FSQRT | \ |
| 3416 | PPC_64B | PPC_ALTIVEC | \ | 3413 | PPC_64B | PPC_ALTIVEC | \ |
| 3417 | PPC_64_BRIDGE | PPC_SLBI) | 3414 | PPC_64_BRIDGE | PPC_SLBI) |
| @@ -3451,10 +3448,8 @@ static void init_proc_970FX (CPUPPCState *env) | @@ -3451,10 +3448,8 @@ static void init_proc_970FX (CPUPPCState *env) | ||
| 3451 | /* Allocate hardware IRQ controller */ | 3448 | /* Allocate hardware IRQ controller */ |
| 3452 | ppc970_irq_init(env); | 3449 | ppc970_irq_init(env); |
| 3453 | } | 3450 | } |
| 3454 | -#endif /* TODO */ | ||
| 3455 | 3451 | ||
| 3456 | /* PowerPC 970 GX */ | 3452 | /* PowerPC 970 GX */ |
| 3457 | -#if defined (TODO) | ||
| 3458 | #define POWERPC_INSNS_970GX (POWERPC_INSNS_WORKS | PPC_FLOAT_FSQRT | \ | 3453 | #define POWERPC_INSNS_970GX (POWERPC_INSNS_WORKS | PPC_FLOAT_FSQRT | \ |
| 3459 | PPC_64B | PPC_ALTIVEC | \ | 3454 | PPC_64B | PPC_ALTIVEC | \ |
| 3460 | PPC_64_BRIDGE | PPC_SLBI) | 3455 | PPC_64_BRIDGE | PPC_SLBI) |
| @@ -3494,7 +3489,6 @@ static void init_proc_970GX (CPUPPCState *env) | @@ -3494,7 +3489,6 @@ static void init_proc_970GX (CPUPPCState *env) | ||
| 3494 | /* Allocate hardware IRQ controller */ | 3489 | /* Allocate hardware IRQ controller */ |
| 3495 | ppc970_irq_init(env); | 3490 | ppc970_irq_init(env); |
| 3496 | } | 3491 | } |
| 3497 | -#endif /* TODO */ | ||
| 3498 | 3492 | ||
| 3499 | /* PowerPC 620 */ | 3493 | /* PowerPC 620 */ |
| 3500 | #if defined (TODO) | 3494 | #if defined (TODO) |
| @@ -4897,50 +4891,28 @@ static ppc_def_t ppc_defs[] = { | @@ -4897,50 +4891,28 @@ static ppc_def_t ppc_defs[] = { | ||
| 4897 | /* POWER6A */ | 4891 | /* POWER6A */ |
| 4898 | POWERPC_DEF("POWER6A", CPU_POWERPC_POWER6A, 0xFFFFFFFF, POWER6), | 4892 | POWERPC_DEF("POWER6A", CPU_POWERPC_POWER6A, 0xFFFFFFFF, POWER6), |
| 4899 | #endif | 4893 | #endif |
| 4900 | -#if defined (TODO) | ||
| 4901 | /* PowerPC 970 */ | 4894 | /* PowerPC 970 */ |
| 4902 | POWERPC_DEF("970", CPU_POWERPC_970, 0xFFFFFFFF, 970), | 4895 | POWERPC_DEF("970", CPU_POWERPC_970, 0xFFFFFFFF, 970), |
| 4903 | -#endif | ||
| 4904 | -#if defined (TODO) | ||
| 4905 | /* PowerPC 970FX (G5) */ | 4896 | /* PowerPC 970FX (G5) */ |
| 4906 | POWERPC_DEF("970fx", CPU_POWERPC_970FX, 0xFFFFFFFF, 970FX), | 4897 | POWERPC_DEF("970fx", CPU_POWERPC_970FX, 0xFFFFFFFF, 970FX), |
| 4907 | -#endif | ||
| 4908 | -#if defined (TODO) | ||
| 4909 | /* PowerPC 970FX v1.0 (G5) */ | 4898 | /* PowerPC 970FX v1.0 (G5) */ |
| 4910 | POWERPC_DEF("970fx1.0", CPU_POWERPC_970FX_v10, 0xFFFFFFFF, 970FX), | 4899 | POWERPC_DEF("970fx1.0", CPU_POWERPC_970FX_v10, 0xFFFFFFFF, 970FX), |
| 4911 | -#endif | ||
| 4912 | -#if defined (TODO) | ||
| 4913 | /* PowerPC 970FX v2.0 (G5) */ | 4900 | /* PowerPC 970FX v2.0 (G5) */ |
| 4914 | POWERPC_DEF("970fx2.0", CPU_POWERPC_970FX_v20, 0xFFFFFFFF, 970FX), | 4901 | POWERPC_DEF("970fx2.0", CPU_POWERPC_970FX_v20, 0xFFFFFFFF, 970FX), |
| 4915 | -#endif | ||
| 4916 | -#if defined (TODO) | ||
| 4917 | /* PowerPC 970FX v2.1 (G5) */ | 4902 | /* PowerPC 970FX v2.1 (G5) */ |
| 4918 | POWERPC_DEF("970fx2.1", CPU_POWERPC_970FX_v21, 0xFFFFFFFF, 970FX), | 4903 | POWERPC_DEF("970fx2.1", CPU_POWERPC_970FX_v21, 0xFFFFFFFF, 970FX), |
| 4919 | -#endif | ||
| 4920 | -#if defined (TODO) | ||
| 4921 | /* PowerPC 970FX v3.0 (G5) */ | 4904 | /* PowerPC 970FX v3.0 (G5) */ |
| 4922 | POWERPC_DEF("970fx3.0", CPU_POWERPC_970FX_v30, 0xFFFFFFFF, 970FX), | 4905 | POWERPC_DEF("970fx3.0", CPU_POWERPC_970FX_v30, 0xFFFFFFFF, 970FX), |
| 4923 | -#endif | ||
| 4924 | -#if defined (TODO) | ||
| 4925 | /* PowerPC 970FX v3.1 (G5) */ | 4906 | /* PowerPC 970FX v3.1 (G5) */ |
| 4926 | POWERPC_DEF("970fx3.1", CPU_POWERPC_970FX_v31, 0xFFFFFFFF, 970FX), | 4907 | POWERPC_DEF("970fx3.1", CPU_POWERPC_970FX_v31, 0xFFFFFFFF, 970FX), |
| 4927 | -#endif | ||
| 4928 | -#if defined (TODO) | ||
| 4929 | /* PowerPC 970GX (G5) */ | 4908 | /* PowerPC 970GX (G5) */ |
| 4930 | POWERPC_DEF("970gx", CPU_POWERPC_970GX, 0xFFFFFFFF, 970GX), | 4909 | POWERPC_DEF("970gx", CPU_POWERPC_970GX, 0xFFFFFFFF, 970GX), |
| 4931 | -#endif | ||
| 4932 | -#if defined (TODO) | ||
| 4933 | /* PowerPC 970MP */ | 4910 | /* PowerPC 970MP */ |
| 4934 | POWERPC_DEF("970mp", CPU_POWERPC_970MP, 0xFFFFFFFF, 970), | 4911 | POWERPC_DEF("970mp", CPU_POWERPC_970MP, 0xFFFFFFFF, 970), |
| 4935 | -#endif | ||
| 4936 | -#if defined (TODO) | ||
| 4937 | /* PowerPC 970MP v1.0 */ | 4912 | /* PowerPC 970MP v1.0 */ |
| 4938 | POWERPC_DEF("970mp1.0", CPU_POWERPC_970MP_v10, 0xFFFFFFFF, 970), | 4913 | POWERPC_DEF("970mp1.0", CPU_POWERPC_970MP_v10, 0xFFFFFFFF, 970), |
| 4939 | -#endif | ||
| 4940 | -#if defined (TODO) | ||
| 4941 | /* PowerPC 970MP v1.1 */ | 4914 | /* PowerPC 970MP v1.1 */ |
| 4942 | POWERPC_DEF("970mp1.1", CPU_POWERPC_970MP_v11, 0xFFFFFFFF, 970), | 4915 | POWERPC_DEF("970mp1.1", CPU_POWERPC_970MP_v11, 0xFFFFFFFF, 970), |
| 4943 | -#endif | ||
| 4944 | #if defined (TODO) | 4916 | #if defined (TODO) |
| 4945 | /* PowerPC Cell */ | 4917 | /* PowerPC Cell */ |
| 4946 | POWERPC_DEF("Cell", CPU_POWERPC_CELL, 0xFFFFFFFF, 970), | 4918 | POWERPC_DEF("Cell", CPU_POWERPC_CELL, 0xFFFFFFFF, 970), |