|
|
1.1 ! root 1: /* clkint.s - clkint */ ! 2: ! 3: #include <procreg.h> ! 4: #include <conf.h> ! 5: ! 6: /*------------------------------------------------------------------------ ! 7: * clkint -- real-time clock interrupt service routine ! 8: *------------------------------------------------------------------------ ! 9: */ ! 10: ! 11: /* define constants */ ! 12: #define CLEARINT 0xc1 /* value to clear ICCS INT bit */ ! 13: ! 14: .text ! 15: .align 2 /* align on longword boundary */ ! 16: .globl _clkint ! 17: _clkint: ! 18: mtpr $DISABLE, $IPL /* disable interrupts */ ! 19: #if !defined(UVAX) ! 20: mtpr $CLEARINT, $ICCS /* clr interrupt bit in interval*/ ! 21: /* clock control reg */ ! 22: #else /* Microvax has a 10ms rt clock */ ! 23: decl _count10 /* Is this the 10th interrupt? */ ! 24: jnequ clret /* no => return */ ! 25: movl $10, _count10 /* yes=> reset counter&continue*/ ! 26: #endif ! 27: decl _tickctr /* Is this the 10th tick? */ ! 28: jnequ clckdef /* no => process tick */ ! 29: movl $10, _tickctr /* yes=> reset counter&continue*/ ! 30: incl _clktime /* increment time-of-day clock */ ! 31: clckdef: ! 32: tstl _defclk /* Are clock ticks deferred? */ ! 33: jeqlu notdef /* no => go process this tick */ ! 34: incl _clkdiff /* yes=> count in clkdiff and */ ! 35: rei /* return quickly */ ! 36: notdef: ! 37: tstl _slnempty /* Is sleep queue nonempty? */ ! 38: jeqlu clpreem /* no => go process preemption */ ! 39: decw *_sltop /* yes=> decrement delta key */ ! 40: jnequ clpreem /* on first process, */ ! 41: /* calling wakeup if 0 */ ! 42: pushr $LOWREGS /* save low registers */ ! 43: calls $0, _wakeup /* wakeup sleeping process */ ! 44: popr $LOWREGS /* restore low registers */ ! 45: clpreem: ! 46: decl _preempt /* decrement preemption counter */ ! 47: jnequ clret /* and call resched if it is 0 */ ! 48: pushr $LOWREGS /* save low registers */ ! 49: calls $0, _resched /* reschedule */ ! 50: popr $LOWREGS /* restore low registers */ ! 51: clret: ! 52: rei /* restore pre-interrupt IPL & */ ! 53: /* return from interrupt */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.