Sparc32: fix monitor commands 'info pic' and 'info irq'
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
7432ff5d6b
commit
d453c2c32e
|
@ -220,11 +220,14 @@ static CPUWriteMemoryFunc *slavio_intctlm_mem_write[3] = {
|
||||||
slavio_intctlm_mem_writel,
|
slavio_intctlm_mem_writel,
|
||||||
};
|
};
|
||||||
|
|
||||||
void slavio_pic_info(Monitor *mon, void *opaque)
|
void slavio_pic_info(Monitor *mon, DeviceState *dev)
|
||||||
{
|
{
|
||||||
SLAVIO_INTCTLState *s = opaque;
|
SysBusDevice *sd;
|
||||||
|
SLAVIO_INTCTLState *s;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
sd = sysbus_from_qdev(dev);
|
||||||
|
s = FROM_SYSBUS(SLAVIO_INTCTLState, sd);
|
||||||
for (i = 0; i < MAX_CPUS; i++) {
|
for (i = 0; i < MAX_CPUS; i++) {
|
||||||
monitor_printf(mon, "per-cpu %d: pending 0x%08x\n", i,
|
monitor_printf(mon, "per-cpu %d: pending 0x%08x\n", i,
|
||||||
s->slaves[i].intreg_pending);
|
s->slaves[i].intreg_pending);
|
||||||
|
@ -233,15 +236,18 @@ void slavio_pic_info(Monitor *mon, void *opaque)
|
||||||
s->intregm_pending, s->intregm_disabled);
|
s->intregm_pending, s->intregm_disabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
void slavio_irq_info(Monitor *mon, void *opaque)
|
void slavio_irq_info(Monitor *mon, DeviceState *dev)
|
||||||
{
|
{
|
||||||
#ifndef DEBUG_IRQ_COUNT
|
#ifndef DEBUG_IRQ_COUNT
|
||||||
monitor_printf(mon, "irq statistic code not compiled.\n");
|
monitor_printf(mon, "irq statistic code not compiled.\n");
|
||||||
#else
|
#else
|
||||||
SLAVIO_INTCTLState *s = opaque;
|
SysBusDevice *sd;
|
||||||
|
SLAVIO_INTCTLState *s;
|
||||||
int i;
|
int i;
|
||||||
int64_t count;
|
int64_t count;
|
||||||
|
|
||||||
|
sd = sysbus_from_qdev(dev);
|
||||||
|
s = FROM_SYSBUS(SLAVIO_INTCTLState, sd);
|
||||||
monitor_printf(mon, "IRQ statistics:\n");
|
monitor_printf(mon, "IRQ statistics:\n");
|
||||||
for (i = 0; i < 32; i++) {
|
for (i = 0; i < 32; i++) {
|
||||||
count = s->irq_count[i];
|
count = s->irq_count[i];
|
||||||
|
|
|
@ -209,7 +209,7 @@ static void nvram_init(m48t59_t *nvram, uint8_t *macaddr, const char *cmdline,
|
||||||
m48t59_write(nvram, i, image[i]);
|
m48t59_write(nvram, i, image[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *slavio_intctl;
|
static DeviceState *slavio_intctl;
|
||||||
|
|
||||||
void pic_info(Monitor *mon)
|
void pic_info(Monitor *mon)
|
||||||
{
|
{
|
||||||
|
@ -748,7 +748,6 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, ram_addr_t RAM_size,
|
||||||
unsigned long kernel_size;
|
unsigned long kernel_size;
|
||||||
BlockDriverState *fd[MAX_FD];
|
BlockDriverState *fd[MAX_FD];
|
||||||
void *fw_cfg;
|
void *fw_cfg;
|
||||||
DeviceState *dev;
|
|
||||||
DriveInfo *dinfo;
|
DriveInfo *dinfo;
|
||||||
|
|
||||||
/* init CPUs */
|
/* init CPUs */
|
||||||
|
@ -768,16 +767,16 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, ram_addr_t RAM_size,
|
||||||
|
|
||||||
prom_init(hwdef->slavio_base, bios_name);
|
prom_init(hwdef->slavio_base, bios_name);
|
||||||
|
|
||||||
dev = slavio_intctl_init(hwdef->intctl_base,
|
slavio_intctl = slavio_intctl_init(hwdef->intctl_base,
|
||||||
hwdef->intctl_base + 0x10000ULL,
|
hwdef->intctl_base + 0x10000ULL,
|
||||||
cpu_irqs,
|
cpu_irqs,
|
||||||
7);
|
7);
|
||||||
|
|
||||||
for (i = 0; i < 32; i++) {
|
for (i = 0; i < 32; i++) {
|
||||||
slavio_irq[i] = qdev_get_gpio_in(dev, i);
|
slavio_irq[i] = qdev_get_gpio_in(slavio_intctl, i);
|
||||||
}
|
}
|
||||||
for (i = 0; i < MAX_CPUS; i++) {
|
for (i = 0; i < MAX_CPUS; i++) {
|
||||||
slavio_cpu_irq[i] = qdev_get_gpio_in(dev, 32 + i);
|
slavio_cpu_irq[i] = qdev_get_gpio_in(slavio_intctl, 32 + i);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hwdef->idreg_base) {
|
if (hwdef->idreg_base) {
|
||||||
|
|
|
@ -23,8 +23,8 @@ static inline void sparc_iommu_memory_write(void *opaque,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* slavio_intctl.c */
|
/* slavio_intctl.c */
|
||||||
void slavio_pic_info(Monitor *mon, void *opaque);
|
void slavio_pic_info(Monitor *mon, DeviceState *dev);
|
||||||
void slavio_irq_info(Monitor *mon, void *opaque);
|
void slavio_irq_info(Monitor *mon, DeviceState *dev);
|
||||||
|
|
||||||
/* sun4c_intctl.c */
|
/* sun4c_intctl.c */
|
||||||
void sun4c_pic_info(Monitor *mon, void *opaque);
|
void sun4c_pic_info(Monitor *mon, void *opaque);
|
||||||
|
|
Loading…
Reference in a new issue