Allow the active timer (providing udelay() and currticks()) to be selected at runtime based on probing during the INIT_EARLY stage of initialisation. TICKS_PER_SEC is now a fixed compile-time constant for all builds, and is independent of the underlying clock tick rate. We choose the value 1024 to allow multiplications and divisions on seconds to be converted to bit shifts. TICKS_PER_MS is defined as 1, allowing multiplications and divisions on milliseconds to be omitted entirely. The 2% inaccuracy in this definition is negligible when using the standard BIOS timer (running at around 18.2Hz). TIMER_RDTSC now checks for a constant TSC before claiming to be a usable timer. (This timer can be tested in KVM via the command-line option "-cpu host,+invtsc".) Signed-off-by: Michael Brown <mcb30@ipxe.org>tags/v1.20.1
|
||
1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
||
29 | 29 |
|
30 | 30 |
|
31 | 31 |
|
32 |
|
|
32 |
|
|
33 |
|
|
33 | 34 |
|
35 |
|
|
34 | 36 |
|
35 | 37 |
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
|
52 |
|
|
53 |
|
|
54 |
|
|
55 |
|
|
56 |
|
|
57 |
|
|
58 |
|
|
59 |
|
|
60 |
|
|
61 |
|
|
62 |
|
|
63 |
|
|
64 |
|
|
65 |
|
|
66 |
|
|
67 |
|
|
68 |
|
|
69 |
|
|
70 |
|
|
71 |
|
|
72 |
|
|
73 |
|
|
74 |
|
|
75 |
|
|
76 |
|
|
77 |
|
|
78 |
|
|
79 |
|
|
80 |
|
|
81 |
|
|
82 |
|
|
83 |
|
|
84 |
|
|
36 | 85 |
|
37 |
|
|
86 |
|
|
38 | 87 |
|
39 |
|
|
88 |
|
|
40 | 89 |
|
41 |
|
|
90 |
|
|
91 |
|
|
92 |
|
|
93 |
|
|
94 |
|
|
95 |
|
|
42 | 96 |
|
43 | 97 |
|
44 | 98 |
|
|
||
48 | 102 |
|
49 | 103 |
|
50 | 104 |
|
105 |
|
|
51 | 106 |
|
52 |
|
|
53 |
|
|
54 |
|
|
55 |
|
|
56 |
|
|
57 |
|
|
58 |
|
|
59 |
|
|
60 |
|
|
61 |
|
|
62 |
|
|
63 |
|
|
64 |
|
|
65 |
|
|
66 |
|
|
67 |
|
|
68 |
|
|
69 |
|
|
70 |
|
|
71 |
|
|
72 |
|
|
107 |
|
|
108 |
|
|
109 |
|
|
110 |
|
|
111 |
|
|
73 | 112 |
|
74 | 113 |
|
75 | 114 |
|
76 |
|
|
115 |
|
|
77 | 116 |
|
78 |
|
|
117 |
|
|
79 | 118 |
|
80 |
|
|
119 |
|
|
120 |
|
|
121 |
|
|
122 |
|
|
123 |
|
|
124 |
|
|
125 |
|
|
126 |
|
|
127 |
|
|
81 | 128 |
|
82 |
|
|
83 |
|
|
84 |
|
|
129 |
|
|
130 |
|
|
131 |
|
|
132 |
|
|
133 |
|
|
134 |
|
|
135 |
|
|
136 |
|
|
137 |
|
|
138 |
|
|
139 |
|
|
140 |
|
|
85 | 141 |
|
86 |
|
|
87 |
|
|
142 |
|
|
143 |
|
|
144 |
|
|
145 |
|
|
146 |
|
|
147 |
|
|
148 |
|
|
149 |
|
|
150 |
|
|
151 |
|
|
152 |
|
|
153 |
|
|
154 |
|
|
155 |
|
|
156 |
|
|
157 |
|
|
158 |
|
|
159 |
|
|
160 |
|
|
161 |
|
|
162 |
|
|
163 |
|
|
164 |
|
|
165 |
|
|
166 |
|
|
88 | 167 |
|
89 |
|
|
168 |
|
|
90 | 169 |
|
91 | 170 |
|
92 |
|
|
93 |
|
|
94 |
|
|
171 |
|
|
172 |
|
|
173 |
|
|
174 |
|
|
175 |
|
|
176 |
|
|
177 |
|
|
||
7 | 7 |
|
8 | 8 |
|
9 | 9 |
|
10 |
|
|
11 |
|
|
10 | 12 |
|
11 | 13 |
|
12 | 14 |
|
|
||
26 | 26 |
|
27 | 27 |
|
28 | 28 |
|
29 |
|
|
29 | 30 |
|
30 | 31 |
|
31 | 32 |
|
|
||
1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
||
1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
|
||
57 | 57 |
|
58 | 58 |
|
59 | 59 |
|
60 |
|
|
61 |
|
|
62 |
|
|
63 |
|
|
64 |
|
|
65 |
|
|
60 | 66 |
|
61 | 67 |
|
62 | 68 |
|
|
||
1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
|
||
32 | 32 |
|
33 | 33 |
|
34 | 34 |
|
35 |
|
|
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
|
35 | 47 |
|
36 | 48 |
|
37 | 49 |
|
|
||
43 | 55 |
|
44 | 56 |
|
45 | 57 |
|
46 |
|
|
58 |
|
|
47 | 59 |
|
48 | 60 |
|
49 | 61 |
|
|
||
53 | 65 |
|
54 | 66 |
|
55 | 67 |
|
56 |
|
|
57 |
|
|
68 |
|
|
69 |
|
|
70 |
|
|
58 | 71 |
|
72 |
|
|
59 | 73 |
|
60 | 74 |
|
61 |
|
|
62 |
|
|
75 |
|
|
76 |
|
|
63 | 77 |
|
78 |
|
|
64 | 79 |
|
65 |
|
|
80 |
|
|
81 |
|
|
66 | 82 |
|
67 | 83 |
|
68 |
|
|
69 |
|
|
70 |
|
|
84 |
|
|
85 |
|
|
86 |
|
|
87 |
|
|
88 |
|
|
89 |
|
|
||
1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
|
||
117 | 117 |
|
118 | 118 |
|
119 | 119 |
|
120 |
|
|
120 |
|
|
121 | 121 |
|
122 | 122 |
|
123 | 123 |
|
|
||
23 | 23 |
|
24 | 24 |
|
25 | 25 |
|
26 |
|
|
26 |
|
|
27 |
|
|
27 | 28 |
|
28 | 29 |
|
29 | 30 |
|
30 | 31 |
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
|
52 |
|
|
53 |
|
|
54 |
|
|
55 |
|
|
56 |
|
|
57 |
|
|
58 |
|
|
31 | 59 |
|
32 | 60 |
|
33 | 61 |
|
|
||
61 | 89 |
|
62 | 90 |
|
63 | 91 |
|
92 |
|
|
93 |
|
|
94 |
|
|
95 |
|
|
96 |
|
|
97 |
|
|
98 |
|
|
99 |
|
|
100 |
|
|
101 |
|
|
102 |
|
|
103 |
|
|
104 |
|
|
105 |
|
|
106 |
|
|
107 |
|
|
108 |
|
|
109 |
|
|
110 |
|
|
111 |
|
|
112 |
|
|
113 |
|
|
114 |
|
|
115 |
|
|
116 |
|
|
117 |
|
|
118 |
|
|
119 |
|
|
120 |
|
|
121 |
|
|
122 |
|
|
123 |
|
|
||
1381 | 1381 |
|
1382 | 1382 |
|
1383 | 1383 |
|
1384 |
|
|
1384 |
|
|
1385 | 1385 |
|
1386 | 1386 |
|
1387 | 1387 |
|
|
||
1176 | 1176 |
|
1177 | 1177 |
|
1178 | 1178 |
|
1179 |
|
|
1179 |
|
|
1180 | 1180 |
|
1181 | 1181 |
|
1182 | 1182 |
|
|
||
68 | 68 |
|
69 | 69 |
|
70 | 70 |
|
71 |
|
|
71 |
|
|
72 | 72 |
|
73 | 73 |
|
74 | 74 |
|
|
||
1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
|
||
1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
||
3 | 3 |
|
4 | 4 |
|
5 | 5 |
|
6 |
|
|
6 |
|
|
7 | 7 |
|
8 |
|
|
9 |
|
|
10 | 8 |
|
11 | 9 |
|
12 | 10 |
|
13 | 11 |
|
14 |
|
|
15 |
|
|
12 |
|
|
16 | 13 |
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
14 |
|
|
15 |
|
|
26 | 16 |
|
27 |
|
|
28 |
|
|
17 |
|
|
29 | 18 |
|
30 |
|
|
31 |
|
|
32 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
33 | 24 |
|
34 |
|
|
35 |
|
|
25 |
|
|
36 | 26 |
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
|
45 | 50 |
|
46 |
|
|
47 |
|
|
48 |
|
|
51 |
|
|
52 |
|
|
49 | 53 |
|
50 |
|
|
51 |
|
|
54 |
|
|
55 |
|
|
52 | 56 |
|
53 |
|
|
54 |
|
|
57 |
|
|
55 | 58 |
|
56 |
|
|
59 |
|
|
57 | 60 |
|
58 |
|
|
59 | 61 |
|
60 |
|
|
61 |
|
|
62 |
|
|
63 |
|
|
64 |
|
|
65 |
|
|
62 |
|
|
63 |
|
|
66 | 64 |
|
67 |
|
|
68 |
|
|
65 |
|
|
66 |
|
|
67 |
|
|
68 |
|
|
69 |
|
|
70 |
|
|
69 | 71 |
|
70 |
|
|
71 | 72 |
|
72 |
|
|
73 | 73 |
|
74 |
|
|
75 |
|
|
74 |
|
|
75 |
|
|
76 |
|
|
77 |
|
|
76 | 78 |
|
77 | 79 |
|
|
||
23 | 23 |
|
24 | 24 |
|
25 | 25 |
|
26 |
|
|
26 |
|
|
27 | 27 |
|
28 | 28 |
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
|
37 |
|
|
38 |
|
|
39 | 29 |
|
40 | 30 |
|
41 | 31 |
|
|
||
36 | 36 |
|
37 | 37 |
|
38 | 38 |
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
|
39 | 46 |
|
40 | 47 |
|
41 | 48 |
|
|
||
95 | 102 |
|
96 | 103 |
|
97 | 104 |
|
98 |
|
|
105 |
|
|
99 | 106 |
|
100 | 107 |
|
101 | 108 |
|
|
||
133 | 140 |
|
134 | 141 |
|
135 | 142 |
|
136 |
|
|
143 |
|
|
137 | 144 |
|
138 | 145 |
|
139 | 146 |
|
|
||
141 | 148 |
|
142 | 149 |
|
143 | 150 |
|
144 |
|
|
151 |
|
|
145 | 152 |
|
146 | 153 |
|
147 | 154 |
|
|
||
180 | 187 |
|
181 | 188 |
|
182 | 189 |
|
183 |
|
|
184 |
|
|
185 |
|
|
190 |
|
|
191 |
|
|
192 |
|
|
193 |
|
|
194 |
|
|
195 |
|
|
||
39 | 39 |
|
40 | 40 |
|
41 | 41 |
|
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
|
52 | 42 |
|
53 | 43 |
|
54 | 44 |
|
|
||
67 | 57 |
|
68 | 58 |
|
69 | 59 |
|
60 |
|
|
61 |
|
|
70 | 62 |
|
71 | 63 |
|
72 | 64 |
|
73 | 65 |
|
74 | 66 |
|
75 | 67 |
|
76 |
|
|
77 | 68 |
|
78 | 69 |
|
79 |
|
|
80 |
|
|
70 |
|
|
71 |
|
|
81 | 72 |
|
82 | 73 |
|
83 | 74 |
|
84 | 75 |
|
85 |
|
|
86 |
|
|
87 |
|
|
76 |
|
|
77 |
|
|
78 |
|
|
79 |
|
|
80 |
|
|
81 |
|
|
||
1321 | 1321 |
|
1322 | 1322 |
|
1323 | 1323 |
|
1324 |
|
|
1324 |
|
|
1325 | 1325 |
|
1326 | 1326 |
|
1327 | 1327 |
|
|
||
1363 | 1363 |
|
1364 | 1364 |
|
1365 | 1365 |
|
1366 |
|
|
1367 |
|
|
1366 |
|
|
1367 |
|
|
1368 | 1368 |
|
1369 | 1369 |
|
1370 | 1370 |
|
|
||
2606 | 2606 |
|
2607 | 2607 |
|
2608 | 2608 |
|
2609 |
|
|
2609 |
|
|
2610 | 2610 |
|
2611 | 2611 |
|
2612 | 2612 |
|
|
||
1094 | 1094 |
|
1095 | 1095 |
|
1096 | 1096 |
|
1097 |
|
|
1097 |
|
|
1098 | 1098 |
|
1099 | 1099 |
|
1100 | 1100 |
|
|
||
110 | 110 |
|
111 | 111 |
|
112 | 112 |
|
113 |
|
|
113 |
|
|
114 | 114 |
|
115 | 115 |
|
116 | 116 |
|