Annotation of driverkit/notes/fcTimer, revision 1.1

1.1     ! root        1:                        fc timer notes
        !             2:                        
        !             3: states
        !             4:        idle                            TS_IDLE
        !             5:        running, t/o msg enabled        TS_RUN_MSG
        !             6:        running, t/o msg disabled       TS_RUN_POLL
        !             7:        timeout, no msg sent            TS_TIMEOUT
        !             8:        timeout, msg sent               TS_TIMEOUT_MSG
        !             9:        
        !            10: transitions
        !            11: 
        !            12:        TS_IDLE
        !            13:                ==> TS_RUN_MSG     : startTimer(TRUE)
        !            14:                ==> TS_RUN_POLL    : startTimer(FALSE)
        !            15:        TS_RUN_MSG
        !            16:                ==> TS_IDLE        : stopTimer
        !            17:                ==> TS_TIMEOUT_MSG : floppyTimeout()
        !            18:        TS_RUN_POLL
        !            19:                ==> TS_IDLE        : stopTimer
        !            20:                ==> TS_TIMEOUT     : floppyTimeout()
        !            21:        TS_TIMEOUT_MSG
        !            22:                ==> TS_IDLE        : stopTimer
        !            23:                ==> TS_IDLE        : waitIntr
        !            24:        XXX
        !            25:                ==> TS_IDLE        : stopTimer
        !            26:        timeout, no msg sent
        !            27:        timeout, msg sent
        !            28: 
        !            29: startTimer(seconds, boolean_t msg) 
        !            30: {
        !            31:        IOTimeout();
        !            32:        timerState = TS_RUN_POLL or TS_RUN_MSG;
        !            33: }
        !            34: 
        !            35: stopTimer()
        !            36: {
        !            37:        switch(timerState) {
        !            38:            case TS_TIMEOUT_MSG:
        !            39:                get the message from timerPort;
        !            40:            case TS_RUN_POLL:
        !            41:            case TS_RUN_MSG:
        !            42:                IOUnTimeout();
        !            43:            case TS_TIMEOUT:
        !            44:            case TS_IDLE:
        !            45:                nop;
        !            46:        }
        !            47:        timerState = TS_IDLE;
        !            48: }
        !            49: 
        !            50: timerInit() {
        !            51:        timerState = TS_IDLE;
        !            52: }
        !            53: 
        !            54: floppyTimeout(id)
        !            55: {
        !            56:        switch(timerState) {
        !            57:            case TS_RUN_MSG:
        !            58:                send timeout msg to timeoutPort;
        !            59:                timerState = TS_TIMEOUT_MSG;
        !            60:            case TS_RUN_POLL:
        !            61:                timerState = TS_TIMEOUT;
        !            62:            default:
        !            63:                huh?
        !            64: }
        !            65: 
        !            66: waitIntr(seconds)
        !            67: {      
        !            68:        startTimer(seconds, TRUE);
        !            69:        msg_receive on fcPortSet;
        !            70:        if msg from timeoutPort {
        !            71:                timerInit();
        !            72:                rtn = timeout;          
        !            73:        }
        !            74:        else {
        !            75:                timerStop();
        !            76:                rtn = OK;
        !            77:                /* old fc interrupt code to get status, etc.? */
        !            78:        }
        !            79: }
        !            80: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.