gonzui


Format: Advanced Search

tkernel_2/driver/tef_em1d/console/src/main.cbare sourcepermlink (0.00 seconds)

Search this content:

    1: /*
    2:  *----------------------------------------------------------------------
    3:  *    T-Kernel 2.0 Software Package
    4:  *
    5:  *    Copyright 2011 by Ken Sakamura.
    6:  *    This software is distributed under the latest version of T-License 2.x.
    7:  *----------------------------------------------------------------------
    8:  *
    9:  *    Released by T-Engine Forum(http://www.t-engine.org/) at 2011/05/17.
   10:  *    Modified by T-Engine Forum at 2013/03/01.
   11:  *    Modified by TRON Forum(http://www.tron.org/) at 2015/06/01.
   12:  *
   13:  *----------------------------------------------------------------------
   14:  */
   15: 
   16: /*
   17:  *      main.c       Console/Low-level serial I/O driver
   18:  *
   19:  *      Main entry  : system-independent
   20:  */
   21: 
   22: #include <basic.h>
   23: #include <tk/tkernel.h>
   24: 
   25: /* Console driver */
   26: IMPORT  ER       console_startup( BOOL StartUp );
   27: 
   28: /* Low-level serial I/O driver */
   29: IMPORT  ER       startup_serial_io( BOOL StartUp );
   30: 
   31: /*
   32:  *      Register/Deregister the subsystem
   33:  */
   34: EXPORT  ER       con_def_subsys(W svc, W pri, void *svcent, void *brkent)
   35: {
   36:         T_DSSY dssy;
   37: 
   38:         dssy.ssyatr    = TA_NULL;
   39:         dssy.ssypri    = pri;
   40:         dssy.svchdr    = (FP)svcent;
   41:         dssy.breakfn   = (FP)brkent;
   42:         dssy.startupfn = NULL;
   43:         dssy.cleanupfn = NULL;
   44:         dssy.eventfn   = NULL;
   45:         dssy.resblksz  = 0;
   46:         if (! svcent) return tk_def_ssy(svc, NULL);    /* Delete only */
   47:         if (brkent) tk_def_ssy(svc, NULL);             /* Delete once */
   48:         return tk_def_ssy(svc, &dssy);                 /* Registration */
   49: }
   50: 
   51: /*
   52:  *      Console initialization/End processing entry
   53:  */
   54: EXPORT  ER       ConsoleIO( INT ac, UB *av[] )
   55: {
   56:         BOOL   start;
   57: 
   58:         start = (ac >= 0) ? TRUE : FALSE;
   59: 
   60:         /* Startup/Exit the low-level serial I/O */
   61:         startup_serial_io(start);
   62: 
   63:         /* Startup/ Exit the console driver */
   64:         console_startup(start);
   65: 
   66:         return E_OK;
   67: }