-extern FILE *logfile;
-
-void mips_set_irq (int n_IRQ, int level)
-{
- uint32_t mask;
-
- if (n_IRQ < 0 || n_IRQ >= 8)
- return;
- mask = 0x100 << n_IRQ;
- if (level != 0) {
-#if 1
- if (logfile) {
- fprintf(logfile, "%s n %d l %d mask %08x %08x\n",
- __func__, n_IRQ, level, mask, cpu_single_env->CP0_Status);
- }
-#endif
- cpu_single_env->CP0_Cause |= mask;
- if ((cpu_single_env->CP0_Status & 0x00000001) &&
- (cpu_single_env->CP0_Status & mask)) {
-#if defined(DEBUG_IRQ_COUNT)
- irq_count[n_IRQ]++;
-#endif
-#if 1
- if (logfile)
- fprintf(logfile, "%s raise IRQ\n", __func__);
-#endif
- cpu_interrupt(cpu_single_env, CPU_INTERRUPT_HARD);
- }
- } else {
- cpu_single_env->CP0_Cause &= ~mask;
- }
-}
-
-void pic_set_irq (int n_IRQ, int level)
-{
- mips_set_irq(n_IRQ + 2, level);
-}
-
-void pic_info (void)
-{
- term_printf("IRQ asserted: %02x mask: %02x\n",
- (cpu_single_env->CP0_Cause >> 8) & 0xFF,
- (cpu_single_env->CP0_Status >> 8) & 0xFF);
-}
-
-void irq_info (void)
-{
-#if !defined(DEBUG_IRQ_COUNT)
- term_printf("irq statistic code not compiled.\n");