diff options
author | Blue Swirl <blauwirbel@gmail.com> | 2012-03-10 20:37:00 +0000 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2012-03-17 16:30:06 +0000 |
commit | 361dea401f529fc136aaeb49c82b2a5bb7faa316 (patch) | |
tree | 84fd01e931fbd33f6359e4fe758c087d3f65d551 /target-sparc | |
parent | 89aaf60dedbe0e6415acfe816e02b538e5c54e68 (diff) | |
download | qemu-361dea401f529fc136aaeb49c82b2a5bb7faa316.zip qemu-361dea401f529fc136aaeb49c82b2a5bb7faa316.tar.gz qemu-361dea401f529fc136aaeb49c82b2a5bb7faa316.tar.bz2 |
sparc64: implement PCI and ISA irqs
Generate correct trap for external interrupts. Map PCI and ISA IRQs to
RIC/UltraSPARC-IIi interrupt vectors.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'target-sparc')
-rw-r--r-- | target-sparc/cpu.h | 3 | ||||
-rw-r--r-- | target-sparc/ldst_helper.c | 20 |
2 files changed, 17 insertions, 6 deletions
diff --git a/target-sparc/cpu.h b/target-sparc/cpu.h index 887adc3..f638457 100644 --- a/target-sparc/cpu.h +++ b/target-sparc/cpu.h @@ -493,6 +493,9 @@ struct CPUSPARCState { /* UA 2005 hyperprivileged registers */ uint64_t hpstate, htstate[MAXTL_MAX], hintp, htba, hver, hstick_cmpr, ssr; CPUTimer *hstick; // UA 2005 + /* Interrupt vector registers */ + uint64_t ivec_status; + uint64_t ivec_data[3]; uint32_t softint; #define SOFTINT_TIMER 1 #define SOFTINT_STIMER (1 << 16) diff --git a/target-sparc/ldst_helper.c b/target-sparc/ldst_helper.c index 48d433c..97afdd3 100644 --- a/target-sparc/ldst_helper.c +++ b/target-sparc/ldst_helper.c @@ -1526,6 +1526,19 @@ uint64_t helper_ld_asi(target_ulong addr, int asi, int size, int sign) ret = env->dtlb[reg].tag; break; } + case 0x48: /* Interrupt dispatch, RO */ + break; + case 0x49: /* Interrupt data receive */ + ret = env->ivec_status; + break; + case 0x7f: /* Incoming interrupt vector, RO */ + { + int reg = (addr >> 4) & 0x3; + if (reg < 3) { + ret = env->ivec_data[reg]; + } + break; + } case 0x46: /* D-cache data */ case 0x47: /* D-cache tag access */ case 0x4b: /* E-cache error enable */ @@ -1540,11 +1553,6 @@ uint64_t helper_ld_asi(target_ulong addr, int asi, int size, int sign) case 0x7e: /* E-cache tag */ break; case 0x5b: /* D-MMU data pointer */ - case 0x48: /* Interrupt dispatch, RO */ - case 0x49: /* Interrupt data receive */ - case 0x7f: /* Incoming interrupt vector, RO */ - /* XXX */ - break; case 0x54: /* I-MMU data in, WO */ case 0x57: /* I-MMU demap, WO */ case 0x5c: /* D-MMU data in, WO */ @@ -1954,7 +1962,7 @@ void helper_st_asi(target_ulong addr, target_ulong val, int asi, int size) demap_tlb(env->dtlb, addr, "dmmu", env); return; case 0x49: /* Interrupt data receive */ - /* XXX */ + env->ivec_status = val & 0x20; return; case 0x46: /* D-cache data */ case 0x47: /* D-cache tag access */ |