void com_resume(struct com_softc *sc) { struct tty *tp = sc->sc_tty; bus_space_tag_t iot = sc->sc_iot; bus_space_handle_t ioh = sc->sc_ioh; int ospeed; if (!tp || !ISSET(tp->t_state, TS_ISOPEN)) { #ifdef COM_CONSOLE if (ISSET(sc->sc_hwflags, COM_HW_CONSOLE)) cominit(iot, ioh, comconsrate, comconsfreq); #endif return; } /* * Wake up the sleepy heads. */ if (!ISSET(sc->sc_hwflags, COM_HW_CONSOLE)) { switch (sc->sc_uarttype) { case COM_UART_ST16650: case COM_UART_ST16650V2: bus_space_write_1(iot, ioh, com_lcr, LCR_EFR); bus_space_write_1(iot, ioh, com_efr, EFR_ECB); bus_space_write_1(iot, ioh, com_ier, 0); bus_space_write_1(iot, ioh, com_efr, 0); bus_space_write_1(iot, ioh, com_lcr, 0); break; case COM_UART_TI16750: bus_space_write_1(iot, ioh, com_ier, 0); break; case COM_UART_PXA2X0: bus_space_write_1(iot, ioh, com_ier, IER_EUART); break; } } ospeed = comspeed(sc->sc_frequency, tp->t_ospeed); if (ospeed != 0) { bus_space_write_1(iot, ioh, com_lcr, sc->sc_lcr | LCR_DLAB); bus_space_write_1(iot, ioh, com_dlbl, ospeed); bus_space_write_1(iot, ioh, com_dlbh, ospeed >> 8); bus_space_write_1(iot, ioh, com_lcr, sc->sc_lcr); } else {
int common (char *s) { if (cgate==0) cominit(); return (c_look(s, 1)); }
int main(int argc, char **argv) { int i; char commandLine[ MAX_STRING_CHARS ] = { 0 }; #ifndef DEDICATED /* SDL version check */ /* Compile time */ # if !SDL_VERSION_ATLEAST(MINSDL_MAJOR,MINSDL_MINOR,MINSDL_PATCH) # error A more recent version of SDL is required # endif /* Run time */ const SDL_version *ver = SDL_Linked_Version(); #define MINSDL_VERSION \ XSTRING(MINSDL_MAJOR) "." \ XSTRING(MINSDL_MINOR) "." \ XSTRING(MINSDL_PATCH) if(SDL_VERSIONNUM(ver->major, ver->minor, ver->patch) < SDL_VERSIONNUM(MINSDL_MAJOR, MINSDL_MINOR, MINSDL_PATCH)){ sysmkdialog(DT_ERROR, va( "SDL version " MINSDL_VERSION " or greater is required, " "but only version %d.%d.%d was found.", ver->major, ver->minor, ver->patch), "SDL library too old"); Sys_Exit(1); } syssetenv("SDL_DISABLE_LOCK_KEYS", "1"); #endif Sys_PlatformInit( ); /* Set the initial time base */ sysmillisecs( ); Sys_ParseArgs(argc, argv); Sys_SetBinaryPath(sysdirname(argv[ 0 ])); syssetdefaultinstallpath(DEFAULT_BASEDIR); /* Concatenate the command line for passing to cominit */ for(i = 1; i < argc; i++){ const qbool containsSpaces = strchr(argv[i], ' ') != NULL; if(containsSpaces) Q_strcat(commandLine, sizeof(commandLine), "\""); Q_strcat(commandLine, sizeof(commandLine), argv[ i ]); if(containsSpaces) Q_strcat(commandLine, sizeof(commandLine), "\""); Q_strcat(commandLine, sizeof(commandLine), " "); } cominit(commandLine); netinit(); CON_Init(); signal(SIGILL, Sys_SigHandler); signal(SIGFPE, Sys_SigHandler); signal(SIGSEGV, Sys_SigHandler); signal(SIGTERM, Sys_SigHandler); signal(SIGINT, Sys_SigHandler); for(;;){ IN_Frame(); comframe(); } return 0; }