Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/rth/tags/pull-hppa-20170206' in…
Browse files Browse the repository at this point in the history
…to staging

Misc hppa fixes.

# gpg: Signature made Tue 07 Feb 2017 02:28:40 GMT
# gpg:                using RSA key 0xAD1270CC4DD0279B
# gpg: Good signature from "Richard Henderson <rth7680@gmail.com>"
# gpg:                 aka "Richard Henderson <rth@redhat.com>"
# gpg:                 aka "Richard Henderson <rth@twiddle.net>"
# Primary key fingerprint: 9CB1 8DDA F8E8 49AD 2AFC  16A4 AD12 70CC 4DD0 279B

* remotes/rth/tags/pull-hppa-20170206:
  target/hppa: Fix gdb_write_register
  target/hppa: Tidy do_cbranch
  linux-user: define correct UTS machine name for hppa
  linux-user: fix "apt-get update" on linux-user hppa
  linux-user: add hppa magic numbers in qemu-binfmt-conf.sh

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
pm215 committed Feb 7, 2017
2 parents ac7568b + 6836a8f commit 3c457da
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion linux-user/hppa/target_syscall.h
Expand Up @@ -19,7 +19,7 @@ struct target_pt_regs {
target_ulong ipsw;
};

#define UNAME_MACHINE "hppa"
#define UNAME_MACHINE "parisc"
#define UNAME_MINIMUM_RELEASE "2.6.32"
#define TARGET_CLONE_BACKWARDS
#define TARGET_MINSIGSTKSZ 2048
Expand Down
1 change: 0 additions & 1 deletion linux-user/syscall.c
Expand Up @@ -9343,7 +9343,6 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
#ifdef TARGET_NR_socket
case TARGET_NR_socket:
ret = do_socket(arg1, arg2, arg3);
fd_trans_unregister(ret);
break;
#endif
#ifdef TARGET_NR_socketpair
Expand Down
9 changes: 7 additions & 2 deletions scripts/qemu-binfmt-conf.sh
@@ -1,9 +1,10 @@
#!/bin/sh
# enable automatic i386/ARM/M68K/MIPS/SPARC/PPC/s390 program execution by the kernel
# enable automatic i386/ARM/M68K/MIPS/SPARC/PPC/s390/HPPA
# program execution by the kernel

qemu_target_list="i386 i486 alpha arm sparc32plus ppc ppc64 ppc64le m68k \
mips mipsel mipsn32 mipsn32el mips64 mips64el \
sh4 sh4eb s390x aarch64"
sh4 sh4eb s390x aarch64 hppa"

i386_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00'
i386_mask='\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'
Expand Down Expand Up @@ -91,6 +92,10 @@ aarch64_magic='\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x
aarch64_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'
aarch64_family=arm

hppa_magic='\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x0f'
hppa_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'
hppa_family=hppa

qemu_get_family() {
cpu=${HOST_ARCH:-$(uname -m)}
case "$cpu" in
Expand Down
1 change: 1 addition & 0 deletions target/hppa/gdbstub.c
Expand Up @@ -85,6 +85,7 @@ int hppa_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
break;
case 35:
env->iaoq_b = val;
break;
case 59:
env->cr26 = val;
break;
Expand Down
17 changes: 5 additions & 12 deletions target/hppa/translate.c
Expand Up @@ -1433,7 +1433,6 @@ static ExitStatus do_cbranch(DisasContext *ctx, target_long disp, bool is_n,
target_ulong dest = iaoq_dest(ctx, disp);
TCGLabel *taken = NULL;
TCGCond c = cond->c;
int which = 0;
bool n;

assert(ctx->null_cond.c == TCG_COND_NEVER);
Expand All @@ -1455,14 +1454,14 @@ static ExitStatus do_cbranch(DisasContext *ctx, target_long disp, bool is_n,
n = is_n && disp < 0;
if (n && use_nullify_skip(ctx)) {
nullify_set(ctx, 0);
gen_goto_tb(ctx, which++, ctx->iaoq_n, ctx->iaoq_n + 4);
gen_goto_tb(ctx, 0, ctx->iaoq_n, ctx->iaoq_n + 4);
} else {
if (!n && ctx->null_lab) {
gen_set_label(ctx->null_lab);
ctx->null_lab = NULL;
}
nullify_set(ctx, n);
gen_goto_tb(ctx, which++, ctx->iaoq_b, ctx->iaoq_n);
gen_goto_tb(ctx, 0, ctx->iaoq_b, ctx->iaoq_n);
}

gen_set_label(taken);
Expand All @@ -1471,23 +1470,17 @@ static ExitStatus do_cbranch(DisasContext *ctx, target_long disp, bool is_n,
n = is_n && disp >= 0;
if (n && use_nullify_skip(ctx)) {
nullify_set(ctx, 0);
gen_goto_tb(ctx, which++, dest, dest + 4);
gen_goto_tb(ctx, 1, dest, dest + 4);
} else {
nullify_set(ctx, n);
gen_goto_tb(ctx, which++, ctx->iaoq_b, dest);
gen_goto_tb(ctx, 1, ctx->iaoq_b, dest);
}

/* Not taken: the branch itself was nullified. */
if (ctx->null_lab) {
gen_set_label(ctx->null_lab);
ctx->null_lab = NULL;
if (which < 2) {
nullify_set(ctx, 0);
gen_goto_tb(ctx, which, ctx->iaoq_b, ctx->iaoq_n);
return EXIT_GOTO_TB;
} else {
return EXIT_IAQ_N_STALE;
}
return EXIT_IAQ_N_STALE;
} else {
return EXIT_GOTO_TB;
}
Expand Down

0 comments on commit 3c457da

Please sign in to comment.