コード例 #1
0
ファイル: nova_lp.c プロジェクト: B-Rich/simh
int32 lpt (int32 pulse, int32 code, int32 AC)
{
if (code == ioDOA)
    lpt_unit.buf = AC & 0177 ;

switch (pulse)
    {                                                   /* decode IR<8:9> */
  case iopS:                                            /* start */
    DEV_SET_BUSY( INT_LPT ) ;
    DEV_CLR_DONE( INT_LPT ) ;
    DEV_UPDATE_INTR ;
    if ( lpt_unit.wait )
       if (  (lpt_unit.buf == 015)
          || (lpt_unit.buf == 014)
          || (lpt_unit.buf == 012)
          )
        {
        sim_activate (&lpt_unit, lpt_unit.wait);
        break ;
        }
    return (lpt_svc (&lpt_unit) << IOT_V_REASON);
    break;

  case iopC:                                            /* clear */
    DEV_CLR_BUSY( INT_LPT ) ;
    DEV_CLR_DONE( INT_LPT ) ;
    DEV_UPDATE_INTR ;
    sim_cancel (&lpt_unit);                             /* deactivate unit */
    break;
    }                                                   /* end switch */

return 0;
}
コード例 #2
0
int32 clk (int32 pulse, int32 code, int32 AC)
{
if (code == ioDOA) {                                    /* DOA */
    clk_sel = AC & 3;                                   /* save select */
    sim_rtc_init (clk_time[clk_sel]);                   /* init calibr */
    }

switch (pulse) {                                        /* decode IR<8:9> */

  case iopS:                                            /* start */
    DEV_SET_BUSY( INT_CLK ) ;
    DEV_CLR_DONE( INT_CLK ) ;
    DEV_UPDATE_INTR ;
    if (!sim_is_active (&clk_unit))                     /* not running? */
        sim_activate (&clk_unit,                        /* activate */
            sim_rtc_init (clk_time[clk_sel]));          /* init calibr */
    break;

  case iopC:                                            /* clear */
    DEV_CLR_BUSY( INT_CLK ) ;
    DEV_CLR_DONE( INT_CLK ) ;
    DEV_UPDATE_INTR ;
    sim_cancel (&clk_unit);                             /* deactivate unit */
    break;
    }                                                   /* end switch */

return 0;
}
コード例 #3
0
ファイル: nova_tt.c プロジェクト: alexchenfeng/UNIXV6
int32 tti (int32 pulse, int32 code, int32 AC)
{
    int32 iodata;


    if (code == ioDIA)
        iodata = tti_unit.buf & 0377;
    else iodata = 0;

    switch (pulse)
    {   /* decode IR<8:9> */
    case iopS:                                            /* start */
        DEV_SET_BUSY( INT_TTI ) ;
        DEV_CLR_DONE( INT_TTI ) ;
        DEV_UPDATE_INTR ;
        break;

    case iopC:                                            /* clear */
        DEV_CLR_BUSY( INT_TTI ) ;
        DEV_CLR_DONE( INT_TTI ) ;
        DEV_UPDATE_INTR ;
        break;
    }                                                   /* end switch */

    return iodata;
}
コード例 #4
0
ファイル: nova_lp.c プロジェクト: B-Rich/simh
t_stat lpt_reset (DEVICE *dptr)
{
lpt_unit.buf = 0;                                       /* (not DG compatible) */
DEV_CLR_BUSY( INT_LPT ) ;
DEV_CLR_DONE( INT_LPT ) ;
DEV_UPDATE_INTR ;
sim_cancel (&lpt_unit);                                 /* deactivate unit */
return SCPE_OK;
}
コード例 #5
0
ファイル: nova_tt.c プロジェクト: alexchenfeng/UNIXV6
t_stat tto_reset (DEVICE *dptr)
{
    tto_unit.buf = 0;                                       /* <not DG compatible!>  */
    DEV_CLR_BUSY( INT_TTO ) ;
    DEV_CLR_DONE( INT_TTO ) ;
    DEV_UPDATE_INTR ;
    sim_cancel (&tto_unit);                                 /* deactivate unit */
    return SCPE_OK;
}
コード例 #6
0
ファイル: nova_tt.c プロジェクト: alexchenfeng/UNIXV6
t_stat tti_reset (DEVICE *dptr)
{
    tti_unit.buf = 0;                                       /* <not DG compatible>  */
    DEV_CLR_BUSY( INT_TTI ) ;
    DEV_CLR_DONE( INT_TTI ) ;
    DEV_UPDATE_INTR ;
    sim_activate (&tti_unit, tti_unit.wait);                /* activate unit */
    return SCPE_OK;
}
コード例 #7
0
t_stat clk_reset (DEVICE *dptr)
{
clk_sel = 0;
DEV_CLR_BUSY( INT_CLK ) ;
DEV_CLR_DONE( INT_CLK ) ;
DEV_UPDATE_INTR ;

sim_cancel (&clk_unit);                                 /* deactivate unit */
tmxr_poll = clk_time[0];                                /* poll is default */
return SCPE_OK;
}
コード例 #8
0
ファイル: nova_tt.c プロジェクト: alexchenfeng/UNIXV6
int32 tto (int32 pulse, int32 code, int32 AC)
{
    if (code == ioDOA)
        tto_unit.buf = AC & 0377;

    switch (pulse)
    {   /* decode IR<8:9> */
    case iopS:                                            /* start */
        DEV_SET_BUSY( INT_TTO ) ;
        DEV_CLR_DONE( INT_TTO ) ;
        DEV_UPDATE_INTR ;
        sim_activate (&tto_unit, tto_unit.wait);            /* activate unit */
        break;

    case iopC:                                            /* clear */
        DEV_CLR_BUSY( INT_TTO ) ;
        DEV_CLR_DONE( INT_TTO ) ;
        DEV_UPDATE_INTR ;
        sim_cancel (&tto_unit);                             /* deactivate unit */
        break;
    }                                                   /* end switch */
    return 0;
}
コード例 #9
0
ファイル: nova_qty.c プロジェクト: promovicz/simh-pre-git
t_stat qty_common_reset( DIB * dibp, UNIT * unitp, DEVICE * dptr )
{
    if ((dptr->flags & DEV_DIS) == 0)
    {
        if (dptr == &qty_dev) alm_dev.flags |= DEV_DIS;
        else qty_dev.flags |= DEV_DIS;
    }
    qty_clear( TRUE ) ;
    DEV_CLR_BUSY( INT_QTY ) ;                              /*  clear busy  */
    DEV_CLR_DONE( INT_QTY ) ;                              /*  clear done, int */
    DEV_UPDATE_INTR ;
    if ( QTY_MASTER_ACTIVE(&qty_desc) )
    {
        sim_activate( unitp, tmxr_poll ) ;
    }
    else
    {
        sim_cancel( unitp ) ;
    }
    return ( SCPE_OK ) ;
}   /*  end of 'qty_common_reset'  */
コード例 #10
0
ファイル: nova_qty.c プロジェクト: promovicz/simh-pre-git
int qty_update_status( DIB * dibp, TMXR * tmxr_desc )
{
    int     line ;
    int     status ;
    int     txbusy ;

    /*----------------------------------------------*/
    /*  return global device status for current qty */
    /*  state.                                      */
    /*                                              */
    /*  Receiver interrupts have higher priority    */
    /*  than transmitter interrupts according to DG */
    /*  but this routine could be modified to use   */
    /*  different priority criteria.                */
    /*                                              */
    /*  Round-robin polling could also be used in   */
    /*  some future release rather than starting    */
    /*  with line 0 each time.                      */
    /*                                              */
    /*  Return <QTY_S_RI + line # + character> of   */
    /*  first waiting character, else return        */
    /*  <QTY_S_TI + line #> of first finished line  */
    /*  output, else return 0.                      */
    /*                                              */
    /*  This routine does -not- clear input line    */
    /*  BZ/DN flags; caller should do this.         */
    /*                                              */
    /*  Global device done and busy flags are       */
    /*  updated.                    */
    /*----------------------------------------------*/

    for ( txbusy = status = line = 0 ; line < qty_max ; ++line )
    {
        txbusy |= (QTY_LINE_BIT_SET(line,QTY_L_TXBZ)) ;
        if ( QTY_LINE_BIT_SET(line,QTY_L_RXDN) )
        {
            if ( ! status )
            {
                status = QTY_LINE_BITS( line, QTY_S_DMASK ) | QTY_S_RI ;
                status = status | (line << 8) ;
            }
            break ;
        }
        else if ( QTY_LINE_BIT_SET(line,QTY_L_TXDN) )
        {
            if ( ! (status & QTY_S_RI) )
                if ( ! (status & QTY_S_RI) )
                {
                    status = QTY_S_TI ;
                    status = status | (line << 8) ;
                }
        }
    }
    /*  <we could check each line for TX busy to set DEV_SET_BUSY)?>  */
    DEV_CLR_BUSY( INT_QTY ) ;
    DEV_CLR_DONE( INT_QTY ) ;
    if ( txbusy )
    {
        DEV_SET_BUSY( INT_QTY ) ;
    }
    if ( status & (QTY_S_RI | QTY_S_TI) )
    {
        DEV_SET_DONE( INT_QTY ) ;
    }
    DEV_UPDATE_INTR ;                                   /*  update final intr status  */
    return ( status ) ;
}   /*  end of 'qty_update_status'  */