diff mbox series

[2/5] target/rx: Set exception vector base to 0xffffff80

Message ID 20250215021654.1786679-3-keithp@keithp.com (mailing list archive)
State New
Headers show
Series Renesas RX target fixes | expand

Commit Message

Keith Packard Feb. 15, 2025, 2:16 a.m. UTC
The documentation says the vector is at 0xffffff80, instead of the
previous value of 0xffffffc0. That value must have been a bug because
the standard vector values (20, 21, 23, 25, 30) were all
past the end of the array.

Signed-off-by: Keith Packard <keithp@keithp.com>
---
 target/rx/helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Richard Henderson Feb. 15, 2025, 6:12 p.m. UTC | #1
On 2/14/25 18:16, Keith Packard via wrote:
> The documentation says the vector is at 0xffffff80, instead of the
> previous value of 0xffffffc0. That value must have been a bug because
> the standard vector values (20, 21, 23, 25, 30) were all
> past the end of the array.
> 
> Signed-off-by: Keith Packard <keithp@keithp.com>
> ---
>   target/rx/helper.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/rx/helper.c b/target/rx/helper.c
> index 80912e8dcb..55e2ae4a11 100644
> --- a/target/rx/helper.c
> +++ b/target/rx/helper.c
> @@ -90,7 +90,7 @@ void rx_cpu_do_interrupt(CPUState *cs)
>           cpu_stl_data(env, env->isp, env->pc);
>   
>           if (vec < 0x100) {
> -            env->pc = cpu_ldl_data(env, 0xffffffc0 + vec * 4);
> +            env->pc = cpu_ldl_data(env, 0xffffff80 + vec * 4);
>           } else {
>               env->pc = cpu_ldl_data(env, env->intb + (vec & 0xff) * 4);
>           }

This does appear to match the unnamed constants used as operands to raise_exception, 
comparing to the vector addresses in the manual: (0xffffffd0, etc).

It would be nice to have them named, e.g. per the named list in rx_cpu_do_interrupt.  The 
0x100 constant would probably be better numbered 32, so that

   vec < 0x100

checks themselves don't imply wraparound from 0xffffff80.


r~
diff mbox series

Patch

diff --git a/target/rx/helper.c b/target/rx/helper.c
index 80912e8dcb..55e2ae4a11 100644
--- a/target/rx/helper.c
+++ b/target/rx/helper.c
@@ -90,7 +90,7 @@  void rx_cpu_do_interrupt(CPUState *cs)
         cpu_stl_data(env, env->isp, env->pc);
 
         if (vec < 0x100) {
-            env->pc = cpu_ldl_data(env, 0xffffffc0 + vec * 4);
+            env->pc = cpu_ldl_data(env, 0xffffff80 + vec * 4);
         } else {
             env->pc = cpu_ldl_data(env, env->intb + (vec & 0xff) * 4);
         }