void time_statsf(FILE *f, char *str, int size) { long sum; printx("times in seconds:\n"); tm_sum = 0; print_t_(intro); print_tn(wpad); print_t_(ios1); print_tn(ios2); print_t_(sd_init); print_tn(sd_mount); print_t_(usb_init); print_t3("mount", usb_mount, " "); print_t3("retry", usb_retry, "\n"); printx("open: %.3f ini: %.3f cap: %.3f\n", diff_fsec(TIME.usb_init1, TIME.usb_open), diff_fsec(TIME.usb_open, TIME.usb_cap), diff_fsec(TIME.usb_cap, TIME.usb_init2)); print_t3("cfg", cfg, " (config,settings,titles,theme)\n"); print_t3("misc", misc, " (lang,playstat,unifont)\n"); print_t_(wiitdb); printx("load: %.3f parse: %.3f\n", TIME_S(db_load), TIME_S(wiitdb)-TIME_S(db_load)); print_t_(gamelist); print_tn(mp3); print_t_(conbg); print_tn(guitheme); sum = tm_sum; printx("sum: %.3f ", (float)sum/1000.0); printx("uncounted: %.3f\n", (float)((long)TIME_MS(boot)-sum)/1000.0); print_t2("total startup", boot); }
/** * @brief HACK: pull the next word from the duckbreath in the fifo * * This is probably lacking the updates to one or more of * the status flip flops. */ static void rx_duckbreath(int id, int arg) { uint32_t data; if (arg == 0) { /* first word: set the IBUSY flip flop */ PUT_ETH_IBUSY(eth.status, 1); } data = duckbreath[arg++]; eth.rx_crc = f9401_7(eth.rx_crc, data); eth.fifo[eth.fifo_wr] = data; if (++eth.fifo_wr == ETHER_FIFO_SIZE) eth.fifo_wr = 0; PUT_ETH_WLF(eth.status, 1); if (ETHER_A49_BF == 0) { /* fifo is overrun: set input data late flip flop */ PUT_ETH_IDL(eth.status, 1); } if (arg == BREATHLEN) { /* * last word: reset the receiver CRC * * TODO: if data comes from some other source, * compare our CRC with the next word received * and set the CRC error flag if they differ. */ eth.rx_crc = 0; /* set the IGONE flip flop */ PUT_ETH_IGONE(eth.status, 1); ether_show_indicators(1); timer_insert(TIME_S(duckbreath_sec), rx_duckbreath, 0, "duckbreath"); } else { /* 5.44us per word (?) */ timer_insert(TIME_US(5.44), rx_duckbreath, arg, "duckbreath"); } eth_wakeup(); }
/** * @brief pass command line switches down to the Ethernet code * * @param arg a pointer to a command line switch, like "-db" * @result returns 0 if arg was accepted, -1 otherwise */ int ether_args(const char *arg) { char *equ; int val; switch (arg[0]) { case '-': arg++; equ = strchr(arg, '='); if (equ) val = strtoull(equ+1,NULL,0); else val = 5; break; default: return -1; } if (!strncmp(arg, "ee", 2)) { ether_enable = 1; return 0; } if (!strncmp(arg, "db", 2)) { duckbreath_sec = val; if (duckbreath_sec > 0) timer_insert(TIME_S(duckbreath_sec), rx_duckbreath, 0, "duckbreath"); return 0; } if (!strncmp(arg, "eh", 2)) { if (val < 1 || val > 254) fatal(1, "Invalid Ether Host: %d\n", val); ether_id = val; return 0; } return -1; }