diff options
| author | Peter Maydell <peter.maydell@linaro.org> | 2019-07-01 16:59:29 +0100 |
|---|---|---|
| committer | Peter Maydell <peter.maydell@linaro.org> | 2019-07-01 16:59:29 +0100 |
| commit | 5e6ebacc3b1e4e8d52a27b9f236fdc01d828641c (patch) | |
| tree | 08b11c91ac919bf8aa7d6e001dc201c5bbc4b683 /target/m68k/op_helper.c | |
| parent | ae9108f8f0746ce64d02afb1a216153a50926132 (diff) | |
| parent | c6d0700f57b2c50229a27e31b9f99056a011215f (diff) | |
| download | focaccia-qemu-5e6ebacc3b1e4e8d52a27b9f236fdc01d828641c.tar.gz focaccia-qemu-5e6ebacc3b1e4e8d52a27b9f236fdc01d828641c.zip | |
Merge remote-tracking branch 'remotes/vivier/tags/m68k-next-pull-request' into staging
remove m68k simulator syscall interface Fix comments format Fix gdbstub # gpg: Signature made Wed 26 Jun 2019 17:20:41 BST # gpg: using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C # gpg: issuer "laurent@vivier.eu" # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full] # gpg: aka "Laurent Vivier <laurent@vivier.eu>" [full] # gpg: aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full] # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F 5173 F30C 38BD 3F2F BE3C * remotes/vivier/tags/m68k-next-pull-request: linux-user/m68k: remove simulator syscall interface m68k comments break patch submission due to being incorrectly formatted The m68k gdbstub SR reg request doesnt include Condition-Codes Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target/m68k/op_helper.c')
| -rw-r--r-- | target/m68k/op_helper.c | 58 |
1 files changed, 37 insertions, 21 deletions
diff --git a/target/m68k/op_helper.c b/target/m68k/op_helper.c index ebcfe3dfdd..bc4f845e3f 100644 --- a/target/m68k/op_helper.c +++ b/target/m68k/op_helper.c @@ -494,10 +494,12 @@ bool m68k_cpu_exec_interrupt(CPUState *cs, int interrupt_request) if (interrupt_request & CPU_INTERRUPT_HARD && ((env->sr & SR_I) >> SR_I_SHIFT) < env->pending_level) { - /* Real hardware gets the interrupt vector via an IACK cycle - at this point. Current emulated hardware doesn't rely on - this, so we provide/save the vector when the interrupt is - first signalled. */ + /* + * Real hardware gets the interrupt vector via an IACK cycle + * at this point. Current emulated hardware doesn't rely on + * this, so we provide/save the vector when the interrupt is + * first signalled. + */ cs->exception_index = env->pending_vector; do_interrupt_m68k_hardirq(env); return true; @@ -537,7 +539,8 @@ void HELPER(divuw)(CPUM68KState *env, int destr, uint32_t den) env->cc_c = 0; /* always cleared, even if overflow */ if (quot > 0xffff) { env->cc_v = -1; - /* real 68040 keeps N and unset Z on overflow, + /* + * real 68040 keeps N and unset Z on overflow, * whereas documentation says "undefined" */ env->cc_z = 1; @@ -564,7 +567,8 @@ void HELPER(divsw)(CPUM68KState *env, int destr, int32_t den) if (quot != (int16_t)quot) { env->cc_v = -1; /* nothing else is modified */ - /* real 68040 keeps N and unset Z on overflow, + /* + * real 68040 keeps N and unset Z on overflow, * whereas documentation says "undefined" */ env->cc_z = 1; @@ -647,7 +651,8 @@ void HELPER(divull)(CPUM68KState *env, int numr, int regr, uint32_t den) env->cc_c = 0; /* always cleared, even if overflow */ if (quot > 0xffffffffULL) { env->cc_v = -1; - /* real 68040 keeps N and unset Z on overflow, + /* + * real 68040 keeps N and unset Z on overflow, * whereas documentation says "undefined" */ env->cc_z = 1; @@ -681,7 +686,8 @@ void HELPER(divsll)(CPUM68KState *env, int numr, int regr, int32_t den) env->cc_c = 0; /* always cleared, even if overflow */ if (quot != (int32_t)quot) { env->cc_v = -1; - /* real 68040 keeps N and unset Z on overflow, + /* + * real 68040 keeps N and unset Z on overflow, * whereas documentation says "undefined" */ env->cc_z = 1; @@ -838,14 +844,18 @@ static struct bf_data bf_prep(uint32_t addr, int32_t ofs, uint32_t len) addr -= 1; } - /* Compute the number of bytes required (minus one) to - satisfy the bitfield. */ + /* + * Compute the number of bytes required (minus one) to + * satisfy the bitfield. + */ blen = (bofs + len - 1) / 8; - /* Canonicalize the bit offset for data loaded into a 64-bit big-endian - word. For the cases where BLEN is not a power of 2, adjust ADDR so - that we can use the next power of two sized load without crossing a - page boundary, unless the field itself crosses the boundary. */ + /* + * Canonicalize the bit offset for data loaded into a 64-bit big-endian + * word. For the cases where BLEN is not a power of 2, adjust ADDR so + * that we can use the next power of two sized load without crossing a + * page boundary, unless the field itself crosses the boundary. + */ switch (blen) { case 0: bofs += 56; @@ -937,8 +947,10 @@ uint64_t HELPER(bfextu_mem)(CPUM68KState *env, uint32_t addr, struct bf_data d = bf_prep(addr, ofs, len); uint64_t data = bf_load(env, d.addr, d.blen, ra); - /* Put CC_N at the top of the high word; put the zero-extended value - at the bottom of the low word. */ + /* + * Put CC_N at the top of the high word; put the zero-extended value + * at the bottom of the low word. + */ data <<= d.bofs; data >>= 64 - d.len; data |= data << (64 - d.len); @@ -1016,15 +1028,18 @@ uint64_t HELPER(bfffo_mem)(CPUM68KState *env, uint32_t addr, uint64_t n = (data & mask) << d.bofs; uint32_t ffo = helper_bfffo_reg(n >> 32, ofs, d.len); - /* Return FFO in the low word and N in the high word. - Note that because of MASK and the shift, the low word - is already zero. */ + /* + * Return FFO in the low word and N in the high word. + * Note that because of MASK and the shift, the low word + * is already zero. + */ return n | ffo; } void HELPER(chk)(CPUM68KState *env, int32_t val, int32_t ub) { - /* From the specs: + /* + * From the specs: * X: Not affected, C,V,Z: Undefined, * N: Set if val < 0; cleared if val > ub, undefined otherwise * We implement here values found from a real MC68040: @@ -1054,7 +1069,8 @@ void HELPER(chk)(CPUM68KState *env, int32_t val, int32_t ub) void HELPER(chk2)(CPUM68KState *env, int32_t val, int32_t lb, int32_t ub) { - /* From the specs: + /* + * From the specs: * X: Not affected, N,V: Undefined, * Z: Set if val is equal to lb or ub * C: Set if val < lb or val > ub, cleared otherwise |