|
|
1.1.1.2 ! root 1: |* clkint.s - clkint 1.1 root 2: 1.1.1.2 ! root 3: |*------------------------------------------------------------------------ ! 4: |* clkint -- real-time clock interrupt service routine ! 5: |*------------------------------------------------------------------------ 1.1 root 6: .text 7: .globl _clkint 1.1.1.2 ! root 8: .globl _tstat 1.1 root 9: _clkint: 1.1.1.2 ! root 10: movl a0,sp@- | save a0 ! 11: movl _tstat,a0 | address of hardware reg to ack tick ! 12: #ifdef ATT7300 ! 13: | clock owns one bit of miscellaneous control reg--maintain other bits-- ! 14: movl d0,sp@- ! 15: movw _soft_mcr7300,d0 | normal value for MCR ! 16: andw #0x7fff,d0 | clear high bit ! 17: movw d0,a0@ | acknowledge clock tick ! 18: movw _soft_mcr7300,a0@ | with low-high on high bit of MCR ! 19: movl sp@+,d0 ! 20: #else ! 21: movb #1,a0@ | acknowledge clock tick 1.1 root 22: #endif 1.1.1.2 ! root 23: movl sp@+,a0 | restore a0 ! 24: subql #1,_count6 | Is this the 6th interrupt? ! 25: bpl clret | no => return ! 26: movl #6,_count6 | yes=> reset counter&continue ! 27: tstl _defclk | Are clock ticks deferred? ! 28: beq notdef | no => skip down ! 29: addql #1,_clkdiff | yes=> count in clkdiff and ! 30: rte | return quickly ! 31: notdef: ! 32: tstl _slnempty | Is sleep queue empty? ! 33: beq clpreem | yes=> skip down ! 34: movl a0,sp@- | save a0 ! 35: movl _sltop,a0 | no => decrement delta key ! 36: subql #1,a0@ | of first process ! 37: movl sp@+,a0 | restore a0, cc's unaffected ! 38: bpl clpreem | ck if ready to wake up ! 39: moveml #0xc0c0,sp@- | Save d0,d1,a0,a1 - C scratch regs ! 40: jsr _wakeup | ! 41: moveml sp@+,#0x0303 | Restore d0,d1,a0,a1 1.1 root 42: clpreem: 1.1.1.2 ! root 43: subql #1,_preempt | Decrement preemption counter ! 44: bpl clret | and call resched if it ! 45: moveml #0xc0c0,sp@- ! 46: jsr _resched ! 47: moveml sp@+,#0x0303 1.1 root 48: clret: 1.1.1.2 ! root 49: rte | Return from interrupt
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.