gonzui


Format: Advanced Search

tkernel_2/driver/tef_em1d/console/src/ns16450sys.hbare 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:  *      ns16450sys.h Console/Low-level serial I/O driver
   18:  *
   19:  *      Serial line low level driver (for NS16450)
   20:  *                      EM1-D512 system-dependent definition
   21:  */
   22: 
   23: /*
   24:  *      "UART" clock
   25:  */
   26: #define UART_CLK        (229376000)    /* Hz */
   27: 
   28: /*
   29:  *      I/O input and output macro
   30:  */
   31: #define OutB(ix, dt)    out_b((ix), (dt))
   32: #define InB(ix)         in_b((ix))
   33: 
   34: /*
   35:  *      Post-interrupt processing
   36:  */
   37: Inline  void     end_inthdr(SC_DEFS *scdefs)
   38: {
   39:         /* Unnecessary to execute anything */
   40: }
   41: 
   42: /*
   43:  *      Release an interrupt handler
   44:  */
   45: Inline  void     delete_inthdr(SC_DEFS *scdefs, void *sio_inthdr)
   46: {
   47:         ER     err;
   48: 
   49:         /* Release an interrupt handler */
   50:         err = tk_def_int(scdefs->c.intvec, NULL);
   51:         if (err >= E_OK) {
   52:                 /* Disable interrupt */
   53:                 DisableInt(scdefs->c.intvec);
   54:         }
   55: }
   56: 
   57: /*
   58:  *      Register the interrupt handler
   59:  */
   60: Inline  ER       regist_inthdr(SC_DEFS *scdefs, void *sio_inthdr)
   61: {
   62:         T_DINT dint;
   63:         ER     err;
   64: 
   65:         /* Register the interrupt handler */
   66:         dint.intatr = TA_HLNG;
   67:         dint.inthdr = sio_inthdr;
   68:         err = tk_def_int(scdefs->c.intvec, &dint);
   69:         if (err >= E_OK) {
   70:                 /* Enable interrupt */
   71:                 SetIntMode(scdefs->c.intvec, IM_ENA);
   72:                 EnableInt(scdefs->c.intvec);
   73:         }
   74:         return err;
   75: }
   76: 
   77: /*
   78:  *      Suspend/Resume
   79:  */
   80: Inline  void     sio_susres(LINE_INFO *li, W resume)
   81: {
   82:         /* Execute nothing */
   83: }
   84: