|
|
1.1 root 1: #
2: # trap routines valid only on MicroVAX
3: #
4: # real clock interrupt, MicroVAX version
5: #
6: # clock ticks at 100Hz. skip 4 of each 10 to pretend it's 60Hz
7:
8: #
9: # the normal clock-trimming idea is to correct by CLKBIAS microseconds
10: # every 60Hz tick for clockbias ticks. on MicroVAX, the interval
11: # has to be a multiple of the 100Hz tick; so skip or add a tick
12: # every SKIPBIAS or TICKBIAS ticks instead.
13: #
14: # if we skip a tick, the clock changes by 10ms (one hardware tick).
15: # if we insert an extra tick, the clock changes by 1s/60 - 10ms
16: # (because there's an extra hardware tick as well as a software tick)
17: # NB CLK60HZ is a number ready for NICR, hence it's negative
18: #
19:
20: .set HWCLOCK,10000 # usec per hardware tick
21:
22: .set SKIPBIAS,HWCLOCK/CLKBIAS # value of a skipped tick
23: .set TICKBIAS,(-CLK60HZ-HWCLOCK)/CLKBIAS # value of an extra tick
24:
25: .text
26:
27: .lcomm tick,1 # 100Hz-60Hz counter
28: .globl Xhardclock
29: .align 2
30: Xhardclock:
31: incb tick
32: cmpb $1,tick
33: beql 9f
34: cmpb $4,tick
35: beql 9f
36: cmpb $6,tick
37: beql 9f
38: cmpb $9,tick
39: beql 9f
40: cmpb $10,tick
41: bneq 1f
42: clrb tick
43: 1: pushr $SAVREG
44: movl _clockbias,r0 # need clock adjustment?
45: beql 3f
46: decl _clockbias
47: movl $SKIPBIAS,r2
48: cvtbl _clocksign,r3
49: blss 2f
50: movl $TICKBIAS,r2
51: 2: divl3 r2,r0,r1 # fudge to our units
52: mull2 r2,r1
53: cmpl r0,r1 # time to adj by a whole uvax tick?
54: bneq 3f # not yet
55: decb tick # yes, invent an extra tick
56: tstl r3
57: blss 8f # need to slow down, extra tick is a skip
58: 3: pushl 4+NRS*4(sp)
59: pushl 4+NRS*4(sp)
60: calls $2,_hardclock # hardclock(pc,psl)
61: 8: popr $SAVREG
62: 9: rei
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.