/* * Determine which Sun2 model we are running on. * * XXX: Just save idprom.idp_machtype here, and * XXX: move the rest of this to identifycpu(). * XXX: Move cache_size stuff to cache.c. */ static void _verify_hardware(void) { unsigned char machtype; int cpu_match = 0; machtype = identity_prom.idp_machtype; if ((machtype & IDM_ARCH_MASK) != IDM_ARCH_SUN2) { prom_printf("Bad IDPROM arch!\n"); prom_abort(); } cpu_machine_id = machtype; switch (cpu_machine_id) { case ID_SUN2_120 : cpu_match++; cpu_string = "{120,170}"; delay_divisor = 205; /* 10 MHz */ cpu_has_multibus = true; break; case ID_SUN2_50 : cpu_match++; cpu_string = "50"; delay_divisor = 205; /* 10 MHz */ cpu_has_vme = true; break; default: prom_printf("unknown sun2 model\n"); prom_abort(); } if (!cpu_match) { prom_printf("kernel not configured for the Sun 2 model\n"); prom_abort(); } }
/* * This is used if we hit a kernel breakpoint or trace trap * when there is no debugger installed (or not attached). * Drop into the PROM temporarily... */ int _nodb_trap(int type, struct trapframe *tf) { printf("\r\nKernel "); if ((0 <= type) && (type < trap_types)) printf("%s", trap_type[type]); else printf("trap 0x%x", type); printf(", frame=%p\r\n", tf); printf("No debugger; doing PROM abort.\r\n"); printf("To continue, type: c <RETURN>\r\n"); prom_abort(); /* OK then, just resume... */ tf->tf_sr &= ~PSL_T; return(1); }
/* * kdb_trap - field a TRACE or BPT trap */ int kdb_trap(int type, struct trapframe64 *tf) { int s; extern int trap_trace_dis; extern int doing_shutdown; trap_trace_dis++; doing_shutdown++; #if NFB > 0 fb_unblank(); #endif switch (type) { case T_BREAKPOINT: /* breakpoint */ break; case -1: /* keyboard interrupt */ printf("kdb tf=%p\n", tf); break; default: if (!db_onpanic && db_recover==0) return (0); printf("kernel trap %x: %s\n", type, trap_type[type & 0x1ff]); if (db_recover != 0) { prom_abort(); db_error("Faulted in DDB; continuing...\n"); prom_abort(); /*NOTREACHED*/ } db_recover = (label_t *)1; } /* Should switch to kdb`s own stack here. */ write_all_windows(); #if defined(MULTIPROCESSOR) if (!db_suspend_others()) { ddb_suspend(tf); return 1; } #endif /* Initialise local dbregs storage from trap frame */ fill_ddb_regs_from_tf(tf); s = splhigh(); db_active++; cnpollc(TRUE); /* Need to do spl stuff till cnpollc works */ db_dump_ts(0, 0, 0, 0); db_trap(type, 0/*code*/); ddb_restore_state(); cnpollc(FALSE); db_active--; splx(s); *tf = DDB_REGS->db_tf; curcpu()->ci_ddb_regs = NULL; trap_trace_dis--; doing_shutdown--; #if defined(MULTIPROCESSOR) db_resume_others(); #endif return (1); }
void db_prom_cmd(db_expr_t addr, bool have_addr, db_expr_t count, const char *modif) { prom_abort(); }