void Show_Runs(void) { AisoIter iter; struct run *run; #ifdef DB_RUN fprintf(Debug_File, "Starting Show_Runs()\n"); #endif /* DB_RUN */ max_line_length = Page_Width / 2 - 2; line0 = Malloc((size_t)(max_line_length + 1) * sizeof (char)); line1 = Malloc((size_t)(max_line_length + 1) * sizeof (char)); OpenIter(&iter); while (GetAisoItem(&iter, &run)) { #ifdef DB_RUN db_run(run); #endif /* DB_RUN */ show_run(run); fprintf(Output_File, "\n"); } CloseIter(&iter); Free(line0); line0 = 0; Free(line1); line1 = 0; }
void ddb5477_irq_setup(void) { db_run(printk("ddb5477_irq_setup invoked.\n")); /* by default, we disable all interrupts and route all vrc5477 * interrupts to pin 0 (irq 2) */ ddb_out32(DDB_INTCTRL0, 0); ddb_out32(DDB_INTCTRL1, 0); ddb_out32(DDB_INTCTRL2, 0); ddb_out32(DDB_INTCTRL3, 0); clear_cp0_status(0xff00); set_cp0_status(0x0400); /* setup PCI interrupt attributes */ set_pci_int_attr(PCI0, INTA, ACTIVE_LOW, LEVEL_SENSE); set_pci_int_attr(PCI0, INTB, ACTIVE_LOW, LEVEL_SENSE); set_pci_int_attr(PCI0, INTC, ACTIVE_LOW, LEVEL_SENSE); set_pci_int_attr(PCI0, INTD, ACTIVE_LOW, LEVEL_SENSE); set_pci_int_attr(PCI0, INTE, ACTIVE_LOW, LEVEL_SENSE); set_pci_int_attr(PCI1, INTA, ACTIVE_LOW, LEVEL_SENSE); set_pci_int_attr(PCI1, INTB, ACTIVE_LOW, LEVEL_SENSE); set_pci_int_attr(PCI1, INTC, ACTIVE_LOW, LEVEL_SENSE); set_pci_int_attr(PCI1, INTD, ACTIVE_LOW, LEVEL_SENSE); set_pci_int_attr(PCI1, INTE, ACTIVE_LOW, LEVEL_SENSE); /* * for debugging purpose, we enable several error interrupts * and route them to pin 1. (IP3) */ /* cpu parity check - 0 */ ll_vrc5477_irq_route(0, 1); ll_vrc5477_irq_enable(0); /* cpu no-target decode - 1 */ ll_vrc5477_irq_route(1, 1); ll_vrc5477_irq_enable(1); /* local bus read time-out - 7 */ ll_vrc5477_irq_route(7, 1); ll_vrc5477_irq_enable(7); /* PCI SERR# - 14 */ ll_vrc5477_irq_route(14, 1); ll_vrc5477_irq_enable(14); /* PCI internal error - 15 */ ll_vrc5477_irq_route(15, 1); ll_vrc5477_irq_enable(15); /* IOPCI SERR# - 30 */ ll_vrc5477_irq_route(30, 1); ll_vrc5477_irq_enable(30); /* IOPCI internal error - 31 */ ll_vrc5477_irq_route(31, 1); ll_vrc5477_irq_enable(31); /* init all controllers */ mips_cpu_irq_init(0); vrc5477_irq_init(8); /* hook up the first-level interrupt handler */ set_except_vector(0, ddb5477_handle_int); }
void Show_Runs(void) { #ifdef DB_RUN fprintf(Debug_File, "Starting Show_Runs()\n"); #endif /* DB_RUN */ const struct run *run = /*ZZ*/ (is_set_option('u') ? unsorted_runs() : sorted_runs()); while (run) { #ifdef DB_RUN db_run(run); #endif /* DB_RUN */ show_run(run); print_char('\n'); fflush(Output_File); run = run->rn_next; } discard_runs(); }
void __init pcibios_fixup_irqs(void) { struct pci_dev *dev; int slot_num; pci_for_each_dev(dev) { slot_num = PCI_SLOT(dev->devfn); /* we don't do IRQ fixup for sub-bus yet */ if (dev->bus->parent != NULL) { db_run(printk("Don't know how to fixup irq for PCI device %d on sub-bus %d\n", slot_num, dev->bus->number)); continue; } db_assert(slot_num < MAX_SLOT_NUM); db_assert(irq_map[slot_num] != 0xff); pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq_map[slot_num]); dev->irq = vrc5477_irq_to_irq(irq_map[slot_num]); } }
int main(int argc, char *argv[]) { T *db; char buf[32]; char dbpath[256]; UNUSED(argc); UNUSED(argv); #ifndef FOR_UNIT_TEST init_log(); #endif strcpy(dbpath, argv[1]); l_tcase = atoi(argv[2]); if (argc >= 4) { l_kvcnt = atoi(argv[3]); } if (argc >= 5) { strcpy(l_prefix, argv[4]); } if (argc >= 6) { loop = atoi(argv[5]); } dbver = dbe_version(dbpath); if (dbver == 1) { #if 0 db = db_open(dbpath, NULL); #endif } else { db = HIDB2(db_open)(dbpath, NULL); } test_init(db); if (dbver == 1) { #if 0 db_run(db); #endif } else { HIDB2(db_run)(db); } if (l_tcase & CASE_PUT) { test_db_put(db); read(1, buf, 1); } if (l_tcase & CASE_MPUT) { test_db_mput(db); read(1, buf, 1); } if (l_tcase & CASE_DEL) { test_db_del(db); read(1, buf, 1); } if (l_tcase & CASE_PDEL) { test_db_pdel(db); read(1, buf, 1); } if (l_tcase & CASE_MDEL) { test_db_mdel(db); read(1, buf, 1); } if (l_tcase & CASE_ITER) { test_db_iter(db); read(1, buf, 1); } if (l_tcase & CASE_GET) { test_db_get(db); read(1, buf, 1); } if (l_tcase & CASE_SINGLE_GET) { test_db_single_get(db); read(1, buf, 1); } if (l_tcase & CASE_RANDOM_GET) { test_db_random_get(db); read(1, buf, 1); } if (l_tcase & CASE_PGET) { test_db_pget(db); read(1, buf, 1); } if (l_tcase & CASE_SINGLE_PGET) { test_db_single_pget(db); read(1, buf, 1); } if (l_tcase & CASE_PUT_GET) { pthread_t pth, gth; pthread_create(&pth, NULL, test_db_put, db); pthread_create(>h, NULL, test_db_get, db); pthread_join(pth, NULL); pthread_join(gth, NULL); read(1, buf, 1); } if (l_tcase & CASE_PUT_PGET) { pthread_t pth, gth; pthread_create(&pth, NULL, test_db_put, db); pthread_create(>h, NULL, test_db_pget, db); pthread_join(pth, NULL); pthread_join(gth, NULL); read(1, buf, 1); } if (l_tcase & CASE_MPUT_PGET) { pthread_t pth, gth; pthread_create(&pth, NULL, test_db_mput, db); pthread_create(>h, NULL, test_db_pget, db); pthread_join(pth, NULL); pthread_join(gth, NULL); read(1, buf, 1); } if (dbver == 1) { #if 0 db_close(db); #endif } else { PRINT(stdout, "press any key to checkpoint db\n"); read(1, buf, 1); HIDB2(db_checkpoint)(db); PRINT(stdout, "press any key to close db\n"); read(1, buf, 1); HIDB2(db_close)(db); } PRINT(stdout, "press any key to exit\n"); read(1, buf, 1); return 0; }