summaryrefslogtreecommitdiff
path: root/xv6.ps
blob: 8a7a9dbb06719649f7ad31731967de8efc895edf (plain)
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
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
85
86
87
88
89
90
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103
12104
12105
12106
12107
12108
12109
12110
12111
12112
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
12322
12323
12324
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
12893
12894
12895
12896
12897
12898
12899
12900
12901
12902
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13017
13018
13019
13020
13021
13022
13023
13024
13025
13026
13027
13028
13029
13030
13031
13032
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095
13096
13097
13098
13099
13100
13101
13102
13103
13104
13105
13106
13107
13108
13109
13110
13111
13112
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13486
13487
13488
13489
13490
13491
13492
13493
13494
13495
13496
13497
13498
13499
13500
13501
13502
13503
13504
13505
13506
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13585
13586
13587
13588
13589
13590
13591
13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13605
13606
13607
13608
13609
13610
13611
13612
13613
13614
13615
13616
13617
13618
13619
13620
13621
13622
13623
13624
13625
13626
13627
13628
13629
13630
13631
13632
13633
13634
13635
13636
13637
13638
13639
13640
13641
13642
13643
13644
13645
13646
13647
13648
13649
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13678
13679
13680
13681
13682
13683
13684
13685
13686
13687
13688
13689
13690
13691
13692
13693
13694
13695
13696
13697
13698
13699
13700
13701
13702
13703
13704
13705
13706
13707
13708
13709
13710
13711
13712
13713
13714
13715
13716
13717
13718
13719
13720
13721
13722
13723
13724
13725
13726
13727
13728
13729
13730
13731
13732
13733
13734
13735
13736
13737
13738
13739
13740
13741
13742
13743
13744
13745
13746
13747
13748
13749
13750
13751
13752
13753
13754
13755
13756
13757
13758
13759
13760
13761
13762
13763
13764
13765
13766
13767
13768
13769
13770
13771
13772
13773
13774
13775
13776
13777
13778
13779
13780
13781
13782
13783
13784
13785
13786
13787
13788
13789
13790
13791
13792
13793
13794
13795
13796
13797
13798
13799
13800
13801
13802
13803
13804
13805
13806
13807
13808
13809
13810
13811
13812
13813
13814
13815
13816
13817
13818
13819
13820
13821
13822
13823
13824
13825
13826
13827
13828
13829
13830
13831
13832
13833
13834
13835
13836
13837
13838
13839
13840
13841
13842
13843
13844
13845
13846
13847
13848
13849
13850
13851
13852
13853
13854
13855
13856
13857
13858
13859
13860
13861
13862
13863
13864
13865
13866
13867
13868
13869
13870
13871
13872
13873
13874
13875
13876
13877
13878
13879
13880
13881
13882
13883
13884
13885
13886
13887
13888
13889
13890
13891
13892
13893
13894
13895
13896
13897
13898
13899
13900
13901
13902
13903
13904
13905
13906
13907
13908
13909
13910
13911
13912
13913
13914
13915
13916
13917
13918
13919
13920
13921
13922
13923
13924
13925
13926
13927
13928
13929
13930
13931
13932
13933
13934
13935
13936
13937
13938
13939
13940
13941
13942
13943
13944
13945
13946
13947
13948
13949
13950
13951
13952
13953
13954
13955
13956
13957
13958
13959
13960
13961
13962
13963
13964
13965
13966
13967
13968
13969
13970
13971
13972
13973
13974
13975
13976
13977
13978
13979
13980
13981
13982
13983
13984
13985
13986
13987
13988
13989
13990
13991
13992
13993
13994
13995
13996
13997
13998
13999
14000
14001
14002
14003
14004
14005
14006
14007
14008
14009
14010
14011
14012
14013
14014
14015
14016
14017
14018
14019
14020
14021
14022
14023
14024
14025
14026
14027
14028
14029
14030
14031
14032
14033
14034
14035
14036
14037
14038
14039
14040
14041
14042
14043
14044
14045
14046
14047
14048
14049
14050
14051
14052
14053
14054
14055
14056
14057
14058
14059
14060
14061
14062
14063
14064
14065
14066
14067
14068
14069
14070
14071
14072
14073
14074
14075
14076
14077
14078
14079
14080
14081
14082
14083
14084
14085
14086
14087
14088
14089
14090
14091
14092
14093
14094
14095
14096
14097
14098
14099
14100
14101
14102
14103
14104
14105
14106
14107
14108
14109
14110
14111
14112
14113
14114
14115
14116
14117
14118
14119
14120
14121
14122
14123
14124
14125
14126
14127
14128
14129
14130
14131
14132
14133
14134
14135
14136
14137
14138
14139
14140
14141
14142
14143
14144
14145
14146
14147
14148
14149
14150
14151
14152
14153
14154
14155
14156
14157
14158
14159
14160
14161
14162
14163
14164
14165
14166
14167
14168
14169
14170
14171
14172
14173
14174
14175
14176
14177
14178
14179
14180
14181
14182
14183
14184
14185
14186
14187
14188
14189
14190
14191
14192
14193
14194
14195
14196
14197
14198
14199
14200
14201
14202
14203
14204
14205
14206
14207
14208
14209
14210
14211
14212
14213
14214
14215
14216
14217
14218
14219
14220
14221
14222
14223
14224
14225
14226
14227
14228
14229
14230
14231
14232
14233
14234
14235
14236
14237
14238
14239
14240
14241
14242
14243
14244
14245
14246
14247
14248
14249
14250
14251
14252
14253
14254
14255
14256
14257
14258
14259
14260
14261
14262
14263
14264
14265
14266
14267
14268
14269
14270
14271
14272
14273
14274
14275
14276
14277
14278
14279
14280
14281
14282
14283
14284
14285
14286
14287
14288
14289
14290
14291
14292
14293
14294
14295
14296
14297
14298
14299
14300
14301
14302
14303
14304
14305
14306
14307
14308
14309
14310
14311
14312
14313
14314
14315
14316
14317
14318
14319
14320
14321
14322
14323
14324
14325
14326
14327
14328
14329
14330
14331
14332
14333
14334
14335
14336
14337
14338
14339
14340
14341
14342
14343
14344
14345
14346
14347
14348
14349
14350
14351
14352
14353
14354
14355
14356
14357
14358
14359
14360
14361
14362
14363
14364
14365
14366
14367
14368
14369
14370
14371
14372
14373
14374
14375
14376
14377
14378
14379
14380
14381
14382
14383
14384
14385
14386
14387
14388
14389
14390
14391
14392
14393
14394
14395
14396
14397
14398
14399
14400
14401
14402
14403
14404
14405
14406
14407
14408
14409
14410
14411
14412
14413
14414
14415
14416
14417
14418
14419
14420
14421
14422
14423
14424
14425
14426
14427
14428
14429
14430
14431
14432
14433
14434
14435
14436
14437
14438
14439
14440
14441
14442
14443
14444
14445
14446
14447
14448
14449
14450
14451
14452
14453
14454
14455
14456
14457
14458
14459
14460
14461
14462
14463
14464
14465
14466
14467
14468
14469
14470
14471
14472
14473
14474
14475
14476
14477
14478
14479
14480
14481
14482
14483
14484
14485
14486
14487
14488
14489
14490
14491
14492
14493
14494
14495
14496
14497
14498
14499
14500
14501
14502
14503
14504
14505
14506
14507
14508
14509
14510
14511
14512
14513
14514
14515
14516
14517
14518
14519
14520
14521
14522
14523
14524
14525
14526
14527
14528
14529
14530
14531
14532
14533
14534
14535
14536
14537
14538
14539
14540
14541
14542
14543
14544
14545
14546
14547
14548
14549
14550
14551
14552
14553
14554
14555
14556
14557
14558
14559
14560
14561
14562
14563
14564
14565
14566
14567
14568
14569
14570
14571
14572
14573
14574
14575
14576
14577
14578
14579
14580
14581
14582
14583
14584
14585
14586
14587
14588
14589
14590
14591
14592
14593
14594
14595
14596
14597
14598
14599
14600
14601
14602
14603
14604
14605
14606
14607
14608
14609
14610
14611
14612
14613
14614
14615
14616
14617
14618
14619
14620
14621
14622
14623
14624
14625
14626
14627
14628
14629
14630
14631
14632
14633
14634
14635
14636
14637
14638
14639
14640
14641
14642
14643
14644
14645
14646
14647
14648
14649
14650
14651
14652
14653
14654
14655
14656
14657
14658
14659
14660
14661
14662
14663
14664
14665
14666
14667
14668
14669
14670
14671
14672
14673
14674
14675
14676
14677
14678
14679
14680
14681
14682
14683
14684
14685
14686
14687
14688
14689
14690
14691
14692
14693
14694
14695
14696
14697
14698
14699
14700
14701
14702
14703
14704
14705
14706
14707
14708
14709
14710
14711
14712
14713
14714
14715
14716
14717
14718
14719
14720
14721
14722
14723
14724
14725
14726
14727
14728
14729
14730
14731
14732
14733
14734
14735
14736
14737
14738
14739
14740
14741
14742
14743
14744
14745
14746
14747
14748
14749
14750
14751
14752
14753
14754
14755
14756
14757
14758
14759
14760
14761
14762
14763
14764
14765
14766
14767
14768
14769
14770
14771
14772
14773
14774
14775
14776
14777
14778
14779
14780
14781
14782
14783
14784
14785
14786
14787
14788
14789
14790
14791
14792
14793
14794
14795
14796
14797
14798
14799
14800
14801
14802
14803
14804
14805
14806
14807
14808
14809
14810
14811
14812
14813
14814
14815
14816
14817
14818
14819
14820
14821
14822
14823
14824
14825
14826
14827
14828
14829
14830
14831
14832
14833
14834
14835
14836
14837
14838
14839
14840
14841
14842
14843
14844
14845
14846
14847
14848
14849
14850
14851
14852
14853
14854
14855
14856
14857
14858
14859
14860
14861
14862
14863
14864
14865
14866
14867
14868
14869
14870
14871
14872
14873
14874
14875
14876
14877
14878
14879
14880
14881
14882
14883
14884
14885
14886
14887
14888
14889
14890
14891
14892
14893
14894
14895
14896
14897
14898
14899
14900
14901
14902
14903
14904
14905
14906
14907
14908
14909
14910
14911
14912
14913
14914
14915
14916
14917
14918
14919
14920
14921
14922
14923
14924
14925
14926
14927
14928
14929
14930
14931
14932
14933
14934
14935
14936
14937
14938
14939
14940
14941
14942
14943
14944
14945
14946
14947
14948
14949
14950
14951
14952
14953
14954
14955
14956
14957
14958
14959
14960
14961
14962
14963
14964
14965
14966
14967
14968
14969
14970
14971
14972
14973
14974
14975
14976
14977
14978
14979
14980
14981
14982
14983
14984
14985
14986
14987
14988
14989
14990
14991
14992
14993
14994
14995
14996
14997
14998
14999
15000
15001
15002
15003
15004
15005
15006
15007
15008
15009
15010
15011
15012
15013
15014
15015
15016
15017
15018
15019
15020
15021
15022
15023
15024
15025
15026
15027
15028
15029
15030
15031
15032
15033
15034
15035
15036
15037
15038
15039
15040
15041
15042
15043
15044
15045
15046
15047
15048
15049
15050
15051
15052
15053
15054
15055
15056
15057
15058
15059
15060
15061
15062
15063
15064
15065
15066
15067
15068
15069
15070
15071
15072
15073
15074
15075
15076
15077
15078
15079
15080
15081
15082
15083
15084
15085
15086
15087
15088
15089
15090
15091
15092
15093
15094
15095
15096
15097
15098
15099
15100
15101
15102
15103
15104
15105
15106
15107
15108
15109
15110
15111
15112
15113
15114
15115
15116
15117
15118
15119
15120
15121
15122
15123
15124
15125
15126
15127
15128
15129
15130
15131
15132
15133
15134
15135
15136
15137
15138
15139
15140
15141
15142
15143
15144
15145
15146
15147
15148
15149
15150
15151
15152
15153
15154
15155
15156
15157
15158
15159
15160
15161
15162
15163
15164
15165
15166
15167
15168
15169
15170
15171
15172
15173
15174
15175
15176
15177
15178
15179
15180
15181
15182
15183
15184
15185
15186
15187
15188
15189
15190
15191
15192
15193
15194
15195
15196
15197
15198
15199
15200
15201
15202
15203
15204
15205
15206
15207
15208
15209
15210
15211
15212
15213
15214
15215
15216
15217
15218
15219
15220
15221
15222
15223
15224
15225
15226
15227
15228
15229
15230
15231
15232
15233
15234
15235
15236
15237
15238
15239
15240
15241
15242
15243
15244
15245
15246
15247
15248
15249
15250
15251
15252
15253
15254
15255
15256
15257
15258
15259
15260
15261
15262
15263
15264
15265
15266
15267
15268
15269
15270
15271
15272
15273
15274
15275
15276
15277
15278
15279
15280
15281
15282
15283
15284
15285
15286
15287
15288
15289
15290
15291
15292
15293
15294
15295
15296
15297
15298
15299
15300
15301
15302
15303
15304
15305
15306
15307
15308
15309
15310
15311
15312
15313
15314
15315
15316
15317
15318
15319
15320
15321
15322
15323
15324
15325
15326
15327
15328
15329
15330
15331
15332
15333
15334
15335
15336
15337
15338
15339
15340
15341
15342
15343
15344
15345
15346
15347
15348
15349
15350
15351
15352
15353
15354
15355
15356
15357
15358
15359
15360
15361
15362
15363
15364
15365
15366
15367
15368
15369
15370
15371
15372
15373
15374
15375
15376
15377
15378
15379
15380
15381
15382
15383
15384
15385
15386
15387
15388
15389
15390
15391
15392
15393
15394
15395
15396
15397
15398
15399
15400
15401
15402
15403
15404
15405
15406
15407
15408
15409
15410
15411
15412
15413
15414
15415
15416
15417
15418
15419
15420
15421
15422
15423
15424
15425
15426
15427
15428
15429
15430
15431
15432
15433
15434
15435
15436
15437
15438
15439
15440
15441
15442
15443
15444
15445
15446
15447
15448
15449
15450
15451
15452
15453
15454
15455
15456
15457
15458
15459
15460
15461
15462
15463
15464
15465
15466
15467
15468
15469
15470
15471
15472
15473
15474
15475
15476
15477
15478
15479
15480
15481
15482
15483
15484
15485
15486
15487
15488
15489
15490
15491
15492
15493
15494
15495
15496
15497
15498
15499
15500
15501
15502
15503
15504
15505
15506
15507
15508
15509
15510
15511
15512
15513
15514
15515
15516
15517
15518
15519
15520
15521
15522
15523
15524
15525
15526
15527
15528
15529
15530
15531
15532
15533
15534
15535
15536
15537
15538
15539
15540
15541
15542
15543
15544
15545
15546
15547
15548
15549
15550
15551
15552
15553
15554
15555
15556
15557
15558
15559
15560
15561
15562
15563
15564
15565
15566
15567
15568
15569
15570
15571
15572
15573
15574
15575
15576
15577
15578
15579
15580
15581
15582
15583
15584
15585
15586
15587
15588
15589
15590
15591
15592
15593
15594
15595
15596
15597
15598
15599
15600
15601
15602
15603
15604
15605
15606
15607
15608
15609
15610
15611
15612
15613
15614
15615
15616
15617
15618
15619
15620
15621
15622
15623
15624
15625
15626
15627
15628
15629
15630
15631
15632
15633
15634
15635
15636
15637
15638
15639
15640
15641
15642
15643
15644
15645
15646
15647
15648
15649
15650
15651
15652
15653
15654
15655
15656
15657
15658
15659
15660
15661
15662
15663
15664
15665
15666
15667
15668
15669
15670
15671
15672
15673
15674
15675
15676
15677
15678
15679
15680
15681
15682
15683
15684
15685
15686
15687
15688
15689
15690
15691
15692
15693
15694
15695
15696
15697
15698
15699
15700
15701
15702
15703
15704
15705
15706
15707
15708
15709
15710
15711
15712
15713
15714
15715
15716
15717
15718
15719
15720
15721
15722
15723
15724
15725
15726
15727
15728
15729
15730
15731
15732
15733
15734
15735
15736
15737
15738
15739
15740
15741
15742
15743
15744
15745
15746
15747
15748
15749
15750
15751
15752
15753
15754
15755
15756
15757
15758
15759
15760
15761
15762
15763
15764
15765
15766
15767
15768
15769
15770
15771
15772
15773
15774
15775
15776
15777
15778
15779
15780
15781
15782
15783
15784
15785
15786
15787
15788
15789
15790
15791
15792
15793
15794
15795
15796
15797
15798
15799
15800
15801
15802
15803
15804
15805
15806
15807
15808
15809
15810
15811
15812
15813
15814
15815
15816
15817
15818
15819
15820
15821
15822
15823
15824
15825
15826
15827
15828
15829
15830
15831
15832
15833
15834
15835
15836
15837
15838
15839
15840
15841
15842
15843
15844
15845
15846
15847
15848
15849
15850
15851
15852
15853
15854
15855
15856
15857
15858
15859
15860
15861
15862
15863
15864
15865
15866
15867
15868
15869
15870
15871
15872
15873
15874
15875
15876
15877
15878
15879
15880
15881
15882
15883
15884
15885
15886
15887
15888
15889
15890
15891
15892
15893
15894
15895
15896
15897
15898
15899
15900
15901
15902
15903
15904
15905
15906
15907
15908
15909
15910
15911
15912
15913
15914
15915
15916
15917
15918
15919
15920
15921
15922
15923
15924
15925
15926
15927
15928
15929
15930
15931
15932
15933
15934
15935
15936
15937
15938
15939
15940
15941
15942
15943
15944
15945
15946
15947
15948
15949
15950
15951
15952
15953
15954
15955
15956
15957
15958
15959
15960
15961
15962
15963
15964
15965
15966
15967
15968
15969
15970
15971
15972
15973
15974
15975
15976
15977
15978
15979
15980
15981
15982
15983
15984
15985
15986
15987
15988
15989
15990
15991
15992
15993
15994
15995
15996
15997
15998
15999
16000
16001
16002
16003
16004
16005
16006
16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033
16034
16035
16036
16037
16038
16039
16040
16041
16042
16043
16044
16045
16046
16047
16048
16049
16050
16051
16052
16053
16054
16055
16056
16057
16058
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
16073
16074
16075
16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110
16111
16112
16113
16114
16115
16116
16117
16118
16119
16120
16121
16122
16123
16124
16125
16126
16127
16128
16129
16130
16131
16132
16133
16134
16135
16136
16137
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
16170
16171
16172
16173
16174
16175
16176
16177
16178
16179
16180
16181
16182
16183
16184
16185
16186
16187
16188
16189
16190
16191
16192
16193
16194
16195
16196
16197
16198
16199
16200
16201
16202
16203
16204
16205
16206
16207
16208
16209
16210
16211
16212
16213
16214
16215
16216
16217
16218
16219
16220
16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
16232
16233
16234
16235
16236
16237
16238
16239
16240
16241
16242
16243
16244
16245
16246
16247
16248
16249
16250
16251
16252
16253
16254
16255
16256
16257
16258
16259
16260
16261
16262
16263
16264
16265
16266
16267
16268
16269
16270
16271
16272
16273
16274
16275
16276
16277
16278
16279
16280
16281
16282
16283
16284
16285
16286
16287
16288
16289
16290
16291
16292
16293
16294
16295
16296
16297
16298
16299
16300
16301
16302
16303
16304
16305
16306
16307
16308
16309
16310
16311
16312
16313
16314
16315
16316
16317
16318
16319
16320
16321
16322
16323
16324
16325
16326
16327
16328
16329
16330
16331
16332
16333
16334
16335
16336
16337
16338
16339
16340
16341
16342
16343
16344
16345
16346
16347
16348
16349
16350
16351
16352
16353
16354
16355
16356
16357
16358
16359
16360
16361
16362
16363
16364
16365
16366
16367
16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
16379
16380
16381
16382
16383
16384
16385
16386
16387
16388
16389
16390
16391
16392
16393
16394
16395
16396
16397
16398
16399
16400
16401
16402
16403
16404
16405
16406
16407
16408
16409
16410
16411
16412
16413
16414
16415
16416
16417
16418
16419
16420
16421
16422
16423
16424
16425
16426
16427
16428
16429
16430
16431
16432
16433
16434
16435
16436
16437
16438
16439
16440
16441
16442
16443
16444
16445
16446
16447
16448
16449
16450
16451
16452
16453
16454
16455
16456
16457
16458
16459
16460
16461
16462
16463
16464
16465
16466
16467
16468
16469
16470
16471
16472
16473
16474
16475
16476
16477
16478
16479
16480
16481
16482
16483
16484
16485
16486
16487
16488
16489
16490
16491
16492
16493
16494
16495
16496
16497
16498
16499
16500
16501
16502
16503
16504
16505
16506
16507
16508
16509
16510
16511
16512
16513
16514
16515
16516
16517
16518
16519
16520
16521
16522
16523
16524
16525
16526
16527
16528
16529
16530
16531
16532
16533
16534
16535
16536
16537
16538
16539
16540
16541
16542
16543
16544
16545
16546
16547
16548
16549
16550
16551
16552
16553
16554
16555
16556
16557
16558
16559
16560
16561
16562
16563
16564
16565
16566
16567
16568
16569
16570
16571
16572
16573
16574
16575
16576
16577
16578
16579
16580
16581
16582
16583
16584
16585
16586
16587
16588
16589
16590
16591
16592
16593
16594
16595
16596
16597
16598
16599
16600
16601
16602
16603
16604
16605
16606
16607
16608
16609
16610
16611
16612
16613
16614
16615
16616
16617
16618
16619
16620
16621
16622
16623
16624
16625
16626
16627
16628
16629
16630
16631
16632
16633
16634
16635
16636
16637
16638
16639
16640
16641
16642
16643
16644
16645
16646
16647
16648
16649
16650
16651
16652
16653
16654
16655
16656
16657
16658
16659
16660
16661
16662
16663
16664
16665
16666
16667
16668
16669
16670
16671
16672
16673
16674
16675
16676
16677
16678
16679
16680
16681
16682
16683
16684
16685
16686
16687
16688
16689
16690
16691
16692
16693
16694
16695
16696
16697
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16708
16709
16710
16711
16712
16713
16714
16715
16716
16717
16718
16719
16720
16721
16722
16723
16724
16725
16726
16727
16728
16729
16730
16731
16732
16733
16734
16735
16736
16737
16738
16739
16740
16741
16742
16743
16744
16745
16746
16747
16748
16749
16750
16751
16752
16753
16754
16755
16756
16757
16758
16759
16760
16761
16762
16763
16764
16765
16766
16767
16768
16769
16770
16771
16772
16773
16774
16775
16776
16777
16778
16779
16780
16781
16782
16783
16784
16785
16786
16787
16788
16789
16790
16791
16792
16793
16794
16795
16796
16797
16798
16799
16800
16801
16802
16803
16804
16805
16806
16807
16808
16809
16810
16811
16812
16813
16814
16815
16816
16817
16818
16819
16820
16821
16822
16823
16824
16825
16826
16827
16828
16829
16830
16831
16832
16833
16834
16835
16836
16837
16838
16839
16840
16841
16842
16843
16844
16845
16846
16847
16848
16849
16850
16851
16852
16853
16854
16855
16856
16857
16858
16859
16860
16861
16862
16863
16864
16865
16866
16867
16868
16869
16870
16871
16872
16873
16874
16875
16876
16877
16878
16879
16880
16881
16882
16883
16884
16885
16886
16887
16888
16889
16890
16891
16892
16893
16894
16895
16896
16897
16898
16899
16900
16901
16902
16903
16904
16905
16906
16907
16908
16909
16910
16911
16912
16913
16914
16915
16916
16917
16918
16919
16920
16921
16922
16923
16924
16925
16926
16927
16928
16929
16930
16931
16932
16933
16934
16935
16936
16937
16938
16939
16940
16941
16942
16943
16944
16945
16946
16947
16948
16949
16950
16951
16952
16953
16954
16955
16956
16957
16958
16959
16960
16961
16962
16963
16964
16965
16966
16967
16968
16969
16970
16971
16972
16973
16974
16975
16976
16977
16978
16979
16980
16981
16982
16983
16984
16985
16986
16987
16988
16989
16990
16991
16992
16993
16994
16995
16996
16997
16998
16999
17000
17001
17002
17003
17004
17005
17006
17007
17008
17009
17010
17011
17012
17013
17014
17015
17016
17017
17018
17019
17020
17021
17022
17023
17024
17025
17026
17027
17028
17029
17030
17031
17032
17033
17034
17035
17036
17037
17038
17039
17040
17041
17042
17043
17044
17045
17046
17047
17048
17049
17050
17051
17052
17053
17054
17055
17056
17057
17058
17059
17060
17061
17062
17063
17064
17065
17066
17067
17068
17069
17070
17071
17072
17073
17074
17075
17076
17077
17078
17079
17080
17081
17082
17083
17084
17085
17086
17087
17088
17089
17090
17091
17092
17093
17094
17095
17096
17097
17098
17099
17100
17101
17102
17103
17104
17105
17106
17107
17108
17109
17110
17111
17112
17113
17114
17115
17116
17117
17118
17119
17120
17121
17122
17123
17124
17125
17126
17127
17128
17129
17130
17131
17132
17133
17134
17135
17136
17137
17138
17139
17140
17141
17142
17143
17144
17145
17146
17147
17148
17149
17150
17151
17152
17153
17154
17155
17156
17157
17158
17159
17160
17161
17162
17163
17164
17165
17166
17167
17168
17169
17170
17171
17172
17173
17174
17175
17176
17177
17178
17179
17180
17181
17182
17183
17184
17185
17186
17187
17188
17189
17190
17191
17192
17193
17194
17195
17196
17197
17198
17199
17200
17201
17202
17203
17204
17205
17206
17207
17208
17209
17210
17211
17212
17213
17214
17215
17216
17217
17218
17219
17220
17221
17222
17223
17224
17225
17226
17227
17228
17229
17230
17231
17232
17233
17234
17235
17236
17237
17238
17239
17240
17241
17242
17243
17244
17245
17246
17247
17248
17249
17250
17251
17252
17253
17254
17255
17256
17257
17258
17259
17260
17261
17262
17263
17264
17265
17266
17267
17268
17269
17270
17271
17272
17273
17274
17275
17276
17277
17278
17279
17280
17281
17282
17283
17284
17285
17286
17287
17288
17289
17290
17291
17292
17293
17294
17295
17296
17297
17298
17299
17300
17301
17302
17303
17304
17305
17306
17307
17308
17309
17310
17311
17312
17313
17314
17315
17316
17317
17318
17319
17320
17321
17322
17323
17324
17325
17326
17327
17328
17329
17330
17331
17332
17333
17334
17335
17336
17337
17338
17339
17340
17341
17342
17343
17344
17345
17346
17347
17348
17349
17350
17351
17352
17353
17354
17355
17356
17357
17358
17359
17360
17361
17362
17363
17364
17365
17366
17367
17368
17369
17370
17371
17372
17373
17374
17375
17376
17377
17378
17379
17380
17381
17382
17383
17384
17385
17386
17387
17388
17389
17390
17391
17392
17393
17394
17395
17396
17397
17398
17399
17400
17401
17402
17403
17404
17405
17406
17407
17408
17409
17410
17411
17412
17413
17414
17415
17416
17417
17418
17419
17420
17421
17422
17423
17424
17425
17426
17427
17428
17429
17430
17431
17432
17433
17434
17435
17436
17437
17438
17439
17440
17441
17442
17443
17444
17445
17446
17447
17448
17449
17450
17451
17452
17453
17454
17455
17456
17457
17458
17459
17460
17461
17462
17463
17464
17465
17466
17467
17468
17469
17470
17471
17472
17473
17474
17475
17476
17477
17478
17479
17480
17481
17482
17483
17484
17485
17486
17487
17488
17489
17490
17491
17492
17493
17494
17495
17496
17497
17498
17499
17500
17501
17502
17503
17504
17505
17506
17507
17508
17509
17510
17511
17512
17513
17514
17515
17516
17517
17518
17519
17520
17521
17522
17523
17524
17525
17526
17527
17528
17529
17530
17531
17532
17533
17534
17535
17536
17537
17538
17539
17540
17541
17542
17543
17544
17545
17546
17547
17548
17549
17550
17551
17552
17553
17554
17555
17556
17557
17558
17559
17560
17561
17562
17563
17564
17565
17566
17567
17568
17569
17570
17571
17572
17573
17574
17575
17576
17577
17578
17579
17580
17581
17582
17583
17584
17585
17586
17587
17588
17589
17590
17591
17592
17593
17594
17595
17596
17597
17598
17599
17600
17601
17602
17603
17604
17605
17606
17607
17608
17609
17610
17611
17612
17613
17614
17615
17616
17617
17618
17619
17620
17621
17622
17623
17624
17625
17626
17627
17628
17629
17630
17631
17632
17633
17634
17635
17636
17637
17638
17639
17640
17641
17642
17643
17644
17645
17646
17647
17648
17649
17650
17651
17652
17653
17654
17655
17656
17657
17658
17659
17660
17661
17662
17663
17664
17665
17666
17667
17668
17669
17670
17671
17672
17673
17674
17675
17676
17677
17678
17679
17680
17681
17682
17683
17684
17685
17686
17687
17688
17689
17690
17691
17692
17693
17694
17695
17696
17697
17698
17699
17700
17701
17702
17703
17704
17705
17706
17707
17708
17709
17710
17711
17712
17713
17714
17715
17716
17717
17718
17719
17720
17721
17722
17723
17724
17725
17726
17727
17728
17729
17730
17731
17732
17733
17734
17735
17736
17737
17738
17739
17740
17741
17742
17743
17744
17745
17746
17747
17748
17749
17750
17751
17752
17753
17754
17755
17756
17757
17758
17759
17760
17761
17762
17763
17764
17765
17766
17767
17768
17769
17770
17771
17772
17773
17774
17775
17776
17777
17778
17779
17780
17781
17782
17783
17784
17785
17786
17787
17788
17789
17790
17791
17792
17793
17794
17795
17796
17797
17798
17799
17800
17801
17802
17803
17804
17805
17806
17807
17808
17809
17810
17811
17812
17813
17814
17815
17816
17817
17818
17819
17820
17821
17822
17823
17824
17825
17826
17827
17828
17829
17830
17831
17832
17833
17834
17835
17836
17837
17838
17839
17840
17841
17842
17843
17844
17845
17846
17847
17848
17849
17850
17851
17852
17853
17854
17855
17856
17857
17858
17859
17860
17861
17862
17863
17864
17865
17866
17867
17868
17869
17870
17871
17872
17873
17874
17875
17876
17877
17878
17879
17880
17881
17882
17883
17884
17885
17886
17887
17888
17889
17890
17891
17892
17893
17894
17895
17896
17897
17898
17899
17900
17901
17902
17903
17904
17905
17906
17907
17908
17909
17910
17911
17912
17913
17914
17915
17916
17917
17918
17919
17920
17921
17922
17923
17924
17925
17926
17927
17928
17929
17930
17931
17932
17933
17934
17935
17936
17937
17938
17939
17940
17941
17942
17943
17944
17945
17946
17947
17948
17949
17950
17951
17952
17953
17954
17955
17956
17957
17958
17959
17960
17961
17962
17963
17964
17965
17966
17967
17968
17969
17970
17971
17972
17973
17974
17975
17976
17977
17978
17979
17980
17981
17982
17983
17984
17985
17986
17987
17988
17989
17990
17991
17992
17993
17994
17995
17996
17997
17998
17999
18000
18001
18002
18003
18004
18005
18006
18007
18008
18009
18010
18011
18012
18013
18014
18015
18016
18017
18018
18019
18020
18021
18022
18023
18024
18025
18026
18027
18028
18029
18030
18031
18032
18033
18034
18035
18036
18037
18038
18039
18040
18041
18042
18043
18044
18045
18046
18047
18048
18049
18050
18051
18052
18053
18054
18055
18056
18057
18058
18059
18060
18061
18062
18063
18064
18065
18066
18067
18068
18069
18070
18071
18072
18073
18074
18075
18076
18077
18078
18079
18080
18081
18082
18083
18084
18085
18086
18087
18088
18089
18090
18091
18092
18093
18094
18095
18096
18097
18098
18099
18100
18101
18102
18103
18104
18105
18106
18107
18108
18109
18110
18111
18112
18113
18114
18115
18116
18117
18118
18119
18120
18121
18122
18123
18124
18125
18126
18127
18128
18129
18130
18131
18132
18133
18134
18135
18136
18137
18138
18139
18140
18141
18142
18143
18144
18145
18146
18147
18148
18149
18150
18151
18152
18153
18154
18155
18156
18157
18158
18159
18160
18161
18162
18163
18164
18165
18166
18167
18168
18169
18170
18171
18172
18173
18174
18175
18176
18177
18178
18179
18180
18181
18182
18183
18184
18185
18186
18187
18188
18189
18190
18191
18192
18193
18194
18195
18196
18197
18198
18199
18200
18201
18202
18203
18204
18205
18206
18207
18208
18209
18210
18211
18212
18213
18214
18215
18216
18217
18218
18219
18220
18221
18222
18223
18224
18225
18226
18227
18228
18229
18230
18231
18232
18233
18234
18235
18236
18237
18238
18239
18240
18241
18242
18243
18244
18245
18246
18247
18248
18249
18250
18251
18252
18253
18254
18255
18256
18257
18258
18259
18260
18261
18262
18263
18264
18265
18266
18267
18268
18269
18270
18271
18272
18273
18274
18275
18276
18277
18278
18279
18280
18281
18282
18283
18284
18285
18286
18287
18288
18289
18290
18291
18292
18293
18294
18295
18296
18297
18298
18299
18300
18301
18302
18303
18304
18305
18306
18307
18308
18309
18310
18311
18312
18313
18314
18315
18316
18317
18318
18319
18320
18321
18322
18323
18324
18325
18326
18327
18328
18329
18330
18331
18332
18333
18334
18335
18336
18337
18338
18339
18340
18341
18342
18343
18344
18345
18346
18347
18348
18349
18350
18351
18352
18353
18354
18355
18356
18357
18358
18359
18360
18361
18362
18363
18364
18365
18366
18367
18368
18369
18370
18371
18372
18373
18374
18375
18376
18377
18378
18379
18380
18381
18382
18383
18384
18385
18386
18387
18388
18389
18390
18391
18392
18393
18394
18395
18396
18397
18398
18399
18400
18401
18402
18403
18404
18405
18406
18407
18408
18409
18410
18411
18412
18413
18414
18415
18416
18417
18418
18419
18420
18421
18422
18423
18424
18425
18426
18427
18428
18429
18430
18431
18432
18433
18434
18435
18436
18437
18438
18439
18440
18441
18442
18443
18444
18445
18446
18447
18448
18449
18450
18451
18452
18453
18454
18455
18456
18457
18458
18459
18460
18461
18462
18463
18464
18465
18466
18467
18468
18469
18470
18471
18472
18473
18474
18475
18476
18477
18478
18479
18480
18481
18482
18483
18484
18485
18486
18487
18488
18489
18490
18491
18492
18493
18494
18495
18496
18497
18498
18499
18500
18501
18502
18503
18504
18505
18506
18507
18508
18509
18510
18511
18512
18513
18514
18515
18516
18517
18518
18519
18520
18521
18522
18523
18524
18525
18526
18527
18528
18529
18530
18531
18532
18533
18534
18535
18536
18537
18538
18539
18540
18541
18542
18543
18544
18545
18546
18547
18548
18549
18550
18551
18552
18553
18554
18555
18556
18557
18558
18559
18560
18561
18562
18563
18564
18565
18566
18567
18568
18569
18570
18571
18572
18573
18574
18575
18576
18577
18578
18579
18580
18581
18582
18583
18584
18585
18586
18587
18588
18589
18590
18591
18592
18593
18594
18595
18596
18597
18598
18599
18600
18601
18602
18603
18604
18605
18606
18607
18608
18609
18610
18611
18612
18613
18614
18615
18616
18617
18618
18619
18620
18621
18622
18623
18624
18625
18626
18627
18628
18629
18630
18631
18632
18633
18634
18635
18636
18637
18638
18639
18640
18641
18642
18643
18644
18645
18646
18647
18648
18649
18650
18651
18652
18653
18654
18655
18656
18657
18658
18659
18660
18661
18662
18663
18664
18665
18666
18667
18668
18669
18670
18671
18672
18673
18674
18675
18676
18677
18678
18679
18680
18681
18682
18683
18684
18685
18686
18687
18688
18689
18690
18691
18692
18693
18694
18695
18696
18697
18698
18699
18700
18701
18702
18703
18704
18705
18706
18707
18708
18709
18710
18711
18712
18713
18714
18715
18716
18717
18718
18719
18720
18721
18722
18723
18724
18725
18726
18727
18728
18729
18730
18731
18732
18733
18734
18735
18736
18737
18738
18739
18740
18741
18742
18743
18744
18745
18746
18747
18748
18749
18750
18751
18752
18753
18754
18755
18756
18757
18758
18759
18760
18761
18762
18763
18764
18765
18766
18767
18768
18769
18770
18771
18772
18773
18774
18775
18776
18777
18778
18779
18780
18781
18782
18783
18784
18785
18786
18787
18788
18789
18790
18791
18792
18793
18794
18795
18796
18797
18798
18799
18800
18801
18802
18803
18804
18805
18806
18807
18808
18809
18810
18811
18812
18813
18814
18815
18816
18817
18818
18819
18820
18821
18822
18823
18824
18825
18826
18827
18828
18829
18830
18831
18832
18833
18834
18835
18836
18837
18838
18839
18840
18841
18842
18843
18844
18845
18846
18847
18848
18849
18850
18851
18852
18853
18854
18855
18856
18857
18858
18859
18860
18861
18862
18863
18864
18865
18866
18867
18868
18869
18870
18871
18872
18873
18874
18875
18876
18877
18878
18879
18880
18881
18882
18883
18884
18885
18886
18887
18888
18889
18890
18891
18892
18893
18894
18895
18896
18897
18898
18899
18900
18901
18902
18903
18904
18905
18906
18907
18908
18909
18910
18911
18912
18913
18914
18915
18916
18917
18918
18919
18920
18921
18922
18923
18924
18925
18926
18927
18928
18929
18930
18931
18932
18933
18934
18935
18936
18937
18938
18939
18940
18941
18942
18943
18944
18945
18946
18947
18948
18949
18950
18951
18952
18953
18954
18955
18956
18957
18958
18959
18960
18961
18962
18963
18964
18965
18966
18967
18968
18969
18970
18971
18972
18973
18974
18975
18976
18977
18978
18979
18980
18981
18982
18983
18984
18985
18986
18987
18988
18989
18990
18991
18992
18993
18994
18995
18996
18997
18998
18999
19000
19001
19002
19003
19004
19005
19006
19007
19008
19009
19010
19011
19012
19013
19014
19015
19016
19017
19018
19019
19020
19021
19022
19023
19024
19025
19026
19027
19028
19029
19030
19031
19032
19033
19034
19035
19036
19037
19038
19039
19040
19041
19042
19043
19044
19045
19046
19047
19048
19049
19050
19051
19052
19053
19054
19055
19056
19057
19058
19059
19060
19061
19062
19063
19064
19065
19066
19067
19068
19069
19070
19071
19072
19073
19074
19075
19076
19077
19078
19079
19080
19081
19082
19083
19084
19085
19086
19087
19088
19089
19090
19091
19092
19093
19094
19095
19096
19097
19098
19099
19100
19101
19102
19103
19104
19105
19106
19107
19108
19109
19110
19111
19112
19113
19114
19115
19116
19117
19118
19119
19120
19121
19122
19123
19124
19125
19126
19127
19128
19129
19130
19131
19132
19133
19134
19135
19136
19137
19138
19139
19140
19141
19142
19143
19144
19145
19146
19147
19148
19149
19150
19151
19152
19153
19154
19155
19156
19157
19158
19159
19160
19161
19162
19163
19164
19165
19166
19167
19168
19169
19170
19171
19172
19173
19174
19175
19176
19177
19178
19179
19180
19181
19182
19183
19184
19185
19186
19187
19188
19189
19190
19191
19192
19193
19194
19195
19196
19197
19198
19199
19200
19201
19202
19203
19204
19205
19206
19207
19208
19209
19210
19211
19212
19213
19214
19215
19216
19217
19218
19219
19220
19221
19222
19223
19224
19225
19226
19227
19228
19229
19230
19231
19232
19233
19234
19235
19236
19237
19238
19239
19240
19241
19242
19243
19244
19245
19246
19247
19248
19249
19250
19251
19252
19253
19254
19255
19256
19257
19258
19259
19260
19261
19262
19263
19264
19265
19266
19267
19268
19269
19270
19271
19272
19273
19274
19275
19276
19277
19278
19279
19280
19281
19282
19283
19284
19285
19286
19287
19288
19289
19290
19291
19292
19293
19294
19295
19296
19297
19298
19299
19300
19301
19302
19303
19304
19305
19306
19307
19308
19309
19310
19311
19312
19313
19314
19315
19316
19317
19318
19319
19320
19321
19322
19323
19324
19325
19326
19327
19328
19329
19330
19331
19332
19333
19334
19335
19336
19337
19338
19339
19340
19341
19342
19343
19344
19345
19346
19347
19348
19349
19350
19351
19352
19353
19354
19355
19356
19357
19358
19359
19360
19361
19362
19363
19364
19365
19366
19367
19368
19369
19370
19371
19372
19373
19374
19375
19376
19377
19378
19379
19380
19381
19382
19383
19384
19385
19386
19387
19388
19389
19390
19391
19392
19393
19394
19395
19396
19397
19398
19399
19400
19401
19402
19403
19404
19405
19406
19407
19408
19409
19410
19411
19412
19413
19414
19415
19416
19417
19418
19419
19420
19421
19422
19423
19424
19425
19426
19427
19428
19429
19430
19431
19432
19433
19434
19435
19436
19437
19438
19439
19440
19441
19442
19443
19444
19445
19446
19447
19448
19449
19450
19451
19452
19453
19454
19455
19456
19457
19458
19459
19460
19461
19462
19463
19464
19465
19466
19467
19468
19469
19470
19471
19472
19473
19474
19475
19476
19477
19478
19479
19480
19481
19482
19483
19484
19485
19486
19487
19488
19489
19490
19491
19492
19493
19494
19495
19496
19497
19498
19499
19500
19501
19502
19503
19504
19505
19506
19507
19508
19509
19510
19511
19512
19513
19514
19515
19516
19517
19518
19519
19520
19521
19522
19523
19524
19525
19526
19527
19528
19529
19530
19531
19532
19533
19534
19535
19536
19537
19538
19539
19540
19541
19542
19543
19544
19545
19546
19547
19548
19549
19550
19551
19552
19553
19554
19555
19556
19557
19558
19559
19560
19561
19562
19563
19564
19565
19566
19567
19568
19569
19570
19571
19572
19573
19574
19575
19576
19577
19578
19579
19580
19581
19582
19583
19584
19585
19586
19587
19588
19589
19590
19591
19592
19593
19594
19595
19596
19597
19598
19599
19600
19601
19602
19603
19604
19605
19606
19607
19608
19609
19610
19611
19612
19613
19614
19615
19616
19617
19618
19619
19620
19621
19622
19623
19624
19625
19626
19627
19628
19629
19630
19631
19632
19633
19634
19635
19636
19637
19638
19639
19640
19641
19642
19643
19644
19645
19646
19647
19648
19649
19650
19651
19652
19653
19654
19655
19656
19657
19658
19659
19660
19661
19662
19663
19664
19665
19666
19667
19668
19669
19670
19671
19672
19673
19674
19675
19676
19677
19678
19679
19680
19681
19682
19683
19684
19685
19686
19687
19688
19689
19690
19691
19692
19693
19694
19695
19696
19697
19698
19699
19700
19701
19702
19703
19704
19705
19706
19707
19708
19709
19710
19711
19712
19713
19714
19715
19716
19717
19718
19719
19720
19721
19722
19723
19724
19725
19726
19727
19728
19729
19730
19731
19732
19733
19734
19735
19736
19737
19738
19739
19740
19741
19742
19743
19744
19745
19746
19747
19748
19749
19750
19751
19752
19753
19754
19755
19756
19757
19758
19759
19760
19761
19762
19763
19764
19765
19766
19767
19768
19769
19770
19771
19772
19773
19774
19775
19776
19777
19778
19779
19780
19781
19782
19783
19784
19785
19786
19787
19788
19789
19790
19791
19792
19793
19794
19795
19796
19797
19798
19799
19800
19801
19802
19803
19804
19805
19806
19807
19808
19809
19810
19811
19812
19813
19814
19815
19816
19817
19818
19819
19820
19821
19822
19823
19824
19825
19826
19827
19828
19829
19830
19831
19832
19833
19834
19835
19836
19837
19838
19839
19840
19841
19842
19843
19844
19845
19846
19847
19848
19849
19850
19851
19852
19853
19854
19855
19856
19857
19858
19859
19860
19861
19862
19863
19864
19865
19866
19867
19868
19869
19870
19871
19872
19873
19874
19875
19876
19877
19878
19879
19880
19881
19882
19883
19884
19885
19886
19887
19888
19889
19890
19891
19892
19893
19894
19895
19896
19897
19898
19899
19900
19901
19902
19903
19904
19905
19906
19907
19908
19909
19910
19911
19912
19913
19914
19915
19916
19917
19918
19919
19920
19921
19922
19923
19924
19925
19926
19927
19928
19929
19930
19931
19932
19933
19934
19935
19936
19937
19938
19939
19940
19941
19942
19943
19944
19945
19946
19947
19948
19949
19950
19951
19952
19953
19954
19955
19956
19957
19958
19959
19960
19961
19962
19963
19964
19965
19966
19967
19968
19969
19970
19971
19972
19973
19974
19975
19976
19977
19978
19979
19980
19981
19982
19983
19984
19985
19986
19987
19988
19989
19990
19991
19992
19993
19994
19995
19996
19997
19998
19999
20000
20001
20002
20003
20004
20005
20006
20007
20008
20009
20010
20011
20012
20013
20014
20015
20016
20017
20018
20019
20020
20021
20022
20023
20024
20025
20026
20027
20028
20029
20030
20031
20032
20033
20034
20035
20036
20037
20038
20039
20040
20041
20042
20043
20044
20045
20046
20047
20048
20049
20050
20051
20052
20053
20054
20055
20056
20057
20058
20059
20060
20061
20062
20063
20064
20065
20066
20067
20068
20069
20070
20071
20072
20073
20074
20075
20076
20077
20078
20079
20080
20081
20082
20083
20084
20085
20086
20087
20088
20089
20090
20091
20092
20093
20094
20095
20096
20097
20098
20099
20100
20101
20102
20103
20104
20105
20106
20107
20108
20109
20110
20111
20112
20113
20114
20115
20116
20117
20118
20119
20120
20121
20122
20123
20124
20125
20126
20127
20128
20129
20130
20131
20132
20133
20134
20135
20136
20137
20138
20139
20140
20141
20142
20143
20144
20145
20146
20147
20148
20149
20150
20151
20152
20153
20154
20155
20156
20157
20158
20159
20160
20161
20162
20163
20164
20165
20166
20167
20168
20169
20170
20171
20172
20173
20174
20175
20176
20177
20178
20179
20180
20181
20182
20183
20184
20185
20186
20187
20188
20189
20190
20191
20192
20193
20194
20195
20196
20197
20198
20199
20200
20201
20202
20203
20204
20205
20206
20207
20208
20209
20210
20211
20212
20213
20214
20215
20216
20217
20218
20219
20220
20221
20222
20223
20224
20225
20226
20227
20228
20229
20230
20231
20232
20233
20234
20235
20236
20237
20238
20239
20240
20241
20242
20243
20244
20245
20246
20247
20248
20249
20250
20251
20252
20253
20254
20255
20256
20257
20258
20259
20260
20261
20262
20263
20264
20265
20266
20267
20268
20269
20270
20271
20272
20273
20274
20275
20276
20277
20278
20279
20280
20281
20282
20283
20284
20285
20286
20287
20288
20289
20290
20291
20292
20293
20294
20295
20296
20297
20298
20299
20300
20301
20302
20303
20304
20305
20306
20307
20308
20309
20310
20311
20312
20313
20314
20315
20316
20317
20318
20319
20320
20321
20322
20323
20324
20325
20326
20327
20328
20329
20330
20331
20332
20333
20334
20335
20336
20337
20338
20339
20340
20341
20342
20343
20344
20345
20346
20347
20348
20349
20350
20351
20352
20353
20354
20355
20356
20357
20358
20359
20360
20361
20362
20363
20364
20365
20366
20367
20368
20369
20370
20371
20372
20373
20374
20375
20376
20377
20378
20379
20380
20381
20382
20383
20384
20385
20386
20387
20388
20389
20390
20391
20392
20393
20394
20395
20396
20397
20398
20399
20400
20401
20402
20403
20404
20405
20406
20407
20408
20409
20410
20411
20412
20413
20414
20415
20416
20417
20418
20419
20420
20421
20422
20423
20424
20425
20426
20427
20428
20429
20430
20431
20432
20433
20434
20435
20436
20437
20438
20439
20440
20441
20442
20443
20444
20445
20446
20447
20448
20449
20450
20451
20452
20453
20454
20455
20456
20457
20458
20459
20460
20461
20462
20463
20464
20465
20466
20467
20468
20469
20470
20471
20472
20473
20474
20475
20476
20477
20478
20479
20480
20481
20482
20483
20484
20485
20486
20487
20488
20489
20490
20491
20492
20493
20494
20495
20496
20497
20498
20499
20500
20501
20502
20503
20504
20505
20506
20507
20508
20509
20510
20511
20512
20513
20514
20515
20516
20517
20518
20519
20520
20521
20522
20523
20524
20525
20526
20527
20528
20529
20530
20531
20532
20533
20534
20535
20536
20537
20538
20539
20540
20541
20542
20543
20544
20545
20546
20547
20548
20549
20550
20551
20552
20553
20554
20555
20556
20557
20558
20559
20560
20561
20562
20563
20564
20565
20566
20567
20568
20569
20570
20571
20572
20573
20574
20575
20576
20577
20578
20579
20580
20581
20582
20583
20584
20585
20586
20587
20588
20589
20590
20591
20592
20593
20594
20595
20596
20597
20598
20599
20600
20601
20602
20603
20604
20605
20606
20607
20608
20609
20610
20611
20612
20613
20614
20615
20616
20617
20618
20619
20620
20621
20622
20623
20624
20625
20626
20627
20628
20629
20630
20631
20632
20633
20634
20635
20636
20637
20638
20639
20640
20641
20642
20643
20644
20645
20646
20647
20648
20649
20650
20651
20652
20653
20654
20655
20656
20657
20658
20659
20660
20661
20662
20663
20664
20665
20666
20667
20668
20669
20670
20671
20672
20673
20674
20675
20676
20677
20678
20679
20680
20681
20682
20683
20684
20685
20686
20687
20688
20689
20690
20691
20692
20693
20694
20695
20696
20697
20698
20699
20700
20701
20702
20703
20704
20705
20706
20707
20708
20709
20710
20711
20712
20713
20714
20715
20716
20717
20718
20719
20720
20721
20722
20723
20724
20725
20726
20727
20728
20729
20730
20731
20732
20733
20734
20735
20736
20737
20738
20739
20740
20741
20742
20743
20744
20745
20746
20747
20748
20749
20750
20751
20752
20753
20754
20755
20756
20757
20758
20759
20760
20761
20762
20763
20764
20765
20766
20767
20768
20769
20770
20771
20772
20773
20774
20775
20776
20777
20778
20779
20780
20781
20782
20783
20784
20785
20786
20787
20788
20789
20790
20791
20792
20793
20794
20795
20796
20797
20798
20799
20800
20801
20802
20803
20804
20805
20806
20807
20808
20809
20810
20811
20812
20813
20814
20815
20816
20817
20818
20819
20820
20821
20822
20823
20824
20825
20826
20827
20828
20829
20830
20831
20832
20833
20834
20835
20836
20837
20838
20839
20840
20841
20842
20843
20844
20845
20846
20847
20848
20849
20850
20851
20852
20853
20854
20855
20856
20857
20858
20859
20860
20861
20862
20863
20864
20865
20866
20867
20868
20869
20870
20871
20872
20873
20874
20875
20876
20877
20878
20879
20880
20881
20882
20883
20884
20885
20886
20887
20888
20889
20890
20891
20892
20893
20894
20895
20896
20897
20898
20899
20900
20901
20902
20903
20904
20905
20906
20907
20908
20909
20910
20911
20912
20913
20914
20915
20916
20917
20918
%!PS-Adobe-3.0
%%Creator: xpdf/pdftops 3.00
%%LanguageLevel: 2
%%DocumentSuppliedResources: (atend)
%%DocumentMedia: plain 612 792 0 () ()
%%BoundingBox: 0 0 612 792
%%Pages: 75
%%EndComments
%%BeginDefaults
%%PageMedia: plain
%%EndDefaults
%%BeginProlog
%%BeginResource: procset xpdf 3.00 0
/xpdf 75 dict def xpdf begin
% PDF special state
/pdfDictSize 15 def
/pdfSetup {
  3 1 roll 2 array astore
  /setpagedevice where {
    pop 3 dict begin
      /PageSize exch def
      /ImagingBBox null def
      /Policies 1 dict dup begin /PageSize 3 def end def
      { /Duplex true def } if
    currentdict end setpagedevice
  } {
    pop pop
  } ifelse
} def
/pdfStartPage {
  pdfDictSize dict begin
  /pdfFill [0] def
  /pdfStroke [0] def
  /pdfLastFill false def
  /pdfLastStroke false def
  /pdfTextMat [1 0 0 1 0 0] def
  /pdfFontSize 0 def
  /pdfCharSpacing 0 def
  /pdfTextRender 0 def
  /pdfTextRise 0 def
  /pdfWordSpacing 0 def
  /pdfHorizScaling 1 def
  /pdfTextClipPath [] def
} def
/pdfEndPage { end } def
% separation convention operators
/findcmykcustomcolor where {
  pop
}{
  /findcmykcustomcolor { 5 array astore } def
} ifelse
/setcustomcolor where {
  pop
}{
  /setcustomcolor {
    exch
    [ exch /Separation exch dup 4 get exch /DeviceCMYK exch
      0 4 getinterval cvx
      [ exch /dup load exch { mul exch dup } /forall load
        /pop load dup ] cvx
    ] setcolorspace setcolor
  } def
} ifelse
/customcolorimage where {
  pop
}{
  /customcolorimage {
    gsave
    [ exch /Separation exch dup 4 get exch /DeviceCMYK exch
      0 4 getinterval
      [ exch /dup load exch { mul exch dup } /forall load
        /pop load dup ] cvx
    ] setcolorspace
    10 dict begin
      /ImageType 1 def
      /DataSource exch def
      /ImageMatrix exch def
      /BitsPerComponent exch def
      /Height exch def
      /Width exch def
      /Decode [1 0] def
    currentdict end
    image
    grestore
  } def
} ifelse
% PDF color state
/sCol {
  pdfLastStroke not {
    pdfStroke aload length
    dup 1 eq {
      pop setgray
    }{
      dup 3 eq {
        pop setrgbcolor
      }{
        4 eq {
          setcmykcolor
        }{
          findcmykcustomcolor exch setcustomcolor
        } ifelse
      } ifelse
    } ifelse
    /pdfLastStroke true def /pdfLastFill false def
  } if
} def
/fCol {
  pdfLastFill not {
    pdfFill aload length
    dup 1 eq {
      pop setgray
    }{
      dup 3 eq {
        pop setrgbcolor
      }{
        4 eq {
          setcmykcolor
        }{
          findcmykcustomcolor exch setcustomcolor
        } ifelse
      } ifelse
    } ifelse
    /pdfLastFill true def /pdfLastStroke false def
  } if
} def
% build a font
/pdfMakeFont {
  4 3 roll findfont
  4 2 roll matrix scale makefont
  dup length dict begin
    { 1 index /FID ne { def } { pop pop } ifelse } forall
    /Encoding exch def
    currentdict
  end
  definefont pop
} def
/pdfMakeFont16 {
  exch findfont
  dup length dict begin
    { 1 index /FID ne { def } { pop pop } ifelse } forall
    /WMode exch def
    currentdict
  end
  definefont pop
} def
/pdfMakeFont16L3 {
  1 index /CIDFont resourcestatus {
    pop pop 1 index /CIDFont findresource /CIDFontType known
  } {
    false
  } ifelse
  {
    0 eq { /Identity-H } { /Identity-V } ifelse
    exch 1 array astore composefont pop
  } {
    pdfMakeFont16
  } ifelse
} def
% graphics state operators
/q { gsave pdfDictSize dict begin } def
/Q { end grestore } def
/cm { concat } def
/d { setdash } def
/i { setflat } def
/j { setlinejoin } def
/J { setlinecap } def
/M { setmiterlimit } def
/w { setlinewidth } def
% color operators
/g { dup 1 array astore /pdfFill exch def setgray
     /pdfLastFill true def /pdfLastStroke false def } def
/G { dup 1 array astore /pdfStroke exch def setgray
     /pdfLastStroke true def /pdfLastFill false def } def
/rg { 3 copy 3 array astore /pdfFill exch def setrgbcolor
      /pdfLastFill true def /pdfLastStroke false def } def
/RG { 3 copy 3 array astore /pdfStroke exch def setrgbcolor
      /pdfLastStroke true def /pdfLastFill false def } def
/k { 4 copy 4 array astore /pdfFill exch def setcmykcolor
     /pdfLastFill true def /pdfLastStroke false def } def
/K { 4 copy 4 array astore /pdfStroke exch def setcmykcolor
     /pdfLastStroke true def /pdfLastFill false def } def
/ck { 6 copy 6 array astore /pdfFill exch def
      findcmykcustomcolor exch setcustomcolor
      /pdfLastFill true def /pdfLastStroke false def } def
/CK { 6 copy 6 array astore /pdfStroke exch def
      findcmykcustomcolor exch setcustomcolor
      /pdfLastStroke true def /pdfLastFill false def } def
% path segment operators
/m { moveto } def
/l { lineto } def
/c { curveto } def
/re { 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto
      neg 0 rlineto closepath } def
/h { closepath } def
% path painting operators
/S { sCol stroke } def
/Sf { fCol stroke } def
/f { fCol fill } def
/f* { fCol eofill } def
% clipping operators
/W { clip newpath } def
/W* { eoclip newpath } def
% text state operators
/Tc { /pdfCharSpacing exch def } def
/Tf { dup /pdfFontSize exch def
      dup pdfHorizScaling mul exch matrix scale
      pdfTextMat matrix concatmatrix dup 4 0 put dup 5 0 put
      exch findfont exch makefont setfont } def
/Tr { /pdfTextRender exch def } def
/Ts { /pdfTextRise exch def } def
/Tw { /pdfWordSpacing exch def } def
/Tz { /pdfHorizScaling exch def } def
% text positioning operators
/Td { pdfTextMat transform moveto } def
/Tm { /pdfTextMat exch def } def
% text string operators
/cshow where {
  pop
  /cshow2 {
    dup {
      pop pop
      1 string dup 0 3 index put 3 index exec
    } exch cshow
    pop pop
  } def
}{
  /cshow2 {
    currentfont /FontType get 0 eq {
      0 2 2 index length 1 sub {
        2 copy get exch 1 add 2 index exch get
        2 copy exch 256 mul add
        2 string dup 0 6 5 roll put dup 1 5 4 roll put
        3 index exec
      } for
    } {
      dup {
        1 string dup 0 3 index put 3 index exec
      } forall
    } ifelse
    pop pop
  } def
} ifelse
/awcp {
  exch {
    false charpath
    5 index 5 index rmoveto
    6 index eq { 7 index 7 index rmoveto } if
  } exch cshow2
  6 {pop} repeat
} def
/Tj {
  fCol
  1 index stringwidth pdfTextMat idtransform pop
  sub 1 index length dup 0 ne { div } { pop pop 0 } ifelse
  pdfWordSpacing pdfHorizScaling mul 0 pdfTextMat dtransform 32
  4 3 roll pdfCharSpacing pdfHorizScaling mul add 0
  pdfTextMat dtransform
  6 5 roll Tj1
} def
/Tj16 {
  fCol
  2 index stringwidth pdfTextMat idtransform pop
  sub exch div
  pdfWordSpacing pdfHorizScaling mul 0 pdfTextMat dtransform 32
  4 3 roll pdfCharSpacing pdfHorizScaling mul add 0
  pdfTextMat dtransform
  6 5 roll Tj1
} def
/Tj16V {
  fCol
  2 index stringwidth pdfTextMat idtransform exch pop
  sub exch div
  0 pdfWordSpacing pdfTextMat dtransform 32
  4 3 roll pdfCharSpacing add 0 exch
  pdfTextMat dtransform
  6 5 roll Tj1
} def
/Tj1 {
  0 pdfTextRise pdfTextMat dtransform rmoveto
  currentpoint 8 2 roll
  pdfTextRender 1 and 0 eq {
    6 copy awidthshow
  } if
  pdfTextRender 3 and dup 1 eq exch 2 eq or {
    7 index 7 index moveto
    6 copy
    currentfont /FontType get 3 eq { fCol } { sCol } ifelse
    false awcp currentpoint stroke moveto
  } if
  pdfTextRender 4 and 0 ne {
    8 6 roll moveto
    false awcp
    /pdfTextClipPath [ pdfTextClipPath aload pop
      {/moveto cvx}
      {/lineto cvx}
      {/curveto cvx}
      {/closepath cvx}
    pathforall ] def
    currentpoint newpath moveto
  } {
    8 {pop} repeat
  } ifelse
  0 pdfTextRise neg pdfTextMat dtransform rmoveto
} def
/TJm { pdfFontSize 0.001 mul mul neg 0
       pdfTextMat dtransform rmoveto } def
/TJmV { pdfFontSize 0.001 mul mul neg 0 exch
        pdfTextMat dtransform rmoveto } def
/Tclip { pdfTextClipPath cvx exec clip newpath
         /pdfTextClipPath [] def } def
% Level 2 image operators
/pdfImBuf 100 string def
/pdfIm {
  image
  { currentfile pdfImBuf readline
    not { pop exit } if
    (%-EOD-) eq { exit } if } loop
} def
/pdfImSep {
  findcmykcustomcolor exch
  dup /Width get /pdfImBuf1 exch string def
  dup /Decode get aload pop 1 index sub /pdfImDecodeRange exch def
  /pdfImDecodeLow exch def
  begin Width Height BitsPerComponent ImageMatrix DataSource end
  /pdfImData exch def
  { pdfImData pdfImBuf1 readstring pop
    0 1 2 index length 1 sub {
      1 index exch 2 copy get
      pdfImDecodeRange mul 255 div pdfImDecodeLow add round cvi
      255 exch sub put
    } for }
  6 5 roll customcolorimage
  { currentfile pdfImBuf readline
    not { pop exit } if
    (%-EOD-) eq { exit } if } loop
} def
/pdfImM {
  fCol imagemask
  { currentfile pdfImBuf readline
    not { pop exit } if
    (%-EOD-) eq { exit } if } loop
} def
end
/__tumble {
  180 rotate
  -612 -792 translate
} def
%%EndResource
%%EndProlog
%%BeginSetup
xpdf begin
%%BeginResource: font LTWFJF+OurCharSet
%!FontType1-1.0: LTWFJF+OurCharSet
12 dict begin
/FontInfo 10 dict dup begin
/Notice (Copyright (c) 1991 Bigelow & Holmes Inc. and Y&Y, Inc. (508) 371-3286. All Rights Reserved.) readonly def
/FullName (Lucida Sans Typewriter 83) readonly def
/FamilyName (LucidaSansTypewriter83) readonly def
/isFixedPitch false def
/ItalicAngle 0 def
/UnderlinePosition -100 def
/UnderlineThickness 50 def
end readonly def
/FontName /LTWFJF+OurCharSet def
/PaintType 0 def
/FontType 1 def
/FontMatrix [0.001 0 0 0.001 0 0] readonly def
/FontBBox [-12 -205 618 928] readonly def
/StrokeWidth 0 def
/Encoding 256 array
0 1 255 {1 index exch /.notdef put} for
dup 32 /space put
dup 33 /exclam put
dup 34 /quotedbl put
dup 35 /numbersign put
dup 36 /dollar put
dup 37 /percent put
dup 38 /ampersand put
dup 39 /quoteright put
dup 40 /parenleft put
dup 41 /parenright put
dup 42 /asterisk put
dup 43 /plus put
dup 44 /comma put
dup 45 /minus put
dup 46 /period put
dup 47 /slash put
dup 48 /zero put
dup 49 /one put
dup 50 /two put
dup 51 /three put
dup 52 /four put
dup 53 /five put
dup 54 /six put
dup 55 /seven put
dup 56 /eight put
dup 57 /nine put
dup 58 /colon put
dup 59 /semicolon put
dup 60 /less put
dup 61 /equal put
dup 62 /greater put
dup 63 /question put
dup 64 /at put
dup 65 /A put
dup 66 /B put
dup 67 /C put
dup 68 /D put
dup 69 /E put
dup 70 /F put
dup 71 /G put
dup 72 /H put
dup 73 /I put
dup 74 /J put
dup 75 /K put
dup 76 /L put
dup 77 /M put
dup 78 /N put
dup 79 /O put
dup 80 /P put
dup 81 /Q put
dup 82 /R put
dup 83 /S put
dup 84 /T put
dup 85 /U put
dup 86 /V put
dup 87 /W put
dup 88 /X put
dup 89 /Y put
dup 90 /Z put
dup 91 /bracketleft put
dup 92 /backslash put
dup 93 /bracketright put
dup 94 /asciicircum put
dup 95 /underscore put
dup 96 /quoteleft put
dup 97 /a put
dup 98 /b put
dup 99 /c put
dup 100 /d put
dup 101 /e put
dup 102 /f put
dup 103 /g put
dup 104 /h put
dup 105 /i put
dup 106 /j put
dup 107 /k put
dup 108 /l put
dup 109 /m put
dup 110 /n put
dup 111 /o put
dup 112 /p put
dup 113 /q put
dup 114 /r put
dup 115 /s put
dup 116 /t put
dup 117 /u put
dup 118 /v put
dup 119 /w put
dup 120 /x put
dup 121 /y put
dup 122 /z put
dup 123 /braceleft put
dup 124 /bar put
dup 125 /braceright put
dup 126 /asciitilde put
readonly def
currentdict end
currentfile eexec
5AA4F71255501637F1A431BAB555283D093E1B588B45B0281559110D21315C62
BD638C6B34BA54AA75227715D9947EBCD51A104CAEA657499E94138F5645BF68
368BB1B1EC8E4776F067FFF2CE9B89FB7E63A7DB304498C1036D399C47A4CB79
BD517EDB02BEB90195FD7DDAF3E839BCE2DB156D9337DBB2305A465B3E0FFB97
1985C79DC71C47E26F9F0F042B2CDEE97B679358059256FB93D662D43C7ECB5B
1A564DFCECB963478373C69F52172F071E0AA6082A3E10D9E1CE2851CFA210EE
7BD5FCB1AAE15E89D1FB339D587D218B89C18A32F47C7451A80CB1FC07CF5EF5
C2A9054AD59AE4D5522D8745045620C9C40EAB675A6FE53511D83C04968F37DE
389C3A7A551DC79580FF1B382205C5951A9F8E7B6CEF33E027D608C14A394033
1E603A09B3061B66BB71AC1D2A232B5F2BC9481D7D44F334ACCBBF6538A439A3
FE8DA1ABE05931A20F8FC365A0F90C9A22578FEBDD03E4201D2887923DD20ED9
2F8F50AA500DE6414F5521ACCBBA45FBD55A4882C7485B52146BD36775948914
F8D5FB4C38AFAA25CC8946C7A7DBA010B186D6B5B07DA514976B3CC03535B838
7B3B0BE3D2A1813A3B406846433DF6235D79BA455E54E35184F42053C1FB0105
CDB7B017C5BF449CEF69EF7E7B143698D00B249BA50E98D198FCE708667252B4
E45CC9BE25735FF617ABA79311E655756E2F7993ACB8E4F27F76F14A9088DA85
6E17B25267A4D8177DEF6684BEB1F400B6B07492E58311CB44EC0B528F8FECE8
E96A50FC1F544E0F3DDFEC55E4CD9C34AE42CA8EF98BB1901E6D97DFECA023E0
F1D49EC9054CFEFE87ED611814870C75F636FA9F1430AA5F53C397BD13CE9113
7B57917BCBD964A8370F3FBCAF0FBC80BB0527B5E1C9DE292498096D0570A220
444B3E5CCF7F32C09338E4B393D1528267A5CEC43DE04EB0A7D3E802146533F8
5BE541383085700F322990AE9C7400CD2CD7031F05FDFB9D4825ABDB38E904C2
096B183D3D32C10A5C0391DA6516282D95C06E54EFBFA34282AE4D4EE0D87D9E
D0F41D3FCD7CEA0794E2A18A5F8092950BCA3B49A1A88A6A49E54BFC5BD354AD
4B58480C1F9136A0D2B34C96E6FAAC235DA8B5A643E94CE0A3924CD4A9C07F8F
CEEF6DB90ACD50F9438B78C1A7BB01F9A52B1A80F6DB7D5C0E26A3929939FCAF
91A90F63E448D6B2513B8835B3732FB96A449289BBCCB20C65A77EA718C25FC5
AE7C12089733357F89152E2667276AE55358EAA697CF0BA0031AB617710FF229
571046B5EA6B5EB93FDEE581FAB465EEF10F302EE7C5E39DE51A3C8B3FCEF031
9819ABC8FD2E80E6D0073E638992185B3C5301267853F69A9E0D969D229569C4
D59E062DB6A53B5F82FF8ED7584D27CE27EDEEE8C6C31EACC673C18CF53B1D72
419639DC644D9C1CBD370CE96E8D28C9ECA7F37F26989C125CF0B6B806D8B4D6
2E1CA29F891ACDCCEBBFF5E2F8BE1D59AF78E01A10B841624499DC224081C1C2
006938615363E596D014BD38E4729DF9AA2839500FF70D246873CE23A99DD173
6E4AA28598A115331ADB40913F876D05B8F89625A122CD752A60F2180D971AD3
486C49066503E24C50F5F4975C2EC545F051BC46DBF96898A28B2F09B608ECCB
57D2499B735ED1C45DA6BC1778273180D9DCC6E15C7DBF9F53BDFF46569CD7D5
3E66E85372B5A5D8CA62B906BD4CF56F0336441349554A5EF4C43837B83471FD
6CB4FABBADF99FEE2AA79354678722725927BFF26B7797AC9CD034474F889C41
403BCB546A701285EC285C90A7F69ED5FCFC6E1E9928E71999C408089A3D48C7
136BB77E9165624383400B324F50F3F88AD03205515A33586CEA9155C3FF70FA
CC1397107C484B8F9FD71F8E37265B47F8A28D50471A0539FE6B89C354A5ED46
2A0ED3C91DD90FE617D27C70E86A3DC1C05BE7E99D527B681E0141A787139940
FE22F116C428EA79BA326F462007EAF2D2CBFFEEA47D0A04840728FA57516073
FC9E482B25CE59A3951841FCB2994A454DBB17F56A629310E128919D60017178
4DE9E614779A44F400845C4905C13E75EF17E7D5653A62613E7BDC232674349F
7B0D86E1D499F42964E9CCECF15FBB0B557B0BC864CF475BF309B64BDDED98D5
D2B23DE6EAB32C8C3FD3D930ACD6288A80713148FD98BB757A8740B1DC48F757
3B19A56CB146FC5F38F3F89C44C4AAC71EC2F65E6024E15F805EF905F3A45094
289D38BF465D7E90EBB6C64C705D505ACAFF0631135855E9905C54808A9D1E53
B24360028BE452FABBFF72AFE83F9A26B7101C6E9D4DAB8AA495E19AD99490B4
870615F47C4135E29EF2178CED745490FCDB229E04FED8353A09DFA1448E3892
75D7480CD30611AEBBEB051F8F6E5E90B487263DC92F34EF9D1951A40EF2FCCB
3F5DFEBFCE277690B90A82291198B12C535EBE18E2206878829EFF8567B85D89
CA7BEBC9FF25FC6411D78C1A07FBE98104041632129730E371AD0054A4B74E48
CA21E60DB8AD10811A91CE4CC2A33D3750A0838643CBD5CE4E94566AACBA6146
926594ADD73AA1E4A48A3B32B4300B13750E4298EF23E77CF2923F8B95926603
16EDE4B6AA04E53CF708876C051A02B95D076BB4D754F4057C13EF0C9CAE1E02
D969A5CD0C82ABC080F3CB65F672344D201B927676B2C80EC6BDD30BDAEA61B8
6297D34A4BB3FCE96A8762161588AC43116550E8E6CA631B4F4DF540F03CBC41
046C2CB4547ED81370856486665CA480DB67F6B00727DC6AD77BD78F9EED9A35
BCF3E276E8BCF746E6BC38A59DD2171B87256AF5FAD646378F8E7DE26ECEA4CE
7089E042EA0A7557C346AA6F8DD6CA1CB9D581B5AC86EA4F6A3B257E286F22F2
C9CAD0DD32B0FF6798C83AE03B3168F70F7C7C849CC7C28F04F6CE8B6A6D0CF9
23114D99AE626E926A170751F654B7B268A8934C25EC195D43941F241CB36819
277B9CAB40F6EAD122B75DA9DD7918C8E5406AD44A54B3733BD01190CFF3740B
4C66E2D58D4682DD41E8F9580570A302FF450C375D9247DC8C8DBD38E48E04FE
F14D0650A63A5290A806C536E1F47EA00B13C27D8958F3332B9FAEE59875F289
7B224AB3EEA0CF879F56914E64AFD23763C661CCC36FA6B750EE28A1388C2664
AFE3DB6D09D3E21168A72A82DEED295BC44FC24A4EA46A02AA67447F7374DE34
3CA0ABAA0777FBBF2D02FCDF58F4783A1823DA35A54CA3A6069FFD7B9960AD3F
7E201A14A202BC5DEA12A40F12FBD779568CDE23DF90AD3EB281D5D63FDE864A
6DBE38FF0FDE4E222EF669EB29DED49A900DC9678D37DA2BD520D9A7C878D4DE
5877B8A6451CCC50B59D2455137CEBEC65CBAF609A00DE3CADFCF818C56409F4
871107C839043D6319CF2D57B2F94B524C8B9D64C8C4420E0D630471161EAB9F
D74449EBBDFEFCD9DEF0B39F4BF609B852394519F8697B42962BCC1499BF77A8
B02A695893533389BCD4B204FABCA016459C53D08426AE31A23F52497DCA85F8
8E19D62AA5AA45E3756BD0D067C510ABD271ECBD8B2A0466CB4AE70950C9A971
9FD6264399B34D82B9FD7169103BD48886226F267158FCF8E9300A04E4BDE133
06781119AE5C210F3858A00DCF23AF6D0E83FE052774EED1EF733075663A6599
19A31B51A977380648DF55CF9A088A864A55515B28D7DC75730E05CAD07B3A2C
818D43625A27F7284243AB26A90E2F80706DCA1676815313EC98F545D8EB02CC
1D1A710DF5C183EB8D7CEF837986556B470C7C0DCFE193047521CCB067226571
7C4929829A218FC50D522D4239F6B5C8D4A3E8006DE102A4873620AABF1A1FDD
BF94D362FA7B23EA59B8B07828EE49B2E825502960EFBB7F27246F8784797F54
3CDA02F9E8408E12F3F8724D465C73993321E8368D8E3FC8FE823CCA34042D72
159038A933CC6618627CC8755E72EC6B3FE4DF5F36D59E99409C6D4F7399936F
91DC03F065003B6AE676AA39B0D3F9746053E18B16C085F5D74C0FC3B6B00E99
FCCE3590271AA78A76BB36248B7B9B00DE62EE0C6767690228CC5F97CD27107E
D483D52A34182070A54EC20304CBC4763863735EE0C4941277755FC985CF6A9A
D95C8A8DEC8DD9734BC35578B79DF8EB140EEA8C622DEFED33768625FF197B19
1062FE5B7BC0C3E2EDF8F404477E4A0652342370889232DE662578DB1AE2DA0F
B7612DB64253390460682A6EFD5DA4D3316491DDCA92269289EA782FDAC82A76
FFE4181A6BAE23E0E539F31AF2CC0C9CF4DBD569C44598CFB6029B50C1D74151
D98FC5FCF0248778CCDC4F7B59C070E1E7D3FA8D4030178E1F02382C69B0338D
E2296378105DCAEA8AECAF50F8B90F1F2C20B03201D27B7AB1D633DA02D1626C
B6FF684677B042CE5BC5C9668BC1D959B8E666BF00EF10DA7C450FC122DDA86A
BC227BEB160C8F870A9A0BA1CC9ECF7A37E95186F150A3507E0AB6766E1E82BE
7C3E8C7C9C832A89127D7728C8BF89EF8C599F9ED7DAA8223FB2531AD7CC7381
918E6EB3386DDA03501A83D1BE49F381EE5C8BCE02432BBD93E7E145F681923D
814DF79DE4CEA10E025134E81A1A947F1E62EEAF978EF4B9DADC322881A88090
F1EE06A5DB1273F87737B35357651B77EC8D3E488BB949A2AC288FBA3C78C217
FCD52E3BDD13C610022F53617775B14752AE4FA0E5CC39CB66B9539D33C711ED
0F712DF81A28E42AD90C6AE2FAAD9C07ADF0A5CBA487F2D392E294069592F214
7BB688CB4FCEE81D2518BCBD21B04E2F3F9BE8DE6BF0640A667E700E2EC5414C
9F42F26FAC0923BAF78F63E03321E8BEC2332A8BE703C23457B1EA2448F7B48F
CC7BED855283A132869D38A43D74948D1EA165CAFB6C1FE35A426C23436C411B
C9B81EDCADE1F79F2A16963F609B8E5C8D9547FE8BBC20EBCB421D3D7510EF3F
D801AA9C68B389310E6394952C72BCC2252946260CAD4EC880F69D95AB07AC90
C6D0C8F95B72CA274CB690C5334B73A2F3B8B9CD6885E431E36FE16430FEB750
FBB8A3154BE9ACB2F3837E5A69836832F4FF6BC000EFC90167B450916892C728
D3BEE1F49B276C57BB298A646233A669BCB011179693BCD8AF0E09F14474EDEF
A34936392F66C296A8050F79458AA8F10FC95954CA98096604B99859813B488D
DEDACC162AB1330B9513B17F434A11F6E76746C180FF9B0AFDB4097453C6E1D8
2B0290CF6F7B8119CFBD59D6FA3BD32BA2D40E6266FB10520A71B734C502B46D
B96F597BBB18FDE6A61BCF7A9DACF524AC3B8C7770727BDB14850E3E6350A3BE
6A5D849BBEA78FA4C973DA470D984C3D2234AF68171A01D7F1E573FD3C9DEBEB
8A77F12916D9C22CA7026CAF1274A9C280FBE5089DA3EA526F9C68BC986A8B7F
4743E87A10196A1E3B9BC621B614CA32F47A171F8DF9D83A6294E796835A98DF
3C87725116BEB93D30C065EE4DFF5BE02E253F251647F3A6CBD9F8066884FA9D
7372CB758C1EC8B19D9B3E85919453B788D6BA4EB55CC047E00AB8ABA22F9001
4D7076D1B14BF9D9258DA19F8BB89DA70504254FB9D82F5E16F00576319F20FB
98B680758D7435BA34E98EF02F5C8CD16A1062B35A42B2E522D90435072D3BD6
5FC64AFBF541BBBF497328BE21F36B4EEE20EC18F41F3A985C49BBC05AFDA137
06F850F85BC991B658EA5DD6504A43D64664900026F08F5AD0657E81CB4B6394
29F8518C7F3A0CCB787EC827DF97B4EBE133AB28291C3202F7AE1E45DC8EC498
367870A9C9CA93AF3053D334DBFD307AFA2C421D2DBF465605A711568CAD060D
9C92373F4317EAE7B74228CD32BC3FE7289935DAAC9A1C95D67386820B478C2A
E7A76926BF9EF3B372A9F4A5C98F30BF2A46C1A0C393826191BD343F0DFE5734
DC38658406967441AE18C73FF0D2E70CC88255385E71F1FD5EBF85D4CCD4FD4D
DF5D02A2C7FD38CCCD29368B7CDE2AAF50B716AFA07470692E6AA278DED84406
F52643941EAA6ABDE13E948EFF746D506052BCFC45293FC75B3183A188712D37
11F81585E2279E301A9C967533959B0D99819435ADF4394EAF23C8432E8114DD
3DA40F4C2848A9A131403152773371ADCB6ADAE608A0159B3ED1DF37BCA6D1E1
DE7261DE98D26A75FC64B23F61CBBF5984DC45112F3E44D9BADFE9372A8AD035
D966F9D87CB5F831B40D6154C29DFEFCE905AD2F0F525DBA7A471BB8175A6E57
25598FD243FC0282D2D41AFB41FAF75FC48413DB128475A00BB49E23E1A47C70
657F84F3D09D66974B98DC898991A6DB7C7EFD32527F3FA56E9464793D47C5CC
17631250AA37B1B7EBD972D379110778F7033B7E10875AECAF5226BF9C43C330
E66639348E444F7A246D456A678637E6E4EECD1FB25C25A7037C364EB83DCDB3
4A6FCA2E36E71754927C30A0BC968164FFF79F210D8913A4A03A90EE3F03A860
4FB7D7513ACF84D3AD96E011067A9794DC09DCC003223A95CDD49C065A247105
A77118106D8B301D12292C657432A4457D8FEBA4E605FD1D528F2ED51C972831
4CB7A88AF1088B303598ED0BFDF520755E683F2267C50A0770AF901A7C4F830D
AAE9691172D8CADBAB44276AEB5BFE3D60B23807BE33B7318B0F31D9D1ADE720
670BC376989C51255259FE3231B842A200051006831B65AE59CA723A3E958FDF
0B10CBC82E0184DA8FE9D172B76AF9472BEA2794FC1A4D6D256AD61A9951C388
09115F42846C880AE0DA6B0C719BDA2773306957F2C46695104D436C27CC0F5E
FDDBCF9AF99A8E94D7057E10410BCA5C8871CCF35F6640BC5EFF590C3528CA0A
2B754DC5219EB8A95B33FB15698157565102FDA281A7C32C65FF594892ED419B
0EE181A5535E3CAD898C9911A1CEF440A38301D930E534B6BE1142F214456CA0
6B63D5F854E389C5CAB3C52713004004606CEB24ECD9630330F7DDED6E3CFD05
E058904B16B3F198EB4A727DE5C24FF496D081A4F149244A9E9A563FA271EA72
CE24AA04328A612060B88F2ADDCB21B1843B5B8CA7F1521B1D503787A9742FD0
22C0A7EDD92849E87CD6732D753232392CB0CDE9DB9CC77641F8215EC7C7FB10
202045EFAB63262F1F21C459A294628886C0D5A677ED6EDF183E92BA7A311456
3F543B8E3032442269A1474114371F25E7411B3CBB9B1397B2CC7C193C0E0264
E21FCFA9BC47115422E28D0033F20F9B898CEEE6A1507EB81E54427E2024C67D
24DE610ED650D41FD7618201FA16DFB017890E2E0C5AF82216FC043D3DB21F29
44748E3BEC5E5049AAB86DFB85AB9F891C2C564D7227C4F9A05B4C8F5CE44BB5
5524183F6CC7BAD349D94C3C40A22F074F731DCC986D475772005074BFCE608D
BDB002FBD772517D4B43A534081DB7B95AF23D84CF395376D8F9BD6A7B0AD7CC
F9876E644B9CE1D0ACA576A749FBC65A6F56E625D9891096C319C0C355E8518D
C708F6F9F17514C8C5543E8CABEF72B3E5AB01BC676632D2AF90A593346735F1
446C775B2972E52632DA18869784D610890589D9E899CD9BC98641AFF1506352
845E206C10FDBE99462B273231986D5E9C74F9B747F5378B7E294B14AC65D35E
79CF4F095347A0EBEAE012D2BFB30BD241141B9F1FD70776E4CA993E7ACFCA53
3B2CEC09393E72082FCEF5AEC847861C42B498C6F68B14620C4E3FE298C67234
B9D05A74945CA5C549CC1169DAB2614D0F0FE3209B1D063FBD53DFB97EC0E40F
F398B9A3363B6DE30E47726496A6B2DE2FBD8341C3F7FF2FC20C3589ADAD353B
5CAB95C83A62AD97341C39276F3FB20756EC51464EE631F9DDC50D6AC8BE2482
5E5341EC76366A610E36E9276893FBF05E7E0FFDDBBA50A13FE23F97700C7CA8
A8DC0EC182378399ED1ACC44868D4E3A5FF4E7E9D9FB84AA72E868097CFAACB6
9218465A00019D5D10A41AD270539F2757516DF0DE79ECE5AA4C90603C4C40E3
D1B57ACB536CD43148EB7389D7D2139BFC287A5D63A89F8D2BA1BA2EB7F6A7A1
A42472571FEA3C655856A6207D6F48EDF7BD0EDCC0A6E118E43DCA4870431C54
02B9F9D6DC7E7D82526BB50A15BE15619366AD054AD489EF0E8C812DB50134F7
F36D356D7B8AF6BA016D0A683FA662CE2809037915A9200893D352CEE4A8A539
F4DF1320F72585E59943F6A3EE2CBC2E020C17F5391E1045B190CAEF1C0297DE
45F87701542146D953F99FE0E6A23FC4FB081C8A2A3A89F2028F51DFEE278D98
2FFAB44AA4122E8175074BCA6928252D4147F8A7115161D512DB3410F1762CAF
16211C8FFD8C082F292D7944D508F2BA2FA7AFE471B35BA4B933B6E6E2DA4107
81A9737C42DE3D56E55C002D83190D893743A3A2200D5B43F7E10F8B4735EEAA
C5F911660F1C172CC1E5C4036098C0AFE71958B01FC261C70DC2C4BAE0A25254
DEF0801BEF762156E673B69D359962F482E79EF5EC599D1B800E6111576DD289
3D88CBA03D849DA14E865EDD612E34561ED626EE51BE0B7EBD995FEC2DCD1E1D
1D13FD1EF101E572B732D69961D91E0130CBCB1D0F79AE3E5AB68E11E0B208CF
2B11BEA9FAD42C67E63E35BE7E410D1725B1DD3532CC7F4730EDF325AB77C0F7
93F39B4D89CA618FC6964C5EB58128DF2BF997000BF3A43341FADBD1FA6A577F
B86018A21665D509AE01E02B73B36FA0BF1A434809512D70ED1231A49FDF5C17
8A859F63E1C726069232DD0C4E6F9AD64BD7199AD19F14B360D906F40093B84B
9B52A33F36D146E2B5264E53A41745DA30BD649E8CDF2B0871887996BD22D025
8A4F8CAA6EE7D67E4E36D900DF0B8F31B5A1B10893CCA13A23734A2F6FD654D6
0E1C9B0A73D59EE66DDE4E8F0C9FE805BF4AEC6F54F25AE66113BCBAE85FA720
1322EA828073DC235AF729562F888A349D6C5D40CAFB28C495D8BDAAA8E93C4A
4DF630094A7BCEC8C63F1BAA8F28F1BB4BFE28C30C5CABDC6DF2A31B246D3840
C3642A683A551D3E605F0635773FF926F37B3017F75CF70E1C02B335DF9BB2B6
25A634897D331FC1A3C23050EC25AC7B68B77BDF239DD2263DCA7893DA7EE147
2842626C81FA4E487BE92876563211F4BF13B27BF3040021E09C9EBE30B1E342
86E128E15C2AB17A47C10164862A4286B0B5164F43D9055E18E003A96BC41F52
8E8EA4B37C0475510AFC513707D649527468E0D6843196AB2CD65B59967B956C
95B2F98CBBEF2B900C65F581A1A4C273C1626131653C2CB2E78152ECCD8F2BBE
C6F6B99EE6958C92B1C4B555AFFE911BBEAC9A2AF10BC8EBF41C2FA6929F414C
CF5088B60DC6F3CDFECDC1169687333E8E42D2E756995DE5EFDC7F1F21B63627
14AF8CD7B1EA7C84256332F6D2231BE5D6FAE80379CB0132A4BEB397A4D27375
71D9B6AC8D466E408CED3A3C8D73E078BFE44EFE531433E41250752711EE6B99
B6C5A8FA6CFAA3F858806A58D06681E8191C02A1555BA9A45FCECD26B6E7A4EA
FD38B456CE576063E87567B9AB3BD3114220E4B4D24B3CCE8BFF26A01A658D96
50A133E9AE039A6D39EAB0993ACBE8F71C60DEE0A25CADB02B1550C4E5F5406E
238DDA885BCAFA01739AC40559A1FEC332706D9D1DBFE7B7AF9F2F6FB86F9706
610809706FD7C80F35BBE8252E5E4A978683505F15E2AFF2F5A69F33581133A8
5F261E686A495B74F7F6BEBE0ED509F0B0FEB387E632195B203ADCAA21FD6405
B4634EFAAFCC5C5E859E82B7E52FD3B1AAE99898EE6622E40217BF98695468C2
0E4703C8862208692C12C884AA8D65CD47FE385782F49E12FCCFFECB31125895
A2AD4D9D20B7287ACB9180BD15B1657F95E80C324E68647E3D7B95F7F07FC917
30210543C3851FC1E264A1CD1ED95D21AA479B12BCC9B74E9938FE33B4FD1A5C
04AE0031D88D0DE723F56B21237F0D20BB40E0BEBF7D62152B541118B7EB9E0D
EFB1DB53B3E4AA0680EEF6BC021748D23969EF9E711D95159A4271222F0433EF
720E615CC7BF47E7E401512C39F84D873629D6964CC045B4FC422A56B0CEB142
9CB1A2CF6EBE92B74B6A1D1CC7BCBBA9E50EB527F0186B1846E12384CCECE5EC
335C4F2E7941E4793C63CF6DFBF5AB7C1286CED77D135BA8D1CD4C6D2BCEE104
1570DFAA5ED9AB7778DBD2DE652B8038B5C2AEF8BE93CA80CA0ECD571E0BA9D7
CC8614D176B178FB8C51F170017C70BCB01F28805B4053D0DC933A5A1420C27C
88897D7D4A7029685F6C0F9F255CDBFB6CED05607A0A3A8116D61D96A31BEF71
5397FC32D6A9B198B085D796FB330791085AAA33AF6D1349F5C93243E37797EE
C3458787AA6EAC5753110237D8CDF153EA4ECF5FBBFFF4098A5A9E64E65E244C
04F61511784F0E0524437209C2873143D9C87EEE272A852FF3AD554BC094C156
4E6FD0F69124B074E1977DAF7AB3AA7914B64578C99A925818F6D54E5BDD53E2
2A6A786087EF436909DAC86CB8F4CD595996FA03DDF2833BF1485C9611DC0ACD
7366EAEB31F718FD569F1EA3D772945D347771B175D3B488D5F12587A2B91211
0D5F37EE9FDBBCF9DFA3F7E104F53D80886AFEDF48F0449192EBEF6036278AC8
9002DE452516EA28C9F3286D42DAA0F78A1B4BFAC7EC35D7E45A99AC66111052
1AA6A6CA1FA68284997CF7A7674E43B40261177AA982657A7448C1F1DB05DBB8
CFAE02FFD09F584D1B0B29E1F3FB7DC908021E0B854EBADAD8A833605FFFD1C9
5D1A6C2E8CD3EAE89BEE21B3E9622398B610223ED6733D5C30DD37362324F2FB
C764FCFDBE7B7EFB247A618016BD74BFD1C39420F6D33FFA6154898B62AB0444
8B049117E5452A5B84CE45F48389B7AA696F3B194C04EEFA9CD79E1ACA160699
9E5F7DE8027195E2559D0FA4A59A70CE1266B69F422FB62EC102482620FA09C6
1B85E545596D226545AC83C89B941A3FA95B0704EA34C4E9FFF8917F1A611E8E
0C9F8A4A8A3F3E9DFB2D3C34EFBAD3C6218B8624EDD9F77E7FA30A8A080EF8A3
F360D8671D0692EB118A3E83C7140CC161E5E0011CC15073E9B30894354973AA
BAC1DFF1C0889CFF50CF070A806CCA9B4A869E5E15EB345E5686764B142F6B2A
F198443420B930CFD9441720C9BC3A17CF6FCB40ABE90EB198DB21259D402F03
DE7C84D3BD01E9800348EF8F0B5DCC76D45E7E0869846CAEAF5535EFC15D5D32
9BDF9869FA715C14639A3DCA72FD34024C89A2363A7C7F18210CA9BC5A75CDE3
4C2E98737682AE6D20C37220947D5707071FB50C5077439B38795D64BD1530EA
A3DA77C2D4C39AE44697950B5587D026167856859E679AB44776932D84E00225
34822AD977566481DEB69B6D71FF394C744492443B0BC7E4201807684082B69F
5D0973DAEF0167AFDCFA7C019EFA4FDEACB014B263EA6B5C8A14FE2ABE63516E
A02EFE7B3BC3F7FFAC46725125D0C0DABEF697E9B2FC9017EA707242073D8C50
46EAF3A89F2806D16B330AB73D64CB38399BBA1480B6DC038270A34B8B16FB6C
F998C2901B8BE47FC0B3B30B352A436A3322948C97BB47741F4BBB3D9ED51A33
E7005E22474EEF660E9AC247987008748F0B20A2F6EC487910B8F10AE20FDC51
BE59F58EB10033CD563F1B24665EA7DD179708813390224241849C02DBE44F57
EE17A22728C030B95AB5D8BDE385CE9E878E94FF2886C88FFF45E41F0FD783D7
2A4BD1C6CE2353737DD9272C52DA8AA91D152BA16996484B31E0EF9741D43FF8
9D4AE17847BF44A2A2EF04252FF904CF2F1FC0AE43BF8DFCB3D9035C2F11D359
8AB2B94E53FAF40580542230648069C84E9475BC330FDA951A9DE4FB350EEEC9
039BAC59746AE6E527C19DA1D5E81F1CB5D775FAE7326131D34A5D7BCAD1DD6E
744241BB355593A364F8FFC50244911C2FF6932987CF49AC282F0618800DF652
A396847B441024CE3B634BCB505B9CBAFC44204A980D4B9EB516F4BD166BB91D
FA4AF61DDB4D94A4A23A727F687A801FCCC9CC81D93C64534259B2D74163441C
70EFFCA0952EA5E9D977E965FBD2B931C78FD9F1727B82EE6EC5C3E5B1FA954C
CE1624EBAFF6AF08DC4026D98CAEC116A4CA76CE7679B7683B323887A201CBE8
3E08BDAE20E9813D26F7B50CFFFB608794B3E557212102106CF8862EFB170D0E
9E90D5EF3E1EF3DCBF21BE27F70E527FDBA3C30DDDBC8BB319E62BCEA406F423
B4FF9683313CBC0430EC7CA8887AE2924BDA5E048DB731ED00E4E955B19DCA3E
57158330AE6D18A4047C22D0DCD86F1E5A6C02EBD19D39F81EB46BAF322C04D4
6101A50AB3C0A6FE0575F36EA3703C96A5E273AADF2E263922065F0D296939F0
B347FDF7DAE050A8C8C41D38DF5F951E7FF2D69BC5D17F6803774D7D795B8531
46BC1B2541ACF1435C00C033FF98658B2C0A3B0F45EF89B6B7C2B9220CCEEADA
73FD745AFF710B1BC5BA38906BBAC57DEDE11CE03F206269A0CF77FDF4252FEF
878EE755C56ED29CF4775948F0555714E9BDECD09CA84B4D7990DEB7B85D2C04
87287A6DC7F6AEAB9F6BF2CC06A1210B8B8405DF2CD29E6B36B767C950C0B8B3
236983F8CAC70ECB93C3E252A28EF16FC8430CA65DF2F42FB5698AC0922C9851
1AC47678E99535512247ABE19DF4729F9BCF62F9B155DE7B9201A095E5A456CB
539F469F2B7D22DE5CFD57613652B7A38CDA3ADAC7990F5EE0EDB7345F894628
13B1FAA7D73201D193F2F6B0E45E02D9391408C589C54DF99BD18E6BABD1946C
1DBDB2889E5085519A651EC6AAB38518F71767A6792036F8E1F5E7789A8C3BC3
294634D8682498A9E329A8DF7374E0A073439440FE90B551082AAC24C2F03423
52B89E03BBFA681942D97269117D4BEED5F97CD402569A152927C8E1F42DAA04
0126AA3E1B323368C16ED5F16EF7DDAC6B7CE493ACFA102128D1FE73AC927B44
C4D5DE39D8919E1909A69B603EB73CF6B3EFD8503FCF03CF5550825D4D39FCA3
19065E067C1663A930E50196D34307682B75F07733325F280C30FFF4E895F266
CF553133A0D31CE4F7E88E4AE2D3F55FA72802D8DD04D7F02495B3D43048626C
2C7020FBEBAB25364ADB70EE16C22C0C9CBCF1281872B5E23AE3688B17E5E0A7
F38E12C07B9955BC6019786C9CF65D9A4E8EE5C273092DEAF97A92E5AC04D250
1FA1799A112808F4E041C2E6B3DB25495F690C5E6D9EC0D529E23C28A6317F01
B283DE471016E9587C6105C862984C7653A3B445C9CAD1C5D8F6E4068ED15C59
4E16BD6572345A4B94AC1234A0CB46B543D15ECB9B3B11909E32BAEB53E13834
96FCFC4482455BF5B847EFD142C2716FF6E6A5DCC9A568BFA9D0ECB2FF815B85
175EE958D523C7F8C95D79DAB5FF776BDE102AB7DF6C81EFD51B9CF9C47DEA99
42079BF3EA4C1F8C6D4950EB0F16FA591C5463A006FB6B9C07B699B39FEB8ACD
06861753F64845934A846336B5F70C92E43D3625AD4B6E2D5E106B127C8E9155
65130F0481F3B522F96386B06F90E4848BDEC9B034E2FD70467555F719E2DAFF
7541D1678F9D33CBA501AE4AA5B37071E304FB5B4E5E8E4F242AB00C52CFF06E
77F323F785D42F5727EB0EB4267CF4B43C45CC3F5F898DF6E47DF1E3BCDFA32C
6354FF10AF2AFA95ACC0C87FD5649A4C311FFB7CF17AEDF22186A6927A08CCA4
DF4A339412E323B07EC6A29532AF771E3CE5C39BD173B82207DF1F87E55B969E
FFFD59A78695DFA711BC20DF71CA13955452854F8378808AD167BECB7470D5BD
217212DCB886B5295FAD290139AA6559380056949AFE444F7C5DBE44E7804EB6
A075697F7A69EA42147ACF1AB84084DE5EA5FFB355A927B77DC646970275A9FF
05FB84C9B2D2F52AE30FE5B7E35832991F159A419528B2CA39BBCD8F215D54A8
B8C5CD777CB7FAAF086A5C06D4FB8B157E72E42CA9C0E109BD2270CF91BA8678
1C9BEF2E8E0F54EBE69E9DBD5D7C20BD9FCC22E782FC9D9EDC420DA1914A158A
AB60234B944D4B534F57E11ABB32F481305CF2FCC696BD46F519C22C25A89DE6
BC97294D816FC09276506BE4D69A89F99DC2DCE7CA9315FFD818BBCCFE39BBB6
DB2E31FEA52729EA00495AE1EBFB32A737EB9127EF513F28869DA91E5779F90D
C8342F9243D645DC86F28DDA99791BD54FE9CA2479446F2F25EB82A40F006F6C
DBB7A98B407C16D196EE9B65351BE795693D86D234B38E2566CBF0263D9C13BD
87EFD910F953AB4CDA2CA351B74B30FBE79AFB86BBEC212E0DB9661F24A8E3D0
81CDCF04D8323B4FEF99FEF72FEDF9EF6C2F8022585CF6CEBED03C0BBF7A58D4
0B4D72B27E15EC0A20C960A20D0D63606517BBE8D7D72D31A30F583F64B97226
B0D0EB7EC9BD7E99FA18CDE8B37663AB5558924AFC8AE0A429E435B79A6CFAD7
A51970C7DD68505BA2FF91F7B1EE86FAACDBD10A50B7F928ED31743FAF44624D
D20FCA7D7FEB5A56D8DFD78D89AD89FA8D5D98F216CCB974A845545CD2276878
0B5F184BDEF71ABAB21B71360448F6BA9B4C6F8A3B609DEA24675A11CCC78EDA
E3D094540F18F1DADF7E311F774CD06893C0486C57E56462E1C7777C5D09F747
6EDFD5EA99D1B7DF40D116A270DDAE87057CBF78E1F09144A20CB2F2DD5EA497
8C2F38B0C013AC73FC48FD1EB6FA4E0FAD127EB8E9421F36F0DF10E71FB2E475
FFE72569A67E84929378F4146E2EB7893667990CE96BB85B995F1181888D3325
2B9287DB524600D8592F71F0F3B2BB792A041D0E9CA93D63871E2C6B2A4E1DB6
B6E0E528C594A75BD3F51A41572E753F364EEDC58E6317DDABD4F1F53416D466
EFBCB92A7E82CB34DC62643AB6928A7C0A6E54DC5730CC8DC6C70B53FA3DCEC2
CB11D40721D7479D8C28C385D957BE8E3FFF199519FB11B22B54C2BB7AD40D9C
214E22C93EEE97512014DE402097DF8D93579E91B995A24C89B2DB3FCDF2A2A2
0799F032623EB41A74DAF015ADC00957421DFF0C8FE0A63435C22E8FA8A4E10A
F536E242654948423E11AC20D90A1438F0AE8210996863C01D45507A0CFE3446
65DE4EF3EE70260C581F499F89FCC79F0590AB0DF78FA693DBC7F577B061A058
02E3D3893ED18F8CEA394D943AE99F4A551129D46CC80805E00B6AA7F138C08A
1B111224F228C18966F0786716AE6F23C706AF10A364526105E290C4BB222220
5D62147BD31BD973CE00B21FC890E405F6E05271FF249AB82E86715F5570D78F
AE61E3098253D4703AA38201A0DC339FE12AF47B2886D6
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
cleartomark
%%EndResource
/F10_0 /LTWFJF+OurCharSet 1 1
[ /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
  /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
  /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
  /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
  /space/exclam/quotedbl/numbersign/dollar/percent/ampersand/quoteright
  /parenleft/parenright/asterisk/plus/comma/minus/period/slash
  /zero/one/two/three/four/five/six/seven
  /eight/nine/colon/semicolon/less/equal/greater/question
  /at/A/B/C/D/E/F/G
  /H/I/J/K/L/M/N/O
  /P/Q/R/S/T/U/V/W
  /X/Y/Z/bracketleft/backslash/bracketright/asciicircum/underscore
  /quoteleft/a/b/c/d/e/f/g
  /h/i/j/k/l/m/n/o
  /p/q/r/s/t/u/v/w
  /x/y/z/braceleft/bar/braceright/asciitilde/.notdef
  /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
  /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
  /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
  /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
  /.notdef/exclamdown/cent/sterling/fraction/yen/florin/section
  /currency/quotesingle/quotedblleft/guillemotleft/guilsinglleft/guilsinglright/fi/fl
  /.notdef/endash/dagger/daggerdbl/periodcentered/.notdef/paragraph/bullet
  /quotesinglbase/quotedblbase/quotedblright/guillemotright/ellipsis/perthousand/.notdef/questiondown
  /.notdef/grave/acute/circumflex/tilde/macron/breve/dotaccent
  /dieresis/.notdef/ring/cedilla/.notdef/hungarumlaut/ogonek/caron
  /emdash/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
  /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
  /.notdef/AE/.notdef/ordfeminine/.notdef/.notdef/.notdef/.notdef
  /Lslash/Oslash/OE/ordmasculine/.notdef/.notdef/.notdef/.notdef
  /.notdef/ae/.notdef/.notdef/.notdef/dotlessi/.notdef/.notdef
  /lslash/oslash/oe/germandbls/.notdef/.notdef/.notdef/.notdef]
pdfMakeFont
612 792 false pdfSetup
%%EndSetup
%%Page: 1 1
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  README  Page 1) 19.866 Tj
0 -3.92728 Td
(xv6 is a re-implementation of Dennis Ritchie's and Ken Thompson's Unix) 42.14 Tj
0 -5.23637 Td
(Version 6 \(v6\).  xv6 loosely follows the structure and style of v6,) 40.334 Tj
0 -6.54546 Td
(but is implemented for a modern x86-based multiprocessor using ANSI C.) 42.14 Tj
0 -9.16364 Td
(ACKNOWLEDGEMENTS) 9.632 Tj
0 -11.7818 Td
(xv6 is inspired by John Lions' Commentary on UNIX 6th Edition \(Peer) 40.334 Tj
0 -13.0909 Td
(to Peer Communications; ISBN: 1-57398-013-7; 1st edition \(June 14,) 39.732 Tj
0 -14.4 Td
(2000\)\). See also http://pdos.csail.mit.edu/6.828/2006/v6.html, which) 40.936 Tj
0 -15.7091 Td
(provides pointers to on-line resources for v6.) 27.692 Tj
0 -18.3273 Td
(xv6 borrows code from the following sources:) 26.488 Tj
2.40798 -19.6364 Td
(JOS \(asm.h, elf.h, mmu.h, bootasm.S, ide.c, console.c, and others\)) 39.732 Tj
2.40798 -20.9455 Td
(Plan 9 \(bootother.S, mp.h, mp.c, ioapic.h, lapic.c\)) 30.702 Tj
2.40798 -22.2546 Td
(FreeBSD \(ioapic.c\)) 10.836 Tj
2.40798 -23.5636 Td
(NetBSD \(console.c\)) 10.836 Tj
0 -26.1818 Td
(The following people made contributions:) 24.08 Tj
2.40798 -27.4909 Td
(Russ Cox \(context switching, locking\)) 22.274 Tj
2.40798 -28.8 Td
(Cliff Frey \(MP\)) 9.03 Tj
2.40798 -30.1091 Td
(Xiao Yu \(MP\)) 7.224 Tj
0 -32.7273 Td
(The code in the files that constitute xv6 are ) 27.692 Tj
0 -34.0364 Td
(Copyright 2006 Frans Kaashoek, Robert Morris, and Russ Cox.) 35.518 Tj
0 -36.6545 Td
(ERROR REPORTS) 7.826 Tj
0 -39.2727 Td
(If you spot errors or have suggestions for improvement, please send) 40.334 Tj
0 -40.5818 Td
(email to Frans Kaashoek and Robert Morris) 24.682 Tj
0 -41.8909 Td
(\({kaashoek,rtm}@csail.mit.edu\).  This version is the very first one,) 40.936 Tj
0 -43.2 Td
(so don't be surprised if there are errors or the code is unclear.) 39.13 Tj
0 -45.8182 Td
(BUIDLING AND RUNNING XV6) 14.448 Tj
0 -48.4364 Td
(To build xv6 on an x86 ELF machine \(like Linux or FreeBSD\), run "make".) 42.742 Tj
0 -49.7454 Td
(On non-x86 or non-ELF machines \(like OS X, even on x86\), you will) 39.13 Tj
0 -51.0545 Td
(need to install a cross-compiler gcc suite capable of producing x86 ELF) 42.742 Tj
0 -52.3636 Td
(binaries.  See http://pdos.csail.mit.edu/6.828/2006/tools.html.) 37.926 Tj
0 -53.6727 Td
(Then run "make TOOLPREFIX=i386-jos-elf-".) 24.682 Tj
0 -56.2909 Td
(To run xv6, you can use Bochs or QEMU, both PC simulators.  Bochs makes) 42.742 Tj
0 -57.6 Td
(debugging easier, but QEMU is much faster. ) 25.886 Tj
0 -58.9091 Td
(To run in Bochs, run "make bochs" and then type "c" at the bochs prompt.) 43.344 Tj
0 -60.2182 Td
(To run in QEMU, run "make qemu".  Both log the xv6 screen output to ) 40.936 Tj
0 -61.5272 Td
(standard output.) 9.632 Tj
0 -64.1454 Td
(To create a typeset version of the code, run "make xv6.pdf".) 36.12 Tj
0 -65.4545 Td
(This requires the "mpage" text formatting utility.) 30.1 Tj
0 -66.7636 Td
(See http://www.mesa.nl/pub/mpage/.) 20.468 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  table of contents  Page 1) 26.488 Tj
0 -3.92728 Td
(The numbers to the left of the file names in the table are sheet numbers.) 43.946 Tj
0 -5.23637 Td
(The source code has been printed in a double column format with fifty) 41.538 Tj
0 -6.54546 Td
(lines per column, giving one hundred lines per sheet \(or page\).) 37.926 Tj
0 -7.85455 Td
(Thus there is a convenient relationship between line numbers and sheet numbers.) 47.558 Tj
0 -13.0909 Td
(# basic headers) 9.03 Tj
14.4479 -13.0909 Td
(# processes) 6.622 Tj
28.8958 -13.0909 Td
(35 fs.h) 4.214 Tj
-0.0001 -14.4 Td
(01 types.h) 6.02 Tj
14.4478 -14.4 Td
(19 proc.h) 5.418 Tj
28.8957 -14.4 Td
(36 fsvar.h) 6.02 Tj
-0.0002 -15.7091 Td
(01 param.h) 6.02 Tj
14.4477 -15.7091 Td
(20 proc.c) 5.418 Tj
28.8956 -15.7091 Td
(37 ide.c) 4.816 Tj
-0.0003 -17.0182 Td
(02 defs.h) 5.418 Tj
14.4476 -17.0182 Td
(25 setjmp.S) 6.622 Tj
28.8955 -17.0182 Td
(39 bio.c) 4.816 Tj
-0.0004 -18.3273 Td
(03 x86.h) 4.816 Tj
14.4475 -18.3273 Td
(25 kalloc.c) 6.622 Tj
28.8954 -18.3273 Td
(40 fs.c) 4.214 Tj
-0.0005 -19.6364 Td
(05 asm.h) 4.816 Tj
28.8954 -19.6364 Td
(49 file.c) 5.418 Tj
-0.0005 -20.9455 Td
(06 mmu.h) 4.816 Tj
14.4474 -20.9455 Td
(# system calls) 8.428 Tj
28.8953 -20.9455 Td
(51 sysfile.c) 7.224 Tj
-0.0006 -22.2545 Td
(08 elf.h) 4.816 Tj
14.4473 -22.2545 Td
(27 syscall.h) 7.224 Tj
-0.0006 -23.5636 Td
(08 mp.h) 4.214 Tj
14.4473 -23.5636 Td
(27 trapasm.S) 7.224 Tj
28.8952 -23.5636 Td
(# pipes) 4.214 Tj
14.4473 -24.8727 Td
(28 traps.h) 6.02 Tj
28.8952 -24.8727 Td
(56 pipe.c) 5.418 Tj
-0.0007 -26.1818 Td
(# startup) 5.418 Tj
14.4472 -26.1818 Td
(28 trap.c) 5.418 Tj
-0.0007 -27.4909 Td
(10 bootasm.S) 7.224 Tj
14.4472 -27.4909 Td
(29 vectors.pl) 7.826 Tj
28.8951 -27.4909 Td
(# string operations) 11.438 Tj
-0.0008 -28.8 Td
(11 bootother.S) 8.428 Tj
14.4471 -28.8 Td
(30 syscall.c) 7.224 Tj
28.895 -28.8 Td
(57 string.c) 6.622 Tj
-0.0009 -30.1091 Td
(12 main.c) 5.418 Tj
14.447 -30.1091 Td
(32 sysproc.c) 7.224 Tj
-0.0009 -31.4182 Td
(14 mp.c) 4.214 Tj
28.895 -31.4182 Td
(# low-level PC) 8.428 Tj
-0.0009 -32.7273 Td
(16 init.c) 5.418 Tj
14.447 -32.7273 Td
(# file system) 7.826 Tj
28.8949 -32.7273 Td
(58 ioapic.h) 6.622 Tj
14.447 -34.0364 Td
(33 buf.h) 4.816 Tj
28.8949 -34.0364 Td
(59 lapic.c) 6.02 Tj
-0.001 -35.3454 Td
(# locks) 4.214 Tj
14.4469 -35.3454 Td
(33 dev.h) 4.816 Tj
28.8948 -35.3454 Td
(62 ioapic.c) 6.622 Tj
-0.0011 -36.6545 Td
(17 spinlock.h) 7.826 Tj
14.4468 -36.6545 Td
(34 fcntl.h) 6.02 Tj
28.8947 -36.6545 Td
(63 picirq.c) 6.622 Tj
-0.0012 -37.9636 Td
(17 spinlock.c) 7.826 Tj
14.4467 -37.9636 Td
(34 stat.h) 5.418 Tj
28.8946 -37.9636 Td
(64 console.c) 7.224 Tj
14.4467 -39.2727 Td
(35 file.h) 5.418 Tj
28.8946 -39.2727 Td
(68 8253pit.c) 7.224 Tj
-0.0013 -44.5091 Td
(The source listing is preceded by a cross-reference that lists every defined ) 46.354 Tj
-0.0013 -45.8182 Td
(constant, struct, global variable, and function in xv6.  Each entry gives,) 44.548 Tj
-0.0013 -47.1273 Td
(on the same line as the name, the line number \(or, in a few cases, numbers\)) 45.15 Tj
-0.0013 -48.4363 Td
(where the name is defined.  Successive lines in an entry list the line) 42.14 Tj
-0.0013 -49.7454 Td
(numbers where the name is used.  For example, this entry:) 34.314 Tj
2.40669 -52.3636 Td
(namei 4610) 6.02 Tj
4.81468 -53.6727 Td
(0333 4610 4709 4758) 11.438 Tj
4.81468 -54.9818 Td
(4808 4857 4866 5264) 11.438 Tj
4.81468 -56.2909 Td
(5277 5362 5410 5490) 11.438 Tj
-0.0013 -58.9091 Td
(indicates that namei is defined on line 4610 and is mentioned on twelve lines) 46.354 Tj
-0.0013 -60.2181 Td
(on sheets 03, 46, 47, 48, 52, 53, and 54.) 24.682 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 2 2
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  cross-references  Page 1) 25.886 Tj
0 -3.92728 Td
(acquire 1805) 7.224 Tj
24.0799 -3.92728 Td
(4533) 2.408 Tj
2.408 -5.23637 Td
(0282 1805 1808 2111) 11.438 Tj
21.6719 -5.23637 Td
(B_BUSY 3308) 6.622 Tj
2.408 -6.54546 Td
(2215 2272 2313 2320) 11.438 Tj
24.0799 -6.54546 Td
(3308 3904 3905 3907) 11.438 Tj
2.408 -7.85455 Td
(2335 2355 2368 2403) 11.438 Tj
24.0799 -7.85455 Td
(3921 3923 3973 3978) 11.438 Tj
2.408 -9.16364 Td
(2431 2619 2667 3791) 11.438 Tj
24.0799 -9.16364 Td
(3981 3988 3989 4021) 11.438 Tj
2.408 -10.4727 Td
(3833 3969 4035 4190) 11.438 Tj
24.0799 -10.4727 Td
(4032 4044) 5.418 Tj
2.408 -11.7818 Td
(4327 4359 4442 4930) 11.438 Tj
21.6719 -11.7818 Td
(bfree 4152) 6.02 Tj
2.408 -13.0909 Td
(5004 5054 5663 5684) 11.438 Tj
24.0799 -13.0909 Td
(4152 4414 4420) 8.428 Tj
2.408 -14.4 Td
(5710 6509 6578 6747) 11.438 Tj
21.6719 -14.4 Td
(bget 3965) 5.418 Tj
2.408 -15.7091 Td
(6812) 2.408 Tj
24.0799 -15.7091 Td
(3908 3965 3996 4006) 11.438 Tj
0 -17.0182 Td
(allocproc 2080) 8.428 Tj
21.6719 -17.0182 Td
(binit 3944) 6.02 Tj
2.408 -18.3273 Td
(2080 2112) 5.418 Tj
24.0799 -18.3273 Td
(0316 1251 3944) 8.428 Tj
7.10543e-15 -19.6364 Td
(APBOOTCODE 1603) 9.03 Tj
21.6719 -19.6364 Td
(bmap 4369) 5.418 Tj
2.408 -20.9455 Td
(1603 1612 1621 1624) 11.438 Tj
24.0799 -20.9455 Td
(4369 4376 4380 4383) 11.438 Tj
2.408 -22.2545 Td
(1627) 2.408 Tj
24.0799 -22.2545 Td
(4389 4495 4572 4574) 11.438 Tj
1.42109e-14 -23.5636 Td
(APIC_ID_CLUSTER 5856) 12.04 Tj
24.0799 -23.5636 Td
(4664) 2.408 Tj
2.408 -24.8727 Td
(5856) 2.408 Tj
21.6719 -24.8727 Td
(bread 4002) 6.02 Tj
7.10543e-15 -26.1818 Td
(APIC_ID_CLUSTER_ID 5857) 13.846 Tj
24.0799 -26.1818 Td
(0319 3913 4002 4112) 11.438 Tj
2.408 -27.4909 Td
(5857) 2.408 Tj
24.0799 -27.4909 Td
(4120 4160 4165 4170) 11.438 Tj
7.10543e-15 -28.8 Td
(APIC_ID_CLUSTER_SHIFT 5860) 15.652 Tj
24.0799 -28.8 Td
(4223 4258 4282 4288) 11.438 Tj
2.408 -30.1091 Td
(5860) 2.408 Tj
24.0799 -30.1091 Td
(4384 4410 4495 4530) 11.438 Tj
7.10543e-15 -31.4182 Td
(APIC_ID_MASK 5854) 10.234 Tj
24.0799 -31.4182 Td
(4572 4664) 5.418 Tj
2.408 -32.7273 Td
(5854 5898) 5.418 Tj
21.6719 -32.7273 Td
(brelse 4030) 6.622 Tj
0 -34.0364 Td
(APIC_ID_SHIFT 5855) 10.836 Tj
24.0799 -34.0364 Td
(0321 3920 3924 4030) 11.438 Tj
2.408 -35.3454 Td
(5855 6245 6282) 8.428 Tj
24.0799 -35.3454 Td
(4033 4119 4133 4163) 11.438 Tj
0 -36.6545 Td
(APIC_MAX_CLUSTER 5858) 12.642 Tj
24.0799 -36.6545 Td
(4168 4175 4231 4267) 11.438 Tj
2.408 -37.9636 Td
(5858) 2.408 Tj
24.0799 -37.9636 Td
(4285 4293 4303 4387) 11.438 Tj
0 -39.2727 Td
(APIC_MAX_INTRACLUSTER_ID 5859) 17.458 Tj
24.0799 -39.2727 Td
(4418 4502 4539 4575) 11.438 Tj
2.408 -40.5818 Td
(5859) 2.408 Tj
24.0799 -40.5818 Td
(4675 4680) 5.418 Tj
0 -41.8909 Td
(APIC_VER_MAXLVT 5864) 12.04 Tj
21.6719 -41.8909 Td
(BSIZE 3557) 6.02 Tj
2.408 -43.2 Td
(5864) 2.408 Tj
24.0799 -43.2 Td
(3557 3569 3587 3593) 11.438 Tj
7.10543e-15 -44.5091 Td
(APIC_VER_VERSION 5863) 12.642 Tj
24.0799 -44.5091 Td
(4166 4495 4497 4498) 11.438 Tj
2.408 -45.8182 Td
(5863) 2.408 Tj
24.0799 -45.8182 Td
(4564 4571 4573 4582) 11.438 Tj
7.10543e-15 -47.1272 Td
(argfd 5120) 6.02 Tj
24.0799 -47.1272 Td
(4663 4664 4666) 8.428 Tj
2.408 -48.4363 Td
(5120 5207 5219 5230) 11.438 Tj
21.6719 -48.4363 Td
(buf 3300) 4.816 Tj
2.408 -49.7454 Td
(5445 5456) 5.418 Tj
24.0799 -49.7454 Td
(0317 0318 0319 0320) 11.438 Tj
7.10543e-15 -51.0545 Td
(argint 3052) 6.622 Tj
24.0799 -51.0545 Td
(0321 3010 3210 3300) 11.438 Tj
2.408 -52.3636 Td
(0246 3052 3068 3084) 11.438 Tj
24.0799 -52.3636 Td
(3304 3305 3902 3904) 11.438 Tj
2.408 -53.6727 Td
(3246 3263 5126 5207) 11.438 Tj
24.0799 -53.6727 Td
(3906 3907 3913 3916) 11.438 Tj
2.408 -54.9818 Td
(5219 5260 5326 5327) 11.438 Tj
24.0799 -54.9818 Td
(3924 3933 3935 3941) 11.438 Tj
2.408 -56.2909 Td
(5487) 2.408 Tj
24.0799 -56.2909 Td
(3946 3953 3964 3967) 11.438 Tj
7.10543e-15 -57.6 Td
(argptr 3063) 6.622 Tj
24.0799 -57.6 Td
(3979 4000 4001 4004) 11.438 Tj
2.408 -58.9091 Td
(0247 3063 5174 5207) 11.438 Tj
24.0799 -58.9091 Td
(4016 4019 4028 4030) 11.438 Tj
2.408 -60.2181 Td
(5219 5445) 5.418 Tj
24.0799 -60.2181 Td
(4045 4058 4105 4154) 11.438 Tj
7.10543e-15 -61.5272 Td
(argstr 3081) 6.622 Tj
24.0799 -61.5272 Td
(4188 4255 4280 4373) 11.438 Tj
2.408 -62.8363 Td
(0248 3081 5260 5326) 11.438 Tj
24.0799 -62.8363 Td
(4405 4486 4512 4559) 11.438 Tj
2.408 -64.1454 Td
(5359 5407 5434 5469) 11.438 Tj
24.0799 -64.1454 Td
(4617 5110 6475 6488) 11.438 Tj
2.408 -65.4545 Td
(5487) 2.408 Tj
24.0799 -65.4545 Td
(6491 6494 6574 6581) 11.438 Tj
7.10543e-15 -66.7636 Td
(balloc 4102) 6.622 Tj
21.6719 -66.7636 Td
(bufhead 3941) 7.224 Tj
2.408 -68.0727 Td
(4102 4129 4518 4525) 11.438 Tj
24.0799 -68.0727 Td
(3939 3940 3941 3951) 11.438 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  cross-references  Page 2) 25.886 Tj
2.40799 -3.92728 Td
(3952 3954 3955 3956) 11.438 Tj
24.0799 -3.92728 Td
(1850 1854 1962 1972) 11.438 Tj
2.40799 -5.23637 Td
(3957 3972 3977 3987) 11.438 Tj
24.0799 -5.23637 Td
(2030 2061 2227 2229) 11.438 Tj
2.40799 -6.54546 Td
(4039 4040 4041 4042) 11.438 Tj
24.0799 -6.54546 Td
(2234 2251 2255 2259) 11.438 Tj
-1e-05 -7.85455 Td
(buf_table_lock 3936) 11.438 Tj
24.0799 -7.85455 Td
(2263 2270 2287 2305) 11.438 Tj
2.40799 -9.16364 Td
(3936 3948 3969 3979) 11.438 Tj
24.0799 -9.16364 Td
(2390 2428 2883 2902) 11.438 Tj
2.40799 -10.4727 Td
(3983 3992 4035 4047) 11.438 Tj
24.0799 -10.4727 Td
(2907 2932 2936 2938) 11.438 Tj
-1e-05 -11.7818 Td
(B_VALID 3309) 7.224 Tj
24.0799 -11.7818 Td
(2939 2944 2948 3054) 11.438 Tj
2.40799 -13.0909 Td
(3309 3904 3910 3912) 11.438 Tj
24.0799 -13.0909 Td
(3066 3086 3123 3222) 11.438 Tj
2.40799 -14.4 Td
(3973 3982 4007 4011) 11.438 Tj
24.0799 -14.4 Td
(3253 3261 4614 5124) 11.438 Tj
2.40799 -15.7091 Td
(4025) 2.408 Tj
24.0799 -15.7091 Td
(5156 5172 5232 5403) 11.438 Tj
-1e-05 -17.0182 Td
(bwrite 4019) 6.622 Tj
24.0799 -17.0182 Td
(5477 6151 6562) 8.428 Tj
2.40799 -18.3273 Td
(0320 3916 4019 4022) 11.438 Tj
21.6719 -18.3273 Td
(cpuid 0451) 6.02 Tj
2.40799 -19.6364 Td
(4132 4167 4174 4266) 11.438 Tj
24.0799 -19.6364 Td
(0451 0454 1315 1819) 11.438 Tj
2.40799 -20.9455 Td
(4302 4537 4574) 8.428 Tj
24.0799 -20.9455 Td
(1841) 2.408 Tj
-1e-05 -22.2545 Td
(cli 0479) 4.816 Tj
21.6719 -22.2545 Td
(devsw 3350) 6.02 Tj
2.40799 -23.5636 Td
(0479 0481 1022 1067) 11.438 Tj
24.0799 -23.5636 Td
(3350 3355 4489 4491) 11.438 Tj
2.40799 -24.8727 Td
(1122 1811 6436 6560) 11.438 Tj
24.0799 -24.8727 Td
(4555 4557 4914 6839) 11.438 Tj
-1e-05 -26.1818 Td
(cmpxchg 0468) 7.224 Tj
24.0799 -26.1818 Td
(6840) 2.408 Tj
2.40799 -27.4909 Td
(0468 1814) 5.418 Tj
21.6719 -27.4909 Td
(dinode 3573) 6.622 Tj
-1e-05 -28.8 Td
(CONSOLE 3357) 7.224 Tj
24.0799 -28.8 Td
(3573 3587 4187 4224) 11.438 Tj
2.40799 -30.1091 Td
(3357 6839 6840) 8.428 Tj
24.0799 -30.1091 Td
(4256 4259 4276 4289) 11.438 Tj
-1e-05 -31.4182 Td
(console_init 6834) 10.234 Tj
21.6719 -31.4182 Td
(dirent 3603) 6.622 Tj
2.40799 -32.7273 Td
(0206 1273 6834) 8.428 Tj
24.0799 -32.7273 Td
(3600 3603 4607 4618) 11.438 Tj
-1e-05 -34.0364 Td
(console_lock 6409) 10.234 Tj
24.0799 -34.0364 Td
(4665 4666 4719 4805) 11.438 Tj
2.40799 -35.3454 Td
(6409 6509 6551 6578) 11.438 Tj
24.0799 -35.3454 Td
(5356) 2.408 Tj
2.40799 -36.6545 Td
(6584 6836) 5.418 Tj
21.6719 -36.6545 Td
(DIRSIZ 3601) 6.622 Tj
-1e-05 -37.9636 Td
(console_read 6808) 10.234 Tj
24.0799 -37.9636 Td
(3601 3605 4660 4661) 11.438 Tj
2.40799 -39.2727 Td
(6808 6840) 5.418 Tj
24.0799 -39.2727 Td
(4671 4730 4732 5330) 11.438 Tj
-1e-05 -40.5818 Td
(console_write 6574) 10.836 Tj
24.0799 -40.5818 Td
(5375) 2.408 Tj
2.40799 -41.8909 Td
(6574 6839) 5.418 Tj
21.6719 -41.8909 Td
(disk_1_present 3737) 11.438 Tj
-1e-05 -43.2 Td
(cons_putc 6429) 8.428 Tj
24.0799 -43.2 Td
(3737 3762 3830) 8.428 Tj
2.40799 -44.5091 Td
(6429 6494 6518 6531) 11.438 Tj
21.6719 -44.5091 Td
(disk_queue 3738) 9.03 Tj
2.40799 -45.8182 Td
(6534 6539 6542 6543) 11.438 Tj
24.0799 -45.8182 Td
(3738 3837 3861) 8.428 Tj
2.40799 -47.1272 Td
(6581 6820) 5.418 Tj
21.6719 -47.1272 Td
(elfhdr 0805) 6.622 Tj
-1e-05 -48.4363 Td
(copyproc 2105) 7.826 Tj
24.0799 -48.4363 Td
(0805 1367 1370 5481) 11.438 Tj
2.40799 -49.7454 Td
(0215 1339 1345 1354) 11.438 Tj
21.6719 -49.7454 Td
(ELF_MAGIC 0802) 8.428 Tj
2.40799 -51.0545 Td
(2105 3222) 5.418 Tj
24.0799 -51.0545 Td
(0802 0806 1371 5497) 11.438 Tj
-1e-05 -52.3636 Td
(cprintf 6502) 7.224 Tj
21.6719 -52.3636 Td
(ELF_PROG_FLAG_EXEC 0839) 13.846 Tj
2.40799 -53.6727 Td
(0207 1244 1304 1573) 11.438 Tj
24.0799 -53.6727 Td
(0839) 2.408 Tj
2.40799 -54.9818 Td
(1575 2479 2588 2686) 11.438 Tj
21.6719 -54.9818 Td
(ELF_PROG_FLAG_READ 0841) 13.846 Tj
2.40799 -56.2909 Td
(2932 2938 2944 3186) 11.438 Tj
24.0799 -56.2909 Td
(0841) 2.408 Tj
2.40799 -57.6 Td
(4568 6247 6502 6562) 11.438 Tj
21.6719 -57.6 Td
(ELF_PROG_FLAG_WRITE 0840) 14.448 Tj
2.40799 -58.9091 Td
(6563 6564 6567 6786) 11.438 Tj
24.0799 -58.9091 Td
(0840) 2.408 Tj
-1e-05 -60.2181 Td
(cpu 1962 6151) 7.826 Tj
21.6719 -60.2181 Td
(ELF_PROG_LOAD 0836) 10.836 Tj
2.40799 -61.5272 Td
(0272 0277 1244 1289) 11.438 Tj
24.0799 -61.5272 Td
(0836 1379 5505 5572) 11.438 Tj
2.40799 -62.8363 Td
(1304 1306 1307 1308) 11.438 Tj
21.6719 -62.8363 Td
(fdalloc 5153) 7.224 Tj
2.40799 -64.1454 Td
(1316 1319 1431 1436) 11.438 Tj
24.0799 -64.1454 Td
(5153 5179 5290 5458) 11.438 Tj
2.40799 -65.4545 Td
(1616 1617 1629 1706) 11.438 Tj
21.6719 -65.4545 Td
(fetchint 3025) 7.826 Tj
2.40799 -66.7636 Td
(1767 1810 1812 1823) 11.438 Tj
24.0799 -66.7636 Td
(0244 3025 3056 5523) 11.438 Tj
2.40799 -68.0727 Td
(1824 1825 1837 1844) 11.438 Tj
24.0799 -68.0727 Td
(5553) 2.408 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 3 3
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  cross-references  Page 3) 25.886 Tj
0 -3.92728 Td
(fetchstr 3037) 7.826 Tj
24.0799 -3.92728 Td
(0611) 2.408 Tj
2.408 -5.23637 Td
(0245 3037 3086 5527) 11.438 Tj
21.6719 -5.23637 Td
(FL_ID 0624) 6.02 Tj
2.408 -6.54546 Td
(5554) 2.408 Tj
24.0799 -6.54546 Td
(0624) 2.408 Tj
0 -7.85455 Td
(file 3500) 5.418 Tj
21.6719 -7.85455 Td
(FL_IF 0610) 6.02 Tj
2.408 -9.16364 Td
(0292 0293 0300 0303) 11.438 Tj
24.0799 -9.16364 Td
(0610 0752 1351) 8.428 Tj
2.408 -10.4727 Td
(0304 0305 0306 0307) 11.438 Tj
21.6719 -10.4727 Td
(FL_IOPL_0 0614) 8.428 Tj
2.408 -11.7818 Td
(0308 0600 0800 1938) 11.438 Tj
24.0799 -11.7818 Td
(0614) 2.408 Tj
2.408 -13.0909 Td
(2004 2150 3014 3214) 11.438 Tj
21.6719 -13.0909 Td
(FL_IOPL_1 0615) 8.428 Tj
2.408 -14.4 Td
(3453 3454 3455 3500) 11.438 Tj
24.0799 -14.4 Td
(0615) 2.408 Tj
2.408 -15.7091 Td
(3550 3561 3577 3578) 11.438 Tj
21.6719 -15.7091 Td
(FL_IOPL_2 0616) 8.428 Tj
2.408 -17.0182 Td
(3600 3608 3650 4271) 11.438 Tj
24.0799 -17.0182 Td
(0616) 2.408 Tj
2.408 -18.3273 Td
(4308 4604 4907 4916) 11.438 Tj
21.6719 -18.3273 Td
(FL_IOPL_3 0617) 8.428 Tj
2.408 -19.6364 Td
(4924 4925 4932 4933) 11.438 Tj
24.0799 -19.6364 Td
(0617) 2.408 Tj
2.408 -20.9455 Td
(4934 4936 4950 4952) 11.438 Tj
21.6719 -20.9455 Td
(FL_IOPL_MASK 0613) 10.234 Tj
2.408 -22.2545 Td
(4972 4974 5000 5002) 11.438 Tj
24.0799 -22.2545 Td
(0613) 2.408 Tj
2.408 -23.5636 Td
(5010 5028 5030 5050) 11.438 Tj
21.6719 -23.5636 Td
(FL_NT 0618) 6.02 Tj
2.408 -24.8727 Td
(5052 5114 5117 5118) 11.438 Tj
24.0799 -24.8727 Td
(0618) 2.408 Tj
2.408 -26.1818 Td
(5120 5123 5150 5151) 11.438 Tj
21.6719 -26.1818 Td
(FL_OF 0612) 6.02 Tj
2.408 -27.4909 Td
(5153 5170 5203 5215) 11.438 Tj
24.0799 -27.4909 Td
(0612) 2.408 Tj
2.408 -28.8 Td
(5228 5257 5442 5453) 11.438 Tj
21.6719 -28.8 Td
(FL_PF 0605) 6.02 Tj
2.408 -30.1091 Td
(5606 5621 6415) 8.428 Tj
24.0799 -30.1091 Td
(0605) 2.408 Tj
7.10543e-15 -31.4182 Td
(filealloc 4926) 8.428 Tj
21.6719 -31.4182 Td
(FL_RF 0619) 6.02 Tj
2.408 -32.7273 Td
(0303 4926 5286 5626) 11.438 Tj
24.0799 -32.7273 Td
(0619) 2.408 Tj
2.408 -34.0364 Td
(5628) 2.408 Tj
21.6719 -34.0364 Td
(FL_SF 0608) 6.02 Tj
7.10543e-15 -35.3454 Td
(fileclose 5002) 8.428 Tj
24.0799 -35.3454 Td
(0608) 2.408 Tj
2.408 -36.6545 Td
(0304 2396 5002 5007) 11.438 Tj
21.6719 -36.6545 Td
(FL_TF 0609) 6.02 Tj
2.408 -37.9636 Td
(5021 5182 5183 5233) 11.438 Tj
24.0799 -37.9636 Td
(0609) 2.408 Tj
2.408 -39.2727 Td
(5292 5651 5655) 8.428 Tj
21.6719 -39.2727 Td
(FL_VIF 0622) 6.622 Tj
0 -40.5818 Td
(fileincref 5052) 9.03 Tj
24.0799 -40.5818 Td
(0622) 2.408 Tj
2.408 -41.8909 Td
(0308 2154 5052 5056) 11.438 Tj
21.6719 -41.8909 Td
(FL_VIP 0623) 6.622 Tj
2.408 -43.2 Td
(5460) 2.408 Tj
24.0799 -43.2 Td
(0623) 2.408 Tj
0 -44.5091 Td
(fileinit 4919) 7.826 Tj
21.6719 -44.5091 Td
(FL_VM 0620) 6.02 Tj
2.408 -45.8182 Td
(0302 1257 4919) 8.428 Tj
24.0799 -45.8182 Td
(0620) 2.408 Tj
7.10543e-15 -47.1272 Td
(fileread 4974) 7.826 Tj
21.6719 -47.1272 Td
(FL_ZF 0607) 6.02 Tj
2.408 -48.4363 Td
(0305 4974 4988 5221) 11.438 Tj
24.0799 -48.4363 Td
(0607) 2.408 Tj
1.42109e-14 -49.7454 Td
(filestat 5030) 7.826 Tj
21.6719 -49.7454 Td
(forkret 2281) 7.224 Tj
2.408 -51.0545 Td
(0307 5030 5447) 8.428 Tj
24.0799 -51.0545 Td
(2014 2145 2147 2281) 11.438 Tj
2.13163e-14 -52.3636 Td
(file_table_lock 4913) 12.04 Tj
21.6719 -52.3636 Td
(gatedesc 0728) 7.826 Tj
2.408 -53.6727 Td
(4913 4921 4930 4935) 11.438 Tj
24.0799 -53.6727 Td
(0414 0417 0728 2860) 11.438 Tj
2.408 -54.9818 Td
(4939 5004 5014 5024) 11.438 Tj
21.6719 -54.9818 Td
(getcallerpcs 1772) 10.234 Tj
2.408 -56.2909 Td
(5054 5058) 5.418 Tj
24.0799 -56.2909 Td
(0285 1772 1826 6565) 11.438 Tj
2.84217e-14 -57.6 Td
(filewrite 4952) 8.428 Tj
21.6719 -57.6 Td
(growproc 2059) 7.826 Tj
2.408 -58.9091 Td
(0306 4952 4967 5209) 11.438 Tj
24.0799 -58.9091 Td
(0217 2059 3265) 8.428 Tj
3.55271e-14 -60.2181 Td
(FL_AC 0621) 6.02 Tj
21.6719 -60.2181 Td
(holding 1852) 7.224 Tj
2.408 -61.5272 Td
(0621) 2.408 Tj
24.0799 -61.5272 Td
(0284 1706 1803 1807) 11.438 Tj
4.26326e-14 -62.8363 Td
(FL_AF 0606) 6.02 Tj
24.0799 -62.8363 Td
(1824 1833 1850 1852) 11.438 Tj
2.408 -64.1454 Td
(0606) 2.408 Tj
24.0799 -64.1454 Td
(2257 2283 3903) 8.428 Tj
4.26326e-14 -65.4545 Td
(FL_CF 0604) 6.02 Tj
21.6719 -65.4545 Td
(ialloc 4273) 6.622 Tj
2.408 -66.7636 Td
(0604) 2.408 Tj
24.0799 -66.7636 Td
(4273 4297 4776) 8.428 Tj
4.9738e-14 -68.0727 Td
(FL_DF 0611) 6.02 Tj
21.6719 -68.0727 Td
(IDE_BSY 3711) 7.224 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  cross-references  Page 4) 25.886 Tj
2.40799 -3.92728 Td
(3711 3748) 5.418 Tj
24.0799 -3.92728 Td
(1585 3748 3778 6421) 11.438 Tj
-1e-05 -5.23637 Td
(IDE_CMD_READ 3716) 10.234 Tj
24.0799 -5.23637 Td
(6445 6447 6750 6753) 11.438 Tj
2.40799 -6.54546 Td
(3716 3816) 5.418 Tj
21.6719 -6.54546 Td
(INDIRECT 3568) 7.826 Tj
-1e-05 -7.85455 Td
(IDE_CMD_WRITE 3717) 10.836 Tj
24.0799 -7.85455 Td
(3568 4382 4384 4409) 11.438 Tj
2.40799 -9.16364 Td
(3717 3818) 5.418 Tj
24.0799 -9.16364 Td
(4410 4524 4528 4530) 11.438 Tj
-1e-05 -10.4727 Td
(idecref 4453) 7.224 Tj
24.0799 -10.4727 Td
(4537) 2.408 Tj
2.40799 -11.7818 Td
(0330 2400 4453 4867) 11.438 Tj
21.6719 -11.7818 Td
(initlock 1763) 7.826 Tj
2.40799 -13.0909 Td
(4871 5019 5423) 8.428 Tj
24.0799 -13.0909 Td
(0281 1763 2020 2584) 11.438 Tj
-1e-05 -14.4 Td
(IDE_DF 3713) 6.622 Tj
24.0799 -14.4 Td
(3758 3948 4086 4921) 11.438 Tj
2.40799 -15.7091 Td
(3713 3750) 5.418 Tj
24.0799 -15.7091 Td
(5636 6836 6837) 8.428 Tj
-1e-05 -17.0182 Td
(IDE_DRDY 3712) 7.826 Tj
21.6719 -17.0182 Td
(inode 3652) 6.02 Tj
2.40799 -18.3273 Td
(3712 3748) 5.418 Tj
24.0799 -18.3273 Td
(0326 0327 0328 0329) 11.438 Tj
-1e-05 -19.6364 Td
(IDE_ERR 3714) 7.224 Tj
24.0799 -19.6364 Td
(0330 0331 0332 0333) 11.438 Tj
2.40799 -20.9455 Td
(3714 3750) 5.418 Tj
24.0799 -20.9455 Td
(0334 0335 0336 0337) 11.438 Tj
-1e-05 -22.2545 Td
(ide_init 3756) 7.826 Tj
24.0799 -22.2545 Td
(0338 0340 1939 3506) 11.438 Tj
2.40799 -23.5636 Td
(0311 1274 3756) 8.428 Tj
24.0799 -23.5636 Td
(3572 3577 3589 3652) 11.438 Tj
-1e-05 -24.8727 Td
(ide_intr 3789) 7.826 Tj
24.0799 -24.8727 Td
(3656 3658 4063 4064) 11.438 Tj
2.40799 -26.1818 Td
(0312 2922 3789) 8.428 Tj
24.0799 -26.1818 Td
(4066 4068 4072 4074) 11.438 Tj
-1e-05 -27.4909 Td
(ide_lock 3735) 7.826 Tj
24.0799 -27.4909 Td
(4076 4078 4178 4179) 11.438 Tj
2.40799 -28.8 Td
(3723 3735 3758 3791) 11.438 Tj
24.0799 -28.8 Td
(4181 4183 4186 4194) 11.438 Tj
2.40799 -30.1091 Td
(3793 3833 3837 3851) 11.438 Tj
24.0799 -30.1091 Td
(4199 4200 4250 4253) 11.438 Tj
2.40799 -31.4182 Td
(3867) 2.408 Tj
24.0799 -31.4182 Td
(4270 4272 4275 4287) 11.438 Tj
-1e-05 -32.7273 Td
(ide_probe_disk1 3767) 12.04 Tj
24.0799 -32.7273 Td
(4290 4308 4310 4316) 11.438 Tj
2.40799 -34.0364 Td
(3740 3762 3767) 8.428 Tj
24.0799 -34.0364 Td
(4322 4354 4367 4369) 11.438 Tj
-1e-05 -35.3454 Td
(ide_request 3725) 9.632 Tj
24.0799 -35.3454 Td
(4400 4402 4432 4453) 11.438 Tj
2.40799 -36.6545 Td
(3725 3733 3804 3828) 11.438 Tj
24.0799 -36.6545 Td
(4461 4468 4470 4481) 11.438 Tj
-1e-05 -37.9636 Td
(ide_rw 3826) 6.622 Tj
24.0799 -37.9636 Td
(4483 4508 4510 4550) 11.438 Tj
2.40799 -39.2727 Td
(0313 3826 4010 4024) 11.438 Tj
24.0799 -39.2727 Td
(4552 4601 4602 4607) 11.438 Tj
-1e-05 -40.5818 Td
(ide_wait_ready 3744) 11.438 Tj
24.0799 -40.5818 Td
(4609 4611 4613 4716) 11.438 Tj
2.40799 -41.8909 Td
(3744 3761 3772 3808) 11.438 Tj
24.0799 -41.8909 Td
(4750 4752 4755 4768) 11.438 Tj
2.40799 -43.2 Td
(3855 3879 3889) 8.428 Tj
24.0799 -43.2 Td
(4769 4771 4772 4774) 11.438 Tj
-1e-05 -44.5091 Td
(ide_write 3872) 8.428 Tj
24.0799 -44.5091 Td
(4784 4800 4804 4850) 11.438 Tj
2.40799 -45.8182 Td
(3872 3877) 5.418 Tj
24.0799 -45.8182 Td
(4854 5253 5321 5353) 11.438 Tj
-1e-05 -47.1272 Td
(idtinit 2874) 7.224 Tj
24.0799 -47.1272 Td
(5354 5404 5480) 8.428 Tj
2.40799 -48.4363 Td
(0234 1256 1305 2874) 11.438 Tj
21.6719 -48.4363 Td
(inode_table_lock 4079) 12.642 Tj
-1e-05 -49.7454 Td
(ifree 4310) 6.02 Tj
24.0799 -49.7454 Td
(4079 4086 4190 4197) 11.438 Tj
2.40799 -51.0545 Td
(4310 4439) 5.418 Tj
24.0799 -51.0545 Td
(4198 4206 4221 4327) 11.438 Tj
-1e-05 -52.3636 Td
(iget 4184) 5.418 Tj
24.0799 -52.3636 Td
(4330 4333 4359 4364) 11.438 Tj
2.40799 -53.6727 Td
(0326 1336 4077 4184) 11.438 Tj
24.0799 -53.6727 Td
(4442 4448) 5.418 Tj
2.40799 -54.9818 Td
(4304 4630 4707 4826) 11.438 Tj
21.6719 -54.9818 Td
(insl 0362) 5.418 Tj
-1e-05 -56.2909 Td
(iincref 4461) 7.224 Tj
24.0799 -56.2909 Td
(0362 3856) 5.418 Tj
2.40799 -57.6 Td
(0331 2158 4461 4633) 11.438 Tj
21.6719 -57.6 Td
(ioapic 6207) 6.622 Tj
-1e-05 -58.9091 Td
(iinit 4084) 6.02 Tj
24.0799 -58.9091 Td
(0274 1523 1564 1565) 11.438 Tj
2.40799 -60.2181 Td
(0325 1258 4084) 8.428 Tj
24.0799 -60.2181 Td
(6205 6207 6217 6224) 11.438 Tj
-1e-05 -61.5272 Td
(ilock 4322) 6.02 Tj
24.0799 -61.5272 Td
(6233 6242 6271 6276) 11.438 Tj
2.40799 -62.8363 Td
(0327 4322 4325 4455) 11.438 Tj
21.6719 -62.8363 Td
(IOAPIC_ARB 5870) 9.03 Tj
2.40799 -64.1454 Td
(4463 4634 4876 4959) 11.438 Tj
24.0799 -64.1454 Td
(5870) 2.408 Tj
2.40799 -65.4545 Td
(4981 5033) 5.418 Tj
21.6719 -65.4545 Td
(IO_APIC_BASE 5850) 10.234 Tj
-1e-05 -66.7636 Td
(inb 0354) 4.816 Tj
24.0799 -66.7636 Td
(5850 6242 6276) 8.428 Tj
2.40799 -68.0727 Td
(0354 0357 1043 1051) 11.438 Tj
21.6719 -68.0727 Td
(ioapic_id 1434) 8.428 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 4 4
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  cross-references  Page 5) 25.886 Tj
2.40798 -3.92728 Td
(0275 1434 1565 6246) 11.438 Tj
21.6719 -3.92728 Td
(IOART_DESTPHY 5919) 10.836 Tj
2.40798 -5.23637 Td
(6247) 2.408 Tj
24.0799 -5.23637 Td
(5919) 2.408 Tj
-2e-05 -6.54546 Td
(ioapic_init 6231) 9.632 Tj
21.6719 -6.54546 Td
(IOART_INTAHI 5913) 10.234 Tj
2.40798 -7.85455 Td
(0276 1253 6231 6247) 11.438 Tj
24.0799 -7.85455 Td
(5913) 2.408 Tj
-2e-05 -9.16364 Td
(ioapic_read 6217) 9.632 Tj
21.6719 -9.16364 Td
(IOART_INTALO 5914) 10.234 Tj
2.40798 -10.4727 Td
(6217 6243 6245 6252) 11.438 Tj
24.0799 -10.4727 Td
(5914) 2.408 Tj
2.40798 -11.7818 Td
(6261 6277 6280) 8.428 Tj
21.6719 -11.7818 Td
(IOART_INTMASK 5902) 10.836 Tj
-2e-05 -13.0909 Td
(IOAPIC_REDTBL 5871) 10.836 Tj
24.0799 -13.0909 Td
(5902 6253 6278) 8.428 Tj
2.40798 -14.4 Td
(5871 5872 5873 5874) 11.438 Tj
21.6719 -14.4 Td
(IOART_INTMCLR 5903) 10.836 Tj
2.40798 -15.7091 Td
(5875 5876 5877 5878) 11.438 Tj
24.0799 -15.7091 Td
(5903) 2.408 Tj
2.40798 -17.0182 Td
(5879 5880 5881 5882) 11.438 Tj
21.6719 -17.0182 Td
(IOART_INTMSET 5904) 10.836 Tj
2.40798 -18.3273 Td
(5883 5884 5885 5886) 11.438 Tj
24.0799 -18.3273 Td
(5904 6254) 5.418 Tj
2.40798 -19.6364 Td
(5887 5888 5889 5890) 11.438 Tj
21.6719 -19.6364 Td
(IOART_INTPOL 5912) 10.234 Tj
2.40798 -20.9455 Td
(5891 5892 5893 5894) 11.438 Tj
24.0799 -20.9455 Td
(5912 6255) 5.418 Tj
2.40798 -22.2545 Td
(5895 6213) 5.418 Tj
21.6719 -22.2545 Td
(IOART_INTVEC 5932) 10.234 Tj
-2e-05 -23.5636 Td
(IOAPIC_REDTBL0 5872) 11.438 Tj
24.0799 -23.5636 Td
(5932) 2.408 Tj
2.40798 -24.8727 Td
(5872) 2.408 Tj
21.6719 -24.8727 Td
(IOART_REM_IRR 5910) 10.836 Tj
-2e-05 -26.1818 Td
(IOAPIC_VER 5869) 9.03 Tj
24.0799 -26.1818 Td
(5910) 2.408 Tj
2.40798 -27.4909 Td
(5869 6243) 5.418 Tj
21.6719 -27.4909 Td
(IOART_RESV 5900) 9.03 Tj
-2e-05 -28.8 Td
(IOAPIC_WINDOW 5851) 10.836 Tj
24.0799 -28.8 Td
(5900) 2.408 Tj
2.40798 -30.1091 Td
(5851) 2.408 Tj
21.6719 -30.1091 Td
(IOART_TRGREDG 5907) 10.836 Tj
-2e-05 -31.4182 Td
(ioapic_write 6224) 10.234 Tj
24.0799 -31.4182 Td
(5907) 2.408 Tj
2.40798 -32.7273 Td
(6224 6260 6263 6279) 11.438 Tj
21.6719 -32.7273 Td
(IOART_TRGRLVL 5908) 10.836 Tj
2.40798 -34.0364 Td
(6283) 2.408 Tj
24.0799 -34.0364 Td
(5908) 2.408 Tj
-2e-05 -35.3454 Td
(IOART_DELEXINT 5930) 11.438 Tj
21.6719 -35.3454 Td
(IOART_TRGRMOD 5906) 10.836 Tj
2.40798 -36.6545 Td
(5930) 2.408 Tj
24.0799 -36.6545 Td
(5906 6256) 5.418 Tj
-2e-05 -37.9636 Td
(IOART_DELFIXED 5923) 11.438 Tj
21.6719 -37.9636 Td
(IOART_VER_MAXREDIR 5936) 13.846 Tj
2.40798 -39.2727 Td
(5923) 2.408 Tj
24.0799 -39.2727 Td
(5936 6244) 5.418 Tj
-2e-05 -40.5818 Td
(IOART_DELINIT 5928) 10.836 Tj
21.6719 -40.5818 Td
(IOART_VER_VERSION 5935) 13.244 Tj
2.40798 -41.8909 Td
(5928) 2.408 Tj
24.0799 -41.8909 Td
(5935) 2.408 Tj
-2e-05 -43.2 Td
(IOART_DELIVS 5916) 10.234 Tj
21.6719 -43.2 Td
(IO_PIC1 6306) 7.224 Tj
2.40798 -44.5091 Td
(5916) 2.408 Tj
24.0799 -44.5091 Td
(6306 6320 6335 6344) 11.438 Tj
-2e-05 -45.8182 Td
(IOART_DELLOPRI 5924) 11.438 Tj
24.0799 -45.8182 Td
(6347 6352 6362 6376) 11.438 Tj
2.40798 -47.1272 Td
(5924) 2.408 Tj
24.0799 -47.1272 Td
(6377) 2.408 Tj
-2e-05 -48.4363 Td
(IOART_DELMOD 5922) 10.234 Tj
21.6719 -48.4363 Td
(IO_PIC2 6307) 7.224 Tj
2.40798 -49.7454 Td
(5922 6257) 5.418 Tj
24.0799 -49.7454 Td
(6307 6321 6336 6365) 11.438 Tj
-2e-05 -51.0545 Td
(IOART_DELNMI 5927) 10.234 Tj
24.0799 -51.0545 Td
(6366 6367 6370 6379) 11.438 Tj
2.40798 -52.3636 Td
(5927) 2.408 Tj
24.0799 -52.3636 Td
(6380) 2.408 Tj
-2e-05 -53.6727 Td
(IOART_DELRSV1 5926) 10.836 Tj
21.6719 -53.6727 Td
(IO_TIMER1 6858) 8.428 Tj
2.40798 -54.9818 Td
(5926) 2.408 Tj
24.0799 -54.9818 Td
(6858 6867 6868 6869) 11.438 Tj
-2e-05 -56.2909 Td
(IOART_DELRSV2 5929) 10.836 Tj
24.0799 -56.2909 Td
(6870 6891 6892) 8.428 Tj
2.40798 -57.6 Td
(5929) 2.408 Tj
21.6719 -57.6 Td
(IO_TIMER2 6859) 8.428 Tj
-2e-05 -58.9091 Td
(IOART_DELSMI 5925) 10.234 Tj
24.0799 -58.9091 Td
(6859) 2.408 Tj
2.40798 -60.2181 Td
(5925) 2.408 Tj
21.6719 -60.2181 Td
(iput 4432) 5.418 Tj
-2e-05 -61.5272 Td
(IOART_DEST 5898) 9.03 Tj
24.0799 -61.5272 Td
(0332 4182 4432 4435) 11.438 Tj
2.40798 -62.8363 Td
(5898 6262 6281) 8.428 Tj
24.0799 -62.8363 Td
(4456 4648 4653 4688) 11.438 Tj
-2e-05 -64.1454 Td
(IOART_DESTLOG 5920) 10.836 Tj
24.0799 -64.1454 Td
(4695 4706 4763 4824) 11.438 Tj
2.40798 -65.4545 Td
(5920) 2.408 Tj
24.0799 -65.4545 Td
(4834 4860 4872 4881) 11.438 Tj
-2e-05 -66.7636 Td
(IOART_DESTMOD 5918) 10.836 Tj
24.0799 -66.7636 Td
(4882 5267 5273 5282) 11.438 Tj
2.40798 -68.0727 Td
(5918 6258) 5.418 Tj
24.0799 -68.0727 Td
(5287 5291 5335 5368) 11.438 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  cross-references  Page 6) 25.886 Tj
2.40799 -3.92728 Td
(5384 5385 5414 5419) 11.438 Tj
21.6719 -3.92728 Td
(KBDATAP 6602) 7.224 Tj
2.40799 -5.23637 Td
(5581 5592 5596) 8.428 Tj
24.0799 -5.23637 Td
(6602 6753) 5.418 Tj
-1e-05 -6.54546 Td
(irq_enable 6325) 9.03 Tj
21.6719 -6.54546 Td
(KBD_BUF 6735) 7.224 Tj
2.40799 -7.85455 Td
(0252 3759 6325 6842) 11.438 Tj
24.0799 -7.85455 Td
(6735 6736 6794 6796) 11.438 Tj
2.40799 -9.16364 Td
(6893) 2.408 Tj
24.0799 -9.16364 Td
(6824) 2.408 Tj
-1e-05 -10.4727 Td
(IRQ_ERROR 2834) 8.428 Tj
21.6719 -10.4727 Td
(kbd_intr 6743) 7.826 Tj
2.40799 -11.7818 Td
(2834 6109) 5.418 Tj
24.0799 -11.7818 Td
(0209 2927 6743) 8.428 Tj
-1e-05 -13.0909 Td
(IRQ_IDE 2833) 7.224 Tj
21.6719 -13.0909 Td
(kbd_lock 6739) 7.826 Tj
2.40799 -14.4 Td
(2833 2921 3759 3760) 11.438 Tj
24.0799 -14.4 Td
(6739 6747 6804 6812) 11.438 Tj
-1e-05 -15.7091 Td
(IRQ_KBD 2832) 7.224 Tj
24.0799 -15.7091 Td
(6815 6828 6837) 8.428 Tj
2.40799 -17.0182 Td
(2832 2926 6842 6843) 11.438 Tj
21.6719 -17.0182 Td
(kbd_r 6737) 6.02 Tj
-1e-05 -18.3273 Td
(IRQ_OFFSET 2829) 9.03 Tj
24.0799 -18.3273 Td
(6737 6794 6798 6814) 11.438 Tj
2.40799 -19.6364 Td
(2829 2905 2921 2926) 11.438 Tj
24.0799 -19.6364 Td
(6815 6818 6819 6823) 11.438 Tj
2.40799 -20.9455 Td
(2931 6073 6099 6109) 11.438 Tj
24.0799 -20.9455 Td
(6824 6825) 5.418 Tj
2.40799 -22.2545 Td
(6259 6347 6366) 8.428 Tj
21.6719 -22.2545 Td
(kbd_w 6738) 6.02 Tj
-1e-05 -23.5636 Td
(irq_setmask_8259A 6316) 13.244 Tj
24.0799 -23.5636 Td
(6738 6794 6795 6796) 11.438 Tj
2.40799 -24.8727 Td
(6316 6327 6383) 8.428 Tj
24.0799 -24.8727 Td
(6797 6814 6818) 8.428 Tj
-1e-05 -26.1818 Td
(IRQ_SLAVE 6309) 8.428 Tj
21.6719 -26.1818 Td
(KBS_DIB 6601) 7.224 Tj
2.40799 -27.4909 Td
(6309 6313 6352 6367) 11.438 Tj
24.0799 -27.4909 Td
(6601 6751) 5.418 Tj
-1e-05 -28.8 Td
(IRQ_SPURIOUS 2835) 10.234 Tj
21.6719 -28.8 Td
(KBSTATP 6600) 7.224 Tj
2.40799 -30.1091 Td
(2835 2931 6099) 8.428 Tj
24.0799 -30.1091 Td
(6600 6750) 5.418 Tj
-1e-05 -31.4182 Td
(IRQ_TIMER 2831) 8.428 Tj
21.6719 -31.4182 Td
(KEY_DEL 6626) 7.224 Tj
2.40799 -32.7273 Td
(2831 2905 6073 6893) 11.438 Tj
24.0799 -32.7273 Td
(6626 6674 6701 6725) 11.438 Tj
-1e-05 -34.0364 Td
(ismp 1432) 5.418 Tj
21.6719 -34.0364 Td
(KEY_DN 6620) 6.622 Tj
2.40799 -35.3454 Td
(0258 1280 1432 1533) 11.438 Tj
24.0799 -35.3454 Td
(6620 6671 6698 6722) 11.438 Tj
2.40799 -36.6545 Td
(1595 6239 6273) 8.428 Tj
21.6719 -36.6545 Td
(KEY_END 6618) 7.224 Tj
-1e-05 -37.9636 Td
(itrunc 4402) 6.622 Tj
24.0799 -37.9636 Td
(6618 6670 6697 6721) 11.438 Tj
2.40799 -39.2727 Td
(0329 4402 4438) 8.428 Tj
21.6719 -39.2727 Td
(KEY_HOME 6617) 7.826 Tj
-1e-05 -40.5818 Td
(iunlock 4354) 7.224 Tj
24.0799 -40.5818 Td
(6617 6663 6690 6715) 11.438 Tj
2.40799 -41.8909 Td
(0328 1337 4354 4357) 11.438 Tj
21.6719 -41.8909 Td
(KEY_INS 6625) 7.224 Tj
2.40799 -43.2 Td
(4465 4864 4964 4985) 11.438 Tj
24.0799 -43.2 Td
(6625 6673 6700 6724) 11.438 Tj
2.40799 -44.5091 Td
(5035 5300 5425) 8.428 Tj
21.6719 -44.5091 Td
(KEY_LF 6621) 6.622 Tj
-1e-05 -45.8182 Td
(iupdate 4253) 7.224 Tj
24.0799 -45.8182 Td
(6621 6668 6695 6719) 11.438 Tj
2.40799 -47.1272 Td
(0340 4253 4313 4425) 11.438 Tj
21.6719 -47.1272 Td
(KEY_PGDN 6624) 7.826 Tj
2.40799 -48.4363 Td
(4586 4784 4823 4833) 11.438 Tj
24.0799 -48.4363 Td
(6624 6672 6699 6723) 11.438 Tj
2.40799 -49.7454 Td
(4878 5373) 5.418 Tj
21.6719 -49.7454 Td
(KEY_PGUP 6623) 7.826 Tj
-1e-05 -51.0545 Td
(jmpbuf 1915) 6.622 Tj
24.0799 -51.0545 Td
(6623 6667 6694 6718) 11.438 Tj
2.40799 -52.3636 Td
(0228 0229 0230 1266) 11.438 Tj
21.6719 -52.3636 Td
(KEY_RT 6622) 6.622 Tj
2.40799 -53.6727 Td
(1267 1914 1915 1940) 11.438 Tj
24.0799 -53.6727 Td
(6622 6669 6696 6720) 11.438 Tj
2.40799 -54.9818 Td
(1964 2145 2146 2147) 11.438 Tj
21.6719 -54.9818 Td
(KEY_UP 6619) 6.622 Tj
2.40799 -56.2909 Td
(2148 2229 2230 2262) 11.438 Tj
24.0799 -56.2909 Td
(6619 6666 6693 6717) 11.438 Tj
2.40799 -57.6 Td
(2263 2500 2501) 8.428 Tj
21.6719 -57.6 Td
(kfree 2605) 6.02 Tj
-1e-05 -58.9091 Td
(kalloc 2660) 6.622 Tj
24.0799 -58.9091 Td
(0202 2071 2132 2442) 11.438 Tj
2.40799 -60.2181 Td
(0200 0201 1263 1342) 11.438 Tj
24.0799 -60.2181 Td
(2443 2589 2605 2613) 11.438 Tj
2.40799 -61.5272 Td
(2064 2122 2130 2584) 11.438 Tj
24.0799 -61.5272 Td
(5563 5591 5648 5676) 11.438 Tj
2.40799 -62.8363 Td
(2602 2660 2665 2686) 11.438 Tj
21.6719 -62.8363 Td
(kinit 2578) 6.02 Tj
2.40799 -64.1454 Td
(5515 5630) 5.418 Tj
24.0799 -64.1454 Td
(0203 1254 2578 2603) 11.438 Tj
-1e-05 -65.4545 Td
(kalloc_lock 2565) 9.632 Tj
21.6719 -65.4545 Td
(KSTACKSIZE 0152) 9.03 Tj
2.40799 -66.7636 Td
(2565 2584 2619 2653) 11.438 Tj
24.0799 -66.7636 Td
(0152 1263 1267 2034) 11.438 Tj
2.40799 -68.0727 Td
(2667 2674 2680 2685) 11.438 Tj
24.0799 -68.0727 Td
(2130 2139 2443) 8.428 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 5 5
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  cross-references  Page 7) 25.886 Tj
0 -3.92728 Td
(lapic_disableintr 6129) 13.244 Tj
24.0799 -3.92728 Td
(0239 1387 1612 2067) 11.438 Tj
2.408 -5.23637 Td
(0270 6129) 5.418 Tj
24.0799 -5.23637 Td
(2127 2140 4230 4265) 11.438 Tj
0 -6.54546 Td
(lapic_enableintr 6122) 12.642 Tj
24.0799 -6.54546 Td
(4498 4573 5555 5780) 11.438 Tj
2.408 -7.85455 Td
(0269 1286 1310 6122) 11.438 Tj
24.0799 -7.85455 Td
(6461) 2.408 Tj
0 -9.16364 Td
(lapic_eoi 6136) 8.428 Tj
21.6719 -9.16364 Td
(memset 5754) 6.622 Tj
2.408 -10.4727 Td
(0271 2923 2928 6136) 11.438 Tj
24.0799 -10.4727 Td
(0237 1229 1348 1388) 11.438 Tj
7.10543e-15 -11.7818 Td
(lapic_init 6086) 9.03 Tj
24.0799 -11.7818 Td
(2068 2146 4166 4300) 11.438 Tj
2.408 -13.0909 Td
(0265 1242 1308 6086) 11.438 Tj
24.0799 -13.0909 Td
(4819 5375 5518 5578) 11.438 Tj
7.10543e-15 -14.4 Td
(lapic_read 6053) 9.03 Tj
24.0799 -14.4 Td
(5754 6463) 5.418 Tj
2.408 -15.7091 Td
(6053 6094 6106 6111) 11.438 Tj
21.6719 -15.7091 Td
(mknod 4753) 6.02 Tj
2.408 -17.0182 Td
(6117 6155) 5.418 Tj
24.0799 -17.0182 Td
(0337 1666 4753 5333) 11.438 Tj
7.10543e-15 -18.3273 Td
(lapic_startap 6162) 10.836 Tj
21.6719 -18.3273 Td
(mknod1 4772) 6.622 Tj
2.408 -19.6364 Td
(0266 1627 6162) 8.428 Tj
24.0799 -19.6364 Td
(0338 4761 4772 5266) 11.438 Tj
1.42109e-14 -20.9455 Td
(lapic_timerinit 6066) 12.04 Tj
24.0799 -20.9455 Td
(5366) 2.408 Tj
2.408 -22.2545 Td
(0267 1281 1309 6066) 11.438 Tj
21.6719 -22.2545 Td
(mp 0852) 4.214 Tj
7.10543e-15 -23.5636 Td
(lapic_timerintr 6079) 12.04 Tj
24.0799 -23.5636 Td
(0257 0852 1111 1112) 11.438 Tj
2.408 -24.8727 Td
(0268 2906 6079) 8.428 Tj
24.0799 -24.8727 Td
(1401 1437 1439 1446) 11.438 Tj
7.10543e-15 -26.1818 Td
(lapic_write 6059) 9.632 Tj
24.0799 -26.1818 Td
(1450 1453 1463 1468) 11.438 Tj
2.408 -27.4909 Td
(6059 6071 6072 6074) 11.438 Tj
24.0799 -27.4909 Td
(1472 1473 1477 1478) 11.438 Tj
2.408 -28.8 Td
(6075 6082 6093 6095) 11.438 Tj
24.0799 -28.8 Td
(1495 1500 1539 1582) 11.438 Tj
2.408 -30.1091 Td
(6096 6099 6101 6102) 11.438 Tj
24.0799 -30.1091 Td
(5951 6201) 5.418 Tj
2.408 -31.4182 Td
(6104 6108 6109 6110) 11.438 Tj
21.6719 -31.4182 Td
(mp_bcpu 1593) 7.224 Tj
2.408 -32.7273 Td
(6114 6115 6125 6132) 11.438 Tj
24.0799 -32.7273 Td
(0261 1236 1593) 8.428 Tj
2.408 -34.0364 Td
(6139 6168 6169 6173) 11.438 Tj
21.6719 -34.0364 Td
(mpbe 0888) 5.418 Tj
2.408 -35.3454 Td
(6180 6181) 5.418 Tj
24.0799 -35.3454 Td
(0888 1522 1556 1561) 11.438 Tj
7.10543e-15 -36.6545 Td
(lgdt 0403) 5.418 Tj
21.6719 -36.6545 Td
(mpctb 0863) 6.02 Tj
2.408 -37.9636 Td
(0403 0411 1068 1144) 11.438 Tj
24.0799 -37.9636 Td
(0863 1491 1500 1520) 11.438 Tj
2.408 -39.2727 Td
(2052) 2.408 Tj
24.0799 -39.2727 Td
(1539 1540 1541 1542) 11.438 Tj
1.42109e-14 -40.5818 Td
(lidt 0417) 5.418 Tj
21.6719 -40.5818 Td
(mp_detect 1489) 8.428 Tj
2.408 -41.8909 Td
(0417 0425 2876) 8.428 Tj
24.0799 -41.8909 Td
(1489 1529) 5.418 Tj
2.13163e-14 -43.2 Td
(link 4852) 5.418 Tj
21.6719 -43.2 Td
(mpie 0908) 5.418 Tj
2.408 -44.5091 Td
(0341 0688 4850 4852) 11.438 Tj
24.0799 -44.5091 Td
(0908 1524 1569 1570) 11.438 Tj
2.408 -45.8182 Td
(5471) 2.408 Tj
21.6719 -45.8182 Td
(mp_init 1516) 7.224 Tj
2.13163e-14 -47.1272 Td
(load_icode 1364) 9.03 Tj
24.0799 -47.1272 Td
(0259 1235 1516 1573) 11.438 Tj
2.408 -48.4363 Td
(0288 1356 1364 1372) 11.438 Tj
21.6719 -48.4363 Td
(mpioapic 0900) 7.826 Tj
2.408 -49.7454 Td
(1382 1384) 5.418 Tj
24.0799 -49.7454 Td
(0900 1523 1564 1566) 11.438 Tj
2.13163e-14 -51.0545 Td
(lpt_putc 6417) 7.826 Tj
21.6719 -51.0545 Td
(mpmain 1302) 6.622 Tj
2.408 -52.3636 Td
(6417 6441) 5.418 Tj
24.0799 -52.3636 Td
(1302 1307 1600 1624) 11.438 Tj
2.84217e-14 -53.6727 Td
(ltr 0429) 4.816 Tj
21.6719 -53.6727 Td
(mppe 0878) 5.418 Tj
2.408 -54.9818 Td
(0429 0431 2053) 8.428 Tj
24.0799 -54.9818 Td
(0878 1521 1547 1553) 11.438 Tj
3.55271e-14 -56.2909 Td
(main0 1222) 6.02 Tj
21.6719 -56.2909 Td
(mp_scan 1440) 7.224 Tj
2.408 -57.6 Td
(1218 1222) 5.418 Tj
24.0799 -57.6 Td
(1440 1472 1477 1480) 11.438 Tj
4.26326e-14 -58.9091 Td
(MAXLVTSHIFT 5865) 9.632 Tj
21.6719 -58.9091 Td
(mp_search 1464) 8.428 Tj
2.408 -60.2181 Td
(5865) 2.408 Tj
24.0799 -60.2181 Td
(1464 1495) 5.418 Tj
4.9738e-14 -61.5272 Td
(MAXREDIRSHIFT 5937) 10.836 Tj
21.6719 -61.5272 Td
(MPSTACK 1959) 7.224 Tj
2.408 -62.8363 Td
(5937 6244) 5.418 Tj
24.0799 -62.8363 Td
(1239 1240 1621 1959) 11.438 Tj
5.68434e-14 -64.1454 Td
(memcmp 5765) 6.622 Tj
24.0799 -64.1454 Td
(1967) 2.408 Tj
2.408 -65.4545 Td
(0238 1447 1501 4670) 11.438 Tj
21.6719 -65.4545 Td
(mp_startthem 1606) 10.234 Tj
2.408 -66.7636 Td
(5765) 2.408 Tj
24.0799 -66.7636 Td
(0260 1277 1606) 8.428 Tj
5.68434e-14 -68.0727 Td
(memmove 5780) 7.224 Tj
21.6719 -68.0727 Td
(namei 4610) 6.02 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  cross-references  Page 8) 25.886 Tj
2.40799 -3.92728 Td
(0333 4610 4709 4758) 11.438 Tj
21.6719 -3.92728 Td
(O_RDWR 3403) 6.622 Tj
2.40799 -5.23637 Td
(4808 4857 4866 5264) 11.438 Tj
24.0799 -5.23637 Td
(1665 1667 3403 5281) 11.438 Tj
2.40799 -6.54546 Td
(5277 5362 5410 5490) 11.438 Tj
24.0799 -6.54546 Td
(5302) 2.408 Tj
-1e-05 -7.85455 Td
(NAMEI_CREATE 3669) 10.234 Tj
21.6719 -7.85455 Td
(outb 0371) 5.418 Tj
2.40799 -9.16364 Td
(3669 4602 4644 4686) 11.438 Tj
24.0799 -9.16364 Td
(0371 0373 1047 1055) 11.438 Tj
2.40799 -10.4727 Td
(4758 4866 5264 5362) 11.438 Tj
24.0799 -10.4727 Td
(1584 1587 3775 3782) 11.438 Tj
-1e-05 -11.7818 Td
(NAMEI_DELETE 3670) 10.234 Tj
24.0799 -11.7818 Td
(3809 3810 3811 3812) 11.438 Tj
2.40799 -13.0909 Td
(3670 4607 4701 4808) 11.438 Tj
24.0799 -13.0909 Td
(3813 3814 3816 3818) 11.438 Tj
-1e-05 -14.4 Td
(NAMEI_LOOKUP 3668) 10.234 Tj
24.0799 -14.4 Td
(3881 3882 3883 3884) 11.438 Tj
2.40799 -15.7091 Td
(3668 4601 4642 4857) 11.438 Tj
24.0799 -15.7091 Td
(3885 3886 6320 6321) 11.438 Tj
2.40799 -17.0182 Td
(5277 5410 5490) 8.428 Tj
24.0799 -17.0182 Td
(6335 6336 6344 6347) 11.438 Tj
-1e-05 -18.3273 Td
(NBUF 0157) 5.418 Tj
24.0799 -18.3273 Td
(6352 6362 6365 6366) 11.438 Tj
2.40799 -19.6364 Td
(0157 3935 3953) 8.428 Tj
24.0799 -19.6364 Td
(6367 6370 6376 6377) 11.438 Tj
-1e-05 -20.9455 Td
(NCPU 0153) 5.418 Tj
24.0799 -20.9455 Td
(6379 6380 6423 6424) 11.438 Tj
2.40799 -22.2545 Td
(0153 1232 1431 1957) 11.438 Tj
24.0799 -22.2545 Td
(6425 6444 6446 6466) 11.438 Tj
2.40799 -23.5636 Td
(1972 2012) 5.418 Tj
24.0799 -23.5636 Td
(6467 6468 6469 6890) 11.438 Tj
-1e-05 -24.8727 Td
(NDEV 0159) 5.418 Tj
24.0799 -24.8727 Td
(6891 6892) 5.418 Tj
2.40799 -26.1818 Td
(0159 4489 4555 4914) 11.438 Tj
21.6719 -26.1818 Td
(outsl 0383) 6.02 Tj
-1e-05 -27.4909 Td
(NDIRECT 3567) 7.224 Tj
24.0799 -27.4909 Td
(0383 3819 3891) 8.428 Tj
2.40799 -28.8 Td
(3566 3567 3570 4377) 11.438 Tj
21.6719 -28.8 Td
(outw 0377) 5.418 Tj
2.40799 -30.1091 Td
(4386 4516 4532 4536) 11.438 Tj
24.0799 -30.1091 Td
(0377 0379) 5.418 Tj
-1e-05 -31.4182 Td
(newblock 4510) 7.826 Tj
21.6719 -31.4182 Td
(O_WRONLY 3402) 7.826 Tj
2.40799 -32.7273 Td
(4510 4567 4568) 8.428 Tj
24.0799 -32.7273 Td
(3402 5281 5305) 8.428 Tj
-1e-05 -34.0364 Td
(NFILE 0155) 6.02 Tj
21.6719 -34.0364 Td
(PAGE 0151) 5.418 Tj
2.40799 -35.3454 Td
(0155 4916 4931) 8.428 Tj
24.0799 -35.3454 Td
(0151 0152 1341 2586) 11.438 Tj
-1e-05 -36.6545 Td
(NINODE 0158) 6.622 Tj
24.0799 -36.6545 Td
(2588 2589 2612 2664) 11.438 Tj
2.40799 -37.9636 Td
(0158 4078 4194) 8.428 Tj
24.0799 -37.9636 Td
(5630 5648 5676) 8.428 Tj
-1e-05 -39.2727 Td
(NO 6604) 4.214 Tj
21.6719 -39.2727 Td
(panic 6555) 6.02 Tj
2.40799 -40.5818 Td
(6604 6652 6655 6657) 11.438 Tj
24.0799 -40.5818 Td
(0208 1307 1360 1372) 11.438 Tj
2.40799 -41.8909 Td
(6658 6659 6660 6662) 11.438 Tj
24.0799 -41.8909 Td
(1382 1384 1808 1834) 11.438 Tj
2.40799 -43.2 Td
(6679 6682 6684 6685) 11.438 Tj
24.0799 -43.2 Td
(2258 2260 2308 2311) 11.438 Tj
2.40799 -44.5091 Td
(6686 6687 6689 6708) 11.438 Tj
24.0799 -44.5091 Td
(2419 2613 2625 2665) 11.438 Tj
2.40799 -45.8182 Td
(6709 6711 6712 6713) 11.438 Tj
24.0799 -45.8182 Td
(2945 3831 3877 3996) 11.438 Tj
2.40799 -47.1272 Td
(6714) 2.408 Tj
24.0799 -47.1272 Td
(4022 4033 4129 4214) 11.438 Tj
-1e-05 -48.4363 Td
(NOFILE 0154) 6.622 Tj
24.0799 -48.4363 Td
(4297 4325 4357 4376) 11.438 Tj
2.40799 -49.7454 Td
(0154 1938 2151 2394) 11.438 Tj
24.0799 -49.7454 Td
(4380 4383 4389 4435) 11.438 Tj
2.40799 -51.0545 Td
(5128 5157) 5.418 Tj
24.0799 -51.0545 Td
(4590 4709 4724 4736) 11.438 Tj
-1e-05 -52.3636 Td
(NPROC 0150) 6.02 Tj
24.0799 -52.3636 Td
(4815 4821 4829 4967) 11.438 Tj
2.40799 -53.6727 Td
(0150 2011 2085 2217) 11.438 Tj
24.0799 -53.6727 Td
(4988 5007 5021 5056) 11.438 Tj
2.40799 -54.9818 Td
(2346 2369 2406 2411) 11.438 Tj
24.0799 -54.9818 Td
(6555 6562) 5.418 Tj
2.40799 -56.2909 Td
(2435 2475) 5.418 Tj
21.6719 -56.2909 Td
(pic_init 6332) 7.826 Tj
-1e-05 -57.6 Td
(NREQUEST 0156) 7.826 Tj
24.0799 -57.6 Td
(0251 1252 6332) 8.428 Tj
2.40799 -58.9091 Td
(0156 3733 3836 3845) 11.438 Tj
21.6719 -58.9091 Td
(pinit 2018) 6.02 Tj
2.40799 -60.2181 Td
(3860 3862) 5.418 Tj
24.0799 -60.2181 Td
(0212 1250 2018) 8.428 Tj
-1e-05 -61.5272 Td
(NSEGS 1906) 6.02 Tj
21.6719 -61.5272 Td
(pipe 5611) 5.418 Tj
2.40799 -62.8363 Td
(1906 1966) 5.418 Tj
24.0799 -62.8363 Td
(0290 0291 0294 0295) 11.438 Tj
-1e-05 -64.1454 Td
(O_CREATE 3400) 7.826 Tj
24.0799 -64.1454 Td
(0296 3505 4957 4979) 11.438 Tj
2.40799 -65.4545 Td
(3400 5263) 5.418 Tj
24.0799 -65.4545 Td
(5017 5611 5624 5630) 11.438 Tj
-1e-05 -66.7636 Td
(O_RDONLY 3401) 7.826 Tj
24.0799 -66.7636 Td
(5636 5640 5644 5661) 11.438 Tj
2.40799 -68.0727 Td
(3401) 2.408 Tj
24.0799 -68.0727 Td
(5680 5706) 5.418 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 6 6
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  cross-references  Page 9) 25.886 Tj
0 -3.92728 Td
(pipe_alloc 5621) 9.03 Tj
24.0799 -3.92728 Td
(2223 2239 2250 2257) 11.438 Tj
2.408 -5.23637 Td
(0293 5176 5621) 8.428 Tj
24.0799 -5.23637 Td
(2272 2275 2283 2284) 11.438 Tj
0 -6.54546 Td
(pipe_close 5661) 9.03 Tj
24.0799 -6.54546 Td
(2313 2315 2317 2319) 11.438 Tj
2.408 -7.85455 Td
(0294 5017 5661) 8.428 Tj
24.0799 -7.85455 Td
(2320 2333 2334 2355) 11.438 Tj
0 -9.16364 Td
(pipe_read 5706) 8.428 Tj
24.0799 -9.16364 Td
(2357 2368 2375 2379) 11.438 Tj
2.408 -10.4727 Td
(0296 4979 5706) 8.428 Tj
24.0799 -10.4727 Td
(2403 2431 2448 2457) 11.438 Tj
0 -11.7818 Td
(PIPESIZE 5609) 7.826 Tj
24.0799 -11.7818 Td
(2462) 2.408 Tj
2.408 -13.0909 Td
(5609 5617 5687 5696) 11.438 Tj
21.6719 -13.0909 Td
(proc_wait 2425) 8.428 Tj
2.408 -14.4 Td
(5724) 2.408 Tj
24.0799 -14.4 Td
(0223 1359 2425 3238) 11.438 Tj
0 -15.7091 Td
(pipe_write 5680) 9.03 Tj
21.6719 -15.7091 Td
(proghdr 0824) 7.224 Tj
2.408 -17.0182 Td
(0295 4957 5680) 8.428 Tj
24.0799 -17.0182 Td
(0824 1368 1377 1382) 11.438 Tj
7.10543e-15 -18.3273 Td
(pit8253_timerinit 6887) 13.244 Tj
24.0799 -18.3273 Td
(5482) 2.408 Tj
2.408 -19.6364 Td
(0255 1283 6887) 8.428 Tj
21.6719 -19.6364 Td
(read_eflags 0435) 9.632 Tj
0 -20.9455 Td
(printint 6473) 7.826 Tj
24.0799 -20.9455 Td
(0435) 2.408 Tj
2.408 -22.2545 Td
(6473 6522 6525) 8.428 Tj
21.6719 -22.2545 Td
(readi 4483) 6.02 Tj
-7.10543e-15 -23.5636 Td
(proc 1929) 5.418 Tj
24.0799 -23.5636 Td
(0335 4483 4723 4814) 11.438 Tj
2.408 -24.8727 Td
(0211 0213 0214 0215) 11.438 Tj
24.0799 -24.8727 Td
(4982 5494 5502 5569) 11.438 Tj
2.408 -26.1818 Td
(0244 0245 0288 1203) 11.438 Tj
24.0799 -26.1818 Td
(5576) 2.408 Tj
2.408 -27.4909 Td
(1226 1261 1265 1325) 11.438 Tj
21.6719 -27.4909 Td
(release 1831) 7.224 Tj
2.408 -28.8 Td
(1329 1330 1364 1407) 11.438 Tj
24.0799 -28.8 Td
(0283 1231 1334 1831) 11.438 Tj
2.408 -30.1091 Td
(1521 1547 1548 1549) 11.438 Tj
24.0799 -30.1091 Td
(1834 2113 2118 2223) 11.438 Tj
2.408 -31.4182 Td
(1757 1900 1929 1956) 11.438 Tj
24.0799 -31.4182 Td
(2239 2275 2284 2300) 11.438 Tj
2.408 -32.7273 Td
(1957 2005 2011 2012) 11.438 Tj
24.0799 -32.7273 Td
(2318 2321 2334 2357) 11.438 Tj
2.408 -34.0364 Td
(2028 2061 2076 2079) 11.438 Tj
24.0799 -34.0364 Td
(2375 2379 2448 2457) 11.438 Tj
2.408 -35.3454 Td
(2083 2086 2104 2105) 11.438 Tj
24.0799 -35.3454 Td
(2653 2674 2680 2685) 11.438 Tj
2.408 -36.6545 Td
(2108 2210 2218 2255) 11.438 Tj
24.0799 -36.6545 Td
(3793 3867 3920 3983) 11.438 Tj
2.408 -37.9636 Td
(2270 2305 2344 2346) 11.438 Tj
24.0799 -37.9636 Td
(3992 4047 4206 4221) 11.438 Tj
2.408 -39.2727 Td
(2366 2369 2389 2390) 11.438 Tj
24.0799 -39.2727 Td
(4333 4364 4448 4935) 11.438 Tj
2.408 -40.5818 Td
(2406 2411 2427 2428) 11.438 Tj
24.0799 -40.5818 Td
(4939 5014 5024 5058) 11.438 Tj
2.408 -41.8909 Td
(2436 2473 2476 2562) 11.438 Tj
24.0799 -41.8909 Td
(5673 5689 5700 5714) 11.438 Tj
2.408 -43.2 Td
(2853 2883 2938 3004) 11.438 Tj
24.0799 -43.2 Td
(5727 6551 6584 6804) 11.438 Tj
2.408 -44.5091 Td
(3025 3037 3054 3066) 11.438 Tj
24.0799 -44.5091 Td
(6828) 2.408 Tj
2.408 -45.8182 Td
(3123 3204 3220 3261) 11.438 Tj
21.6719 -45.8182 Td
(run 2567) 4.816 Tj
2.408 -47.1272 Td
(3705 3930 4055 4614) 11.438 Tj
24.0799 -47.1272 Td
(1583 1940 2103 2203) 11.438 Tj
2.408 -48.4363 Td
(4905 5104 5124 5156) 11.438 Tj
24.0799 -48.4363 Td
(2214 2567 2568 2571) 11.438 Tj
2.408 -49.7454 Td
(5172 5403 5477 5604) 11.438 Tj
24.0799 -49.7454 Td
(2607 2608 2609 2623) 11.438 Tj
2.408 -51.0545 Td
(5957) 2.408 Tj
24.0799 -51.0545 Td
(2662 2671 2915) 8.428 Tj
-7.10543e-15 -52.3636 Td
(procdump 2470) 7.826 Tj
21.6719 -52.3636 Td
(RUNNING 1926) 7.224 Tj
2.408 -53.6727 Td
(0225 2470 6790) 8.428 Tj
24.0799 -53.6727 Td
(1926 2228 2916) 8.428 Tj
0 -54.9818 Td
(process0 1327) 7.826 Tj
21.6719 -54.9818 Td
(sched 2253) 6.02 Tj
2.408 -56.2909 Td
(1215 1265 1266 1327) 11.438 Tj
24.0799 -56.2909 Td
(2253 2258 2260 2274) 11.438 Tj
7.10543e-15 -57.6 Td
(proc_exit 2387) 8.428 Tj
24.0799 -57.6 Td
(2314 2327 2418) 8.428 Tj
2.408 -58.9091 Td
(0221 2387 2461 2887) 11.438 Tj
21.6719 -58.9091 Td
(scheduler 2208) 8.428 Tj
2.408 -60.2181 Td
(2891 2913 2940 3231) 11.438 Tj
24.0799 -60.2181 Td
(0220 1292 1322 1325) 11.438 Tj
2.408 -61.5272 Td
(5597) 2.408 Tj
24.0799 -61.5272 Td
(1964 2025 2200 2201) 11.438 Tj
7.10543e-15 -62.8363 Td
(proc_kill 2364) 8.428 Tj
24.0799 -62.8363 Td
(2206 2208 2250 2278) 11.438 Tj
2.408 -64.1454 Td
(0222 2364 3248) 8.428 Tj
24.0799 -64.1454 Td
(2283 2415) 5.418 Tj
7.10543e-15 -65.4545 Td
(proc_table_lock 2009) 12.04 Tj
21.6719 -65.4545 Td
(segdesc 0627) 7.224 Tj
2.408 -66.7636 Td
(1331 1334 2009 2020) 11.438 Tj
24.0799 -66.7636 Td
(0400 0403 0627 0651) 11.438 Tj
2.408 -68.0727 Td
(2111 2113 2118 2215) 11.438 Tj
24.0799 -68.0727 Td
(0654 0659 1966) 8.428 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  cross-references  Page 10) 26.488 Tj
0 -3.92728 Td
(SEG_KCODE 1901) 8.428 Tj
21.6719 -3.92728 Td
(stati 4470) 6.02 Tj
2.408 -5.23637 Td
(1901 2040 2869 2870) 11.438 Tj
24.0799 -5.23637 Td
(0334 4470 5034) 8.428 Tj
7.10543e-15 -6.54546 Td
(SEG_KDATA 1902) 8.428 Tj
21.6719 -6.54546 Td
(STA_W 0566 0668) 9.03 Tj
2.408 -7.85455 Td
(1902 2032 2041 2760) 11.438 Tj
24.0799 -7.85455 Td
(0566 0668 1096 1174) 11.438 Tj
1.42109e-14 -9.16364 Td
(SEG_NULLASM 0554) 9.632 Tj
24.0799 -9.16364 Td
(2041 2046) 5.418 Tj
2.408 -10.4727 Td
(0554 1094 1172) 8.428 Tj
21.6719 -10.4727 Td
(STA_X 0563 0665) 9.03 Tj
7.10543e-15 -11.7818 Td
(SEG_TSS 1905) 7.224 Tj
24.0799 -11.7818 Td
(0563 0665 1095 1173) 11.438 Tj
2.408 -13.0909 Td
(1905 2042 2043 2053) 11.438 Tj
24.0799 -13.0909 Td
(2040 2045) 5.418 Tj
7.10543e-15 -14.4 Td
(SEG_UCODE 1903) 8.428 Tj
21.6719 -14.4 Td
(sti 0485) 4.816 Tj
2.408 -15.7091 Td
(1350 1903 2045 2048) 11.438 Tj
24.0799 -15.7091 Td
(0485 0487 1290 1320) 11.438 Tj
1.42109e-14 -17.0182 Td
(SEG_UDATA 1904) 8.428 Tj
24.0799 -17.0182 Td
(1845) 2.408 Tj
2.408 -18.3273 Td
(1349 1904 2046 2049) 11.438 Tj
21.6719 -18.3273 Td
(strncmp 5801) 7.224 Tj
7.10543e-15 -19.6364 Td
(setupsegs 2028) 8.428 Tj
24.0799 -19.6364 Td
(0240 1558 5801) 8.428 Tj
2.408 -20.9455 Td
(0214 1270 1313 2028) 11.438 Tj
21.6719 -20.9455 Td
(STS_CG16 0676) 7.826 Tj
2.408 -22.2545 Td
(2226 2236 3267 5585) 11.438 Tj
24.0799 -22.2545 Td
(0676) 2.408 Tj
7.10543e-15 -23.5636 Td
(shift 6740) 6.02 Tj
21.6719 -23.5636 Td
(STS_CG32 0682) 7.826 Tj
2.408 -24.8727 Td
(6740 6756 6760 6761) 11.438 Tj
24.0799 -24.8727 Td
(0682) 2.408 Tj
2.408 -26.1818 Td
(6763 6766 6769 6770) 11.438 Tj
21.6719 -26.1818 Td
(STS_IG16 0678) 7.826 Tj
2.408 -27.4909 Td
(6772 6773) 5.418 Tj
24.0799 -27.4909 Td
(0678) 2.408 Tj
1.42109e-14 -28.8 Td
(sleep 2303) 6.02 Tj
21.6719 -28.8 Td
(STS_IG32 0683) 7.826 Tj
2.408 -30.1091 Td
(0218 1803 2300 2303) 11.438 Tj
24.0799 -30.1091 Td
(0683 0764) 5.418 Tj
2.408 -31.4182 Td
(2308 2311 2324 2372) 11.438 Tj
21.6719 -31.4182 Td
(STS_LDT 0674) 7.224 Tj
2.408 -32.7273 Td
(2462 3837 3851 3907) 11.438 Tj
24.0799 -32.7273 Td
(0674) 2.408 Tj
2.408 -34.0364 Td
(3979 4076 4197 4330) 11.438 Tj
21.6719 -34.0364 Td
(STS_T16A 0673) 7.826 Tj
2.408 -35.3454 Td
(5693 5717 6815) 8.428 Tj
24.0799 -35.3454 Td
(0673) 2.408 Tj
2.13163e-14 -36.6545 Td
(spinlock 1701) 7.826 Tj
21.6719 -36.6545 Td
(STS_T16B 0675) 7.826 Tj
2.408 -37.9636 Td
(0216 0218 0279 0280) 11.438 Tj
24.0799 -37.9636 Td
(0675) 2.408 Tj
2.408 -39.2727 Td
(0281 0282 0283 0284) 11.438 Tj
21.6719 -39.2727 Td
(STS_T32A 0680) 7.826 Tj
2.408 -40.5818 Td
(1210 1331 1701 1758) 11.438 Tj
24.0799 -40.5818 Td
(0680 2042) 5.418 Tj
2.408 -41.8909 Td
(1763 1805 1831 1852) 11.438 Tj
21.6719 -41.8909 Td
(STS_T32B 0681) 7.826 Tj
2.408 -43.2 Td
(2007 2009 2303 2563) 11.438 Tj
24.0799 -43.2 Td
(0681) 2.408 Tj
2.408 -44.5091 Td
(2565 3009 3209 3709) 11.438 Tj
21.6719 -44.5091 Td
(STS_TG 0677) 6.622 Tj
2.408 -45.8182 Td
(3735 3932 3936 4057) 11.438 Tj
24.0799 -45.8182 Td
(0677) 2.408 Tj
2.408 -47.1272 Td
(4079 4908 4913 5109) 11.438 Tj
21.6719 -47.1272 Td
(STS_TG16 0679) 7.826 Tj
2.408 -48.4363 Td
(5607 5616 6404 6409) 11.438 Tj
24.0799 -48.4363 Td
(0679) 2.408 Tj
2.408 -49.7454 Td
(6739) 2.408 Tj
21.6719 -49.7454 Td
(STS_TG32 0684) 7.826 Tj
2.13163e-14 -51.0545 Td
(STA_A 0568 0670) 9.03 Tj
24.0799 -51.0545 Td
(0684 0764) 5.418 Tj
2.408 -52.3636 Td
(0568 0670) 5.418 Tj
21.6719 -52.3636 Td
(superblock 3560) 9.03 Tj
1.42109e-14 -53.6727 Td
(STA_C 0565 0667) 9.03 Tj
24.0799 -53.6727 Td
(3560 4106 4113 4155) 11.438 Tj
2.408 -54.9818 Td
(0565 0667) 5.418 Tj
24.0799 -54.9818 Td
(4161 4277 4283) 8.428 Tj
1.42109e-14 -56.2909 Td
(STA_E 0564 0666) 9.03 Tj
21.6719 -56.2909 Td
(syscall 3121) 7.224 Tj
2.408 -57.6 Td
(0564 0666) 5.418 Tj
24.0799 -57.6 Td
(0242 0243 1207 2857) 11.438 Tj
2.13163e-14 -58.9091 Td
(STA_R 0567 0669) 9.03 Tj
24.0799 -58.9091 Td
(2889 3008 3121 3208) 11.438 Tj
2.408 -60.2181 Td
(0567 0669 1095 1173) 11.438 Tj
24.0799 -60.2181 Td
(5108) 2.408 Tj
2.408 -61.5272 Td
(2040 2045) 5.418 Tj
21.6719 -61.5272 Td
(SYS_chdir 2716) 8.428 Tj
1.42109e-14 -62.8363 Td
(stat 3450) 5.418 Tj
24.0799 -62.8363 Td
(2716 3173) 5.418 Tj
2.408 -64.1454 Td
(0301 0307 0334 1651) 11.438 Tj
21.6719 -64.1454 Td
(SYS_close 2707) 8.428 Tj
2.408 -65.4545 Td
(3001 3201 3450 4051) 11.438 Tj
24.0799 -65.4545 Td
(2707 3146) 5.418 Tj
2.408 -66.7636 Td
(4468 4470 4901 5030) 11.438 Tj
21.6719 -66.7636 Td
(SYS_dup 2717) 7.224 Tj
2.408 -68.0727 Td
(5101 5443) 5.418 Tj
24.0799 -68.0727 Td
(2717 3176) 5.418 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 7 7
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  cross-references  Page 11) 26.488 Tj
0 -3.92728 Td
(SYS_exec 2709) 7.826 Tj
21.6719 -3.92728 Td
(T_DEV 3584) 6.02 Tj
2.408 -5.23637 Td
(2709 3152) 5.418 Tj
24.0799 -5.23637 Td
(1666 3575 3576 3584) 11.438 Tj
7.10543e-15 -6.54546 Td
(SYS_exit 2702) 7.826 Tj
24.0799 -6.54546 Td
(4488 4554) 5.418 Tj
2.408 -7.85455 Td
(2702 3131) 5.418 Tj
21.6719 -7.85455 Td
(T_DEVICE 2810) 7.826 Tj
0 -9.16364 Td
(SYS_fork 2701) 7.826 Tj
24.0799 -9.16364 Td
(2810) 2.408 Tj
2.408 -10.4727 Td
(2701 3128) 5.418 Tj
21.6719 -10.4727 Td
(T_DIR 3582) 6.02 Tj
-7.10543e-15 -11.7818 Td
(SYS_fstat 2713) 8.428 Tj
24.0799 -11.7818 Td
(3582 4558 4581 4652) 11.438 Tj
2.408 -13.0909 Td
(2713 3164) 5.418 Tj
24.0799 -13.0909 Td
(4859 5272 5281 5366) 11.438 Tj
-7.10543e-15 -14.4 Td
(SYS_getpid 2718) 9.03 Tj
24.0799 -14.4 Td
(5418) 2.408 Tj
2.408 -15.7091 Td
(2718 3179) 5.418 Tj
21.6719 -15.7091 Td
(T_DIVIDE 2803) 7.826 Tj
-1.42109e-14 -17.0182 Td
(SYS_kill 2708) 7.826 Tj
24.0799 -17.0182 Td
(2803) 2.408 Tj
2.408 -18.3273 Td
(2708 3149) 5.418 Tj
21.6719 -18.3273 Td
(T_FILE 3583) 6.622 Tj
-2.13163e-14 -19.6364 Td
(SYS_link 2714) 7.826 Tj
24.0799 -19.6364 Td
(3583 4558 5266) 8.428 Tj
2.408 -20.9455 Td
(2714 3167) 5.418 Tj
21.6719 -20.9455 Td
(T_FPERR 2819) 7.224 Tj
-2.84217e-14 -22.2545 Td
(SYS_mkdir 2715) 8.428 Tj
24.0799 -22.2545 Td
(2819) 2.408 Tj
2.408 -23.5636 Td
(2715 3170) 5.418 Tj
21.6719 -23.5636 Td
(T_GPFLT 2816) 7.224 Tj
-3.55271e-14 -24.8727 Td
(SYS_mknod 2711) 8.428 Tj
24.0799 -24.8727 Td
(2816) 2.408 Tj
2.408 -26.1818 Td
(2711 3158) 5.418 Tj
21.6719 -26.1818 Td
(T_ILLOP 2809) 7.224 Tj
-4.26326e-14 -27.4909 Td
(SYS_open 2710) 7.826 Tj
24.0799 -27.4909 Td
(2809) 2.408 Tj
2.408 -28.8 Td
(2710 3155) 5.418 Tj
21.6719 -28.8 Td
(TIMER_16BIT 6883) 9.632 Tj
-4.9738e-14 -30.1091 Td
(SYS_pipe 2704) 7.826 Tj
24.0799 -30.1091 Td
(6883 6890) 5.418 Tj
2.408 -31.4182 Td
(2704 3137) 5.418 Tj
21.6719 -31.4182 Td
(TIMER_BCD 6884) 8.428 Tj
-5.68434e-14 -32.7273 Td
(SYS_read 2706) 7.826 Tj
24.0799 -32.7273 Td
(6884) 2.408 Tj
2.408 -34.0364 Td
(2706 3143) 5.418 Tj
21.6719 -34.0364 Td
(TIMER_FREQ 6864) 9.03 Tj
-6.39488e-14 -35.3454 Td
(SYS_sbrk 2719) 7.826 Tj
24.0799 -35.3454 Td
(6861 6864 6865) 8.428 Tj
2.408 -36.6545 Td
(2719 3182) 5.418 Tj
21.6719 -36.6545 Td
(TIMER_HWSTROBE 6879) 11.438 Tj
-7.10543e-14 -37.9636 Td
(SYS_unlink 2712) 9.03 Tj
24.0799 -37.9636 Td
(6879) 2.408 Tj
2.408 -39.2727 Td
(2712 3161) 5.418 Tj
21.6719 -39.2727 Td
(TIMER_INTTC 6874) 9.632 Tj
-7.81597e-14 -40.5818 Td
(SYS_wait 2703) 7.826 Tj
24.0799 -40.5818 Td
(6874) 2.408 Tj
2.408 -41.8909 Td
(2703 3134) 5.418 Tj
21.6719 -41.8909 Td
(TIMER_LATCH 6880) 9.632 Tj
-8.52651e-14 -43.2 Td
(SYS_write 2705) 8.428 Tj
24.0799 -43.2 Td
(6880) 2.408 Tj
2.408 -44.5091 Td
(2705 3140) 5.418 Tj
21.6719 -44.5091 Td
(TIMER_LSB 6881) 8.428 Tj
-9.23706e-14 -45.8182 Td
(tail 3734) 5.418 Tj
24.0799 -45.8182 Td
(6881) 2.408 Tj
2.408 -47.1272 Td
(3722 3734 3792 3806) 11.438 Tj
21.6719 -47.1272 Td
(TIMER_MSB 6882) 8.428 Tj
2.408 -48.4363 Td
(3807 3836 3860 3862) 11.438 Tj
24.0799 -48.4363 Td
(6882) 2.408 Tj
2.408 -49.7454 Td
(3940) 2.408 Tj
21.6719 -49.7454 Td
(TIMER_ONESHOT 6875) 10.836 Tj
-9.9476e-14 -51.0545 Td
(T_ALIGN 2820) 7.224 Tj
24.0799 -51.0545 Td
(6875) 2.408 Tj
2.408 -52.3636 Td
(2820) 2.408 Tj
21.6719 -52.3636 Td
(TIMER_RATEGEN 6876) 10.836 Tj
-1.06581e-13 -53.6727 Td
(taskstate 0687) 8.428 Tj
24.0799 -53.6727 Td
(6876 6890) 5.418 Tj
2.408 -54.9818 Td
(0687 1965) 5.418 Tj
21.6719 -54.9818 Td
(TIMER_SEL0 6871) 9.03 Tj
-1.13687e-13 -56.2909 Td
(T_BOUND 2808) 7.224 Tj
24.0799 -56.2909 Td
(6871 6890) 5.418 Tj
2.408 -57.6 Td
(2808) 2.408 Tj
21.6719 -57.6 Td
(TIMER_SEL1 6872) 9.03 Tj
-1.20792e-13 -58.9091 Td
(T_BRKPT 2806) 7.224 Tj
24.0799 -58.9091 Td
(6872) 2.408 Tj
2.408 -60.2181 Td
(2806) 2.408 Tj
21.6719 -60.2181 Td
(TIMER_SEL2 6873) 9.03 Tj
-1.27898e-13 -61.5272 Td
(T_DBLFLT 2811) 7.826 Tj
24.0799 -61.5272 Td
(6873) 2.408 Tj
2.408 -62.8363 Td
(2811) 2.408 Tj
21.6719 -62.8363 Td
(TIMER_SQWAVE 6877) 10.234 Tj
-1.35003e-13 -64.1454 Td
(T_DEBUG 2804) 7.224 Tj
24.0799 -64.1454 Td
(6877) 2.408 Tj
2.408 -65.4545 Td
(2804) 2.408 Tj
21.6719 -65.4545 Td
(TIMER_SWSTROBE 6878) 11.438 Tj
-1.42109e-13 -66.7636 Td
(T_DEFAULT 2827) 8.428 Tj
24.0799 -66.7636 Td
(6878) 2.408 Tj
2.408 -68.0727 Td
(2827) 2.408 Tj
21.6719 -68.0727 Td
(T_MCHK 2821) 6.622 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  cross-references  Page 12) 26.488 Tj
2.40799 -3.92728 Td
(2821) 2.408 Tj
24.0799 -3.92728 Td
(2826 2870 2885 3017) 11.438 Tj
-1e-05 -5.23637 Td
(T_NMI 2805) 6.02 Tj
21.6719 -5.23637 Td
(T_TSS 2813) 6.02 Tj
2.40799 -6.54546 Td
(2805) 2.408 Tj
24.0799 -6.54546 Td
(2813) 2.408 Tj
-1e-05 -7.85455 Td
(T_OFLOW 2807) 7.224 Tj
21.6719 -7.85455 Td
(tvinit 2864) 6.622 Tj
2.40799 -9.16364 Td
(2807) 2.408 Tj
24.0799 -9.16364 Td
(0233 1255 2864) 8.428 Tj
-1e-05 -10.4727 Td
(T_PGFLT 2817) 7.224 Tj
21.6719 -10.4727 Td
(unlink 4802) 6.622 Tj
2.40799 -11.7818 Td
(2817) 2.408 Tj
24.0799 -11.7818 Td
(0339 4802 4815 4821) 11.438 Tj
-1e-05 -13.0909 Td
(trap 2880) 5.418 Tj
24.0799 -13.0909 Td
(4829 5436) 5.418 Tj
2.40799 -14.4 Td
(0232 0500 0512 0731) 11.438 Tj
21.6719 -14.4 Td
(wakeup 2353) 6.622 Tj
2.40799 -15.7091 Td
(0750 0751 0752 0753) 11.438 Tj
24.0799 -15.7091 Td
(0219 2316 2317 2353) 11.438 Tj
2.40799 -17.0182 Td
(0754 0757 1255 1344) 11.438 Tj
24.0799 -17.0182 Td
(3792 3861 4045 4362) 11.438 Tj
2.40799 -18.3273 Td
(2362 2751 2758 2764) 11.438 Tj
24.0799 -18.3273 Td
(4446 5667 5670 5692) 11.438 Tj
2.40799 -19.6364 Td
(2800 2880 2938 2944) 11.438 Tj
24.0799 -19.6364 Td
(5701 5728 6798) 8.428 Tj
2.40799 -20.9455 Td
(2945 2952 2954) 8.428 Tj
21.6719 -20.9455 Td
(wakeup1 2342) 7.224 Tj
-1e-05 -22.2545 Td
(trapframe 0501) 8.428 Tj
24.0799 -22.2545 Td
(2342 2356 2408 2461) 11.438 Tj
2.40799 -23.5636 Td
(0501 1332 1348 1941) 11.438 Tj
21.6719 -23.5636 Td
(wdir 4716) 5.418 Tj
2.40799 -24.8727 Td
(2015 2138 2139 2763) 11.438 Tj
24.0799 -24.8727 Td
(4716 4724 4736 4786) 11.438 Tj
2.40799 -26.1818 Td
(2880) 2.408 Tj
24.0799 -26.1818 Td
(4880) 2.408 Tj
-1e-05 -27.4909 Td
(T_SEGNP 2814) 7.224 Tj
21.6719 -27.4909 Td
(write_eflags 0443) 10.234 Tj
2.40799 -28.8 Td
(2814) 2.408 Tj
24.0799 -28.8 Td
(0443) 2.408 Tj
-1e-05 -30.1091 Td
(T_SIMDERR 2822) 8.428 Tj
21.6719 -30.1091 Td
(writei 4552) 6.622 Tj
2.40799 -31.4182 Td
(2822) 2.408 Tj
24.0799 -31.4182 Td
(0336 4552 4590 4735) 11.438 Tj
-1e-05 -32.7273 Td
(T_STACK 2815) 7.224 Tj
24.0799 -32.7273 Td
(4820 4960 5378 5382) 11.438 Tj
2.40799 -34.0364 Td
(2815) 2.408 Tj
21.6719 -34.0364 Td
(yield 2268) 6.02 Tj
-1e-05 -35.3454 Td
(T_SYSCALL 2826) 8.428 Tj
24.0799 -35.3454 Td
(0224 2268 2917) 8.428 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 8 8
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/types.h  Page 1) 22.876 Tj
0 -3.92728 Td
(0100 typedef unsigned int uint;) 18.662 Tj
0 -5.23637 Td
(0101 typedef unsigned short ushort;) 21.07 Tj
0 -6.54546 Td
(0102 typedef unsigned char uchar;) 19.866 Tj
0 -7.85455 Td
(0103 ) 3.01 Tj
0 -9.16364 Td
(0104 ) 3.01 Tj
0 -10.4727 Td
(0105 ) 3.01 Tj
0 -11.7818 Td
(0106 ) 3.01 Tj
0 -13.0909 Td
(0107 ) 3.01 Tj
0 -14.4 Td
(0108 ) 3.01 Tj
0 -15.7091 Td
(0109 ) 3.01 Tj
0 -17.0182 Td
(0110 ) 3.01 Tj
0 -18.3273 Td
(0111 ) 3.01 Tj
0 -19.6364 Td
(0112 ) 3.01 Tj
0 -20.9455 Td
(0113 ) 3.01 Tj
0 -22.2545 Td
(0114 ) 3.01 Tj
0 -23.5636 Td
(0115 ) 3.01 Tj
0 -24.8727 Td
(0116 ) 3.01 Tj
0 -26.1818 Td
(0117 ) 3.01 Tj
0 -27.4909 Td
(0118 ) 3.01 Tj
0 -28.8 Td
(0119 ) 3.01 Tj
0 -30.1091 Td
(0120 ) 3.01 Tj
0 -31.4182 Td
(0121 ) 3.01 Tj
0 -32.7273 Td
(0122 ) 3.01 Tj
0 -34.0364 Td
(0123 ) 3.01 Tj
0 -35.3454 Td
(0124 ) 3.01 Tj
0 -36.6545 Td
(0125 ) 3.01 Tj
0 -37.9636 Td
(0126 ) 3.01 Tj
0 -39.2727 Td
(0127 ) 3.01 Tj
0 -40.5818 Td
(0128 ) 3.01 Tj
0 -41.8909 Td
(0129 ) 3.01 Tj
0 -43.2 Td
(0130 ) 3.01 Tj
0 -44.5091 Td
(0131 ) 3.01 Tj
0 -45.8182 Td
(0132 ) 3.01 Tj
0 -47.1272 Td
(0133 ) 3.01 Tj
0 -48.4363 Td
(0134 ) 3.01 Tj
0 -49.7454 Td
(0135 ) 3.01 Tj
0 -51.0545 Td
(0136 ) 3.01 Tj
0 -52.3636 Td
(0137 ) 3.01 Tj
0 -53.6727 Td
(0138 ) 3.01 Tj
0 -54.9818 Td
(0139 ) 3.01 Tj
0 -56.2909 Td
(0140 ) 3.01 Tj
0 -57.6 Td
(0141 ) 3.01 Tj
0 -58.9091 Td
(0142 ) 3.01 Tj
0 -60.2181 Td
(0143 ) 3.01 Tj
0 -61.5272 Td
(0144 ) 3.01 Tj
0 -62.8363 Td
(0145 ) 3.01 Tj
0 -64.1454 Td
(0146 ) 3.01 Tj
0 -65.4545 Td
(0147 ) 3.01 Tj
0 -66.7636 Td
(0148 ) 3.01 Tj
0 -68.0727 Td
(0149 ) 3.01 Tj
0 -72 Td
(Sheet 01) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/param.h  Page 1) 22.876 Tj
0 -3.92728 Td
(0150 #define NPROC        64  // maximum number of processes) 36.12 Tj
0 -5.23637 Td
(0151 #define PAGE       4096  // granularity of user-space memory allocation) 45.752 Tj
0 -6.54546 Td
(0152 #define KSTACKSIZE PAGE  // size of per-process kernel stack) 39.13 Tj
0 -7.85455 Td
(0153 #define NCPU          8  // maximum number of CPUs) 33.11 Tj
0 -9.16364 Td
(0154 #define NOFILE       16  // open files per process) 33.11 Tj
0 -10.4727 Td
(0155 #define NFILE       100  // open files per system) 32.508 Tj
0 -11.7818 Td
(0156 #define NREQUEST    100  // outstanding disk requests) 34.916 Tj
0 -13.0909 Td
(0157 #define NBUF         10  // size of disk block cache) 34.314 Tj
0 -14.4 Td
(0158 #define NINODE      100  // maximum number of active i-nodes) 39.13 Tj
0 -15.7091 Td
(0159 #define NDEV         10  // maximum major device number) 36.12 Tj
0 -17.0182 Td
(0160 ) 3.01 Tj
0 -18.3273 Td
(0161 ) 3.01 Tj
0 -19.6364 Td
(0162 ) 3.01 Tj
0 -20.9455 Td
(0163 ) 3.01 Tj
0 -22.2545 Td
(0164 ) 3.01 Tj
0 -23.5636 Td
(0165 ) 3.01 Tj
0 -24.8727 Td
(0166 ) 3.01 Tj
0 -26.1818 Td
(0167 ) 3.01 Tj
0 -27.4909 Td
(0168 ) 3.01 Tj
0 -28.8 Td
(0169 ) 3.01 Tj
0 -30.1091 Td
(0170 ) 3.01 Tj
0 -31.4182 Td
(0171 ) 3.01 Tj
0 -32.7273 Td
(0172 ) 3.01 Tj
0 -34.0364 Td
(0173 ) 3.01 Tj
0 -35.3454 Td
(0174 ) 3.01 Tj
0 -36.6545 Td
(0175 ) 3.01 Tj
0 -37.9636 Td
(0176 ) 3.01 Tj
0 -39.2727 Td
(0177 ) 3.01 Tj
0 -40.5818 Td
(0178 ) 3.01 Tj
0 -41.8909 Td
(0179 ) 3.01 Tj
0 -43.2 Td
(0180 ) 3.01 Tj
0 -44.5091 Td
(0181 ) 3.01 Tj
0 -45.8182 Td
(0182 ) 3.01 Tj
0 -47.1272 Td
(0183 ) 3.01 Tj
0 -48.4363 Td
(0184 ) 3.01 Tj
0 -49.7454 Td
(0185 ) 3.01 Tj
0 -51.0545 Td
(0186 ) 3.01 Tj
0 -52.3636 Td
(0187 ) 3.01 Tj
0 -53.6727 Td
(0188 ) 3.01 Tj
0 -54.9818 Td
(0189 ) 3.01 Tj
0 -56.2909 Td
(0190 ) 3.01 Tj
0 -57.6 Td
(0191 ) 3.01 Tj
0 -58.9091 Td
(0192 ) 3.01 Tj
0 -60.2181 Td
(0193 ) 3.01 Tj
0 -61.5272 Td
(0194 ) 3.01 Tj
0 -62.8363 Td
(0195 ) 3.01 Tj
0 -64.1454 Td
(0196 ) 3.01 Tj
0 -65.4545 Td
(0197 ) 3.01 Tj
0 -66.7636 Td
(0198 ) 3.01 Tj
0 -68.0727 Td
(0199 ) 3.01 Tj
0 -72 Td
(Sheet 01) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 9 9
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/defs.h  Page 1) 22.274 Tj
0 -3.92728 Td
(0200 // kalloc.c) 9.632 Tj
0 -5.23637 Td
(0201 char* kalloc\(int\);) 13.846 Tj
0 -6.54546 Td
(0202 void kfree\(char*, int\);) 16.856 Tj
0 -7.85455 Td
(0203 void kinit\(void\);) 13.244 Tj
0 -9.16364 Td
(0204 ) 3.01 Tj
0 -10.4727 Td
(0205 // console.c) 10.234 Tj
0 -11.7818 Td
(0206 void console_init\(void\);) 17.458 Tj
0 -13.0909 Td
(0207 void cprintf\(char*, ...\);) 18.06 Tj
0 -14.4 Td
(0208 void panic\(char*\);) 13.846 Tj
0 -15.7091 Td
(0209 void kbd_intr\(void\);) 15.05 Tj
0 -17.0182 Td
(0210 ) 3.01 Tj
0 -18.3273 Td
(0211 // proc.c) 8.428 Tj
0 -19.6364 Td
(0212 void pinit\(void\);) 13.244 Tj
0 -20.9455 Td
(0213 struct proc;) 10.234 Tj
0 -22.2545 Td
(0214 void setupsegs\(struct proc*\);) 20.468 Tj
0 -23.5636 Td
(0215 struct proc* copyproc\(struct proc*\);) 24.682 Tj
0 -24.8727 Td
(0216 struct spinlock;) 12.642 Tj
0 -26.1818 Td
(0217 int growproc\(int\);) 13.846 Tj
0 -27.4909 Td
(0218 void sleep\(void*, struct spinlock*\);) 24.682 Tj
0 -28.8 Td
(0219 void wakeup\(void*\);) 14.448 Tj
0 -30.1091 Td
(0220 void scheduler\(void\);) 15.652 Tj
0 -31.4182 Td
(0221 void proc_exit\(void\);) 15.652 Tj
0 -32.7273 Td
(0222 int proc_kill\(int\);) 14.448 Tj
0 -34.0364 Td
(0223 int proc_wait\(void\);) 15.05 Tj
0 -35.3454 Td
(0224 void yield\(void\);) 13.244 Tj
0 -36.6545 Td
(0225 void procdump\(void\);) 15.05 Tj
0 -37.9636 Td
(0226 ) 3.01 Tj
0 -39.2727 Td
(0227 // setjmp.S) 9.632 Tj
0 -40.5818 Td
(0228 struct jmpbuf;) 11.438 Tj
0 -41.8909 Td
(0229 int setjmp\(struct jmpbuf*\);) 19.264 Tj
0 -43.2 Td
(0230 void longjmp\(struct jmpbuf*\);) 20.468 Tj
0 -44.5091 Td
(0231 ) 3.01 Tj
0 -45.8182 Td
(0232 // trap.c) 8.428 Tj
0 -47.1272 Td
(0233 void tvinit\(void\);) 13.846 Tj
0 -48.4363 Td
(0234 void idtinit\(void\);) 14.448 Tj
0 -49.7454 Td
(0235 ) 3.01 Tj
0 -51.0545 Td
(0236 // string.c) 9.632 Tj
0 -52.3636 Td
(0237 void* memset\(void*, int, uint\);) 21.672 Tj
0 -53.6727 Td
(0238 int memcmp\(const void*, const void*, uint\);) 28.896 Tj
0 -54.9818 Td
(0239 void* memmove\(void*, const void*, uint\);) 27.09 Tj
0 -56.2909 Td
(0240 int strncmp\(const char*, const char*, uint\);) 29.498 Tj
0 -57.6 Td
(0241 ) 3.01 Tj
0 -58.9091 Td
(0242 // syscall.c) 10.234 Tj
0 -60.2181 Td
(0243 void syscall\(void\);) 14.448 Tj
0 -61.5272 Td
(0244 int fetchint\(struct proc*, uint, int*\);) 26.488 Tj
0 -62.8363 Td
(0245 int fetchstr\(struct proc*, uint, char**\);) 27.692 Tj
0 -64.1454 Td
(0246 int argint\(int, int*\);) 16.254 Tj
0 -65.4545 Td
(0247 int argptr\(int, char**, int\);) 20.468 Tj
0 -66.7636 Td
(0248 int argstr\(int, char**\);) 17.458 Tj
0 -68.0727 Td
(0249 ) 3.01 Tj
0 -72 Td
(Sheet 02) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/defs.h  Page 2) 22.274 Tj
0 -3.92728 Td
(0250 // picirq.c) 9.632 Tj
0 -5.23637 Td
(0251 void pic_init\(void\);) 15.05 Tj
0 -6.54546 Td
(0252 void irq_enable\(int\);) 15.652 Tj
0 -7.85455 Td
(0253 ) 3.01 Tj
0 -9.16364 Td
(0254 // 8253pit.c) 10.234 Tj
0 -10.4727 Td
(0255 void pit8253_timerinit\(void\);) 20.468 Tj
0 -11.7818 Td
(0256 ) 3.01 Tj
0 -13.0909 Td
(0257 // mp.c) 7.224 Tj
0 -14.4 Td
(0258 extern int ismp;) 12.642 Tj
0 -15.7091 Td
(0259 void mp_init\(void\);) 14.448 Tj
0 -17.0182 Td
(0260 void mp_startthem\(void\);) 17.458 Tj
0 -18.3273 Td
(0261 int mp_bcpu\(void\);) 13.846 Tj
0 -19.6364 Td
(0262 ) 3.01 Tj
0 -20.9455 Td
(0263 // lapic.c) 9.03 Tj
0 -22.2545 Td
(0264 extern uint *lapicaddr;) 16.856 Tj
0 -23.5636 Td
(0265 void lapic_init\(int\);) 15.652 Tj
0 -24.8727 Td
(0266 void lapic_startap\(uchar, int\);) 21.672 Tj
0 -26.1818 Td
(0267 void lapic_timerinit\(void\);) 19.264 Tj
0 -27.4909 Td
(0268 void lapic_timerintr\(void\);) 19.264 Tj
0 -28.8 Td
(0269 void lapic_enableintr\(void\);) 19.866 Tj
0 -30.1091 Td
(0270 void lapic_disableintr\(void\);) 20.468 Tj
0 -31.4182 Td
(0271 void lapic_eoi\(void\);) 15.652 Tj
0 -32.7273 Td
(0272 int cpu\(void\);) 11.438 Tj
0 -34.0364 Td
(0273 ) 3.01 Tj
0 -35.3454 Td
(0274 // ioapic.c) 9.632 Tj
0 -36.6545 Td
(0275 extern uchar ioapic_id;) 16.856 Tj
0 -37.9636 Td
(0276 void ioapic_init\(void\);) 16.856 Tj
0 -39.2727 Td
(0277 void ioapic_enable\(int irq, int cpu\);) 25.284 Tj
0 -40.5818 Td
(0278 ) 3.01 Tj
0 -41.8909 Td
(0279 // spinlock.c) 10.836 Tj
0 -43.2 Td
(0280 struct spinlock;) 12.642 Tj
0 -44.5091 Td
(0281 void initlock\(struct spinlock*, char*\);) 26.488 Tj
0 -45.8182 Td
(0282 void acquire\(struct spinlock*\);) 21.672 Tj
0 -47.1272 Td
(0283 void release\(struct spinlock*\);) 21.672 Tj
0 -48.4363 Td
(0284 int holding\(struct spinlock*\);) 21.07 Tj
0 -49.7454 Td
(0285 void getcallerpcs\(void*, uint*\);) 22.274 Tj
0 -51.0545 Td
(0286 ) 3.01 Tj
0 -52.3636 Td
(0287 // main.c) 8.428 Tj
0 -53.6727 Td
(0288 void load_icode\(struct proc*, uchar*, uint\);) 29.498 Tj
0 -54.9818 Td
(0289 ) 3.01 Tj
0 -56.2909 Td
(0290 // pipe.c) 8.428 Tj
0 -57.6 Td
(0291 struct pipe;) 10.234 Tj
0 -58.9091 Td
(0292 struct file;) 10.234 Tj
0 -60.2181 Td
(0293 int pipe_alloc\(struct file**, struct file**\);) 30.1 Tj
0 -61.5272 Td
(0294 void pipe_close\(struct pipe*, int\);) 24.08 Tj
0 -62.8363 Td
(0295 int pipe_write\(struct pipe*, char*, int\);) 27.692 Tj
0 -64.1454 Td
(0296 int pipe_read\(struct pipe*, char*, int\);) 27.09 Tj
0 -65.4545 Td
(0297 ) 3.01 Tj
0 -66.7636 Td
(0298 ) 3.01 Tj
0 -68.0727 Td
(0299 ) 3.01 Tj
0 -72 Td
(Sheet 02) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 10 10
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/defs.h  Page 3) 22.274 Tj
0 -3.92728 Td
(0300 // file.c) 8.428 Tj
0 -5.23637 Td
(0301 struct stat;) 10.234 Tj
0 -6.54546 Td
(0302 void fileinit\(void\);) 15.05 Tj
0 -7.85455 Td
(0303 struct file* filealloc\(void\);) 20.468 Tj
0 -9.16364 Td
(0304 void fileclose\(struct file*\);) 20.468 Tj
0 -10.4727 Td
(0305 int fileread\(struct file*, char*, int n\);) 27.692 Tj
0 -11.7818 Td
(0306 int filewrite\(struct file*, char*, int n\);) 28.294 Tj
0 -13.0909 Td
(0307 int filestat\(struct file*, struct stat*\);) 27.692 Tj
0 -14.4 Td
(0308 void fileincref\(struct file*\);) 21.07 Tj
0 -15.7091 Td
(0309 ) 3.01 Tj
0 -17.0182 Td
(0310 // ide.c) 7.826 Tj
0 -18.3273 Td
(0311 void ide_init\(void\);) 15.05 Tj
0 -19.6364 Td
(0312 void ide_intr\(void\);) 15.05 Tj
0 -20.9455 Td
(0313 void ide_rw\(int, uint, void*, uint, int\);) 27.692 Tj
0 -22.2545 Td
(0314 ) 3.01 Tj
0 -23.5636 Td
(0315 // bio.c) 7.826 Tj
0 -24.8727 Td
(0316 void binit\(void\);) 13.244 Tj
0 -26.1818 Td
(0317 struct buf;) 9.632 Tj
0 -27.4909 Td
(0318 struct buf* getblk\(uint dev, uint sector\);) 28.294 Tj
0 -28.8 Td
(0319 struct buf* bread\(uint, uint\);) 21.07 Tj
0 -30.1091 Td
(0320 void bwrite\(struct buf*, uint\);) 21.672 Tj
0 -31.4182 Td
(0321 void brelse\(struct buf*\);) 18.06 Tj
0 -32.7273 Td
(0322 ) 3.01 Tj
0 -34.0364 Td
(0323 // fs.c) 7.224 Tj
0 -35.3454 Td
(0324 extern uint rootdev;) 15.05 Tj
0 -36.6545 Td
(0325 void iinit\(void\);) 13.244 Tj
0 -37.9636 Td
(0326 struct inode* iget\(uint, uint\);) 21.672 Tj
0 -39.2727 Td
(0327 void ilock\(struct inode*\);) 18.662 Tj
0 -40.5818 Td
(0328 void iunlock\(struct inode*\);) 19.866 Tj
0 -41.8909 Td
(0329 void itrunc\(struct inode*\);) 19.264 Tj
0 -43.2 Td
(0330 void idecref\(struct inode*\);) 19.866 Tj
0 -44.5091 Td
(0331 void iincref\(struct inode*\);) 19.866 Tj
0 -45.8182 Td
(0332 void iput\(struct inode*\);) 18.06 Tj
0 -47.1272 Td
(0333 struct inode* namei\(char*, int, uint*, char**, struct inode**\);) 40.936 Tj
0 -48.4363 Td
(0334 void stati\(struct inode*, struct stat*\);) 27.09 Tj
0 -49.7454 Td
(0335 int readi\(struct inode*, char*, uint, uint\);) 29.498 Tj
0 -51.0545 Td
(0336 int writei\(struct inode*, char*, uint, uint\);) 30.1 Tj
0 -52.3636 Td
(0337 struct inode* mknod\(char*, short, short, short\);) 31.906 Tj
0 -53.6727 Td
(0338 struct inode* mknod1\(struct inode*, char*, short, short, short\);) 41.538 Tj
0 -54.9818 Td
(0339 int unlink\(char*\);) 13.846 Tj
0 -56.2909 Td
(0340 void iupdate\(struct inode*\);) 19.866 Tj
0 -57.6 Td
(0341 int link\(char*, char*\);) 16.856 Tj
0 -58.9091 Td
(0342 ) 3.01 Tj
0 -60.2181 Td
(0343 ) 3.01 Tj
0 -61.5272 Td
(0344 ) 3.01 Tj
0 -62.8363 Td
(0345 ) 3.01 Tj
0 -64.1454 Td
(0346 ) 3.01 Tj
0 -65.4545 Td
(0347 ) 3.01 Tj
0 -66.7636 Td
(0348 ) 3.01 Tj
0 -68.0727 Td
(0349 ) 3.01 Tj
0 -72 Td
(Sheet 03) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/x86.h  Page 1) 21.672 Tj
0 -3.92728 Td
(0350 // Special assembly routines to access x86-specific) 33.712 Tj
0 -5.23637 Td
(0351 // hardware instructions.) 18.06 Tj
0 -6.54546 Td
(0352 ) 3.01 Tj
0 -7.85455 Td
(0353 static __inline uchar) 15.652 Tj
0 -9.16364 Td
(0354 inb\(int port\)) 10.836 Tj
0 -10.4727 Td
(0355 {) 3.612 Tj
0 -11.7818 Td
(0356   uchar data;) 10.836 Tj
0 -13.0909 Td
(0357   __asm __volatile\("inb %w1,%0" : "=a" \(data\) : "d" \(port\)\);) 39.13 Tj
0 -14.4 Td
(0358   return data;) 11.438 Tj
0 -15.7091 Td
(0359 }) 3.612 Tj
0 -17.0182 Td
(0360 ) 3.01 Tj
0 -18.3273 Td
(0361 static __inline void) 15.05 Tj
0 -19.6364 Td
(0362 insl\(int port, void *addr, int cnt\)) 24.08 Tj
0 -20.9455 Td
(0363 {) 3.612 Tj
0 -22.2545 Td
(0364   __asm __volatile\("cld\\n\\trepne\\n\\tinsl"     :) 31.304 Tj
0 -23.5636 Td
(0365                    "=D" \(addr\), "=c" \(cnt\)    :) 31.304 Tj
0 -24.8727 Td
(0366                    "d" \(port\), "0" \(addr\), "1" \(cnt\)  :) 36.12 Tj
0 -26.1818 Td
(0367                    "memory", "cc"\);) 24.08 Tj
0 -27.4909 Td
(0368 }) 3.612 Tj
0 -28.8 Td
(0369 ) 3.01 Tj
0 -30.1091 Td
(0370 static __inline void) 15.05 Tj
0 -31.4182 Td
(0371 outb\(int port, uchar data\)) 18.662 Tj
0 -32.7273 Td
(0372 {) 3.612 Tj
0 -34.0364 Td
(0373   __asm __volatile\("outb %0,%w1" : : "a" \(data\), "d" \(port\)\);) 39.732 Tj
0 -35.3454 Td
(0374 }) 3.612 Tj
0 -36.6545 Td
(0375 ) 3.01 Tj
0 -37.9636 Td
(0376 static __inline void) 15.05 Tj
0 -39.2727 Td
(0377 outw\(int port, ushort data\)) 19.264 Tj
0 -40.5818 Td
(0378 {) 3.612 Tj
0 -41.8909 Td
(0379   __asm __volatile\("outw %0,%w1" : : "a" \(data\), "d" \(port\)\);) 39.732 Tj
0 -43.2 Td
(0380 }) 3.612 Tj
0 -44.5091 Td
(0381 ) 3.01 Tj
0 -45.8182 Td
(0382 static __inline void) 15.05 Tj
0 -47.1272 Td
(0383 outsl\(int port, const void *addr, int cnt\)) 28.294 Tj
0 -48.4363 Td
(0384 {) 3.612 Tj
0 -49.7454 Td
(0385   __asm __volatile\("cld\\n\\trepne\\n\\toutsl"    :) 31.304 Tj
0 -51.0545 Td
(0386                    "=S" \(addr\), "=c" \(cnt\)    :) 31.304 Tj
0 -52.3636 Td
(0387                    "d" \(port\), "0" \(addr\), "1" \(cnt\)  :) 36.12 Tj
0 -53.6727 Td
(0388                    "cc"\);) 18.06 Tj
0 -54.9818 Td
(0389 }) 3.612 Tj
0 -56.2909 Td
(0390 ) 3.01 Tj
0 -57.6 Td
(0391 ) 3.01 Tj
0 -58.9091 Td
(0392 ) 3.01 Tj
0 -60.2181 Td
(0393 ) 3.01 Tj
0 -61.5272 Td
(0394 ) 3.01 Tj
0 -62.8363 Td
(0395 ) 3.01 Tj
0 -64.1454 Td
(0396 ) 3.01 Tj
0 -65.4545 Td
(0397 ) 3.01 Tj
0 -66.7636 Td
(0398 ) 3.01 Tj
0 -68.0727 Td
(0399 ) 3.01 Tj
0 -72 Td
(Sheet 03) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 11 11
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/x86.h  Page 2) 21.672 Tj
0 -3.92728 Td
(0400 struct segdesc;) 12.04 Tj
0 -5.23637 Td
(0401 ) 3.01 Tj
0 -6.54546 Td
(0402 static __inline void) 15.05 Tj
0 -7.85455 Td
(0403 lgdt\(struct segdesc *p, int size\)) 22.876 Tj
0 -9.16364 Td
(0404 {) 3.612 Tj
0 -10.4727 Td
(0405   volatile ushort pd[3];) 17.458 Tj
0 -11.7818 Td
(0406 ) 3.01 Tj
0 -13.0909 Td
(0407   pd[0] = size-1;) 13.244 Tj
0 -14.4 Td
(0408   pd[1] = \(uint\)p;) 13.846 Tj
0 -15.7091 Td
(0409   pd[2] = \(uint\)p >> 16;) 17.458 Tj
0 -17.0182 Td
(0410 ) 3.01 Tj
0 -18.3273 Td
(0411   asm volatile\("lgdt \(%0\)" : : "g" \(pd\)\);) 27.692 Tj
0 -19.6364 Td
(0412 }) 3.612 Tj
0 -20.9455 Td
(0413 ) 3.01 Tj
0 -22.2545 Td
(0414 struct gatedesc;) 12.642 Tj
0 -23.5636 Td
(0415 ) 3.01 Tj
0 -24.8727 Td
(0416 static __inline void) 15.05 Tj
0 -26.1818 Td
(0417 lidt\(struct gatedesc *p, int size\)) 23.478 Tj
0 -27.4909 Td
(0418 {) 3.612 Tj
0 -28.8 Td
(0419   volatile ushort pd[3];) 17.458 Tj
0 -30.1091 Td
(0420 ) 3.01 Tj
0 -31.4182 Td
(0421   pd[0] = size-1;) 13.244 Tj
0 -32.7273 Td
(0422   pd[1] = \(uint\)p;) 13.846 Tj
0 -34.0364 Td
(0423   pd[2] = \(uint\)p >> 16;) 17.458 Tj
0 -35.3454 Td
(0424 ) 3.01 Tj
0 -36.6545 Td
(0425   asm volatile\("lidt \(%0\)" : : "g" \(pd\)\);) 27.692 Tj
0 -37.9636 Td
(0426 }) 3.612 Tj
0 -39.2727 Td
(0427 ) 3.01 Tj
0 -40.5818 Td
(0428 static __inline void) 15.05 Tj
0 -41.8909 Td
(0429 ltr\(ushort sel\)) 12.04 Tj
0 -43.2 Td
(0430 {) 3.612 Tj
0 -44.5091 Td
(0431   __asm __volatile\("ltr %0" : : "r" \(sel\)\);) 28.896 Tj
0 -45.8182 Td
(0432 }) 3.612 Tj
0 -47.1272 Td
(0433 ) 3.01 Tj
0 -48.4363 Td
(0434 static __inline uint) 15.05 Tj
0 -49.7454 Td
(0435 read_eflags\(void\)) 13.244 Tj
0 -51.0545 Td
(0436 {) 3.612 Tj
0 -52.3636 Td
(0437   uint eflags;) 11.438 Tj
0 -53.6727 Td
(0438   __asm __volatile\("pushfl; popl %0" : "=r" \(eflags\)\);) 35.518 Tj
0 -54.9818 Td
(0439   return eflags;) 12.642 Tj
0 -56.2909 Td
(0440 }) 3.612 Tj
0 -57.6 Td
(0441 ) 3.01 Tj
0 -58.9091 Td
(0442 static __inline void) 15.05 Tj
0 -60.2181 Td
(0443 write_eflags\(uint eflags\)) 18.06 Tj
0 -61.5272 Td
(0444 {) 3.612 Tj
0 -62.8363 Td
(0445   __asm __volatile\("pushl %0; popfl" : : "r" \(eflags\)\);) 36.12 Tj
0 -64.1454 Td
(0446 }) 3.612 Tj
0 -65.4545 Td
(0447 ) 3.01 Tj
0 -66.7636 Td
(0448 ) 3.01 Tj
0 -68.0727 Td
(0449 ) 3.01 Tj
0 -72 Td
(Sheet 04) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/x86.h  Page 3) 21.672 Tj
0 -3.92728 Td
(0450 static __inline void) 15.05 Tj
0 -5.23637 Td
(0451 cpuid\(uint info, uint *eaxp, uint *ebxp, uint *ecxp, uint *edxp\)) 41.538 Tj
0 -6.54546 Td
(0452 {) 3.612 Tj
0 -7.85455 Td
(0453   uint eax, ebx, ecx, edx;) 18.662 Tj
0 -9.16364 Td
(0454   asm volatile\("cpuid" :) 17.458 Tj
0 -10.4727 Td
(0455                "=a" \(eax\), "=b" \(ebx\), "=c" \(ecx\), "=d" \(edx\) :) 40.936 Tj
0 -11.7818 Td
(0456                "a" \(info\)\);) 19.264 Tj
0 -13.0909 Td
(0457   if\(eaxp\)) 9.03 Tj
0 -14.4 Td
(0458     *eaxp = eax;) 12.642 Tj
0 -15.7091 Td
(0459   if\(ebxp\)) 9.03 Tj
0 -17.0182 Td
(0460     *ebxp = ebx;) 12.642 Tj
0 -18.3273 Td
(0461   if\(ecxp\)) 9.03 Tj
0 -19.6364 Td
(0462     *ecxp = ecx;) 12.642 Tj
0 -20.9455 Td
(0463   if\(edxp\)) 9.03 Tj
0 -22.2545 Td
(0464     *edxp = edx;) 12.642 Tj
0 -23.5636 Td
(0465 }) 3.612 Tj
0 -24.8727 Td
(0466 ) 3.01 Tj
0 -26.1818 Td
(0467 static __inline uint) 15.05 Tj
0 -27.4909 Td
(0468 cmpxchg\(uint oldval, uint newval, volatile uint* lock_addr\)) 38.528 Tj
0 -28.8 Td
(0469 {) 3.612 Tj
0 -30.1091 Td
(0470   uint result;) 11.438 Tj
0 -31.4182 Td
(0471   __asm__ __volatile__\("lock; cmpxchgl %2, %0" :) 31.906 Tj
0 -32.7273 Td
(0472                        "+m" \(*lock_addr\), "=a" \(result\) :) 37.324 Tj
0 -34.0364 Td
(0473                        "r"\(newval\), "1"\(oldval\) :) 32.508 Tj
0 -35.3454 Td
(0474                        "cc"\);) 20.468 Tj
0 -36.6545 Td
(0475   return result;) 12.642 Tj
0 -37.9636 Td
(0476 }) 3.612 Tj
0 -39.2727 Td
(0477 ) 3.01 Tj
0 -40.5818 Td
(0478 static __inline void) 15.05 Tj
0 -41.8909 Td
(0479 cli\(void\)) 8.428 Tj
0 -43.2 Td
(0480 {) 3.612 Tj
0 -44.5091 Td
(0481   __asm__ volatile\("cli"\);) 18.662 Tj
0 -45.8182 Td
(0482 }) 3.612 Tj
0 -47.1272 Td
(0483 ) 3.01 Tj
0 -48.4363 Td
(0484 static __inline void) 15.05 Tj
0 -49.7454 Td
(0485 sti\(void\)) 8.428 Tj
0 -51.0545 Td
(0486 {) 3.612 Tj
0 -52.3636 Td
(0487   __asm__ volatile\("sti"\);) 18.662 Tj
0 -53.6727 Td
(0488 }) 3.612 Tj
0 -54.9818 Td
(0489 ) 3.01 Tj
0 -56.2909 Td
(0490 ) 3.01 Tj
0 -57.6 Td
(0491 ) 3.01 Tj
0 -58.9091 Td
(0492 ) 3.01 Tj
0 -60.2181 Td
(0493 ) 3.01 Tj
0 -61.5272 Td
(0494 ) 3.01 Tj
0 -62.8363 Td
(0495 ) 3.01 Tj
0 -64.1454 Td
(0496 ) 3.01 Tj
0 -65.4545 Td
(0497 ) 3.01 Tj
0 -66.7636 Td
(0498 ) 3.01 Tj
0 -68.0727 Td
(0499 ) 3.01 Tj
0 -72 Td
(Sheet 04) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 12 12
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/x86.h  Page 4) 21.672 Tj
0 -3.92728 Td
(0500 // Layout of the trap frame on the stack upon entry to trap.) 39.13 Tj
0 -5.23637 Td
(0501 struct trapframe {) 13.846 Tj
0 -6.54546 Td
(0502   // registers as pushed by pusha) 22.876 Tj
0 -7.85455 Td
(0503   uint edi;) 9.632 Tj
0 -9.16364 Td
(0504   uint esi;) 9.632 Tj
0 -10.4727 Td
(0505   uint ebp;) 9.632 Tj
0 -11.7818 Td
(0506   uint oesp;      // useless & ignored) 25.886 Tj
0 -13.0909 Td
(0507   uint ebx;) 9.632 Tj
0 -14.4 Td
(0508   uint edx;) 9.632 Tj
0 -15.7091 Td
(0509   uint ecx;) 9.632 Tj
0 -17.0182 Td
(0510   uint eax;) 9.632 Tj
0 -18.3273 Td
(0511 ) 3.01 Tj
0 -19.6364 Td
(0512   // rest of trap frame) 16.856 Tj
0 -20.9455 Td
(0513   ushort es;) 10.234 Tj
0 -22.2545 Td
(0514   ushort padding1;) 13.846 Tj
0 -23.5636 Td
(0515   ushort ds;) 10.234 Tj
0 -24.8727 Td
(0516   ushort padding2;) 13.846 Tj
0 -26.1818 Td
(0517   uint trapno;) 11.438 Tj
0 -27.4909 Td
(0518 ) 3.01 Tj
0 -28.8 Td
(0519   // below here defined by x86 hardware) 26.488 Tj
0 -30.1091 Td
(0520   uint err;) 9.632 Tj
0 -31.4182 Td
(0521   uint eip;) 9.632 Tj
0 -32.7273 Td
(0522   ushort cs;) 10.234 Tj
0 -34.0364 Td
(0523   ushort padding3;) 13.846 Tj
0 -35.3454 Td
(0524   uint eflags;) 11.438 Tj
0 -36.6545 Td
(0525 ) 3.01 Tj
0 -37.9636 Td
(0526   // below here only when crossing rings, such as from user to kernel) 44.548 Tj
0 -39.2727 Td
(0527   uint esp;) 9.632 Tj
0 -40.5818 Td
(0528   ushort ss;) 10.234 Tj
0 -41.8909 Td
(0529   ushort padding4;) 13.846 Tj
0 -43.2 Td
(0530 };) 4.214 Tj
0 -44.5091 Td
(0531 ) 3.01 Tj
0 -45.8182 Td
(0532 ) 3.01 Tj
0 -47.1272 Td
(0533 ) 3.01 Tj
0 -48.4363 Td
(0534 ) 3.01 Tj
0 -49.7454 Td
(0535 ) 3.01 Tj
0 -51.0545 Td
(0536 ) 3.01 Tj
0 -52.3636 Td
(0537 ) 3.01 Tj
0 -53.6727 Td
(0538 ) 3.01 Tj
0 -54.9818 Td
(0539 ) 3.01 Tj
0 -56.2909 Td
(0540 ) 3.01 Tj
0 -57.6 Td
(0541 ) 3.01 Tj
0 -58.9091 Td
(0542 ) 3.01 Tj
0 -60.2181 Td
(0543 ) 3.01 Tj
0 -61.5272 Td
(0544 ) 3.01 Tj
0 -62.8363 Td
(0545 ) 3.01 Tj
0 -64.1454 Td
(0546 ) 3.01 Tj
0 -65.4545 Td
(0547 ) 3.01 Tj
0 -66.7636 Td
(0548 ) 3.01 Tj
0 -68.0727 Td
(0549 ) 3.01 Tj
0 -72 Td
(Sheet 05) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/asm.h  Page 1) 21.672 Tj
0 -3.92728 Td
(0550 //) 4.214 Tj
0 -5.23637 Td
(0551 // macros to create x86 segments from assembler) 31.304 Tj
0 -6.54546 Td
(0552 //) 4.214 Tj
0 -7.85455 Td
(0553 ) 3.01 Tj
0 -9.16364 Td
(0554 #define SEG_NULLASM                                             \\) 42.14 Tj
0 -10.4727 Td
(0555         .word 0, 0;                                             \\) 42.14 Tj
0 -11.7818 Td
(0556         .byte 0, 0, 0, 0) 17.458 Tj
0 -13.0909 Td
(0557 ) 3.01 Tj
0 -14.4 Td
(0558 #define SEG_ASM\(type,base,lim\)                                  \\) 42.14 Tj
0 -15.7091 Td
(0559         .word \(\(\(lim\) >> 12\) & 0xffff\), \(\(base\) & 0xffff\);      \\) 42.14 Tj
0 -17.0182 Td
(0560         .byte \(\(\(base\) >> 16\) & 0xff\), \(0x90 | \(type\)\),         \\) 42.14 Tj
0 -18.3273 Td
(0561                 \(0xC0 | \(\(\(lim\) >> 28\) & 0xf\)\), \(\(\(base\) >> 24\) & 0xff\)) 45.752 Tj
0 -19.6364 Td
(0562 ) 3.01 Tj
0 -20.9455 Td
(0563 #define STA_X     0x8       // Executable segment) 32.508 Tj
0 -22.2545 Td
(0564 #define STA_E     0x4       // Expand down \(non-executable segments\)) 43.946 Tj
0 -23.5636 Td
(0565 #define STA_C     0x4       // Conforming code segment \(executable only\)) 46.354 Tj
0 -24.8727 Td
(0566 #define STA_W     0x2       // Writeable \(non-executable segments\)) 42.742 Tj
0 -26.1818 Td
(0567 #define STA_R     0x2       // Readable \(executable segments\)) 39.732 Tj
0 -27.4909 Td
(0568 #define STA_A     0x1       // Accessed) 26.488 Tj
0 -28.8 Td
(0569 ) 3.01 Tj
0 -30.1091 Td
(0570 ) 3.01 Tj
0 -31.4182 Td
(0571 ) 3.01 Tj
0 -32.7273 Td
(0572 ) 3.01 Tj
0 -34.0364 Td
(0573 ) 3.01 Tj
0 -35.3454 Td
(0574 ) 3.01 Tj
0 -36.6545 Td
(0575 ) 3.01 Tj
0 -37.9636 Td
(0576 ) 3.01 Tj
0 -39.2727 Td
(0577 ) 3.01 Tj
0 -40.5818 Td
(0578 ) 3.01 Tj
0 -41.8909 Td
(0579 ) 3.01 Tj
0 -43.2 Td
(0580 ) 3.01 Tj
0 -44.5091 Td
(0581 ) 3.01 Tj
0 -45.8182 Td
(0582 ) 3.01 Tj
0 -47.1272 Td
(0583 ) 3.01 Tj
0 -48.4363 Td
(0584 ) 3.01 Tj
0 -49.7454 Td
(0585 ) 3.01 Tj
0 -51.0545 Td
(0586 ) 3.01 Tj
0 -52.3636 Td
(0587 ) 3.01 Tj
0 -53.6727 Td
(0588 ) 3.01 Tj
0 -54.9818 Td
(0589 ) 3.01 Tj
0 -56.2909 Td
(0590 ) 3.01 Tj
0 -57.6 Td
(0591 ) 3.01 Tj
0 -58.9091 Td
(0592 ) 3.01 Tj
0 -60.2181 Td
(0593 ) 3.01 Tj
0 -61.5272 Td
(0594 ) 3.01 Tj
0 -62.8363 Td
(0595 ) 3.01 Tj
0 -64.1454 Td
(0596 ) 3.01 Tj
0 -65.4545 Td
(0597 ) 3.01 Tj
0 -66.7636 Td
(0598 ) 3.01 Tj
0 -68.0727 Td
(0599 ) 3.01 Tj
0 -72 Td
(Sheet 05) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 13 13
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/mmu.h  Page 1) 21.672 Tj
0 -3.92728 Td
(0600 // This file contains definitions for the) 27.692 Tj
0 -5.23637 Td
(0601 // x86 memory management unit \(MMU\).) 24.682 Tj
0 -6.54546 Td
(0602 ) 3.01 Tj
0 -7.85455 Td
(0603 // Eflags register) 13.846 Tj
0 -9.16364 Td
(0604 #define FL_CF           0x00000001      // Carry Flag) 34.916 Tj
0 -10.4727 Td
(0605 #define FL_PF           0x00000004      // Parity Flag) 35.518 Tj
0 -11.7818 Td
(0606 #define FL_AF           0x00000010      // Auxiliary carry Flag) 40.936 Tj
0 -13.0909 Td
(0607 #define FL_ZF           0x00000040      // Zero Flag) 34.314 Tj
0 -14.4 Td
(0608 #define FL_SF           0x00000080      // Sign Flag) 34.314 Tj
0 -15.7091 Td
(0609 #define FL_TF           0x00000100      // Trap Flag) 34.314 Tj
0 -17.0182 Td
(0610 #define FL_IF           0x00000200      // Interrupt Enable) 38.528 Tj
0 -18.3273 Td
(0611 #define FL_DF           0x00000400      // Direction Flag) 37.324 Tj
0 -19.6364 Td
(0612 #define FL_OF           0x00000800      // Overflow Flag) 36.722 Tj
0 -20.9455 Td
(0613 #define FL_IOPL_MASK    0x00003000      // I/O Privilege Level bitmask) 45.15 Tj
0 -22.2545 Td
(0614 #define FL_IOPL_0       0x00000000      //   IOPL == 0) 35.518 Tj
0 -23.5636 Td
(0615 #define FL_IOPL_1       0x00001000      //   IOPL == 1) 35.518 Tj
0 -24.8727 Td
(0616 #define FL_IOPL_2       0x00002000      //   IOPL == 2) 35.518 Tj
0 -26.1818 Td
(0617 #define FL_IOPL_3       0x00003000      //   IOPL == 3) 35.518 Tj
0 -27.4909 Td
(0618 #define FL_NT           0x00004000      // Nested Task) 35.518 Tj
0 -28.8 Td
(0619 #define FL_RF           0x00010000      // Resume Flag) 35.518 Tj
0 -30.1091 Td
(0620 #define FL_VM           0x00020000      // Virtual 8086 mode) 39.13 Tj
0 -31.4182 Td
(0621 #define FL_AC           0x00040000      // Alignment Check) 37.926 Tj
0 -32.7273 Td
(0622 #define FL_VIF          0x00080000      // Virtual Interrupt Flag) 42.14 Tj
0 -34.0364 Td
(0623 #define FL_VIP          0x00100000      // Virtual Interrupt Pending) 43.946 Tj
0 -35.3454 Td
(0624 #define FL_ID           0x00200000      // ID flag) 33.11 Tj
0 -36.6545 Td
(0625 ) 3.01 Tj
0 -37.9636 Td
(0626 // Segment Descriptor) 15.652 Tj
0 -39.2727 Td
(0627 struct segdesc {) 12.642 Tj
0 -40.5818 Td
(0628   uint lim_15_0 : 16;  // Low bits of segment limit) 33.712 Tj
0 -41.8909 Td
(0629   uint base_15_0 : 16; // Low bits of segment base address) 37.926 Tj
0 -43.2 Td
(0630   uint base_23_16 : 8; // Middle bits of segment base address) 39.732 Tj
0 -44.5091 Td
(0631   uint type : 4;       // Segment type \(see STS_ constants\)) 38.528 Tj
0 -45.8182 Td
(0632   uint s : 1;          // 0 = system, 1 = application) 34.916 Tj
0 -47.1272 Td
(0633   uint dpl : 2;        // Descriptor Privilege Level) 34.314 Tj
0 -48.4363 Td
(0634   uint p : 1;          // Present) 22.876 Tj
0 -49.7454 Td
(0635   uint lim_19_16 : 4;  // High bits of segment limit) 34.314 Tj
0 -51.0545 Td
(0636   uint avl : 1;        // Unused \(available for software use\)) 39.732 Tj
0 -52.3636 Td
(0637   uint rsv1 : 1;       // Reserved) 23.478 Tj
0 -53.6727 Td
(0638   uint db : 1;         // 0 = 16-bit segment, 1 = 32-bit segment) 41.538 Tj
0 -54.9818 Td
(0639   uint g : 1;          // Granularity: limit scaled by 4K when set) 42.742 Tj
0 -56.2909 Td
(0640   uint base_31_24 : 8; // High bits of segment base address) 38.528 Tj
0 -57.6 Td
(0641 };) 4.214 Tj
0 -58.9091 Td
(0642 ) 3.01 Tj
0 -60.2181 Td
(0643 ) 3.01 Tj
0 -61.5272 Td
(0644 ) 3.01 Tj
0 -62.8363 Td
(0645 ) 3.01 Tj
0 -64.1454 Td
(0646 ) 3.01 Tj
0 -65.4545 Td
(0647 ) 3.01 Tj
0 -66.7636 Td
(0648 ) 3.01 Tj
0 -68.0727 Td
(0649 ) 3.01 Tj
0 -72 Td
(Sheet 06) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/mmu.h  Page 2) 21.672 Tj
0 -3.92728 Td
(0650 // Null segment) 12.04 Tj
0 -5.23637 Td
(0651 #define SEG_NULL        \(struct segdesc\){ 0,0,0,0,0,0,0,0,0,0,0,0,0 }) 44.548 Tj
0 -6.54546 Td
(0652 ) 3.01 Tj
0 -7.85455 Td
(0653 // Normal segment) 13.244 Tj
0 -9.16364 Td
(0654 #define SEG\(type, base, lim, dpl\) \(struct segdesc\)                      \\) 46.956 Tj
0 -10.4727 Td
(0655 { \(\(lim\) >> 12\) & 0xffff, \(base\) & 0xffff, \(\(base\) >> 16\) & 0xff,       \\) 46.956 Tj
0 -11.7818 Td
(0656     type, 1, dpl, 1, \(uint\) \(lim\) >> 28, 0, 0, 1, 1,            \\) 42.14 Tj
0 -13.0909 Td
(0657     \(uint\) \(base\) >> 24 }) 18.06 Tj
0 -14.4 Td
(0658 ) 3.01 Tj
0 -15.7091 Td
(0659 #define SEG16\(type, base, lim, dpl\) \(struct segdesc\)                    \\) 46.956 Tj
0 -17.0182 Td
(0660 { \(lim\) & 0xffff, \(base\) & 0xffff, \(\(base\) >> 16\) & 0xff,               \\) 46.956 Tj
0 -18.3273 Td
(0661     type, 1, dpl, 1, \(uint\) \(lim\) >> 16, 0, 0, 1, 0,            \\) 42.14 Tj
0 -19.6364 Td
(0662     \(uint\) \(base\) >> 24 }) 18.06 Tj
0 -20.9455 Td
(0663 ) 3.01 Tj
0 -22.2545 Td
(0664 // Application segment type bits) 22.274 Tj
0 -23.5636 Td
(0665 #define STA_X       0x8     // Executable segment) 32.508 Tj
0 -24.8727 Td
(0666 #define STA_E       0x4     // Expand down \(non-executable segments\)) 43.946 Tj
0 -26.1818 Td
(0667 #define STA_C       0x4     // Conforming code segment \(executable only\)) 46.354 Tj
0 -27.4909 Td
(0668 #define STA_W       0x2     // Writeable \(non-executable segments\)) 42.742 Tj
0 -28.8 Td
(0669 #define STA_R       0x2     // Readable \(executable segments\)) 39.732 Tj
0 -30.1091 Td
(0670 #define STA_A       0x1     // Accessed) 26.488 Tj
0 -31.4182 Td
(0671 ) 3.01 Tj
0 -32.7273 Td
(0672 // System segment type bits) 19.264 Tj
0 -34.0364 Td
(0673 #define STS_T16A    0x1     // Available 16-bit TSS) 33.712 Tj
0 -35.3454 Td
(0674 #define STS_LDT     0x2     // Local Descriptor Table) 34.916 Tj
0 -36.6545 Td
(0675 #define STS_T16B    0x3     // Busy 16-bit TSS) 30.702 Tj
0 -37.9636 Td
(0676 #define STS_CG16    0x4     // 16-bit Call Gate) 31.304 Tj
0 -39.2727 Td
(0677 #define STS_TG      0x5     // Task Gate / Coum Transmitions) 39.13 Tj
0 -40.5818 Td
(0678 #define STS_IG16    0x6     // 16-bit Interrupt Gate) 34.314 Tj
0 -41.8909 Td
(0679 #define STS_TG16    0x7     // 16-bit Trap Gate) 31.304 Tj
0 -43.2 Td
(0680 #define STS_T32A    0x9     // Available 32-bit TSS) 33.712 Tj
0 -44.5091 Td
(0681 #define STS_T32B    0xB     // Busy 32-bit TSS) 30.702 Tj
0 -45.8182 Td
(0682 #define STS_CG32    0xC     // 32-bit Call Gate) 31.304 Tj
0 -47.1272 Td
(0683 #define STS_IG32    0xE     // 32-bit Interrupt Gate) 34.314 Tj
0 -48.4363 Td
(0684 #define STS_TG32    0xF     // 32-bit Trap Gate) 31.304 Tj
0 -49.7454 Td
(0685 ) 3.01 Tj
0 -51.0545 Td
(0686 // Task state segment format) 19.866 Tj
0 -52.3636 Td
(0687 struct taskstate {) 13.846 Tj
0 -53.6727 Td
(0688   uint link;      // Old ts selector) 24.682 Tj
0 -54.9818 Td
(0689   uint esp0;      // Stack pointers and segment selectors) 37.324 Tj
0 -56.2909 Td
(0690   ushort ss0;     //   after an increase in privilege level) 38.528 Tj
0 -57.6 Td
(0691   ushort padding1;) 13.846 Tj
0 -58.9091 Td
(0692   uint *esp1;) 10.836 Tj
0 -60.2181 Td
(0693   ushort ss1;) 10.836 Tj
0 -61.5272 Td
(0694   ushort padding2;) 13.846 Tj
0 -62.8363 Td
(0695   uint *esp2;) 10.836 Tj
0 -64.1454 Td
(0696   ushort ss2;) 10.836 Tj
0 -65.4545 Td
(0697   ushort padding3;) 13.846 Tj
0 -66.7636 Td
(0698   void *cr3;     // Page directory base) 26.488 Tj
0 -68.0727 Td
(0699   uint *eip;     // Saved state from last task switch) 34.916 Tj
0 -72 Td
(Sheet 06) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 14 14
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/mmu.h  Page 3) 21.672 Tj
0 -3.92728 Td
(0700   uint eflags;) 11.438 Tj
0 -5.23637 Td
(0701   uint eax;       // More saved state \(registers\)) 32.508 Tj
0 -6.54546 Td
(0702   uint ecx;) 9.632 Tj
0 -7.85455 Td
(0703   uint edx;) 9.632 Tj
0 -9.16364 Td
(0704   uint ebx;) 9.632 Tj
0 -10.4727 Td
(0705   uint *esp;) 10.234 Tj
0 -11.7818 Td
(0706   uint *ebp;) 10.234 Tj
0 -13.0909 Td
(0707   uint esi;) 9.632 Tj
0 -14.4 Td
(0708   uint edi;) 9.632 Tj
0 -15.7091 Td
(0709   ushort es;              // Even more saved state \(segment selectors\)) 45.15 Tj
0 -17.0182 Td
(0710   ushort padding4;) 13.846 Tj
0 -18.3273 Td
(0711   ushort cs;) 10.234 Tj
0 -19.6364 Td
(0712   ushort padding5;) 13.846 Tj
0 -20.9455 Td
(0713   ushort ss;) 10.234 Tj
0 -22.2545 Td
(0714   ushort padding6;) 13.846 Tj
0 -23.5636 Td
(0715   ushort ds;) 10.234 Tj
0 -24.8727 Td
(0716   ushort padding7;) 13.846 Tj
0 -26.1818 Td
(0717   ushort fs;) 10.234 Tj
0 -27.4909 Td
(0718   ushort padding8;) 13.846 Tj
0 -28.8 Td
(0719   ushort gs;) 10.234 Tj
0 -30.1091 Td
(0720   ushort padding9;) 13.846 Tj
0 -31.4182 Td
(0721   ushort ldt;) 10.836 Tj
0 -32.7273 Td
(0722   ushort padding10;) 14.448 Tj
0 -34.0364 Td
(0723   ushort t;               // Trap on task switch) 31.906 Tj
0 -35.3454 Td
(0724   ushort iomb;    // I/O map base address) 27.692 Tj
0 -36.6545 Td
(0725 };) 4.214 Tj
0 -37.9636 Td
(0726 ) 3.01 Tj
0 -39.2727 Td
(0727 // Gate descriptors for interrupts and traps) 29.498 Tj
0 -40.5818 Td
(0728 struct gatedesc {) 13.244 Tj
0 -41.8909 Td
(0729   uint off_15_0 : 16;   // low 16 bits of offset in segment) 38.528 Tj
0 -43.2 Td
(0730   uint ss : 16;         // segment selector) 28.896 Tj
0 -44.5091 Td
(0731   uint args : 5;        // # args, 0 for interrupt/trap gates) 39.732 Tj
0 -45.8182 Td
(0732   uint rsv1 : 3;        // reserved\(should be zero I guess\)) 38.528 Tj
0 -47.1272 Td
(0733   uint type : 4;        // type\(STS_{TG,IG32,TG32}\)) 33.712 Tj
0 -48.4363 Td
(0734   uint s : 1;           // must be 0 \(system\)) 30.1 Tj
0 -49.7454 Td
(0735   uint dpl : 2;         // descriptor\(meaning new\) privilege level) 42.742 Tj
0 -51.0545 Td
(0736   uint p : 1;           // Present) 23.478 Tj
0 -52.3636 Td
(0737   uint off_31_16 : 16;  // high bits of offset in segment) 37.324 Tj
0 -53.6727 Td
(0738 };) 4.214 Tj
0 -54.9818 Td
(0739 ) 3.01 Tj
0 -56.2909 Td
(0740 ) 3.01 Tj
0 -57.6 Td
(0741 ) 3.01 Tj
0 -58.9091 Td
(0742 ) 3.01 Tj
0 -60.2181 Td
(0743 ) 3.01 Tj
0 -61.5272 Td
(0744 ) 3.01 Tj
0 -62.8363 Td
(0745 ) 3.01 Tj
0 -64.1454 Td
(0746 ) 3.01 Tj
0 -65.4545 Td
(0747 ) 3.01 Tj
0 -66.7636 Td
(0748 ) 3.01 Tj
0 -68.0727 Td
(0749 ) 3.01 Tj
0 -72 Td
(Sheet 07) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/mmu.h  Page 4) 21.672 Tj
0 -3.92728 Td
(0750 // Set up a normal interrupt/trap gate descriptor.) 33.11 Tj
0 -5.23637 Td
(0751 // - istrap: 1 for a trap \(= exception\) gate, 0 for an interrupt gate.) 45.15 Tj
0 -6.54546 Td
(0752 //   interrupt gate clears FL_IF, trap gate leaves FL_IF alone) 40.334 Tj
0 -7.85455 Td
(0753 // - sel: Code segment selector for interrupt/trap handler) 37.926 Tj
0 -9.16364 Td
(0754 // - off: Offset in code segment for interrupt/trap handler) 38.528 Tj
0 -10.4727 Td
(0755 // - dpl: Descriptor Privilege Level -) 25.886 Tj
0 -11.7818 Td
(0756 //        the privilege level required for software to invoke) 39.732 Tj
0 -13.0909 Td
(0757 //        this interrupt/trap gate explicitly using an int instruction.) 45.752 Tj
0 -14.4 Td
(0758 #define SETGATE\(gate, istrap, sel, off, d\)                      \\) 42.14 Tj
0 -15.7091 Td
(0759 {                                                               \\) 42.14 Tj
0 -17.0182 Td
(0760   \(gate\).off_15_0 = \(uint\) \(off\) & 0xffff;                \\) 38.528 Tj
0 -18.3273 Td
(0761   \(gate\).ss = \(sel\);                                      \\) 38.528 Tj
0 -19.6364 Td
(0762   \(gate\).args = 0;                                        \\) 38.528 Tj
0 -20.9455 Td
(0763   \(gate\).rsv1 = 0;                                        \\) 38.528 Tj
0 -22.2545 Td
(0764   \(gate\).type = \(istrap\) ? STS_TG32 : STS_IG32;   \\) 33.712 Tj
0 -23.5636 Td
(0765   \(gate\).s = 0;                                   \\) 33.712 Tj
0 -24.8727 Td
(0766   \(gate\).dpl = \(d\);                                       \\) 38.528 Tj
0 -26.1818 Td
(0767   \(gate\).p = 1;                                   \\) 33.712 Tj
0 -27.4909 Td
(0768   \(gate\).off_31_16 = \(uint\) \(off\) >> 16;          \\) 33.712 Tj
0 -28.8 Td
(0769 }) 3.612 Tj
0 -30.1091 Td
(0770 ) 3.01 Tj
0 -31.4182 Td
(0771 ) 3.01 Tj
0 -32.7273 Td
(0772 ) 3.01 Tj
0 -34.0364 Td
(0773 ) 3.01 Tj
0 -35.3454 Td
(0774 ) 3.01 Tj
0 -36.6545 Td
(0775 ) 3.01 Tj
0 -37.9636 Td
(0776 ) 3.01 Tj
0 -39.2727 Td
(0777 ) 3.01 Tj
0 -40.5818 Td
(0778 ) 3.01 Tj
0 -41.8909 Td
(0779 ) 3.01 Tj
0 -43.2 Td
(0780 ) 3.01 Tj
0 -44.5091 Td
(0781 ) 3.01 Tj
0 -45.8182 Td
(0782 ) 3.01 Tj
0 -47.1272 Td
(0783 ) 3.01 Tj
0 -48.4363 Td
(0784 ) 3.01 Tj
0 -49.7454 Td
(0785 ) 3.01 Tj
0 -51.0545 Td
(0786 ) 3.01 Tj
0 -52.3636 Td
(0787 ) 3.01 Tj
0 -53.6727 Td
(0788 ) 3.01 Tj
0 -54.9818 Td
(0789 ) 3.01 Tj
0 -56.2909 Td
(0790 ) 3.01 Tj
0 -57.6 Td
(0791 ) 3.01 Tj
0 -58.9091 Td
(0792 ) 3.01 Tj
0 -60.2181 Td
(0793 ) 3.01 Tj
0 -61.5272 Td
(0794 ) 3.01 Tj
0 -62.8363 Td
(0795 ) 3.01 Tj
0 -64.1454 Td
(0796 ) 3.01 Tj
0 -65.4545 Td
(0797 ) 3.01 Tj
0 -66.7636 Td
(0798 ) 3.01 Tj
0 -68.0727 Td
(0799 ) 3.01 Tj
0 -72 Td
(Sheet 07) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 15 15
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/elf.h  Page 1) 21.672 Tj
0 -3.92728 Td
(0800 // Format of an ELF executable file) 24.08 Tj
0 -5.23637 Td
(0801 ) 3.01 Tj
0 -6.54546 Td
(0802 #define ELF_MAGIC 0x464C457FU  // "\\x7FELF" in little endian) 39.13 Tj
0 -7.85455 Td
(0803 ) 3.01 Tj
0 -9.16364 Td
(0804 // File header) 11.438 Tj
0 -10.4727 Td
(0805 struct elfhdr {) 12.04 Tj
0 -11.7818 Td
(0806   uint magic;  // must equal ELF_MAGIC) 25.886 Tj
0 -13.0909 Td
(0807   uchar elf[12];) 12.642 Tj
0 -14.4 Td
(0808   ushort type;) 11.438 Tj
0 -15.7091 Td
(0809   ushort machine;) 13.244 Tj
0 -17.0182 Td
(0810   uint version;) 12.04 Tj
0 -18.3273 Td
(0811   uint entry;) 10.836 Tj
0 -19.6364 Td
(0812   uint phoff;) 10.836 Tj
0 -20.9455 Td
(0813   uint shoff;) 10.836 Tj
0 -22.2545 Td
(0814   uint flags;) 10.836 Tj
0 -23.5636 Td
(0815   ushort ehsize;) 12.642 Tj
0 -24.8727 Td
(0816   ushort phentsize;) 14.448 Tj
0 -26.1818 Td
(0817   ushort phnum;) 12.04 Tj
0 -27.4909 Td
(0818   ushort shentsize;) 14.448 Tj
0 -28.8 Td
(0819   ushort shnum;) 12.04 Tj
0 -30.1091 Td
(0820   ushort shstrndx;) 13.846 Tj
0 -31.4182 Td
(0821 };) 4.214 Tj
0 -32.7273 Td
(0822 ) 3.01 Tj
0 -34.0364 Td
(0823 // Program section header) 18.06 Tj
0 -35.3454 Td
(0824 struct proghdr {) 12.642 Tj
0 -36.6545 Td
(0825   uint type;) 10.234 Tj
0 -37.9636 Td
(0826   uint offset;) 11.438 Tj
0 -39.2727 Td
(0827   uint va;) 9.03 Tj
0 -40.5818 Td
(0828   uint pa;) 9.03 Tj
0 -41.8909 Td
(0829   uint filesz;) 11.438 Tj
0 -43.2 Td
(0830   uint memsz;) 10.836 Tj
0 -44.5091 Td
(0831   uint flags;) 10.836 Tj
0 -45.8182 Td
(0832   uint align;) 10.836 Tj
0 -47.1272 Td
(0833 };) 4.214 Tj
0 -48.4363 Td
(0834 ) 3.01 Tj
0 -49.7454 Td
(0835 // Values for Proghdr type) 18.662 Tj
0 -51.0545 Td
(0836 #define ELF_PROG_LOAD           1) 22.876 Tj
0 -52.3636 Td
(0837 ) 3.01 Tj
0 -53.6727 Td
(0838 // Flag bits for Proghdr flags) 21.07 Tj
0 -54.9818 Td
(0839 #define ELF_PROG_FLAG_EXEC      1) 22.876 Tj
0 -56.2909 Td
(0840 #define ELF_PROG_FLAG_WRITE     2) 22.876 Tj
0 -57.6 Td
(0841 #define ELF_PROG_FLAG_READ      4) 22.876 Tj
0 -58.9091 Td
(0842 ) 3.01 Tj
0 -60.2181 Td
(0843 ) 3.01 Tj
0 -61.5272 Td
(0844 ) 3.01 Tj
0 -62.8363 Td
(0845 ) 3.01 Tj
0 -64.1454 Td
(0846 ) 3.01 Tj
0 -65.4545 Td
(0847 ) 3.01 Tj
0 -66.7636 Td
(0848 ) 3.01 Tj
0 -68.0727 Td
(0849 ) 3.01 Tj
0 -72 Td
(Sheet 08) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/mp.h  Page 1) 21.07 Tj
0 -3.92728 Td
(0850 // See MultiProcessor Specification Version 1.[14].) 33.712 Tj
0 -5.23637 Td
(0851 ) 3.01 Tj
0 -6.54546 Td
(0852 struct mp {             // floating pointer) 28.896 Tj
0 -7.85455 Td
(0853   uchar signature[4];           // "_MP_") 27.692 Tj
0 -9.16364 Td
(0854   void *physaddr;               // phys addr of MP config table) 40.936 Tj
0 -10.4727 Td
(0855   uchar length;                 // 1) 24.682 Tj
0 -11.7818 Td
(0856   uchar specrev;                // [14]) 26.488 Tj
0 -13.0909 Td
(0857   uchar checksum;               // all bytes must add up to 0) 39.732 Tj
0 -14.4 Td
(0858   uchar type;                   // MP system config type) 36.722 Tj
0 -15.7091 Td
(0859   uchar imcrp;) 11.438 Tj
0 -17.0182 Td
(0860   uchar reserved[3];) 15.05 Tj
0 -18.3273 Td
(0861 };) 4.214 Tj
0 -19.6364 Td
(0862 ) 3.01 Tj
0 -20.9455 Td
(0863 struct mpctb {          // configuration table header) 34.916 Tj
0 -22.2545 Td
(0864   uchar signature[4];           // "PCMP") 27.692 Tj
0 -23.5636 Td
(0865   ushort length;                // total table length) 34.916 Tj
0 -24.8727 Td
(0866   uchar version;                // [14]) 26.488 Tj
0 -26.1818 Td
(0867   uchar checksum;               // all bytes must add up to 0) 39.732 Tj
0 -27.4909 Td
(0868   uchar product[20];            // product id) 30.1 Tj
0 -28.8 Td
(0869   uint *oemtable;               // OEM table pointer) 34.314 Tj
0 -30.1091 Td
(0870   ushort oemlength;             // OEM table length) 33.712 Tj
0 -31.4182 Td
(0871   ushort entry;                 // entry count) 30.702 Tj
0 -32.7273 Td
(0872   uint *lapicaddr;              // address of local APIC) 36.722 Tj
0 -34.0364 Td
(0873   ushort xlength;               // extended table length) 36.722 Tj
0 -35.3454 Td
(0874   uchar xchecksum;              // extended table checksum) 37.926 Tj
0 -36.6545 Td
(0875   uchar reserved;) 13.244 Tj
0 -37.9636 Td
(0876 };) 4.214 Tj
0 -39.2727 Td
(0877 ) 3.01 Tj
0 -40.5818 Td
(0878 struct mppe {           // processor table entry) 31.906 Tj
0 -41.8909 Td
(0879   uchar type;                   // entry type \(0\)) 32.508 Tj
0 -43.2 Td
(0880   uchar apicid;                 // local APIC id) 31.906 Tj
0 -44.5091 Td
(0881   uchar version;                // local APIC verison) 34.916 Tj
0 -45.8182 Td
(0882   uchar flags;                  // CPU flags) 29.498 Tj
0 -47.1272 Td
(0883   uchar signature[4];           // CPU signature) 31.906 Tj
0 -48.4363 Td
(0884   uint feature;                 // feature flags from CPUID instruction) 45.752 Tj
0 -49.7454 Td
(0885   uchar reserved[8];) 15.05 Tj
0 -51.0545 Td
(0886 };) 4.214 Tj
0 -52.3636 Td
(0887 ) 3.01 Tj
0 -53.6727 Td
(0888 struct mpbe {           // bus table entry) 28.294 Tj
0 -54.9818 Td
(0889   uchar type;                   // entry type \(1\)) 32.508 Tj
0 -56.2909 Td
(0890   uchar busno;                  // bus id) 27.692 Tj
0 -57.6 Td
(0891   char string[6];               // bus type string) 33.11 Tj
0 -58.9091 Td
(0892 };) 4.214 Tj
0 -60.2181 Td
(0893 ) 3.01 Tj
0 -61.5272 Td
(0894 ) 3.01 Tj
0 -62.8363 Td
(0895 ) 3.01 Tj
0 -64.1454 Td
(0896 ) 3.01 Tj
0 -65.4545 Td
(0897 ) 3.01 Tj
0 -66.7636 Td
(0898 ) 3.01 Tj
0 -68.0727 Td
(0899 ) 3.01 Tj
0 -72 Td
(Sheet 08) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 16 16
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/mp.h  Page 2) 21.07 Tj
0 -3.92728 Td
(0900 struct mpioapic {       // I/O APIC table entry) 31.304 Tj
0 -5.23637 Td
(0901   uchar type;                   // entry type \(2\)) 32.508 Tj
0 -6.54546 Td
(0902   uchar apicno;                 // I/O APIC id) 30.702 Tj
0 -7.85455 Td
(0903   uchar version;                // I/O APIC version) 33.712 Tj
0 -9.16364 Td
(0904   uchar flags;                  // I/O APIC flags) 32.508 Tj
0 -10.4727 Td
(0905   uint *addr;                  // I/O APIC address) 33.11 Tj
0 -11.7818 Td
(0906 };) 4.214 Tj
0 -13.0909 Td
(0907 ) 3.01 Tj
0 -14.4 Td
(0908 struct mpie {           // interrupt table entry) 31.906 Tj
0 -15.7091 Td
(0909   uchar type;                   // entry type \([34]\)) 34.314 Tj
0 -17.0182 Td
(0910   uchar intr;                   // interrupt type) 32.508 Tj
0 -18.3273 Td
(0911   ushort flags;                 // interrupt flag) 32.508 Tj
0 -19.6364 Td
(0912   uchar busno;                  // source bus id) 31.906 Tj
0 -20.9455 Td
(0913   uchar irq;                    // source bus irq) 32.508 Tj
0 -22.2545 Td
(0914   uchar apicno;                 // destination APIC id) 35.518 Tj
0 -23.5636 Td
(0915   uchar intin;                  // destination APIC [L]INTIN#) 39.732 Tj
0 -24.8727 Td
(0916 };) 4.214 Tj
0 -26.1818 Td
(0917 ) 3.01 Tj
0 -27.4909 Td
(0918 enum {                  // table entry types) 29.498 Tj
0 -28.8 Td
(0919   MPPROCESSOR   = 0x00,         // one entry per processor) 37.926 Tj
0 -30.1091 Td
(0920   MPBUS = 0x01,                 // one entry per bus) 34.314 Tj
0 -31.4182 Td
(0921   MPIOAPIC = 0x02,              // one entry per I/O APIC) 37.324 Tj
0 -32.7273 Td
(0922   MPIOINTR = 0x03,              // one entry per bus interrupt source) 44.548 Tj
0 -34.0364 Td
(0923   MPLINTR = 0x04,               // one entry per system interrupt source) 46.354 Tj
0 -35.3454 Td
(0924 ) 3.01 Tj
0 -36.6545 Td
(0925   MPSASM = 0x80,) 12.642 Tj
0 -37.9636 Td
(0926   MPHIERARCHY   = 0x81,) 16.856 Tj
0 -39.2727 Td
(0927   MPCBASM = 0x82,) 13.244 Tj
0 -40.5818 Td
(0928 ) 3.01 Tj
0 -41.8909 Td
(0929                         // PCMPprocessor and PCMPioapic flags) 39.732 Tj
0 -43.2 Td
(0930   MPEN = 0x01,                  // enabled) 28.294 Tj
0 -44.5091 Td
(0931   MPBP = 0x02,                  // bootstrap processor) 35.518 Tj
0 -45.8182 Td
(0932 ) 3.01 Tj
0 -47.1272 Td
(0933                         // PCMPiointr and PCMPlintr flags) 37.324 Tj
0 -48.4363 Td
(0934   MPPOMASK = 0x03,              // polarity conforms to bus specs) 42.14 Tj
0 -49.7454 Td
(0935   MPHIGH = 0x01,                // active high) 30.702 Tj
0 -51.0545 Td
(0936   MPLOW = 0x03,                 // active low) 30.1 Tj
0 -52.3636 Td
(0937   MPELMASK = 0x0C,              // trigger mode of APIC input signals) 44.548 Tj
0 -53.6727 Td
(0938   MPEDGE = 0x04,                // edge-triggered) 32.508 Tj
0 -54.9818 Td
(0939   MPLEVEL = 0x0C,               // level-triggered) 33.11 Tj
0 -56.2909 Td
(0940 ) 3.01 Tj
0 -57.6 Td
(0941                         // PCMPiointr and PCMPlintr interrupt type) 42.742 Tj
0 -58.9091 Td
(0942   MPINT = 0x00,                 // vectored interrupt from APIC Rdt) 43.344 Tj
0 -60.2181 Td
(0943   MPNMI = 0x01,                 // non-maskable interrupt) 37.324 Tj
0 -61.5272 Td
(0944   MPSMI = 0x02,                 // system management interrupt) 40.334 Tj
0 -62.8363 Td
(0945   MPExtINT = 0x03,              // vectored interrupt from external PIC) 45.752 Tj
0 -64.1454 Td
(0946 };) 4.214 Tj
0 -65.4545 Td
(0947 ) 3.01 Tj
0 -66.7636 Td
(0948 ) 3.01 Tj
0 -68.0727 Td
(0949 ) 3.01 Tj
0 -72 Td
(Sheet 09) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/mp.h  Page 3) 21.07 Tj
0 -3.92728 Td
(0950 // Common bits for) 13.846 Tj
0 -5.23637 Td
(0951 //      I/O APIC Redirection Table Entry;) 27.692 Tj
0 -6.54546 Td
(0952 //      Local APIC Local Interrupt Vector Table;) 31.906 Tj
0 -7.85455 Td
(0953 //      Local APIC Inter-Processor Interrupt;) 30.1 Tj
0 -9.16364 Td
(0954 //      Local APIC Timer Vector Table.) 25.886 Tj
0 -10.4727 Td
(0955 enum {) 6.622 Tj
0 -11.7818 Td
(0956   APIC_FIXED     = 0x00000000,  // [10:8] Delivery Mode) 36.12 Tj
0 -13.0909 Td
(0957   APIC_LOWEST    = 0x00000100,  // Lowest priority) 33.11 Tj
0 -14.4 Td
(0958   APIC_SMI       = 0x00000200,  // System Management Interrupt) 40.334 Tj
0 -15.7091 Td
(0959   APIC_RR        = 0x00000300,  // Remote Read) 30.702 Tj
0 -17.0182 Td
(0960   APIC_NMI       = 0x00000400,) 21.07 Tj
0 -18.3273 Td
(0961   APIC_INIT      = 0x00000500,  // INIT/RESET) 30.1 Tj
0 -19.6364 Td
(0962   APIC_STARTUP   = 0x00000600,  // Startup IPI) 30.702 Tj
0 -20.9455 Td
(0963   APIC_EXTINT    = 0x00000700,) 21.07 Tj
0 -22.2545 Td
(0964 ) 3.01 Tj
0 -23.5636 Td
(0965   APIC_PHYSICAL  = 0x00000000,  // [11] Destination Mode \(RW\)) 39.732 Tj
0 -24.8727 Td
(0966   APIC_LOGICAL   = 0x00000800,) 21.07 Tj
0 -26.1818 Td
(0967 ) 3.01 Tj
0 -27.4909 Td
(0968   APIC_DELIVS    = 0x00001000,  // [12] Delivery Status \(RO\)) 39.13 Tj
0 -28.8 Td
(0969   APIC_HIGH      = 0x00000000,  // [13] Interrupt Input Pin Polarity \(RW\)) 46.956 Tj
0 -30.1091 Td
(0970   APIC_LOW       = 0x00002000,) 21.07 Tj
0 -31.4182 Td
(0971   APIC_REMOTEIRR = 0x00004000,  // [14] Remote IRR \(RO\)) 36.12 Tj
0 -32.7273 Td
(0972   APIC_EDGE      = 0x00000000,  // [15] Trigger Mode \(RW\)) 37.324 Tj
0 -34.0364 Td
(0973   APIC_LEVEL     = 0x00008000,) 21.07 Tj
0 -35.3454 Td
(0974   APIC_IMASK     = 0x00010000,  // [16] Interrupt Mask) 35.518 Tj
0 -36.6545 Td
(0975 };) 4.214 Tj
0 -37.9636 Td
(0976 ) 3.01 Tj
0 -39.2727 Td
(0977 ) 3.01 Tj
0 -40.5818 Td
(0978 ) 3.01 Tj
0 -41.8909 Td
(0979 ) 3.01 Tj
0 -43.2 Td
(0980 ) 3.01 Tj
0 -44.5091 Td
(0981 ) 3.01 Tj
0 -45.8182 Td
(0982 ) 3.01 Tj
0 -47.1272 Td
(0983 ) 3.01 Tj
0 -48.4363 Td
(0984 ) 3.01 Tj
0 -49.7454 Td
(0985 ) 3.01 Tj
0 -51.0545 Td
(0986 ) 3.01 Tj
0 -52.3636 Td
(0987 ) 3.01 Tj
0 -53.6727 Td
(0988 ) 3.01 Tj
0 -54.9818 Td
(0989 ) 3.01 Tj
0 -56.2909 Td
(0990 ) 3.01 Tj
0 -57.6 Td
(0991 ) 3.01 Tj
0 -58.9091 Td
(0992 ) 3.01 Tj
0 -60.2181 Td
(0993 ) 3.01 Tj
0 -61.5272 Td
(0994 ) 3.01 Tj
0 -62.8363 Td
(0995 ) 3.01 Tj
0 -64.1454 Td
(0996 ) 3.01 Tj
0 -65.4545 Td
(0997 ) 3.01 Tj
0 -66.7636 Td
(0998 ) 3.01 Tj
0 -68.0727 Td
(0999 ) 3.01 Tj
0 -72 Td
(Sheet 09) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 17 17
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/bootasm.S  Page 1) 24.08 Tj
0 -3.92728 Td
(1000 #include "asm.h") 12.642 Tj
0 -5.23637 Td
(1001 ) 3.01 Tj
0 -6.54546 Td
(1002 .set PROT_MODE_CSEG,0x8         # code segment selector) 36.12 Tj
0 -7.85455 Td
(1003 .set PROT_MODE_DSEG,0x10        # data segment selector) 36.12 Tj
0 -9.16364 Td
(1004 .set CR0_PE_ON,0x1              # protected mode enable flag) 39.13 Tj
0 -10.4727 Td
(1005 ) 3.01 Tj
0 -11.7818 Td
(1006 #########################################################################) 46.956 Tj
0 -13.0909 Td
(1007 # ENTRY POINT for the bootstrap processor) 27.692 Tj
0 -14.4 Td
(1008 #   This code should be stored in the first sector of the hard disk.) 43.946 Tj
0 -15.7091 Td
(1009 #   After the BIOS initializes the hardware on startup or system reset,) 45.752 Tj
0 -17.0182 Td
(1010 #   it loads this code at physical address 0x7c00 - 0x7d00 \(512 bytes\).) 45.752 Tj
0 -18.3273 Td
(1011 #   Then the BIOS jumps to the beginning of it, address 0x7c00,) 40.936 Tj
0 -19.6364 Td
(1012 #   while running in 16-bit real-mode \(8086 compatibility mode\).) 41.538 Tj
0 -20.9455 Td
(1013 #   The Code Segment register \(CS\) is initially zero on entry.) 40.334 Tj
0 -22.2545 Td
(1014 #) 3.612 Tj
0 -23.5636 Td
(1015 # This code switches into 32-bit protected mode so that all of) 40.334 Tj
0 -24.8727 Td
(1016 # memory can accessed, then calls into C.) 27.692 Tj
0 -26.1818 Td
(1017 #########################################################################) 46.956 Tj
0 -27.4909 Td
(1018 ) 3.01 Tj
0 -28.8 Td
(1019 .globl start                      # Entry point) 31.304 Tj
0 -30.1091 Td
(1020 start:) 6.622 Tj
0 -31.4182 Td
(1021 .code16                           # This runs in real mode) 37.926 Tj
0 -32.7273 Td
(1022   cli                             # Disable interrupts) 35.518 Tj
0 -34.0364 Td
(1023   cld                             # String operations increment) 40.936 Tj
0 -35.3454 Td
(1024 ) 3.01 Tj
0 -36.6545 Td
(1025   # Set up the important data segment registers \(DS, ES, SS\).) 39.732 Tj
0 -37.9636 Td
(1026   xorw    %ax,%ax                 # Segment number zero) 36.12 Tj
0 -39.2727 Td
(1027   movw    %ax,%ds                 # -> Data Segment) 33.712 Tj
0 -40.5818 Td
(1028   movw    %ax,%es                 # -> Extra Segment) 34.314 Tj
0 -41.8909 Td
(1029   movw    %ax,%ss                 # -> Stack Segment) 34.314 Tj
0 -43.2 Td
(1030 ) 3.01 Tj
0 -44.5091 Td
(1031   # Set up the stack pointer, growing downward from 0x7c00.) 38.528 Tj
0 -45.8182 Td
(1032   movw    $start,%sp              # Stack Pointer) 32.508 Tj
0 -47.1272 Td
(1033 ) 3.01 Tj
0 -48.4363 Td
(1034   # Enable A20:) 12.04 Tj
0 -49.7454 Td
(1035   #   For fascinating historical reasons \(related to the fact that) 42.742 Tj
0 -51.0545 Td
(1036   #   the earliest 8086-based PCs could only address 1MB of physical) 43.946 Tj
0 -52.3636 Td
(1037   #   memory and subsequent 80286-based PCs wanted to retain maximum) 43.946 Tj
0 -53.6727 Td
(1038   #   compatibility\), physical address line 20 is tied to low when the) 45.15 Tj
0 -54.9818 Td
(1039   #   machine boots.  Obviously this a bit of a drag for us, especially) 45.752 Tj
0 -56.2909 Td
(1040   #   when trying to address memory above 1MB.  This code undoes this.) 45.15 Tj
0 -57.6 Td
(1041 ) 3.01 Tj
0 -58.9091 Td
(1042 seta20.1:) 8.428 Tj
0 -60.2181 Td
(1043   inb     $0x64,%al               # Get status) 30.702 Tj
0 -61.5272 Td
(1044   testb   $0x2,%al                # Busy?) 27.692 Tj
0 -62.8363 Td
(1045   jnz     seta20.1                # Yes) 26.488 Tj
0 -64.1454 Td
(1046   movb    $0xd1,%al               # Command: Write) 33.11 Tj
0 -65.4545 Td
(1047   outb    %al,$0x64               #  output port) 31.906 Tj
0 -66.7636 Td
(1048 ) 3.01 Tj
0 -68.0727 Td
(1049 ) 3.01 Tj
0 -72 Td
(Sheet 10) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/bootasm.S  Page 2) 24.08 Tj
0 -3.92728 Td
(1050 seta20.2:) 8.428 Tj
0 -5.23637 Td
(1051   inb     $0x64,%al               # Get status) 30.702 Tj
0 -6.54546 Td
(1052   testb   $0x2,%al                # Busy?) 27.692 Tj
0 -7.85455 Td
(1053   jnz     seta20.2                # Yes) 26.488 Tj
0 -9.16364 Td
(1054   movb    $0xdf,%al               # Enable) 28.294 Tj
0 -10.4727 Td
(1055   outb    %al,$0x60               #  A20) 27.09 Tj
0 -11.7818 Td
(1056 ) 3.01 Tj
0 -13.0909 Td
(1057 # Switch from real to protected mode) 24.682 Tj
0 -14.4 Td
(1058 #  The descriptors in our GDT allow all physical memory to be accessed.) 45.752 Tj
0 -15.7091 Td
(1059 #  Furthermore, the descriptors have base addresses of 0, so that the) 44.548 Tj
0 -17.0182 Td
(1060 #  segment translation is a NOP, ie. virtual addresses are identical to) 45.752 Tj
0 -18.3273 Td
(1061 #  their physical addresses.  With this setup, immediately after) 41.538 Tj
0 -19.6364 Td
(1062 #  enabling protected mode it will still appear to this code) 39.13 Tj
0 -20.9455 Td
(1063 #  that it is running directly on physical memory with no translation.) 45.15 Tj
0 -22.2545 Td
(1064 #  This initial NOP-translation setup is required by the processor) 42.742 Tj
0 -23.5636 Td
(1065 #  to ensure that the transition to protected mode occurs smoothly.) 43.344 Tj
0 -24.8727 Td
(1066 real_to_prot:) 10.836 Tj
0 -26.1818 Td
(1067   cli                         # Mandatory since we dont set up an IDT) 44.548 Tj
0 -27.4909 Td
(1068   lgdt    gdtdesc             # load GDT -- mandatory in protected mode) 45.752 Tj
0 -28.8 Td
(1069   movl    %cr0, %eax          # turn on protected mode) 35.518 Tj
0 -30.1091 Td
(1070   orl     $CR0_PE_ON, %eax    #) 21.672 Tj
0 -31.4182 Td
(1071   movl    %eax, %cr0          #) 21.672 Tj
0 -32.7273 Td
(1072   ### CPU magic: jump to relocation, flush prefetch queue, and reload %cs) 46.956 Tj
0 -34.0364 Td
(1073   ### Has the effect of just jmp to the next instruction, but simultaneous) 47.558 Tj
0 -35.3454 Td
(1074   ### loads CS with $PROT_MODE_CSEG.) 24.682 Tj
0 -36.6545 Td
(1075   ljmp    $PROT_MODE_CSEG, $protcseg) 24.682 Tj
0 -37.9636 Td
(1076 ) 3.01 Tj
0 -39.2727 Td
(1077 #### we are in 32-bit protected mode \(hence the .code32\)) 36.722 Tj
0 -40.5818 Td
(1078 .code32) 7.224 Tj
0 -41.8909 Td
(1079 protcseg:) 8.428 Tj
0 -43.2 Td
(1080   # Set up the protected-mode data segment registers) 34.314 Tj
0 -44.5091 Td
(1081   movw    $PROT_MODE_DSEG, %ax    # Our data segment selector) 39.732 Tj
0 -45.8182 Td
(1082   movw    %ax, %ds                # -> DS: Data Segment) 36.12 Tj
0 -47.1272 Td
(1083   movw    %ax, %es                # -> ES: Extra Segment) 36.722 Tj
0 -48.4363 Td
(1084   movw    %ax, %fs                # -> FS) 27.692 Tj
0 -49.7454 Td
(1085   movw    %ax, %gs                # -> GS) 27.692 Tj
0 -51.0545 Td
(1086   movw    %ax, %ss                # -> SS: Stack Segment) 36.722 Tj
0 -52.3636 Td
(1087   call cmain                      # finish the boot load from C.) 41.538 Tj
0 -53.6727 Td
(1088                                   # cmain\(\) should not return) 39.732 Tj
0 -54.9818 Td
(1089 spin:) 6.02 Tj
0 -56.2909 Td
(1090   jmp spin                        # ..but in case it does, spin) 40.936 Tj
0 -57.6 Td
(1091 ) 3.01 Tj
0 -58.9091 Td
(1092 .p2align 2                                # force 4 byte alignment) 42.742 Tj
0 -60.2181 Td
(1093 gdt:) 5.418 Tj
0 -61.5272 Td
(1094   SEG_NULLASM                             # null seg) 34.314 Tj
0 -62.8363 Td
(1095   SEG_ASM\(STA_X|STA_R, 0x0, 0xffffffff\)   # code seg) 34.314 Tj
0 -64.1454 Td
(1096   SEG_ASM\(STA_W, 0x0, 0xffffffff\)         # data seg) 34.314 Tj
0 -65.4545 Td
(1097 gdtdesc:) 7.826 Tj
0 -66.7636 Td
(1098   .word   0x17                            # sizeof\(gdt\) - 1) 38.528 Tj
0 -68.0727 Td
(1099   .long   gdt                             # address gdt) 36.12 Tj
0 -72 Td
(Sheet 10) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 18 18
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/bootother.S  Page 1) 25.284 Tj
0 -3.92728 Td
(1100 #include "asm.h") 12.642 Tj
0 -5.23637 Td
(1101 ) 3.01 Tj
0 -6.54546 Td
(1102 # Start an Application Processor. This must be placed on a 4KB boundary) 45.752 Tj
0 -7.85455 Td
(1103 # somewhere in the 1st MB of conventional memory \(APBOOTSTRAP\). However,) 46.354 Tj
0 -9.16364 Td
(1104 # due to some shortcuts below it's restricted further to within the 1st) 45.752 Tj
0 -10.4727 Td
(1105 # 64KB. The AP starts in real-mode, with) 27.09 Tj
0 -11.7818 Td
(1106 #   CS selector set to the startup memory address/16;) 34.916 Tj
0 -13.0909 Td
(1107 #   CS base set to startup memory address;) 28.294 Tj
0 -14.4 Td
(1108 #   CS limit set to 64KB;) 18.06 Tj
0 -15.7091 Td
(1109 #   CPL and IP set to 0.) 17.458 Tj
0 -17.0182 Td
(1110 #) 3.612 Tj
0 -18.3273 Td
(1111 # mp.c causes each non-boot CPU in turn to jump to start.) 37.324 Tj
0 -19.6364 Td
(1112 # mp.c puts the correct %esp in start-4, and the place to jump) 40.334 Tj
0 -20.9455 Td
(1113 # to in start-8.) 12.642 Tj
0 -22.2545 Td
(1114 ) 3.01 Tj
0 -23.5636 Td
(1115 .set PROT_MODE_CSEG,0x8         # code segment selector) 36.12 Tj
0 -24.8727 Td
(1116 .set PROT_MODE_DSEG,0x10        # data segment selector) 36.12 Tj
0 -26.1818 Td
(1117 .set CR0_PE_ON,0x1              # protected mode enable flag) 39.13 Tj
0 -27.4909 Td
(1118 ) 3.01 Tj
0 -28.8 Td
(1119 .globl start) 10.234 Tj
0 -30.1091 Td
(1120 start:) 6.622 Tj
0 -31.4182 Td
(1121   .code16                     # This runs in real mode) 35.518 Tj
0 -32.7273 Td
(1122   cli                         # Disable interrupts) 33.11 Tj
0 -34.0364 Td
(1123   cld                         # String operations increment) 38.528 Tj
0 -35.3454 Td
(1124 ) 3.01 Tj
0 -36.6545 Td
(1125   # Set up the important data segment registers \(DS, ES, SS\).) 39.732 Tj
0 -37.9636 Td
(1126   xorw    %ax,%ax             # Segment number zero) 33.712 Tj
0 -39.2727 Td
(1127   movw    %ax,%ds             # -> Data Segment) 31.304 Tj
0 -40.5818 Td
(1128   movw    %ax,%es             # -> Extra Segment) 31.906 Tj
0 -41.8909 Td
(1129   movw    %ax,%ss             # -> Stack Segment) 31.906 Tj
0 -43.2 Td
(1130 ) 3.01 Tj
0 -44.5091 Td
(1131   # Set up the stack pointer, growing downward from 0x7000-8.) 39.732 Tj
0 -45.8182 Td
(1132   movw    $start-8,%sp        # Stack Pointer) 30.1 Tj
0 -47.1272 Td
(1133 ) 3.01 Tj
0 -48.4363 Td
(1134   # Switch from real to protected mode) 25.886 Tj
0 -49.7454 Td
(1135   #  The descriptors in our GDT allow all physical memory to be accessed.) 46.956 Tj
0 -51.0545 Td
(1136   #  Furthermore, the descriptors have base addresses of 0, so that the) 45.752 Tj
0 -52.3636 Td
(1137   #  segment translation is a NOP, ie. virtual addresses are identical to) 46.956 Tj
0 -53.6727 Td
(1138   #  their physical addresses.  With this setup, immediately after) 42.742 Tj
0 -54.9818 Td
(1139   #  enabling protected mode it will still appear to this code) 40.334 Tj
0 -56.2909 Td
(1140   #  that it is running directly on physical memory with no translation.) 46.354 Tj
0 -57.6 Td
(1141   #  This initial NOP-translation setup is required by the processor) 43.946 Tj
0 -58.9091 Td
(1142   #  to ensure that the transition to protected mode occurs smoothly.) 44.548 Tj
0 -60.2181 Td
(1143 ) 3.01 Tj
0 -61.5272 Td
(1144   lgdt    gdtdesc             # load GDT -- mandatory in protected mode) 45.752 Tj
0 -62.8363 Td
(1145   movl    %cr0, %eax          # turn on protected mode) 35.518 Tj
0 -64.1454 Td
(1146   orl     $CR0_PE_ON, %eax    #) 21.672 Tj
0 -65.4545 Td
(1147   movl    %eax, %cr0          #) 21.672 Tj
0 -66.7636 Td
(1148 ) 3.01 Tj
0 -68.0727 Td
(1149 ) 3.01 Tj
0 -72 Td
(Sheet 11) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/bootother.S  Page 2) 25.284 Tj
0 -3.92728 Td
(1150   # CPU magic: jump to relocation, flush prefetch queue, and reload %cs) 45.752 Tj
0 -5.23637 Td
(1151   # Has the effect of just jmp to the next instruction, but simultaneous) 46.354 Tj
0 -6.54546 Td
(1152   # loads CS with $PROT_MODE_CSEG.) 23.478 Tj
0 -7.85455 Td
(1153   ljmp    $PROT_MODE_CSEG, $protcseg) 24.682 Tj
0 -9.16364 Td
(1154 ) 3.01 Tj
0 -10.4727 Td
(1155 # We are now in 32-bit protected mode \(hence the .code32\)) 37.324 Tj
0 -11.7818 Td
(1156 .code32) 7.224 Tj
0 -13.0909 Td
(1157 protcseg:) 8.428 Tj
0 -14.4 Td
(1158   # Set up the protected-mode data segment registers) 34.314 Tj
0 -15.7091 Td
(1159   movw    $PROT_MODE_DSEG, %ax    # Our data segment selector) 39.732 Tj
0 -17.0182 Td
(1160   movw    %ax, %ds                # -> DS: Data Segment) 36.12 Tj
0 -18.3273 Td
(1161   movw    %ax, %es                # -> ES: Extra Segment) 36.722 Tj
0 -19.6364 Td
(1162   movw    %ax, %fs                # -> FS) 27.692 Tj
0 -20.9455 Td
(1163   movw    %ax, %gs                # -> GS) 27.692 Tj
0 -22.2545 Td
(1164   movw    %ax, %ss                # -> SS: Stack Segment) 36.722 Tj
0 -23.5636 Td
(1165 ) 3.01 Tj
0 -24.8727 Td
(1166   movl    start-8, %eax) 16.856 Tj
0 -26.1818 Td
(1167   movl    start-4, %esp) 16.856 Tj
0 -27.4909 Td
(1168   jmp     *%eax) 12.04 Tj
0 -28.8 Td
(1169 ) 3.01 Tj
0 -30.1091 Td
(1170 .p2align 2                                # force 4 byte alignment) 42.742 Tj
0 -31.4182 Td
(1171 gdt:) 5.418 Tj
0 -32.7273 Td
(1172   SEG_NULLASM                             # null seg) 34.314 Tj
0 -34.0364 Td
(1173   SEG_ASM\(STA_X|STA_R, 0x0, 0xffffffff\)   # code seg) 34.314 Tj
0 -35.3454 Td
(1174   SEG_ASM\(STA_W, 0x0, 0xffffffff\)         # data seg) 34.314 Tj
0 -36.6545 Td
(1175 ) 3.01 Tj
0 -37.9636 Td
(1176 gdtdesc:) 7.826 Tj
0 -39.2727 Td
(1177   .word   0x17                            # sizeof\(gdt\) - 1) 38.528 Tj
0 -40.5818 Td
(1178   .long   gdt                             # address gdt) 36.12 Tj
0 -41.8909 Td
(1179 ) 3.01 Tj
0 -43.2 Td
(1180 ) 3.01 Tj
0 -44.5091 Td
(1181 ) 3.01 Tj
0 -45.8182 Td
(1182 ) 3.01 Tj
0 -47.1272 Td
(1183 ) 3.01 Tj
0 -48.4363 Td
(1184 ) 3.01 Tj
0 -49.7454 Td
(1185 ) 3.01 Tj
0 -51.0545 Td
(1186 ) 3.01 Tj
0 -52.3636 Td
(1187 ) 3.01 Tj
0 -53.6727 Td
(1188 ) 3.01 Tj
0 -54.9818 Td
(1189 ) 3.01 Tj
0 -56.2909 Td
(1190 ) 3.01 Tj
0 -57.6 Td
(1191 ) 3.01 Tj
0 -58.9091 Td
(1192 ) 3.01 Tj
0 -60.2181 Td
(1193 ) 3.01 Tj
0 -61.5272 Td
(1194 ) 3.01 Tj
0 -62.8363 Td
(1195 ) 3.01 Tj
0 -64.1454 Td
(1196 ) 3.01 Tj
0 -65.4545 Td
(1197 ) 3.01 Tj
0 -66.7636 Td
(1198 ) 3.01 Tj
0 -68.0727 Td
(1199 ) 3.01 Tj
0 -72 Td
(Sheet 11) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 19 19
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/main.c  Page 1) 22.274 Tj
0 -3.92728 Td
(1200 #include "types.h") 13.846 Tj
0 -5.23637 Td
(1201 #include "param.h") 13.846 Tj
0 -6.54546 Td
(1202 #include "mmu.h") 12.642 Tj
0 -7.85455 Td
(1203 #include "proc.h") 13.244 Tj
0 -9.16364 Td
(1204 #include "defs.h") 13.244 Tj
0 -10.4727 Td
(1205 #include "x86.h") 12.642 Tj
0 -11.7818 Td
(1206 #include "traps.h") 13.846 Tj
0 -13.0909 Td
(1207 #include "syscall.h") 15.05 Tj
0 -14.4 Td
(1208 #include "elf.h") 12.642 Tj
0 -15.7091 Td
(1209 #include "param.h") 13.846 Tj
0 -17.0182 Td
(1210 #include "spinlock.h") 15.652 Tj
0 -18.3273 Td
(1211 ) 3.01 Tj
0 -19.6364 Td
(1212 extern char edata[], end[];) 19.264 Tj
0 -20.9455 Td
(1213 extern uchar _binary__init_start[], _binary__init_size[];) 37.324 Tj
0 -22.2545 Td
(1214 ) 3.01 Tj
0 -23.5636 Td
(1215 void process0\(\);) 12.642 Tj
0 -24.8727 Td
(1216 ) 3.01 Tj
0 -26.1818 Td
(1217 // Bootstrap processor starts running C code here.) 33.11 Tj
0 -27.4909 Td
(1218 // This is called main0 not main so that it can have) 34.314 Tj
0 -28.8 Td
(1219 // a void return type.  Gcc can't handle functions named) 36.722 Tj
0 -30.1091 Td
(1220 // main that don't return int.  Really.) 26.488 Tj
0 -31.4182 Td
(1221 void) 5.418 Tj
0 -32.7273 Td
(1222 main0\(void\)) 9.632 Tj
0 -34.0364 Td
(1223 {) 3.612 Tj
0 -35.3454 Td
(1224   int i;) 7.826 Tj
0 -36.6545 Td
(1225   int bcpu;) 9.632 Tj
0 -37.9636 Td
(1226   struct proc *p;) 13.244 Tj
0 -39.2727 Td
(1227 ) 3.01 Tj
0 -40.5818 Td
(1228   // clear BSS) 11.438 Tj
0 -41.8909 Td
(1229   memset\(edata, 0, end - edata\);) 22.274 Tj
0 -43.2 Td
(1230 ) 3.01 Tj
0 -44.5091 Td
(1231   // Prevent release\(\) from enabling interrupts.) 31.906 Tj
0 -45.8182 Td
(1232   for\(i=0; i<NCPU; i++\)) 16.856 Tj
0 -47.1272 Td
(1233     cpus[i].nlock = 1;) 16.254 Tj
0 -48.4363 Td
(1234 ) 3.01 Tj
0 -49.7454 Td
(1235   mp_init\(\); // collect info about this machine) 31.304 Tj
0 -51.0545 Td
(1236   bcpu = mp_bcpu\(\);) 14.448 Tj
0 -52.3636 Td
(1237 ) 3.01 Tj
0 -53.6727 Td
(1238   // switch to bootstrap processor's stack) 28.294 Tj
0 -54.9818 Td
(1239   asm volatile\("movl %0, %%esp" : : "r" \(cpus[0].mpstack + MPSTACK - 32\)\);) 47.558 Tj
0 -56.2909 Td
(1240   asm volatile\("movl %0, %%ebp" : : "r" \(cpus[0].mpstack + MPSTACK\)\);) 44.548 Tj
0 -57.6 Td
(1241 ) 3.01 Tj
0 -58.9091 Td
(1242   lapic_init\(bcpu\);) 14.448 Tj
0 -60.2181 Td
(1243 ) 3.01 Tj
0 -61.5272 Td
(1244   cprintf\("\\ncpu%d: starting xv6\\n\\n", cpu\(\)\);) 30.702 Tj
0 -62.8363 Td
(1245 ) 3.01 Tj
0 -64.1454 Td
(1246 ) 3.01 Tj
0 -65.4545 Td
(1247 ) 3.01 Tj
0 -66.7636 Td
(1248 ) 3.01 Tj
0 -68.0727 Td
(1249 ) 3.01 Tj
0 -72 Td
(Sheet 12) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/main.c  Page 2) 22.274 Tj
0 -3.92728 Td
(1250   pinit\(\); // process table) 19.264 Tj
0 -5.23637 Td
(1251   binit\(\); // buffer cache) 18.662 Tj
0 -6.54546 Td
(1252   pic_init\(\);) 10.836 Tj
0 -7.85455 Td
(1253   ioapic_init\(\);) 12.642 Tj
0 -9.16364 Td
(1254   kinit\(\); // physical memory allocator) 26.488 Tj
0 -10.4727 Td
(1255   tvinit\(\); // trap vectors) 19.264 Tj
0 -11.7818 Td
(1256   idtinit\(\); // this CPU's interrupt descriptor table) 34.916 Tj
0 -13.0909 Td
(1257   fileinit\(\);) 10.836 Tj
0 -14.4 Td
(1258   iinit\(\); // i-node table) 18.662 Tj
0 -15.7091 Td
(1259 ) 3.01 Tj
0 -17.0182 Td
(1260   // initialize process 0) 18.06 Tj
0 -18.3273 Td
(1261   p = &proc[0];) 12.04 Tj
0 -19.6364 Td
(1262   p->state = RUNNABLE;) 16.254 Tj
0 -20.9455 Td
(1263   p->kstack = kalloc\(KSTACKSIZE\);) 22.876 Tj
0 -22.2545 Td
(1264 ) 3.01 Tj
0 -23.5636 Td
(1265   // cause proc[0] to start in kernel at process0) 32.508 Tj
0 -24.8727 Td
(1266   p->jmpbuf.eip = \(uint\) process0;) 23.478 Tj
0 -26.1818 Td
(1267   p->jmpbuf.esp = \(uint\) \(p->kstack + KSTACKSIZE - 4\);) 35.518 Tj
0 -27.4909 Td
(1268 ) 3.01 Tj
0 -28.8 Td
(1269   // make sure there's a TSS) 19.866 Tj
0 -30.1091 Td
(1270   setupsegs\(0\);) 12.04 Tj
0 -31.4182 Td
(1271 ) 3.01 Tj
0 -32.7273 Td
(1272   // initialize I/O devices, let them enable interrupts) 36.12 Tj
0 -34.0364 Td
(1273   console_init\(\);) 13.244 Tj
0 -35.3454 Td
(1274   ide_init\(\);) 10.836 Tj
0 -36.6545 Td
(1275 ) 3.01 Tj
0 -37.9636 Td
(1276   // start other CPUs) 15.652 Tj
0 -39.2727 Td
(1277   mp_startthem\(\);) 13.244 Tj
0 -40.5818 Td
(1278 ) 3.01 Tj
0 -41.8909 Td
(1279   // turn on timer) 13.846 Tj
0 -43.2 Td
(1280   if\(ismp\)) 9.03 Tj
0 -44.5091 Td
(1281     lapic_timerinit\(\);) 16.254 Tj
0 -45.8182 Td
(1282   else) 6.622 Tj
0 -47.1272 Td
(1283     pit8253_timerinit\(\);) 17.458 Tj
0 -48.4363 Td
(1284 ) 3.01 Tj
0 -49.7454 Td
(1285   // enable interrupts on the local APIC) 27.09 Tj
0 -51.0545 Td
(1286   lapic_enableintr\(\);) 15.652 Tj
0 -52.3636 Td
(1287 ) 3.01 Tj
0 -53.6727 Td
(1288   // enable interrupts on this processor.) 27.692 Tj
0 -54.9818 Td
(1289   cpus[cpu\(\)].nlock--;) 16.254 Tj
0 -56.2909 Td
(1290   sti\(\);) 7.826 Tj
0 -57.6 Td
(1291 ) 3.01 Tj
0 -58.9091 Td
(1292   scheduler\(\);) 11.438 Tj
0 -60.2181 Td
(1293 }) 3.612 Tj
0 -61.5272 Td
(1294 ) 3.01 Tj
0 -62.8363 Td
(1295 ) 3.01 Tj
0 -64.1454 Td
(1296 ) 3.01 Tj
0 -65.4545 Td
(1297 ) 3.01 Tj
0 -66.7636 Td
(1298 ) 3.01 Tj
0 -68.0727 Td
(1299 ) 3.01 Tj
0 -72 Td
(Sheet 12) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 20 20
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/main.c  Page 3) 22.274 Tj
0 -3.92728 Td
(1300 // Additional processors start here.) 24.682 Tj
0 -5.23637 Td
(1301 void) 5.418 Tj
0 -6.54546 Td
(1302 mpmain\(void\)) 10.234 Tj
0 -7.85455 Td
(1303 {) 3.612 Tj
0 -9.16364 Td
(1304   cprintf\("cpu%d: starting\\n", cpu\(\)\);) 25.886 Tj
0 -10.4727 Td
(1305   idtinit\(\); // CPU's idt) 18.06 Tj
0 -11.7818 Td
(1306   if\(cpu\(\) == 0\)) 12.642 Tj
0 -13.0909 Td
(1307     panic\("mpmain on cpu 0"\);) 20.468 Tj
0 -14.4 Td
(1308   lapic_init\(cpu\(\)\);) 15.05 Tj
0 -15.7091 Td
(1309   lapic_timerinit\(\);) 15.05 Tj
0 -17.0182 Td
(1310   lapic_enableintr\(\);) 15.652 Tj
0 -18.3273 Td
(1311 ) 3.01 Tj
0 -19.6364 Td
(1312   // make sure there's a TSS) 19.866 Tj
0 -20.9455 Td
(1313   setupsegs\(0\);) 12.04 Tj
0 -22.2545 Td
(1314 ) 3.01 Tj
0 -23.5636 Td
(1315   cpuid\(0, 0, 0, 0, 0\);  // memory barrier) 28.294 Tj
0 -24.8727 Td
(1316   cpus[cpu\(\)].booted = 1;) 18.06 Tj
0 -26.1818 Td
(1317 ) 3.01 Tj
0 -27.4909 Td
(1318   // Enable interrupts on this processor.) 27.692 Tj
0 -28.8 Td
(1319   cpus[cpu\(\)].nlock--;) 16.254 Tj
0 -30.1091 Td
(1320   sti\(\);) 7.826 Tj
0 -31.4182 Td
(1321 ) 3.01 Tj
0 -32.7273 Td
(1322   scheduler\(\);) 11.438 Tj
0 -34.0364 Td
(1323 }) 3.612 Tj
0 -35.3454 Td
(1324 ) 3.01 Tj
0 -36.6545 Td
(1325 // proc[0] starts here, called by scheduler\(\) in the ordinary way.) 42.742 Tj
0 -37.9636 Td
(1326 void) 5.418 Tj
0 -39.2727 Td
(1327 process0\(\)) 9.03 Tj
0 -40.5818 Td
(1328 {) 3.612 Tj
0 -41.8909 Td
(1329   struct proc *p0 = &proc[0];) 20.468 Tj
0 -43.2 Td
(1330   struct proc *p1;) 13.846 Tj
0 -44.5091 Td
(1331   extern struct spinlock proc_table_lock;) 27.692 Tj
0 -45.8182 Td
(1332   struct trapframe tf;) 16.254 Tj
0 -47.1272 Td
(1333 ) 3.01 Tj
0 -48.4363 Td
(1334   release\(&proc_table_lock\);) 19.866 Tj
0 -49.7454 Td
(1335 ) 3.01 Tj
0 -51.0545 Td
(1336   p0->cwd = iget\(rootdev, 1\);) 20.468 Tj
0 -52.3636 Td
(1337   iunlock\(p0->cwd\);) 14.448 Tj
0 -53.6727 Td
(1338 ) 3.01 Tj
0 -54.9818 Td
(1339   // dummy user memory to make copyproc\(\) happy.) 31.906 Tj
0 -56.2909 Td
(1340   // must be big enough to hold the init binary.) 31.906 Tj
0 -57.6 Td
(1341   p0->sz = PAGE;) 12.642 Tj
0 -58.9091 Td
(1342   p0->mem = kalloc\(p0->sz\);) 19.264 Tj
0 -60.2181 Td
(1343 ) 3.01 Tj
0 -61.5272 Td
(1344   // fake a trap frame as if a user process had made a system) 39.732 Tj
0 -62.8363 Td
(1345   // call, so that copyproc will have a place for the new) 37.324 Tj
0 -64.1454 Td
(1346   // process to return to.) 18.662 Tj
0 -65.4545 Td
(1347   p0->tf = &tf;) 12.04 Tj
0 -66.7636 Td
(1348   memset\(p0->tf, 0, sizeof\(struct trapframe\)\);) 30.702 Tj
0 -68.0727 Td
(1349   p0->tf->es = p0->tf->ds = p0->tf->ss = \(SEG_UDATA << 3\) | 3;) 40.334 Tj
0 -72 Td
(Sheet 13) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/main.c  Page 4) 22.274 Tj
0 -3.92728 Td
(1350   p0->tf->cs = \(SEG_UCODE << 3\) | 3;) 24.682 Tj
0 -5.23637 Td
(1351   p0->tf->eflags = FL_IF;) 18.06 Tj
0 -6.54546 Td
(1352   p0->tf->esp = p0->sz;) 16.856 Tj
0 -7.85455 Td
(1353 ) 3.01 Tj
0 -9.16364 Td
(1354   p1 = copyproc\(p0\);) 15.05 Tj
0 -10.4727 Td
(1355 ) 3.01 Tj
0 -11.7818 Td
(1356   load_icode\(p1, _binary__init_start, \(uint\) _binary__init_size\);) 42.14 Tj
0 -13.0909 Td
(1357   p1->state = RUNNABLE;) 16.856 Tj
0 -14.4 Td
(1358 ) 3.01 Tj
0 -15.7091 Td
(1359   proc_wait\(\);) 11.438 Tj
0 -17.0182 Td
(1360   panic\("init exited"\);) 16.856 Tj
0 -18.3273 Td
(1361 }) 3.612 Tj
0 -19.6364 Td
(1362 ) 3.01 Tj
0 -20.9455 Td
(1363 void) 5.418 Tj
0 -22.2545 Td
(1364 load_icode\(struct proc *p, uchar *binary, uint size\)) 34.314 Tj
0 -23.5636 Td
(1365 {) 3.612 Tj
0 -24.8727 Td
(1366   int i;) 7.826 Tj
0 -26.1818 Td
(1367   struct elfhdr *elf;) 15.652 Tj
0 -27.4909 Td
(1368   struct proghdr *ph;) 15.652 Tj
0 -28.8 Td
(1369 ) 3.01 Tj
0 -30.1091 Td
(1370   elf = \(struct elfhdr*\) binary;) 22.274 Tj
0 -31.4182 Td
(1371   if\(elf->magic != ELF_MAGIC\)) 20.468 Tj
0 -32.7273 Td
(1372     panic\("load_icode: not an ELF binary"\);) 28.896 Tj
0 -34.0364 Td
(1373 ) 3.01 Tj
0 -35.3454 Td
(1374   p->tf->eip = elf->entry;) 18.662 Tj
0 -36.6545 Td
(1375 ) 3.01 Tj
0 -37.9636 Td
(1376   // Map and load segments as directed.) 26.488 Tj
0 -39.2727 Td
(1377   ph = \(struct proghdr*\) \(binary + elf->phoff\);) 31.304 Tj
0 -40.5818 Td
(1378   for\(i = 0; i < elf->phnum; i++, ph++\) {) 27.692 Tj
0 -41.8909 Td
(1379     if\(ph->type != ELF_PROG_LOAD\)) 22.876 Tj
0 -43.2 Td
(1380       continue;) 12.04 Tj
0 -44.5091 Td
(1381     if\(ph->va + ph->memsz < ph->va\)) 24.08 Tj
0 -45.8182 Td
(1382       panic\("load_icode: overflow in proghdr"\);) 31.304 Tj
0 -47.1272 Td
(1383     if\(ph->va + ph->memsz >= p->sz\)) 24.08 Tj
0 -48.4363 Td
(1384       panic\("load_icode: icode too large"\);) 28.896 Tj
0 -49.7454 Td
(1385 ) 3.01 Tj
0 -51.0545 Td
(1386     // Load/clear the segment) 20.468 Tj
0 -52.3636 Td
(1387     memmove\(p->mem + ph->va, binary + ph->offset, ph->filesz\);) 40.334 Tj
0 -53.6727 Td
(1388     memset\(p->mem + ph->va + ph->filesz, 0, ph->memsz - ph->filesz\);) 43.946 Tj
0 -54.9818 Td
(1389   }) 4.816 Tj
0 -56.2909 Td
(1390 }) 3.612 Tj
0 -57.6 Td
(1391 ) 3.01 Tj
0 -58.9091 Td
(1392 ) 3.01 Tj
0 -60.2181 Td
(1393 ) 3.01 Tj
0 -61.5272 Td
(1394 ) 3.01 Tj
0 -62.8363 Td
(1395 ) 3.01 Tj
0 -64.1454 Td
(1396 ) 3.01 Tj
0 -65.4545 Td
(1397 ) 3.01 Tj
0 -66.7636 Td
(1398 ) 3.01 Tj
0 -68.0727 Td
(1399 ) 3.01 Tj
0 -72 Td
(Sheet 13) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 21 21
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/mp.c  Page 1) 21.07 Tj
0 -3.92728 Td
(1400 #include "types.h") 13.846 Tj
0 -5.23637 Td
(1401 #include "mp.h") 12.04 Tj
0 -6.54546 Td
(1402 #include "defs.h") 13.244 Tj
0 -7.85455 Td
(1403 #include "param.h") 13.846 Tj
0 -9.16364 Td
(1404 #include "x86.h") 12.642 Tj
0 -10.4727 Td
(1405 #include "traps.h") 13.846 Tj
0 -11.7818 Td
(1406 #include "mmu.h") 12.642 Tj
0 -13.0909 Td
(1407 #include "proc.h") 13.244 Tj
0 -14.4 Td
(1408 ) 3.01 Tj
0 -15.7091 Td
(1409 static char *buses[] = {) 17.458 Tj
0 -17.0182 Td
(1410   "CBUSI ",) 9.632 Tj
0 -18.3273 Td
(1411   "CBUSII",) 9.632 Tj
0 -19.6364 Td
(1412   "EISA  ",) 9.632 Tj
0 -20.9455 Td
(1413   "FUTURE",) 9.632 Tj
0 -22.2545 Td
(1414   "INTERN",) 9.632 Tj
0 -23.5636 Td
(1415   "ISA   ",) 9.632 Tj
0 -24.8727 Td
(1416   "MBI   ",) 9.632 Tj
0 -26.1818 Td
(1417   "MBII  ",) 9.632 Tj
0 -27.4909 Td
(1418   "MCA   ",) 9.632 Tj
0 -28.8 Td
(1419   "MPI   ",) 9.632 Tj
0 -30.1091 Td
(1420   "MPSA  ",) 9.632 Tj
0 -31.4182 Td
(1421   "NUBUS ",) 9.632 Tj
0 -32.7273 Td
(1422   "PCI   ",) 9.632 Tj
0 -34.0364 Td
(1423   "PCMCIA",) 9.632 Tj
0 -35.3454 Td
(1424   "TC    ",) 9.632 Tj
0 -36.6545 Td
(1425   "VL    ",) 9.632 Tj
0 -37.9636 Td
(1426   "VME   ",) 9.632 Tj
0 -39.2727 Td
(1427   "XPRESS",) 9.632 Tj
0 -40.5818 Td
(1428   0,) 5.418 Tj
0 -41.8909 Td
(1429 };) 4.214 Tj
0 -43.2 Td
(1430 ) 3.01 Tj
0 -44.5091 Td
(1431 struct cpu cpus[NCPU];) 16.254 Tj
0 -45.8182 Td
(1432 int ismp;) 8.428 Tj
0 -47.1272 Td
(1433 int ncpu;) 8.428 Tj
0 -48.4363 Td
(1434 uchar ioapic_id;) 12.642 Tj
0 -49.7454 Td
(1435 ) 3.01 Tj
0 -51.0545 Td
(1436 static struct cpu *bcpu;) 17.458 Tj
0 -52.3636 Td
(1437 static struct mp *mp;  // The MP floating point structure) 37.324 Tj
0 -53.6727 Td
(1438 ) 3.01 Tj
0 -54.9818 Td
(1439 static struct mp*) 13.244 Tj
0 -56.2909 Td
(1440 mp_scan\(uchar *addr, int len\)) 20.468 Tj
0 -57.6 Td
(1441 {) 3.612 Tj
0 -58.9091 Td
(1442   uchar *e, *p, sum;) 15.05 Tj
0 -60.2181 Td
(1443   int i;) 7.826 Tj
0 -61.5272 Td
(1444 ) 3.01 Tj
0 -62.8363 Td
(1445   e = addr+len;) 12.04 Tj
0 -64.1454 Td
(1446   for\(p = addr; p < e; p += sizeof\(struct mp\)\){) 31.304 Tj
0 -65.4545 Td
(1447     if\(memcmp\(p, "_MP_", 4\)\)) 19.866 Tj
0 -66.7636 Td
(1448       continue;) 12.04 Tj
0 -68.0727 Td
(1449     sum = 0;) 10.234 Tj
0 -72 Td
(Sheet 14) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/mp.c  Page 2) 21.07 Tj
0 -3.92728 Td
(1450     for\(i = 0; i < sizeof\(struct mp\); i++\)) 28.294 Tj
0 -5.23637 Td
(1451       sum += p[i];) 13.846 Tj
0 -6.54546 Td
(1452     if\(sum == 0\)) 12.642 Tj
0 -7.85455 Td
(1453       return \(struct mp*\)p;) 19.264 Tj
0 -9.16364 Td
(1454   }) 4.816 Tj
0 -10.4727 Td
(1455   return 0;) 9.632 Tj
0 -11.7818 Td
(1456 }) 3.612 Tj
0 -13.0909 Td
(1457 ) 3.01 Tj
0 -14.4 Td
(1458 // Search for the MP Floating Pointer Structure, which according to the) 45.752 Tj
0 -15.7091 Td
(1459 // spec is in one of the following three locations:) 33.712 Tj
0 -17.0182 Td
(1460 // 1\) in the first KB of the EBDA;) 23.478 Tj
0 -18.3273 Td
(1461 // 2\) in the last KB of system base memory;) 28.896 Tj
0 -19.6364 Td
(1462 // 3\) in the BIOS ROM between 0xE0000 and 0xFFFFF.) 33.11 Tj
0 -20.9455 Td
(1463 static struct mp*) 13.244 Tj
0 -22.2545 Td
(1464 mp_search\(void\)) 12.04 Tj
0 -23.5636 Td
(1465 {) 3.612 Tj
0 -24.8727 Td
(1466   uchar *bda;) 10.836 Tj
0 -26.1818 Td
(1467   uint p;) 8.428 Tj
0 -27.4909 Td
(1468   struct mp *mp;) 12.642 Tj
0 -28.8 Td
(1469 ) 3.01 Tj
0 -30.1091 Td
(1470   bda = \(uchar*\) 0x400;) 16.856 Tj
0 -31.4182 Td
(1471   if\(\(p = \(bda[0x0F]<<8\)|bda[0x0E]\)\){) 25.284 Tj
0 -32.7273 Td
(1472     if\(\(mp = mp_scan\(\(uchar*\) p, 1024\)\)\)) 27.09 Tj
0 -34.0364 Td
(1473       return mp;) 12.642 Tj
0 -35.3454 Td
(1474   }) 4.816 Tj
0 -36.6545 Td
(1475   else{) 7.224 Tj
0 -37.9636 Td
(1476     p = \(\(bda[0x14]<<8\)|bda[0x13]\)*1024;) 27.09 Tj
0 -39.2727 Td
(1477     if\(\(mp = mp_scan\(\(uchar*\)p-1024, 1024\)\)\)) 29.498 Tj
0 -40.5818 Td
(1478       return mp;) 12.642 Tj
0 -41.8909 Td
(1479   }) 4.816 Tj
0 -43.2 Td
(1480   return mp_scan\(\(uchar*\)0xF0000, 0x10000\);) 28.896 Tj
0 -44.5091 Td
(1481 }) 3.612 Tj
0 -45.8182 Td
(1482 ) 3.01 Tj
0 -47.1272 Td
(1483 // Search for an MP configuration table. For now,) 32.508 Tj
0 -48.4363 Td
(1484 // don't accept the default configurations \(physaddr == 0\).) 38.528 Tj
0 -49.7454 Td
(1485 // Check for correct signature, calculate the checksum and,) 38.528 Tj
0 -51.0545 Td
(1486 // if correct, check the version.) 22.876 Tj
0 -52.3636 Td
(1487 // To do: check extended table checksum.) 27.09 Tj
0 -53.6727 Td
(1488 static int) 9.03 Tj
0 -54.9818 Td
(1489 mp_detect\(void\)) 12.04 Tj
0 -56.2909 Td
(1490 {) 3.612 Tj
0 -57.6 Td
(1491   struct mpctb *pcmp;) 15.652 Tj
0 -58.9091 Td
(1492   uchar *p, sum;) 12.642 Tj
0 -60.2181 Td
(1493   uint length;) 11.438 Tj
0 -61.5272 Td
(1494 ) 3.01 Tj
0 -62.8363 Td
(1495   if\(\(mp = mp_search\(\)\) == 0 || mp->physaddr == 0\)) 33.11 Tj
0 -64.1454 Td
(1496     return 1;) 10.836 Tj
0 -65.4545 Td
(1497 ) 3.01 Tj
0 -66.7636 Td
(1498 ) 3.01 Tj
0 -68.0727 Td
(1499 ) 3.01 Tj
0 -72 Td
(Sheet 14) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 22 22
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/mp.c  Page 3) 21.07 Tj
0 -3.92728 Td
(1500   pcmp = \(struct mpctb*\) mp->physaddr;) 25.886 Tj
0 -5.23637 Td
(1501   if\(memcmp\(pcmp, "PCMP", 4\)\)) 20.468 Tj
0 -6.54546 Td
(1502     return 2;) 10.836 Tj
0 -7.85455 Td
(1503 ) 3.01 Tj
0 -9.16364 Td
(1504   length = pcmp->length;) 17.458 Tj
0 -10.4727 Td
(1505   sum = 0;) 9.03 Tj
0 -11.7818 Td
(1506   for\(p = \(uchar*\)pcmp; length; length--\)) 27.692 Tj
0 -13.0909 Td
(1507     sum += *p++;) 12.642 Tj
0 -14.4 Td
(1508 ) 3.01 Tj
0 -15.7091 Td
(1509   if\(sum || \(pcmp->version != 1 && pcmp->version != 4\)\)) 36.12 Tj
0 -17.0182 Td
(1510     return 3;) 10.836 Tj
0 -18.3273 Td
(1511 ) 3.01 Tj
0 -19.6364 Td
(1512   return 0;) 9.632 Tj
0 -20.9455 Td
(1513 }) 3.612 Tj
0 -22.2545 Td
(1514 ) 3.01 Tj
0 -23.5636 Td
(1515 void) 5.418 Tj
0 -24.8727 Td
(1516 mp_init\(void\)) 10.836 Tj
0 -26.1818 Td
(1517 {) 3.612 Tj
0 -27.4909 Td
(1518   int r;) 7.826 Tj
0 -28.8 Td
(1519   uchar *p, *e;) 12.04 Tj
0 -30.1091 Td
(1520   struct mpctb *mpctb;) 16.254 Tj
0 -31.4182 Td
(1521   struct mppe *proc;) 15.05 Tj
0 -32.7273 Td
(1522   struct mpbe *bus;) 14.448 Tj
0 -34.0364 Td
(1523   struct mpioapic *ioapic;) 18.662 Tj
0 -35.3454 Td
(1524   struct mpie *intr;) 15.05 Tj
0 -36.6545 Td
(1525   int i;) 7.826 Tj
0 -37.9636 Td
(1526   uchar byte;) 10.836 Tj
0 -39.2727 Td
(1527 ) 3.01 Tj
0 -40.5818 Td
(1528   ncpu = 0;) 9.632 Tj
0 -41.8909 Td
(1529   if\(\(r = mp_detect\(\)\) != 0\) {) 21.07 Tj
0 -43.2 Td
(1530     return;) 9.632 Tj
0 -44.5091 Td
(1531   }) 4.816 Tj
0 -45.8182 Td
(1532 ) 3.01 Tj
0 -47.1272 Td
(1533   ismp = 1;) 9.632 Tj
0 -48.4363 Td
(1534 ) 3.01 Tj
0 -49.7454 Td
(1535   // Run through the table saving information needed for starting) 42.14 Tj
0 -51.0545 Td
(1536   // application processors and initialising any I/O APICs. The table) 44.548 Tj
0 -52.3636 Td
(1537   // is guaranteed to be in order such that only one pass is necessary.) 45.752 Tj
0 -53.6727 Td
(1538 ) 3.01 Tj
0 -54.9818 Td
(1539   mpctb = \(struct mpctb*\) mp->physaddr;) 26.488 Tj
0 -56.2909 Td
(1540   lapicaddr = \(uint*\) mpctb->lapicaddr;) 26.488 Tj
0 -57.6 Td
(1541   p = \(\(uchar*\)mpctb\)+sizeof\(struct mpctb\);) 28.896 Tj
0 -58.9091 Td
(1542   e = \(\(uchar*\)mpctb\)+mpctb->length;) 24.682 Tj
0 -60.2181 Td
(1543 ) 3.01 Tj
0 -61.5272 Td
(1544   while\(p < e\) {) 12.642 Tj
0 -62.8363 Td
(1545     switch\(*p\){) 12.04 Tj
0 -64.1454 Td
(1546     case MPPROCESSOR:) 15.652 Tj
0 -65.4545 Td
(1547       proc = \(struct mppe*\) p;) 21.07 Tj
0 -66.7636 Td
(1548       cpus[ncpu].apicid = proc->apicid;) 26.488 Tj
0 -68.0727 Td
(1549       if\(proc->flags & MPBP\) {) 21.07 Tj
0 -72 Td
(Sheet 15) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/mp.c  Page 4) 21.07 Tj
0 -3.92728 Td
(1550         bcpu = &cpus[ncpu];) 19.264 Tj
0 -5.23637 Td
(1551       }) 7.224 Tj
0 -6.54546 Td
(1552       ncpu++;) 10.836 Tj
0 -7.85455 Td
(1553       p += sizeof\(struct mppe\);) 21.672 Tj
0 -9.16364 Td
(1554       continue;) 12.04 Tj
0 -10.4727 Td
(1555     case MPBUS:) 12.04 Tj
0 -11.7818 Td
(1556       bus = \(struct mpbe*\) p;) 20.468 Tj
0 -13.0909 Td
(1557       for\(i = 0; buses[i]; i++\){) 22.274 Tj
0 -14.4 Td
(1558         if\(strncmp\(buses[i], bus->string, sizeof\(bus->string\)\) == 0\)) 43.946 Tj
0 -15.7091 Td
(1559           break;) 12.642 Tj
0 -17.0182 Td
(1560       }) 7.224 Tj
0 -18.3273 Td
(1561       p += sizeof\(struct mpbe\);) 21.672 Tj
0 -19.6364 Td
(1562       continue;) 12.04 Tj
0 -20.9455 Td
(1563     case MPIOAPIC:) 13.846 Tj
0 -22.2545 Td
(1564       ioapic = \(struct mpioapic*\) p;) 24.682 Tj
0 -23.5636 Td
(1565       ioapic_id = ioapic->apicno;) 22.876 Tj
0 -24.8727 Td
(1566       p += sizeof\(struct mpioapic\);) 24.08 Tj
0 -26.1818 Td
(1567       continue;) 12.04 Tj
0 -27.4909 Td
(1568     case MPIOINTR:) 13.846 Tj
0 -28.8 Td
(1569       intr = \(struct mpie*\) p;) 21.07 Tj
0 -30.1091 Td
(1570       p += sizeof\(struct mpie\);) 21.672 Tj
0 -31.4182 Td
(1571       continue;) 12.04 Tj
0 -32.7273 Td
(1572     default:) 10.234 Tj
0 -34.0364 Td
(1573       cprintf\("mp_init: unknown PCMP type 0x%x \(e-p 0x%x\)\\n", *p, e-p\);) 45.752 Tj
0 -35.3454 Td
(1574       while\(p < e\){) 14.448 Tj
0 -36.6545 Td
(1575         cprintf\("%uX ", *p\);) 19.866 Tj
0 -37.9636 Td
(1576         p++;) 10.234 Tj
0 -39.2727 Td
(1577       }) 7.224 Tj
0 -40.5818 Td
(1578       break;) 10.234 Tj
0 -41.8909 Td
(1579     }) 6.02 Tj
0 -43.2 Td
(1580   }) 4.816 Tj
0 -44.5091 Td
(1581 ) 3.01 Tj
0 -45.8182 Td
(1582   if\(mp->imcrp\) {) 13.244 Tj
0 -47.1272 Td
(1583     // It appears that Bochs doesn't support IMCR, so code won't run.) 44.548 Tj
0 -48.4363 Td
(1584     outb\(0x22, 0x70\);   // Select IMCR) 25.886 Tj
0 -49.7454 Td
(1585     byte = inb\(0x23\);   // Current contents) 28.896 Tj
0 -51.0545 Td
(1586     byte |= 0x01;       // Mask external INTR) 30.1 Tj
0 -52.3636 Td
(1587     outb\(0x23, byte\);   // Disconnect 8259s/NMI) 31.304 Tj
0 -53.6727 Td
(1588   }) 4.816 Tj
0 -54.9818 Td
(1589 }) 3.612 Tj
0 -56.2909 Td
(1590 ) 3.01 Tj
0 -57.6 Td
(1591 ) 3.01 Tj
0 -58.9091 Td
(1592 int) 4.816 Tj
0 -60.2181 Td
(1593 mp_bcpu\(void\)) 10.836 Tj
0 -61.5272 Td
(1594 {) 3.612 Tj
0 -62.8363 Td
(1595   if\(ismp\)) 9.03 Tj
0 -64.1454 Td
(1596     return bcpu-cpus;) 15.652 Tj
0 -65.4545 Td
(1597   return 0;) 9.632 Tj
0 -66.7636 Td
(1598 }) 3.612 Tj
0 -68.0727 Td
(1599 ) 3.01 Tj
0 -72 Td
(Sheet 15) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 23 23
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/mp.c  Page 5) 21.07 Tj
0 -3.92728 Td
(1600 extern void mpmain\(void\);) 18.06 Tj
0 -5.23637 Td
(1601 ) 3.01 Tj
0 -6.54546 Td
(1602 // Write bootstrap code to unused memory at 0x7000.) 33.712 Tj
0 -7.85455 Td
(1603 #define APBOOTCODE 0x7000) 18.06 Tj
0 -9.16364 Td
(1604 ) 3.01 Tj
0 -10.4727 Td
(1605 void) 5.418 Tj
0 -11.7818 Td
(1606 mp_startthem\(void\)) 13.846 Tj
0 -13.0909 Td
(1607 {) 3.612 Tj
0 -14.4 Td
(1608   extern uchar _binary_bootother_start[], _binary_bootother_size[];) 43.344 Tj
0 -15.7091 Td
(1609   extern int main\(\);) 15.05 Tj
0 -17.0182 Td
(1610   int c;) 7.826 Tj
0 -18.3273 Td
(1611 ) 3.01 Tj
0 -19.6364 Td
(1612   memmove\(\(void*\) APBOOTCODE,_binary_bootother_start,) 34.916 Tj
0 -20.9455 Td
(1613           \(uint\) _binary_bootother_size\);) 27.692 Tj
0 -22.2545 Td
(1614 ) 3.01 Tj
0 -23.5636 Td
(1615   for\(c = 0; c < ncpu; c++\){) 19.866 Tj
0 -24.8727 Td
(1616     // Our current cpu has already started.) 28.896 Tj
0 -26.1818 Td
(1617     if\(c == cpu\(\)\)) 13.846 Tj
0 -27.4909 Td
(1618       continue;) 12.04 Tj
0 -28.8 Td
(1619 ) 3.01 Tj
0 -30.1091 Td
(1620     // Set target %esp) 16.254 Tj
0 -31.4182 Td
(1621     *\(uint*\)\(APBOOTCODE-4\) = \(uint\) \(cpus[c].mpstack\) + MPSTACK;) 41.538 Tj
0 -32.7273 Td
(1622 ) 3.01 Tj
0 -34.0364 Td
(1623     // Set target %eip) 16.254 Tj
0 -35.3454 Td
(1624     *\(uint*\)\(APBOOTCODE-8\) = \(uint\)mpmain;) 28.294 Tj
0 -36.6545 Td
(1625 ) 3.01 Tj
0 -37.9636 Td
(1626     // Go!) 9.03 Tj
0 -39.2727 Td
(1627     lapic_startap\(cpus[c].apicid, \(uint\) APBOOTCODE\);) 34.916 Tj
0 -40.5818 Td
(1628 ) 3.01 Tj
0 -41.8909 Td
(1629     // Wait for cpu to get through bootstrap.) 30.1 Tj
0 -43.2 Td
(1630     while\(cpus[c].booted == 0\)) 21.07 Tj
0 -44.5091 Td
(1631       ;) 7.224 Tj
0 -45.8182 Td
(1632   }) 4.816 Tj
0 -47.1272 Td
(1633 }) 3.612 Tj
0 -48.4363 Td
(1634 ) 3.01 Tj
0 -49.7454 Td
(1635 ) 3.01 Tj
0 -51.0545 Td
(1636 ) 3.01 Tj
0 -52.3636 Td
(1637 ) 3.01 Tj
0 -53.6727 Td
(1638 ) 3.01 Tj
0 -54.9818 Td
(1639 ) 3.01 Tj
0 -56.2909 Td
(1640 ) 3.01 Tj
0 -57.6 Td
(1641 ) 3.01 Tj
0 -58.9091 Td
(1642 ) 3.01 Tj
0 -60.2181 Td
(1643 ) 3.01 Tj
0 -61.5272 Td
(1644 ) 3.01 Tj
0 -62.8363 Td
(1645 ) 3.01 Tj
0 -64.1454 Td
(1646 ) 3.01 Tj
0 -65.4545 Td
(1647 ) 3.01 Tj
0 -66.7636 Td
(1648 ) 3.01 Tj
0 -68.0727 Td
(1649 ) 3.01 Tj
0 -72 Td
(Sheet 16) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/init.c  Page 1) 22.274 Tj
0 -3.92728 Td
(1650 #include "types.h") 13.846 Tj
0 -5.23637 Td
(1651 #include "stat.h") 13.244 Tj
0 -6.54546 Td
(1652 #include "user.h") 13.244 Tj
0 -7.85455 Td
(1653 #include "fs.h") 12.04 Tj
0 -9.16364 Td
(1654 #include "fcntl.h") 13.846 Tj
0 -10.4727 Td
(1655 ) 3.01 Tj
0 -11.7818 Td
(1656 // init: The initial user-level program) 26.488 Tj
0 -13.0909 Td
(1657 ) 3.01 Tj
0 -14.4 Td
(1658 char *sh_args[] = { "sh", 0 };) 21.07 Tj
0 -15.7091 Td
(1659 ) 3.01 Tj
0 -17.0182 Td
(1660 int) 4.816 Tj
0 -18.3273 Td
(1661 main\(void\)) 9.03 Tj
0 -19.6364 Td
(1662 {) 3.612 Tj
0 -20.9455 Td
(1663   int pid;) 9.03 Tj
0 -22.2545 Td
(1664 ) 3.01 Tj
0 -23.5636 Td
(1665   if\(open\("console", O_RDWR\) < 0\){) 23.478 Tj
0 -24.8727 Td
(1666     mknod\("console", T_DEV, 1, 1\);) 23.478 Tj
0 -26.1818 Td
(1667     open\("console", O_RDWR\);) 19.866 Tj
0 -27.4909 Td
(1668   }) 4.816 Tj
0 -28.8 Td
(1669   dup\(0\);  // stdout) 15.05 Tj
0 -30.1091 Td
(1670   dup\(0\);  // stderr) 15.05 Tj
0 -31.4182 Td
(1671 ) 3.01 Tj
0 -32.7273 Td
(1672   for\(;;\){) 9.03 Tj
0 -34.0364 Td
(1673     pid = fork\(\);) 13.244 Tj
0 -35.3454 Td
(1674     if\(pid < 0\){) 12.642 Tj
0 -36.6545 Td
(1675       puts\("init: fork failed\\n"\);) 23.478 Tj
0 -37.9636 Td
(1676       exit\(\);) 10.836 Tj
0 -39.2727 Td
(1677     }) 6.02 Tj
0 -40.5818 Td
(1678     if\(pid == 0\){) 13.244 Tj
0 -41.8909 Td
(1679       exec\("sh", sh_args\);) 18.662 Tj
0 -43.2 Td
(1680       puts\("init: exec sh failed\\n"\);) 25.284 Tj
0 -44.5091 Td
(1681       exit\(\);) 10.836 Tj
0 -45.8182 Td
(1682     } else {) 10.234 Tj
0 -47.1272 Td
(1683       wait\(\);) 10.836 Tj
0 -48.4363 Td
(1684     }) 6.02 Tj
0 -49.7454 Td
(1685   }) 4.816 Tj
0 -51.0545 Td
(1686 }) 3.612 Tj
0 -52.3636 Td
(1687 ) 3.01 Tj
0 -53.6727 Td
(1688 ) 3.01 Tj
0 -54.9818 Td
(1689 ) 3.01 Tj
0 -56.2909 Td
(1690 ) 3.01 Tj
0 -57.6 Td
(1691 ) 3.01 Tj
0 -58.9091 Td
(1692 ) 3.01 Tj
0 -60.2181 Td
(1693 ) 3.01 Tj
0 -61.5272 Td
(1694 ) 3.01 Tj
0 -62.8363 Td
(1695 ) 3.01 Tj
0 -64.1454 Td
(1696 ) 3.01 Tj
0 -65.4545 Td
(1697 ) 3.01 Tj
0 -66.7636 Td
(1698 ) 3.01 Tj
0 -68.0727 Td
(1699 ) 3.01 Tj
0 -72 Td
(Sheet 16) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 24 24
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/spinlock.h  Page 1) 24.682 Tj
0 -3.92728 Td
(1700 // Mutual exclusion lock.) 18.06 Tj
0 -5.23637 Td
(1701 struct spinlock {) 13.244 Tj
0 -6.54546 Td
(1702   uint locked;   // Is the lock held?) 25.284 Tj
0 -7.85455 Td
(1703 ) 3.01 Tj
0 -9.16364 Td
(1704   // For debugging:) 14.448 Tj
0 -10.4727 Td
(1705   char *name;    // Name of lock.) 22.876 Tj
0 -11.7818 Td
(1706   int  cpu;      // The number of the cpu holding the lock.) 38.528 Tj
0 -13.0909 Td
(1707   uint pcs[10];  // The call stack \(an array of program counters\)) 42.14 Tj
0 -14.4 Td
(1708                  // that locked the lock.) 27.692 Tj
0 -15.7091 Td
(1709 };) 4.214 Tj
0 -17.0182 Td
(1710 ) 3.01 Tj
0 -18.3273 Td
(1711 ) 3.01 Tj
0 -19.6364 Td
(1712 ) 3.01 Tj
0 -20.9455 Td
(1713 ) 3.01 Tj
0 -22.2545 Td
(1714 ) 3.01 Tj
0 -23.5636 Td
(1715 ) 3.01 Tj
0 -24.8727 Td
(1716 ) 3.01 Tj
0 -26.1818 Td
(1717 ) 3.01 Tj
0 -27.4909 Td
(1718 ) 3.01 Tj
0 -28.8 Td
(1719 ) 3.01 Tj
0 -30.1091 Td
(1720 ) 3.01 Tj
0 -31.4182 Td
(1721 ) 3.01 Tj
0 -32.7273 Td
(1722 ) 3.01 Tj
0 -34.0364 Td
(1723 ) 3.01 Tj
0 -35.3454 Td
(1724 ) 3.01 Tj
0 -36.6545 Td
(1725 ) 3.01 Tj
0 -37.9636 Td
(1726 ) 3.01 Tj
0 -39.2727 Td
(1727 ) 3.01 Tj
0 -40.5818 Td
(1728 ) 3.01 Tj
0 -41.8909 Td
(1729 ) 3.01 Tj
0 -43.2 Td
(1730 ) 3.01 Tj
0 -44.5091 Td
(1731 ) 3.01 Tj
0 -45.8182 Td
(1732 ) 3.01 Tj
0 -47.1272 Td
(1733 ) 3.01 Tj
0 -48.4363 Td
(1734 ) 3.01 Tj
0 -49.7454 Td
(1735 ) 3.01 Tj
0 -51.0545 Td
(1736 ) 3.01 Tj
0 -52.3636 Td
(1737 ) 3.01 Tj
0 -53.6727 Td
(1738 ) 3.01 Tj
0 -54.9818 Td
(1739 ) 3.01 Tj
0 -56.2909 Td
(1740 ) 3.01 Tj
0 -57.6 Td
(1741 ) 3.01 Tj
0 -58.9091 Td
(1742 ) 3.01 Tj
0 -60.2181 Td
(1743 ) 3.01 Tj
0 -61.5272 Td
(1744 ) 3.01 Tj
0 -62.8363 Td
(1745 ) 3.01 Tj
0 -64.1454 Td
(1746 ) 3.01 Tj
0 -65.4545 Td
(1747 ) 3.01 Tj
0 -66.7636 Td
(1748 ) 3.01 Tj
0 -68.0727 Td
(1749 ) 3.01 Tj
0 -72 Td
(Sheet 17) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/spinlock.c  Page 1) 24.682 Tj
0 -3.92728 Td
(1750 // Mutual exclusion spin locks.) 21.672 Tj
0 -5.23637 Td
(1751 ) 3.01 Tj
0 -6.54546 Td
(1752 #include "types.h") 13.846 Tj
0 -7.85455 Td
(1753 #include "defs.h") 13.244 Tj
0 -9.16364 Td
(1754 #include "x86.h") 12.642 Tj
0 -10.4727 Td
(1755 #include "mmu.h") 12.642 Tj
0 -11.7818 Td
(1756 #include "param.h") 13.846 Tj
0 -13.0909 Td
(1757 #include "proc.h") 13.244 Tj
0 -14.4 Td
(1758 #include "spinlock.h") 15.652 Tj
0 -15.7091 Td
(1759 ) 3.01 Tj
0 -17.0182 Td
(1760 extern int use_console_lock;) 19.866 Tj
0 -18.3273 Td
(1761 ) 3.01 Tj
0 -19.6364 Td
(1762 void) 5.418 Tj
0 -20.9455 Td
(1763 initlock\(struct spinlock *lock, char *name\)) 28.896 Tj
0 -22.2545 Td
(1764 {) 3.612 Tj
0 -23.5636 Td
(1765   lock->name = name;) 15.05 Tj
0 -24.8727 Td
(1766   lock->locked = 0;) 14.448 Tj
0 -26.1818 Td
(1767   lock->cpu = 0xffffffff;) 18.06 Tj
0 -27.4909 Td
(1768 }) 3.612 Tj
0 -28.8 Td
(1769 ) 3.01 Tj
0 -30.1091 Td
(1770 // Record the current call stack in pcs[] by following the %ebp chain.) 45.15 Tj
0 -31.4182 Td
(1771 void) 5.418 Tj
0 -32.7273 Td
(1772 getcallerpcs\(void *v, uint pcs[]\)) 22.876 Tj
0 -34.0364 Td
(1773 {) 3.612 Tj
0 -35.3454 Td
(1774   uint *ebp = \(uint*\)v - 2;) 19.264 Tj
0 -36.6545 Td
(1775   int i;) 7.826 Tj
0 -37.9636 Td
(1776   for\(i = 0; i < 10; i++\){) 18.662 Tj
0 -39.2727 Td
(1777     if\(ebp == 0 || ebp == \(uint*\)0xffffffff\)) 29.498 Tj
0 -40.5818 Td
(1778       break;) 10.234 Tj
0 -41.8909 Td
(1779     pcs[i] = ebp[1];     // saved %eip) 25.886 Tj
0 -43.2 Td
(1780     ebp = \(uint*\)ebp[0]; // saved %ebp) 25.886 Tj
0 -44.5091 Td
(1781   }) 4.816 Tj
0 -45.8182 Td
(1782   for\(; i < 10; i++\)) 15.05 Tj
0 -47.1272 Td
(1783     pcs[i] = 0;) 12.04 Tj
0 -48.4363 Td
(1784 }) 3.612 Tj
0 -49.7454 Td
(1785 ) 3.01 Tj
0 -51.0545 Td
(1786 ) 3.01 Tj
0 -52.3636 Td
(1787 ) 3.01 Tj
0 -53.6727 Td
(1788 ) 3.01 Tj
0 -54.9818 Td
(1789 ) 3.01 Tj
0 -56.2909 Td
(1790 ) 3.01 Tj
0 -57.6 Td
(1791 ) 3.01 Tj
0 -58.9091 Td
(1792 ) 3.01 Tj
0 -60.2181 Td
(1793 ) 3.01 Tj
0 -61.5272 Td
(1794 ) 3.01 Tj
0 -62.8363 Td
(1795 ) 3.01 Tj
0 -64.1454 Td
(1796 ) 3.01 Tj
0 -65.4545 Td
(1797 ) 3.01 Tj
0 -66.7636 Td
(1798 ) 3.01 Tj
0 -68.0727 Td
(1799 ) 3.01 Tj
0 -72 Td
(Sheet 17) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 25 25
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/spinlock.c  Page 2) 24.682 Tj
0 -3.92728 Td
(1800 // Acquire the lock.) 15.05 Tj
0 -5.23637 Td
(1801 // Loops \(spins\) until the lock is acquired.) 29.498 Tj
0 -6.54546 Td
(1802 // \(Because contention is handled by spinning, must not) 36.12 Tj
0 -7.85455 Td
(1803 // go to sleep holding any locks.\)) 23.478 Tj
0 -9.16364 Td
(1804 void) 5.418 Tj
0 -10.4727 Td
(1805 acquire\(struct spinlock *lock\)) 21.07 Tj
0 -11.7818 Td
(1806 {) 3.612 Tj
0 -13.0909 Td
(1807   if\(holding\(lock\)\)) 14.448 Tj
0 -14.4 Td
(1808     panic\("acquire"\);) 15.652 Tj
0 -15.7091 Td
(1809 ) 3.01 Tj
0 -17.0182 Td
(1810   if\(cpus[cpu\(\)].nlock == 0\)) 19.866 Tj
0 -18.3273 Td
(1811     cli\(\);) 9.03 Tj
0 -19.6364 Td
(1812   cpus[cpu\(\)].nlock++;) 16.254 Tj
0 -20.9455 Td
(1813 ) 3.01 Tj
0 -22.2545 Td
(1814   while\(cmpxchg\(0, 1, &lock->locked\) == 1\)) 28.294 Tj
0 -23.5636 Td
(1815     ;) 6.02 Tj
0 -24.8727 Td
(1816 ) 3.01 Tj
0 -26.1818 Td
(1817   // Serialize instructions: now that lock is acquired, make sure) 42.14 Tj
0 -27.4909 Td
(1818   // we wait for all pending writes from other processors.) 37.926 Tj
0 -28.8 Td
(1819   cpuid\(0, 0, 0, 0, 0\);  // memory barrier \(see Ch 7, IA-32 manual vol 3\)) 46.956 Tj
0 -30.1091 Td
(1820 ) 3.01 Tj
0 -31.4182 Td
(1821   // Record info about lock acquisition for debugging.) 35.518 Tj
0 -32.7273 Td
(1822   // The +10 is only so that we can tell the difference) 36.12 Tj
0 -34.0364 Td
(1823   // between forgetting to initialize lock->cpu) 31.304 Tj
0 -35.3454 Td
(1824   // and holding a lock on cpu 0.) 22.876 Tj
0 -36.6545 Td
(1825   lock->cpu = cpu\(\) + 10;) 18.06 Tj
0 -37.9636 Td
(1826   getcallerpcs\(&lock, lock->pcs\);) 22.876 Tj
0 -39.2727 Td
(1827 }) 3.612 Tj
0 -40.5818 Td
(1828 ) 3.01 Tj
0 -41.8909 Td
(1829 // Release the lock.) 15.05 Tj
0 -43.2 Td
(1830 void) 5.418 Tj
0 -44.5091 Td
(1831 release\(struct spinlock *lock\)) 21.07 Tj
0 -45.8182 Td
(1832 {) 3.612 Tj
0 -47.1272 Td
(1833   if\(!holding\(lock\)\)) 15.05 Tj
0 -48.4363 Td
(1834     panic\("release"\);) 15.652 Tj
0 -49.7454 Td
(1835 ) 3.01 Tj
0 -51.0545 Td
(1836   lock->pcs[0] = 0;) 14.448 Tj
0 -52.3636 Td
(1837   lock->cpu = 0xffffffff;) 18.06 Tj
0 -53.6727 Td
(1838 ) 3.01 Tj
0 -54.9818 Td
(1839   // Serialize instructions: before unlocking the lock, make sure) 42.14 Tj
0 -56.2909 Td
(1840   // to flush any pending memory writes from this processor.) 39.13 Tj
0 -57.6 Td
(1841   cpuid\(0, 0, 0, 0, 0\);  // memory barrier \(see Ch 7, IA-32 manual vol 3\)) 46.956 Tj
0 -58.9091 Td
(1842 ) 3.01 Tj
0 -60.2181 Td
(1843   lock->locked = 0;) 14.448 Tj
0 -61.5272 Td
(1844   if\(--cpus[cpu\(\)].nlock == 0\)) 21.07 Tj
0 -62.8363 Td
(1845     sti\(\);) 9.03 Tj
0 -64.1454 Td
(1846 }) 3.612 Tj
0 -65.4545 Td
(1847 ) 3.01 Tj
0 -66.7636 Td
(1848 ) 3.01 Tj
0 -68.0727 Td
(1849 ) 3.01 Tj
0 -72 Td
(Sheet 18) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/spinlock.c  Page 3) 24.682 Tj
0 -3.92728 Td
(1850 // Check whether this cpu is holding the lock.) 30.702 Tj
0 -5.23637 Td
(1851 int) 4.816 Tj
0 -6.54546 Td
(1852 holding\(struct spinlock *lock\)) 21.07 Tj
0 -7.85455 Td
(1853 {) 3.612 Tj
0 -9.16364 Td
(1854   return lock->locked && lock->cpu == cpu\(\) + 10;) 32.508 Tj
0 -10.4727 Td
(1855 }) 3.612 Tj
0 -11.7818 Td
(1856 ) 3.01 Tj
0 -13.0909 Td
(1857 ) 3.01 Tj
0 -14.4 Td
(1858 ) 3.01 Tj
0 -15.7091 Td
(1859 ) 3.01 Tj
0 -17.0182 Td
(1860 ) 3.01 Tj
0 -18.3273 Td
(1861 ) 3.01 Tj
0 -19.6364 Td
(1862 ) 3.01 Tj
0 -20.9455 Td
(1863 ) 3.01 Tj
0 -22.2545 Td
(1864 ) 3.01 Tj
0 -23.5636 Td
(1865 ) 3.01 Tj
0 -24.8727 Td
(1866 ) 3.01 Tj
0 -26.1818 Td
(1867 ) 3.01 Tj
0 -27.4909 Td
(1868 ) 3.01 Tj
0 -28.8 Td
(1869 ) 3.01 Tj
0 -30.1091 Td
(1870 ) 3.01 Tj
0 -31.4182 Td
(1871 ) 3.01 Tj
0 -32.7273 Td
(1872 ) 3.01 Tj
0 -34.0364 Td
(1873 ) 3.01 Tj
0 -35.3454 Td
(1874 ) 3.01 Tj
0 -36.6545 Td
(1875 ) 3.01 Tj
0 -37.9636 Td
(1876 ) 3.01 Tj
0 -39.2727 Td
(1877 ) 3.01 Tj
0 -40.5818 Td
(1878 ) 3.01 Tj
0 -41.8909 Td
(1879 ) 3.01 Tj
0 -43.2 Td
(1880 ) 3.01 Tj
0 -44.5091 Td
(1881 ) 3.01 Tj
0 -45.8182 Td
(1882 ) 3.01 Tj
0 -47.1272 Td
(1883 ) 3.01 Tj
0 -48.4363 Td
(1884 ) 3.01 Tj
0 -49.7454 Td
(1885 ) 3.01 Tj
0 -51.0545 Td
(1886 ) 3.01 Tj
0 -52.3636 Td
(1887 ) 3.01 Tj
0 -53.6727 Td
(1888 ) 3.01 Tj
0 -54.9818 Td
(1889 ) 3.01 Tj
0 -56.2909 Td
(1890 ) 3.01 Tj
0 -57.6 Td
(1891 ) 3.01 Tj
0 -58.9091 Td
(1892 ) 3.01 Tj
0 -60.2181 Td
(1893 ) 3.01 Tj
0 -61.5272 Td
(1894 ) 3.01 Tj
0 -62.8363 Td
(1895 ) 3.01 Tj
0 -64.1454 Td
(1896 ) 3.01 Tj
0 -65.4545 Td
(1897 ) 3.01 Tj
0 -66.7636 Td
(1898 ) 3.01 Tj
0 -68.0727 Td
(1899 ) 3.01 Tj
0 -72 Td
(Sheet 18) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 26 26
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/proc.h  Page 1) 22.274 Tj
0 -3.92728 Td
(1900 // Segments in proc->gdt) 17.458 Tj
0 -5.23637 Td
(1901 #define SEG_KCODE 1  // kernel code) 24.08 Tj
0 -6.54546 Td
(1902 #define SEG_KDATA 2  // kernel data+stack) 27.692 Tj
0 -7.85455 Td
(1903 #define SEG_UCODE 3) 14.448 Tj
0 -9.16364 Td
(1904 #define SEG_UDATA 4) 14.448 Tj
0 -10.4727 Td
(1905 #define SEG_TSS   5  // this process's task state) 32.508 Tj
0 -11.7818 Td
(1906 #define NSEGS     6) 14.448 Tj
0 -13.0909 Td
(1907 ) 3.01 Tj
0 -14.4 Td
(1908 // Saved registers for kernel context switches.) 31.304 Tj
0 -15.7091 Td
(1909 // Don't need to save all the %fs etc. segment registers,) 37.324 Tj
0 -17.0182 Td
(1910 // because they are constant across kernel contexts.) 34.314 Tj
0 -18.3273 Td
(1911 // Save all the regular registers so we don't need to care) 37.926 Tj
0 -19.6364 Td
(1912 // which are caller save.) 18.06 Tj
0 -20.9455 Td
(1913 // Don't save %eax, because that's the return register.) 36.12 Tj
0 -22.2545 Td
(1914 // The layout of jmpbuf is known to setjmp.S.) 30.1 Tj
0 -23.5636 Td
(1915 struct jmpbuf {) 12.04 Tj
0 -24.8727 Td
(1916   int ebx;) 9.03 Tj
0 -26.1818 Td
(1917   int ecx;) 9.03 Tj
0 -27.4909 Td
(1918   int edx;) 9.03 Tj
0 -28.8 Td
(1919   int esi;) 9.03 Tj
0 -30.1091 Td
(1920   int edi;) 9.03 Tj
0 -31.4182 Td
(1921   int esp;) 9.03 Tj
0 -32.7273 Td
(1922   int ebp;) 9.03 Tj
0 -34.0364 Td
(1923   int eip;) 9.03 Tj
0 -35.3454 Td
(1924 };) 4.214 Tj
0 -36.6545 Td
(1925 ) 3.01 Tj
0 -37.9636 Td
(1926 enum proc_state { UNUSED, EMBRYO, SLEEPING, RUNNABLE, RUNNING, ZOMBIE };) 46.354 Tj
0 -39.2727 Td
(1927 ) 3.01 Tj
0 -40.5818 Td
(1928 // Per-process state) 15.05 Tj
0 -41.8909 Td
(1929 struct proc {) 10.836 Tj
0 -43.2 Td
(1930   char *mem;                // Start of process memory \(kernel address\)) 45.752 Tj
0 -44.5091 Td
(1931   uint sz;                  // Size of process memory \(bytes\)) 39.732 Tj
0 -45.8182 Td
(1932   char *kstack;             // Bottom of kernel stack for this process) 45.15 Tj
0 -47.1272 Td
(1933   enum proc_state state;    // Process state) 29.498 Tj
0 -48.4363 Td
(1934   int pid;                  // Process ID) 27.692 Tj
0 -49.7454 Td
(1935   int ppid;                 // Parent pid) 27.692 Tj
0 -51.0545 Td
(1936   void *chan;               // If non-zero, sleeping on chan) 39.13 Tj
0 -52.3636 Td
(1937   int killed;               // If non-zero, have been killed) 39.13 Tj
0 -53.6727 Td
(1938   struct file *ofile[NOFILE];  // Open files) 29.498 Tj
0 -54.9818 Td
(1939   struct inode *cwd;        // Current directory) 31.906 Tj
0 -56.2909 Td
(1940   struct jmpbuf jmpbuf;     // Jump here to run process) 36.12 Tj
0 -57.6 Td
(1941   struct trapframe *tf;     // Trap frame for current interrupt) 40.936 Tj
0 -58.9091 Td
(1942 };) 4.214 Tj
0 -60.2181 Td
(1943 ) 3.01 Tj
0 -61.5272 Td
(1944 ) 3.01 Tj
0 -62.8363 Td
(1945 ) 3.01 Tj
0 -64.1454 Td
(1946 ) 3.01 Tj
0 -65.4545 Td
(1947 ) 3.01 Tj
0 -66.7636 Td
(1948 ) 3.01 Tj
0 -68.0727 Td
(1949 ) 3.01 Tj
0 -72 Td
(Sheet 19) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/proc.h  Page 2) 22.274 Tj
0 -3.92728 Td
(1950 // Process memory is laid out contiguously:) 28.896 Tj
0 -5.23637 Td
(1951 //   text) 8.428 Tj
0 -6.54546 Td
(1952 //   original data and bss) 18.662 Tj
0 -7.85455 Td
(1953 //   fixed-size stack) 15.652 Tj
0 -9.16364 Td
(1954 //   expandable heap) 15.05 Tj
0 -10.4727 Td
(1955 ) 3.01 Tj
0 -11.7818 Td
(1956 extern struct proc proc[];) 18.662 Tj
0 -13.0909 Td
(1957 extern struct proc *curproc[NCPU];  // Current \(running\) process per CPU) 46.354 Tj
0 -14.4 Td
(1958 ) 3.01 Tj
0 -15.7091 Td
(1959 #define MPSTACK 512) 14.448 Tj
0 -17.0182 Td
(1960 ) 3.01 Tj
0 -18.3273 Td
(1961 // Per-CPU state) 12.642 Tj
0 -19.6364 Td
(1962 struct cpu {) 10.234 Tj
0 -20.9455 Td
(1963   uchar apicid;               // Local APIC ID) 30.702 Tj
0 -22.2545 Td
(1964   struct jmpbuf jmpbuf;       // Jump here to enter scheduler) 39.732 Tj
0 -23.5636 Td
(1965   struct taskstate ts;        // Used by x86 to find stack for interrupt) 46.354 Tj
0 -24.8727 Td
(1966   struct segdesc gdt[NSEGS];  // x86 global descriptor table) 39.13 Tj
0 -26.1818 Td
(1967   char mpstack[MPSTACK];      // Per-CPU startup stack) 35.518 Tj
0 -27.4909 Td
(1968   volatile int booted;        // Has the CPU started?) 34.916 Tj
0 -28.8 Td
(1969   int nlock;                  // Number of locks currently held) 40.936 Tj
0 -30.1091 Td
(1970 };) 4.214 Tj
0 -31.4182 Td
(1971 ) 3.01 Tj
0 -32.7273 Td
(1972 extern struct cpu cpus[NCPU];) 20.468 Tj
0 -34.0364 Td
(1973 extern int ncpu;) 12.642 Tj
0 -35.3454 Td
(1974 ) 3.01 Tj
0 -36.6545 Td
(1975 ) 3.01 Tj
0 -37.9636 Td
(1976 ) 3.01 Tj
0 -39.2727 Td
(1977 ) 3.01 Tj
0 -40.5818 Td
(1978 ) 3.01 Tj
0 -41.8909 Td
(1979 ) 3.01 Tj
0 -43.2 Td
(1980 ) 3.01 Tj
0 -44.5091 Td
(1981 ) 3.01 Tj
0 -45.8182 Td
(1982 ) 3.01 Tj
0 -47.1272 Td
(1983 ) 3.01 Tj
0 -48.4363 Td
(1984 ) 3.01 Tj
0 -49.7454 Td
(1985 ) 3.01 Tj
0 -51.0545 Td
(1986 ) 3.01 Tj
0 -52.3636 Td
(1987 ) 3.01 Tj
0 -53.6727 Td
(1988 ) 3.01 Tj
0 -54.9818 Td
(1989 ) 3.01 Tj
0 -56.2909 Td
(1990 ) 3.01 Tj
0 -57.6 Td
(1991 ) 3.01 Tj
0 -58.9091 Td
(1992 ) 3.01 Tj
0 -60.2181 Td
(1993 ) 3.01 Tj
0 -61.5272 Td
(1994 ) 3.01 Tj
0 -62.8363 Td
(1995 ) 3.01 Tj
0 -64.1454 Td
(1996 ) 3.01 Tj
0 -65.4545 Td
(1997 ) 3.01 Tj
0 -66.7636 Td
(1998 ) 3.01 Tj
0 -68.0727 Td
(1999 ) 3.01 Tj
0 -72 Td
(Sheet 19) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 27 27
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/proc.c  Page 1) 22.274 Tj
0 -3.92728 Td
(2000 #include "types.h") 13.846 Tj
0 -5.23637 Td
(2001 #include "mmu.h") 12.642 Tj
0 -6.54546 Td
(2002 #include "x86.h") 12.642 Tj
0 -7.85455 Td
(2003 #include "param.h") 13.846 Tj
0 -9.16364 Td
(2004 #include "file.h") 13.244 Tj
0 -10.4727 Td
(2005 #include "proc.h") 13.244 Tj
0 -11.7818 Td
(2006 #include "defs.h") 13.244 Tj
0 -13.0909 Td
(2007 #include "spinlock.h") 15.652 Tj
0 -14.4 Td
(2008 ) 3.01 Tj
0 -15.7091 Td
(2009 struct spinlock proc_table_lock;) 22.274 Tj
0 -17.0182 Td
(2010 ) 3.01 Tj
0 -18.3273 Td
(2011 struct proc proc[NPROC];) 17.458 Tj
0 -19.6364 Td
(2012 struct proc *curproc[NCPU];) 19.264 Tj
0 -20.9455 Td
(2013 int next_pid = 1;) 13.244 Tj
0 -22.2545 Td
(2014 extern void forkret\(void\);) 18.662 Tj
0 -23.5636 Td
(2015 extern void forkret1\(struct trapframe*\);) 27.09 Tj
0 -24.8727 Td
(2016 ) 3.01 Tj
0 -26.1818 Td
(2017 void) 5.418 Tj
0 -27.4909 Td
(2018 pinit\(void\)) 9.632 Tj
0 -28.8 Td
(2019 {) 3.612 Tj
0 -30.1091 Td
(2020   initlock\(&proc_table_lock, "proc_table"\);) 28.896 Tj
0 -31.4182 Td
(2021 }) 3.612 Tj
0 -32.7273 Td
(2022 ) 3.01 Tj
0 -34.0364 Td
(2023 // Set up CPU's segment descriptors and task state for a) 36.722 Tj
0 -35.3454 Td
(2024 // given process.) 13.244 Tj
0 -36.6545 Td
(2025 // If p==0, set up for "idle" state for when scheduler\(\)) 36.722 Tj
0 -37.9636 Td
(2026 // is idling, not running any process.) 25.886 Tj
0 -39.2727 Td
(2027 void) 5.418 Tj
0 -40.5818 Td
(2028 setupsegs\(struct proc *p\)) 18.06 Tj
0 -41.8909 Td
(2029 {) 3.612 Tj
0 -43.2 Td
(2030   struct cpu *c = &cpus[cpu\(\)];) 21.672 Tj
0 -44.5091 Td
(2031 ) 3.01 Tj
0 -45.8182 Td
(2032   c->ts.ss0 = SEG_KDATA << 3;) 20.468 Tj
0 -47.1272 Td
(2033   if\(p\){) 7.826 Tj
0 -48.4363 Td
(2034     c->ts.esp0 = \(uint\)\(p->kstack + KSTACKSIZE\);) 31.906 Tj
0 -49.7454 Td
(2035   } else {) 9.03 Tj
0 -51.0545 Td
(2036     c->ts.esp0 = 0xffffffff;) 19.866 Tj
0 -52.3636 Td
(2037   }) 4.816 Tj
0 -53.6727 Td
(2038 ) 3.01 Tj
0 -54.9818 Td
(2039   c->gdt[0] = SEG_NULL;) 16.856 Tj
0 -56.2909 Td
(2040   c->gdt[SEG_KCODE] = SEG\(STA_X|STA_R, 0, 0x100000 + 64*1024, 0\);) 42.14 Tj
0 -57.6 Td
(2041   c->gdt[SEG_KDATA] = SEG\(STA_W, 0, 0xffffffff, 0\);) 33.712 Tj
0 -58.9091 Td
(2042   c->gdt[SEG_TSS] = SEG16\(STS_T32A, \(uint\) &c->ts, sizeof\(c->ts\), 0\);) 44.548 Tj
0 -60.2181 Td
(2043   c->gdt[SEG_TSS].s = 0;) 17.458 Tj
0 -61.5272 Td
(2044   if\(p\){) 7.826 Tj
0 -62.8363 Td
(2045     c->gdt[SEG_UCODE] = SEG\(STA_X|STA_R, \(uint\)p->mem, p->sz, 3\);) 42.14 Tj
0 -64.1454 Td
(2046     c->gdt[SEG_UDATA] = SEG\(STA_W, \(uint\)p->mem, p->sz, 3\);) 38.528 Tj
0 -65.4545 Td
(2047   } else {) 9.03 Tj
0 -66.7636 Td
(2048     c->gdt[SEG_UCODE] = SEG_NULL;) 22.876 Tj
0 -68.0727 Td
(2049     c->gdt[SEG_UDATA] = SEG_NULL;) 22.876 Tj
0 -72 Td
(Sheet 20) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/proc.c  Page 2) 22.274 Tj
0 -3.92728 Td
(2050   }) 4.816 Tj
0 -5.23637 Td
(2051 ) 3.01 Tj
0 -6.54546 Td
(2052   lgdt\(c->gdt, sizeof c->gdt\);) 21.07 Tj
0 -7.85455 Td
(2053   ltr\(SEG_TSS << 3\);) 15.05 Tj
0 -9.16364 Td
(2054 }) 3.612 Tj
0 -10.4727 Td
(2055 ) 3.01 Tj
0 -11.7818 Td
(2056 // Grow current process's memory by n bytes.) 29.498 Tj
0 -13.0909 Td
(2057 // Return old size on success, -1 on failure.) 30.1 Tj
0 -14.4 Td
(2058 int) 4.816 Tj
0 -15.7091 Td
(2059 growproc\(int n\)) 12.04 Tj
0 -17.0182 Td
(2060 {) 3.612 Tj
0 -18.3273 Td
(2061   struct proc *cp = curproc[cpu\(\)];) 24.08 Tj
0 -19.6364 Td
(2062   char *newmem, *oldmem;) 17.458 Tj
0 -20.9455 Td
(2063 ) 3.01 Tj
0 -22.2545 Td
(2064   newmem = kalloc\(cp->sz + n\);) 21.07 Tj
0 -23.5636 Td
(2065   if\(newmem == 0\)) 13.244 Tj
0 -24.8727 Td
(2066     return 0xffffffff;) 16.254 Tj
0 -26.1818 Td
(2067   memmove\(newmem, cp->mem, cp->sz\);) 24.08 Tj
0 -27.4909 Td
(2068   memset\(newmem + cp->sz, 0, n\);) 22.274 Tj
0 -28.8 Td
(2069   oldmem = cp->mem;) 14.448 Tj
0 -30.1091 Td
(2070   cp->mem = newmem;) 14.448 Tj
0 -31.4182 Td
(2071   kfree\(oldmem, cp->sz\);) 17.458 Tj
0 -32.7273 Td
(2072   cp->sz += n;) 11.438 Tj
0 -34.0364 Td
(2073   return cp->sz - n;) 15.05 Tj
0 -35.3454 Td
(2074 }) 3.612 Tj
0 -36.6545 Td
(2075 ) 3.01 Tj
0 -37.9636 Td
(2076 // Look in the process table for an UNUSED proc.) 31.906 Tj
0 -39.2727 Td
(2077 // If found, change state to EMBRYO and return it.) 33.11 Tj
0 -40.5818 Td
(2078 // Otherwise return 0.) 16.254 Tj
0 -41.8909 Td
(2079 struct proc*) 10.234 Tj
0 -43.2 Td
(2080 allocproc\(void\)) 12.04 Tj
0 -44.5091 Td
(2081 {) 3.612 Tj
0 -45.8182 Td
(2082   int i;) 7.826 Tj
0 -47.1272 Td
(2083   struct proc *p;) 13.244 Tj
0 -48.4363 Td
(2084 ) 3.01 Tj
0 -49.7454 Td
(2085   for\(i = 0; i < NPROC; i++\){) 20.468 Tj
0 -51.0545 Td
(2086     p = &proc[i];) 13.244 Tj
0 -52.3636 Td
(2087     if\(p->state == UNUSED\){) 19.264 Tj
0 -53.6727 Td
(2088       p->state = EMBRYO;) 17.458 Tj
0 -54.9818 Td
(2089       return p;) 12.04 Tj
0 -56.2909 Td
(2090     }) 6.02 Tj
0 -57.6 Td
(2091   }) 4.816 Tj
0 -58.9091 Td
(2092   return 0;) 9.632 Tj
0 -60.2181 Td
(2093 }) 3.612 Tj
0 -61.5272 Td
(2094 ) 3.01 Tj
0 -62.8363 Td
(2095 ) 3.01 Tj
0 -64.1454 Td
(2096 ) 3.01 Tj
0 -65.4545 Td
(2097 ) 3.01 Tj
0 -66.7636 Td
(2098 ) 3.01 Tj
0 -68.0727 Td
(2099 ) 3.01 Tj
0 -72 Td
(Sheet 20) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 28 28
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/proc.c  Page 3) 22.274 Tj
0 -3.92728 Td
(2100 // Create a new process copying p as the parent.) 31.906 Tj
0 -5.23637 Td
(2101 // Does not copy the kernel stack.) 23.478 Tj
0 -6.54546 Td
(2102 // Instead, sets up stack to return as if from system call.) 38.528 Tj
0 -7.85455 Td
(2103 // Caller must arrange for process to run \(set state to RUNNABLE\).) 42.742 Tj
0 -9.16364 Td
(2104 struct proc*) 10.234 Tj
0 -10.4727 Td
(2105 copyproc\(struct proc *p\)) 17.458 Tj
0 -11.7818 Td
(2106 {) 3.612 Tj
0 -13.0909 Td
(2107   int i;) 7.826 Tj
0 -14.4 Td
(2108   struct proc *np;) 13.846 Tj
0 -15.7091 Td
(2109 ) 3.01 Tj
0 -17.0182 Td
(2110   // Allocate process.) 16.254 Tj
0 -18.3273 Td
(2111   acquire\(&proc_table_lock\);) 19.866 Tj
0 -19.6364 Td
(2112   if\(\(np = allocproc\(\)\) == 0\){) 21.07 Tj
0 -20.9455 Td
(2113     release\(&proc_table_lock\);) 21.07 Tj
0 -22.2545 Td
(2114     return 0;) 10.836 Tj
0 -23.5636 Td
(2115   }) 4.816 Tj
0 -24.8727 Td
(2116   np->pid = next_pid++;) 16.856 Tj
0 -26.1818 Td
(2117   np->ppid = p->pid;) 15.05 Tj
0 -27.4909 Td
(2118   release\(&proc_table_lock\);) 19.866 Tj
0 -28.8 Td
(2119 ) 3.01 Tj
0 -30.1091 Td
(2120   // Copy user memory.) 16.254 Tj
0 -31.4182 Td
(2121   np->sz = p->sz;) 13.244 Tj
0 -32.7273 Td
(2122   np->mem = kalloc\(np->sz\);) 19.264 Tj
0 -34.0364 Td
(2123   if\(np->mem == 0\){) 14.448 Tj
0 -35.3454 Td
(2124     np->state = UNUSED;) 16.856 Tj
0 -36.6545 Td
(2125     return 0;) 10.836 Tj
0 -37.9636 Td
(2126   }) 4.816 Tj
0 -39.2727 Td
(2127   memmove\(np->mem, p->mem, np->sz\);) 24.08 Tj
0 -40.5818 Td
(2128 ) 3.01 Tj
0 -41.8909 Td
(2129   // Allocate kernel stack.) 19.264 Tj
0 -43.2 Td
(2130   np->kstack = kalloc\(KSTACKSIZE\);) 23.478 Tj
0 -44.5091 Td
(2131   if\(np->kstack == 0\){) 16.254 Tj
0 -45.8182 Td
(2132     kfree\(np->mem, np->sz\);) 19.264 Tj
0 -47.1272 Td
(2133     np->mem = 0;) 12.642 Tj
0 -48.4363 Td
(2134     np->state = UNUSED;) 16.856 Tj
0 -49.7454 Td
(2135     return 0;) 10.836 Tj
0 -51.0545 Td
(2136   }) 4.816 Tj
0 -52.3636 Td
(2137 ) 3.01 Tj
0 -53.6727 Td
(2138   // Copy trapframe registers from parent.) 28.294 Tj
0 -54.9818 Td
(2139   np->tf = \(struct trapframe*\)\(np->kstack + KSTACKSIZE\) - 1;) 39.13 Tj
0 -56.2909 Td
(2140   memmove\(np->tf, p->tf, sizeof\(*np->tf\)\);) 28.294 Tj
0 -57.6 Td
(2141 ) 3.01 Tj
0 -58.9091 Td
(2142   // Clear %eax so that fork system call returns 0 in child.) 39.13 Tj
0 -60.2181 Td
(2143   np->tf->eax = 0;) 13.846 Tj
0 -61.5272 Td
(2144 ) 3.01 Tj
0 -62.8363 Td
(2145   // Set up new jmpbuf to start executing at forkret \(see below\).) 42.14 Tj
0 -64.1454 Td
(2146   memset\(&np->jmpbuf, 0, sizeof np->jmpbuf\);) 29.498 Tj
0 -65.4545 Td
(2147   np->jmpbuf.eip = \(uint\)forkret;) 22.876 Tj
0 -66.7636 Td
(2148   np->jmpbuf.esp = \(uint\)np->tf - 4;) 24.682 Tj
0 -68.0727 Td
(2149 ) 3.01 Tj
0 -72 Td
(Sheet 21) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/proc.c  Page 4) 22.274 Tj
0 -3.92728 Td
(2150   // Copy file descriptors) 18.662 Tj
0 -5.23637 Td
(2151   for\(i = 0; i < NOFILE; i++\){) 21.07 Tj
0 -6.54546 Td
(2152     np->ofile[i] = p->ofile[i];) 21.672 Tj
0 -7.85455 Td
(2153     if\(np->ofile[i]\)) 15.05 Tj
0 -9.16364 Td
(2154       fileincref\(np->ofile[i]\);) 21.672 Tj
0 -10.4727 Td
(2155   }) 4.816 Tj
0 -11.7818 Td
(2156 ) 3.01 Tj
0 -13.0909 Td
(2157   np->cwd = p->cwd;) 14.448 Tj
0 -14.4 Td
(2158   iincref\(p->cwd\);) 13.846 Tj
0 -15.7091 Td
(2159 ) 3.01 Tj
0 -17.0182 Td
(2160   return np;) 10.234 Tj
0 -18.3273 Td
(2161 }) 3.612 Tj
0 -19.6364 Td
(2162 ) 3.01 Tj
0 -20.9455 Td
(2163 ) 3.01 Tj
0 -22.2545 Td
(2164 ) 3.01 Tj
0 -23.5636 Td
(2165 ) 3.01 Tj
0 -24.8727 Td
(2166 ) 3.01 Tj
0 -26.1818 Td
(2167 ) 3.01 Tj
0 -27.4909 Td
(2168 ) 3.01 Tj
0 -28.8 Td
(2169 ) 3.01 Tj
0 -30.1091 Td
(2170 ) 3.01 Tj
0 -31.4182 Td
(2171 ) 3.01 Tj
0 -32.7273 Td
(2172 ) 3.01 Tj
0 -34.0364 Td
(2173 ) 3.01 Tj
0 -35.3454 Td
(2174 ) 3.01 Tj
0 -36.6545 Td
(2175 ) 3.01 Tj
0 -37.9636 Td
(2176 ) 3.01 Tj
0 -39.2727 Td
(2177 ) 3.01 Tj
0 -40.5818 Td
(2178 ) 3.01 Tj
0 -41.8909 Td
(2179 ) 3.01 Tj
0 -43.2 Td
(2180 ) 3.01 Tj
0 -44.5091 Td
(2181 ) 3.01 Tj
0 -45.8182 Td
(2182 ) 3.01 Tj
0 -47.1272 Td
(2183 ) 3.01 Tj
0 -48.4363 Td
(2184 ) 3.01 Tj
0 -49.7454 Td
(2185 ) 3.01 Tj
0 -51.0545 Td
(2186 ) 3.01 Tj
0 -52.3636 Td
(2187 ) 3.01 Tj
0 -53.6727 Td
(2188 ) 3.01 Tj
0 -54.9818 Td
(2189 ) 3.01 Tj
0 -56.2909 Td
(2190 ) 3.01 Tj
0 -57.6 Td
(2191 ) 3.01 Tj
0 -58.9091 Td
(2192 ) 3.01 Tj
0 -60.2181 Td
(2193 ) 3.01 Tj
0 -61.5272 Td
(2194 ) 3.01 Tj
0 -62.8363 Td
(2195 ) 3.01 Tj
0 -64.1454 Td
(2196 ) 3.01 Tj
0 -65.4545 Td
(2197 ) 3.01 Tj
0 -66.7636 Td
(2198 ) 3.01 Tj
0 -68.0727 Td
(2199 ) 3.01 Tj
0 -72 Td
(Sheet 21) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 29 29
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/proc.c  Page 5) 22.274 Tj
0 -3.92728 Td
(2200 // Per-CPU process scheduler.) 20.468 Tj
0 -5.23637 Td
(2201 // Each CPU calls scheduler\(\) after setting itself up.) 35.518 Tj
0 -6.54546 Td
(2202 // Scheduler never returns.  It loops, doing:) 30.1 Tj
0 -7.85455 Td
(2203 //  - choose a process to run) 20.468 Tj
0 -9.16364 Td
(2204 //  - longjmp to start running that process) 28.896 Tj
0 -10.4727 Td
(2205 //  - eventually that process transfers control back) 34.314 Tj
0 -11.7818 Td
(2206 //      via longjmp back to the top of scheduler.) 32.508 Tj
0 -13.0909 Td
(2207 void) 5.418 Tj
0 -14.4 Td
(2208 scheduler\(void\)) 12.04 Tj
0 -15.7091 Td
(2209 {) 3.612 Tj
0 -17.0182 Td
(2210   struct proc *p;) 13.244 Tj
0 -18.3273 Td
(2211   int i;) 7.826 Tj
0 -19.6364 Td
(2212 ) 3.01 Tj
0 -20.9455 Td
(2213   for\(;;\){) 9.03 Tj
0 -22.2545 Td
(2214     // Loop over process table looking for process to run.) 37.926 Tj
0 -23.5636 Td
(2215     acquire\(&proc_table_lock\);) 21.07 Tj
0 -24.8727 Td
(2216 ) 3.01 Tj
0 -26.1818 Td
(2217     for\(i = 0; i < NPROC; i++\){) 21.672 Tj
0 -27.4909 Td
(2218       p = &proc[i];) 14.448 Tj
0 -28.8 Td
(2219       if\(p->state != RUNNABLE\)) 21.07 Tj
0 -30.1091 Td
(2220         continue;) 13.244 Tj
0 -31.4182 Td
(2221 ) 3.01 Tj
0 -32.7273 Td
(2222       // Switch to chosen process.  It is the process's job) 38.528 Tj
0 -34.0364 Td
(2223       // to release proc_table_lock and then reacquire it) 37.324 Tj
0 -35.3454 Td
(2224       // before jumping back to us.) 24.08 Tj
0 -36.6545 Td
(2225 ) 3.01 Tj
0 -37.9636 Td
(2226       setupsegs\(p\);) 14.448 Tj
0 -39.2727 Td
(2227       curproc[cpu\(\)] = p;) 18.06 Tj
0 -40.5818 Td
(2228       p->state = RUNNING;) 18.06 Tj
0 -41.8909 Td
(2229       if\(setjmp\(&cpus[cpu\(\)].jmpbuf\) == 0\)) 28.294 Tj
0 -43.2 Td
(2230         longjmp\(&p->jmpbuf\);) 19.866 Tj
0 -44.5091 Td
(2231 ) 3.01 Tj
0 -45.8182 Td
(2232       // Process is done running for now.) 27.692 Tj
0 -47.1272 Td
(2233       // It should have changed its p->state before coming back.) 41.538 Tj
0 -48.4363 Td
(2234       curproc[cpu\(\)] = 0;) 18.06 Tj
0 -49.7454 Td
(2235 ) 3.01 Tj
0 -51.0545 Td
(2236       setupsegs\(0\);) 14.448 Tj
0 -52.3636 Td
(2237     }) 6.02 Tj
0 -53.6727 Td
(2238 ) 3.01 Tj
0 -54.9818 Td
(2239     release\(&proc_table_lock\);) 21.07 Tj
0 -56.2909 Td
(2240   }) 4.816 Tj
0 -57.6 Td
(2241 }) 3.612 Tj
0 -58.9091 Td
(2242 ) 3.01 Tj
0 -60.2181 Td
(2243 ) 3.01 Tj
0 -61.5272 Td
(2244 ) 3.01 Tj
0 -62.8363 Td
(2245 ) 3.01 Tj
0 -64.1454 Td
(2246 ) 3.01 Tj
0 -65.4545 Td
(2247 ) 3.01 Tj
0 -66.7636 Td
(2248 ) 3.01 Tj
0 -68.0727 Td
(2249 ) 3.01 Tj
0 -72 Td
(Sheet 22) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/proc.c  Page 6) 22.274 Tj
0 -3.92728 Td
(2250 // Enter scheduler.  Must already hold proc_table_lock) 35.518 Tj
0 -5.23637 Td
(2251 // and have changed curproc[cpu\(\)]->state.) 28.294 Tj
0 -6.54546 Td
(2252 void) 5.418 Tj
0 -7.85455 Td
(2253 sched\(void\)) 9.632 Tj
0 -9.16364 Td
(2254 {) 3.612 Tj
0 -10.4727 Td
(2255   struct proc *p = curproc[cpu\(\)];) 23.478 Tj
0 -11.7818 Td
(2256 ) 3.01 Tj
0 -13.0909 Td
(2257   if\(!holding\(&proc_table_lock\)\)) 22.274 Tj
0 -14.4 Td
(2258     panic\("sched"\);) 14.448 Tj
0 -15.7091 Td
(2259   if\(cpus[cpu\(\)].nlock != 1\)) 19.866 Tj
0 -17.0182 Td
(2260     panic\("sched locks"\);) 18.06 Tj
0 -18.3273 Td
(2261 ) 3.01 Tj
0 -19.6364 Td
(2262   if\(setjmp\(&p->jmpbuf\) == 0\)) 20.468 Tj
0 -20.9455 Td
(2263     longjmp\(&cpus[cpu\(\)].jmpbuf\);) 22.876 Tj
0 -22.2545 Td
(2264 }) 3.612 Tj
0 -23.5636 Td
(2265 ) 3.01 Tj
0 -24.8727 Td
(2266 // Give up the CPU for one scheduling round.) 29.498 Tj
0 -26.1818 Td
(2267 void) 5.418 Tj
0 -27.4909 Td
(2268 yield\(void\)) 9.632 Tj
0 -28.8 Td
(2269 {) 3.612 Tj
0 -30.1091 Td
(2270   struct proc *p = curproc[cpu\(\)];) 23.478 Tj
0 -31.4182 Td
(2271 ) 3.01 Tj
0 -32.7273 Td
(2272   acquire\(&proc_table_lock\);) 19.866 Tj
0 -34.0364 Td
(2273   p->state = RUNNABLE;) 16.254 Tj
0 -35.3454 Td
(2274   sched\(\);) 9.03 Tj
0 -36.6545 Td
(2275   release\(&proc_table_lock\);) 19.866 Tj
0 -37.9636 Td
(2276 }) 3.612 Tj
0 -39.2727 Td
(2277 ) 3.01 Tj
0 -40.5818 Td
(2278 // A fork child's very first scheduling by scheduler\(\)) 35.518 Tj
0 -41.8909 Td
(2279 // will longjmp here. "return" to user space.) 30.1 Tj
0 -43.2 Td
(2280 void) 5.418 Tj
0 -44.5091 Td
(2281 forkret\(void\)) 10.836 Tj
0 -45.8182 Td
(2282 {) 3.612 Tj
0 -47.1272 Td
(2283   // Still holding proc_table_lock from scheduler.) 33.11 Tj
0 -48.4363 Td
(2284   release\(&proc_table_lock\);) 19.866 Tj
0 -49.7454 Td
(2285 ) 3.01 Tj
0 -51.0545 Td
(2286   // Jump into assembly, never to return.) 27.692 Tj
0 -52.3636 Td
(2287   forkret1\(curproc[cpu\(\)]->tf\);) 21.672 Tj
0 -53.6727 Td
(2288 }) 3.612 Tj
0 -54.9818 Td
(2289 ) 3.01 Tj
0 -56.2909 Td
(2290 ) 3.01 Tj
0 -57.6 Td
(2291 ) 3.01 Tj
0 -58.9091 Td
(2292 ) 3.01 Tj
0 -60.2181 Td
(2293 ) 3.01 Tj
0 -61.5272 Td
(2294 ) 3.01 Tj
0 -62.8363 Td
(2295 ) 3.01 Tj
0 -64.1454 Td
(2296 ) 3.01 Tj
0 -65.4545 Td
(2297 ) 3.01 Tj
0 -66.7636 Td
(2298 ) 3.01 Tj
0 -68.0727 Td
(2299 ) 3.01 Tj
0 -72 Td
(Sheet 22) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 30 30
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/proc.c  Page 7) 22.274 Tj
0 -3.92728 Td
(2300 // Atomically release lock and sleep on chan.) 30.1 Tj
0 -5.23637 Td
(2301 // Reacquires lock when reawakened.) 24.08 Tj
0 -6.54546 Td
(2302 void) 5.418 Tj
0 -7.85455 Td
(2303 sleep\(void *chan, struct spinlock *lk\)) 25.886 Tj
0 -9.16364 Td
(2304 {) 3.612 Tj
0 -10.4727 Td
(2305   struct proc *p = curproc[cpu\(\)];) 23.478 Tj
0 -11.7818 Td
(2306 ) 3.01 Tj
0 -13.0909 Td
(2307   if\(p == 0\)) 10.234 Tj
0 -14.4 Td
(2308     panic\("sleep"\);) 14.448 Tj
0 -15.7091 Td
(2309 ) 3.01 Tj
0 -17.0182 Td
(2310   if\(lk == 0\)) 10.836 Tj
0 -18.3273 Td
(2311     panic\("sleep without lk"\);) 21.07 Tj
0 -19.6364 Td
(2312 ) 3.01 Tj
0 -20.9455 Td
(2313   // Must acquire proc_table_lock in order to) 30.1 Tj
0 -22.2545 Td
(2314   // change p->state and then call sched.) 27.692 Tj
0 -23.5636 Td
(2315   // Once we hold proc_table_lock, we can be) 29.498 Tj
0 -24.8727 Td
(2316   // guaranteed that we won't miss any wakeup) 30.1 Tj
0 -26.1818 Td
(2317   // \(wakeup runs with proc_table_lock locked\),) 31.304 Tj
0 -27.4909 Td
(2318   // so it's okay to release lk.) 22.274 Tj
0 -28.8 Td
(2319   if\(lk != &proc_table_lock\){) 20.468 Tj
0 -30.1091 Td
(2320     acquire\(&proc_table_lock\);) 21.07 Tj
0 -31.4182 Td
(2321     release\(lk\);) 12.642 Tj
0 -32.7273 Td
(2322   }) 4.816 Tj
0 -34.0364 Td
(2323 ) 3.01 Tj
0 -35.3454 Td
(2324   // Go to sleep.) 13.244 Tj
0 -36.6545 Td
(2325   p->chan = chan;) 13.244 Tj
0 -37.9636 Td
(2326   p->state = SLEEPING;) 16.254 Tj
0 -39.2727 Td
(2327   sched\(\);) 9.03 Tj
0 -40.5818 Td
(2328 ) 3.01 Tj
0 -41.8909 Td
(2329   // Tidy up.) 10.836 Tj
0 -43.2 Td
(2330   p->chan = 0;) 11.438 Tj
0 -44.5091 Td
(2331 ) 3.01 Tj
0 -45.8182 Td
(2332   // Reacquire original lock.) 20.468 Tj
0 -47.1272 Td
(2333   if\(lk != &proc_table_lock\){) 20.468 Tj
0 -48.4363 Td
(2334     release\(&proc_table_lock\);) 21.07 Tj
0 -49.7454 Td
(2335     acquire\(lk\);) 12.642 Tj
0 -51.0545 Td
(2336   }) 4.816 Tj
0 -52.3636 Td
(2337 }) 3.612 Tj
0 -53.6727 Td
(2338 ) 3.01 Tj
0 -54.9818 Td
(2339 // Wake up all processes sleeping on chan.) 28.294 Tj
0 -56.2909 Td
(2340 // Proc_table_lock must be held.) 22.274 Tj
0 -57.6 Td
(2341 void) 5.418 Tj
0 -58.9091 Td
(2342 wakeup1\(void *chan\)) 14.448 Tj
0 -60.2181 Td
(2343 {) 3.612 Tj
0 -61.5272 Td
(2344   struct proc *p;) 13.244 Tj
0 -62.8363 Td
(2345 ) 3.01 Tj
0 -64.1454 Td
(2346   for\(p = proc; p < &proc[NPROC]; p++\)) 25.886 Tj
0 -65.4545 Td
(2347     if\(p->state == SLEEPING && p->chan == chan\)) 31.304 Tj
0 -66.7636 Td
(2348       p->state = RUNNABLE;) 18.662 Tj
0 -68.0727 Td
(2349 }) 3.612 Tj
0 -72 Td
(Sheet 23) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/proc.c  Page 8) 22.274 Tj
0 -3.92728 Td
(2350 // Wake up all processes sleeping on chan.) 28.294 Tj
0 -5.23637 Td
(2351 // Proc_table_lock is acquired and released.) 29.498 Tj
0 -6.54546 Td
(2352 void) 5.418 Tj
0 -7.85455 Td
(2353 wakeup\(void *chan\)) 13.846 Tj
0 -9.16364 Td
(2354 {) 3.612 Tj
0 -10.4727 Td
(2355   acquire\(&proc_table_lock\);) 19.866 Tj
0 -11.7818 Td
(2356   wakeup1\(chan\);) 12.642 Tj
0 -13.0909 Td
(2357   release\(&proc_table_lock\);) 19.866 Tj
0 -14.4 Td
(2358 }) 3.612 Tj
0 -15.7091 Td
(2359 ) 3.01 Tj
0 -17.0182 Td
(2360 // Kill the process with the given pid.) 26.488 Tj
0 -18.3273 Td
(2361 // Process won't actually exit until it returns) 31.304 Tj
0 -19.6364 Td
(2362 // to user space \(see trap in trap.c\).) 25.886 Tj
0 -20.9455 Td
(2363 int) 4.816 Tj
0 -22.2545 Td
(2364 proc_kill\(int pid\)) 13.846 Tj
0 -23.5636 Td
(2365 {) 3.612 Tj
0 -24.8727 Td
(2366   struct proc *p;) 13.244 Tj
0 -26.1818 Td
(2367 ) 3.01 Tj
0 -27.4909 Td
(2368   acquire\(&proc_table_lock\);) 19.866 Tj
0 -28.8 Td
(2369   for\(p = proc; p < &proc[NPROC]; p++\){) 26.488 Tj
0 -30.1091 Td
(2370     if\(p->pid == pid\){) 16.254 Tj
0 -31.4182 Td
(2371       p->killed = 1;) 15.05 Tj
0 -32.7273 Td
(2372       // Wake process from sleep if necessary.) 30.702 Tj
0 -34.0364 Td
(2373       if\(p->state == SLEEPING\)) 21.07 Tj
0 -35.3454 Td
(2374         p->state = RUNNABLE;) 19.866 Tj
0 -36.6545 Td
(2375       release\(&proc_table_lock\);) 22.274 Tj
0 -37.9636 Td
(2376       return 0;) 12.04 Tj
0 -39.2727 Td
(2377     }) 6.02 Tj
0 -40.5818 Td
(2378   }) 4.816 Tj
0 -41.8909 Td
(2379   release\(&proc_table_lock\);) 19.866 Tj
0 -43.2 Td
(2380   return -1;) 10.234 Tj
0 -44.5091 Td
(2381 }) 3.612 Tj
0 -45.8182 Td
(2382 ) 3.01 Tj
0 -47.1272 Td
(2383 // Exit the current process.  Does not return.) 30.702 Tj
0 -48.4363 Td
(2384 // Exited processes remain in the zombie state) 30.702 Tj
0 -49.7454 Td
(2385 // until their parent calls wait\(\) to find out they exited.) 38.528 Tj
0 -51.0545 Td
(2386 void) 5.418 Tj
0 -52.3636 Td
(2387 proc_exit\(void\)) 12.04 Tj
0 -53.6727 Td
(2388 {) 3.612 Tj
0 -54.9818 Td
(2389   struct proc *p;) 13.244 Tj
0 -56.2909 Td
(2390   struct proc *cp = curproc[cpu\(\)];) 24.08 Tj
0 -57.6 Td
(2391   int fd;) 8.428 Tj
0 -58.9091 Td
(2392 ) 3.01 Tj
0 -60.2181 Td
(2393   // Close all open files.) 18.662 Tj
0 -61.5272 Td
(2394   for\(fd = 0; fd < NOFILE; fd++\){) 22.876 Tj
0 -62.8363 Td
(2395     if\(cp->ofile[fd]\){) 16.254 Tj
0 -64.1454 Td
(2396       fileclose\(cp->ofile[fd]\);) 21.672 Tj
0 -65.4545 Td
(2397       cp->ofile[fd] = 0;) 17.458 Tj
0 -66.7636 Td
(2398     }) 6.02 Tj
0 -68.0727 Td
(2399   }) 4.816 Tj
0 -72 Td
(Sheet 23) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 31 31
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/proc.c  Page 9) 22.274 Tj
0 -3.92728 Td
(2400   idecref\(cp->cwd\);) 14.448 Tj
0 -5.23637 Td
(2401   cp->cwd = 0;) 11.438 Tj
0 -6.54546 Td
(2402 ) 3.01 Tj
0 -7.85455 Td
(2403   acquire\(&proc_table_lock\);) 19.866 Tj
0 -9.16364 Td
(2404 ) 3.01 Tj
0 -10.4727 Td
(2405   // Wake up our parent.) 17.458 Tj
0 -11.7818 Td
(2406   for\(p = proc; p < &proc[NPROC]; p++\)) 25.886 Tj
0 -13.0909 Td
(2407     if\(p->pid == cp->ppid\)) 18.662 Tj
0 -14.4 Td
(2408       wakeup1\(p\);) 13.244 Tj
0 -15.7091 Td
(2409 ) 3.01 Tj
0 -17.0182 Td
(2410   // Reparent our children to process 1.) 27.09 Tj
0 -18.3273 Td
(2411   for\(p = proc; p < &proc[NPROC]; p++\)) 25.886 Tj
0 -19.6364 Td
(2412     if\(p->ppid == cp->pid\)) 18.662 Tj
0 -20.9455 Td
(2413       p->ppid = 1;) 13.846 Tj
0 -22.2545 Td
(2414 ) 3.01 Tj
0 -23.5636 Td
(2415   // Jump into the scheduler, never to return.) 30.702 Tj
0 -24.8727 Td
(2416   cp->killed = 0;) 13.244 Tj
0 -26.1818 Td
(2417   cp->state = ZOMBIE;) 15.652 Tj
0 -27.4909 Td
(2418   sched\(\);) 9.03 Tj
0 -28.8 Td
(2419   panic\("zombie exit"\);) 16.856 Tj
0 -30.1091 Td
(2420 }) 3.612 Tj
0 -31.4182 Td
(2421 ) 3.01 Tj
0 -32.7273 Td
(2422 // Wait for a child process to exit and return its pid.) 36.12 Tj
0 -34.0364 Td
(2423 // Return -1 if this process has no children.) 30.1 Tj
0 -35.3454 Td
(2424 int) 4.816 Tj
0 -36.6545 Td
(2425 proc_wait\(void\)) 12.04 Tj
0 -37.9636 Td
(2426 {) 3.612 Tj
0 -39.2727 Td
(2427   struct proc *p;) 13.244 Tj
0 -40.5818 Td
(2428   struct proc *cp = curproc[cpu\(\)];) 24.08 Tj
0 -41.8909 Td
(2429   int i, havekids, pid;) 16.856 Tj
0 -43.2 Td
(2430 ) 3.01 Tj
0 -44.5091 Td
(2431   acquire\(&proc_table_lock\);) 19.866 Tj
0 -45.8182 Td
(2432   for\(;;\){) 9.03 Tj
0 -47.1272 Td
(2433     // Scan through table looking for zombie children.) 35.518 Tj
0 -48.4363 Td
(2434     havekids = 0;) 13.244 Tj
0 -49.7454 Td
(2435     for\(i = 0; i < NPROC; i++\){) 21.672 Tj
0 -51.0545 Td
(2436       p = &proc[i];) 14.448 Tj
0 -52.3636 Td
(2437       if\(p->state == UNUSED\)) 19.866 Tj
0 -53.6727 Td
(2438         continue;) 13.244 Tj
0 -54.9818 Td
(2439       if\(p->ppid == cp->pid\){) 20.468 Tj
0 -56.2909 Td
(2440         if\(p->state == ZOMBIE\){) 21.672 Tj
0 -57.6 Td
(2441           // Found one.) 16.856 Tj
0 -58.9091 Td
(2442           kfree\(p->mem, p->sz\);) 21.672 Tj
0 -60.2181 Td
(2443           kfree\(p->kstack, KSTACKSIZE\);) 26.488 Tj
0 -61.5272 Td
(2444           pid = p->pid;) 16.856 Tj
0 -62.8363 Td
(2445           p->state = UNUSED;) 19.866 Tj
0 -64.1454 Td
(2446           p->pid = 0;) 15.652 Tj
0 -65.4545 Td
(2447           p->ppid = 0;) 16.254 Tj
0 -66.7636 Td
(2448           release\(&proc_table_lock\);) 24.682 Tj
0 -68.0727 Td
(2449           return pid;) 15.652 Tj
0 -72 Td
(Sheet 24) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/proc.c  Page 10) 22.876 Tj
0 -3.92728 Td
(2450         }) 8.428 Tj
0 -5.23637 Td
(2451         havekids = 1;) 15.652 Tj
0 -6.54546 Td
(2452       }) 7.224 Tj
0 -7.85455 Td
(2453     }) 6.02 Tj
0 -9.16364 Td
(2454 ) 3.01 Tj
0 -10.4727 Td
(2455     // No point waiting if we don't have any children.) 35.518 Tj
0 -11.7818 Td
(2456     if\(!havekids\){) 13.846 Tj
0 -13.0909 Td
(2457       release\(&proc_table_lock\);) 22.274 Tj
0 -14.4 Td
(2458       return -1;) 12.642 Tj
0 -15.7091 Td
(2459     }) 6.02 Tj
0 -17.0182 Td
(2460 ) 3.01 Tj
0 -18.3273 Td
(2461     // Wait for children to exit.  \(See wakeup1 call in proc_exit.\)) 43.344 Tj
0 -19.6364 Td
(2462     sleep\(cp, &proc_table_lock\);) 22.274 Tj
0 -20.9455 Td
(2463   }) 4.816 Tj
0 -22.2545 Td
(2464 }) 3.612 Tj
0 -23.5636 Td
(2465 ) 3.01 Tj
0 -24.8727 Td
(2466 // Print a process listing to console.  For debugging.) 35.518 Tj
0 -26.1818 Td
(2467 // Runs when user types ^P on console.) 25.886 Tj
0 -27.4909 Td
(2468 // No lock to avoid wedging a stuck machine further.) 34.314 Tj
0 -28.8 Td
(2469 void) 5.418 Tj
0 -30.1091 Td
(2470 procdump\(void\)) 11.438 Tj
0 -31.4182 Td
(2471 {) 3.612 Tj
0 -32.7273 Td
(2472   int i;) 7.826 Tj
0 -34.0364 Td
(2473   struct proc *p;) 13.244 Tj
0 -35.3454 Td
(2474 ) 3.01 Tj
0 -36.6545 Td
(2475   for\(i = 0; i < NPROC; i++\) {) 21.07 Tj
0 -37.9636 Td
(2476     p = &proc[i];) 13.244 Tj
0 -39.2727 Td
(2477     if\(p->state == UNUSED\)) 18.662 Tj
0 -40.5818 Td
(2478       continue;) 12.04 Tj
0 -41.8909 Td
(2479     cprintf\("%d %d %p\\n", p->pid, p->state\);) 29.498 Tj
0 -43.2 Td
(2480   }) 4.816 Tj
0 -44.5091 Td
(2481 }) 3.612 Tj
0 -45.8182 Td
(2482 ) 3.01 Tj
0 -47.1272 Td
(2483 ) 3.01 Tj
0 -48.4363 Td
(2484 ) 3.01 Tj
0 -49.7454 Td
(2485 ) 3.01 Tj
0 -51.0545 Td
(2486 ) 3.01 Tj
0 -52.3636 Td
(2487 ) 3.01 Tj
0 -53.6727 Td
(2488 ) 3.01 Tj
0 -54.9818 Td
(2489 ) 3.01 Tj
0 -56.2909 Td
(2490 ) 3.01 Tj
0 -57.6 Td
(2491 ) 3.01 Tj
0 -58.9091 Td
(2492 ) 3.01 Tj
0 -60.2181 Td
(2493 ) 3.01 Tj
0 -61.5272 Td
(2494 ) 3.01 Tj
0 -62.8363 Td
(2495 ) 3.01 Tj
0 -64.1454 Td
(2496 ) 3.01 Tj
0 -65.4545 Td
(2497 ) 3.01 Tj
0 -66.7636 Td
(2498 ) 3.01 Tj
0 -68.0727 Td
(2499 ) 3.01 Tj
0 -72 Td
(Sheet 24) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 32 32
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/setjmp.S  Page 1) 23.478 Tj
0 -3.92728 Td
(2500 #   int  setjmp\(struct jmpbuf *jmp\);) 24.682 Tj
0 -5.23637 Td
(2501 #   void longjmp\(struct jmpbuf *jmp\);) 25.284 Tj
0 -6.54546 Td
(2502 #) 3.612 Tj
0 -7.85455 Td
(2503 # Setjmp saves its stack environment in jmp for later use by longjmp.) 44.548 Tj
0 -9.16364 Td
(2504 # It returns 0.) 12.04 Tj
0 -10.4727 Td
(2505 #) 3.612 Tj
0 -11.7818 Td
(2506 # Longjmp restores the environment saved by the last call of setjmp.) 43.946 Tj
0 -13.0909 Td
(2507 # It then causes execution to continue as if the call of setjmp) 40.936 Tj
0 -14.4 Td
(2508 # had just returned 1.) 16.254 Tj
0 -15.7091 Td
(2509 #) 3.612 Tj
0 -17.0182 Td
(2510 # The caller of setjmp must not itself have returned in the interim.) 43.946 Tj
0 -18.3273 Td
(2511 # All accessible data have values as of the time longjmp was called.) 43.946 Tj
0 -19.6364 Td
(2512 #) 3.612 Tj
0 -20.9455 Td
(2513 #    [Description, but not code, borrowed from Plan 9.]) 36.12 Tj
0 -22.2545 Td
(2514 ) 3.01 Tj
0 -23.5636 Td
(2515 .globl setjmp) 10.836 Tj
0 -24.8727 Td
(2516 setjmp:) 7.224 Tj
0 -26.1818 Td
(2517   movl 4\(%esp\), %eax) 15.05 Tj
0 -27.4909 Td
(2518 ) 3.01 Tj
0 -28.8 Td
(2519   movl %ebx, 0\(%eax\)) 15.05 Tj
0 -30.1091 Td
(2520   movl %ecx, 4\(%eax\)) 15.05 Tj
0 -31.4182 Td
(2521   movl %edx, 8\(%eax\)) 15.05 Tj
0 -32.7273 Td
(2522   movl %esi, 12\(%eax\)) 15.652 Tj
0 -34.0364 Td
(2523   movl %edi, 16\(%eax\)) 15.652 Tj
0 -35.3454 Td
(2524   movl %esp, 20\(%eax\)) 15.652 Tj
0 -36.6545 Td
(2525   movl %ebp, 24\(%eax\)) 15.652 Tj
0 -37.9636 Td
(2526   pushl 0\(%esp\)   # %eip) 17.458 Tj
0 -39.2727 Td
(2527   popl 28\(%eax\)) 12.04 Tj
0 -40.5818 Td
(2528 ) 3.01 Tj
0 -41.8909 Td
(2529   movl $0, %eax   # return value) 22.274 Tj
0 -43.2 Td
(2530   ret) 6.02 Tj
0 -44.5091 Td
(2531 ) 3.01 Tj
0 -45.8182 Td
(2532 .globl longjmp) 11.438 Tj
0 -47.1272 Td
(2533 longjmp:) 7.826 Tj
0 -48.4363 Td
(2534   movl 4\(%esp\), %eax) 15.05 Tj
0 -49.7454 Td
(2535 ) 3.01 Tj
0 -51.0545 Td
(2536   movl 0\(%eax\), %ebx) 15.05 Tj
0 -52.3636 Td
(2537   movl 4\(%eax\), %ecx) 15.05 Tj
0 -53.6727 Td
(2538   movl 8\(%eax\), %edx) 15.05 Tj
0 -54.9818 Td
(2539   movl 12\(%eax\), %esi) 15.652 Tj
0 -56.2909 Td
(2540   movl 16\(%eax\), %edi) 15.652 Tj
0 -57.6 Td
(2541   movl 20\(%eax\), %esp) 15.652 Tj
0 -58.9091 Td
(2542   movl 24\(%eax\), %ebp) 15.652 Tj
0 -60.2181 Td
(2543 ) 3.01 Tj
0 -61.5272 Td
(2544   addl $4, %esp   # pop and discard %eip) 27.09 Tj
0 -62.8363 Td
(2545   pushl 28\(%eax\)  # push new %eip) 22.876 Tj
0 -64.1454 Td
(2546 ) 3.01 Tj
0 -65.4545 Td
(2547   movl $1, %eax   # return value \(appears to come from setjmp!\)) 40.936 Tj
0 -66.7636 Td
(2548   ret) 6.02 Tj
0 -68.0727 Td
(2549 ) 3.01 Tj
0 -72 Td
(Sheet 25) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/kalloc.c  Page 1) 23.478 Tj
0 -3.92728 Td
(2550 // Physical memory allocator, intended to allocate) 33.11 Tj
0 -5.23637 Td
(2551 // memory for user processes. Allocates in 4096-byte "pages".) 39.732 Tj
0 -6.54546 Td
(2552 // Free list is kept sorted and combines adjacent pages into) 39.13 Tj
0 -7.85455 Td
(2553 // long runs, to make it easier to allocate big segments.) 37.324 Tj
0 -9.16364 Td
(2554 // One reason the page size is 4k is that the x86 segment size) 40.334 Tj
0 -10.4727 Td
(2555 // granularity is 4k.) 15.652 Tj
0 -11.7818 Td
(2556 ) 3.01 Tj
0 -13.0909 Td
(2557 #include "param.h") 13.846 Tj
0 -14.4 Td
(2558 #include "types.h") 13.846 Tj
0 -15.7091 Td
(2559 #include "defs.h") 13.244 Tj
0 -17.0182 Td
(2560 #include "param.h") 13.846 Tj
0 -18.3273 Td
(2561 #include "mmu.h") 12.642 Tj
0 -19.6364 Td
(2562 #include "proc.h") 13.244 Tj
0 -20.9455 Td
(2563 #include "spinlock.h") 15.652 Tj
0 -22.2545 Td
(2564 ) 3.01 Tj
0 -23.5636 Td
(2565 struct spinlock kalloc_lock;) 19.866 Tj
0 -24.8727 Td
(2566 ) 3.01 Tj
0 -26.1818 Td
(2567 struct run {) 10.234 Tj
0 -27.4909 Td
(2568   struct run *next;) 14.448 Tj
0 -28.8 Td
(2569   int len; // bytes) 14.448 Tj
0 -30.1091 Td
(2570 };) 4.214 Tj
0 -31.4182 Td
(2571 struct run *freelist;) 15.652 Tj
0 -32.7273 Td
(2572 ) 3.01 Tj
0 -34.0364 Td
(2573 // Initialize free list of physical pages.) 28.294 Tj
0 -35.3454 Td
(2574 // This code cheats by just considering one megabyte of) 36.12 Tj
0 -36.6545 Td
(2575 // pages after _end.  Real systems would determine the) 35.518 Tj
0 -37.9636 Td
(2576 // amount of memory available in the system and use it all.) 38.528 Tj
0 -39.2727 Td
(2577 void) 5.418 Tj
0 -40.5818 Td
(2578 kinit\(void\)) 9.632 Tj
0 -41.8909 Td
(2579 {) 3.612 Tj
0 -43.2 Td
(2580   extern int end;) 13.244 Tj
0 -44.5091 Td
(2581   uint mem;) 9.632 Tj
0 -45.8182 Td
(2582   char *start;) 11.438 Tj
0 -47.1272 Td
(2583 ) 3.01 Tj
0 -48.4363 Td
(2584   initlock\(&kalloc_lock, "kalloc"\);) 24.08 Tj
0 -49.7454 Td
(2585   start = \(char*\) &end;) 16.856 Tj
0 -51.0545 Td
(2586   start = \(char*\) \(\(\(uint\)start + PAGE\) & ~\(PAGE-1\)\);) 34.916 Tj
0 -52.3636 Td
(2587   mem = 256; // assume computer has 256 pages of RAM) 34.314 Tj
0 -53.6727 Td
(2588   cprintf\("mem = %d\\n", mem * PAGE\);) 24.682 Tj
0 -54.9818 Td
(2589   kfree\(start, mem * PAGE\);) 19.264 Tj
0 -56.2909 Td
(2590 }) 3.612 Tj
0 -57.6 Td
(2591 ) 3.01 Tj
0 -58.9091 Td
(2592 ) 3.01 Tj
0 -60.2181 Td
(2593 ) 3.01 Tj
0 -61.5272 Td
(2594 ) 3.01 Tj
0 -62.8363 Td
(2595 ) 3.01 Tj
0 -64.1454 Td
(2596 ) 3.01 Tj
0 -65.4545 Td
(2597 ) 3.01 Tj
0 -66.7636 Td
(2598 ) 3.01 Tj
0 -68.0727 Td
(2599 ) 3.01 Tj
0 -72 Td
(Sheet 25) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 33 33
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/kalloc.c  Page 2) 23.478 Tj
0 -3.92728 Td
(2600 // Free the len bytes of memory pointed at by cp,) 32.508 Tj
0 -5.23637 Td
(2601 // which normally should have been returned by a) 31.906 Tj
0 -6.54546 Td
(2602 // call to kalloc\(cp\).  \(The exception is when) 30.702 Tj
0 -7.85455 Td
(2603 // initializing the allocator; see kinit above.\)) 31.906 Tj
0 -9.16364 Td
(2604 void) 5.418 Tj
0 -10.4727 Td
(2605 kfree\(char *cp, int len\)) 17.458 Tj
0 -11.7818 Td
(2606 {) 3.612 Tj
0 -13.0909 Td
(2607   struct run **rr;) 13.846 Tj
0 -14.4 Td
(2608   struct run *p = \(struct run*\) cp;) 24.08 Tj
0 -15.7091 Td
(2609   struct run *pend = \(struct run*\) \(cp + len\);) 30.702 Tj
0 -17.0182 Td
(2610   int i;) 7.826 Tj
0 -18.3273 Td
(2611 ) 3.01 Tj
0 -19.6364 Td
(2612   if\(len % PAGE\)) 12.642 Tj
0 -20.9455 Td
(2613     panic\("kfree"\);) 14.448 Tj
0 -22.2545 Td
(2614 ) 3.01 Tj
0 -23.5636 Td
(2615   // Fill with junk to catch dangling refs.) 28.896 Tj
0 -24.8727 Td
(2616   for\(i = 0; i < len; i++\)) 18.662 Tj
0 -26.1818 Td
(2617     cp[i] = 1;) 11.438 Tj
0 -27.4909 Td
(2618 ) 3.01 Tj
0 -28.8 Td
(2619   acquire\(&kalloc_lock\);) 17.458 Tj
0 -30.1091 Td
(2620 ) 3.01 Tj
0 -31.4182 Td
(2621   rr = &freelist;) 13.244 Tj
0 -32.7273 Td
(2622   while\(*rr\){) 10.836 Tj
0 -34.0364 Td
(2623     struct run *rend = \(struct run*\) \(\(char*\)\(*rr\) + \(*rr\)->len\);) 42.14 Tj
0 -35.3454 Td
(2624     if\(p >= *rr && p < rend\)) 19.866 Tj
0 -36.6545 Td
(2625       panic\("freeing free page"\);) 22.876 Tj
0 -37.9636 Td
(2626     if\(pend == *rr\){) 15.05 Tj
0 -39.2727 Td
(2627       p->len = len + \(*rr\)->len;) 22.274 Tj
0 -40.5818 Td
(2628       p->next = \(*rr\)->next;) 19.866 Tj
0 -41.8909 Td
(2629       *rr = p;) 11.438 Tj
0 -43.2 Td
(2630       goto out;) 12.04 Tj
0 -44.5091 Td
(2631     }) 6.02 Tj
0 -45.8182 Td
(2632     if\(pend < *rr\){) 14.448 Tj
0 -47.1272 Td
(2633       p->len = len;) 14.448 Tj
0 -48.4363 Td
(2634       p->next = *rr;) 15.05 Tj
0 -49.7454 Td
(2635       *rr = p;) 11.438 Tj
0 -51.0545 Td
(2636       goto out;) 12.04 Tj
0 -52.3636 Td
(2637     }) 6.02 Tj
0 -53.6727 Td
(2638     if\(p == rend\){) 13.846 Tj
0 -54.9818 Td
(2639       \(*rr\)->len += len;) 17.458 Tj
0 -56.2909 Td
(2640       if\(\(*rr\)->next && \(*rr\)->next == pend\){) 30.1 Tj
0 -57.6 Td
(2641         \(*rr\)->len += \(*rr\)->next->len;) 26.488 Tj
0 -58.9091 Td
(2642         \(*rr\)->next = \(*rr\)->next->next;) 27.09 Tj
0 -60.2181 Td
(2643       }) 7.224 Tj
0 -61.5272 Td
(2644       goto out;) 12.04 Tj
0 -62.8363 Td
(2645     }) 6.02 Tj
0 -64.1454 Td
(2646     rr = &\(\(*rr\)->next\);) 17.458 Tj
0 -65.4545 Td
(2647   }) 4.816 Tj
0 -66.7636 Td
(2648   p->len = len;) 12.04 Tj
0 -68.0727 Td
(2649   p->next = 0;) 11.438 Tj
0 -72 Td
(Sheet 26) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/kalloc.c  Page 3) 23.478 Tj
0 -3.92728 Td
(2650   *rr = p;) 9.03 Tj
0 -5.23637 Td
(2651 ) 3.01 Tj
0 -6.54546 Td
(2652  out:) 6.02 Tj
0 -7.85455 Td
(2653   release\(&kalloc_lock\);) 17.458 Tj
0 -9.16364 Td
(2654 }) 3.612 Tj
0 -10.4727 Td
(2655 ) 3.01 Tj
0 -11.7818 Td
(2656 // Allocate n bytes of physical memory.) 26.488 Tj
0 -13.0909 Td
(2657 // Returns a kernel-segment pointer.) 24.682 Tj
0 -14.4 Td
(2658 // Returns 0 if the memory cannot be allocated.) 31.304 Tj
0 -15.7091 Td
(2659 char*) 6.02 Tj
0 -17.0182 Td
(2660 kalloc\(int n\)) 10.836 Tj
0 -18.3273 Td
(2661 {) 3.612 Tj
0 -19.6364 Td
(2662   struct run **rr;) 13.846 Tj
0 -20.9455 Td
(2663 ) 3.01 Tj
0 -22.2545 Td
(2664   if\(n % PAGE\)) 11.438 Tj
0 -23.5636 Td
(2665     panic\("kalloc"\);) 15.05 Tj
0 -24.8727 Td
(2666 ) 3.01 Tj
0 -26.1818 Td
(2667   acquire\(&kalloc_lock\);) 17.458 Tj
0 -27.4909 Td
(2668 ) 3.01 Tj
0 -28.8 Td
(2669   rr = &freelist;) 13.244 Tj
0 -30.1091 Td
(2670   while\(*rr\){) 10.836 Tj
0 -31.4182 Td
(2671     struct run *r = *rr;) 17.458 Tj
0 -32.7273 Td
(2672     if\(r->len == n\){) 15.05 Tj
0 -34.0364 Td
(2673       *rr = r->next;) 15.05 Tj
0 -35.3454 Td
(2674       release\(&kalloc_lock\);) 19.866 Tj
0 -36.6545 Td
(2675       return \(char*\) r;) 16.856 Tj
0 -37.9636 Td
(2676     }) 6.02 Tj
0 -39.2727 Td
(2677     if\(r->len > n\){) 14.448 Tj
0 -40.5818 Td
(2678       char *p = \(char*\)r + \(r->len - n\);) 27.09 Tj
0 -41.8909 Td
(2679       r->len -= n;) 13.846 Tj
0 -43.2 Td
(2680       release\(&kalloc_lock\);) 19.866 Tj
0 -44.5091 Td
(2681       return p;) 12.04 Tj
0 -45.8182 Td
(2682     }) 6.02 Tj
0 -47.1272 Td
(2683     rr = &\(*rr\)->next;) 16.254 Tj
0 -48.4363 Td
(2684   }) 4.816 Tj
0 -49.7454 Td
(2685   release\(&kalloc_lock\);) 17.458 Tj
0 -51.0545 Td
(2686   cprintf\("kalloc: out of memory\\n"\);) 25.284 Tj
0 -52.3636 Td
(2687   return 0;) 9.632 Tj
0 -53.6727 Td
(2688 }) 3.612 Tj
0 -54.9818 Td
(2689 ) 3.01 Tj
0 -56.2909 Td
(2690 ) 3.01 Tj
0 -57.6 Td
(2691 ) 3.01 Tj
0 -58.9091 Td
(2692 ) 3.01 Tj
0 -60.2181 Td
(2693 ) 3.01 Tj
0 -61.5272 Td
(2694 ) 3.01 Tj
0 -62.8363 Td
(2695 ) 3.01 Tj
0 -64.1454 Td
(2696 ) 3.01 Tj
0 -65.4545 Td
(2697 ) 3.01 Tj
0 -66.7636 Td
(2698 ) 3.01 Tj
0 -68.0727 Td
(2699 ) 3.01 Tj
0 -72 Td
(Sheet 26) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 34 34
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/syscall.h  Page 1) 24.08 Tj
0 -3.92728 Td
(2700 // System call numbers) 16.254 Tj
0 -5.23637 Td
(2701 #define SYS_fork    1) 15.652 Tj
0 -6.54546 Td
(2702 #define SYS_exit    2) 15.652 Tj
0 -7.85455 Td
(2703 #define SYS_wait    3) 15.652 Tj
0 -9.16364 Td
(2704 #define SYS_pipe    4) 15.652 Tj
0 -10.4727 Td
(2705 #define SYS_write   5) 15.652 Tj
0 -11.7818 Td
(2706 #define SYS_read    6) 15.652 Tj
0 -13.0909 Td
(2707 #define SYS_close   7) 15.652 Tj
0 -14.4 Td
(2708 #define SYS_kill    8) 15.652 Tj
0 -15.7091 Td
(2709 #define SYS_exec    9) 15.652 Tj
0 -17.0182 Td
(2710 #define SYS_open   10) 15.652 Tj
0 -18.3273 Td
(2711 #define SYS_mknod  11) 15.652 Tj
0 -19.6364 Td
(2712 #define SYS_unlink 12) 15.652 Tj
0 -20.9455 Td
(2713 #define SYS_fstat  13) 15.652 Tj
0 -22.2545 Td
(2714 #define SYS_link   14) 15.652 Tj
0 -23.5636 Td
(2715 #define SYS_mkdir  15) 15.652 Tj
0 -24.8727 Td
(2716 #define SYS_chdir  16) 15.652 Tj
0 -26.1818 Td
(2717 #define SYS_dup    17) 15.652 Tj
0 -27.4909 Td
(2718 #define SYS_getpid 18) 15.652 Tj
0 -28.8 Td
(2719 #define SYS_sbrk   19) 15.652 Tj
0 -30.1091 Td
(2720 ) 3.01 Tj
0 -31.4182 Td
(2721 ) 3.01 Tj
0 -32.7273 Td
(2722 ) 3.01 Tj
0 -34.0364 Td
(2723 ) 3.01 Tj
0 -35.3454 Td
(2724 ) 3.01 Tj
0 -36.6545 Td
(2725 ) 3.01 Tj
0 -37.9636 Td
(2726 ) 3.01 Tj
0 -39.2727 Td
(2727 ) 3.01 Tj
0 -40.5818 Td
(2728 ) 3.01 Tj
0 -41.8909 Td
(2729 ) 3.01 Tj
0 -43.2 Td
(2730 ) 3.01 Tj
0 -44.5091 Td
(2731 ) 3.01 Tj
0 -45.8182 Td
(2732 ) 3.01 Tj
0 -47.1272 Td
(2733 ) 3.01 Tj
0 -48.4363 Td
(2734 ) 3.01 Tj
0 -49.7454 Td
(2735 ) 3.01 Tj
0 -51.0545 Td
(2736 ) 3.01 Tj
0 -52.3636 Td
(2737 ) 3.01 Tj
0 -53.6727 Td
(2738 ) 3.01 Tj
0 -54.9818 Td
(2739 ) 3.01 Tj
0 -56.2909 Td
(2740 ) 3.01 Tj
0 -57.6 Td
(2741 ) 3.01 Tj
0 -58.9091 Td
(2742 ) 3.01 Tj
0 -60.2181 Td
(2743 ) 3.01 Tj
0 -61.5272 Td
(2744 ) 3.01 Tj
0 -62.8363 Td
(2745 ) 3.01 Tj
0 -64.1454 Td
(2746 ) 3.01 Tj
0 -65.4545 Td
(2747 ) 3.01 Tj
0 -66.7636 Td
(2748 ) 3.01 Tj
0 -68.0727 Td
(2749 ) 3.01 Tj
0 -72 Td
(Sheet 27) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/trapasm.S  Page 1) 24.08 Tj
0 -3.92728 Td
(2750 .text) 6.02 Tj
0 -5.23637 Td
(2751 .globl trap) 9.632 Tj
0 -6.54546 Td
(2752 .globl trapret1) 12.04 Tj
0 -7.85455 Td
(2753 ) 3.01 Tj
0 -9.16364 Td
(2754 .globl alltraps) 12.04 Tj
0 -10.4727 Td
(2755 alltraps:) 8.428 Tj
0 -11.7818 Td
(2756   /* vectors.S sends all traps here */) 25.886 Tj
0 -13.0909 Td
(2757   pushl   %ds      # build) 18.662 Tj
0 -14.4 Td
(2758   pushl   %es      #  trap) 18.662 Tj
0 -15.7091 Td
(2759   pushal           #  frame) 19.264 Tj
0 -17.0182 Td
(2760   movl $16,%eax    # SEG_KDATA << 3) 24.08 Tj
0 -18.3273 Td
(2761   movw %ax,%ds     #  kernel) 19.866 Tj
0 -19.6364 Td
(2762   movw %ax,%es     #  segments) 21.07 Tj
0 -20.9455 Td
(2763   pushl %esp       # pass pointer to this trapframe) 33.712 Tj
0 -22.2545 Td
(2764   call    trap     #  and call trap\(\)) 25.284 Tj
0 -23.5636 Td
(2765   addl $4, %esp) 12.04 Tj
0 -24.8727 Td
(2766   # return falls through to trapret...) 25.886 Tj
0 -26.1818 Td
(2767 ) 3.01 Tj
0 -27.4909 Td
(2768   /*) 5.418 Tj
0 -28.8 Td
(2769    * a forked process RETs here) 21.672 Tj
0 -30.1091 Td
(2770    * expects ESP to point to a Trapframe) 27.09 Tj
0 -31.4182 Td
(2771    */) 6.02 Tj
0 -32.7273 Td
(2772 .globl trapret) 11.438 Tj
0 -34.0364 Td
(2773 trapret:) 7.826 Tj
0 -35.3454 Td
(2774   popal) 7.224 Tj
0 -36.6545 Td
(2775   popl %es) 9.03 Tj
0 -37.9636 Td
(2776   popl %ds) 9.03 Tj
0 -39.2727 Td
(2777   addl $0x8, %esp /* trapno and errcode */) 28.294 Tj
0 -40.5818 Td
(2778   iret) 6.622 Tj
0 -41.8909 Td
(2779 ) 3.01 Tj
0 -43.2 Td
(2780 .globl forkret1) 12.04 Tj
0 -44.5091 Td
(2781 forkret1:) 8.428 Tj
0 -45.8182 Td
(2782   movl 4\(%esp\), %esp) 15.05 Tj
0 -47.1272 Td
(2783   jmp trapret) 10.836 Tj
0 -48.4363 Td
(2784 ) 3.01 Tj
0 -49.7454 Td
(2785 .globl  acpu) 10.234 Tj
0 -51.0545 Td
(2786 acpu:) 6.02 Tj
0 -52.3636 Td
(2787   .long 0) 8.428 Tj
0 -53.6727 Td
(2788 ) 3.01 Tj
0 -54.9818 Td
(2789 ) 3.01 Tj
0 -56.2909 Td
(2790 ) 3.01 Tj
0 -57.6 Td
(2791 ) 3.01 Tj
0 -58.9091 Td
(2792 ) 3.01 Tj
0 -60.2181 Td
(2793 ) 3.01 Tj
0 -61.5272 Td
(2794 ) 3.01 Tj
0 -62.8363 Td
(2795 ) 3.01 Tj
0 -64.1454 Td
(2796 ) 3.01 Tj
0 -65.4545 Td
(2797 ) 3.01 Tj
0 -66.7636 Td
(2798 ) 3.01 Tj
0 -68.0727 Td
(2799 ) 3.01 Tj
0 -72 Td
(Sheet 27) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 35 35
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/traps.h  Page 1) 22.876 Tj
0 -3.92728 Td
(2800 // x86 trap and interrupt constants.) 24.682 Tj
0 -5.23637 Td
(2801 ) 3.01 Tj
0 -6.54546 Td
(2802 // Processor-defined:) 15.652 Tj
0 -7.85455 Td
(2803 #define T_DIVIDE         0      // divide error) 31.304 Tj
0 -9.16364 Td
(2804 #define T_DEBUG          1      // debug exception) 33.11 Tj
0 -10.4727 Td
(2805 #define T_NMI            2      // non-maskable interrupt) 37.324 Tj
0 -11.7818 Td
(2806 #define T_BRKPT          3      // breakpoint) 30.1 Tj
0 -13.0909 Td
(2807 #define T_OFLOW          4      // overflow) 28.896 Tj
0 -14.4 Td
(2808 #define T_BOUND          5      // bounds check) 31.304 Tj
0 -15.7091 Td
(2809 #define T_ILLOP          6      // illegal opcode) 32.508 Tj
0 -17.0182 Td
(2810 #define T_DEVICE         7      // device not available) 36.12 Tj
0 -18.3273 Td
(2811 #define T_DBLFLT         8      // double fault) 31.304 Tj
0 -19.6364 Td
(2812 // #define T_COPROC      9      // reserved \(not used since 486\)) 41.538 Tj
0 -20.9455 Td
(2813 #define T_TSS           10      // invalid task switch segment) 40.334 Tj
0 -22.2545 Td
(2814 #define T_SEGNP         11      // segment not present) 35.518 Tj
0 -23.5636 Td
(2815 #define T_STACK         12      // stack exception) 33.11 Tj
0 -24.8727 Td
(2816 #define T_GPFLT         13      // genernal protection fault) 39.13 Tj
0 -26.1818 Td
(2817 #define T_PGFLT         14      // page fault) 30.1 Tj
0 -27.4909 Td
(2818 // #define T_RES        15      // reserved) 28.896 Tj
0 -28.8 Td
(2819 #define T_FPERR         16      // floating point error) 36.12 Tj
0 -30.1091 Td
(2820 #define T_ALIGN         17      // aligment check) 32.508 Tj
0 -31.4182 Td
(2821 #define T_MCHK          18      // machine check) 31.906 Tj
0 -32.7273 Td
(2822 #define T_SIMDERR       19      // SIMD floating point error) 39.13 Tj
0 -34.0364 Td
(2823 ) 3.01 Tj
0 -35.3454 Td
(2824 // These are arbitrarily chosen, but with care not to overlap) 39.732 Tj
0 -36.6545 Td
(2825 // processor defined exceptions or interrupt vectors.) 34.916 Tj
0 -37.9636 Td
(2826 #define T_SYSCALL       48      // system call) 30.702 Tj
0 -39.2727 Td
(2827 #define T_DEFAULT      500      // catchall) 28.896 Tj
0 -40.5818 Td
(2828 ) 3.01 Tj
0 -41.8909 Td
(2829 #define IRQ_OFFSET      32      // IRQ 0 corresponds to int IRQ_OFFSET) 45.15 Tj
0 -43.2 Td
(2830 ) 3.01 Tj
0 -44.5091 Td
(2831 #define IRQ_TIMER        0) 18.662 Tj
0 -45.8182 Td
(2832 #define IRQ_KBD          1) 18.662 Tj
0 -47.1272 Td
(2833 #define IRQ_IDE         14) 18.662 Tj
0 -48.4363 Td
(2834 #define IRQ_ERROR       19) 18.662 Tj
0 -49.7454 Td
(2835 #define IRQ_SPURIOUS    31) 18.662 Tj
0 -51.0545 Td
(2836 ) 3.01 Tj
0 -52.3636 Td
(2837 ) 3.01 Tj
0 -53.6727 Td
(2838 ) 3.01 Tj
0 -54.9818 Td
(2839 ) 3.01 Tj
0 -56.2909 Td
(2840 ) 3.01 Tj
0 -57.6 Td
(2841 ) 3.01 Tj
0 -58.9091 Td
(2842 ) 3.01 Tj
0 -60.2181 Td
(2843 ) 3.01 Tj
0 -61.5272 Td
(2844 ) 3.01 Tj
0 -62.8363 Td
(2845 ) 3.01 Tj
0 -64.1454 Td
(2846 ) 3.01 Tj
0 -65.4545 Td
(2847 ) 3.01 Tj
0 -66.7636 Td
(2848 ) 3.01 Tj
0 -68.0727 Td
(2849 ) 3.01 Tj
0 -72 Td
(Sheet 28) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/trap.c  Page 1) 22.274 Tj
0 -3.92728 Td
(2850 #include "types.h") 13.846 Tj
0 -5.23637 Td
(2851 #include "param.h") 13.846 Tj
0 -6.54546 Td
(2852 #include "mmu.h") 12.642 Tj
0 -7.85455 Td
(2853 #include "proc.h") 13.244 Tj
0 -9.16364 Td
(2854 #include "defs.h") 13.244 Tj
0 -10.4727 Td
(2855 #include "x86.h") 12.642 Tj
0 -11.7818 Td
(2856 #include "traps.h") 13.846 Tj
0 -13.0909 Td
(2857 #include "syscall.h") 15.05 Tj
0 -14.4 Td
(2858 ) 3.01 Tj
0 -15.7091 Td
(2859 // Interrupt descriptor table \(shared by all CPUs\).) 33.712 Tj
0 -17.0182 Td
(2860 struct gatedesc idt[256];) 18.06 Tj
0 -18.3273 Td
(2861 extern uint vectors[];  // in vectors.S: array of 256 entry pointers) 43.946 Tj
0 -19.6364 Td
(2862 ) 3.01 Tj
0 -20.9455 Td
(2863 void) 5.418 Tj
0 -22.2545 Td
(2864 tvinit\(void\)) 10.234 Tj
0 -23.5636 Td
(2865 {) 3.612 Tj
0 -24.8727 Td
(2866   int i;) 7.826 Tj
0 -26.1818 Td
(2867 ) 3.01 Tj
0 -27.4909 Td
(2868   for\(i = 0; i < 256; i++\)) 18.662 Tj
0 -28.8 Td
(2869     SETGATE\(idt[i], 0, SEG_KCODE << 3, vectors[i], 0\);) 35.518 Tj
0 -30.1091 Td
(2870   SETGATE\(idt[T_SYSCALL], 0, SEG_KCODE << 3, vectors[T_SYSCALL], 3\);) 43.946 Tj
0 -31.4182 Td
(2871 }) 3.612 Tj
0 -32.7273 Td
(2872 ) 3.01 Tj
0 -34.0364 Td
(2873 void) 5.418 Tj
0 -35.3454 Td
(2874 idtinit\(void\)) 10.836 Tj
0 -36.6545 Td
(2875 {) 3.612 Tj
0 -37.9636 Td
(2876   lidt\(idt, sizeof idt\);) 17.458 Tj
0 -39.2727 Td
(2877 }) 3.612 Tj
0 -40.5818 Td
(2878 ) 3.01 Tj
0 -41.8909 Td
(2879 void) 5.418 Tj
0 -43.2 Td
(2880 trap\(struct trapframe *tf\)) 18.662 Tj
0 -44.5091 Td
(2881 {) 3.612 Tj
0 -45.8182 Td
(2882   int v = tf->trapno;) 15.652 Tj
0 -47.1272 Td
(2883   struct proc *cp = curproc[cpu\(\)];) 24.08 Tj
0 -48.4363 Td
(2884 ) 3.01 Tj
0 -49.7454 Td
(2885   if\(v == T_SYSCALL\){) 15.652 Tj
0 -51.0545 Td
(2886     if\(cp->killed\)) 13.846 Tj
0 -52.3636 Td
(2887       proc_exit\(\);) 13.846 Tj
0 -53.6727 Td
(2888     cp->tf = tf;) 12.642 Tj
0 -54.9818 Td
(2889     syscall\(\);) 11.438 Tj
0 -56.2909 Td
(2890     if\(cp->killed\)) 13.846 Tj
0 -57.6 Td
(2891       proc_exit\(\);) 13.846 Tj
0 -58.9091 Td
(2892     return;) 9.632 Tj
0 -60.2181 Td
(2893   }) 4.816 Tj
0 -61.5272 Td
(2894 ) 3.01 Tj
0 -62.8363 Td
(2895 ) 3.01 Tj
0 -64.1454 Td
(2896 ) 3.01 Tj
0 -65.4545 Td
(2897 ) 3.01 Tj
0 -66.7636 Td
(2898 ) 3.01 Tj
0 -68.0727 Td
(2899 ) 3.01 Tj
0 -72 Td
(Sheet 28) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 36 36
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/trap.c  Page 2) 22.274 Tj
0 -3.92728 Td
(2900   // Increment nlock to make sure interrupts stay off) 34.916 Tj
0 -5.23637 Td
(2901   // during interrupt handler.  Decrement before returning.) 38.528 Tj
0 -6.54546 Td
(2902   cpus[cpu\(\)].nlock++;) 16.254 Tj
0 -7.85455 Td
(2903 ) 3.01 Tj
0 -9.16364 Td
(2904   switch\(v\){) 10.234 Tj
0 -10.4727 Td
(2905   case IRQ_OFFSET + IRQ_TIMER:) 21.07 Tj
0 -11.7818 Td
(2906     lapic_timerintr\(\);) 16.254 Tj
0 -13.0909 Td
(2907     cpus[cpu\(\)].nlock--;) 17.458 Tj
0 -14.4 Td
(2908     if\(cp\){) 9.632 Tj
0 -15.7091 Td
(2909       // Force process exit if it has been killed and is in user space.) 45.752 Tj
0 -17.0182 Td
(2910       // \(If it is still executing in the kernel, let it keep running) 44.548 Tj
0 -18.3273 Td
(2911       // until it gets to the regular system call return.\)) 37.926 Tj
0 -19.6364 Td
(2912       if\(\(tf->cs&3\) == 3 && cp->killed\)) 26.488 Tj
0 -20.9455 Td
(2913         proc_exit\(\);) 15.05 Tj
0 -22.2545 Td
(2914 ) 3.01 Tj
0 -23.5636 Td
(2915       // Force process to give up CPU and let others run.) 37.324 Tj
0 -24.8727 Td
(2916       if\(cp->state == RUNNING\)) 21.07 Tj
0 -26.1818 Td
(2917         yield\(\);) 12.642 Tj
0 -27.4909 Td
(2918     }) 6.02 Tj
0 -28.8 Td
(2919     return;) 9.632 Tj
0 -30.1091 Td
(2920 ) 3.01 Tj
0 -31.4182 Td
(2921   case IRQ_OFFSET + IRQ_IDE:) 19.866 Tj
0 -32.7273 Td
(2922     ide_intr\(\);) 12.04 Tj
0 -34.0364 Td
(2923     lapic_eoi\(\);) 12.642 Tj
0 -35.3454 Td
(2924     break;) 9.03 Tj
0 -36.6545 Td
(2925 ) 3.01 Tj
0 -37.9636 Td
(2926   case IRQ_OFFSET + IRQ_KBD:) 19.866 Tj
0 -39.2727 Td
(2927     kbd_intr\(\);) 12.04 Tj
0 -40.5818 Td
(2928     lapic_eoi\(\);) 12.642 Tj
0 -41.8909 Td
(2929     break;) 9.03 Tj
0 -43.2 Td
(2930 ) 3.01 Tj
0 -44.5091 Td
(2931   case IRQ_OFFSET + IRQ_SPURIOUS:) 22.876 Tj
0 -45.8182 Td
(2932     cprintf\("spurious interrupt from cpu %d eip %x\\n", cpu\(\), tf->eip\);) 45.752 Tj
0 -47.1272 Td
(2933     break;) 9.03 Tj
0 -48.4363 Td
(2934 ) 3.01 Tj
0 -49.7454 Td
(2935   default:) 9.03 Tj
0 -51.0545 Td
(2936     if\(curproc[cpu\(\)]\) {) 17.458 Tj
0 -52.3636 Td
(2937       // Assume process divided by zero or dereferenced null, etc.) 42.742 Tj
0 -53.6727 Td
(2938       cprintf\("pid %d: unhandled trap %d on cpu %d eip %x -- kill proc\\n",) 47.558 Tj
0 -54.9818 Td
(2939               curproc[cpu\(\)]->pid, v, cpu\(\), tf->eip\);) 35.518 Tj
0 -56.2909 Td
(2940       proc_exit\(\);) 13.846 Tj
0 -57.6 Td
(2941     }) 6.02 Tj
0 -58.9091 Td
(2942 ) 3.01 Tj
0 -60.2181 Td
(2943     // Otherwise it's our mistake.) 23.478 Tj
0 -61.5272 Td
(2944     cprintf\("unexpected trap %d from cpu %d eip %x\\n", v, cpu\(\), tf->eip\);) 47.558 Tj
0 -62.8363 Td
(2945     panic\("trap"\);) 13.846 Tj
0 -64.1454 Td
(2946   }) 4.816 Tj
0 -65.4545 Td
(2947 ) 3.01 Tj
0 -66.7636 Td
(2948   cpus[cpu\(\)].nlock--;) 16.254 Tj
0 -68.0727 Td
(2949 }) 3.612 Tj
0 -72 Td
(Sheet 29) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/vectors.pl  Page 1) 24.682 Tj
0 -3.92728 Td
(2950 #!/usr/bin/perl -w) 13.846 Tj
0 -5.23637 Td
(2951 ) 3.01 Tj
0 -6.54546 Td
(2952 # Generate vectors.S, the trap/interrupt entry points.) 35.518 Tj
0 -7.85455 Td
(2953 # There has to be one entry point per interrupt number) 35.518 Tj
0 -9.16364 Td
(2954 # since otherwise there's no way for trap\(\) to discover) 36.12 Tj
0 -10.4727 Td
(2955 # the interrupt number.) 16.856 Tj
0 -11.7818 Td
(2956 ) 3.01 Tj
0 -13.0909 Td
(2957 print "# generated by vectors.pl - do not edit\\n";) 33.11 Tj
0 -14.4 Td
(2958 print "# handlers\\n";) 15.652 Tj
0 -15.7091 Td
(2959 print ".text\\n";) 12.642 Tj
0 -17.0182 Td
(2960 print ".globl alltraps\\n";) 18.662 Tj
0 -18.3273 Td
(2961 for\(my $i = 0; $i < 256; $i++\){) 21.672 Tj
0 -19.6364 Td
(2962     print ".globl vector$i\\n";) 21.07 Tj
0 -20.9455 Td
(2963     print "vector$i:\\n";) 17.458 Tj
0 -22.2545 Td
(2964     if\(\($i < 8 || $i > 14\) && $i != 17\){) 27.09 Tj
0 -23.5636 Td
(2965         print "  pushl \\$0\\n";) 21.07 Tj
0 -24.8727 Td
(2966     }) 6.02 Tj
0 -26.1818 Td
(2967     print "  pushl \\$$i\\n";) 19.264 Tj
0 -27.4909 Td
(2968     print "  jmp alltraps\\n";) 20.468 Tj
0 -28.8 Td
(2969 }) 3.612 Tj
0 -30.1091 Td
(2970 ) 3.01 Tj
0 -31.4182 Td
(2971 print "\\n# vector table\\n";) 19.264 Tj
0 -32.7273 Td
(2972 print ".data\\n";) 12.642 Tj
0 -34.0364 Td
(2973 print ".globl vectors\\n";) 18.06 Tj
0 -35.3454 Td
(2974 print "vectors:\\n";) 14.448 Tj
0 -36.6545 Td
(2975 for\(my $i = 0; $i < 256; $i++\){) 21.672 Tj
0 -37.9636 Td
(2976     print "  .long vector$i\\n";) 21.672 Tj
0 -39.2727 Td
(2977 }) 3.612 Tj
0 -40.5818 Td
(2978 ) 3.01 Tj
0 -41.8909 Td
(2979 ) 3.01 Tj
0 -43.2 Td
(2980 ) 3.01 Tj
0 -44.5091 Td
(2981 ) 3.01 Tj
0 -45.8182 Td
(2982 ) 3.01 Tj
0 -47.1272 Td
(2983 ) 3.01 Tj
0 -48.4363 Td
(2984 ) 3.01 Tj
0 -49.7454 Td
(2985 ) 3.01 Tj
0 -51.0545 Td
(2986 ) 3.01 Tj
0 -52.3636 Td
(2987 ) 3.01 Tj
0 -53.6727 Td
(2988 ) 3.01 Tj
0 -54.9818 Td
(2989 ) 3.01 Tj
0 -56.2909 Td
(2990 ) 3.01 Tj
0 -57.6 Td
(2991 ) 3.01 Tj
0 -58.9091 Td
(2992 ) 3.01 Tj
0 -60.2181 Td
(2993 ) 3.01 Tj
0 -61.5272 Td
(2994 ) 3.01 Tj
0 -62.8363 Td
(2995 ) 3.01 Tj
0 -64.1454 Td
(2996 ) 3.01 Tj
0 -65.4545 Td
(2997 ) 3.01 Tj
0 -66.7636 Td
(2998 ) 3.01 Tj
0 -68.0727 Td
(2999 ) 3.01 Tj
0 -72 Td
(Sheet 29) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 37 37
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/syscall.c  Page 1) 24.08 Tj
0 -3.92728 Td
(3000 #include "types.h") 13.846 Tj
0 -5.23637 Td
(3001 #include "stat.h") 13.244 Tj
0 -6.54546 Td
(3002 #include "param.h") 13.846 Tj
0 -7.85455 Td
(3003 #include "mmu.h") 12.642 Tj
0 -9.16364 Td
(3004 #include "proc.h") 13.244 Tj
0 -10.4727 Td
(3005 #include "defs.h") 13.244 Tj
0 -11.7818 Td
(3006 #include "x86.h") 12.642 Tj
0 -13.0909 Td
(3007 #include "traps.h") 13.846 Tj
0 -14.4 Td
(3008 #include "syscall.h") 15.05 Tj
0 -15.7091 Td
(3009 #include "spinlock.h") 15.652 Tj
0 -17.0182 Td
(3010 #include "buf.h") 12.642 Tj
0 -18.3273 Td
(3011 #include "fs.h") 12.04 Tj
0 -19.6364 Td
(3012 #include "fsvar.h") 13.846 Tj
0 -20.9455 Td
(3013 #include "elf.h") 12.642 Tj
0 -22.2545 Td
(3014 #include "file.h") 13.244 Tj
0 -23.5636 Td
(3015 #include "fcntl.h") 13.846 Tj
0 -24.8727 Td
(3016 ) 3.01 Tj
0 -26.1818 Td
(3017 // User code makes a system call with INT T_SYSCALL.) 34.314 Tj
0 -27.4909 Td
(3018 // System call number in %eax.) 21.07 Tj
0 -28.8 Td
(3019 // Arguments on the stack, from the user call to the C) 35.518 Tj
0 -30.1091 Td
(3020 // library system call function. The saved user %esp points) 38.528 Tj
0 -31.4182 Td
(3021 // to a saved program counter, and then the first argument.) 38.528 Tj
0 -32.7273 Td
(3022 ) 3.01 Tj
0 -34.0364 Td
(3023 // Fetch the int at addr from process p.) 27.09 Tj
0 -35.3454 Td
(3024 int) 4.816 Tj
0 -36.6545 Td
(3025 fetchint\(struct proc *p, uint addr, int *ip\)) 29.498 Tj
0 -37.9636 Td
(3026 {) 3.612 Tj
0 -39.2727 Td
(3027   if\(addr >= p->sz || addr+4 > p->sz\)) 25.284 Tj
0 -40.5818 Td
(3028     return -1;) 11.438 Tj
0 -41.8909 Td
(3029   *ip = *\(int*\)\(p->mem + addr\);) 21.672 Tj
0 -43.2 Td
(3030   return 0;) 9.632 Tj
0 -44.5091 Td
(3031 }) 3.612 Tj
0 -45.8182 Td
(3032 ) 3.01 Tj
0 -47.1272 Td
(3033 // Fetch the nul-terminated string at addr from process p.) 37.926 Tj
0 -48.4363 Td
(3034 // Doesn't actually copy the string - just sets *pp to point at it.) 43.344 Tj
0 -49.7454 Td
(3035 // Returns length of string, not including nul.) 31.304 Tj
0 -51.0545 Td
(3036 int) 4.816 Tj
0 -52.3636 Td
(3037 fetchstr\(struct proc *p, uint addr, char **pp\)) 30.702 Tj
0 -53.6727 Td
(3038 {) 3.612 Tj
0 -54.9818 Td
(3039   char *cp, *ep;) 12.642 Tj
0 -56.2909 Td
(3040 ) 3.01 Tj
0 -57.6 Td
(3041   if\(addr >= p->sz\)) 14.448 Tj
0 -58.9091 Td
(3042     return -1;) 11.438 Tj
0 -60.2181 Td
(3043   *pp = p->mem + addr;) 16.254 Tj
0 -61.5272 Td
(3044   ep = p->mem + p->sz;) 16.254 Tj
0 -62.8363 Td
(3045   for\(cp = *pp; cp < ep; cp++\)) 21.07 Tj
0 -64.1454 Td
(3046     if\(*cp == 0\)) 12.642 Tj
0 -65.4545 Td
(3047       return cp - *pp;) 16.254 Tj
0 -66.7636 Td
(3048   return -1;) 10.234 Tj
0 -68.0727 Td
(3049 }) 3.612 Tj
0 -72 Td
(Sheet 30) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/syscall.c  Page 2) 24.08 Tj
0 -3.92728 Td
(3050 // Fetch the argno'th word-sized system call argument as an integer.) 43.946 Tj
0 -5.23637 Td
(3051 int) 4.816 Tj
0 -6.54546 Td
(3052 argint\(int argno, int *ip\)) 18.662 Tj
0 -7.85455 Td
(3053 {) 3.612 Tj
0 -9.16364 Td
(3054   struct proc *p = curproc[cpu\(\)];) 23.478 Tj
0 -10.4727 Td
(3055 ) 3.01 Tj
0 -11.7818 Td
(3056   return fetchint\(p, p->tf->esp + 4 + 4*argno, ip\);) 33.712 Tj
0 -13.0909 Td
(3057 }) 3.612 Tj
0 -14.4 Td
(3058 ) 3.01 Tj
0 -15.7091 Td
(3059 // Fetch the nth word-sized system call argument as a pointer) 39.732 Tj
0 -17.0182 Td
(3060 // to a block of memory of size n bytes.  Check that the pointer) 41.538 Tj
0 -18.3273 Td
(3061 // lies within the process address space.) 27.692 Tj
0 -19.6364 Td
(3062 int) 4.816 Tj
0 -20.9455 Td
(3063 argptr\(int argno, char **pp, int size\)) 25.886 Tj
0 -22.2545 Td
(3064 {) 3.612 Tj
0 -23.5636 Td
(3065   int i;) 7.826 Tj
0 -24.8727 Td
(3066   struct proc *p = curproc[cpu\(\)];) 23.478 Tj
0 -26.1818 Td
(3067 ) 3.01 Tj
0 -27.4909 Td
(3068   if\(argint\(argno, &i\) < 0\)) 19.264 Tj
0 -28.8 Td
(3069     return -1;) 11.438 Tj
0 -30.1091 Td
(3070   if\(\(uint\)i >= p->sz || \(uint\)i+size >= p->sz\)) 31.304 Tj
0 -31.4182 Td
(3071     return -1;) 11.438 Tj
0 -32.7273 Td
(3072   *pp = p->mem + i;) 14.448 Tj
0 -34.0364 Td
(3073   return 0;) 9.632 Tj
0 -35.3454 Td
(3074 }) 3.612 Tj
0 -36.6545 Td
(3075 ) 3.01 Tj
0 -37.9636 Td
(3076 // Fetch the nth word-sized system call argument as a string pointer.) 44.548 Tj
0 -39.2727 Td
(3077 // Check that the pointer is valid and the string is nul-terminated.) 43.946 Tj
0 -40.5818 Td
(3078 // \(There is no shared writable memory, so the string can't change) 42.742 Tj
0 -41.8909 Td
(3079 // between this check and being used by the kernel.\)) 34.314 Tj
0 -43.2 Td
(3080 int) 4.816 Tj
0 -44.5091 Td
(3081 argstr\(int argno, char **pp\)) 19.866 Tj
0 -45.8182 Td
(3082 {) 3.612 Tj
0 -47.1272 Td
(3083   int addr;) 9.632 Tj
0 -48.4363 Td
(3084   if\(argint\(argno, &addr\) < 0\)) 21.07 Tj
0 -49.7454 Td
(3085     return -1;) 11.438 Tj
0 -51.0545 Td
(3086   return fetchstr\(curproc[cpu\(\)], addr, pp\);) 29.498 Tj
0 -52.3636 Td
(3087 }) 3.612 Tj
0 -53.6727 Td
(3088 ) 3.01 Tj
0 -54.9818 Td
(3089 ) 3.01 Tj
0 -56.2909 Td
(3090 ) 3.01 Tj
0 -57.6 Td
(3091 ) 3.01 Tj
0 -58.9091 Td
(3092 ) 3.01 Tj
0 -60.2181 Td
(3093 ) 3.01 Tj
0 -61.5272 Td
(3094 ) 3.01 Tj
0 -62.8363 Td
(3095 ) 3.01 Tj
0 -64.1454 Td
(3096 ) 3.01 Tj
0 -65.4545 Td
(3097 ) 3.01 Tj
0 -66.7636 Td
(3098 ) 3.01 Tj
0 -68.0727 Td
(3099 ) 3.01 Tj
0 -72 Td
(Sheet 30) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 38 38
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/syscall.c  Page 3) 24.08 Tj
0 -3.92728 Td
(3100 extern int sys_chdir\(void\);) 19.264 Tj
0 -5.23637 Td
(3101 extern int sys_close\(void\);) 19.264 Tj
0 -6.54546 Td
(3102 extern int sys_dup\(void\);) 18.06 Tj
0 -7.85455 Td
(3103 extern int sys_exec\(void\);) 18.662 Tj
0 -9.16364 Td
(3104 extern int sys_exit\(void\);) 18.662 Tj
0 -10.4727 Td
(3105 extern int sys_fork\(void\);) 18.662 Tj
0 -11.7818 Td
(3106 extern int sys_fstat\(void\);) 19.264 Tj
0 -13.0909 Td
(3107 extern int sys_getpid\(void\);) 19.866 Tj
0 -14.4 Td
(3108 extern int sys_kill\(void\);) 18.662 Tj
0 -15.7091 Td
(3109 extern int sys_link\(void\);) 18.662 Tj
0 -17.0182 Td
(3110 extern int sys_mkdir\(void\);) 19.264 Tj
0 -18.3273 Td
(3111 extern int sys_mknod\(void\);) 19.264 Tj
0 -19.6364 Td
(3112 extern int sys_open\(void\);) 18.662 Tj
0 -20.9455 Td
(3113 extern int sys_pipe\(void\);) 18.662 Tj
0 -22.2545 Td
(3114 extern int sys_read\(void\);) 18.662 Tj
0 -23.5636 Td
(3115 extern int sys_sbrk\(void\);) 18.662 Tj
0 -24.8727 Td
(3116 extern int sys_unlink\(void\);) 19.866 Tj
0 -26.1818 Td
(3117 extern int sys_wait\(void\);) 18.662 Tj
0 -27.4909 Td
(3118 extern int sys_write\(void\);) 19.264 Tj
0 -28.8 Td
(3119 ) 3.01 Tj
0 -30.1091 Td
(3120 void) 5.418 Tj
0 -31.4182 Td
(3121 syscall\(void\)) 10.836 Tj
0 -32.7273 Td
(3122 {) 3.612 Tj
0 -34.0364 Td
(3123   struct proc *cp = curproc[cpu\(\)];) 24.08 Tj
0 -35.3454 Td
(3124   int num = cp->tf->eax;) 17.458 Tj
0 -36.6545 Td
(3125   int ret = -1;) 12.04 Tj
0 -37.9636 Td
(3126 ) 3.01 Tj
0 -39.2727 Td
(3127   switch\(num\){) 11.438 Tj
0 -40.5818 Td
(3128   case SYS_fork:) 12.642 Tj
0 -41.8909 Td
(3129     ret = sys_fork\(\);) 15.652 Tj
0 -43.2 Td
(3130     break;) 9.03 Tj
0 -44.5091 Td
(3131   case SYS_exit:) 12.642 Tj
0 -45.8182 Td
(3132     ret = sys_exit\(\);) 15.652 Tj
0 -47.1272 Td
(3133     break;) 9.03 Tj
0 -48.4363 Td
(3134   case SYS_wait:) 12.642 Tj
0 -49.7454 Td
(3135     ret = sys_wait\(\);) 15.652 Tj
0 -51.0545 Td
(3136     break;) 9.03 Tj
0 -52.3636 Td
(3137   case SYS_pipe:) 12.642 Tj
0 -53.6727 Td
(3138     ret = sys_pipe\(\);) 15.652 Tj
0 -54.9818 Td
(3139     break;) 9.03 Tj
0 -56.2909 Td
(3140   case SYS_write:) 13.244 Tj
0 -57.6 Td
(3141     ret = sys_write\(\);) 16.254 Tj
0 -58.9091 Td
(3142     break;) 9.03 Tj
0 -60.2181 Td
(3143   case SYS_read:) 12.642 Tj
0 -61.5272 Td
(3144     ret = sys_read\(\);) 15.652 Tj
0 -62.8363 Td
(3145     break;) 9.03 Tj
0 -64.1454 Td
(3146   case SYS_close:) 13.244 Tj
0 -65.4545 Td
(3147     ret = sys_close\(\);) 16.254 Tj
0 -66.7636 Td
(3148     break;) 9.03 Tj
0 -68.0727 Td
(3149   case SYS_kill:) 12.642 Tj
0 -72 Td
(Sheet 31) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/syscall.c  Page 4) 24.08 Tj
0 -3.92728 Td
(3150     ret = sys_kill\(\);) 15.652 Tj
0 -5.23637 Td
(3151     break;) 9.03 Tj
0 -6.54546 Td
(3152   case SYS_exec:) 12.642 Tj
0 -7.85455 Td
(3153     ret = sys_exec\(\);) 15.652 Tj
0 -9.16364 Td
(3154     break;) 9.03 Tj
0 -10.4727 Td
(3155   case SYS_open:) 12.642 Tj
0 -11.7818 Td
(3156     ret = sys_open\(\);) 15.652 Tj
0 -13.0909 Td
(3157     break;) 9.03 Tj
0 -14.4 Td
(3158   case SYS_mknod:) 13.244 Tj
0 -15.7091 Td
(3159     ret = sys_mknod\(\);) 16.254 Tj
0 -17.0182 Td
(3160     break;) 9.03 Tj
0 -18.3273 Td
(3161   case SYS_unlink:) 13.846 Tj
0 -19.6364 Td
(3162     ret = sys_unlink\(\);) 16.856 Tj
0 -20.9455 Td
(3163     break;) 9.03 Tj
0 -22.2545 Td
(3164   case SYS_fstat:) 13.244 Tj
0 -23.5636 Td
(3165     ret = sys_fstat\(\);) 16.254 Tj
0 -24.8727 Td
(3166     break;) 9.03 Tj
0 -26.1818 Td
(3167   case SYS_link:) 12.642 Tj
0 -27.4909 Td
(3168     ret = sys_link\(\);) 15.652 Tj
0 -28.8 Td
(3169     break;) 9.03 Tj
0 -30.1091 Td
(3170   case SYS_mkdir:) 13.244 Tj
0 -31.4182 Td
(3171     ret = sys_mkdir\(\);) 16.254 Tj
0 -32.7273 Td
(3172     break;) 9.03 Tj
0 -34.0364 Td
(3173   case SYS_chdir:) 13.244 Tj
0 -35.3454 Td
(3174     ret = sys_chdir\(\);) 16.254 Tj
0 -36.6545 Td
(3175     break;) 9.03 Tj
0 -37.9636 Td
(3176   case SYS_dup:) 12.04 Tj
0 -39.2727 Td
(3177     ret = sys_dup\(\);) 15.05 Tj
0 -40.5818 Td
(3178     break;) 9.03 Tj
0 -41.8909 Td
(3179   case SYS_getpid:) 13.846 Tj
0 -43.2 Td
(3180     ret = sys_getpid\(\);) 16.856 Tj
0 -44.5091 Td
(3181     break;) 9.03 Tj
0 -45.8182 Td
(3182   case SYS_sbrk:) 12.642 Tj
0 -47.1272 Td
(3183     ret = sys_sbrk\(\);) 15.652 Tj
0 -48.4363 Td
(3184     break;) 9.03 Tj
0 -49.7454 Td
(3185   default:) 9.03 Tj
0 -51.0545 Td
(3186     cprintf\("unknown sys call %d\\n", num\);) 28.294 Tj
0 -52.3636 Td
(3187     // Maybe kill the process?) 21.07 Tj
0 -53.6727 Td
(3188     break;) 9.03 Tj
0 -54.9818 Td
(3189   }) 4.816 Tj
0 -56.2909 Td
(3190   cp->tf->eax = ret;) 15.05 Tj
0 -57.6 Td
(3191 }) 3.612 Tj
0 -58.9091 Td
(3192 ) 3.01 Tj
0 -60.2181 Td
(3193 ) 3.01 Tj
0 -61.5272 Td
(3194 ) 3.01 Tj
0 -62.8363 Td
(3195 ) 3.01 Tj
0 -64.1454 Td
(3196 ) 3.01 Tj
0 -65.4545 Td
(3197 ) 3.01 Tj
0 -66.7636 Td
(3198 ) 3.01 Tj
0 -68.0727 Td
(3199 ) 3.01 Tj
0 -72 Td
(Sheet 31) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 39 39
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/sysproc.c  Page 1) 24.08 Tj
0 -3.92728 Td
(3200 #include "types.h") 13.846 Tj
0 -5.23637 Td
(3201 #include "stat.h") 13.244 Tj
0 -6.54546 Td
(3202 #include "param.h") 13.846 Tj
0 -7.85455 Td
(3203 #include "mmu.h") 12.642 Tj
0 -9.16364 Td
(3204 #include "proc.h") 13.244 Tj
0 -10.4727 Td
(3205 #include "defs.h") 13.244 Tj
0 -11.7818 Td
(3206 #include "x86.h") 12.642 Tj
0 -13.0909 Td
(3207 #include "traps.h") 13.846 Tj
0 -14.4 Td
(3208 #include "syscall.h") 15.05 Tj
0 -15.7091 Td
(3209 #include "spinlock.h") 15.652 Tj
0 -17.0182 Td
(3210 #include "buf.h") 12.642 Tj
0 -18.3273 Td
(3211 #include "fs.h") 12.04 Tj
0 -19.6364 Td
(3212 #include "fsvar.h") 13.846 Tj
0 -20.9455 Td
(3213 #include "elf.h") 12.642 Tj
0 -22.2545 Td
(3214 #include "file.h") 13.244 Tj
0 -23.5636 Td
(3215 #include "fcntl.h") 13.846 Tj
0 -24.8727 Td
(3216 ) 3.01 Tj
0 -26.1818 Td
(3217 int) 4.816 Tj
0 -27.4909 Td
(3218 sys_fork\(void\)) 11.438 Tj
0 -28.8 Td
(3219 {) 3.612 Tj
0 -30.1091 Td
(3220   struct proc *np;) 13.846 Tj
0 -31.4182 Td
(3221 ) 3.01 Tj
0 -32.7273 Td
(3222   if\(\(np = copyproc\(curproc[cpu\(\)]\)\) == 0\)) 28.294 Tj
0 -34.0364 Td
(3223     return -1;) 11.438 Tj
0 -35.3454 Td
(3224   np->state = RUNNABLE;) 16.856 Tj
0 -36.6545 Td
(3225   return np->pid;) 13.244 Tj
0 -37.9636 Td
(3226 }) 3.612 Tj
0 -39.2727 Td
(3227 ) 3.01 Tj
0 -40.5818 Td
(3228 int) 4.816 Tj
0 -41.8909 Td
(3229 sys_exit\(void\)) 11.438 Tj
0 -43.2 Td
(3230 {) 3.612 Tj
0 -44.5091 Td
(3231   proc_exit\(\);) 11.438 Tj
0 -45.8182 Td
(3232   return 0;  // not reached) 19.264 Tj
0 -47.1272 Td
(3233 }) 3.612 Tj
0 -48.4363 Td
(3234 ) 3.01 Tj
0 -49.7454 Td
(3235 int) 4.816 Tj
0 -51.0545 Td
(3236 sys_wait\(void\)) 11.438 Tj
0 -52.3636 Td
(3237 {) 3.612 Tj
0 -53.6727 Td
(3238   return proc_wait\(\);) 15.652 Tj
0 -54.9818 Td
(3239 }) 3.612 Tj
0 -56.2909 Td
(3240 ) 3.01 Tj
0 -57.6 Td
(3241 int) 4.816 Tj
0 -58.9091 Td
(3242 sys_kill\(void\)) 11.438 Tj
0 -60.2181 Td
(3243 {) 3.612 Tj
0 -61.5272 Td
(3244   int pid;) 9.03 Tj
0 -62.8363 Td
(3245 ) 3.01 Tj
0 -64.1454 Td
(3246   if\(argint\(0, &pid\) < 0\)) 18.06 Tj
0 -65.4545 Td
(3247     return -1;) 11.438 Tj
0 -66.7636 Td
(3248   return proc_kill\(pid\);) 17.458 Tj
0 -68.0727 Td
(3249 }) 3.612 Tj
0 -72 Td
(Sheet 32) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/sysproc.c  Page 2) 24.08 Tj
0 -3.92728 Td
(3250 int) 4.816 Tj
0 -5.23637 Td
(3251 sys_getpid\(void\)) 12.642 Tj
0 -6.54546 Td
(3252 {) 3.612 Tj
0 -7.85455 Td
(3253   return curproc[cpu\(\)]->pid;) 20.468 Tj
0 -9.16364 Td
(3254 }) 3.612 Tj
0 -10.4727 Td
(3255 ) 3.01 Tj
0 -11.7818 Td
(3256 int) 4.816 Tj
0 -13.0909 Td
(3257 sys_sbrk\(void\)) 11.438 Tj
0 -14.4 Td
(3258 {) 3.612 Tj
0 -15.7091 Td
(3259   int addr;) 9.632 Tj
0 -17.0182 Td
(3260   int n;) 7.826 Tj
0 -18.3273 Td
(3261   struct proc *cp = curproc[cpu\(\)];) 24.08 Tj
0 -19.6364 Td
(3262 ) 3.01 Tj
0 -20.9455 Td
(3263   if\(argint\(0, &n\) < 0\)) 16.856 Tj
0 -22.2545 Td
(3264     return -1;) 11.438 Tj
0 -23.5636 Td
(3265   if\(\(addr = growproc\(n\)\) < 0\)) 21.07 Tj
0 -24.8727 Td
(3266     return -1;) 11.438 Tj
0 -26.1818 Td
(3267   setupsegs\(cp\);) 12.642 Tj
0 -27.4909 Td
(3268   return addr;) 11.438 Tj
0 -28.8 Td
(3269 }) 3.612 Tj
0 -30.1091 Td
(3270 ) 3.01 Tj
0 -31.4182 Td
(3271 ) 3.01 Tj
0 -32.7273 Td
(3272 ) 3.01 Tj
0 -34.0364 Td
(3273 ) 3.01 Tj
0 -35.3454 Td
(3274 ) 3.01 Tj
0 -36.6545 Td
(3275 ) 3.01 Tj
0 -37.9636 Td
(3276 ) 3.01 Tj
0 -39.2727 Td
(3277 ) 3.01 Tj
0 -40.5818 Td
(3278 ) 3.01 Tj
0 -41.8909 Td
(3279 ) 3.01 Tj
0 -43.2 Td
(3280 ) 3.01 Tj
0 -44.5091 Td
(3281 ) 3.01 Tj
0 -45.8182 Td
(3282 ) 3.01 Tj
0 -47.1272 Td
(3283 ) 3.01 Tj
0 -48.4363 Td
(3284 ) 3.01 Tj
0 -49.7454 Td
(3285 ) 3.01 Tj
0 -51.0545 Td
(3286 ) 3.01 Tj
0 -52.3636 Td
(3287 ) 3.01 Tj
0 -53.6727 Td
(3288 ) 3.01 Tj
0 -54.9818 Td
(3289 ) 3.01 Tj
0 -56.2909 Td
(3290 ) 3.01 Tj
0 -57.6 Td
(3291 ) 3.01 Tj
0 -58.9091 Td
(3292 ) 3.01 Tj
0 -60.2181 Td
(3293 ) 3.01 Tj
0 -61.5272 Td
(3294 ) 3.01 Tj
0 -62.8363 Td
(3295 ) 3.01 Tj
0 -64.1454 Td
(3296 ) 3.01 Tj
0 -65.4545 Td
(3297 ) 3.01 Tj
0 -66.7636 Td
(3298 ) 3.01 Tj
0 -68.0727 Td
(3299 ) 3.01 Tj
0 -72 Td
(Sheet 32) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 40 40
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/buf.h  Page 1) 21.672 Tj
0 -3.92728 Td
(3300 struct buf {) 10.234 Tj
0 -5.23637 Td
(3301   int flags;) 10.234 Tj
0 -6.54546 Td
(3302   uint dev;) 9.632 Tj
0 -7.85455 Td
(3303   uint sector;) 11.438 Tj
0 -9.16364 Td
(3304   struct buf *prev;) 14.448 Tj
0 -10.4727 Td
(3305   struct buf *next;) 14.448 Tj
0 -11.7818 Td
(3306   uchar data[512];) 13.846 Tj
0 -13.0909 Td
(3307 };) 4.214 Tj
0 -14.4 Td
(3308 #define B_BUSY 0x1  // buffer is locked by some process) 36.12 Tj
0 -15.7091 Td
(3309 #define B_VALID 0x2 // buffer contains the data of the sector) 39.732 Tj
0 -17.0182 Td
(3310 ) 3.01 Tj
0 -18.3273 Td
(3311 ) 3.01 Tj
0 -19.6364 Td
(3312 ) 3.01 Tj
0 -20.9455 Td
(3313 ) 3.01 Tj
0 -22.2545 Td
(3314 ) 3.01 Tj
0 -23.5636 Td
(3315 ) 3.01 Tj
0 -24.8727 Td
(3316 ) 3.01 Tj
0 -26.1818 Td
(3317 ) 3.01 Tj
0 -27.4909 Td
(3318 ) 3.01 Tj
0 -28.8 Td
(3319 ) 3.01 Tj
0 -30.1091 Td
(3320 ) 3.01 Tj
0 -31.4182 Td
(3321 ) 3.01 Tj
0 -32.7273 Td
(3322 ) 3.01 Tj
0 -34.0364 Td
(3323 ) 3.01 Tj
0 -35.3454 Td
(3324 ) 3.01 Tj
0 -36.6545 Td
(3325 ) 3.01 Tj
0 -37.9636 Td
(3326 ) 3.01 Tj
0 -39.2727 Td
(3327 ) 3.01 Tj
0 -40.5818 Td
(3328 ) 3.01 Tj
0 -41.8909 Td
(3329 ) 3.01 Tj
0 -43.2 Td
(3330 ) 3.01 Tj
0 -44.5091 Td
(3331 ) 3.01 Tj
0 -45.8182 Td
(3332 ) 3.01 Tj
0 -47.1272 Td
(3333 ) 3.01 Tj
0 -48.4363 Td
(3334 ) 3.01 Tj
0 -49.7454 Td
(3335 ) 3.01 Tj
0 -51.0545 Td
(3336 ) 3.01 Tj
0 -52.3636 Td
(3337 ) 3.01 Tj
0 -53.6727 Td
(3338 ) 3.01 Tj
0 -54.9818 Td
(3339 ) 3.01 Tj
0 -56.2909 Td
(3340 ) 3.01 Tj
0 -57.6 Td
(3341 ) 3.01 Tj
0 -58.9091 Td
(3342 ) 3.01 Tj
0 -60.2181 Td
(3343 ) 3.01 Tj
0 -61.5272 Td
(3344 ) 3.01 Tj
0 -62.8363 Td
(3345 ) 3.01 Tj
0 -64.1454 Td
(3346 ) 3.01 Tj
0 -65.4545 Td
(3347 ) 3.01 Tj
0 -66.7636 Td
(3348 ) 3.01 Tj
0 -68.0727 Td
(3349 ) 3.01 Tj
0 -72 Td
(Sheet 33) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/dev.h  Page 1) 21.672 Tj
0 -3.92728 Td
(3350 struct devsw {) 11.438 Tj
0 -5.23637 Td
(3351   int \(*read\)\(int, char*, int\);) 21.672 Tj
0 -6.54546 Td
(3352   int \(*write\)\(int, char*, int\);) 22.274 Tj
0 -7.85455 Td
(3353 };) 4.214 Tj
0 -9.16364 Td
(3354 ) 3.01 Tj
0 -10.4727 Td
(3355 extern struct devsw devsw[];) 19.866 Tj
0 -11.7818 Td
(3356 ) 3.01 Tj
0 -13.0909 Td
(3357 #define CONSOLE 1) 13.244 Tj
0 -14.4 Td
(3358 ) 3.01 Tj
0 -15.7091 Td
(3359 ) 3.01 Tj
0 -17.0182 Td
(3360 ) 3.01 Tj
0 -18.3273 Td
(3361 ) 3.01 Tj
0 -19.6364 Td
(3362 ) 3.01 Tj
0 -20.9455 Td
(3363 ) 3.01 Tj
0 -22.2545 Td
(3364 ) 3.01 Tj
0 -23.5636 Td
(3365 ) 3.01 Tj
0 -24.8727 Td
(3366 ) 3.01 Tj
0 -26.1818 Td
(3367 ) 3.01 Tj
0 -27.4909 Td
(3368 ) 3.01 Tj
0 -28.8 Td
(3369 ) 3.01 Tj
0 -30.1091 Td
(3370 ) 3.01 Tj
0 -31.4182 Td
(3371 ) 3.01 Tj
0 -32.7273 Td
(3372 ) 3.01 Tj
0 -34.0364 Td
(3373 ) 3.01 Tj
0 -35.3454 Td
(3374 ) 3.01 Tj
0 -36.6545 Td
(3375 ) 3.01 Tj
0 -37.9636 Td
(3376 ) 3.01 Tj
0 -39.2727 Td
(3377 ) 3.01 Tj
0 -40.5818 Td
(3378 ) 3.01 Tj
0 -41.8909 Td
(3379 ) 3.01 Tj
0 -43.2 Td
(3380 ) 3.01 Tj
0 -44.5091 Td
(3381 ) 3.01 Tj
0 -45.8182 Td
(3382 ) 3.01 Tj
0 -47.1272 Td
(3383 ) 3.01 Tj
0 -48.4363 Td
(3384 ) 3.01 Tj
0 -49.7454 Td
(3385 ) 3.01 Tj
0 -51.0545 Td
(3386 ) 3.01 Tj
0 -52.3636 Td
(3387 ) 3.01 Tj
0 -53.6727 Td
(3388 ) 3.01 Tj
0 -54.9818 Td
(3389 ) 3.01 Tj
0 -56.2909 Td
(3390 ) 3.01 Tj
0 -57.6 Td
(3391 ) 3.01 Tj
0 -58.9091 Td
(3392 ) 3.01 Tj
0 -60.2181 Td
(3393 ) 3.01 Tj
0 -61.5272 Td
(3394 ) 3.01 Tj
0 -62.8363 Td
(3395 ) 3.01 Tj
0 -64.1454 Td
(3396 ) 3.01 Tj
0 -65.4545 Td
(3397 ) 3.01 Tj
0 -66.7636 Td
(3398 ) 3.01 Tj
0 -68.0727 Td
(3399 ) 3.01 Tj
0 -72 Td
(Sheet 33) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 41 41
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/fcntl.h  Page 1) 22.876 Tj
0 -3.92728 Td
(3400 #define O_CREATE  0x200) 16.856 Tj
0 -5.23637 Td
(3401 #define O_RDONLY  0x000) 16.856 Tj
0 -6.54546 Td
(3402 #define O_WRONLY  0x001) 16.856 Tj
0 -7.85455 Td
(3403 #define O_RDWR    0x002) 16.856 Tj
0 -9.16364 Td
(3404 ) 3.01 Tj
0 -10.4727 Td
(3405 ) 3.01 Tj
0 -11.7818 Td
(3406 ) 3.01 Tj
0 -13.0909 Td
(3407 ) 3.01 Tj
0 -14.4 Td
(3408 ) 3.01 Tj
0 -15.7091 Td
(3409 ) 3.01 Tj
0 -17.0182 Td
(3410 ) 3.01 Tj
0 -18.3273 Td
(3411 ) 3.01 Tj
0 -19.6364 Td
(3412 ) 3.01 Tj
0 -20.9455 Td
(3413 ) 3.01 Tj
0 -22.2545 Td
(3414 ) 3.01 Tj
0 -23.5636 Td
(3415 ) 3.01 Tj
0 -24.8727 Td
(3416 ) 3.01 Tj
0 -26.1818 Td
(3417 ) 3.01 Tj
0 -27.4909 Td
(3418 ) 3.01 Tj
0 -28.8 Td
(3419 ) 3.01 Tj
0 -30.1091 Td
(3420 ) 3.01 Tj
0 -31.4182 Td
(3421 ) 3.01 Tj
0 -32.7273 Td
(3422 ) 3.01 Tj
0 -34.0364 Td
(3423 ) 3.01 Tj
0 -35.3454 Td
(3424 ) 3.01 Tj
0 -36.6545 Td
(3425 ) 3.01 Tj
0 -37.9636 Td
(3426 ) 3.01 Tj
0 -39.2727 Td
(3427 ) 3.01 Tj
0 -40.5818 Td
(3428 ) 3.01 Tj
0 -41.8909 Td
(3429 ) 3.01 Tj
0 -43.2 Td
(3430 ) 3.01 Tj
0 -44.5091 Td
(3431 ) 3.01 Tj
0 -45.8182 Td
(3432 ) 3.01 Tj
0 -47.1272 Td
(3433 ) 3.01 Tj
0 -48.4363 Td
(3434 ) 3.01 Tj
0 -49.7454 Td
(3435 ) 3.01 Tj
0 -51.0545 Td
(3436 ) 3.01 Tj
0 -52.3636 Td
(3437 ) 3.01 Tj
0 -53.6727 Td
(3438 ) 3.01 Tj
0 -54.9818 Td
(3439 ) 3.01 Tj
0 -56.2909 Td
(3440 ) 3.01 Tj
0 -57.6 Td
(3441 ) 3.01 Tj
0 -58.9091 Td
(3442 ) 3.01 Tj
0 -60.2181 Td
(3443 ) 3.01 Tj
0 -61.5272 Td
(3444 ) 3.01 Tj
0 -62.8363 Td
(3445 ) 3.01 Tj
0 -64.1454 Td
(3446 ) 3.01 Tj
0 -65.4545 Td
(3447 ) 3.01 Tj
0 -66.7636 Td
(3448 ) 3.01 Tj
0 -68.0727 Td
(3449 ) 3.01 Tj
0 -72 Td
(Sheet 34) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/stat.h  Page 1) 22.274 Tj
0 -3.92728 Td
(3450 struct stat {) 10.836 Tj
0 -5.23637 Td
(3451   int dev;     // Device number) 21.672 Tj
0 -6.54546 Td
(3452   uint ino;    // Inode number on device) 27.09 Tj
0 -7.85455 Td
(3453   short type;  // Type of file) 21.07 Tj
0 -9.16364 Td
(3454   short nlink; // Number of links to file) 27.692 Tj
0 -10.4727 Td
(3455   uint size;   // Size of file in bytes) 26.488 Tj
0 -11.7818 Td
(3456 };) 4.214 Tj
0 -13.0909 Td
(3457 ) 3.01 Tj
0 -14.4 Td
(3458 ) 3.01 Tj
0 -15.7091 Td
(3459 ) 3.01 Tj
0 -17.0182 Td
(3460 ) 3.01 Tj
0 -18.3273 Td
(3461 ) 3.01 Tj
0 -19.6364 Td
(3462 ) 3.01 Tj
0 -20.9455 Td
(3463 ) 3.01 Tj
0 -22.2545 Td
(3464 ) 3.01 Tj
0 -23.5636 Td
(3465 ) 3.01 Tj
0 -24.8727 Td
(3466 ) 3.01 Tj
0 -26.1818 Td
(3467 ) 3.01 Tj
0 -27.4909 Td
(3468 ) 3.01 Tj
0 -28.8 Td
(3469 ) 3.01 Tj
0 -30.1091 Td
(3470 ) 3.01 Tj
0 -31.4182 Td
(3471 ) 3.01 Tj
0 -32.7273 Td
(3472 ) 3.01 Tj
0 -34.0364 Td
(3473 ) 3.01 Tj
0 -35.3454 Td
(3474 ) 3.01 Tj
0 -36.6545 Td
(3475 ) 3.01 Tj
0 -37.9636 Td
(3476 ) 3.01 Tj
0 -39.2727 Td
(3477 ) 3.01 Tj
0 -40.5818 Td
(3478 ) 3.01 Tj
0 -41.8909 Td
(3479 ) 3.01 Tj
0 -43.2 Td
(3480 ) 3.01 Tj
0 -44.5091 Td
(3481 ) 3.01 Tj
0 -45.8182 Td
(3482 ) 3.01 Tj
0 -47.1272 Td
(3483 ) 3.01 Tj
0 -48.4363 Td
(3484 ) 3.01 Tj
0 -49.7454 Td
(3485 ) 3.01 Tj
0 -51.0545 Td
(3486 ) 3.01 Tj
0 -52.3636 Td
(3487 ) 3.01 Tj
0 -53.6727 Td
(3488 ) 3.01 Tj
0 -54.9818 Td
(3489 ) 3.01 Tj
0 -56.2909 Td
(3490 ) 3.01 Tj
0 -57.6 Td
(3491 ) 3.01 Tj
0 -58.9091 Td
(3492 ) 3.01 Tj
0 -60.2181 Td
(3493 ) 3.01 Tj
0 -61.5272 Td
(3494 ) 3.01 Tj
0 -62.8363 Td
(3495 ) 3.01 Tj
0 -64.1454 Td
(3496 ) 3.01 Tj
0 -65.4545 Td
(3497 ) 3.01 Tj
0 -66.7636 Td
(3498 ) 3.01 Tj
0 -68.0727 Td
(3499 ) 3.01 Tj
0 -72 Td
(Sheet 34) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 42 42
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/file.h  Page 1) 22.274 Tj
0 -3.92728 Td
(3500 struct file {) 10.836 Tj
0 -5.23637 Td
(3501   enum { FD_CLOSED, FD_NONE, FD_PIPE, FD_FILE } type;) 34.916 Tj
0 -6.54546 Td
(3502   int ref; // reference count) 20.468 Tj
0 -7.85455 Td
(3503   char readable;) 12.642 Tj
0 -9.16364 Td
(3504   char writable;) 12.642 Tj
0 -10.4727 Td
(3505   struct pipe *pipe;) 15.05 Tj
0 -11.7818 Td
(3506   struct inode *ip;) 14.448 Tj
0 -13.0909 Td
(3507   uint off;) 9.632 Tj
0 -14.4 Td
(3508 };) 4.214 Tj
0 -15.7091 Td
(3509 ) 3.01 Tj
0 -17.0182 Td
(3510 ) 3.01 Tj
0 -18.3273 Td
(3511 ) 3.01 Tj
0 -19.6364 Td
(3512 ) 3.01 Tj
0 -20.9455 Td
(3513 ) 3.01 Tj
0 -22.2545 Td
(3514 ) 3.01 Tj
0 -23.5636 Td
(3515 ) 3.01 Tj
0 -24.8727 Td
(3516 ) 3.01 Tj
0 -26.1818 Td
(3517 ) 3.01 Tj
0 -27.4909 Td
(3518 ) 3.01 Tj
0 -28.8 Td
(3519 ) 3.01 Tj
0 -30.1091 Td
(3520 ) 3.01 Tj
0 -31.4182 Td
(3521 ) 3.01 Tj
0 -32.7273 Td
(3522 ) 3.01 Tj
0 -34.0364 Td
(3523 ) 3.01 Tj
0 -35.3454 Td
(3524 ) 3.01 Tj
0 -36.6545 Td
(3525 ) 3.01 Tj
0 -37.9636 Td
(3526 ) 3.01 Tj
0 -39.2727 Td
(3527 ) 3.01 Tj
0 -40.5818 Td
(3528 ) 3.01 Tj
0 -41.8909 Td
(3529 ) 3.01 Tj
0 -43.2 Td
(3530 ) 3.01 Tj
0 -44.5091 Td
(3531 ) 3.01 Tj
0 -45.8182 Td
(3532 ) 3.01 Tj
0 -47.1272 Td
(3533 ) 3.01 Tj
0 -48.4363 Td
(3534 ) 3.01 Tj
0 -49.7454 Td
(3535 ) 3.01 Tj
0 -51.0545 Td
(3536 ) 3.01 Tj
0 -52.3636 Td
(3537 ) 3.01 Tj
0 -53.6727 Td
(3538 ) 3.01 Tj
0 -54.9818 Td
(3539 ) 3.01 Tj
0 -56.2909 Td
(3540 ) 3.01 Tj
0 -57.6 Td
(3541 ) 3.01 Tj
0 -58.9091 Td
(3542 ) 3.01 Tj
0 -60.2181 Td
(3543 ) 3.01 Tj
0 -61.5272 Td
(3544 ) 3.01 Tj
0 -62.8363 Td
(3545 ) 3.01 Tj
0 -64.1454 Td
(3546 ) 3.01 Tj
0 -65.4545 Td
(3547 ) 3.01 Tj
0 -66.7636 Td
(3548 ) 3.01 Tj
0 -68.0727 Td
(3549 ) 3.01 Tj
0 -72 Td
(Sheet 35) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/fs.h  Page 1) 21.07 Tj
0 -3.92728 Td
(3550 // On-disk file system format.) 21.07 Tj
0 -5.23637 Td
(3551 // This header is shared between kernel and user space.) 36.12 Tj
0 -6.54546 Td
(3552 ) 3.01 Tj
0 -7.85455 Td
(3553 // Block 0 is unused.) 15.652 Tj
0 -9.16364 Td
(3554 // Block 1 is super block.) 18.662 Tj
0 -10.4727 Td
(3555 // Inodes start at block 2.) 19.264 Tj
0 -11.7818 Td
(3556 ) 3.01 Tj
0 -13.0909 Td
(3557 #define BSIZE 512  // block size) 22.274 Tj
0 -14.4 Td
(3558 ) 3.01 Tj
0 -15.7091 Td
(3559 // File system super block) 18.662 Tj
0 -17.0182 Td
(3560 struct superblock {) 14.448 Tj
0 -18.3273 Td
(3561   uint size;         // Size of file system image \(blocks\)) 37.926 Tj
0 -19.6364 Td
(3562   uint nblocks;      // Number of data blocks) 30.1 Tj
0 -20.9455 Td
(3563   uint ninodes;      // Number of inodes.) 27.692 Tj
0 -22.2545 Td
(3564 };) 4.214 Tj
0 -23.5636 Td
(3565 ) 3.01 Tj
0 -24.8727 Td
(3566 #define NADDRS \(NDIRECT+1\)) 18.662 Tj
0 -26.1818 Td
(3567 #define NDIRECT 12) 13.846 Tj
0 -27.4909 Td
(3568 #define INDIRECT 12) 14.448 Tj
0 -28.8 Td
(3569 #define NINDIRECT \(BSIZE / sizeof\(uint\)\)) 27.09 Tj
0 -30.1091 Td
(3570 #define MAXFILE \(NDIRECT  + NINDIRECT\)) 25.886 Tj
0 -31.4182 Td
(3571 ) 3.01 Tj
0 -32.7273 Td
(3572 // On-disk inode structure) 18.662 Tj
0 -34.0364 Td
(3573 struct dinode {) 12.04 Tj
0 -35.3454 Td
(3574   short type;           // File type) 24.682 Tj
0 -36.6545 Td
(3575   short major;          // Major device number \(T_DEV only\)) 38.528 Tj
0 -37.9636 Td
(3576   short minor;          // Minor device number \(T_DEV only\)) 38.528 Tj
0 -39.2727 Td
(3577   short nlink;          // Number of links to inode in file system) 42.742 Tj
0 -40.5818 Td
(3578   uint size;            // Size of file \(bytes\)) 31.304 Tj
0 -41.8909 Td
(3579   uint addrs[NADDRS];   // Data block addresses) 31.304 Tj
0 -43.2 Td
(3580 };) 4.214 Tj
0 -44.5091 Td
(3581 ) 3.01 Tj
0 -45.8182 Td
(3582 #define T_DIR  1   // Directory) 21.672 Tj
0 -47.1272 Td
(3583 #define T_FILE 2   // File) 18.662 Tj
0 -48.4363 Td
(3584 #define T_DEV  3   // Special device) 24.682 Tj
0 -49.7454 Td
(3585 ) 3.01 Tj
0 -51.0545 Td
(3586 // Inodes per block.) 15.05 Tj
0 -52.3636 Td
(3587 #define IPB           \(BSIZE / sizeof\(struct dinode\)\)) 34.916 Tj
0 -53.6727 Td
(3588 ) 3.01 Tj
0 -54.9818 Td
(3589 // Block containing inode i) 19.264 Tj
0 -56.2909 Td
(3590 #define IBLOCK\(i\)     \(\(i\) / IPB + 2\)) 25.284 Tj
0 -57.6 Td
(3591 ) 3.01 Tj
0 -58.9091 Td
(3592 // Bitmap bits per block) 17.458 Tj
0 -60.2181 Td
(3593 #define BPB           \(BSIZE*8\)) 21.672 Tj
0 -61.5272 Td
(3594 ) 3.01 Tj
0 -62.8363 Td
(3595 // Block containing bit for block b) 24.08 Tj
0 -64.1454 Td
(3596 #define BBLOCK\(b, ninodes\) \(b/BPB + \(ninodes\)/IPB + 3\)) 35.518 Tj
0 -65.4545 Td
(3597 ) 3.01 Tj
0 -66.7636 Td
(3598 ) 3.01 Tj
0 -68.0727 Td
(3599 ) 3.01 Tj
0 -72 Td
(Sheet 35) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 43 43
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/fs.h  Page 2) 21.07 Tj
0 -3.92728 Td
(3600 // Directory is a file containing a sequence of dirent structures.) 42.742 Tj
0 -5.23637 Td
(3601 #define DIRSIZ 14) 13.244 Tj
0 -6.54546 Td
(3602 ) 3.01 Tj
0 -7.85455 Td
(3603 struct dirent {) 12.04 Tj
0 -9.16364 Td
(3604   ushort inum;) 11.438 Tj
0 -10.4727 Td
(3605   char name[DIRSIZ];) 15.05 Tj
0 -11.7818 Td
(3606 };) 4.214 Tj
0 -13.0909 Td
(3607 ) 3.01 Tj
0 -14.4 Td
(3608 extern uint rootdev;  // Device number of root file system) 37.926 Tj
0 -15.7091 Td
(3609 ) 3.01 Tj
0 -17.0182 Td
(3610 ) 3.01 Tj
0 -18.3273 Td
(3611 ) 3.01 Tj
0 -19.6364 Td
(3612 ) 3.01 Tj
0 -20.9455 Td
(3613 ) 3.01 Tj
0 -22.2545 Td
(3614 ) 3.01 Tj
0 -23.5636 Td
(3615 ) 3.01 Tj
0 -24.8727 Td
(3616 ) 3.01 Tj
0 -26.1818 Td
(3617 ) 3.01 Tj
0 -27.4909 Td
(3618 ) 3.01 Tj
0 -28.8 Td
(3619 ) 3.01 Tj
0 -30.1091 Td
(3620 ) 3.01 Tj
0 -31.4182 Td
(3621 ) 3.01 Tj
0 -32.7273 Td
(3622 ) 3.01 Tj
0 -34.0364 Td
(3623 ) 3.01 Tj
0 -35.3454 Td
(3624 ) 3.01 Tj
0 -36.6545 Td
(3625 ) 3.01 Tj
0 -37.9636 Td
(3626 ) 3.01 Tj
0 -39.2727 Td
(3627 ) 3.01 Tj
0 -40.5818 Td
(3628 ) 3.01 Tj
0 -41.8909 Td
(3629 ) 3.01 Tj
0 -43.2 Td
(3630 ) 3.01 Tj
0 -44.5091 Td
(3631 ) 3.01 Tj
0 -45.8182 Td
(3632 ) 3.01 Tj
0 -47.1272 Td
(3633 ) 3.01 Tj
0 -48.4363 Td
(3634 ) 3.01 Tj
0 -49.7454 Td
(3635 ) 3.01 Tj
0 -51.0545 Td
(3636 ) 3.01 Tj
0 -52.3636 Td
(3637 ) 3.01 Tj
0 -53.6727 Td
(3638 ) 3.01 Tj
0 -54.9818 Td
(3639 ) 3.01 Tj
0 -56.2909 Td
(3640 ) 3.01 Tj
0 -57.6 Td
(3641 ) 3.01 Tj
0 -58.9091 Td
(3642 ) 3.01 Tj
0 -60.2181 Td
(3643 ) 3.01 Tj
0 -61.5272 Td
(3644 ) 3.01 Tj
0 -62.8363 Td
(3645 ) 3.01 Tj
0 -64.1454 Td
(3646 ) 3.01 Tj
0 -65.4545 Td
(3647 ) 3.01 Tj
0 -66.7636 Td
(3648 ) 3.01 Tj
0 -68.0727 Td
(3649 ) 3.01 Tj
0 -72 Td
(Sheet 36) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/fsvar.h  Page 1) 22.876 Tj
0 -3.92728 Td
(3650 // in-core file system types) 19.866 Tj
0 -5.23637 Td
(3651 ) 3.01 Tj
0 -6.54546 Td
(3652 struct inode {) 11.438 Tj
0 -7.85455 Td
(3653   uint dev;           // Device number) 25.886 Tj
0 -9.16364 Td
(3654   uint inum;          // Inode number) 25.284 Tj
0 -10.4727 Td
(3655   int ref;            // Reference count) 27.09 Tj
0 -11.7818 Td
(3656   int busy;           // Is the inode "locked"?) 31.304 Tj
0 -13.0909 Td
(3657 ) 3.01 Tj
0 -14.4 Td
(3658   short type;         // copy of disk inode) 28.896 Tj
0 -15.7091 Td
(3659   short major;) 11.438 Tj
0 -17.0182 Td
(3660   short minor;) 11.438 Tj
0 -18.3273 Td
(3661   short nlink;) 11.438 Tj
0 -19.6364 Td
(3662   uint size;) 10.234 Tj
0 -20.9455 Td
(3663   uint addrs[NADDRS];) 15.652 Tj
0 -22.2545 Td
(3664 };) 4.214 Tj
0 -23.5636 Td
(3665 ) 3.01 Tj
0 -24.8727 Td
(3666 extern uint rootdev;) 15.05 Tj
0 -26.1818 Td
(3667 ) 3.01 Tj
0 -27.4909 Td
(3668 #define NAMEI_LOOKUP 1) 16.254 Tj
0 -28.8 Td
(3669 #define NAMEI_CREATE 2) 16.254 Tj
0 -30.1091 Td
(3670 #define NAMEI_DELETE 3) 16.254 Tj
0 -31.4182 Td
(3671 ) 3.01 Tj
0 -32.7273 Td
(3672 ) 3.01 Tj
0 -34.0364 Td
(3673 ) 3.01 Tj
0 -35.3454 Td
(3674 ) 3.01 Tj
0 -36.6545 Td
(3675 ) 3.01 Tj
0 -37.9636 Td
(3676 ) 3.01 Tj
0 -39.2727 Td
(3677 ) 3.01 Tj
0 -40.5818 Td
(3678 ) 3.01 Tj
0 -41.8909 Td
(3679 ) 3.01 Tj
0 -43.2 Td
(3680 ) 3.01 Tj
0 -44.5091 Td
(3681 ) 3.01 Tj
0 -45.8182 Td
(3682 ) 3.01 Tj
0 -47.1272 Td
(3683 ) 3.01 Tj
0 -48.4363 Td
(3684 ) 3.01 Tj
0 -49.7454 Td
(3685 ) 3.01 Tj
0 -51.0545 Td
(3686 ) 3.01 Tj
0 -52.3636 Td
(3687 ) 3.01 Tj
0 -53.6727 Td
(3688 ) 3.01 Tj
0 -54.9818 Td
(3689 ) 3.01 Tj
0 -56.2909 Td
(3690 ) 3.01 Tj
0 -57.6 Td
(3691 ) 3.01 Tj
0 -58.9091 Td
(3692 ) 3.01 Tj
0 -60.2181 Td
(3693 ) 3.01 Tj
0 -61.5272 Td
(3694 ) 3.01 Tj
0 -62.8363 Td
(3695 ) 3.01 Tj
0 -64.1454 Td
(3696 ) 3.01 Tj
0 -65.4545 Td
(3697 ) 3.01 Tj
0 -66.7636 Td
(3698 ) 3.01 Tj
0 -68.0727 Td
(3699 ) 3.01 Tj
0 -72 Td
(Sheet 36) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 44 44
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/ide.c  Page 1) 21.672 Tj
0 -3.92728 Td
(3700 // Simple PIO-based \(non-DMA\) IDE driver code.) 30.702 Tj
0 -5.23637 Td
(3701 ) 3.01 Tj
0 -6.54546 Td
(3702 #include "types.h") 13.846 Tj
0 -7.85455 Td
(3703 #include "param.h") 13.846 Tj
0 -9.16364 Td
(3704 #include "mmu.h") 12.642 Tj
0 -10.4727 Td
(3705 #include "proc.h") 13.244 Tj
0 -11.7818 Td
(3706 #include "defs.h") 13.244 Tj
0 -13.0909 Td
(3707 #include "x86.h") 12.642 Tj
0 -14.4 Td
(3708 #include "traps.h") 13.846 Tj
0 -15.7091 Td
(3709 #include "spinlock.h") 15.652 Tj
0 -17.0182 Td
(3710 ) 3.01 Tj
0 -18.3273 Td
(3711 #define IDE_BSY       0x80) 18.662 Tj
0 -19.6364 Td
(3712 #define IDE_DRDY      0x40) 18.662 Tj
0 -20.9455 Td
(3713 #define IDE_DF        0x20) 18.662 Tj
0 -22.2545 Td
(3714 #define IDE_ERR       0x01) 18.662 Tj
0 -23.5636 Td
(3715 ) 3.01 Tj
0 -24.8727 Td
(3716 #define IDE_CMD_READ  0x20) 18.662 Tj
0 -26.1818 Td
(3717 #define IDE_CMD_WRITE 0x30) 18.662 Tj
0 -27.4909 Td
(3718 ) 3.01 Tj
0 -28.8 Td
(3719 // IDE request queue.) 15.652 Tj
0 -30.1091 Td
(3720 // The next request will be stored in request[head],) 34.314 Tj
0 -31.4182 Td
(3721 // and the request currently being served by the disk) 34.916 Tj
0 -32.7273 Td
(3722 // is request[tail].) 15.05 Tj
0 -34.0364 Td
(3723 // Must hold ide_lock while manipulating queue.) 31.304 Tj
0 -35.3454 Td
(3724 ) 3.01 Tj
0 -36.6545 Td
(3725 struct ide_request {) 15.05 Tj
0 -37.9636 Td
(3726   int diskno;) 10.836 Tj
0 -39.2727 Td
(3727   uint secno;) 10.836 Tj
0 -40.5818 Td
(3728   void *addr;) 10.836 Tj
0 -41.8909 Td
(3729   uint nsecs;) 10.836 Tj
0 -43.2 Td
(3730   uint read;) 10.234 Tj
0 -44.5091 Td
(3731 };) 4.214 Tj
0 -45.8182 Td
(3732 ) 3.01 Tj
0 -47.1272 Td
(3733 static struct ide_request request[NREQUEST];) 29.498 Tj
0 -48.4363 Td
(3734 static int head, tail;) 16.254 Tj
0 -49.7454 Td
(3735 static struct spinlock ide_lock;) 22.274 Tj
0 -51.0545 Td
(3736 ) 3.01 Tj
0 -52.3636 Td
(3737 static int disk_1_present;) 18.662 Tj
0 -53.6727 Td
(3738 static int disk_queue;) 16.254 Tj
0 -54.9818 Td
(3739 ) 3.01 Tj
0 -56.2909 Td
(3740 static int ide_probe_disk1\(void\);) 22.876 Tj
0 -57.6 Td
(3741 ) 3.01 Tj
0 -58.9091 Td
(3742 // Wait for IDE disk to become ready.) 25.284 Tj
0 -60.2181 Td
(3743 static int) 9.03 Tj
0 -61.5272 Td
(3744 ide_wait_ready\(int check_error\)) 21.672 Tj
0 -62.8363 Td
(3745 {) 3.612 Tj
0 -64.1454 Td
(3746   int r;) 7.826 Tj
0 -65.4545 Td
(3747 ) 3.01 Tj
0 -66.7636 Td
(3748   while\(\(\(r = inb\(0x1F7\)\) & \(IDE_BSY|IDE_DRDY\)\) != IDE_DRDY\)) 39.13 Tj
0 -68.0727 Td
(3749     ;) 6.02 Tj
0 -72 Td
(Sheet 37) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/ide.c  Page 2) 21.672 Tj
0 -3.92728 Td
(3750   if\(check_error && \(r & \(IDE_DF|IDE_ERR\)\) != 0\)) 31.906 Tj
0 -5.23637 Td
(3751     return -1;) 11.438 Tj
0 -6.54546 Td
(3752   return 0;) 9.632 Tj
0 -7.85455 Td
(3753 }) 3.612 Tj
0 -9.16364 Td
(3754 ) 3.01 Tj
0 -10.4727 Td
(3755 void) 5.418 Tj
0 -11.7818 Td
(3756 ide_init\(void\)) 11.438 Tj
0 -13.0909 Td
(3757 {) 3.612 Tj
0 -14.4 Td
(3758   initlock\(&ide_lock, "ide"\);) 20.468 Tj
0 -15.7091 Td
(3759   irq_enable\(IRQ_IDE\);) 16.254 Tj
0 -17.0182 Td
(3760   ioapic_enable\(IRQ_IDE, ncpu - 1\);) 24.08 Tj
0 -18.3273 Td
(3761   ide_wait_ready\(0\);) 15.05 Tj
0 -19.6364 Td
(3762   disk_1_present = ide_probe_disk1\(\);) 25.284 Tj
0 -20.9455 Td
(3763 }) 3.612 Tj
0 -22.2545 Td
(3764 ) 3.01 Tj
0 -23.5636 Td
(3765 // Probe to see if disk 1 exists \(we assume disk 0 exists\).) 38.528 Tj
0 -24.8727 Td
(3766 static int) 9.03 Tj
0 -26.1818 Td
(3767 ide_probe_disk1\(void\)) 15.652 Tj
0 -27.4909 Td
(3768 {) 3.612 Tj
0 -28.8 Td
(3769   int r, x;) 9.632 Tj
0 -30.1091 Td
(3770 ) 3.01 Tj
0 -31.4182 Td
(3771   // wait for Device 0 to be ready) 23.478 Tj
0 -32.7273 Td
(3772   ide_wait_ready\(0\);) 15.05 Tj
0 -34.0364 Td
(3773 ) 3.01 Tj
0 -35.3454 Td
(3774   // switch to Device 1) 16.856 Tj
0 -36.6545 Td
(3775   outb\(0x1F6, 0xE0 | \(1<<4\)\);) 20.468 Tj
0 -37.9636 Td
(3776 ) 3.01 Tj
0 -39.2727 Td
(3777   // check for Device 1 to be ready for a while) 31.304 Tj
0 -40.5818 Td
(3778   for\(x = 0; x < 1000 && \(r = inb\(0x1F7\)\) == 0; x++\)) 34.314 Tj
0 -41.8909 Td
(3779     ;) 6.02 Tj
0 -43.2 Td
(3780 ) 3.01 Tj
0 -44.5091 Td
(3781   // switch back to Device 0) 19.866 Tj
0 -45.8182 Td
(3782   outb\(0x1F6, 0xE0 | \(0<<4\)\);) 20.468 Tj
0 -47.1272 Td
(3783 ) 3.01 Tj
0 -48.4363 Td
(3784   return x < 1000;) 13.846 Tj
0 -49.7454 Td
(3785 }) 3.612 Tj
0 -51.0545 Td
(3786 ) 3.01 Tj
0 -52.3636 Td
(3787 // Interrupt handler - wake up the request that just finished.) 40.334 Tj
0 -53.6727 Td
(3788 void) 5.418 Tj
0 -54.9818 Td
(3789 ide_intr\(void\)) 11.438 Tj
0 -56.2909 Td
(3790 {) 3.612 Tj
0 -57.6 Td
(3791   acquire\(&ide_lock\);) 15.652 Tj
0 -58.9091 Td
(3792   wakeup\(&request[tail]\);) 18.06 Tj
0 -60.2181 Td
(3793   release\(&ide_lock\);) 15.652 Tj
0 -61.5272 Td
(3794 }) 3.612 Tj
0 -62.8363 Td
(3795 ) 3.01 Tj
0 -64.1454 Td
(3796 ) 3.01 Tj
0 -65.4545 Td
(3797 ) 3.01 Tj
0 -66.7636 Td
(3798 ) 3.01 Tj
0 -68.0727 Td
(3799 ) 3.01 Tj
0 -72 Td
(Sheet 37) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 45 45
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/ide.c  Page 3) 21.672 Tj
0 -3.92728 Td
(3800 // Start the next request in the queue.) 26.488 Tj
0 -5.23637 Td
(3801 static void) 9.632 Tj
0 -6.54546 Td
(3802 ide_start_request \(void\)) 17.458 Tj
0 -7.85455 Td
(3803 {) 3.612 Tj
0 -9.16364 Td
(3804   struct ide_request *r;) 17.458 Tj
0 -10.4727 Td
(3805 ) 3.01 Tj
0 -11.7818 Td
(3806   if\(head != tail\) {) 15.05 Tj
0 -13.0909 Td
(3807     r = &request[tail];) 16.856 Tj
0 -14.4 Td
(3808     ide_wait_ready\(0\);) 16.254 Tj
0 -15.7091 Td
(3809     outb\(0x3f6, 0\);  // generate interrupt) 28.294 Tj
0 -17.0182 Td
(3810     outb\(0x1F2, r->nsecs\);) 18.662 Tj
0 -18.3273 Td
(3811     outb\(0x1F3, r->secno & 0xFF\);) 22.876 Tj
0 -19.6364 Td
(3812     outb\(0x1F4, \(r->secno >> 8\) & 0xFF\);) 27.09 Tj
0 -20.9455 Td
(3813     outb\(0x1F5, \(r->secno >> 16\) & 0xFF\);) 27.692 Tj
0 -22.2545 Td
(3814     outb\(0x1F6, 0xE0 | \(\(r->diskno&1\)<<4\) | \(\(r->secno>>24\)&0x0F\)\);) 43.344 Tj
0 -23.5636 Td
(3815     if\(r->read\)) 12.04 Tj
0 -24.8727 Td
(3816       outb\(0x1F7, IDE_CMD_READ\);) 22.274 Tj
0 -26.1818 Td
(3817     else {) 9.03 Tj
0 -27.4909 Td
(3818       outb\(0x1F7, IDE_CMD_WRITE\);) 22.876 Tj
0 -28.8 Td
(3819       outsl\(0x1F0, r->addr, 512/4\);) 24.08 Tj
0 -30.1091 Td
(3820     }) 6.02 Tj
0 -31.4182 Td
(3821   }) 4.816 Tj
0 -32.7273 Td
(3822 }) 3.612 Tj
0 -34.0364 Td
(3823 ) 3.01 Tj
0 -35.3454 Td
(3824 // Run an entire disk operation.) 22.274 Tj
0 -36.6545 Td
(3825 void) 5.418 Tj
0 -37.9636 Td
(3826 ide_rw\(int diskno, uint secno, void *addr, uint nsecs, int read\)) 41.538 Tj
0 -39.2727 Td
(3827 {) 3.612 Tj
0 -40.5818 Td
(3828   struct ide_request *r;) 17.458 Tj
0 -41.8909 Td
(3829 ) 3.01 Tj
0 -43.2 Td
(3830   if\(diskno && !disk_1_present\)) 21.672 Tj
0 -44.5091 Td
(3831     panic\("ide disk 1 not present"\);) 24.682 Tj
0 -45.8182 Td
(3832 ) 3.01 Tj
0 -47.1272 Td
(3833   acquire\(&ide_lock\);) 15.652 Tj
0 -48.4363 Td
(3834 ) 3.01 Tj
0 -49.7454 Td
(3835   // Add request to queue.) 18.662 Tj
0 -51.0545 Td
(3836   while\(\(head + 1\) % NREQUEST == tail\)) 25.886 Tj
0 -52.3636 Td
(3837     sleep\(&disk_queue, &ide_lock\);) 23.478 Tj
0 -53.6727 Td
(3838 ) 3.01 Tj
0 -54.9818 Td
(3839   r = &request[head];) 15.652 Tj
0 -56.2909 Td
(3840   r->secno = secno;) 14.448 Tj
0 -57.6 Td
(3841   r->addr = addr;) 13.244 Tj
0 -58.9091 Td
(3842   r->nsecs = nsecs;) 14.448 Tj
0 -60.2181 Td
(3843   r->diskno = diskno;) 15.652 Tj
0 -61.5272 Td
(3844   r->read = read;) 13.244 Tj
0 -62.8363 Td
(3845   head = \(head + 1\) % NREQUEST;) 21.672 Tj
0 -64.1454 Td
(3846 ) 3.01 Tj
0 -65.4545 Td
(3847   // Start request if necessary.) 22.274 Tj
0 -66.7636 Td
(3848   ide_start_request\(\);) 16.254 Tj
0 -68.0727 Td
(3849 ) 3.01 Tj
0 -72 Td
(Sheet 38) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/ide.c  Page 4) 21.672 Tj
0 -3.92728 Td
(3850   // Wait for request to finish.) 22.274 Tj
0 -5.23637 Td
(3851   sleep\(r, &ide_lock\);) 16.254 Tj
0 -6.54546 Td
(3852 ) 3.01 Tj
0 -7.85455 Td
(3853   // Finish request.) 15.05 Tj
0 -9.16364 Td
(3854   if\(read\){) 9.632 Tj
0 -10.4727 Td
(3855     if\(ide_wait_ready\(1\) >= 0\)) 21.07 Tj
0 -11.7818 Td
(3856       insl\(0x1F0, addr, 512/4\);) 21.672 Tj
0 -13.0909 Td
(3857   }) 4.816 Tj
0 -14.4 Td
(3858 ) 3.01 Tj
0 -15.7091 Td
(3859   // Remove request from queue.) 21.672 Tj
0 -17.0182 Td
(3860   if\(\(head + 1\) % NREQUEST == tail\)) 24.08 Tj
0 -18.3273 Td
(3861     wakeup\(&disk_queue\);) 17.458 Tj
0 -19.6364 Td
(3862   tail = \(tail + 1\) % NREQUEST;) 21.672 Tj
0 -20.9455 Td
(3863 ) 3.01 Tj
0 -22.2545 Td
(3864   // Start next request in queue, if any.) 27.692 Tj
0 -23.5636 Td
(3865   ide_start_request\(\);) 16.254 Tj
0 -24.8727 Td
(3866 ) 3.01 Tj
0 -26.1818 Td
(3867   release\(&ide_lock\);) 15.652 Tj
0 -27.4909 Td
(3868 }) 3.612 Tj
0 -28.8 Td
(3869 ) 3.01 Tj
0 -30.1091 Td
(3870 // Synchronous disk write.) 18.662 Tj
0 -31.4182 Td
(3871 int) 4.816 Tj
0 -32.7273 Td
(3872 ide_write\(int diskno, uint secno, const void *src, uint nsecs\)) 40.334 Tj
0 -34.0364 Td
(3873 {) 3.612 Tj
0 -35.3454 Td
(3874   int r;) 7.826 Tj
0 -36.6545 Td
(3875 ) 3.01 Tj
0 -37.9636 Td
(3876   if\(nsecs > 256\)) 13.244 Tj
0 -39.2727 Td
(3877     panic\("ide_write"\);) 16.856 Tj
0 -40.5818 Td
(3878 ) 3.01 Tj
0 -41.8909 Td
(3879   ide_wait_ready\(0\);) 15.05 Tj
0 -43.2 Td
(3880 ) 3.01 Tj
0 -44.5091 Td
(3881   outb\(0x1F2, nsecs\);) 15.652 Tj
0 -45.8182 Td
(3882   outb\(0x1F3, secno & 0xFF\);) 19.866 Tj
0 -47.1272 Td
(3883   outb\(0x1F4, \(secno >> 8\) & 0xFF\);) 24.08 Tj
0 -48.4363 Td
(3884   outb\(0x1F5, \(secno >> 16\) & 0xFF\);) 24.682 Tj
0 -49.7454 Td
(3885   outb\(0x1F6, 0xE0 | \(\(diskno&1\)<<4\) | \(\(secno>>24\)&0x0F\)\);) 38.528 Tj
0 -51.0545 Td
(3886   outb\(0x1F7, 0x30\);    // CMD 0x30 means write sector) 35.518 Tj
0 -52.3636 Td
(3887 ) 3.01 Tj
0 -53.6727 Td
(3888   for\(; nsecs > 0; nsecs--, src += 512\) {) 27.692 Tj
0 -54.9818 Td
(3889     if\(\(r = ide_wait_ready\(1\)\) < 0\)) 24.08 Tj
0 -56.2909 Td
(3890       return r;) 12.04 Tj
0 -57.6 Td
(3891     outsl\(0x1F0, src, 512/4\);) 20.468 Tj
0 -58.9091 Td
(3892   }) 4.816 Tj
0 -60.2181 Td
(3893 ) 3.01 Tj
0 -61.5272 Td
(3894   return 0;) 9.632 Tj
0 -62.8363 Td
(3895 }) 3.612 Tj
0 -64.1454 Td
(3896 ) 3.01 Tj
0 -65.4545 Td
(3897 ) 3.01 Tj
0 -66.7636 Td
(3898 ) 3.01 Tj
0 -68.0727 Td
(3899 ) 3.01 Tj
0 -72 Td
(Sheet 38) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 46 46
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/bio.c  Page 1) 21.672 Tj
0 -3.92728 Td
(3900 // Buffer cache.) 12.642 Tj
0 -5.23637 Td
(3901 //) 4.214 Tj
0 -6.54546 Td
(3902 // The buffer cache is a linked list of buf structures) 35.518 Tj
0 -7.85455 Td
(3903 // holding cached copies of disk block contents.) 31.906 Tj
0 -9.16364 Td
(3904 // Each buf has two state bits B_BUSY and B_VALID.) 33.11 Tj
0 -10.4727 Td
(3905 // If B_BUSY is set, it means that some code is currently) 37.324 Tj
0 -11.7818 Td
(3906 // editing buf, so other code is not allowed to look at it.) 38.528 Tj
0 -13.0909 Td
(3907 // To wait for a buffer that is B_BUSY, sleep on buf.) 34.916 Tj
0 -14.4 Td
(3908 // \(See bget below.\)) 15.05 Tj
0 -15.7091 Td
(3909 //) 4.214 Tj
0 -17.0182 Td
(3910 // If B_VALID is set, it means that the memory contents) 36.12 Tj
0 -18.3273 Td
(3911 // have been initialized by reading them off the disk.) 35.518 Tj
0 -19.6364 Td
(3912 // \(Conversely, if B_VALID is not set, the memory contents) 37.926 Tj
0 -20.9455 Td
(3913 // of buf must be initialized, often by calling bread,) 35.518 Tj
0 -22.2545 Td
(3914 // before being used.\)) 16.254 Tj
0 -23.5636 Td
(3915 //) 4.214 Tj
0 -24.8727 Td
(3916 // After making changes to a buf's memory, call bwrite to flush) 40.936 Tj
0 -26.1818 Td
(3917 // the changes out to disk, to keep the disk and memory copies) 40.334 Tj
0 -27.4909 Td
(3918 // in sync.) 9.632 Tj
0 -28.8 Td
(3919 //) 4.214 Tj
0 -30.1091 Td
(3920 // When finished with a buffer, call brelse to release the buffer) 42.14 Tj
0 -31.4182 Td
(3921 // \(i.e., clear B_BUSY\), so that others can access it.) 35.518 Tj
0 -32.7273 Td
(3922 //) 4.214 Tj
0 -34.0364 Td
(3923 // Bufs that are not B_BUSY are fair game for reuse for other) 39.732 Tj
0 -35.3454 Td
(3924 // disk blocks.  It is not allowed to use a buf after calling brelse.) 44.548 Tj
0 -36.6545 Td
(3925 ) 3.01 Tj
0 -37.9636 Td
(3926 #include "types.h") 13.846 Tj
0 -39.2727 Td
(3927 #include "param.h") 13.846 Tj
0 -40.5818 Td
(3928 #include "x86.h") 12.642 Tj
0 -41.8909 Td
(3929 #include "mmu.h") 12.642 Tj
0 -43.2 Td
(3930 #include "proc.h") 13.244 Tj
0 -44.5091 Td
(3931 #include "defs.h") 13.244 Tj
0 -45.8182 Td
(3932 #include "spinlock.h") 15.652 Tj
0 -47.1272 Td
(3933 #include "buf.h") 12.642 Tj
0 -48.4363 Td
(3934 ) 3.01 Tj
0 -49.7454 Td
(3935 struct buf buf[NBUF];) 15.652 Tj
0 -51.0545 Td
(3936 struct spinlock buf_table_lock;) 21.672 Tj
0 -52.3636 Td
(3937 ) 3.01 Tj
0 -53.6727 Td
(3938 // Linked list of all buffers, through prev/next.) 32.508 Tj
0 -54.9818 Td
(3939 // bufhead->next is most recently used.) 26.488 Tj
0 -56.2909 Td
(3940 // bufhead->tail is least recently used.) 27.09 Tj
0 -57.6 Td
(3941 struct buf bufhead;) 14.448 Tj
0 -58.9091 Td
(3942 ) 3.01 Tj
0 -60.2181 Td
(3943 void) 5.418 Tj
0 -61.5272 Td
(3944 binit\(void\)) 9.632 Tj
0 -62.8363 Td
(3945 {) 3.612 Tj
0 -64.1454 Td
(3946   struct buf *b;) 12.642 Tj
0 -65.4545 Td
(3947 ) 3.01 Tj
0 -66.7636 Td
(3948   initlock\(&buf_table_lock, "buf_table"\);) 27.692 Tj
0 -68.0727 Td
(3949 ) 3.01 Tj
0 -72 Td
(Sheet 39) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/bio.c  Page 2) 21.672 Tj
0 -3.92728 Td
(3950   // Create linked list of buffers) 23.478 Tj
0 -5.23637 Td
(3951   bufhead.prev = &bufhead;) 18.662 Tj
0 -6.54546 Td
(3952   bufhead.next = &bufhead;) 18.662 Tj
0 -7.85455 Td
(3953   for\(b = buf; b < buf+NBUF; b++\){) 23.478 Tj
0 -9.16364 Td
(3954     b->next = bufhead.next;) 19.264 Tj
0 -10.4727 Td
(3955     b->prev = &bufhead;) 16.856 Tj
0 -11.7818 Td
(3956     bufhead.next->prev = b;) 19.264 Tj
0 -13.0909 Td
(3957     bufhead.next = b;) 15.652 Tj
0 -14.4 Td
(3958   }) 4.816 Tj
0 -15.7091 Td
(3959 }) 3.612 Tj
0 -17.0182 Td
(3960 ) 3.01 Tj
0 -18.3273 Td
(3961 // Look through buffer cache for block n on device dev.) 36.12 Tj
0 -19.6364 Td
(3962 // If not found, allocate fresh block.) 25.886 Tj
0 -20.9455 Td
(3963 // In either case, return locked buffer.) 27.09 Tj
0 -22.2545 Td
(3964 static struct buf*) 13.846 Tj
0 -23.5636 Td
(3965 bget\(uint dev, uint sector\)) 19.264 Tj
0 -24.8727 Td
(3966 {) 3.612 Tj
0 -26.1818 Td
(3967   struct buf *b;) 12.642 Tj
0 -27.4909 Td
(3968 ) 3.01 Tj
0 -28.8 Td
(3969   acquire\(&buf_table_lock\);) 19.264 Tj
0 -30.1091 Td
(3970 ) 3.01 Tj
0 -31.4182 Td
(3971   for\(;;\){) 9.03 Tj
0 -32.7273 Td
(3972     for\(b = bufhead.next; b != &bufhead; b = b->next\)) 34.916 Tj
0 -34.0364 Td
(3973       if\(\(b->flags & \(B_BUSY|B_VALID\)\) &&) 27.692 Tj
0 -35.3454 Td
(3974          b->dev == dev && b->sector == sector\)) 30.702 Tj
0 -36.6545 Td
(3975         break;) 11.438 Tj
0 -37.9636 Td
(3976 ) 3.01 Tj
0 -39.2727 Td
(3977     if\(b != &bufhead\){) 16.254 Tj
0 -40.5818 Td
(3978       if\(b->flags & B_BUSY\){) 19.866 Tj
0 -41.8909 Td
(3979         sleep\(buf, &buf_table_lock\);) 24.682 Tj
0 -43.2 Td
(3980       } else {) 11.438 Tj
0 -44.5091 Td
(3981         b->flags |= B_BUSY;) 19.264 Tj
0 -45.8182 Td
(3982         // b->flags &= ~B_VALID; // Force reread from disk) 37.926 Tj
0 -47.1272 Td
(3983         release\(&buf_table_lock\);) 22.876 Tj
0 -48.4363 Td
(3984         return b;) 13.244 Tj
0 -49.7454 Td
(3985       }) 7.224 Tj
0 -51.0545 Td
(3986     } else {) 10.234 Tj
0 -52.3636 Td
(3987       for\(b = bufhead.prev; b != &bufhead; b = b->prev\){) 36.722 Tj
0 -53.6727 Td
(3988         if\(\(b->flags & B_BUSY\) == 0\){) 25.284 Tj
0 -54.9818 Td
(3989           b->flags = B_BUSY;) 19.866 Tj
0 -56.2909 Td
(3990           b->dev = dev;) 16.856 Tj
0 -57.6 Td
(3991           b->sector = sector;) 20.468 Tj
0 -58.9091 Td
(3992           release\(&buf_table_lock\);) 24.08 Tj
0 -60.2181 Td
(3993           return b;) 14.448 Tj
0 -61.5272 Td
(3994         }) 8.428 Tj
0 -62.8363 Td
(3995       }) 7.224 Tj
0 -64.1454 Td
(3996       panic\("bget: no buffers"\);) 22.274 Tj
0 -65.4545 Td
(3997     }) 6.02 Tj
0 -66.7636 Td
(3998   }) 4.816 Tj
0 -68.0727 Td
(3999 }) 3.612 Tj
0 -72 Td
(Sheet 39) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 47 47
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/bio.c  Page 3) 21.672 Tj
0 -3.92728 Td
(4000 // Read buf's contents from disk.) 22.876 Tj
0 -5.23637 Td
(4001 struct buf*) 9.632 Tj
0 -6.54546 Td
(4002 bread\(uint dev, uint sector\)) 19.866 Tj
0 -7.85455 Td
(4003 {) 3.612 Tj
0 -9.16364 Td
(4004   struct buf *b;) 12.642 Tj
0 -10.4727 Td
(4005 ) 3.01 Tj
0 -11.7818 Td
(4006   b = bget\(dev, sector\);) 17.458 Tj
0 -13.0909 Td
(4007   if\(b->flags & B_VALID\)) 17.458 Tj
0 -14.4 Td
(4008     return b;) 10.836 Tj
0 -15.7091 Td
(4009 ) 3.01 Tj
0 -17.0182 Td
(4010   ide_rw\(dev & 0xff, sector, b->data, 1, 1\);) 29.498 Tj
0 -18.3273 Td
(4011   b->flags |= B_VALID;) 16.254 Tj
0 -19.6364 Td
(4012 ) 3.01 Tj
0 -20.9455 Td
(4013   return b;) 9.632 Tj
0 -22.2545 Td
(4014 }) 3.612 Tj
0 -23.5636 Td
(4015 ) 3.01 Tj
0 -24.8727 Td
(4016 // Write buf's contents to disk.) 22.274 Tj
0 -26.1818 Td
(4017 // Must be locked.) 13.846 Tj
0 -27.4909 Td
(4018 void) 5.418 Tj
0 -28.8 Td
(4019 bwrite\(struct buf *b, uint sector\)) 23.478 Tj
0 -30.1091 Td
(4020 {) 3.612 Tj
0 -31.4182 Td
(4021   if\(\(b->flags & B_BUSY\) == 0\)) 21.07 Tj
0 -32.7273 Td
(4022     panic\("bwrite"\);) 15.05 Tj
0 -34.0364 Td
(4023 ) 3.01 Tj
0 -35.3454 Td
(4024   ide_rw\(b->dev & 0xff, sector, b->data, 1, 0\);) 31.304 Tj
0 -36.6545 Td
(4025   b->flags |= B_VALID;) 16.254 Tj
0 -37.9636 Td
(4026 }) 3.612 Tj
0 -39.2727 Td
(4027 ) 3.01 Tj
0 -40.5818 Td
(4028 // Release the buffer buf.) 18.662 Tj
0 -41.8909 Td
(4029 void) 5.418 Tj
0 -43.2 Td
(4030 brelse\(struct buf *b\)) 15.652 Tj
0 -44.5091 Td
(4031 {) 3.612 Tj
0 -45.8182 Td
(4032   if\(\(b->flags & B_BUSY\) == 0\)) 21.07 Tj
0 -47.1272 Td
(4033     panic\("brelse"\);) 15.05 Tj
0 -48.4363 Td
(4034 ) 3.01 Tj
0 -49.7454 Td
(4035   acquire\(&buf_table_lock\);) 19.264 Tj
0 -51.0545 Td
(4036 ) 3.01 Tj
0 -52.3636 Td
(4037   b->next->prev = b->prev;) 18.662 Tj
0 -53.6727 Td
(4038   b->prev->next = b->next;) 18.662 Tj
0 -54.9818 Td
(4039   b->next = bufhead.next;) 18.06 Tj
0 -56.2909 Td
(4040   b->prev = &bufhead;) 15.652 Tj
0 -57.6 Td
(4041   bufhead.next->prev = b;) 18.06 Tj
0 -58.9091 Td
(4042   bufhead.next = b;) 14.448 Tj
0 -60.2181 Td
(4043 ) 3.01 Tj
0 -61.5272 Td
(4044   b->flags &= ~B_BUSY;) 16.254 Tj
0 -62.8363 Td
(4045   wakeup\(buf\);) 11.438 Tj
0 -64.1454 Td
(4046 ) 3.01 Tj
0 -65.4545 Td
(4047   release\(&buf_table_lock\);) 19.264 Tj
0 -66.7636 Td
(4048 }) 3.612 Tj
0 -68.0727 Td
(4049 ) 3.01 Tj
0 -72 Td
(Sheet 40) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/fs.c  Page 1) 21.07 Tj
0 -3.92728 Td
(4050 #include "types.h") 13.846 Tj
0 -5.23637 Td
(4051 #include "stat.h") 13.244 Tj
0 -6.54546 Td
(4052 #include "param.h") 13.846 Tj
0 -7.85455 Td
(4053 #include "x86.h") 12.642 Tj
0 -9.16364 Td
(4054 #include "mmu.h") 12.642 Tj
0 -10.4727 Td
(4055 #include "proc.h") 13.244 Tj
0 -11.7818 Td
(4056 #include "defs.h") 13.244 Tj
0 -13.0909 Td
(4057 #include "spinlock.h") 15.652 Tj
0 -14.4 Td
(4058 #include "buf.h") 12.642 Tj
0 -15.7091 Td
(4059 #include "fs.h") 12.04 Tj
0 -17.0182 Td
(4060 #include "fsvar.h") 13.846 Tj
0 -18.3273 Td
(4061 #include "dev.h") 12.642 Tj
0 -19.6364 Td
(4062 ) 3.01 Tj
0 -20.9455 Td
(4063 // Inode table.  The inode table is an in-memory cache of the) 39.732 Tj
0 -22.2545 Td
(4064 // on-disk inode structures.  If an inode in the table has a non-zero) 44.548 Tj
0 -23.5636 Td
(4065 // reference count, then some open files refer to it and it must stay) 44.548 Tj
0 -24.8727 Td
(4066 // in memory.  If an inode has a zero reference count, it is only in) 43.946 Tj
0 -26.1818 Td
(4067 // memory as a cache in hopes of being used again \(avoiding a disk read\).) 46.956 Tj
0 -27.4909 Td
(4068 // Any inode with reference count zero can be evicted from the table.) 44.548 Tj
0 -28.8 Td
(4069 //) 4.214 Tj
0 -30.1091 Td
(4070 // In addition to having a reference count, inodes can be marked busy) 44.548 Tj
0 -31.4182 Td
(4071 // \(just like bufs\), meaning that some code has logically locked the) 43.946 Tj
0 -32.7273 Td
(4072 // inode, and others are not allowed to look at it.) 33.712 Tj
0 -34.0364 Td
(4073 // This locking can last for a long) 24.08 Tj
0 -35.3454 Td
(4074 // time \(for example, if the inode is busy during a disk access\),) 42.14 Tj
0 -36.6545 Td
(4075 // so we don't use spin locks.  Instead, if a process wants to use) 42.742 Tj
0 -37.9636 Td
(4076 // a particular inode, it must sleep\(ip\) to wait for it to be not busy.) 45.752 Tj
0 -39.2727 Td
(4077 // See iget below.) 13.846 Tj
0 -40.5818 Td
(4078 struct inode inode[NINODE];) 19.264 Tj
0 -41.8909 Td
(4079 struct spinlock inode_table_lock;) 22.876 Tj
0 -43.2 Td
(4080 ) 3.01 Tj
0 -44.5091 Td
(4081 uint rootdev = 1;) 13.244 Tj
0 -45.8182 Td
(4082 ) 3.01 Tj
0 -47.1272 Td
(4083 void) 5.418 Tj
0 -48.4363 Td
(4084 iinit\(void\)) 9.632 Tj
0 -49.7454 Td
(4085 {) 3.612 Tj
0 -51.0545 Td
(4086   initlock\(&inode_table_lock, "inode_table"\);) 30.1 Tj
0 -52.3636 Td
(4087 }) 3.612 Tj
0 -53.6727 Td
(4088 ) 3.01 Tj
0 -54.9818 Td
(4089 ) 3.01 Tj
0 -56.2909 Td
(4090 ) 3.01 Tj
0 -57.6 Td
(4091 ) 3.01 Tj
0 -58.9091 Td
(4092 ) 3.01 Tj
0 -60.2181 Td
(4093 ) 3.01 Tj
0 -61.5272 Td
(4094 ) 3.01 Tj
0 -62.8363 Td
(4095 ) 3.01 Tj
0 -64.1454 Td
(4096 ) 3.01 Tj
0 -65.4545 Td
(4097 ) 3.01 Tj
0 -66.7636 Td
(4098 ) 3.01 Tj
0 -68.0727 Td
(4099 ) 3.01 Tj
0 -72 Td
(Sheet 40) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 48 48
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/fs.c  Page 2) 21.07 Tj
0 -3.92728 Td
(4100 // Allocate a disk block.) 18.06 Tj
0 -5.23637 Td
(4101 static uint) 9.632 Tj
0 -6.54546 Td
(4102 balloc\(uint dev\)) 12.642 Tj
0 -7.85455 Td
(4103 {) 3.612 Tj
0 -9.16364 Td
(4104   int b;) 7.826 Tj
0 -10.4727 Td
(4105   struct buf *bp;) 13.244 Tj
0 -11.7818 Td
(4106   struct superblock *sb;) 17.458 Tj
0 -13.0909 Td
(4107   int bi = 0;) 10.836 Tj
0 -14.4 Td
(4108   int size;) 9.632 Tj
0 -15.7091 Td
(4109   int ninodes;) 11.438 Tj
0 -17.0182 Td
(4110   uchar m;) 9.03 Tj
0 -18.3273 Td
(4111 ) 3.01 Tj
0 -19.6364 Td
(4112   bp = bread\(dev, 1\);) 15.652 Tj
0 -20.9455 Td
(4113   sb = \(struct superblock*\) bp->data;) 25.284 Tj
0 -22.2545 Td
(4114   size = sb->size;) 13.846 Tj
0 -23.5636 Td
(4115   ninodes = sb->ninodes;) 17.458 Tj
0 -24.8727 Td
(4116 ) 3.01 Tj
0 -26.1818 Td
(4117   for\(b = 0; b < size; b++\) {) 20.468 Tj
0 -27.4909 Td
(4118     if\(b % BPB == 0\) {) 16.254 Tj
0 -28.8 Td
(4119       brelse\(bp\);) 13.244 Tj
0 -30.1091 Td
(4120       bp = bread\(dev, BBLOCK\(b, ninodes\)\);) 28.294 Tj
0 -31.4182 Td
(4121     }) 6.02 Tj
0 -32.7273 Td
(4122     bi = b % BPB;) 13.244 Tj
0 -34.0364 Td
(4123     m = 0x1 << \(bi % 8\);) 17.458 Tj
0 -35.3454 Td
(4124     if\(\(bp->data[bi/8] & m\) == 0\) {  // is block free?) 35.518 Tj
0 -36.6545 Td
(4125       break;) 10.234 Tj
0 -37.9636 Td
(4126     }) 6.02 Tj
0 -39.2727 Td
(4127   }) 4.816 Tj
0 -40.5818 Td
(4128   if\(b >= size\)) 12.04 Tj
0 -41.8909 Td
(4129     panic\("balloc: out of blocks"\);) 24.08 Tj
0 -43.2 Td
(4130 ) 3.01 Tj
0 -44.5091 Td
(4131   bp->data[bi/8] |= 0x1 << \(bi % 8\);) 24.682 Tj
0 -45.8182 Td
(4132   bwrite\(bp, BBLOCK\(b, ninodes\)\);  // mark it allocated on disk) 40.936 Tj
0 -47.1272 Td
(4133   brelse\(bp\);) 10.836 Tj
0 -48.4363 Td
(4134   return b;) 9.632 Tj
0 -49.7454 Td
(4135 }) 3.612 Tj
0 -51.0545 Td
(4136 ) 3.01 Tj
0 -52.3636 Td
(4137 ) 3.01 Tj
0 -53.6727 Td
(4138 ) 3.01 Tj
0 -54.9818 Td
(4139 ) 3.01 Tj
0 -56.2909 Td
(4140 ) 3.01 Tj
0 -57.6 Td
(4141 ) 3.01 Tj
0 -58.9091 Td
(4142 ) 3.01 Tj
0 -60.2181 Td
(4143 ) 3.01 Tj
0 -61.5272 Td
(4144 ) 3.01 Tj
0 -62.8363 Td
(4145 ) 3.01 Tj
0 -64.1454 Td
(4146 ) 3.01 Tj
0 -65.4545 Td
(4147 ) 3.01 Tj
0 -66.7636 Td
(4148 ) 3.01 Tj
0 -68.0727 Td
(4149 ) 3.01 Tj
0 -72 Td
(Sheet 41) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/fs.c  Page 3) 21.07 Tj
0 -3.92728 Td
(4150 // Free a disk block.) 15.652 Tj
0 -5.23637 Td
(4151 static void) 9.632 Tj
0 -6.54546 Td
(4152 bfree\(int dev, uint b\)) 16.254 Tj
0 -7.85455 Td
(4153 {) 3.612 Tj
0 -9.16364 Td
(4154   struct buf *bp;) 13.244 Tj
0 -10.4727 Td
(4155   struct superblock *sb;) 17.458 Tj
0 -11.7818 Td
(4156   int bi;) 8.428 Tj
0 -13.0909 Td
(4157   int ninodes;) 11.438 Tj
0 -14.4 Td
(4158   uchar m;) 9.03 Tj
0 -15.7091 Td
(4159 ) 3.01 Tj
0 -17.0182 Td
(4160   bp = bread\(dev, 1\);) 15.652 Tj
0 -18.3273 Td
(4161   sb = \(struct superblock*\) bp->data;) 25.284 Tj
0 -19.6364 Td
(4162   ninodes = sb->ninodes;) 17.458 Tj
0 -20.9455 Td
(4163   brelse\(bp\);) 10.836 Tj
0 -22.2545 Td
(4164 ) 3.01 Tj
0 -23.5636 Td
(4165   bp = bread\(dev, b\);) 15.652 Tj
0 -24.8727 Td
(4166   memset\(bp->data, 0, BSIZE\);) 20.468 Tj
0 -26.1818 Td
(4167   bwrite\(bp, b\);) 12.642 Tj
0 -27.4909 Td
(4168   brelse\(bp\);) 10.836 Tj
0 -28.8 Td
(4169 ) 3.01 Tj
0 -30.1091 Td
(4170   bp = bread\(dev, BBLOCK\(b, ninodes\)\);) 25.886 Tj
0 -31.4182 Td
(4171   bi = b % BPB;) 12.04 Tj
0 -32.7273 Td
(4172   m = ~\(0x1 << \(bi %8\)\);) 17.458 Tj
0 -34.0364 Td
(4173   bp->data[bi/8] &= m;) 16.254 Tj
0 -35.3454 Td
(4174   bwrite\(bp, BBLOCK\(b, ninodes\)\);  // mark it free on disk) 37.926 Tj
0 -36.6545 Td
(4175   brelse\(bp\);) 10.836 Tj
0 -37.9636 Td
(4176 }) 3.612 Tj
0 -39.2727 Td
(4177 ) 3.01 Tj
0 -40.5818 Td
(4178 // Find the inode with number inum on device dev) 31.906 Tj
0 -41.8909 Td
(4179 // and return an in-memory copy.  Loads the inode) 32.508 Tj
0 -43.2 Td
(4180 // from disk into the in-core table if necessary.) 32.508 Tj
0 -44.5091 Td
(4181 // The returned inode has busy set and has its ref count incremented.) 44.548 Tj
0 -45.8182 Td
(4182 // Caller must iput the return value when done with it.) 36.12 Tj
0 -47.1272 Td
(4183 struct inode*) 10.836 Tj
0 -48.4363 Td
(4184 iget\(uint dev, uint inum\)) 18.06 Tj
0 -49.7454 Td
(4185 {) 3.612 Tj
0 -51.0545 Td
(4186   struct inode *ip, *nip;) 18.06 Tj
0 -52.3636 Td
(4187   struct dinode *dip;) 15.652 Tj
0 -53.6727 Td
(4188   struct buf *bp;) 13.244 Tj
0 -54.9818 Td
(4189 ) 3.01 Tj
0 -56.2909 Td
(4190   acquire\(&inode_table_lock\);) 20.468 Tj
0 -57.6 Td
(4191 ) 3.01 Tj
0 -58.9091 Td
(4192  loop:) 6.622 Tj
0 -60.2181 Td
(4193   nip = 0;) 9.03 Tj
0 -61.5272 Td
(4194   for\(ip = &inode[0]; ip < &inode[NINODE]; ip++\){) 32.508 Tj
0 -62.8363 Td
(4195     if\(ip->ref > 0 && ip->dev == dev && ip->inum == inum\){) 37.926 Tj
0 -64.1454 Td
(4196       if\(ip->busy\){) 14.448 Tj
0 -65.4545 Td
(4197         sleep\(ip, &inode_table_lock\);) 25.284 Tj
0 -66.7636 Td
(4198         // Since we droped inode_table_lock, ip might have been reused) 45.15 Tj
0 -68.0727 Td
(4199         // for some other inode entirely.  Must start the scan over,) 43.946 Tj
0 -72 Td
(Sheet 41) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 49 49
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/fs.c  Page 4) 21.07 Tj
0 -3.92728 Td
(4200         // and hopefully this time we will find the inode we want) 42.14 Tj
0 -5.23637 Td
(4201         // and it will not be busy.) 24.08 Tj
0 -6.54546 Td
(4202         goto loop;) 13.846 Tj
0 -7.85455 Td
(4203       }) 7.224 Tj
0 -9.16364 Td
(4204       ip->ref++;) 12.642 Tj
0 -10.4727 Td
(4205       ip->busy = 1;) 14.448 Tj
0 -11.7818 Td
(4206       release\(&inode_table_lock\);) 22.876 Tj
0 -13.0909 Td
(4207       return ip;) 12.642 Tj
0 -14.4 Td
(4208     }) 6.02 Tj
0 -15.7091 Td
(4209     if\(nip == 0 && ip->ref == 0\)) 22.274 Tj
0 -17.0182 Td
(4210       nip = ip;) 12.04 Tj
0 -18.3273 Td
(4211   }) 4.816 Tj
0 -19.6364 Td
(4212 ) 3.01 Tj
0 -20.9455 Td
(4213   if\(nip == 0\)) 11.438 Tj
0 -22.2545 Td
(4214     panic\("out of inodes"\);) 19.264 Tj
0 -23.5636 Td
(4215 ) 3.01 Tj
0 -24.8727 Td
(4216   nip->dev = dev;) 13.244 Tj
0 -26.1818 Td
(4217   nip->inum = inum;) 14.448 Tj
0 -27.4909 Td
(4218   nip->ref = 1;) 12.04 Tj
0 -28.8 Td
(4219   nip->busy = 1;) 12.642 Tj
0 -30.1091 Td
(4220 ) 3.01 Tj
0 -31.4182 Td
(4221   release\(&inode_table_lock\);) 20.468 Tj
0 -32.7273 Td
(4222 ) 3.01 Tj
0 -34.0364 Td
(4223   bp = bread\(dev, IBLOCK\(inum\)\);) 22.274 Tj
0 -35.3454 Td
(4224   dip = &\(\(struct dinode*\)\(bp->data\)\)[inum % IPB];) 33.11 Tj
0 -36.6545 Td
(4225   nip->type = dip->type;) 17.458 Tj
0 -37.9636 Td
(4226   nip->major = dip->major;) 18.662 Tj
0 -39.2727 Td
(4227   nip->minor = dip->minor;) 18.662 Tj
0 -40.5818 Td
(4228   nip->nlink = dip->nlink;) 18.662 Tj
0 -41.8909 Td
(4229   nip->size = dip->size;) 17.458 Tj
0 -43.2 Td
(4230   memmove\(nip->addrs, dip->addrs, sizeof\(nip->addrs\)\);) 35.518 Tj
0 -44.5091 Td
(4231   brelse\(bp\);) 10.836 Tj
0 -45.8182 Td
(4232 ) 3.01 Tj
0 -47.1272 Td
(4233   return nip;) 10.836 Tj
0 -48.4363 Td
(4234 }) 3.612 Tj
0 -49.7454 Td
(4235 ) 3.01 Tj
0 -51.0545 Td
(4236 ) 3.01 Tj
0 -52.3636 Td
(4237 ) 3.01 Tj
0 -53.6727 Td
(4238 ) 3.01 Tj
0 -54.9818 Td
(4239 ) 3.01 Tj
0 -56.2909 Td
(4240 ) 3.01 Tj
0 -57.6 Td
(4241 ) 3.01 Tj
0 -58.9091 Td
(4242 ) 3.01 Tj
0 -60.2181 Td
(4243 ) 3.01 Tj
0 -61.5272 Td
(4244 ) 3.01 Tj
0 -62.8363 Td
(4245 ) 3.01 Tj
0 -64.1454 Td
(4246 ) 3.01 Tj
0 -65.4545 Td
(4247 ) 3.01 Tj
0 -66.7636 Td
(4248 ) 3.01 Tj
0 -68.0727 Td
(4249 ) 3.01 Tj
0 -72 Td
(Sheet 42) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/fs.c  Page 5) 21.07 Tj
0 -3.92728 Td
(4250 // Copy inode in memory, which has changed, to disk.) 34.314 Tj
0 -5.23637 Td
(4251 // Caller must have locked ip.) 21.07 Tj
0 -6.54546 Td
(4252 void) 5.418 Tj
0 -7.85455 Td
(4253 iupdate\(struct inode *ip\)) 18.06 Tj
0 -9.16364 Td
(4254 {) 3.612 Tj
0 -10.4727 Td
(4255   struct buf *bp;) 13.244 Tj
0 -11.7818 Td
(4256   struct dinode *dip;) 15.652 Tj
0 -13.0909 Td
(4257 ) 3.01 Tj
0 -14.4 Td
(4258   bp = bread\(ip->dev, IBLOCK\(ip->inum\)\);) 27.09 Tj
0 -15.7091 Td
(4259   dip = &\(\(struct dinode*\)\(bp->data\)\)[ip->inum % IPB];) 35.518 Tj
0 -17.0182 Td
(4260   dip->type = ip->type;) 16.856 Tj
0 -18.3273 Td
(4261   dip->major = ip->major;) 18.06 Tj
0 -19.6364 Td
(4262   dip->minor = ip->minor;) 18.06 Tj
0 -20.9455 Td
(4263   dip->nlink = ip->nlink;) 18.06 Tj
0 -22.2545 Td
(4264   dip->size = ip->size;) 16.856 Tj
0 -23.5636 Td
(4265   memmove\(dip->addrs, ip->addrs, sizeof\(ip->addrs\)\);) 34.314 Tj
0 -24.8727 Td
(4266   bwrite\(bp, IBLOCK\(ip->inum\)\);   // mark it allocated on the disk) 42.742 Tj
0 -26.1818 Td
(4267   brelse\(bp\);) 10.836 Tj
0 -27.4909 Td
(4268 }) 3.612 Tj
0 -28.8 Td
(4269 ) 3.01 Tj
0 -30.1091 Td
(4270 // Allocate a new inode with the given type) 28.896 Tj
0 -31.4182 Td
(4271 // from the file system on device dev.) 25.886 Tj
0 -32.7273 Td
(4272 struct inode*) 10.836 Tj
0 -34.0364 Td
(4273 ialloc\(uint dev, short type\)) 19.866 Tj
0 -35.3454 Td
(4274 {) 3.612 Tj
0 -36.6545 Td
(4275   struct inode *ip;) 14.448 Tj
0 -37.9636 Td
(4276   struct dinode *dip = 0;) 18.06 Tj
0 -39.2727 Td
(4277   struct superblock *sb;) 17.458 Tj
0 -40.5818 Td
(4278   int ninodes;) 11.438 Tj
0 -41.8909 Td
(4279   int inum;) 9.632 Tj
0 -43.2 Td
(4280   struct buf *bp;) 13.244 Tj
0 -44.5091 Td
(4281 ) 3.01 Tj
0 -45.8182 Td
(4282   bp = bread\(dev, 1\);) 15.652 Tj
0 -47.1272 Td
(4283   sb = \(struct superblock*\) bp->data;) 25.284 Tj
0 -48.4363 Td
(4284   ninodes = sb->ninodes;) 17.458 Tj
0 -49.7454 Td
(4285   brelse\(bp\);) 10.836 Tj
0 -51.0545 Td
(4286 ) 3.01 Tj
0 -52.3636 Td
(4287   for\(inum = 1; inum < ninodes; inum++\) {  // loop over inode blocks) 43.946 Tj
0 -53.6727 Td
(4288     bp = bread\(dev, IBLOCK\(inum\)\);) 23.478 Tj
0 -54.9818 Td
(4289     dip = &\(\(struct dinode*\)\(bp->data\)\)[inum % IPB];) 34.314 Tj
0 -56.2909 Td
(4290     if\(dip->type == 0\) {  // a free inode) 27.692 Tj
0 -57.6 Td
(4291       break;) 10.234 Tj
0 -58.9091 Td
(4292     }) 6.02 Tj
0 -60.2181 Td
(4293     brelse\(bp\);) 12.04 Tj
0 -61.5272 Td
(4294   }) 4.816 Tj
0 -62.8363 Td
(4295 ) 3.01 Tj
0 -64.1454 Td
(4296   if\(inum >= ninodes\)) 15.652 Tj
0 -65.4545 Td
(4297     panic\("ialloc: no inodes left"\);) 24.682 Tj
0 -66.7636 Td
(4298 ) 3.01 Tj
0 -68.0727 Td
(4299 ) 3.01 Tj
0 -72 Td
(Sheet 42) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 50 50
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/fs.c  Page 6) 21.07 Tj
0 -3.92728 Td
(4300   memset\(dip, 0, sizeof\(*dip\)\);) 21.672 Tj
0 -5.23637 Td
(4301   dip->type = type;) 14.448 Tj
0 -6.54546 Td
(4302   bwrite\(bp, IBLOCK\(inum\)\);   // mark it allocated on the disk) 40.334 Tj
0 -7.85455 Td
(4303   brelse\(bp\);) 10.836 Tj
0 -9.16364 Td
(4304   ip = iget\(dev, inum\);) 16.856 Tj
0 -10.4727 Td
(4305   return ip;) 10.234 Tj
0 -11.7818 Td
(4306 }) 3.612 Tj
0 -13.0909 Td
(4307 ) 3.01 Tj
0 -14.4 Td
(4308 // Free the given inode from its file system.) 30.1 Tj
0 -15.7091 Td
(4309 static void) 9.632 Tj
0 -17.0182 Td
(4310 ifree\(struct inode *ip\)) 16.856 Tj
0 -18.3273 Td
(4311 {) 3.612 Tj
0 -19.6364 Td
(4312   ip->type = 0;) 12.04 Tj
0 -20.9455 Td
(4313   iupdate\(ip\);) 11.438 Tj
0 -22.2545 Td
(4314 }) 3.612 Tj
0 -23.5636 Td
(4315 ) 3.01 Tj
0 -24.8727 Td
(4316 // Lock the given inode \(wait for it to be not busy,) 34.314 Tj
0 -26.1818 Td
(4317 // and then ip->busy\).) 16.254 Tj
0 -27.4909 Td
(4318 // Caller must already hold a reference to ip.) 30.702 Tj
0 -28.8 Td
(4319 // Otherwise, if all the references to ip go away,) 33.11 Tj
0 -30.1091 Td
(4320 // it might be reused underfoot.) 22.274 Tj
0 -31.4182 Td
(4321 void) 5.418 Tj
0 -32.7273 Td
(4322 ilock\(struct inode *ip\)) 16.856 Tj
0 -34.0364 Td
(4323 {) 3.612 Tj
0 -35.3454 Td
(4324   if\(ip->ref < 1\)) 13.244 Tj
0 -36.6545 Td
(4325     panic\("ilock"\);) 14.448 Tj
0 -37.9636 Td
(4326 ) 3.01 Tj
0 -39.2727 Td
(4327   acquire\(&inode_table_lock\);) 20.468 Tj
0 -40.5818 Td
(4328 ) 3.01 Tj
0 -41.8909 Td
(4329   while\(ip->busy\)) 13.244 Tj
0 -43.2 Td
(4330     sleep\(ip, &inode_table_lock\);) 22.876 Tj
0 -44.5091 Td
(4331   ip->busy = 1;) 12.04 Tj
0 -45.8182 Td
(4332 ) 3.01 Tj
0 -47.1272 Td
(4333   release\(&inode_table_lock\);) 20.468 Tj
0 -48.4363 Td
(4334 }) 3.612 Tj
0 -49.7454 Td
(4335 ) 3.01 Tj
0 -51.0545 Td
(4336 ) 3.01 Tj
0 -52.3636 Td
(4337 ) 3.01 Tj
0 -53.6727 Td
(4338 ) 3.01 Tj
0 -54.9818 Td
(4339 ) 3.01 Tj
0 -56.2909 Td
(4340 ) 3.01 Tj
0 -57.6 Td
(4341 ) 3.01 Tj
0 -58.9091 Td
(4342 ) 3.01 Tj
0 -60.2181 Td
(4343 ) 3.01 Tj
0 -61.5272 Td
(4344 ) 3.01 Tj
0 -62.8363 Td
(4345 ) 3.01 Tj
0 -64.1454 Td
(4346 ) 3.01 Tj
0 -65.4545 Td
(4347 ) 3.01 Tj
0 -66.7636 Td
(4348 ) 3.01 Tj
0 -68.0727 Td
(4349 ) 3.01 Tj
0 -72 Td
(Sheet 43) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/fs.c  Page 7) 21.07 Tj
0 -3.92728 Td
(4350 // Caller holds reference to ip and has locked it.) 33.11 Tj
0 -5.23637 Td
(4351 // Caller no longer needs to examine / change it.) 32.508 Tj
0 -6.54546 Td
(4352 // Unlock it, but keep the reference.) 25.284 Tj
0 -7.85455 Td
(4353 void) 5.418 Tj
0 -9.16364 Td
(4354 iunlock\(struct inode *ip\)) 18.06 Tj
0 -10.4727 Td
(4355 {) 3.612 Tj
0 -11.7818 Td
(4356   if\(ip->busy != 1 || ip->ref < 1\)) 23.478 Tj
0 -13.0909 Td
(4357     panic\("iunlock"\);) 15.652 Tj
0 -14.4 Td
(4358 ) 3.01 Tj
0 -15.7091 Td
(4359   acquire\(&inode_table_lock\);) 20.468 Tj
0 -17.0182 Td
(4360 ) 3.01 Tj
0 -18.3273 Td
(4361   ip->busy = 0;) 12.04 Tj
0 -19.6364 Td
(4362   wakeup\(ip\);) 10.836 Tj
0 -20.9455 Td
(4363 ) 3.01 Tj
0 -22.2545 Td
(4364   release\(&inode_table_lock\);) 20.468 Tj
0 -23.5636 Td
(4365 }) 3.612 Tj
0 -24.8727 Td
(4366 ) 3.01 Tj
0 -26.1818 Td
(4367 // Return the disk block address of the nth block in inode ip.) 40.334 Tj
0 -27.4909 Td
(4368 uint) 5.418 Tj
0 -28.8 Td
(4369 bmap\(struct inode *ip, uint bn\)) 21.672 Tj
0 -30.1091 Td
(4370 {) 3.612 Tj
0 -31.4182 Td
(4371   unsigned x;) 10.836 Tj
0 -32.7273 Td
(4372   uint *a;) 9.03 Tj
0 -34.0364 Td
(4373   struct buf *inbp;) 14.448 Tj
0 -35.3454 Td
(4374 ) 3.01 Tj
0 -36.6545 Td
(4375   if\(bn >= MAXFILE\)) 14.448 Tj
0 -37.9636 Td
(4376     panic\("bmap 1"\);) 15.05 Tj
0 -39.2727 Td
(4377   if\(bn < NDIRECT\) {) 15.05 Tj
0 -40.5818 Td
(4378     x = ip->addrs[bn];) 16.254 Tj
0 -41.8909 Td
(4379     if\(x == 0\)) 11.438 Tj
0 -43.2 Td
(4380       panic\("bmap 2"\);) 16.254 Tj
0 -44.5091 Td
(4381   } else {) 9.03 Tj
0 -45.8182 Td
(4382     if\(ip->addrs[INDIRECT] == 0\)) 22.274 Tj
0 -47.1272 Td
(4383       panic\("bmap 3"\);) 16.254 Tj
0 -48.4363 Td
(4384     inbp = bread\(ip->dev, ip->addrs[INDIRECT]\);) 31.304 Tj
0 -49.7454 Td
(4385     a = \(uint*\) inbp->data;) 19.264 Tj
0 -51.0545 Td
(4386     x = a[bn - NDIRECT];) 17.458 Tj
0 -52.3636 Td
(4387     brelse\(inbp\);) 13.244 Tj
0 -53.6727 Td
(4388     if\(x == 0\)) 11.438 Tj
0 -54.9818 Td
(4389       panic\("bmap 4"\);) 16.254 Tj
0 -56.2909 Td
(4390   }) 4.816 Tj
0 -57.6 Td
(4391   return x;) 9.632 Tj
0 -58.9091 Td
(4392 }) 3.612 Tj
0 -60.2181 Td
(4393 ) 3.01 Tj
0 -61.5272 Td
(4394 ) 3.01 Tj
0 -62.8363 Td
(4395 ) 3.01 Tj
0 -64.1454 Td
(4396 ) 3.01 Tj
0 -65.4545 Td
(4397 ) 3.01 Tj
0 -66.7636 Td
(4398 ) 3.01 Tj
0 -68.0727 Td
(4399 ) 3.01 Tj
0 -72 Td
(Sheet 43) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 51 51
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/fs.c  Page 8) 21.07 Tj
0 -3.92728 Td
(4400 // Truncate the inode ip, discarding all its data blocks.) 37.324 Tj
0 -5.23637 Td
(4401 void) 5.418 Tj
0 -6.54546 Td
(4402 itrunc\(struct inode *ip\)) 17.458 Tj
0 -7.85455 Td
(4403 {) 3.612 Tj
0 -9.16364 Td
(4404   int i, j;) 9.632 Tj
0 -10.4727 Td
(4405   struct buf *inbp;) 14.448 Tj
0 -11.7818 Td
(4406 ) 3.01 Tj
0 -13.0909 Td
(4407   for\(i = 0; i < NADDRS; i++\) {) 21.672 Tj
0 -14.4 Td
(4408     if\(ip->addrs[i] != 0\) {) 19.264 Tj
0 -15.7091 Td
(4409       if\(i == INDIRECT\) {) 18.06 Tj
0 -17.0182 Td
(4410         inbp = bread\(ip->dev, ip->addrs[INDIRECT]\);) 33.712 Tj
0 -18.3273 Td
(4411         uint *a = \(uint*\) inbp->data;) 25.284 Tj
0 -19.6364 Td
(4412         for\(j = 0; j < NINDIRECT; j++\) {) 27.09 Tj
0 -20.9455 Td
(4413           if\(a[j] != 0\) {) 18.06 Tj
0 -22.2545 Td
(4414             bfree\(ip->dev, a[j]\);) 22.876 Tj
0 -23.5636 Td
(4415             a[j] = 0;) 15.652 Tj
0 -24.8727 Td
(4416           }) 9.632 Tj
0 -26.1818 Td
(4417         }) 8.428 Tj
0 -27.4909 Td
(4418         brelse\(inbp\);) 15.652 Tj
0 -28.8 Td
(4419       }) 7.224 Tj
0 -30.1091 Td
(4420       bfree\(ip->dev, ip->addrs[i]\);) 24.08 Tj
0 -31.4182 Td
(4421       ip->addrs[i] = 0;) 16.856 Tj
0 -32.7273 Td
(4422     }) 6.02 Tj
0 -34.0364 Td
(4423   }) 4.816 Tj
0 -35.3454 Td
(4424   ip->size = 0;) 12.04 Tj
0 -36.6545 Td
(4425   iupdate\(ip\);) 11.438 Tj
0 -37.9636 Td
(4426 }) 3.612 Tj
0 -39.2727 Td
(4427 ) 3.01 Tj
0 -40.5818 Td
(4428 // Caller holds reference to ip and has locked it,) 33.11 Tj
0 -41.8909 Td
(4429 // possibly editing it.) 16.856 Tj
0 -43.2 Td
(4430 // Release lock and drop the reference.) 26.488 Tj
0 -44.5091 Td
(4431 void) 5.418 Tj
0 -45.8182 Td
(4432 iput\(struct inode *ip\)) 16.254 Tj
0 -47.1272 Td
(4433 {) 3.612 Tj
0 -48.4363 Td
(4434   if\(ip->ref < 1 || ip->busy != 1\)) 23.478 Tj
0 -49.7454 Td
(4435     panic\("iput"\);) 13.846 Tj
0 -51.0545 Td
(4436 ) 3.01 Tj
0 -52.3636 Td
(4437   if\(\(ip->ref == 1\) && \(ip->nlink == 0\)\) {) 28.294 Tj
0 -53.6727 Td
(4438     itrunc\(ip\);) 12.04 Tj
0 -54.9818 Td
(4439     ifree\(ip\);) 11.438 Tj
0 -56.2909 Td
(4440   }) 4.816 Tj
0 -57.6 Td
(4441 ) 3.01 Tj
0 -58.9091 Td
(4442   acquire\(&inode_table_lock\);) 20.468 Tj
0 -60.2181 Td
(4443 ) 3.01 Tj
0 -61.5272 Td
(4444   ip->ref -= 1;) 12.04 Tj
0 -62.8363 Td
(4445   ip->busy = 0;) 12.04 Tj
0 -64.1454 Td
(4446   wakeup\(ip\);) 10.836 Tj
0 -65.4545 Td
(4447 ) 3.01 Tj
0 -66.7636 Td
(4448   release\(&inode_table_lock\);) 20.468 Tj
0 -68.0727 Td
(4449 }) 3.612 Tj
0 -72 Td
(Sheet 44) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/fs.c  Page 9) 21.07 Tj
0 -3.92728 Td
(4450 // Caller holds reference to ip but not lock.) 30.1 Tj
0 -5.23637 Td
(4451 // Drop reference.) 13.846 Tj
0 -6.54546 Td
(4452 void) 5.418 Tj
0 -7.85455 Td
(4453 idecref\(struct inode *ip\)) 18.06 Tj
0 -9.16364 Td
(4454 {) 3.612 Tj
0 -10.4727 Td
(4455   ilock\(ip\);) 10.234 Tj
0 -11.7818 Td
(4456   iput\(ip\);) 9.632 Tj
0 -13.0909 Td
(4457 }) 3.612 Tj
0 -14.4 Td
(4458 ) 3.01 Tj
0 -15.7091 Td
(4459 // Increment reference count for ip.) 24.682 Tj
0 -17.0182 Td
(4460 void) 5.418 Tj
0 -18.3273 Td
(4461 iincref\(struct inode *ip\)) 18.06 Tj
0 -19.6364 Td
(4462 {) 3.612 Tj
0 -20.9455 Td
(4463   ilock\(ip\);) 10.234 Tj
0 -22.2545 Td
(4464   ip->ref++;) 10.234 Tj
0 -23.5636 Td
(4465   iunlock\(ip\);) 11.438 Tj
0 -24.8727 Td
(4466 }) 3.612 Tj
0 -26.1818 Td
(4467 ) 3.01 Tj
0 -27.4909 Td
(4468 // Copy stat information from inode.) 24.682 Tj
0 -28.8 Td
(4469 void) 5.418 Tj
0 -30.1091 Td
(4470 stati\(struct inode *ip, struct stat *st\)) 27.09 Tj
0 -31.4182 Td
(4471 {) 3.612 Tj
0 -32.7273 Td
(4472   st->dev = ip->dev;) 15.05 Tj
0 -34.0364 Td
(4473   st->ino = ip->inum;) 15.652 Tj
0 -35.3454 Td
(4474   st->type = ip->type;) 16.254 Tj
0 -36.6545 Td
(4475   st->nlink = ip->nlink;) 17.458 Tj
0 -37.9636 Td
(4476   st->size = ip->size;) 16.254 Tj
0 -39.2727 Td
(4477 }) 3.612 Tj
0 -40.5818 Td
(4478 ) 3.01 Tj
0 -41.8909 Td
(4479 #define min\(a, b\) \(\(a\) < \(b\) ? \(a\) : \(b\)\)) 27.692 Tj
0 -43.2 Td
(4480 ) 3.01 Tj
0 -44.5091 Td
(4481 // Read data from inode.) 17.458 Tj
0 -45.8182 Td
(4482 int) 4.816 Tj
0 -47.1272 Td
(4483 readi\(struct inode *ip, char *dst, uint off, uint n\)) 34.314 Tj
0 -48.4363 Td
(4484 {) 3.612 Tj
0 -49.7454 Td
(4485   uint target = n, n1;) 16.254 Tj
0 -51.0545 Td
(4486   struct buf *bp;) 13.244 Tj
0 -52.3636 Td
(4487 ) 3.01 Tj
0 -53.6727 Td
(4488   if\(ip->type == T_DEV\) {) 18.06 Tj
0 -54.9818 Td
(4489     if\(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read\)) 43.946 Tj
0 -56.2909 Td
(4490       return -1;) 12.642 Tj
0 -57.6 Td
(4491     return devsw[ip->major].read\(ip->minor, dst, n\);) 34.314 Tj
0 -58.9091 Td
(4492   }) 4.816 Tj
0 -60.2181 Td
(4493 ) 3.01 Tj
0 -61.5272 Td
(4494   while\(n > 0 && off < ip->size\){) 22.876 Tj
0 -62.8363 Td
(4495     bp = bread\(ip->dev, bmap\(ip, off / BSIZE\)\);) 31.304 Tj
0 -64.1454 Td
(4496     n1 = min\(n, ip->size - off\);) 22.274 Tj
0 -65.4545 Td
(4497     n1 = min\(n1, BSIZE - \(off % BSIZE\)\);) 27.09 Tj
0 -66.7636 Td
(4498     memmove\(dst, bp->data + \(off % BSIZE\), n1\);) 31.304 Tj
0 -68.0727 Td
(4499     n -= n1;) 10.234 Tj
0 -72 Td
(Sheet 44) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 52 52
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/fs.c  Page 10) 21.672 Tj
0 -3.92728 Td
(4500     off += n1;) 11.438 Tj
0 -5.23637 Td
(4501     dst += n1;) 11.438 Tj
0 -6.54546 Td
(4502     brelse\(bp\);) 12.04 Tj
0 -7.85455 Td
(4503   }) 4.816 Tj
0 -9.16364 Td
(4504 ) 3.01 Tj
0 -10.4727 Td
(4505   return target - n;) 15.05 Tj
0 -11.7818 Td
(4506 }) 3.612 Tj
0 -13.0909 Td
(4507 ) 3.01 Tj
0 -14.4 Td
(4508 // Allocate the nth block in inode ip if necessary.) 33.712 Tj
0 -15.7091 Td
(4509 static int) 9.03 Tj
0 -17.0182 Td
(4510 newblock\(struct inode *ip, uint lbn\)) 24.682 Tj
0 -18.3273 Td
(4511 {) 3.612 Tj
0 -19.6364 Td
(4512   struct buf *inbp;) 14.448 Tj
0 -20.9455 Td
(4513   uint *inaddrs;) 12.642 Tj
0 -22.2545 Td
(4514   uint b;) 8.428 Tj
0 -23.5636 Td
(4515 ) 3.01 Tj
0 -24.8727 Td
(4516   if\(lbn < NDIRECT\) {) 15.652 Tj
0 -26.1818 Td
(4517     if\(ip->addrs[lbn] == 0\) {) 20.468 Tj
0 -27.4909 Td
(4518       b = balloc\(ip->dev\);) 18.662 Tj
0 -28.8 Td
(4519       if\(b <= 0\)) 12.642 Tj
0 -30.1091 Td
(4520         return -1;) 13.846 Tj
0 -31.4182 Td
(4521       ip->addrs[lbn] = b;) 18.06 Tj
0 -32.7273 Td
(4522     }) 6.02 Tj
0 -34.0364 Td
(4523   } else {) 9.03 Tj
0 -35.3454 Td
(4524     if\(ip->addrs[INDIRECT] == 0\) {) 23.478 Tj
0 -36.6545 Td
(4525       b = balloc\(ip->dev\);) 18.662 Tj
0 -37.9636 Td
(4526       if\(b <= 0\)) 12.642 Tj
0 -39.2727 Td
(4527         return -1;) 13.846 Tj
0 -40.5818 Td
(4528       ip->addrs[INDIRECT] = b;) 21.07 Tj
0 -41.8909 Td
(4529     }) 6.02 Tj
0 -43.2 Td
(4530     inbp = bread\(ip->dev, ip->addrs[INDIRECT]\);) 31.304 Tj
0 -44.5091 Td
(4531     inaddrs = \(uint*\) inbp->data;) 22.876 Tj
0 -45.8182 Td
(4532     if\(inaddrs[lbn - NDIRECT] == 0\) {) 25.284 Tj
0 -47.1272 Td
(4533       b = balloc\(ip->dev\);) 18.662 Tj
0 -48.4363 Td
(4534       if\(b <= 0\)) 12.642 Tj
0 -49.7454 Td
(4535         return -1;) 13.846 Tj
0 -51.0545 Td
(4536       inaddrs[lbn - NDIRECT] = b;) 22.876 Tj
0 -52.3636 Td
(4537       bwrite\(inbp, ip->addrs[INDIRECT]\);) 27.09 Tj
0 -53.6727 Td
(4538     }) 6.02 Tj
0 -54.9818 Td
(4539     brelse\(inbp\);) 13.244 Tj
0 -56.2909 Td
(4540   }) 4.816 Tj
0 -57.6 Td
(4541   return 0;) 9.632 Tj
0 -58.9091 Td
(4542 }) 3.612 Tj
0 -60.2181 Td
(4543 ) 3.01 Tj
0 -61.5272 Td
(4544 ) 3.01 Tj
0 -62.8363 Td
(4545 ) 3.01 Tj
0 -64.1454 Td
(4546 ) 3.01 Tj
0 -65.4545 Td
(4547 ) 3.01 Tj
0 -66.7636 Td
(4548 ) 3.01 Tj
0 -68.0727 Td
(4549 ) 3.01 Tj
0 -72 Td
(Sheet 45) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/fs.c  Page 11) 21.672 Tj
0 -3.92728 Td
(4550 // Write data to inode.) 16.856 Tj
0 -5.23637 Td
(4551 int) 4.816 Tj
0 -6.54546 Td
(4552 writei\(struct inode *ip, char *addr, uint off, uint n\)) 35.518 Tj
0 -7.85455 Td
(4553 {) 3.612 Tj
0 -9.16364 Td
(4554   if\(ip->type == T_DEV\) {) 18.06 Tj
0 -10.4727 Td
(4555     if\(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write\)) 44.548 Tj
0 -11.7818 Td
(4556       return -1;) 12.642 Tj
0 -13.0909 Td
(4557     return devsw[ip->major].write\(ip->minor, addr, n\);) 35.518 Tj
0 -14.4 Td
(4558   } else if\(ip->type == T_FILE || ip->type == T_DIR\) {) 35.518 Tj
0 -15.7091 Td
(4559     struct buf *bp;) 14.448 Tj
0 -17.0182 Td
(4560     int r = 0;) 11.438 Tj
0 -18.3273 Td
(4561     int m;) 9.03 Tj
0 -19.6364 Td
(4562     int lbn;) 10.234 Tj
0 -20.9455 Td
(4563     while\(r < n\) {) 13.846 Tj
0 -22.2545 Td
(4564       lbn = off / BSIZE;) 17.458 Tj
0 -23.5636 Td
(4565       if\(lbn >= MAXFILE\)) 17.458 Tj
0 -24.8727 Td
(4566         return r;) 13.244 Tj
0 -26.1818 Td
(4567       if\(newblock\(ip, lbn\) < 0\) {) 22.876 Tj
0 -27.4909 Td
(4568         cprintf\("newblock failed\\n"\);) 25.284 Tj
0 -28.8 Td
(4569         return r;) 13.244 Tj
0 -30.1091 Td
(4570       }) 7.224 Tj
0 -31.4182 Td
(4571       m = min\(BSIZE - off % BSIZE, n-r\);) 27.09 Tj
0 -32.7273 Td
(4572       bp = bread\(ip->dev, bmap\(ip, lbn\)\);) 27.692 Tj
0 -34.0364 Td
(4573       memmove\(bp->data + off % BSIZE, addr, m\);) 31.304 Tj
0 -35.3454 Td
(4574       bwrite\(bp, bmap\(ip, lbn\)\);) 22.274 Tj
0 -36.6545 Td
(4575       brelse\(bp\);) 13.244 Tj
0 -37.9636 Td
(4576       r += m;) 10.836 Tj
0 -39.2727 Td
(4577       off += m;) 12.04 Tj
0 -40.5818 Td
(4578     }) 6.02 Tj
0 -41.8909 Td
(4579     if\(r > 0\) {) 12.04 Tj
0 -43.2 Td
(4580       if\(off > ip->size\) {) 18.662 Tj
0 -44.5091 Td
(4581         if\(ip->type == T_DIR\)) 20.468 Tj
0 -45.8182 Td
(4582           ip->size = \(\(off / BSIZE\) + 1\) * BSIZE;) 32.508 Tj
0 -47.1272 Td
(4583         else) 10.234 Tj
0 -48.4363 Td
(4584           ip->size = off;) 18.06 Tj
0 -49.7454 Td
(4585       }) 7.224 Tj
0 -51.0545 Td
(4586       iupdate\(ip\);) 13.846 Tj
0 -52.3636 Td
(4587     }) 6.02 Tj
0 -53.6727 Td
(4588     return r;) 10.836 Tj
0 -54.9818 Td
(4589   } else {) 9.03 Tj
0 -56.2909 Td
(4590     panic\("writei: unknown type"\);) 23.478 Tj
0 -57.6 Td
(4591     return 0;) 10.836 Tj
0 -58.9091 Td
(4592   }) 4.816 Tj
0 -60.2181 Td
(4593 }) 3.612 Tj
0 -61.5272 Td
(4594 ) 3.01 Tj
0 -62.8363 Td
(4595 ) 3.01 Tj
0 -64.1454 Td
(4596 ) 3.01 Tj
0 -65.4545 Td
(4597 ) 3.01 Tj
0 -66.7636 Td
(4598 ) 3.01 Tj
0 -68.0727 Td
(4599 ) 3.01 Tj
0 -72 Td
(Sheet 45) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 53 53
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/fs.c  Page 12) 21.672 Tj
0 -3.92728 Td
(4600 // look up a path name, in one of three modes.) 30.702 Tj
0 -5.23637 Td
(4601 // NAMEI_LOOKUP: return locked target inode.) 29.498 Tj
0 -6.54546 Td
(4602 // NAMEI_CREATE: return locked parent inode.) 29.498 Tj
0 -7.85455 Td
(4603 //   return 0 if name does exist.) 22.876 Tj
0 -9.16364 Td
(4604 //   *ret_last points to last path component \(i.e. new file name\).) 42.742 Tj
0 -10.4727 Td
(4605 //   *ret_ip points to the the name that did exist, if it did.) 40.334 Tj
0 -11.7818 Td
(4606 //   *ret_ip and *ret_last may be zero even if return value is zero.) 43.946 Tj
0 -13.0909 Td
(4607 // NAMEI_DELETE: return locked parent inode, offset of dirent in *ret_off.) 47.558 Tj
0 -14.4 Td
(4608 //   return 0 if name doesn't exist.) 24.682 Tj
0 -15.7091 Td
(4609 struct inode*) 10.836 Tj
0 -17.0182 Td
(4610 namei\(char *path, int mode, uint *ret_off,) 28.294 Tj
0 -18.3273 Td
(4611       char **ret_last, struct inode **ret_ip\)) 30.1 Tj
0 -19.6364 Td
(4612 {) 3.612 Tj
0 -20.9455 Td
(4613   struct inode *dp;) 14.448 Tj
0 -22.2545 Td
(4614   struct proc *p = curproc[cpu\(\)];) 23.478 Tj
0 -23.5636 Td
(4615   char *cp = path, *cp1;) 17.458 Tj
0 -24.8727 Td
(4616   uint off, dev;) 12.642 Tj
0 -26.1818 Td
(4617   struct buf *bp;) 13.244 Tj
0 -27.4909 Td
(4618   struct dirent *ep;) 15.05 Tj
0 -28.8 Td
(4619   int i, l, atend;) 13.846 Tj
0 -30.1091 Td
(4620   uint ninum;) 10.836 Tj
0 -31.4182 Td
(4621 ) 3.01 Tj
0 -32.7273 Td
(4622   if\(ret_off\)) 10.836 Tj
0 -34.0364 Td
(4623     *ret_off = 0xffffffff;) 18.662 Tj
0 -35.3454 Td
(4624   if\(ret_last\)) 11.438 Tj
0 -36.6545 Td
(4625     *ret_last = 0;) 13.846 Tj
0 -37.9636 Td
(4626   if\(ret_ip\)) 10.234 Tj
0 -39.2727 Td
(4627     *ret_ip = 0;) 12.642 Tj
0 -40.5818 Td
(4628 ) 3.01 Tj
0 -41.8909 Td
(4629   if\(*cp == '/'\)) 12.642 Tj
0 -43.2 Td
(4630     dp = iget\(rootdev, 1\);) 18.662 Tj
0 -44.5091 Td
(4631   else {) 7.826 Tj
0 -45.8182 Td
(4632     dp = p->cwd;) 12.642 Tj
0 -47.1272 Td
(4633     iincref\(dp\);) 12.642 Tj
0 -48.4363 Td
(4634     ilock\(dp\);) 11.438 Tj
0 -49.7454 Td
(4635   }) 4.816 Tj
0 -51.0545 Td
(4636 ) 3.01 Tj
0 -52.3636 Td
(4637   for\(;;\){) 9.03 Tj
0 -53.6727 Td
(4638     while\(*cp == '/'\)) 15.652 Tj
0 -54.9818 Td
(4639       cp++;) 9.632 Tj
0 -56.2909 Td
(4640 ) 3.01 Tj
0 -57.6 Td
(4641     if\(*cp == '\\0'\){) 15.05 Tj
0 -58.9091 Td
(4642       if\(mode == NAMEI_LOOKUP\)) 21.07 Tj
0 -60.2181 Td
(4643         return dp;) 13.846 Tj
0 -61.5272 Td
(4644       if\(mode == NAMEI_CREATE && ret_ip\){) 27.692 Tj
0 -62.8363 Td
(4645         *ret_ip = dp;) 15.652 Tj
0 -64.1454 Td
(4646         return 0;) 13.244 Tj
0 -65.4545 Td
(4647       }) 7.224 Tj
0 -66.7636 Td
(4648       iput\(dp\);) 12.04 Tj
0 -68.0727 Td
(4649       return 0;) 12.04 Tj
0 -72 Td
(Sheet 46) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/fs.c  Page 13) 21.672 Tj
0 -3.92728 Td
(4650     }) 6.02 Tj
0 -5.23637 Td
(4651 ) 3.01 Tj
0 -6.54546 Td
(4652     if\(dp->type != T_DIR\){) 18.662 Tj
0 -7.85455 Td
(4653       iput\(dp\);) 12.04 Tj
0 -9.16364 Td
(4654       return 0;) 12.04 Tj
0 -10.4727 Td
(4655     }) 6.02 Tj
0 -11.7818 Td
(4656 ) 3.01 Tj
0 -13.0909 Td
(4657     for\(i = 0; cp[i] != 0 && cp[i] != '/'; i++\)) 31.304 Tj
0 -14.4 Td
(4658       ;) 7.224 Tj
0 -15.7091 Td
(4659     l = i;) 9.03 Tj
0 -17.0182 Td
(4660     if\(i > DIRSIZ\)) 13.846 Tj
0 -18.3273 Td
(4661       l = DIRSIZ;) 13.244 Tj
0 -19.6364 Td
(4662 ) 3.01 Tj
0 -20.9455 Td
(4663     for\(off = 0; off < dp->size; off += BSIZE\){) 31.304 Tj
0 -22.2545 Td
(4664       bp = bread\(dp->dev, bmap\(dp, off / BSIZE\)\);) 32.508 Tj
0 -23.5636 Td
(4665       for\(ep = \(struct dirent*\) bp->data;) 27.692 Tj
0 -24.8727 Td
(4666           ep < \(struct dirent*\) \(bp->data + BSIZE\);) 33.712 Tj
0 -26.1818 Td
(4667           ep++\){) 12.642 Tj
0 -27.4909 Td
(4668         if\(ep->inum == 0\)) 18.06 Tj
0 -28.8 Td
(4669           continue;) 14.448 Tj
0 -30.1091 Td
(4670         if\(memcmp\(cp, ep->name, l\) == 0 &&) 28.294 Tj
0 -31.4182 Td
(4671            \(l == DIRSIZ || ep->name[l]== 0\)\){) 30.1 Tj
0 -32.7273 Td
(4672           // entry matches path element) 26.488 Tj
0 -34.0364 Td
(4673           off += \(uchar*\)ep - bp->data;) 26.488 Tj
0 -35.3454 Td
(4674           ninum = ep->inum;) 19.264 Tj
0 -36.6545 Td
(4675           brelse\(bp\);) 15.652 Tj
0 -37.9636 Td
(4676           cp += i;) 13.846 Tj
0 -39.2727 Td
(4677           goto found;) 15.652 Tj
0 -40.5818 Td
(4678         }) 8.428 Tj
0 -41.8909 Td
(4679       }) 7.224 Tj
0 -43.2 Td
(4680       brelse\(bp\);) 13.244 Tj
0 -44.5091 Td
(4681     }) 6.02 Tj
0 -45.8182 Td
(4682     atend = 1;) 11.438 Tj
0 -47.1272 Td
(4683     for\(cp1 = cp; *cp1; cp1++\)) 21.07 Tj
0 -48.4363 Td
(4684       if\(*cp1 == '/'\)) 15.652 Tj
0 -49.7454 Td
(4685         atend = 0;) 13.846 Tj
0 -51.0545 Td
(4686     if\(mode == NAMEI_CREATE && atend\){) 25.886 Tj
0 -52.3636 Td
(4687       if\(*cp == '\\0'\){) 16.254 Tj
0 -53.6727 Td
(4688         iput\(dp\);) 13.244 Tj
0 -54.9818 Td
(4689         return 0;) 13.244 Tj
0 -56.2909 Td
(4690       }) 7.224 Tj
0 -57.6 Td
(4691       *ret_last = cp;) 15.652 Tj
0 -58.9091 Td
(4692       return dp;) 12.642 Tj
0 -60.2181 Td
(4693     }) 6.02 Tj
0 -61.5272 Td
(4694 ) 3.01 Tj
0 -62.8363 Td
(4695     iput\(dp\);) 10.836 Tj
0 -64.1454 Td
(4696     return 0;) 10.836 Tj
0 -65.4545 Td
(4697 ) 3.01 Tj
0 -66.7636 Td
(4698 ) 3.01 Tj
0 -68.0727 Td
(4699 ) 3.01 Tj
0 -72 Td
(Sheet 46) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 54 54
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/fs.c  Page 14) 21.672 Tj
0 -3.92728 Td
(4700   found:) 7.826 Tj
0 -5.23637 Td
(4701     if\(mode == NAMEI_DELETE && *cp == '\\0'\){) 29.498 Tj
0 -6.54546 Td
(4702       *ret_off = off;) 15.652 Tj
0 -7.85455 Td
(4703       return dp;) 12.642 Tj
0 -9.16364 Td
(4704     }) 6.02 Tj
0 -10.4727 Td
(4705     dev = dp->dev;) 13.846 Tj
0 -11.7818 Td
(4706     iput\(dp\);) 10.836 Tj
0 -13.0909 Td
(4707     dp = iget\(dev, ninum\);) 18.662 Tj
0 -14.4 Td
(4708     if\(dp->type == 0 || dp->nlink < 1\)) 25.886 Tj
0 -15.7091 Td
(4709       panic\("namei"\);) 15.652 Tj
0 -17.0182 Td
(4710   }) 4.816 Tj
0 -18.3273 Td
(4711 }) 3.612 Tj
0 -19.6364 Td
(4712 ) 3.01 Tj
0 -20.9455 Td
(4713 // Write a new directory entry \(name, ino\) into the directory dp.) 42.14 Tj
0 -22.2545 Td
(4714 // Caller must have locked dp.) 21.07 Tj
0 -23.5636 Td
(4715 void) 5.418 Tj
0 -24.8727 Td
(4716 wdir\(struct inode *dp, char *name, uint ino\)) 29.498 Tj
0 -26.1818 Td
(4717 {) 3.612 Tj
0 -27.4909 Td
(4718   uint off;) 9.632 Tj
0 -28.8 Td
(4719   struct dirent de;) 14.448 Tj
0 -30.1091 Td
(4720   int i;) 7.826 Tj
0 -31.4182 Td
(4721 ) 3.01 Tj
0 -32.7273 Td
(4722   for\(off = 0; off < dp->size; off += sizeof\(de\)\){) 33.11 Tj
0 -34.0364 Td
(4723     if\(readi\(dp, \(char*\) &de, off, sizeof\(de\)\) != sizeof\(de\)\)) 39.732 Tj
0 -35.3454 Td
(4724       panic\("wdir read"\);) 18.06 Tj
0 -36.6545 Td
(4725     if\(de.inum == 0\)) 15.05 Tj
0 -37.9636 Td
(4726       break;) 10.234 Tj
0 -39.2727 Td
(4727   }) 4.816 Tj
0 -40.5818 Td
(4728 ) 3.01 Tj
0 -41.8909 Td
(4729   de.inum = ino;) 12.642 Tj
0 -43.2 Td
(4730   for\(i = 0; i < DIRSIZ && name[i]; i++\)) 27.09 Tj
0 -44.5091 Td
(4731     de.name[i] = name[i];) 18.06 Tj
0 -45.8182 Td
(4732   for\( ; i < DIRSIZ; i++\)) 18.06 Tj
0 -47.1272 Td
(4733     de.name[i] = '\\0';) 16.254 Tj
0 -48.4363 Td
(4734 ) 3.01 Tj
0 -49.7454 Td
(4735   if\(writei\(dp, \(char*\) &de, off, sizeof\(de\)\) != sizeof\(de\)\)) 39.13 Tj
0 -51.0545 Td
(4736     panic\("wdir write"\);) 17.458 Tj
0 -52.3636 Td
(4737 }) 3.612 Tj
0 -53.6727 Td
(4738 ) 3.01 Tj
0 -54.9818 Td
(4739 ) 3.01 Tj
0 -56.2909 Td
(4740 ) 3.01 Tj
0 -57.6 Td
(4741 ) 3.01 Tj
0 -58.9091 Td
(4742 ) 3.01 Tj
0 -60.2181 Td
(4743 ) 3.01 Tj
0 -61.5272 Td
(4744 ) 3.01 Tj
0 -62.8363 Td
(4745 ) 3.01 Tj
0 -64.1454 Td
(4746 ) 3.01 Tj
0 -65.4545 Td
(4747 ) 3.01 Tj
0 -66.7636 Td
(4748 ) 3.01 Tj
0 -68.0727 Td
(4749 ) 3.01 Tj
0 -72 Td
(Sheet 47) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/fs.c  Page 15) 21.672 Tj
0 -3.92728 Td
(4750 // Create the path cp and return its locked inode structure.) 39.13 Tj
0 -5.23637 Td
(4751 // If cp already exists, return 0.) 23.478 Tj
0 -6.54546 Td
(4752 struct inode*) 10.836 Tj
0 -7.85455 Td
(4753 mknod\(char *cp, short type, short major, short minor\)) 34.916 Tj
0 -9.16364 Td
(4754 {) 3.612 Tj
0 -10.4727 Td
(4755   struct inode *ip, *dp;) 17.458 Tj
0 -11.7818 Td
(4756   char *last;) 10.836 Tj
0 -13.0909 Td
(4757 ) 3.01 Tj
0 -14.4 Td
(4758   if\(\(dp = namei\(cp, NAMEI_CREATE, 0, &last, 0\)\) == 0\)) 35.518 Tj
0 -15.7091 Td
(4759     return 0;) 10.836 Tj
0 -17.0182 Td
(4760 ) 3.01 Tj
0 -18.3273 Td
(4761   ip = mknod1\(dp, last, type, major, minor\);) 29.498 Tj
0 -19.6364 Td
(4762 ) 3.01 Tj
0 -20.9455 Td
(4763   iput\(dp\);) 9.632 Tj
0 -22.2545 Td
(4764 ) 3.01 Tj
0 -23.5636 Td
(4765   return ip;) 10.234 Tj
0 -24.8727 Td
(4766 }) 3.612 Tj
0 -26.1818 Td
(4767 ) 3.01 Tj
0 -27.4909 Td
(4768 // Create a new inode named name inside dp) 28.294 Tj
0 -28.8 Td
(4769 // and return its locked inode structure.) 27.692 Tj
0 -30.1091 Td
(4770 // If name already exists, return 0.) 24.682 Tj
0 -31.4182 Td
(4771 struct inode*) 10.836 Tj
0 -32.7273 Td
(4772 mknod1\(struct inode *dp, char *name, short type, short major, short minor\)) 47.558 Tj
0 -34.0364 Td
(4773 {) 3.612 Tj
0 -35.3454 Td
(4774   struct inode *ip;) 14.448 Tj
0 -36.6545 Td
(4775 ) 3.01 Tj
0 -37.9636 Td
(4776   ip = ialloc\(dp->dev, type\);) 20.468 Tj
0 -39.2727 Td
(4777   if\(ip == 0\)) 10.836 Tj
0 -40.5818 Td
(4778     return 0;) 10.836 Tj
0 -41.8909 Td
(4779   ip->major = major;) 15.05 Tj
0 -43.2 Td
(4780   ip->minor = minor;) 15.05 Tj
0 -44.5091 Td
(4781   ip->size = 0;) 12.04 Tj
0 -45.8182 Td
(4782   ip->nlink = 1;) 12.642 Tj
0 -47.1272 Td
(4783 ) 3.01 Tj
0 -48.4363 Td
(4784   iupdate\(ip\);  // write new inode to disk) 28.294 Tj
0 -49.7454 Td
(4785 ) 3.01 Tj
0 -51.0545 Td
(4786   wdir\(dp, name, ip->inum\);) 19.264 Tj
0 -52.3636 Td
(4787 ) 3.01 Tj
0 -53.6727 Td
(4788   return ip;) 10.234 Tj
0 -54.9818 Td
(4789 }) 3.612 Tj
0 -56.2909 Td
(4790 ) 3.01 Tj
0 -57.6 Td
(4791 ) 3.01 Tj
0 -58.9091 Td
(4792 ) 3.01 Tj
0 -60.2181 Td
(4793 ) 3.01 Tj
0 -61.5272 Td
(4794 ) 3.01 Tj
0 -62.8363 Td
(4795 ) 3.01 Tj
0 -64.1454 Td
(4796 ) 3.01 Tj
0 -65.4545 Td
(4797 ) 3.01 Tj
0 -66.7636 Td
(4798 ) 3.01 Tj
0 -68.0727 Td
(4799 ) 3.01 Tj
0 -72 Td
(Sheet 47) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 55 55
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/fs.c  Page 16) 21.672 Tj
0 -3.92728 Td
(4800 // Unlink the inode named cp.) 20.468 Tj
0 -5.23637 Td
(4801 int) 4.816 Tj
0 -6.54546 Td
(4802 unlink\(char *cp\)) 12.642 Tj
0 -7.85455 Td
(4803 {) 3.612 Tj
0 -9.16364 Td
(4804   struct inode *ip, *dp;) 17.458 Tj
0 -10.4727 Td
(4805   struct dirent de;) 14.448 Tj
0 -11.7818 Td
(4806   uint off, inum, dev;) 16.254 Tj
0 -13.0909 Td
(4807 ) 3.01 Tj
0 -14.4 Td
(4808   dp = namei\(cp, NAMEI_DELETE, &off, 0, 0\);) 28.896 Tj
0 -15.7091 Td
(4809   if\(dp == 0\)) 10.836 Tj
0 -17.0182 Td
(4810     return -1;) 11.438 Tj
0 -18.3273 Td
(4811 ) 3.01 Tj
0 -19.6364 Td
(4812   dev = dp->dev;) 12.642 Tj
0 -20.9455 Td
(4813 ) 3.01 Tj
0 -22.2545 Td
(4814   if\(readi\(dp, \(char*\)&de, off, sizeof\(de\)\) != sizeof\(de\) || de.inum == 0\)) 47.558 Tj
0 -23.5636 Td
(4815     panic\("unlink no entry"\);) 20.468 Tj
0 -24.8727 Td
(4816 ) 3.01 Tj
0 -26.1818 Td
(4817   inum = de.inum;) 13.244 Tj
0 -27.4909 Td
(4818 ) 3.01 Tj
0 -28.8 Td
(4819   memset\(&de, 0, sizeof\(de\)\);) 20.468 Tj
0 -30.1091 Td
(4820   if\(writei\(dp, \(char*\)&de, off, sizeof\(de\)\) != sizeof\(de\)\)) 38.528 Tj
0 -31.4182 Td
(4821     panic\("unlink dir write"\);) 21.07 Tj
0 -32.7273 Td
(4822 ) 3.01 Tj
0 -34.0364 Td
(4823   iupdate\(dp\);) 11.438 Tj
0 -35.3454 Td
(4824   iput\(dp\);) 9.632 Tj
0 -36.6545 Td
(4825 ) 3.01 Tj
0 -37.9636 Td
(4826   ip = iget\(dev, inum\);) 16.856 Tj
0 -39.2727 Td
(4827 ) 3.01 Tj
0 -40.5818 Td
(4828   if\(ip->nlink < 1\)) 14.448 Tj
0 -41.8909 Td
(4829     panic\("unlink nlink < 1"\);) 21.07 Tj
0 -43.2 Td
(4830 ) 3.01 Tj
0 -44.5091 Td
(4831   ip->nlink--;) 11.438 Tj
0 -45.8182 Td
(4832 ) 3.01 Tj
0 -47.1272 Td
(4833   iupdate\(ip\);) 11.438 Tj
0 -48.4363 Td
(4834   iput\(ip\);) 9.632 Tj
0 -49.7454 Td
(4835 ) 3.01 Tj
0 -51.0545 Td
(4836   return 0;) 9.632 Tj
0 -52.3636 Td
(4837 }) 3.612 Tj
0 -53.6727 Td
(4838 ) 3.01 Tj
0 -54.9818 Td
(4839 ) 3.01 Tj
0 -56.2909 Td
(4840 ) 3.01 Tj
0 -57.6 Td
(4841 ) 3.01 Tj
0 -58.9091 Td
(4842 ) 3.01 Tj
0 -60.2181 Td
(4843 ) 3.01 Tj
0 -61.5272 Td
(4844 ) 3.01 Tj
0 -62.8363 Td
(4845 ) 3.01 Tj
0 -64.1454 Td
(4846 ) 3.01 Tj
0 -65.4545 Td
(4847 ) 3.01 Tj
0 -66.7636 Td
(4848 ) 3.01 Tj
0 -68.0727 Td
(4849 ) 3.01 Tj
0 -72 Td
(Sheet 48) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/fs.c  Page 17) 21.672 Tj
0 -3.92728 Td
(4850 // Create the path new as a link to the same inode as old.) 37.926 Tj
0 -5.23637 Td
(4851 int) 4.816 Tj
0 -6.54546 Td
(4852 link\(char *name1, char *name2\)) 21.07 Tj
0 -7.85455 Td
(4853 {) 3.612 Tj
0 -9.16364 Td
(4854   struct inode *ip, *dp;) 17.458 Tj
0 -10.4727 Td
(4855   char *last;) 10.836 Tj
0 -11.7818 Td
(4856 ) 3.01 Tj
0 -13.0909 Td
(4857   if\(\(ip = namei\(name1, NAMEI_LOOKUP, 0, 0, 0\)\) == 0\)) 34.916 Tj
0 -14.4 Td
(4858     return -1;) 11.438 Tj
0 -15.7091 Td
(4859   if\(ip->type == T_DIR\){) 17.458 Tj
0 -17.0182 Td
(4860     iput\(ip\);) 10.836 Tj
0 -18.3273 Td
(4861     return -1;) 11.438 Tj
0 -19.6364 Td
(4862   }) 4.816 Tj
0 -20.9455 Td
(4863 ) 3.01 Tj
0 -22.2545 Td
(4864   iunlock\(ip\);) 11.438 Tj
0 -23.5636 Td
(4865 ) 3.01 Tj
0 -24.8727 Td
(4866   if\(\(dp = namei\(name2, NAMEI_CREATE, 0, &last, 0\)\) == 0\) {) 38.528 Tj
0 -26.1818 Td
(4867     idecref\(ip\);) 12.642 Tj
0 -27.4909 Td
(4868     return -1;) 11.438 Tj
0 -28.8 Td
(4869   }) 4.816 Tj
0 -30.1091 Td
(4870   if\(dp->dev != ip->dev\){) 18.06 Tj
0 -31.4182 Td
(4871     idecref\(ip\);) 12.642 Tj
0 -32.7273 Td
(4872     iput\(dp\);) 10.836 Tj
0 -34.0364 Td
(4873     return -1;) 11.438 Tj
0 -35.3454 Td
(4874   }) 4.816 Tj
0 -36.6545 Td
(4875 ) 3.01 Tj
0 -37.9636 Td
(4876   ilock\(ip\);) 10.234 Tj
0 -39.2727 Td
(4877   ip->nlink++;) 11.438 Tj
0 -40.5818 Td
(4878   iupdate\(ip\);) 11.438 Tj
0 -41.8909 Td
(4879 ) 3.01 Tj
0 -43.2 Td
(4880   wdir\(dp, last, ip->inum\);) 19.264 Tj
0 -44.5091 Td
(4881   iput\(dp\);) 9.632 Tj
0 -45.8182 Td
(4882   iput\(ip\);) 9.632 Tj
0 -47.1272 Td
(4883 ) 3.01 Tj
0 -48.4363 Td
(4884   return 0;) 9.632 Tj
0 -49.7454 Td
(4885 }) 3.612 Tj
0 -51.0545 Td
(4886 ) 3.01 Tj
0 -52.3636 Td
(4887 ) 3.01 Tj
0 -53.6727 Td
(4888 ) 3.01 Tj
0 -54.9818 Td
(4889 ) 3.01 Tj
0 -56.2909 Td
(4890 ) 3.01 Tj
0 -57.6 Td
(4891 ) 3.01 Tj
0 -58.9091 Td
(4892 ) 3.01 Tj
0 -60.2181 Td
(4893 ) 3.01 Tj
0 -61.5272 Td
(4894 ) 3.01 Tj
0 -62.8363 Td
(4895 ) 3.01 Tj
0 -64.1454 Td
(4896 ) 3.01 Tj
0 -65.4545 Td
(4897 ) 3.01 Tj
0 -66.7636 Td
(4898 ) 3.01 Tj
0 -68.0727 Td
(4899 ) 3.01 Tj
0 -72 Td
(Sheet 48) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 56 56
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/file.c  Page 1) 22.274 Tj
0 -3.92728 Td
(4900 #include "types.h") 13.846 Tj
0 -5.23637 Td
(4901 #include "stat.h") 13.244 Tj
0 -6.54546 Td
(4902 #include "param.h") 13.846 Tj
0 -7.85455 Td
(4903 #include "x86.h") 12.642 Tj
0 -9.16364 Td
(4904 #include "mmu.h") 12.642 Tj
0 -10.4727 Td
(4905 #include "proc.h") 13.244 Tj
0 -11.7818 Td
(4906 #include "defs.h") 13.244 Tj
0 -13.0909 Td
(4907 #include "file.h") 13.244 Tj
0 -14.4 Td
(4908 #include "spinlock.h") 15.652 Tj
0 -15.7091 Td
(4909 #include "dev.h") 12.642 Tj
0 -17.0182 Td
(4910 #include "fs.h") 12.04 Tj
0 -18.3273 Td
(4911 #include "fsvar.h") 13.846 Tj
0 -19.6364 Td
(4912 ) 3.01 Tj
0 -20.9455 Td
(4913 struct spinlock file_table_lock;) 22.274 Tj
0 -22.2545 Td
(4914 struct devsw devsw[NDEV];) 18.06 Tj
0 -23.5636 Td
(4915 ) 3.01 Tj
0 -24.8727 Td
(4916 struct file file[NFILE];) 17.458 Tj
0 -26.1818 Td
(4917 ) 3.01 Tj
0 -27.4909 Td
(4918 void) 5.418 Tj
0 -28.8 Td
(4919 fileinit\(void\)) 11.438 Tj
0 -30.1091 Td
(4920 {) 3.612 Tj
0 -31.4182 Td
(4921   initlock\(&file_table_lock, "file_table"\);) 28.896 Tj
0 -32.7273 Td
(4922 }) 3.612 Tj
0 -34.0364 Td
(4923 ) 3.01 Tj
0 -35.3454 Td
(4924 // Allocate a file structure) 19.866 Tj
0 -36.6545 Td
(4925 struct file*) 10.234 Tj
0 -37.9636 Td
(4926 filealloc\(void\)) 12.04 Tj
0 -39.2727 Td
(4927 {) 3.612 Tj
0 -40.5818 Td
(4928   int i;) 7.826 Tj
0 -41.8909 Td
(4929 ) 3.01 Tj
0 -43.2 Td
(4930   acquire\(&file_table_lock\);) 19.866 Tj
0 -44.5091 Td
(4931   for\(i = 0; i < NFILE; i++\){) 20.468 Tj
0 -45.8182 Td
(4932     if\(file[i].type == FD_CLOSED\){) 23.478 Tj
0 -47.1272 Td
(4933       file[i].type = FD_NONE;) 20.468 Tj
0 -48.4363 Td
(4934       file[i].ref = 1;) 16.254 Tj
0 -49.7454 Td
(4935       release\(&file_table_lock\);) 22.274 Tj
0 -51.0545 Td
(4936       return file + i;) 16.254 Tj
0 -52.3636 Td
(4937     }) 6.02 Tj
0 -53.6727 Td
(4938   }) 4.816 Tj
0 -54.9818 Td
(4939   release\(&file_table_lock\);) 19.866 Tj
0 -56.2909 Td
(4940   return 0;) 9.632 Tj
0 -57.6 Td
(4941 }) 3.612 Tj
0 -58.9091 Td
(4942 ) 3.01 Tj
0 -60.2181 Td
(4943 ) 3.01 Tj
0 -61.5272 Td
(4944 ) 3.01 Tj
0 -62.8363 Td
(4945 ) 3.01 Tj
0 -64.1454 Td
(4946 ) 3.01 Tj
0 -65.4545 Td
(4947 ) 3.01 Tj
0 -66.7636 Td
(4948 ) 3.01 Tj
0 -68.0727 Td
(4949 ) 3.01 Tj
0 -72 Td
(Sheet 49) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/file.c  Page 2) 22.274 Tj
0 -3.92728 Td
(4950 // Write to file f.  Addr is kernel address.) 29.498 Tj
0 -5.23637 Td
(4951 int) 4.816 Tj
0 -6.54546 Td
(4952 filewrite\(struct file *f, char *addr, int n\)) 29.498 Tj
0 -7.85455 Td
(4953 {) 3.612 Tj
0 -9.16364 Td
(4954   if\(f->writable == 0\)) 16.254 Tj
0 -10.4727 Td
(4955     return -1;) 11.438 Tj
0 -11.7818 Td
(4956   if\(f->type == FD_PIPE\){) 18.06 Tj
0 -13.0909 Td
(4957     return pipe_write\(f->pipe, addr, n\);) 27.09 Tj
0 -14.4 Td
(4958   } else if\(f->type == FD_FILE\) {) 22.876 Tj
0 -15.7091 Td
(4959     ilock\(f->ip\);) 13.244 Tj
0 -17.0182 Td
(4960     int r = writei\(f->ip, addr, f->off, n\);) 28.896 Tj
0 -18.3273 Td
(4961     if\(r > 0\) {) 12.04 Tj
0 -19.6364 Td
(4962       f->off += r;) 13.846 Tj
0 -20.9455 Td
(4963     }) 6.02 Tj
0 -22.2545 Td
(4964     iunlock\(f->ip\);) 14.448 Tj
0 -23.5636 Td
(4965     return r;) 10.836 Tj
0 -24.8727 Td
(4966   } else {) 9.03 Tj
0 -26.1818 Td
(4967     panic\("filewrite"\);) 16.856 Tj
0 -27.4909 Td
(4968     return -1;) 11.438 Tj
0 -28.8 Td
(4969   }) 4.816 Tj
0 -30.1091 Td
(4970 }) 3.612 Tj
0 -31.4182 Td
(4971 ) 3.01 Tj
0 -32.7273 Td
(4972 // Read from file f.  Addr is kernel address.) 30.1 Tj
0 -34.0364 Td
(4973 int) 4.816 Tj
0 -35.3454 Td
(4974 fileread\(struct file *f, char *addr, int n\)) 28.896 Tj
0 -36.6545 Td
(4975 {) 3.612 Tj
0 -37.9636 Td
(4976   if\(f->readable == 0\)) 16.254 Tj
0 -39.2727 Td
(4977     return -1;) 11.438 Tj
0 -40.5818 Td
(4978   if\(f->type == FD_PIPE\){) 18.06 Tj
0 -41.8909 Td
(4979     return pipe_read\(f->pipe, addr, n\);) 26.488 Tj
0 -43.2 Td
(4980   } else if\(f->type == FD_FILE\){) 22.274 Tj
0 -44.5091 Td
(4981     ilock\(f->ip\);) 13.244 Tj
0 -45.8182 Td
(4982     int cc = readi\(f->ip, addr, f->off, n\);) 28.896 Tj
0 -47.1272 Td
(4983     if\(cc > 0\)) 11.438 Tj
0 -48.4363 Td
(4984       f->off += cc;) 14.448 Tj
0 -49.7454 Td
(4985     iunlock\(f->ip\);) 14.448 Tj
0 -51.0545 Td
(4986     return cc;) 11.438 Tj
0 -52.3636 Td
(4987   } else {) 9.03 Tj
0 -53.6727 Td
(4988     panic\("fileread"\);) 16.254 Tj
0 -54.9818 Td
(4989     return -1;) 11.438 Tj
0 -56.2909 Td
(4990   }) 4.816 Tj
0 -57.6 Td
(4991 }) 3.612 Tj
0 -58.9091 Td
(4992 ) 3.01 Tj
0 -60.2181 Td
(4993 ) 3.01 Tj
0 -61.5272 Td
(4994 ) 3.01 Tj
0 -62.8363 Td
(4995 ) 3.01 Tj
0 -64.1454 Td
(4996 ) 3.01 Tj
0 -65.4545 Td
(4997 ) 3.01 Tj
0 -66.7636 Td
(4998 ) 3.01 Tj
0 -68.0727 Td
(4999 ) 3.01 Tj
0 -72 Td
(Sheet 49) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 57 57
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/file.c  Page 3) 22.274 Tj
0 -3.92728 Td
(5000 // Close file f.  \(Decrement ref count, close when reaches 0.\)) 40.334 Tj
0 -5.23637 Td
(5001 void) 5.418 Tj
0 -6.54546 Td
(5002 fileclose\(struct file *f\)) 18.06 Tj
0 -7.85455 Td
(5003 {) 3.612 Tj
0 -9.16364 Td
(5004   acquire\(&file_table_lock\);) 19.866 Tj
0 -10.4727 Td
(5005 ) 3.01 Tj
0 -11.7818 Td
(5006   if\(f->ref < 1 || f->type == FD_CLOSED\)) 27.09 Tj
0 -13.0909 Td
(5007     panic\("fileclose"\);) 16.856 Tj
0 -14.4 Td
(5008 ) 3.01 Tj
0 -15.7091 Td
(5009   if\(--f->ref == 0\){) 15.05 Tj
0 -17.0182 Td
(5010     struct file dummy = *f;) 19.264 Tj
0 -18.3273 Td
(5011 ) 3.01 Tj
0 -19.6364 Td
(5012     f->ref = 0;) 12.04 Tj
0 -20.9455 Td
(5013     f->type = FD_CLOSED;) 17.458 Tj
0 -22.2545 Td
(5014     release\(&file_table_lock\);) 21.07 Tj
0 -23.5636 Td
(5015 ) 3.01 Tj
0 -24.8727 Td
(5016     if\(dummy.type == FD_PIPE\){) 21.07 Tj
0 -26.1818 Td
(5017       pipe_close\(dummy.pipe, dummy.writable\);) 30.1 Tj
0 -27.4909 Td
(5018     } else if\(dummy.type == FD_FILE\){) 25.284 Tj
0 -28.8 Td
(5019       idecref\(dummy.ip\);) 17.458 Tj
0 -30.1091 Td
(5020     } else {) 10.234 Tj
0 -31.4182 Td
(5021       panic\("fileclose"\);) 18.06 Tj
0 -32.7273 Td
(5022     }) 6.02 Tj
0 -34.0364 Td
(5023   } else {) 9.03 Tj
0 -35.3454 Td
(5024     release\(&file_table_lock\);) 21.07 Tj
0 -36.6545 Td
(5025   }) 4.816 Tj
0 -37.9636 Td
(5026 }) 3.612 Tj
0 -39.2727 Td
(5027 ) 3.01 Tj
0 -40.5818 Td
(5028 // Get metadata about file f.) 20.468 Tj
0 -41.8909 Td
(5029 int) 4.816 Tj
0 -43.2 Td
(5030 filestat\(struct file *f, struct stat *st\)) 27.692 Tj
0 -44.5091 Td
(5031 {) 3.612 Tj
0 -45.8182 Td
(5032   if\(f->type == FD_FILE\){) 18.06 Tj
0 -47.1272 Td
(5033     ilock\(f->ip\);) 13.244 Tj
0 -48.4363 Td
(5034     stati\(f->ip, st\);) 15.652 Tj
0 -49.7454 Td
(5035     iunlock\(f->ip\);) 14.448 Tj
0 -51.0545 Td
(5036     return 0;) 10.836 Tj
0 -52.3636 Td
(5037   } else) 7.826 Tj
0 -53.6727 Td
(5038     return -1;) 11.438 Tj
0 -54.9818 Td
(5039 }) 3.612 Tj
0 -56.2909 Td
(5040 ) 3.01 Tj
0 -57.6 Td
(5041 ) 3.01 Tj
0 -58.9091 Td
(5042 ) 3.01 Tj
0 -60.2181 Td
(5043 ) 3.01 Tj
0 -61.5272 Td
(5044 ) 3.01 Tj
0 -62.8363 Td
(5045 ) 3.01 Tj
0 -64.1454 Td
(5046 ) 3.01 Tj
0 -65.4545 Td
(5047 ) 3.01 Tj
0 -66.7636 Td
(5048 ) 3.01 Tj
0 -68.0727 Td
(5049 ) 3.01 Tj
0 -72 Td
(Sheet 50) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/file.c  Page 4) 22.274 Tj
0 -3.92728 Td
(5050 // Increment ref count for file f.) 23.478 Tj
0 -5.23637 Td
(5051 void) 5.418 Tj
0 -6.54546 Td
(5052 fileincref\(struct file *f\)) 18.662 Tj
0 -7.85455 Td
(5053 {) 3.612 Tj
0 -9.16364 Td
(5054   acquire\(&file_table_lock\);) 19.866 Tj
0 -10.4727 Td
(5055   if\(f->ref < 1 || f->type == FD_CLOSED\)) 27.09 Tj
0 -11.7818 Td
(5056     panic\("fileincref"\);) 17.458 Tj
0 -13.0909 Td
(5057   f->ref++;) 9.632 Tj
0 -14.4 Td
(5058   release\(&file_table_lock\);) 19.866 Tj
0 -15.7091 Td
(5059 }) 3.612 Tj
0 -17.0182 Td
(5060 ) 3.01 Tj
0 -18.3273 Td
(5061 ) 3.01 Tj
0 -19.6364 Td
(5062 ) 3.01 Tj
0 -20.9455 Td
(5063 ) 3.01 Tj
0 -22.2545 Td
(5064 ) 3.01 Tj
0 -23.5636 Td
(5065 ) 3.01 Tj
0 -24.8727 Td
(5066 ) 3.01 Tj
0 -26.1818 Td
(5067 ) 3.01 Tj
0 -27.4909 Td
(5068 ) 3.01 Tj
0 -28.8 Td
(5069 ) 3.01 Tj
0 -30.1091 Td
(5070 ) 3.01 Tj
0 -31.4182 Td
(5071 ) 3.01 Tj
0 -32.7273 Td
(5072 ) 3.01 Tj
0 -34.0364 Td
(5073 ) 3.01 Tj
0 -35.3454 Td
(5074 ) 3.01 Tj
0 -36.6545 Td
(5075 ) 3.01 Tj
0 -37.9636 Td
(5076 ) 3.01 Tj
0 -39.2727 Td
(5077 ) 3.01 Tj
0 -40.5818 Td
(5078 ) 3.01 Tj
0 -41.8909 Td
(5079 ) 3.01 Tj
0 -43.2 Td
(5080 ) 3.01 Tj
0 -44.5091 Td
(5081 ) 3.01 Tj
0 -45.8182 Td
(5082 ) 3.01 Tj
0 -47.1272 Td
(5083 ) 3.01 Tj
0 -48.4363 Td
(5084 ) 3.01 Tj
0 -49.7454 Td
(5085 ) 3.01 Tj
0 -51.0545 Td
(5086 ) 3.01 Tj
0 -52.3636 Td
(5087 ) 3.01 Tj
0 -53.6727 Td
(5088 ) 3.01 Tj
0 -54.9818 Td
(5089 ) 3.01 Tj
0 -56.2909 Td
(5090 ) 3.01 Tj
0 -57.6 Td
(5091 ) 3.01 Tj
0 -58.9091 Td
(5092 ) 3.01 Tj
0 -60.2181 Td
(5093 ) 3.01 Tj
0 -61.5272 Td
(5094 ) 3.01 Tj
0 -62.8363 Td
(5095 ) 3.01 Tj
0 -64.1454 Td
(5096 ) 3.01 Tj
0 -65.4545 Td
(5097 ) 3.01 Tj
0 -66.7636 Td
(5098 ) 3.01 Tj
0 -68.0727 Td
(5099 ) 3.01 Tj
0 -72 Td
(Sheet 50) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 58 58
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/sysfile.c  Page 1) 24.08 Tj
0 -3.92728 Td
(5100 #include "types.h") 13.846 Tj
0 -5.23637 Td
(5101 #include "stat.h") 13.244 Tj
0 -6.54546 Td
(5102 #include "param.h") 13.846 Tj
0 -7.85455 Td
(5103 #include "mmu.h") 12.642 Tj
0 -9.16364 Td
(5104 #include "proc.h") 13.244 Tj
0 -10.4727 Td
(5105 #include "defs.h") 13.244 Tj
0 -11.7818 Td
(5106 #include "x86.h") 12.642 Tj
0 -13.0909 Td
(5107 #include "traps.h") 13.846 Tj
0 -14.4 Td
(5108 #include "syscall.h") 15.05 Tj
0 -15.7091 Td
(5109 #include "spinlock.h") 15.652 Tj
0 -17.0182 Td
(5110 #include "buf.h") 12.642 Tj
0 -18.3273 Td
(5111 #include "fs.h") 12.04 Tj
0 -19.6364 Td
(5112 #include "fsvar.h") 13.846 Tj
0 -20.9455 Td
(5113 #include "elf.h") 12.642 Tj
0 -22.2545 Td
(5114 #include "file.h") 13.244 Tj
0 -23.5636 Td
(5115 #include "fcntl.h") 13.846 Tj
0 -24.8727 Td
(5116 ) 3.01 Tj
0 -26.1818 Td
(5117 // Fetch the nth word-sized system call argument as a file descriptor) 44.548 Tj
0 -27.4909 Td
(5118 // and return both the descriptor and the corresponding struct file.) 43.946 Tj
0 -28.8 Td
(5119 static int) 9.03 Tj
0 -30.1091 Td
(5120 argfd\(int argno, int *pfd, struct file **pf\)) 29.498 Tj
0 -31.4182 Td
(5121 {) 3.612 Tj
0 -32.7273 Td
(5122   int fd;) 8.428 Tj
0 -34.0364 Td
(5123   struct file *f;) 13.244 Tj
0 -35.3454 Td
(5124   struct proc *p = curproc[cpu\(\)];) 23.478 Tj
0 -36.6545 Td
(5125 ) 3.01 Tj
0 -37.9636 Td
(5126   if\(argint\(argno, &fd\) < 0\)) 19.866 Tj
0 -39.2727 Td
(5127     return -1;) 11.438 Tj
0 -40.5818 Td
(5128   if\(fd < 0 || fd >= NOFILE || \(f=p->ofile[fd]\) == 0\)) 34.916 Tj
0 -41.8909 Td
(5129     return -1;) 11.438 Tj
0 -43.2 Td
(5130   if\(pfd\)) 8.428 Tj
0 -44.5091 Td
(5131     *pfd = fd;) 11.438 Tj
0 -45.8182 Td
(5132   if\(pf\)) 7.826 Tj
0 -47.1272 Td
(5133     *pf = f;) 10.234 Tj
0 -48.4363 Td
(5134   return 0;) 9.632 Tj
0 -49.7454 Td
(5135 }) 3.612 Tj
0 -51.0545 Td
(5136 ) 3.01 Tj
0 -52.3636 Td
(5137 ) 3.01 Tj
0 -53.6727 Td
(5138 ) 3.01 Tj
0 -54.9818 Td
(5139 ) 3.01 Tj
0 -56.2909 Td
(5140 ) 3.01 Tj
0 -57.6 Td
(5141 ) 3.01 Tj
0 -58.9091 Td
(5142 ) 3.01 Tj
0 -60.2181 Td
(5143 ) 3.01 Tj
0 -61.5272 Td
(5144 ) 3.01 Tj
0 -62.8363 Td
(5145 ) 3.01 Tj
0 -64.1454 Td
(5146 ) 3.01 Tj
0 -65.4545 Td
(5147 ) 3.01 Tj
0 -66.7636 Td
(5148 ) 3.01 Tj
0 -68.0727 Td
(5149 ) 3.01 Tj
0 -72 Td
(Sheet 51) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/sysfile.c  Page 2) 24.08 Tj
0 -3.92728 Td
(5150 // Allocate a file descriptor for the given file.) 32.508 Tj
0 -5.23637 Td
(5151 // Takes over file reference from caller on success.) 34.314 Tj
0 -6.54546 Td
(5152 static int) 9.03 Tj
0 -7.85455 Td
(5153 fdalloc\(struct file *f\)) 16.856 Tj
0 -9.16364 Td
(5154 {) 3.612 Tj
0 -10.4727 Td
(5155   int fd;) 8.428 Tj
0 -11.7818 Td
(5156   struct proc *p = curproc[cpu\(\)];) 23.478 Tj
0 -13.0909 Td
(5157   for\(fd = 0; fd < NOFILE; fd++\){) 22.876 Tj
0 -14.4 Td
(5158     if\(p->ofile[fd] == 0\){) 18.662 Tj
0 -15.7091 Td
(5159       p->ofile[fd] = f;) 16.856 Tj
0 -17.0182 Td
(5160       return fd;) 12.642 Tj
0 -18.3273 Td
(5161     }) 6.02 Tj
0 -19.6364 Td
(5162   }) 4.816 Tj
0 -20.9455 Td
(5163   return -1;) 10.234 Tj
0 -22.2545 Td
(5164 }) 3.612 Tj
0 -23.5636 Td
(5165 ) 3.01 Tj
0 -24.8727 Td
(5166 int) 4.816 Tj
0 -26.1818 Td
(5167 sys_pipe\(void\)) 11.438 Tj
0 -27.4909 Td
(5168 {) 3.612 Tj
0 -28.8 Td
(5169   int *fd;) 9.03 Tj
0 -30.1091 Td
(5170   struct file *rf = 0, *wf = 0;) 21.672 Tj
0 -31.4182 Td
(5171   int fd0, fd1;) 12.04 Tj
0 -32.7273 Td
(5172   struct proc *p = curproc[cpu\(\)];) 23.478 Tj
0 -34.0364 Td
(5173 ) 3.01 Tj
0 -35.3454 Td
(5174   if\(argptr\(0, \(void*\)&fd, 2*sizeof fd[0]\) < 0\)) 31.304 Tj
0 -36.6545 Td
(5175     return -1;) 11.438 Tj
0 -37.9636 Td
(5176   if\(pipe_alloc\(&rf, &wf\) < 0\)) 21.07 Tj
0 -39.2727 Td
(5177     return -1;) 11.438 Tj
0 -40.5818 Td
(5178   fd0 = -1;) 9.632 Tj
0 -41.8909 Td
(5179   if\(\(fd0 = fdalloc\(rf\)\) < 0 || \(fd1 = fdalloc\(wf\)\) < 0\){) 37.324 Tj
0 -43.2 Td
(5180     if\(fd0 >= 0\)) 12.642 Tj
0 -44.5091 Td
(5181       p->ofile[fd0] = 0;) 17.458 Tj
0 -45.8182 Td
(5182     fileclose\(rf\);) 13.846 Tj
0 -47.1272 Td
(5183     fileclose\(wf\);) 13.846 Tj
0 -48.4363 Td
(5184     return -1;) 11.438 Tj
0 -49.7454 Td
(5185   }) 4.816 Tj
0 -51.0545 Td
(5186   fd[0] = fd0;) 11.438 Tj
0 -52.3636 Td
(5187   fd[1] = fd1;) 11.438 Tj
0 -53.6727 Td
(5188   return 0;) 9.632 Tj
0 -54.9818 Td
(5189 }) 3.612 Tj
0 -56.2909 Td
(5190 ) 3.01 Tj
0 -57.6 Td
(5191 ) 3.01 Tj
0 -58.9091 Td
(5192 ) 3.01 Tj
0 -60.2181 Td
(5193 ) 3.01 Tj
0 -61.5272 Td
(5194 ) 3.01 Tj
0 -62.8363 Td
(5195 ) 3.01 Tj
0 -64.1454 Td
(5196 ) 3.01 Tj
0 -65.4545 Td
(5197 ) 3.01 Tj
0 -66.7636 Td
(5198 ) 3.01 Tj
0 -68.0727 Td
(5199 ) 3.01 Tj
0 -72 Td
(Sheet 51) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 59 59
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/sysfile.c  Page 3) 24.08 Tj
0 -3.92728 Td
(5200 int) 4.816 Tj
0 -5.23637 Td
(5201 sys_write\(void\)) 12.04 Tj
0 -6.54546 Td
(5202 {) 3.612 Tj
0 -7.85455 Td
(5203   struct file *f;) 13.244 Tj
0 -9.16364 Td
(5204   int n;) 7.826 Tj
0 -10.4727 Td
(5205   char *cp;) 9.632 Tj
0 -11.7818 Td
(5206 ) 3.01 Tj
0 -13.0909 Td
(5207   if\(argfd\(0, 0, &f\) < 0 || argint\(2, &n\) < 0 || argptr\(1, &cp, n\) < 0\)) 45.752 Tj
0 -14.4 Td
(5208     return -1;) 11.438 Tj
0 -15.7091 Td
(5209   return filewrite\(f, cp, n\);) 20.468 Tj
0 -17.0182 Td
(5210 }) 3.612 Tj
0 -18.3273 Td
(5211 ) 3.01 Tj
0 -19.6364 Td
(5212 int) 4.816 Tj
0 -20.9455 Td
(5213 sys_read\(void\)) 11.438 Tj
0 -22.2545 Td
(5214 {) 3.612 Tj
0 -23.5636 Td
(5215   struct file *f;) 13.244 Tj
0 -24.8727 Td
(5216   int n;) 7.826 Tj
0 -26.1818 Td
(5217   char *cp;) 9.632 Tj
0 -27.4909 Td
(5218 ) 3.01 Tj
0 -28.8 Td
(5219   if\(argfd\(0, 0, &f\) < 0 || argint\(2, &n\) < 0 || argptr\(1, &cp, n\) < 0\)) 45.752 Tj
0 -30.1091 Td
(5220     return -1;) 11.438 Tj
0 -31.4182 Td
(5221   return fileread\(f, cp, n\);) 19.866 Tj
0 -32.7273 Td
(5222 }) 3.612 Tj
0 -34.0364 Td
(5223 ) 3.01 Tj
0 -35.3454 Td
(5224 int) 4.816 Tj
0 -36.6545 Td
(5225 sys_close\(void\)) 12.04 Tj
0 -37.9636 Td
(5226 {) 3.612 Tj
0 -39.2727 Td
(5227   int fd;) 8.428 Tj
0 -40.5818 Td
(5228   struct file *f;) 13.244 Tj
0 -41.8909 Td
(5229 ) 3.01 Tj
0 -43.2 Td
(5230   if\(argfd\(0, &fd, &f\) < 0\)) 19.264 Tj
0 -44.5091 Td
(5231     return -1;) 11.438 Tj
0 -45.8182 Td
(5232   curproc[cpu\(\)]->ofile[fd] = 0;) 22.274 Tj
0 -47.1272 Td
(5233   fileclose\(f\);) 12.04 Tj
0 -48.4363 Td
(5234   return 0;) 9.632 Tj
0 -49.7454 Td
(5235 }) 3.612 Tj
0 -51.0545 Td
(5236 ) 3.01 Tj
0 -52.3636 Td
(5237 ) 3.01 Tj
0 -53.6727 Td
(5238 ) 3.01 Tj
0 -54.9818 Td
(5239 ) 3.01 Tj
0 -56.2909 Td
(5240 ) 3.01 Tj
0 -57.6 Td
(5241 ) 3.01 Tj
0 -58.9091 Td
(5242 ) 3.01 Tj
0 -60.2181 Td
(5243 ) 3.01 Tj
0 -61.5272 Td
(5244 ) 3.01 Tj
0 -62.8363 Td
(5245 ) 3.01 Tj
0 -64.1454 Td
(5246 ) 3.01 Tj
0 -65.4545 Td
(5247 ) 3.01 Tj
0 -66.7636 Td
(5248 ) 3.01 Tj
0 -68.0727 Td
(5249 ) 3.01 Tj
0 -72 Td
(Sheet 52) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/sysfile.c  Page 4) 24.08 Tj
0 -3.92728 Td
(5250 int) 4.816 Tj
0 -5.23637 Td
(5251 sys_open\(void\)) 11.438 Tj
0 -6.54546 Td
(5252 {) 3.612 Tj
0 -7.85455 Td
(5253   struct inode *ip, *dp;) 17.458 Tj
0 -9.16364 Td
(5254   char *path;) 10.836 Tj
0 -10.4727 Td
(5255   int omode;) 10.234 Tj
0 -11.7818 Td
(5256   int fd;) 8.428 Tj
0 -13.0909 Td
(5257   struct file *f;) 13.244 Tj
0 -14.4 Td
(5258   char *last;) 10.836 Tj
0 -15.7091 Td
(5259 ) 3.01 Tj
0 -17.0182 Td
(5260   if\(argstr\(0, &path\) < 0 || argint\(1, &omode\) < 0\)) 33.712 Tj
0 -18.3273 Td
(5261     return -1;) 11.438 Tj
0 -19.6364 Td
(5262 ) 3.01 Tj
0 -20.9455 Td
(5263   if\(omode & O_CREATE\){) 16.856 Tj
0 -22.2545 Td
(5264     dp = namei\(path, NAMEI_CREATE, 0, &last, &ip\);) 33.11 Tj
0 -23.5636 Td
(5265     if\(dp\){) 9.632 Tj
0 -24.8727 Td
(5266       ip = mknod1\(dp, last, T_FILE, 0, 0\);) 28.294 Tj
0 -26.1818 Td
(5267       iput\(dp\);) 12.04 Tj
0 -27.4909 Td
(5268       if\(ip == 0\)) 13.244 Tj
0 -28.8 Td
(5269         return -1;) 13.846 Tj
0 -30.1091 Td
(5270     } else if\(ip == 0\){) 16.856 Tj
0 -31.4182 Td
(5271       return -1;) 12.642 Tj
0 -32.7273 Td
(5272     } else if\(ip->type == T_DIR\){) 22.876 Tj
0 -34.0364 Td
(5273       iput\(ip\);) 12.04 Tj
0 -35.3454 Td
(5274       return -1;) 12.642 Tj
0 -36.6545 Td
(5275     }) 6.02 Tj
0 -37.9636 Td
(5276   } else {) 9.03 Tj
0 -39.2727 Td
(5277     ip = namei\(path, NAMEI_LOOKUP, 0, 0, 0\);) 29.498 Tj
0 -40.5818 Td
(5278     if\(ip == 0\)) 12.04 Tj
0 -41.8909 Td
(5279       return -1;) 12.642 Tj
0 -43.2 Td
(5280   }) 4.816 Tj
0 -44.5091 Td
(5281   if\(ip->type == T_DIR && \(\(omode & O_RDWR\) || \(omode & O_WRONLY\)\)\){) 43.946 Tj
0 -45.8182 Td
(5282     iput\(ip\);) 10.836 Tj
0 -47.1272 Td
(5283     return -1;) 11.438 Tj
0 -48.4363 Td
(5284   }) 4.816 Tj
0 -49.7454 Td
(5285 ) 3.01 Tj
0 -51.0545 Td
(5286   if\(\(f = filealloc\(\)\) == 0\){) 20.468 Tj
0 -52.3636 Td
(5287     iput\(ip\);) 10.836 Tj
0 -53.6727 Td
(5288     return -1;) 11.438 Tj
0 -54.9818 Td
(5289   }) 4.816 Tj
0 -56.2909 Td
(5290   if\(\(fd = fdalloc\(f\)\) < 0\){) 19.866 Tj
0 -57.6 Td
(5291     iput\(ip\);) 10.836 Tj
0 -58.9091 Td
(5292     fileclose\(f\);) 13.244 Tj
0 -60.2181 Td
(5293     return -1;) 11.438 Tj
0 -61.5272 Td
(5294   }) 4.816 Tj
0 -62.8363 Td
(5295 ) 3.01 Tj
0 -64.1454 Td
(5296 ) 3.01 Tj
0 -65.4545 Td
(5297 ) 3.01 Tj
0 -66.7636 Td
(5298 ) 3.01 Tj
0 -68.0727 Td
(5299 ) 3.01 Tj
0 -72 Td
(Sheet 52) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 60 60
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/sysfile.c  Page 5) 24.08 Tj
0 -3.92728 Td
(5300   iunlock\(ip\);) 11.438 Tj
0 -5.23637 Td
(5301   f->type = FD_FILE;) 15.05 Tj
0 -6.54546 Td
(5302   if\(omode & O_RDWR\) {) 16.254 Tj
0 -7.85455 Td
(5303     f->readable = 1;) 15.05 Tj
0 -9.16364 Td
(5304     f->writable = 1;) 15.05 Tj
0 -10.4727 Td
(5305   } else if\(omode & O_WRONLY\) {) 21.672 Tj
0 -11.7818 Td
(5306     f->readable = 0;) 15.05 Tj
0 -13.0909 Td
(5307     f->writable = 1;) 15.05 Tj
0 -14.4 Td
(5308   } else {) 9.03 Tj
0 -15.7091 Td
(5309     f->readable = 1;) 15.05 Tj
0 -17.0182 Td
(5310     f->writable = 0;) 15.05 Tj
0 -18.3273 Td
(5311   }) 4.816 Tj
0 -19.6364 Td
(5312   f->ip = ip;) 10.836 Tj
0 -20.9455 Td
(5313   f->off = 0;) 10.836 Tj
0 -22.2545 Td
(5314 ) 3.01 Tj
0 -23.5636 Td
(5315   return fd;) 10.234 Tj
0 -24.8727 Td
(5316 }) 3.612 Tj
0 -26.1818 Td
(5317 ) 3.01 Tj
0 -27.4909 Td
(5318 int) 4.816 Tj
0 -28.8 Td
(5319 sys_mknod\(void\)) 12.04 Tj
0 -30.1091 Td
(5320 {) 3.612 Tj
0 -31.4182 Td
(5321   struct inode *nip;) 15.05 Tj
0 -32.7273 Td
(5322   char *path;) 10.836 Tj
0 -34.0364 Td
(5323   int len;) 9.03 Tj
0 -35.3454 Td
(5324   int type, major, minor;) 18.06 Tj
0 -36.6545 Td
(5325 ) 3.01 Tj
0 -37.9636 Td
(5326   if\(\(len=argstr\(0, &path\)\) < 0 || argint\(1, &type\) < 0 ||) 37.926 Tj
0 -39.2727 Td
(5327      argint\(2, &major\) < 0 || argint\(3, &minor\) < 0\)) 34.314 Tj
0 -40.5818 Td
(5328     return -1;) 11.438 Tj
0 -41.8909 Td
(5329 ) 3.01 Tj
0 -43.2 Td
(5330   if\(len >= DIRSIZ\)) 14.448 Tj
0 -44.5091 Td
(5331     return -1;) 11.438 Tj
0 -45.8182 Td
(5332 ) 3.01 Tj
0 -47.1272 Td
(5333   if\(\(nip = mknod\(path, type, major, minor\)\) == 0\)) 33.11 Tj
0 -48.4363 Td
(5334     return -1;) 11.438 Tj
0 -49.7454 Td
(5335   iput\(nip\);) 10.234 Tj
0 -51.0545 Td
(5336   return 0;) 9.632 Tj
0 -52.3636 Td
(5337 }) 3.612 Tj
0 -53.6727 Td
(5338 ) 3.01 Tj
0 -54.9818 Td
(5339 ) 3.01 Tj
0 -56.2909 Td
(5340 ) 3.01 Tj
0 -57.6 Td
(5341 ) 3.01 Tj
0 -58.9091 Td
(5342 ) 3.01 Tj
0 -60.2181 Td
(5343 ) 3.01 Tj
0 -61.5272 Td
(5344 ) 3.01 Tj
0 -62.8363 Td
(5345 ) 3.01 Tj
0 -64.1454 Td
(5346 ) 3.01 Tj
0 -65.4545 Td
(5347 ) 3.01 Tj
0 -66.7636 Td
(5348 ) 3.01 Tj
0 -68.0727 Td
(5349 ) 3.01 Tj
0 -72 Td
(Sheet 53) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/sysfile.c  Page 6) 24.08 Tj
0 -3.92728 Td
(5350 int) 4.816 Tj
0 -5.23637 Td
(5351 sys_mkdir\(void\)) 12.04 Tj
0 -6.54546 Td
(5352 {) 3.612 Tj
0 -7.85455 Td
(5353   struct inode *nip;) 15.05 Tj
0 -9.16364 Td
(5354   struct inode *dp;) 14.448 Tj
0 -10.4727 Td
(5355   char *path;) 10.836 Tj
0 -11.7818 Td
(5356   struct dirent de;) 14.448 Tj
0 -13.0909 Td
(5357   char *last;) 10.836 Tj
0 -14.4 Td
(5358 ) 3.01 Tj
0 -15.7091 Td
(5359   if\(argstr\(0, &path\) < 0\)) 18.662 Tj
0 -17.0182 Td
(5360     return -1;) 11.438 Tj
0 -18.3273 Td
(5361 ) 3.01 Tj
0 -19.6364 Td
(5362   dp = namei\(path, NAMEI_CREATE, 0, &last, 0\);) 30.702 Tj
0 -20.9455 Td
(5363   if\(dp == 0\)) 10.836 Tj
0 -22.2545 Td
(5364     return -1;) 11.438 Tj
0 -23.5636 Td
(5365 ) 3.01 Tj
0 -24.8727 Td
(5366   nip = mknod1\(dp, last, T_DIR, 0, 0\);) 25.886 Tj
0 -26.1818 Td
(5367   if\(nip == 0\){) 12.04 Tj
0 -27.4909 Td
(5368     iput\(dp\);) 10.836 Tj
0 -28.8 Td
(5369     return -1;) 11.438 Tj
0 -30.1091 Td
(5370   }) 4.816 Tj
0 -31.4182 Td
(5371 ) 3.01 Tj
0 -32.7273 Td
(5372   dp->nlink++;) 11.438 Tj
0 -34.0364 Td
(5373   iupdate\(dp\);) 11.438 Tj
0 -35.3454 Td
(5374 ) 3.01 Tj
0 -36.6545 Td
(5375   memset\(de.name, '\\0', DIRSIZ\);) 22.274 Tj
0 -37.9636 Td
(5376   de.name[0] = '.';) 14.448 Tj
0 -39.2727 Td
(5377   de.inum = nip->inum;) 16.254 Tj
0 -40.5818 Td
(5378   writei\(nip, \(char*\) &de, 0, sizeof\(de\)\);) 28.294 Tj
0 -41.8909 Td
(5379 ) 3.01 Tj
0 -43.2 Td
(5380   de.inum = dp->inum;) 15.652 Tj
0 -44.5091 Td
(5381   de.name[1] = '.';) 14.448 Tj
0 -45.8182 Td
(5382   writei\(nip, \(char*\) &de, sizeof\(de\), sizeof\(de\)\);) 33.712 Tj
0 -47.1272 Td
(5383 ) 3.01 Tj
0 -48.4363 Td
(5384   iput\(dp\);) 9.632 Tj
0 -49.7454 Td
(5385   iput\(nip\);) 10.234 Tj
0 -51.0545 Td
(5386 ) 3.01 Tj
0 -52.3636 Td
(5387   return 0;) 9.632 Tj
0 -53.6727 Td
(5388 }) 3.612 Tj
0 -54.9818 Td
(5389 ) 3.01 Tj
0 -56.2909 Td
(5390 ) 3.01 Tj
0 -57.6 Td
(5391 ) 3.01 Tj
0 -58.9091 Td
(5392 ) 3.01 Tj
0 -60.2181 Td
(5393 ) 3.01 Tj
0 -61.5272 Td
(5394 ) 3.01 Tj
0 -62.8363 Td
(5395 ) 3.01 Tj
0 -64.1454 Td
(5396 ) 3.01 Tj
0 -65.4545 Td
(5397 ) 3.01 Tj
0 -66.7636 Td
(5398 ) 3.01 Tj
0 -68.0727 Td
(5399 ) 3.01 Tj
0 -72 Td
(Sheet 53) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 61 61
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/sysfile.c  Page 7) 24.08 Tj
0 -3.92728 Td
(5400 int) 4.816 Tj
0 -5.23637 Td
(5401 sys_chdir\(void\)) 12.04 Tj
0 -6.54546 Td
(5402 {) 3.612 Tj
0 -7.85455 Td
(5403   struct proc *p = curproc[cpu\(\)];) 23.478 Tj
0 -9.16364 Td
(5404   struct inode *ip;) 14.448 Tj
0 -10.4727 Td
(5405   char *path;) 10.836 Tj
0 -11.7818 Td
(5406 ) 3.01 Tj
0 -13.0909 Td
(5407   if\(argstr\(0, &path\) < 0\)) 18.662 Tj
0 -14.4 Td
(5408     return -1;) 11.438 Tj
0 -15.7091 Td
(5409 ) 3.01 Tj
0 -17.0182 Td
(5410   if\(\(ip = namei\(path, NAMEI_LOOKUP, 0, 0, 0\)\) == 0\)) 34.314 Tj
0 -18.3273 Td
(5411     return -1;) 11.438 Tj
0 -19.6364 Td
(5412 ) 3.01 Tj
0 -20.9455 Td
(5413   if\(ip == p->cwd\) {) 15.05 Tj
0 -22.2545 Td
(5414     iput\(ip\);) 10.836 Tj
0 -23.5636 Td
(5415     return 0;) 10.836 Tj
0 -24.8727 Td
(5416   }) 4.816 Tj
0 -26.1818 Td
(5417 ) 3.01 Tj
0 -27.4909 Td
(5418   if\(ip->type != T_DIR\) {) 18.06 Tj
0 -28.8 Td
(5419     iput\(ip\);) 10.836 Tj
0 -30.1091 Td
(5420     return -1;) 11.438 Tj
0 -31.4182 Td
(5421   }) 4.816 Tj
0 -32.7273 Td
(5422 ) 3.01 Tj
0 -34.0364 Td
(5423   idecref\(p->cwd\);) 13.846 Tj
0 -35.3454 Td
(5424   p->cwd = ip;) 11.438 Tj
0 -36.6545 Td
(5425   iunlock\(p->cwd\);) 13.846 Tj
0 -37.9636 Td
(5426   return 0;) 9.632 Tj
0 -39.2727 Td
(5427 }) 3.612 Tj
0 -40.5818 Td
(5428 ) 3.01 Tj
0 -41.8909 Td
(5429 int) 4.816 Tj
0 -43.2 Td
(5430 sys_unlink\(void\)) 12.642 Tj
0 -44.5091 Td
(5431 {) 3.612 Tj
0 -45.8182 Td
(5432   char *path;) 10.836 Tj
0 -47.1272 Td
(5433 ) 3.01 Tj
0 -48.4363 Td
(5434   if\(argstr\(0, &path\) < 0\)) 18.662 Tj
0 -49.7454 Td
(5435     return -1;) 11.438 Tj
0 -51.0545 Td
(5436   return unlink\(path\);) 16.254 Tj
0 -52.3636 Td
(5437 }) 3.612 Tj
0 -53.6727 Td
(5438 ) 3.01 Tj
0 -54.9818 Td
(5439 int) 4.816 Tj
0 -56.2909 Td
(5440 sys_fstat\(void\)) 12.04 Tj
0 -57.6 Td
(5441 {) 3.612 Tj
0 -58.9091 Td
(5442   struct file *f;) 13.244 Tj
0 -60.2181 Td
(5443   struct stat *st;) 13.846 Tj
0 -61.5272 Td
(5444 ) 3.01 Tj
0 -62.8363 Td
(5445   if\(argfd\(0, 0, &f\) < 0 || argptr\(1, \(void*\)&st, sizeof *st\) < 0\)) 42.742 Tj
0 -64.1454 Td
(5446     return -1;) 11.438 Tj
0 -65.4545 Td
(5447   return filestat\(f, st\);) 18.06 Tj
0 -66.7636 Td
(5448 }) 3.612 Tj
0 -68.0727 Td
(5449 ) 3.01 Tj
0 -72 Td
(Sheet 54) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/sysfile.c  Page 8) 24.08 Tj
0 -3.92728 Td
(5450 int) 4.816 Tj
0 -5.23637 Td
(5451 sys_dup\(void\)) 10.836 Tj
0 -6.54546 Td
(5452 {) 3.612 Tj
0 -7.85455 Td
(5453   struct file *f;) 13.244 Tj
0 -9.16364 Td
(5454   int fd;) 8.428 Tj
0 -10.4727 Td
(5455 ) 3.01 Tj
0 -11.7818 Td
(5456   if\(argfd\(0, 0, &f\) < 0\)) 18.06 Tj
0 -13.0909 Td
(5457     return -1;) 11.438 Tj
0 -14.4 Td
(5458   if\(\(fd=fdalloc\(f\)\) < 0\)) 18.06 Tj
0 -15.7091 Td
(5459     return -1;) 11.438 Tj
0 -17.0182 Td
(5460   fileincref\(f\);) 12.642 Tj
0 -18.3273 Td
(5461   return fd;) 10.234 Tj
0 -19.6364 Td
(5462 }) 3.612 Tj
0 -20.9455 Td
(5463 ) 3.01 Tj
0 -22.2545 Td
(5464 int) 4.816 Tj
0 -23.5636 Td
(5465 sys_link\(void\)) 11.438 Tj
0 -24.8727 Td
(5466 {) 3.612 Tj
0 -26.1818 Td
(5467   char *old, *new;) 13.846 Tj
0 -27.4909 Td
(5468 ) 3.01 Tj
0 -28.8 Td
(5469   if\(argstr\(0, &old\) < 0 || argstr\(1, &new\) < 0\)) 31.906 Tj
0 -30.1091 Td
(5470     return -1;) 11.438 Tj
0 -31.4182 Td
(5471   return link\(old, new\);) 17.458 Tj
0 -32.7273 Td
(5472 }) 3.612 Tj
0 -34.0364 Td
(5473 ) 3.01 Tj
0 -35.3454 Td
(5474 int) 4.816 Tj
0 -36.6545 Td
(5475 sys_exec\(void\)) 11.438 Tj
0 -37.9636 Td
(5476 {) 3.612 Tj
0 -39.2727 Td
(5477   struct proc *cp = curproc[cpu\(\)];) 24.08 Tj
0 -40.5818 Td
(5478   uint sz=0, ap, sp, p1, p2;) 19.866 Tj
0 -41.8909 Td
(5479   int i, nargs, argbytes, len;) 21.07 Tj
0 -43.2 Td
(5480   struct inode *ip;) 14.448 Tj
0 -44.5091 Td
(5481   struct elfhdr elf;) 15.05 Tj
0 -45.8182 Td
(5482   struct proghdr ph;) 15.05 Tj
0 -47.1272 Td
(5483   char *mem = 0;) 12.642 Tj
0 -48.4363 Td
(5484   char *path, *s;) 13.244 Tj
0 -49.7454 Td
(5485   uint argv;) 10.234 Tj
0 -51.0545 Td
(5486 ) 3.01 Tj
0 -52.3636 Td
(5487   if\(argstr\(0, &path\) < 0 || argint\(1, \(int*\)&argv\) < 0\)) 36.722 Tj
0 -53.6727 Td
(5488     return -1;) 11.438 Tj
0 -54.9818 Td
(5489 ) 3.01 Tj
0 -56.2909 Td
(5490   ip = namei\(path, NAMEI_LOOKUP, 0, 0, 0\);) 28.294 Tj
0 -57.6 Td
(5491   if\(ip == 0\)) 10.836 Tj
0 -58.9091 Td
(5492     return -1;) 11.438 Tj
0 -60.2181 Td
(5493 ) 3.01 Tj
0 -61.5272 Td
(5494   if\(readi\(ip, \(char*\)&elf, 0, sizeof\(elf\)\) < sizeof\(elf\)\)) 37.926 Tj
0 -62.8363 Td
(5495     goto bad;) 10.836 Tj
0 -64.1454 Td
(5496 ) 3.01 Tj
0 -65.4545 Td
(5497   if\(elf.magic != ELF_MAGIC\)) 19.866 Tj
0 -66.7636 Td
(5498     goto bad;) 10.836 Tj
0 -68.0727 Td
(5499 ) 3.01 Tj
0 -72 Td
(Sheet 54) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 62 62
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/sysfile.c  Page 9) 24.08 Tj
0 -3.92728 Td
(5500   sz = 0;) 8.428 Tj
0 -5.23637 Td
(5501   for\(i = 0; i < elf.phnum; i++\){) 22.876 Tj
0 -6.54546 Td
(5502     if\(readi\(ip, \(char*\)&ph, elf.phoff + i * sizeof\(ph\),) 36.722 Tj
0 -7.85455 Td
(5503              sizeof\(ph\)\) != sizeof\(ph\)\)) 26.488 Tj
0 -9.16364 Td
(5504       goto bad;) 12.04 Tj
0 -10.4727 Td
(5505     if\(ph.type != ELF_PROG_LOAD\)) 22.274 Tj
0 -11.7818 Td
(5506       continue;) 12.04 Tj
0 -13.0909 Td
(5507     if\(ph.memsz < ph.filesz\)) 19.866 Tj
0 -14.4 Td
(5508       goto bad;) 12.04 Tj
0 -15.7091 Td
(5509     sz += ph.memsz;) 14.448 Tj
0 -17.0182 Td
(5510   }) 4.816 Tj
0 -18.3273 Td
(5511 ) 3.01 Tj
0 -19.6364 Td
(5512   sz += 4096 - \(sz % 4096\);) 19.264 Tj
0 -20.9455 Td
(5513   sz += 4096;) 10.836 Tj
0 -22.2545 Td
(5514 ) 3.01 Tj
0 -23.5636 Td
(5515   mem = kalloc\(sz\);) 14.448 Tj
0 -24.8727 Td
(5516   if\(mem == 0\)) 11.438 Tj
0 -26.1818 Td
(5517     goto bad;) 10.836 Tj
0 -27.4909 Td
(5518   memset\(mem, 0, sz\);) 15.652 Tj
0 -28.8 Td
(5519 ) 3.01 Tj
0 -30.1091 Td
(5520   nargs = 0;) 10.234 Tj
0 -31.4182 Td
(5521   argbytes = 0;) 12.04 Tj
0 -32.7273 Td
(5522   for\(i = 0;; i++\){) 14.448 Tj
0 -34.0364 Td
(5523     if\(fetchint\(cp, argv + 4*i, \(int*\)&ap\) < 0\)) 31.304 Tj
0 -35.3454 Td
(5524       goto bad;) 12.04 Tj
0 -36.6545 Td
(5525     if\(ap == 0\)) 12.04 Tj
0 -37.9636 Td
(5526       break;) 10.234 Tj
0 -39.2727 Td
(5527     len = fetchstr\(cp, ap, &s\);) 21.672 Tj
0 -40.5818 Td
(5528     if\(len < 0\)) 12.04 Tj
0 -41.8909 Td
(5529       goto bad;) 12.04 Tj
0 -43.2 Td
(5530     nargs++;) 10.234 Tj
0 -44.5091 Td
(5531     argbytes += len + 1;) 17.458 Tj
0 -45.8182 Td
(5532   }) 4.816 Tj
0 -47.1272 Td
(5533 ) 3.01 Tj
0 -48.4363 Td
(5534   // argn\\0) 9.632 Tj
0 -49.7454 Td
(5535   // ...) 7.826 Tj
0 -51.0545 Td
(5536   // arg0\\0) 9.632 Tj
0 -52.3636 Td
(5537   // 0) 6.622 Tj
0 -53.6727 Td
(5538   // ptr to argn) 12.642 Tj
0 -54.9818 Td
(5539   // ...) 7.826 Tj
0 -56.2909 Td
(5540   // 12: ptr to arg0) 15.05 Tj
0 -57.6 Td
(5541   //  8: argv \(points to ptr to arg0\)) 25.284 Tj
0 -58.9091 Td
(5542   //  4: argc) 10.836 Tj
0 -60.2181 Td
(5543   //  0: fake return pc) 16.856 Tj
0 -61.5272 Td
(5544   sp = sz - argbytes - \(nargs+1\)*4 - 4 - 4 - 4;) 31.304 Tj
0 -62.8363 Td
(5545   *\(uint*\)\(mem + sp\) = 0xffffffff;) 23.478 Tj
0 -64.1454 Td
(5546   *\(uint*\)\(mem + sp + 4\) = nargs;) 22.876 Tj
0 -65.4545 Td
(5547   *\(uint*\)\(mem + sp + 8\) = \(uint\)\(sp + 12\);) 28.896 Tj
0 -66.7636 Td
(5548 ) 3.01 Tj
0 -68.0727 Td
(5549 ) 3.01 Tj
0 -72 Td
(Sheet 55) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/sysfile.c  Page 10) 24.682 Tj
0 -3.92728 Td
(5550   p1 = sp + 12;) 12.04 Tj
0 -5.23637 Td
(5551   p2 = sp + 12 + \(nargs + 1\) * 4;) 22.876 Tj
0 -6.54546 Td
(5552   for\(i = 0; i < nargs; i++\){) 20.468 Tj
0 -7.85455 Td
(5553     fetchint\(cp, argv + 4*i, \(int*\)&ap\);) 27.09 Tj
0 -9.16364 Td
(5554     len = fetchstr\(cp, ap, &s\);) 21.672 Tj
0 -10.4727 Td
(5555     memmove\(mem + p2, s, len + 1\);) 23.478 Tj
0 -11.7818 Td
(5556     *\(uint*\)\(mem + p1\) = p2;) 19.866 Tj
0 -13.0909 Td
(5557     p1 += 4;) 10.234 Tj
0 -14.4 Td
(5558     p2 += len + 1;) 13.846 Tj
0 -15.7091 Td
(5559   }) 4.816 Tj
0 -17.0182 Td
(5560   *\(uint*\)\(mem + p1\) = 0;) 18.06 Tj
0 -18.3273 Td
(5561 ) 3.01 Tj
0 -19.6364 Td
(5562   // commit to the new image.) 20.468 Tj
0 -20.9455 Td
(5563   kfree\(cp->mem, cp->sz\);) 18.06 Tj
0 -22.2545 Td
(5564   cp->sz = sz;) 11.438 Tj
0 -23.5636 Td
(5565   cp->mem = mem;) 12.642 Tj
0 -24.8727 Td
(5566   mem = 0;) 9.03 Tj
0 -26.1818 Td
(5567 ) 3.01 Tj
0 -27.4909 Td
(5568   for\(i = 0; i < elf.phnum; i++\){) 22.876 Tj
0 -28.8 Td
(5569     if\(readi\(ip, \(char*\)&ph, elf.phoff + i * sizeof\(ph\),) 36.722 Tj
0 -30.1091 Td
(5570              sizeof\(ph\)\) != sizeof\(ph\)\)) 26.488 Tj
0 -31.4182 Td
(5571       goto bad2;) 12.642 Tj
0 -32.7273 Td
(5572     if\(ph.type != ELF_PROG_LOAD\)) 22.274 Tj
0 -34.0364 Td
(5573       continue;) 12.04 Tj
0 -35.3454 Td
(5574     if\(ph.va + ph.memsz > sz\)) 20.468 Tj
0 -36.6545 Td
(5575       goto bad2;) 12.642 Tj
0 -37.9636 Td
(5576     if\(readi\(ip, cp->mem + ph.va, ph.offset, ph.filesz\) != ph.filesz\)) 44.548 Tj
0 -39.2727 Td
(5577       goto bad2;) 12.642 Tj
0 -40.5818 Td
(5578     memset\(cp->mem + ph.va + ph.filesz, 0, ph.memsz - ph.filesz\);) 42.14 Tj
0 -41.8909 Td
(5579   }) 4.816 Tj
0 -43.2 Td
(5580 ) 3.01 Tj
0 -44.5091 Td
(5581   iput\(ip\);) 9.632 Tj
0 -45.8182 Td
(5582 ) 3.01 Tj
0 -47.1272 Td
(5583   cp->tf->eip = elf.entry;) 18.662 Tj
0 -48.4363 Td
(5584   cp->tf->esp = sp;) 14.448 Tj
0 -49.7454 Td
(5585   setupsegs\(cp\);) 12.642 Tj
0 -51.0545 Td
(5586 ) 3.01 Tj
0 -52.3636 Td
(5587   return 0;) 9.632 Tj
0 -53.6727 Td
(5588 ) 3.01 Tj
0 -54.9818 Td
(5589  bad:) 6.02 Tj
0 -56.2909 Td
(5590   if\(mem\)) 8.428 Tj
0 -57.6 Td
(5591     kfree\(mem, sz\);) 14.448 Tj
0 -58.9091 Td
(5592   iput\(ip\);) 9.632 Tj
0 -60.2181 Td
(5593   return -1;) 10.234 Tj
0 -61.5272 Td
(5594 ) 3.01 Tj
0 -62.8363 Td
(5595  bad2:) 6.622 Tj
0 -64.1454 Td
(5596   iput\(ip\);) 9.632 Tj
0 -65.4545 Td
(5597   proc_exit\(\);) 11.438 Tj
0 -66.7636 Td
(5598   return 0;) 9.632 Tj
0 -68.0727 Td
(5599 }) 3.612 Tj
0 -72 Td
(Sheet 55) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 63 63
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/pipe.c  Page 1) 22.274 Tj
0 -3.92728 Td
(5600 #include "types.h") 13.846 Tj
0 -5.23637 Td
(5601 #include "param.h") 13.846 Tj
0 -6.54546 Td
(5602 #include "x86.h") 12.642 Tj
0 -7.85455 Td
(5603 #include "mmu.h") 12.642 Tj
0 -9.16364 Td
(5604 #include "proc.h") 13.244 Tj
0 -10.4727 Td
(5605 #include "defs.h") 13.244 Tj
0 -11.7818 Td
(5606 #include "file.h") 13.244 Tj
0 -13.0909 Td
(5607 #include "spinlock.h") 15.652 Tj
0 -14.4 Td
(5608 ) 3.01 Tj
0 -15.7091 Td
(5609 #define PIPESIZE 512) 15.05 Tj
0 -17.0182 Td
(5610 ) 3.01 Tj
0 -18.3273 Td
(5611 struct pipe {) 10.836 Tj
0 -19.6364 Td
(5612   int readopen; // read fd is still open) 27.09 Tj
0 -20.9455 Td
(5613   int writeopen; // write fd is still open) 28.294 Tj
0 -22.2545 Td
(5614   int writep; // next index to write) 24.682 Tj
0 -23.5636 Td
(5615   int readp;  // next index to read) 24.08 Tj
0 -24.8727 Td
(5616   struct spinlock lock;) 16.856 Tj
0 -26.1818 Td
(5617   char data[PIPESIZE];) 16.254 Tj
0 -27.4909 Td
(5618 };) 4.214 Tj
0 -28.8 Td
(5619 ) 3.01 Tj
0 -30.1091 Td
(5620 int) 4.816 Tj
0 -31.4182 Td
(5621 pipe_alloc\(struct file **f0, struct file **f1\)) 30.702 Tj
0 -32.7273 Td
(5622 {) 3.612 Tj
0 -34.0364 Td
(5623   *f0 = *f1 = 0;) 12.642 Tj
0 -35.3454 Td
(5624   struct pipe *p = 0;) 15.652 Tj
0 -36.6545 Td
(5625 ) 3.01 Tj
0 -37.9636 Td
(5626   if\(\(*f0 = filealloc\(\)\) == 0\)) 21.07 Tj
0 -39.2727 Td
(5627     goto oops;) 11.438 Tj
0 -40.5818 Td
(5628   if\(\(*f1 = filealloc\(\)\) == 0\)) 21.07 Tj
0 -41.8909 Td
(5629     goto oops;) 11.438 Tj
0 -43.2 Td
(5630   if\(\(p = \(struct pipe*\) kalloc\(PAGE\)\) == 0\)) 29.498 Tj
0 -44.5091 Td
(5631     goto oops;) 11.438 Tj
0 -45.8182 Td
(5632   p->readopen = 1;) 13.846 Tj
0 -47.1272 Td
(5633   p->writeopen = 1;) 14.448 Tj
0 -48.4363 Td
(5634   p->writep = 0;) 12.642 Tj
0 -49.7454 Td
(5635   p->readp = 0;) 12.04 Tj
0 -51.0545 Td
(5636   initlock\(&p->lock, "pipe"\);) 20.468 Tj
0 -52.3636 Td
(5637   \(*f0\)->type = FD_PIPE;) 17.458 Tj
0 -53.6727 Td
(5638   \(*f0\)->readable = 1;) 16.254 Tj
0 -54.9818 Td
(5639   \(*f0\)->writable = 0;) 16.254 Tj
0 -56.2909 Td
(5640   \(*f0\)->pipe = p;) 13.846 Tj
0 -57.6 Td
(5641   \(*f1\)->type = FD_PIPE;) 17.458 Tj
0 -58.9091 Td
(5642   \(*f1\)->readable = 0;) 16.254 Tj
0 -60.2181 Td
(5643   \(*f1\)->writable = 1;) 16.254 Tj
0 -61.5272 Td
(5644   \(*f1\)->pipe = p;) 13.846 Tj
0 -62.8363 Td
(5645   return 0;) 9.632 Tj
0 -64.1454 Td
(5646  oops:) 6.622 Tj
0 -65.4545 Td
(5647   if\(p\)) 7.224 Tj
0 -66.7636 Td
(5648     kfree\(\(char*\) p, PAGE\);) 19.264 Tj
0 -68.0727 Td
(5649   if\(*f0\){) 9.03 Tj
0 -72 Td
(Sheet 56) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/pipe.c  Page 2) 22.274 Tj
0 -3.92728 Td
(5650     \(*f0\)->type = FD_NONE;) 18.662 Tj
0 -5.23637 Td
(5651     fileclose\(*f0\);) 14.448 Tj
0 -6.54546 Td
(5652   }) 4.816 Tj
0 -7.85455 Td
(5653   if\(*f1\){) 9.03 Tj
0 -9.16364 Td
(5654     \(*f1\)->type = FD_NONE;) 18.662 Tj
0 -10.4727 Td
(5655     fileclose\(*f1\);) 14.448 Tj
0 -11.7818 Td
(5656   }) 4.816 Tj
0 -13.0909 Td
(5657   return -1;) 10.234 Tj
0 -14.4 Td
(5658 }) 3.612 Tj
0 -15.7091 Td
(5659 ) 3.01 Tj
0 -17.0182 Td
(5660 void) 5.418 Tj
0 -18.3273 Td
(5661 pipe_close\(struct pipe *p, int writable\)) 27.09 Tj
0 -19.6364 Td
(5662 {) 3.612 Tj
0 -20.9455 Td
(5663   acquire\(&p->lock\);) 15.05 Tj
0 -22.2545 Td
(5664 ) 3.01 Tj
0 -23.5636 Td
(5665   if\(writable\){) 12.04 Tj
0 -24.8727 Td
(5666     p->writeopen = 0;) 15.652 Tj
0 -26.1818 Td
(5667     wakeup\(&p->readp\);) 16.254 Tj
0 -27.4909 Td
(5668   } else {) 9.03 Tj
0 -28.8 Td
(5669     p->readopen = 0;) 15.05 Tj
0 -30.1091 Td
(5670     wakeup\(&p->writep\);) 16.856 Tj
0 -31.4182 Td
(5671   }) 4.816 Tj
0 -32.7273 Td
(5672 ) 3.01 Tj
0 -34.0364 Td
(5673   release\(&p->lock\);) 15.05 Tj
0 -35.3454 Td
(5674 ) 3.01 Tj
0 -36.6545 Td
(5675   if\(p->readopen == 0 && p->writeopen == 0\)) 28.896 Tj
0 -37.9636 Td
(5676     kfree\(\(char*\) p, PAGE\);) 19.264 Tj
0 -39.2727 Td
(5677 }) 3.612 Tj
0 -40.5818 Td
(5678 ) 3.01 Tj
0 -41.8909 Td
(5679 int) 4.816 Tj
0 -43.2 Td
(5680 pipe_write\(struct pipe *p, char *addr, int n\)) 30.1 Tj
0 -44.5091 Td
(5681 {) 3.612 Tj
0 -45.8182 Td
(5682   int i;) 7.826 Tj
0 -47.1272 Td
(5683 ) 3.01 Tj
0 -48.4363 Td
(5684   acquire\(&p->lock\);) 15.05 Tj
0 -49.7454 Td
(5685 ) 3.01 Tj
0 -51.0545 Td
(5686   for\(i = 0; i < n; i++\){) 18.06 Tj
0 -52.3636 Td
(5687     while\(\(\(p->writep + 1\) % PIPESIZE\) == p->readp\){) 34.314 Tj
0 -53.6727 Td
(5688       if\(p->readopen == 0\){) 19.264 Tj
0 -54.9818 Td
(5689         release\(&p->lock\);) 18.662 Tj
0 -56.2909 Td
(5690         return -1;) 13.846 Tj
0 -57.6 Td
(5691       }) 7.224 Tj
0 -58.9091 Td
(5692       wakeup\(&p->readp\);) 17.458 Tj
0 -60.2181 Td
(5693       sleep\(&p->writep, &p->lock\);) 23.478 Tj
0 -61.5272 Td
(5694     }) 6.02 Tj
0 -62.8363 Td
(5695     p->data[p->writep] = addr[i];) 22.876 Tj
0 -64.1454 Td
(5696     p->writep = \(p->writep + 1\) % PIPESIZE;) 28.896 Tj
0 -65.4545 Td
(5697   }) 4.816 Tj
0 -66.7636 Td
(5698 ) 3.01 Tj
0 -68.0727 Td
(5699 ) 3.01 Tj
0 -72 Td
(Sheet 56) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 64 64
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/pipe.c  Page 3) 22.274 Tj
0 -3.92728 Td
(5700   release\(&p->lock\);) 15.05 Tj
0 -5.23637 Td
(5701   wakeup\(&p->readp\);) 15.05 Tj
0 -6.54546 Td
(5702   return i;) 9.632 Tj
0 -7.85455 Td
(5703 }) 3.612 Tj
0 -9.16364 Td
(5704 ) 3.01 Tj
0 -10.4727 Td
(5705 int) 4.816 Tj
0 -11.7818 Td
(5706 pipe_read\(struct pipe *p, char *addr, int n\)) 29.498 Tj
0 -13.0909 Td
(5707 {) 3.612 Tj
0 -14.4 Td
(5708   int i;) 7.826 Tj
0 -15.7091 Td
(5709 ) 3.01 Tj
0 -17.0182 Td
(5710   acquire\(&p->lock\);) 15.05 Tj
0 -18.3273 Td
(5711 ) 3.01 Tj
0 -19.6364 Td
(5712   while\(p->readp == p->writep\){) 21.672 Tj
0 -20.9455 Td
(5713     if\(p->writeopen == 0\){) 18.662 Tj
0 -22.2545 Td
(5714       release\(&p->lock\);) 17.458 Tj
0 -23.5636 Td
(5715       return 0;) 12.04 Tj
0 -24.8727 Td
(5716     }) 6.02 Tj
0 -26.1818 Td
(5717     sleep\(&p->readp, &p->lock\);) 21.672 Tj
0 -27.4909 Td
(5718   }) 4.816 Tj
0 -28.8 Td
(5719 ) 3.01 Tj
0 -30.1091 Td
(5720   for\(i = 0; i < n; i++\){) 18.06 Tj
0 -31.4182 Td
(5721     if\(p->readp == p->writep\)) 20.468 Tj
0 -32.7273 Td
(5722       break;) 10.234 Tj
0 -34.0364 Td
(5723     addr[i] = p->data[p->readp];) 22.274 Tj
0 -35.3454 Td
(5724     p->readp = \(p->readp + 1\) % PIPESIZE;) 27.692 Tj
0 -36.6545 Td
(5725   }) 4.816 Tj
0 -37.9636 Td
(5726 ) 3.01 Tj
0 -39.2727 Td
(5727   release\(&p->lock\);) 15.05 Tj
0 -40.5818 Td
(5728   wakeup\(&p->writep\);) 15.652 Tj
0 -41.8909 Td
(5729   return i;) 9.632 Tj
0 -43.2 Td
(5730 }) 3.612 Tj
0 -44.5091 Td
(5731 ) 3.01 Tj
0 -45.8182 Td
(5732 ) 3.01 Tj
0 -47.1272 Td
(5733 ) 3.01 Tj
0 -48.4363 Td
(5734 ) 3.01 Tj
0 -49.7454 Td
(5735 ) 3.01 Tj
0 -51.0545 Td
(5736 ) 3.01 Tj
0 -52.3636 Td
(5737 ) 3.01 Tj
0 -53.6727 Td
(5738 ) 3.01 Tj
0 -54.9818 Td
(5739 ) 3.01 Tj
0 -56.2909 Td
(5740 ) 3.01 Tj
0 -57.6 Td
(5741 ) 3.01 Tj
0 -58.9091 Td
(5742 ) 3.01 Tj
0 -60.2181 Td
(5743 ) 3.01 Tj
0 -61.5272 Td
(5744 ) 3.01 Tj
0 -62.8363 Td
(5745 ) 3.01 Tj
0 -64.1454 Td
(5746 ) 3.01 Tj
0 -65.4545 Td
(5747 ) 3.01 Tj
0 -66.7636 Td
(5748 ) 3.01 Tj
0 -68.0727 Td
(5749 ) 3.01 Tj
0 -72 Td
(Sheet 57) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/string.c  Page 1) 23.478 Tj
0 -3.92728 Td
(5750 #include "types.h") 13.846 Tj
0 -5.23637 Td
(5751 #include "defs.h") 13.244 Tj
0 -6.54546 Td
(5752 ) 3.01 Tj
0 -7.85455 Td
(5753 void*) 6.02 Tj
0 -9.16364 Td
(5754 memset\(void *dst, int c, uint n\)) 22.274 Tj
0 -10.4727 Td
(5755 {) 3.612 Tj
0 -11.7818 Td
(5756   char *d = \(char*\) dst;) 17.458 Tj
0 -13.0909 Td
(5757 ) 3.01 Tj
0 -14.4 Td
(5758   while\(n-- > 0\)) 12.642 Tj
0 -15.7091 Td
(5759     *d++ = c;) 10.836 Tj
0 -17.0182 Td
(5760 ) 3.01 Tj
0 -18.3273 Td
(5761   return dst;) 10.836 Tj
0 -19.6364 Td
(5762 }) 3.612 Tj
0 -20.9455 Td
(5763 ) 3.01 Tj
0 -22.2545 Td
(5764 int) 4.816 Tj
0 -23.5636 Td
(5765 memcmp\(const void *v1, const void *v2, uint n\)) 30.702 Tj
0 -24.8727 Td
(5766 {) 3.612 Tj
0 -26.1818 Td
(5767   const uchar *s1 = \(const uchar*\) v1;) 25.886 Tj
0 -27.4909 Td
(5768   const uchar *s2 = \(const uchar*\) v2;) 25.886 Tj
0 -28.8 Td
(5769 ) 3.01 Tj
0 -30.1091 Td
(5770   while\(n-- > 0\) {) 13.846 Tj
0 -31.4182 Td
(5771     if\(*s1 != *s2\)) 13.846 Tj
0 -32.7273 Td
(5772       return \(int\) *s1 - \(int\) *s2;) 24.08 Tj
0 -34.0364 Td
(5773     s1++, s2++;) 12.04 Tj
0 -35.3454 Td
(5774   }) 4.816 Tj
0 -36.6545 Td
(5775 ) 3.01 Tj
0 -37.9636 Td
(5776   return 0;) 9.632 Tj
0 -39.2727 Td
(5777 }) 3.612 Tj
0 -40.5818 Td
(5778 ) 3.01 Tj
0 -41.8909 Td
(5779 void*) 6.02 Tj
0 -43.2 Td
(5780 memmove\(void *dst, const void *src, uint n\)) 28.896 Tj
0 -44.5091 Td
(5781 {) 3.612 Tj
0 -45.8182 Td
(5782   const char *s;) 12.642 Tj
0 -47.1272 Td
(5783   char *d;) 9.03 Tj
0 -48.4363 Td
(5784 ) 3.01 Tj
0 -49.7454 Td
(5785   s = src;) 9.03 Tj
0 -51.0545 Td
(5786   d = dst;) 9.03 Tj
0 -52.3636 Td
(5787   if\(s < d && s + n > d\) {) 18.662 Tj
0 -53.6727 Td
(5788     s += n;) 9.632 Tj
0 -54.9818 Td
(5789     d += n;) 9.632 Tj
0 -56.2909 Td
(5790     while\(n-- > 0\)) 13.846 Tj
0 -57.6 Td
(5791       *--d = *--s;) 13.846 Tj
0 -58.9091 Td
(5792   } else) 7.826 Tj
0 -60.2181 Td
(5793     while\(n-- > 0\)) 13.846 Tj
0 -61.5272 Td
(5794       *d++ = *s++;) 13.846 Tj
0 -62.8363 Td
(5795 ) 3.01 Tj
0 -64.1454 Td
(5796   return dst;) 10.836 Tj
0 -65.4545 Td
(5797 }) 3.612 Tj
0 -66.7636 Td
(5798 ) 3.01 Tj
0 -68.0727 Td
(5799 ) 3.01 Tj
0 -72 Td
(Sheet 57) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 65 65
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/string.c  Page 2) 23.478 Tj
0 -3.92728 Td
(5800 int) 4.816 Tj
0 -5.23637 Td
(5801 strncmp\(const char *p, const char *q, uint n\)) 30.1 Tj
0 -6.54546 Td
(5802 {) 3.612 Tj
0 -7.85455 Td
(5803   while\(n > 0 && *p && *p == *q\)) 22.274 Tj
0 -9.16364 Td
(5804     n--, p++, q++;) 13.846 Tj
0 -10.4727 Td
(5805   if\(n == 0\)) 10.234 Tj
0 -11.7818 Td
(5806     return 0;) 10.836 Tj
0 -13.0909 Td
(5807   else) 6.622 Tj
0 -14.4 Td
(5808     return \(int\) \(\(uchar\) *p - \(uchar\) *q\);) 28.896 Tj
0 -15.7091 Td
(5809 }) 3.612 Tj
0 -17.0182 Td
(5810 ) 3.01 Tj
0 -18.3273 Td
(5811 ) 3.01 Tj
0 -19.6364 Td
(5812 ) 3.01 Tj
0 -20.9455 Td
(5813 ) 3.01 Tj
0 -22.2545 Td
(5814 ) 3.01 Tj
0 -23.5636 Td
(5815 ) 3.01 Tj
0 -24.8727 Td
(5816 ) 3.01 Tj
0 -26.1818 Td
(5817 ) 3.01 Tj
0 -27.4909 Td
(5818 ) 3.01 Tj
0 -28.8 Td
(5819 ) 3.01 Tj
0 -30.1091 Td
(5820 ) 3.01 Tj
0 -31.4182 Td
(5821 ) 3.01 Tj
0 -32.7273 Td
(5822 ) 3.01 Tj
0 -34.0364 Td
(5823 ) 3.01 Tj
0 -35.3454 Td
(5824 ) 3.01 Tj
0 -36.6545 Td
(5825 ) 3.01 Tj
0 -37.9636 Td
(5826 ) 3.01 Tj
0 -39.2727 Td
(5827 ) 3.01 Tj
0 -40.5818 Td
(5828 ) 3.01 Tj
0 -41.8909 Td
(5829 ) 3.01 Tj
0 -43.2 Td
(5830 ) 3.01 Tj
0 -44.5091 Td
(5831 ) 3.01 Tj
0 -45.8182 Td
(5832 ) 3.01 Tj
0 -47.1272 Td
(5833 ) 3.01 Tj
0 -48.4363 Td
(5834 ) 3.01 Tj
0 -49.7454 Td
(5835 ) 3.01 Tj
0 -51.0545 Td
(5836 ) 3.01 Tj
0 -52.3636 Td
(5837 ) 3.01 Tj
0 -53.6727 Td
(5838 ) 3.01 Tj
0 -54.9818 Td
(5839 ) 3.01 Tj
0 -56.2909 Td
(5840 ) 3.01 Tj
0 -57.6 Td
(5841 ) 3.01 Tj
0 -58.9091 Td
(5842 ) 3.01 Tj
0 -60.2181 Td
(5843 ) 3.01 Tj
0 -61.5272 Td
(5844 ) 3.01 Tj
0 -62.8363 Td
(5845 ) 3.01 Tj
0 -64.1454 Td
(5846 ) 3.01 Tj
0 -65.4545 Td
(5847 ) 3.01 Tj
0 -66.7636 Td
(5848 ) 3.01 Tj
0 -68.0727 Td
(5849 ) 3.01 Tj
0 -72 Td
(Sheet 58) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/ioapic.h  Page 1) 23.478 Tj
0 -3.92728 Td
(5850 #define IO_APIC_BASE   0xFEC00000   // Default phys addr of IO APIC) 43.344 Tj
0 -5.23637 Td
(5851 #define IOAPIC_WINDOW        0x10   // Window register offset) 39.732 Tj
0 -6.54546 Td
(5852 ) 3.01 Tj
0 -7.85455 Td
(5853 // Constants relating to APIC ID registers) 28.294 Tj
0 -9.16364 Td
(5854 #define APIC_ID_MASK            0xff000000) 28.294 Tj
0 -10.4727 Td
(5855 #define APIC_ID_SHIFT           24) 23.478 Tj
0 -11.7818 Td
(5856 #define APIC_ID_CLUSTER         0xf0) 24.682 Tj
0 -13.0909 Td
(5857 #define APIC_ID_CLUSTER_ID      0x0f) 24.682 Tj
0 -14.4 Td
(5858 #define APIC_MAX_CLUSTER        0xe) 24.08 Tj
0 -15.7091 Td
(5859 #define APIC_MAX_INTRACLUSTER_ID 3) 23.478 Tj
0 -17.0182 Td
(5860 #define APIC_ID_CLUSTER_SHIFT   4) 22.876 Tj
0 -18.3273 Td
(5861 ) 3.01 Tj
0 -19.6364 Td
(5862 // Fields in VER) 12.642 Tj
0 -20.9455 Td
(5863 #define APIC_VER_VERSION        0x000000ff) 28.294 Tj
0 -22.2545 Td
(5864 #define APIC_VER_MAXLVT         0x00ff0000) 28.294 Tj
0 -23.5636 Td
(5865 #define MAXLVTSHIFT             16) 23.478 Tj
0 -24.8727 Td
(5866 ) 3.01 Tj
0 -26.1818 Td
(5867 // Indexes into IO APIC) 16.856 Tj
0 -27.4909 Td
(5868 #define IOAPIC_ID               0x00) 24.682 Tj
0 -28.8 Td
(5869 #define IOAPIC_VER              0x01) 24.682 Tj
0 -30.1091 Td
(5870 #define IOAPIC_ARB              0x02) 24.682 Tj
0 -31.4182 Td
(5871 #define IOAPIC_REDTBL           0x10) 24.682 Tj
0 -32.7273 Td
(5872 #define IOAPIC_REDTBL0          IOAPIC_REDTBL) 30.1 Tj
0 -34.0364 Td
(5873 #define IOAPIC_REDTBL1          \(IOAPIC_REDTBL+0x02\)) 34.314 Tj
0 -35.3454 Td
(5874 #define IOAPIC_REDTBL2          \(IOAPIC_REDTBL+0x04\)) 34.314 Tj
0 -36.6545 Td
(5875 #define IOAPIC_REDTBL3          \(IOAPIC_REDTBL+0x06\)) 34.314 Tj
0 -37.9636 Td
(5876 #define IOAPIC_REDTBL4          \(IOAPIC_REDTBL+0x08\)) 34.314 Tj
0 -39.2727 Td
(5877 #define IOAPIC_REDTBL5          \(IOAPIC_REDTBL+0x0a\)) 34.314 Tj
0 -40.5818 Td
(5878 #define IOAPIC_REDTBL6          \(IOAPIC_REDTBL+0x0c\)) 34.314 Tj
0 -41.8909 Td
(5879 #define IOAPIC_REDTBL7          \(IOAPIC_REDTBL+0x0e\)) 34.314 Tj
0 -43.2 Td
(5880 #define IOAPIC_REDTBL8          \(IOAPIC_REDTBL+0x10\)) 34.314 Tj
0 -44.5091 Td
(5881 #define IOAPIC_REDTBL9          \(IOAPIC_REDTBL+0x12\)) 34.314 Tj
0 -45.8182 Td
(5882 #define IOAPIC_REDTBL10         \(IOAPIC_REDTBL+0x14\)) 34.314 Tj
0 -47.1272 Td
(5883 #define IOAPIC_REDTBL11         \(IOAPIC_REDTBL+0x16\)) 34.314 Tj
0 -48.4363 Td
(5884 #define IOAPIC_REDTBL12         \(IOAPIC_REDTBL+0x18\)) 34.314 Tj
0 -49.7454 Td
(5885 #define IOAPIC_REDTBL13         \(IOAPIC_REDTBL+0x1a\)) 34.314 Tj
0 -51.0545 Td
(5886 #define IOAPIC_REDTBL14         \(IOAPIC_REDTBL+0x1c\)) 34.314 Tj
0 -52.3636 Td
(5887 #define IOAPIC_REDTBL15         \(IOAPIC_REDTBL+0x1e\)) 34.314 Tj
0 -53.6727 Td
(5888 #define IOAPIC_REDTBL16         \(IOAPIC_REDTBL+0x20\)) 34.314 Tj
0 -54.9818 Td
(5889 #define IOAPIC_REDTBL17         \(IOAPIC_REDTBL+0x22\)) 34.314 Tj
0 -56.2909 Td
(5890 #define IOAPIC_REDTBL18         \(IOAPIC_REDTBL+0x24\)) 34.314 Tj
0 -57.6 Td
(5891 #define IOAPIC_REDTBL19         \(IOAPIC_REDTBL+0x26\)) 34.314 Tj
0 -58.9091 Td
(5892 #define IOAPIC_REDTBL20         \(IOAPIC_REDTBL+0x28\)) 34.314 Tj
0 -60.2181 Td
(5893 #define IOAPIC_REDTBL21         \(IOAPIC_REDTBL+0x2a\)) 34.314 Tj
0 -61.5272 Td
(5894 #define IOAPIC_REDTBL22         \(IOAPIC_REDTBL+0x2c\)) 34.314 Tj
0 -62.8363 Td
(5895 #define IOAPIC_REDTBL23         \(IOAPIC_REDTBL+0x2e\)) 34.314 Tj
0 -64.1454 Td
(5896 ) 3.01 Tj
0 -65.4545 Td
(5897 // Fields in the IO APIC's redirection table entries) 34.314 Tj
0 -66.7636 Td
(5898 #define IOART_DEST      APIC_ID_MASK    // broadcast addr: all APICs) 43.946 Tj
0 -68.0727 Td
(5899 ) 3.01 Tj
0 -72 Td
(Sheet 58) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 66 66
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/ioapic.h  Page 2) 23.478 Tj
0 -3.92728 Td
(5900 #define IOART_RESV      0x00fe0000      // reserved) 33.712 Tj
0 -5.23637 Td
(5901 ) 3.01 Tj
0 -6.54546 Td
(5902 #define IOART_INTMASK   0x00010000      // R/W: INTerrupt mask) 40.334 Tj
0 -7.85455 Td
(5903 #define IOART_INTMCLR   0x00000000      //       clear, allow INTs) 42.742 Tj
0 -9.16364 Td
(5904 #define IOART_INTMSET   0x00010000      //       set, inhibit INTs) 42.742 Tj
0 -10.4727 Td
(5905 ) 3.01 Tj
0 -11.7818 Td
(5906 #define IOART_TRGRMOD   0x00008000      // R/W: trigger mode) 39.13 Tj
0 -13.0909 Td
(5907 #define IOART_TRGREDG   0x00000000      //       edge) 34.916 Tj
0 -14.4 Td
(5908 #define IOART_TRGRLVL   0x00008000      //       level) 35.518 Tj
0 -15.7091 Td
(5909 ) 3.01 Tj
0 -17.0182 Td
(5910 #define IOART_REM_IRR   0x00004000      // RO: remote IRR) 37.324 Tj
0 -18.3273 Td
(5911 ) 3.01 Tj
0 -19.6364 Td
(5912 #define IOART_INTPOL    0x00002000      // R/W: INT input pin polarity) 45.15 Tj
0 -20.9455 Td
(5913 #define IOART_INTAHI    0x00000000      //      active high) 38.528 Tj
0 -22.2545 Td
(5914 #define IOART_INTALO    0x00002000      //      active low) 37.926 Tj
0 -23.5636 Td
(5915 ) 3.01 Tj
0 -24.8727 Td
(5916 #define IOART_DELIVS    0x00001000      // RO: delivery status) 40.334 Tj
0 -26.1818 Td
(5917 ) 3.01 Tj
0 -27.4909 Td
(5918 #define IOART_DESTMOD   0x00000800      // R/W: destination mode) 41.538 Tj
0 -28.8 Td
(5919 #define IOART_DESTPHY   0x00000000      //      physical) 36.722 Tj
0 -30.1091 Td
(5920 #define IOART_DESTLOG   0x00000800      //      logical) 36.12 Tj
0 -31.4182 Td
(5921 ) 3.01 Tj
0 -32.7273 Td
(5922 #define IOART_DELMOD    0x00000700      // R/W: delivery mode) 39.732 Tj
0 -34.0364 Td
(5923 #define IOART_DELFIXED  0x00000000      //       fixed) 35.518 Tj
0 -35.3454 Td
(5924 #define IOART_DELLOPRI  0x00000100      //       lowest priority) 41.538 Tj
0 -36.6545 Td
(5925 #define IOART_DELSMI    0x00000200      //       System Management INT) 45.15 Tj
0 -37.9636 Td
(5926 #define IOART_DELRSV1   0x00000300      //       reserved) 37.324 Tj
0 -39.2727 Td
(5927 #define IOART_DELNMI    0x00000400      //       NMI signal) 38.528 Tj
0 -40.5818 Td
(5928 #define IOART_DELINIT   0x00000500      //       INIT signal) 39.13 Tj
0 -41.8909 Td
(5929 #define IOART_DELRSV2   0x00000600      //       reserved) 37.324 Tj
0 -43.2 Td
(5930 #define IOART_DELEXINT  0x00000700      //       External INTerrupt) 43.344 Tj
0 -44.5091 Td
(5931 ) 3.01 Tj
0 -45.8182 Td
(5932 #define IOART_INTVEC    0x000000ff      // R/W: INTerrupt vector field) 45.15 Tj
0 -47.1272 Td
(5933 ) 3.01 Tj
0 -48.4363 Td
(5934 // Fields in VER) 12.642 Tj
0 -49.7454 Td
(5935 #define IOART_VER_VERSION       0x000000ff) 28.294 Tj
0 -51.0545 Td
(5936 #define IOART_VER_MAXREDIR      0x00ff0000) 28.294 Tj
0 -52.3636 Td
(5937 #define MAXREDIRSHIFT           16) 23.478 Tj
0 -53.6727 Td
(5938 ) 3.01 Tj
0 -54.9818 Td
(5939 ) 3.01 Tj
0 -56.2909 Td
(5940 ) 3.01 Tj
0 -57.6 Td
(5941 ) 3.01 Tj
0 -58.9091 Td
(5942 ) 3.01 Tj
0 -60.2181 Td
(5943 ) 3.01 Tj
0 -61.5272 Td
(5944 ) 3.01 Tj
0 -62.8363 Td
(5945 ) 3.01 Tj
0 -64.1454 Td
(5946 ) 3.01 Tj
0 -65.4545 Td
(5947 ) 3.01 Tj
0 -66.7636 Td
(5948 ) 3.01 Tj
0 -68.0727 Td
(5949 ) 3.01 Tj
0 -72 Td
(Sheet 59) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/lapic.c  Page 1) 22.876 Tj
0 -3.92728 Td
(5950 #include "types.h") 13.846 Tj
0 -5.23637 Td
(5951 #include "mp.h") 12.04 Tj
0 -6.54546 Td
(5952 #include "defs.h") 13.244 Tj
0 -7.85455 Td
(5953 #include "param.h") 13.846 Tj
0 -9.16364 Td
(5954 #include "x86.h") 12.642 Tj
0 -10.4727 Td
(5955 #include "traps.h") 13.846 Tj
0 -11.7818 Td
(5956 #include "mmu.h") 12.642 Tj
0 -13.0909 Td
(5957 #include "proc.h") 13.244 Tj
0 -14.4 Td
(5958 ) 3.01 Tj
0 -15.7091 Td
(5959 enum {  // Local APIC registers) 21.672 Tj
0 -17.0182 Td
(5960   LAPIC_ID  = 0x0020,   // ID) 20.468 Tj
0 -18.3273 Td
(5961   LAPIC_VER = 0x0030,   // Version) 23.478 Tj
0 -19.6364 Td
(5962   LAPIC_TPR = 0x0080,   // Task Priority) 27.09 Tj
0 -20.9455 Td
(5963   LAPIC_APR = 0x0090,   // Arbitration Priority) 31.304 Tj
0 -22.2545 Td
(5964   LAPIC_PPR = 0x00A0,   // Processor Priority) 30.1 Tj
0 -23.5636 Td
(5965   LAPIC_EOI = 0x00B0,   // EOI) 21.07 Tj
0 -24.8727 Td
(5966   LAPIC_LDR = 0x00D0,   // Logical Destination) 30.702 Tj
0 -26.1818 Td
(5967   LAPIC_DFR = 0x00E0,   // Destination Format) 30.1 Tj
0 -27.4909 Td
(5968   LAPIC_SVR = 0x00F0,   // Spurious Interrupt Vector) 34.314 Tj
0 -28.8 Td
(5969   LAPIC_ISR = 0x0100,   // Interrupt Status \(8 registers\)) 37.324 Tj
0 -30.1091 Td
(5970   LAPIC_TMR = 0x0180,   // Trigger Mode \(8 registers\)) 34.916 Tj
0 -31.4182 Td
(5971   LAPIC_IRR = 0x0200,   // Interrupt Request \(8 registers\)) 37.926 Tj
0 -32.7273 Td
(5972   LAPIC_ESR = 0x0280,   // Error Status) 26.488 Tj
0 -34.0364 Td
(5973   LAPIC_ICRLO = 0x0300, // Interrupt Command) 29.498 Tj
0 -35.3454 Td
(5974   LAPIC_ICRHI = 0x0310, // Interrupt Command [63:32]) 34.314 Tj
0 -36.6545 Td
(5975   LAPIC_TIMER = 0x0320, // Local Vector Table 0 \(TIMER\)) 36.12 Tj
0 -37.9636 Td
(5976   LAPIC_PCINT = 0x0340, // Performance Counter LVT) 33.11 Tj
0 -39.2727 Td
(5977   LAPIC_LINT0 = 0x0350, // Local Vector Table 1 \(LINT0\)) 36.12 Tj
0 -40.5818 Td
(5978   LAPIC_LINT1 = 0x0360, // Local Vector Table 2 \(LINT1\)) 36.12 Tj
0 -41.8909 Td
(5979   LAPIC_ERROR = 0x0370, // Local Vector Table 3 \(ERROR\)) 36.12 Tj
0 -43.2 Td
(5980   LAPIC_TICR = 0x0380,  // Timer Initial Count) 30.702 Tj
0 -44.5091 Td
(5981   LAPIC_TCCR = 0x0390,  // Timer Current Count) 30.702 Tj
0 -45.8182 Td
(5982   LAPIC_TDCR = 0x03E0,  // Timer Divide Configuration) 34.916 Tj
0 -47.1272 Td
(5983 };) 4.214 Tj
0 -48.4363 Td
(5984 ) 3.01 Tj
0 -49.7454 Td
(5985 enum {  // LAPIC_SVR) 15.05 Tj
0 -51.0545 Td
(5986   LAPIC_ENABLE  = 0x00000100,   // Unit Enable) 30.702 Tj
0 -52.3636 Td
(5987   LAPIC_FOCUS   = 0x00000200,   // Focus Processor Checking Disable) 43.344 Tj
0 -53.6727 Td
(5988 };) 4.214 Tj
0 -54.9818 Td
(5989 ) 3.01 Tj
0 -56.2909 Td
(5990 ) 3.01 Tj
0 -57.6 Td
(5991 ) 3.01 Tj
0 -58.9091 Td
(5992 ) 3.01 Tj
0 -60.2181 Td
(5993 ) 3.01 Tj
0 -61.5272 Td
(5994 ) 3.01 Tj
0 -62.8363 Td
(5995 ) 3.01 Tj
0 -64.1454 Td
(5996 ) 3.01 Tj
0 -65.4545 Td
(5997 ) 3.01 Tj
0 -66.7636 Td
(5998 ) 3.01 Tj
0 -68.0727 Td
(5999 ) 3.01 Tj
0 -72 Td
(Sheet 59) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 67 67
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/lapic.c  Page 2) 22.876 Tj
0 -3.92728 Td
(6000 enum {  // LAPIC_ICRLO) 16.254 Tj
0 -5.23637 Td
(6001   // [14] IPI Trigger Mode Level \(RW\)) 25.284 Tj
0 -6.54546 Td
(6002   LAPIC_DEASSERT = 0x00000000,  // Deassert level-sensitive interrupt) 44.548 Tj
0 -7.85455 Td
(6003   LAPIC_ASSERT  = 0x00004000,   // Assert level-sensitive interrupt) 43.344 Tj
0 -9.16364 Td
(6004 ) 3.01 Tj
0 -10.4727 Td
(6005   // [17:16] Remote Read Status) 21.672 Tj
0 -11.7818 Td
(6006   LAPIC_INVALID = 0x00000000,   // Invalid) 28.294 Tj
0 -13.0909 Td
(6007   LAPIC_WAIT    = 0x00010000,   // In-Progress) 30.702 Tj
0 -14.4 Td
(6008   LAPIC_VALID   = 0x00020000,   // Valid) 27.09 Tj
0 -15.7091 Td
(6009 ) 3.01 Tj
0 -17.0182 Td
(6010   // [19:18] Destination Shorthand) 23.478 Tj
0 -18.3273 Td
(6011   LAPIC_FIELD   = 0x00000000,   // No shorthand) 31.304 Tj
0 -19.6364 Td
(6012   LAPIC_SELF    = 0x00040000,   // Self is single destination) 39.732 Tj
0 -20.9455 Td
(6013   LAPIC_ALLINC  = 0x00080000,   // All including self) 34.916 Tj
0 -22.2545 Td
(6014   LAPIC_ALLEXC  = 0x000C0000,   // All Excluding self) 34.916 Tj
0 -23.5636 Td
(6015 };) 4.214 Tj
0 -24.8727 Td
(6016 ) 3.01 Tj
0 -26.1818 Td
(6017 enum {  // LAPIC_ESR) 15.05 Tj
0 -27.4909 Td
(6018   LAPIC_SENDCS  = 0x00000001,     // Send CS Error) 33.11 Tj
0 -28.8 Td
(6019   LAPIC_RCVCS   = 0x00000002,     // Receive CS Error) 34.916 Tj
0 -30.1091 Td
(6020   LAPIC_SENDACCEPT = 0x00000004,  // Send Accept Error) 35.518 Tj
0 -31.4182 Td
(6021   LAPIC_RCVACCEPT = 0x00000008,   // Receive Accept Error) 37.324 Tj
0 -32.7273 Td
(6022   LAPIC_SENDVECTOR = 0x00000020,  // Send Illegal Vector) 36.722 Tj
0 -34.0364 Td
(6023   LAPIC_RCVVECTOR = 0x00000040,   // Receive Illegal Vector) 38.528 Tj
0 -35.3454 Td
(6024   LAPIC_REGISTER = 0x00000080,    // Illegal Register Address) 39.732 Tj
0 -36.6545 Td
(6025 };) 4.214 Tj
0 -37.9636 Td
(6026 ) 3.01 Tj
0 -39.2727 Td
(6027 enum {  // LAPIC_TIMER) 16.254 Tj
0 -40.5818 Td
(6028   // [17] Timer Mode \(RW\)) 18.06 Tj
0 -41.8909 Td
(6029   LAPIC_ONESHOT = 0x00000000,   // One-shot) 28.896 Tj
0 -43.2 Td
(6030   LAPIC_PERIODIC = 0x00020000,  // Periodic) 28.896 Tj
0 -44.5091 Td
(6031 ) 3.01 Tj
0 -45.8182 Td
(6032   // [19:18] Timer Base \(RW\)) 19.866 Tj
0 -47.1272 Td
(6033   LAPIC_CLKIN   = 0x00000000,   // use CLKIN as input) 34.916 Tj
0 -48.4363 Td
(6034   LAPIC_TMBASE  = 0x00040000,   // use TMBASE) 30.1 Tj
0 -49.7454 Td
(6035   LAPIC_DIVIDER = 0x00080000,   // use output of the divider) 39.13 Tj
0 -51.0545 Td
(6036 };) 4.214 Tj
0 -52.3636 Td
(6037 ) 3.01 Tj
0 -53.6727 Td
(6038 enum {  // LAPIC_TDCR) 15.652 Tj
0 -54.9818 Td
(6039   LAPIC_X2 = 0x00000000,        // divide by 2) 30.702 Tj
0 -56.2909 Td
(6040   LAPIC_X4 = 0x00000001,        // divide by 4) 30.702 Tj
0 -57.6 Td
(6041   LAPIC_X8 = 0x00000002,        // divide by 8) 30.702 Tj
0 -58.9091 Td
(6042   LAPIC_X16 = 0x00000003,       // divide by 16) 31.304 Tj
0 -60.2181 Td
(6043   LAPIC_X32 = 0x00000008,       // divide by 32) 31.304 Tj
0 -61.5272 Td
(6044   LAPIC_X64 = 0x00000009,       // divide by 64) 31.304 Tj
0 -62.8363 Td
(6045   LAPIC_X128 = 0x0000000A,      // divide by 128) 31.906 Tj
0 -64.1454 Td
(6046   LAPIC_X1 = 0x0000000B,        // divide by 1) 30.702 Tj
0 -65.4545 Td
(6047 };) 4.214 Tj
0 -66.7636 Td
(6048 ) 3.01 Tj
0 -68.0727 Td
(6049 ) 3.01 Tj
0 -72 Td
(Sheet 60) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/lapic.c  Page 3) 22.876 Tj
0 -3.92728 Td
(6050 uint *lapicaddr;) 12.642 Tj
0 -5.23637 Td
(6051 ) 3.01 Tj
0 -6.54546 Td
(6052 static int) 9.03 Tj
0 -7.85455 Td
(6053 lapic_read\(int r\)) 13.244 Tj
0 -9.16364 Td
(6054 {) 3.612 Tj
0 -10.4727 Td
(6055   return *\(lapicaddr+\(r/sizeof\(*lapicaddr\)\)\);) 30.1 Tj
0 -11.7818 Td
(6056 }) 3.612 Tj
0 -13.0909 Td
(6057 ) 3.01 Tj
0 -14.4 Td
(6058 static void) 9.632 Tj
0 -15.7091 Td
(6059 lapic_write\(int r, int data\)) 19.866 Tj
0 -17.0182 Td
(6060 {) 3.612 Tj
0 -18.3273 Td
(6061   *\(lapicaddr+\(r/sizeof\(*lapicaddr\)\)\) = data;) 30.1 Tj
0 -19.6364 Td
(6062 }) 3.612 Tj
0 -20.9455 Td
(6063 ) 3.01 Tj
0 -22.2545 Td
(6064 ) 3.01 Tj
0 -23.5636 Td
(6065 void) 5.418 Tj
0 -24.8727 Td
(6066 lapic_timerinit\(void\)) 15.652 Tj
0 -26.1818 Td
(6067 {) 3.612 Tj
0 -27.4909 Td
(6068   if\(!lapicaddr\)) 12.642 Tj
0 -28.8 Td
(6069     return;) 9.632 Tj
0 -30.1091 Td
(6070 ) 3.01 Tj
0 -31.4182 Td
(6071   lapic_write\(LAPIC_TDCR, LAPIC_X1\);) 24.682 Tj
0 -32.7273 Td
(6072   lapic_write\(LAPIC_TIMER, LAPIC_CLKIN | LAPIC_PERIODIC |) 37.324 Tj
0 -34.0364 Td
(6073 ) 3.01 Tj
8.42796 -34.0364 Td
(\(IRQ_OFFSET + IRQ_TIMER\)\);) 15.652 Tj
0 -35.3454 Td
(6074   lapic_write\(LAPIC_TCCR, 10000000\);) 24.682 Tj
0 -36.6545 Td
(6075   lapic_write\(LAPIC_TICR, 10000000\);) 24.682 Tj
0 -37.9636 Td
(6076 }) 3.612 Tj
0 -39.2727 Td
(6077 ) 3.01 Tj
0 -40.5818 Td
(6078 void) 5.418 Tj
0 -41.8909 Td
(6079 lapic_timerintr\(void\)) 15.652 Tj
0 -43.2 Td
(6080 {) 3.612 Tj
0 -44.5091 Td
(6081   if\(lapicaddr\)) 12.04 Tj
0 -45.8182 Td
(6082     lapic_write\(LAPIC_EOI, 0\);) 21.07 Tj
0 -47.1272 Td
(6083 }) 3.612 Tj
0 -48.4363 Td
(6084 ) 3.01 Tj
0 -49.7454 Td
(6085 void) 5.418 Tj
0 -51.0545 Td
(6086 lapic_init\(int c\)) 13.244 Tj
0 -52.3636 Td
(6087 {) 3.612 Tj
0 -53.6727 Td
(6088   uint r, lvt;) 11.438 Tj
0 -54.9818 Td
(6089 ) 3.01 Tj
0 -56.2909 Td
(6090   if\(!lapicaddr\)) 12.642 Tj
0 -57.6 Td
(6091     return;) 9.632 Tj
0 -58.9091 Td
(6092 ) 3.01 Tj
0 -60.2181 Td
(6093   lapic_write\(LAPIC_DFR, 0xFFFFFFFF\);    // Set dst format register) 43.344 Tj
0 -61.5272 Td
(6094   r = \(lapic_read\(LAPIC_ID\)>>24\) & 0xFF; // Read APIC ID) 36.722 Tj
0 -62.8363 Td
(6095   lapic_write\(LAPIC_LDR, \(1<<r\)<<24\);    // Set logical dst register to r) 46.956 Tj
0 -64.1454 Td
(6096   lapic_write\(LAPIC_TPR, 0xFF\);          // No interrupts for now) 42.14 Tj
0 -65.4545 Td
(6097 ) 3.01 Tj
0 -66.7636 Td
(6098   // Enable APIC) 12.642 Tj
0 -68.0727 Td
(6099   lapic_write\(LAPIC_SVR, LAPIC_ENABLE|\(IRQ_OFFSET+IRQ_SPURIOUS\)\);) 42.14 Tj
0 -72 Td
(Sheet 60) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 68 68
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/lapic.c  Page 4) 22.876 Tj
0 -3.92728 Td
(6100   // In virtual wire mode, set up the LINT0 and LINT1 as follows:) 42.14 Tj
0 -5.23637 Td
(6101   lapic_write\(LAPIC_LINT0, APIC_IMASK | APIC_EXTINT\);) 34.916 Tj
0 -6.54546 Td
(6102   lapic_write\(LAPIC_LINT1, APIC_IMASK | APIC_NMI\);) 33.11 Tj
0 -7.85455 Td
(6103 ) 3.01 Tj
0 -9.16364 Td
(6104   lapic_write\(LAPIC_EOI, 0\); // Ack any outstanding interrupts.) 40.936 Tj
0 -10.4727 Td
(6105 ) 3.01 Tj
0 -11.7818 Td
(6106   lvt = \(lapic_read\(LAPIC_VER\)>>16\) & 0xFF;) 28.896 Tj
0 -13.0909 Td
(6107   if\(lvt >= 4\)) 11.438 Tj
0 -14.4 Td
(6108     lapic_write\(LAPIC_PCINT, APIC_IMASK\);) 27.692 Tj
0 -15.7091 Td
(6109   lapic_write\(LAPIC_ERROR, IRQ_OFFSET+IRQ_ERROR\);) 32.508 Tj
0 -17.0182 Td
(6110   lapic_write\(LAPIC_ESR, 0\);) 19.866 Tj
0 -18.3273 Td
(6111   lapic_read\(LAPIC_ESR\);) 17.458 Tj
0 -19.6364 Td
(6112 ) 3.01 Tj
0 -20.9455 Td
(6113   // Issue an INIT Level De-Assert to synchronise arbitration ID's.) 43.344 Tj
0 -22.2545 Td
(6114   lapic_write\(LAPIC_ICRHI, 0\);) 21.07 Tj
0 -23.5636 Td
(6115   lapic_write\(LAPIC_ICRLO, LAPIC_ALLINC|APIC_LEVEL|) 33.712 Tj
0 -24.8727 Td
(6116                            LAPIC_DEASSERT|APIC_INIT\);) 34.916 Tj
0 -26.1818 Td
(6117   while\(lapic_read\(LAPIC_ICRLO\) & APIC_DELIVS\)) 30.702 Tj
0 -27.4909 Td
(6118     ;) 6.02 Tj
0 -28.8 Td
(6119 }) 3.612 Tj
0 -30.1091 Td
(6120 ) 3.01 Tj
0 -31.4182 Td
(6121 void) 5.418 Tj
0 -32.7273 Td
(6122 lapic_enableintr\(void\)) 16.254 Tj
0 -34.0364 Td
(6123 {) 3.612 Tj
0 -35.3454 Td
(6124   if\(lapicaddr\)) 12.04 Tj
0 -36.6545 Td
(6125     lapic_write\(LAPIC_TPR, 0\);) 21.07 Tj
0 -37.9636 Td
(6126 }) 3.612 Tj
0 -39.2727 Td
(6127 ) 3.01 Tj
0 -40.5818 Td
(6128 void) 5.418 Tj
0 -41.8909 Td
(6129 lapic_disableintr\(void\)) 16.856 Tj
0 -43.2 Td
(6130 {) 3.612 Tj
0 -44.5091 Td
(6131   if\(lapicaddr\)) 12.04 Tj
0 -45.8182 Td
(6132     lapic_write\(LAPIC_TPR, 0xFF\);) 22.876 Tj
0 -47.1272 Td
(6133 }) 3.612 Tj
0 -48.4363 Td
(6134 ) 3.01 Tj
0 -49.7454 Td
(6135 void) 5.418 Tj
0 -51.0545 Td
(6136 lapic_eoi\(void\)) 12.04 Tj
0 -52.3636 Td
(6137 {) 3.612 Tj
0 -53.6727 Td
(6138   if\(lapicaddr\)) 12.04 Tj
0 -54.9818 Td
(6139     lapic_write\(LAPIC_EOI, 0\);) 21.07 Tj
0 -56.2909 Td
(6140 }) 3.612 Tj
0 -57.6 Td
(6141 ) 3.01 Tj
0 -58.9091 Td
(6142 ) 3.01 Tj
0 -60.2181 Td
(6143 ) 3.01 Tj
0 -61.5272 Td
(6144 ) 3.01 Tj
0 -62.8363 Td
(6145 ) 3.01 Tj
0 -64.1454 Td
(6146 ) 3.01 Tj
0 -65.4545 Td
(6147 ) 3.01 Tj
0 -66.7636 Td
(6148 ) 3.01 Tj
0 -68.0727 Td
(6149 ) 3.01 Tj
0 -72 Td
(Sheet 61) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/lapic.c  Page 5) 22.876 Tj
0 -3.92728 Td
(6150 int) 4.816 Tj
0 -5.23637 Td
(6151 cpu\(void\)) 8.428 Tj
0 -6.54546 Td
(6152 {) 3.612 Tj
0 -7.85455 Td
(6153   int x;) 7.826 Tj
0 -9.16364 Td
(6154   if\(lapicaddr\)) 12.04 Tj
0 -10.4727 Td
(6155     x = \(lapic_read\(LAPIC_ID\)>>24\) & 0xFF;) 28.294 Tj
0 -11.7818 Td
(6156   else) 6.622 Tj
0 -13.0909 Td
(6157     x = 0;) 9.03 Tj
0 -14.4 Td
(6158   return x;) 9.632 Tj
0 -15.7091 Td
(6159 }) 3.612 Tj
0 -17.0182 Td
(6160 ) 3.01 Tj
0 -18.3273 Td
(6161 void) 5.418 Tj
0 -19.6364 Td
(6162 lapic_startap\(uchar apicid, int v\)) 23.478 Tj
0 -20.9455 Td
(6163 {) 3.612 Tj
0 -22.2545 Td
(6164   int crhi, i;) 11.438 Tj
0 -23.5636 Td
(6165   volatile int j = 0;) 15.652 Tj
0 -24.8727 Td
(6166 ) 3.01 Tj
0 -26.1818 Td
(6167   crhi = apicid<<24;) 15.05 Tj
0 -27.4909 Td
(6168   lapic_write\(LAPIC_ICRHI, crhi\);) 22.876 Tj
0 -28.8 Td
(6169   lapic_write\(LAPIC_ICRLO, LAPIC_FIELD|APIC_LEVEL|) 33.11 Tj
0 -30.1091 Td
(6170                            LAPIC_ASSERT|APIC_INIT\);) 33.712 Tj
0 -31.4182 Td
(6171 ) 3.01 Tj
0 -32.7273 Td
(6172   while\(j++ < 10000\) {;}) 17.458 Tj
0 -34.0364 Td
(6173   lapic_write\(LAPIC_ICRLO, LAPIC_FIELD|APIC_LEVEL|) 33.11 Tj
0 -35.3454 Td
(6174                            LAPIC_DEASSERT|APIC_INIT\);) 34.916 Tj
0 -36.6545 Td
(6175 ) 3.01 Tj
0 -37.9636 Td
(6176   while\(j++ < 1000000\) {;}) 18.662 Tj
0 -39.2727 Td
(6177 ) 3.01 Tj
0 -40.5818 Td
(6178   // in p9 code, this was i < 2, which is what the spec says on page B-3) 46.354 Tj
0 -41.8909 Td
(6179   for\(i = 0; i < 1; i++\){) 18.06 Tj
0 -43.2 Td
(6180     lapic_write\(LAPIC_ICRHI, crhi\);) 24.08 Tj
0 -44.5091 Td
(6181     lapic_write\(LAPIC_ICRLO, LAPIC_FIELD|APIC_EDGE|APIC_STARTUP|\(v/4096\)\);) 47.558 Tj
0 -45.8182 Td
(6182     while\(j++ < 100000\) {;}) 19.264 Tj
0 -47.1272 Td
(6183   }) 4.816 Tj
0 -48.4363 Td
(6184 }) 3.612 Tj
0 -49.7454 Td
(6185 ) 3.01 Tj
0 -51.0545 Td
(6186 ) 3.01 Tj
0 -52.3636 Td
(6187 ) 3.01 Tj
0 -53.6727 Td
(6188 ) 3.01 Tj
0 -54.9818 Td
(6189 ) 3.01 Tj
0 -56.2909 Td
(6190 ) 3.01 Tj
0 -57.6 Td
(6191 ) 3.01 Tj
0 -58.9091 Td
(6192 ) 3.01 Tj
0 -60.2181 Td
(6193 ) 3.01 Tj
0 -61.5272 Td
(6194 ) 3.01 Tj
0 -62.8363 Td
(6195 ) 3.01 Tj
0 -64.1454 Td
(6196 ) 3.01 Tj
0 -65.4545 Td
(6197 ) 3.01 Tj
0 -66.7636 Td
(6198 ) 3.01 Tj
0 -68.0727 Td
(6199 ) 3.01 Tj
0 -72 Td
(Sheet 61) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 69 69
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/ioapic.c  Page 1) 23.478 Tj
0 -3.92728 Td
(6200 #include "types.h") 13.846 Tj
0 -5.23637 Td
(6201 #include "mp.h") 12.04 Tj
0 -6.54546 Td
(6202 #include "defs.h") 13.244 Tj
0 -7.85455 Td
(6203 #include "x86.h") 12.642 Tj
0 -9.16364 Td
(6204 #include "traps.h") 13.846 Tj
0 -10.4727 Td
(6205 #include "ioapic.h") 14.448 Tj
0 -11.7818 Td
(6206 ) 3.01 Tj
0 -13.0909 Td
(6207 struct ioapic {) 12.04 Tj
0 -14.4 Td
(6208   uint ioregsel;  uint p01; uint p02; uint p03;) 31.304 Tj
0 -15.7091 Td
(6209   uint iowin;     uint p11; uint p12; uint p13;) 31.304 Tj
0 -17.0182 Td
(6210 };) 4.214 Tj
0 -18.3273 Td
(6211 ) 3.01 Tj
0 -19.6364 Td
(6212 ) 3.01 Tj
0 -20.9455 Td
(6213 #define IOAPIC_REDTBL_LO\(i\)  \(IOAPIC_REDTBL + \(i\) * 2\)) 35.518 Tj
0 -22.2545 Td
(6214 #define IOAPIC_REDTBL_HI\(i\)  \(IOAPIC_REDTBL_LO\(i\) + 1\)) 35.518 Tj
0 -23.5636 Td
(6215 ) 3.01 Tj
0 -24.8727 Td
(6216 static uint) 9.632 Tj
0 -26.1818 Td
(6217 ioapic_read\(struct ioapic *io, int reg\)) 26.488 Tj
0 -27.4909 Td
(6218 {) 3.612 Tj
0 -28.8 Td
(6219   io->ioregsel = reg;) 15.652 Tj
0 -30.1091 Td
(6220   return io->iowin;) 14.448 Tj
0 -31.4182 Td
(6221 }) 3.612 Tj
0 -32.7273 Td
(6222 ) 3.01 Tj
0 -34.0364 Td
(6223 static void) 9.632 Tj
0 -35.3454 Td
(6224 ioapic_write\(struct ioapic *io, int reg, uint val\)) 33.11 Tj
0 -36.6545 Td
(6225 {) 3.612 Tj
0 -37.9636 Td
(6226   io->ioregsel = reg;) 15.652 Tj
0 -39.2727 Td
(6227   io->iowin = val;) 13.846 Tj
0 -40.5818 Td
(6228 }) 3.612 Tj
0 -41.8909 Td
(6229 ) 3.01 Tj
0 -43.2 Td
(6230 void) 5.418 Tj
0 -44.5091 Td
(6231 ioapic_init\(void\)) 13.244 Tj
0 -45.8182 Td
(6232 {) 3.612 Tj
0 -47.1272 Td
(6233   struct ioapic *io;) 15.05 Tj
0 -48.4363 Td
(6234   uint l, h;) 10.234 Tj
0 -49.7454 Td
(6235   int nintr;) 10.234 Tj
0 -51.0545 Td
(6236   uchar id;) 9.632 Tj
0 -52.3636 Td
(6237   int i;) 7.826 Tj
0 -53.6727 Td
(6238 ) 3.01 Tj
0 -54.9818 Td
(6239   if\(!ismp\)) 9.632 Tj
0 -56.2909 Td
(6240     return;) 9.632 Tj
0 -57.6 Td
(6241 ) 3.01 Tj
0 -58.9091 Td
(6242   io = \(struct ioapic*\) IO_APIC_BASE;) 25.284 Tj
0 -60.2181 Td
(6243   l = ioapic_read\(io, IOAPIC_VER\);) 23.478 Tj
0 -61.5272 Td
(6244   nintr =  \(\(l & IOART_VER_MAXREDIR\) >> MAXREDIRSHIFT\) + 1;) 38.528 Tj
0 -62.8363 Td
(6245   id = ioapic_read\(io, IOAPIC_ID\) >> APIC_ID_SHIFT;) 33.712 Tj
0 -64.1454 Td
(6246   if\(id != ioapic_id\)) 15.652 Tj
0 -65.4545 Td
(6247     cprintf\("ioapic_init: id isn't equal to ioapic_id; not a MP\\n"\);) 43.946 Tj
0 -66.7636 Td
(6248   for\(i = 0; i < nintr; i++\) {) 21.07 Tj
0 -68.0727 Td
(6249     // active-hi and edge-triggered for ISA interrupts) 35.518 Tj
0 -72 Td
(Sheet 62) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/ioapic.c  Page 2) 23.478 Tj
0 -3.92728 Td
(6250     // Assume that pin 0 on the first I/O APIC is an ExtINT pin.) 41.538 Tj
0 -5.23637 Td
(6251     // Assume that pins 1-15 are ISA interrupts) 31.304 Tj
0 -6.54546 Td
(6252     l = ioapic_read\(io, IOAPIC_REDTBL_LO\(i\)\);) 30.1 Tj
0 -7.85455 Td
(6253     l = l & ~IOART_INTMASK;  // allow INTs) 28.294 Tj
0 -9.16364 Td
(6254     l |= IOART_INTMSET;) 16.856 Tj
0 -10.4727 Td
(6255     l = l & ~IOART_INTPOL;   // active hi) 27.692 Tj
0 -11.7818 Td
(6256     l = l & ~IOART_TRGRMOD;  // edgee triggered) 31.304 Tj
0 -13.0909 Td
(6257     l = l & ~IOART_DELMOD;   // fixed) 25.284 Tj
0 -14.4 Td
(6258     l = l & ~IOART_DESTMOD;  // physical mode) 30.1 Tj
0 -15.7091 Td
(6259     l = l | \(IRQ_OFFSET + i\); // vector) 26.488 Tj
0 -17.0182 Td
(6260     ioapic_write\(io, IOAPIC_REDTBL_LO\(i\), l\);) 30.1 Tj
0 -18.3273 Td
(6261     h = ioapic_read\(io, IOAPIC_REDTBL_HI\(i\)\);) 30.1 Tj
0 -19.6364 Td
(6262     h &= ~IOART_DEST;) 15.652 Tj
0 -20.9455 Td
(6263     ioapic_write\(io, IOAPIC_REDTBL_HI\(i\), h\);) 30.1 Tj
0 -22.2545 Td
(6264   }) 4.816 Tj
0 -23.5636 Td
(6265 }) 3.612 Tj
0 -24.8727 Td
(6266 ) 3.01 Tj
0 -26.1818 Td
(6267 void) 5.418 Tj
0 -27.4909 Td
(6268 ioapic_enable \(int irq, int cpunum\)) 24.08 Tj
0 -28.8 Td
(6269 {) 3.612 Tj
0 -30.1091 Td
(6270   uint l, h;) 10.234 Tj
0 -31.4182 Td
(6271   struct ioapic *io;) 15.05 Tj
0 -32.7273 Td
(6272 ) 3.01 Tj
0 -34.0364 Td
(6273   if\(!ismp\)) 9.632 Tj
0 -35.3454 Td
(6274     return;) 9.632 Tj
0 -36.6545 Td
(6275 ) 3.01 Tj
0 -37.9636 Td
(6276   io = \(struct ioapic*\) IO_APIC_BASE;) 25.284 Tj
0 -39.2727 Td
(6277   l = ioapic_read\(io, IOAPIC_REDTBL_LO\(irq\)\);) 30.1 Tj
0 -40.5818 Td
(6278   l = l & ~IOART_INTMASK;  // allow INTs) 27.09 Tj
0 -41.8909 Td
(6279   ioapic_write\(io, IOAPIC_REDTBL_LO\(irq\), l\);) 30.1 Tj
0 -43.2 Td
(6280   h = ioapic_read\(io, IOAPIC_REDTBL_HI\(irq\)\);) 30.1 Tj
0 -44.5091 Td
(6281   h &= ~IOART_DEST;) 14.448 Tj
0 -45.8182 Td
(6282   h |= \(cpunum << APIC_ID_SHIFT\);) 22.876 Tj
0 -47.1272 Td
(6283   ioapic_write\(io, IOAPIC_REDTBL_HI\(irq\), h\);) 30.1 Tj
0 -48.4363 Td
(6284 }) 3.612 Tj
0 -49.7454 Td
(6285 ) 3.01 Tj
0 -51.0545 Td
(6286 ) 3.01 Tj
0 -52.3636 Td
(6287 ) 3.01 Tj
0 -53.6727 Td
(6288 ) 3.01 Tj
0 -54.9818 Td
(6289 ) 3.01 Tj
0 -56.2909 Td
(6290 ) 3.01 Tj
0 -57.6 Td
(6291 ) 3.01 Tj
0 -58.9091 Td
(6292 ) 3.01 Tj
0 -60.2181 Td
(6293 ) 3.01 Tj
0 -61.5272 Td
(6294 ) 3.01 Tj
0 -62.8363 Td
(6295 ) 3.01 Tj
0 -64.1454 Td
(6296 ) 3.01 Tj
0 -65.4545 Td
(6297 ) 3.01 Tj
0 -66.7636 Td
(6298 ) 3.01 Tj
0 -68.0727 Td
(6299 ) 3.01 Tj
0 -72 Td
(Sheet 62) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 70 70
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/picirq.c  Page 1) 23.478 Tj
0 -3.92728 Td
(6300 #include "types.h") 13.846 Tj
0 -5.23637 Td
(6301 #include "x86.h") 12.642 Tj
0 -6.54546 Td
(6302 #include "traps.h") 13.846 Tj
0 -7.85455 Td
(6303 #include "defs.h") 13.244 Tj
0 -9.16364 Td
(6304 ) 3.01 Tj
0 -10.4727 Td
(6305 // I/O Addresses of the two 8259A programmable interrupt controllers) 43.946 Tj
0 -11.7818 Td
(6306 #define IO_PIC1         0x20    // Master \(IRQs 0-7\)) 34.314 Tj
0 -13.0909 Td
(6307 #define IO_PIC2         0xA0    // Slave \(IRQs 8-15\)) 34.314 Tj
0 -14.4 Td
(6308 ) 3.01 Tj
0 -15.7091 Td
(6309 #define IRQ_SLAVE       2       // IRQ at which slave connects to master) 46.354 Tj
0 -17.0182 Td
(6310 ) 3.01 Tj
0 -18.3273 Td
(6311 // Current IRQ mask.) 15.05 Tj
0 -19.6364 Td
(6312 // Initial IRQ mask has interrupt 2 enabled \(for slave 8259A\).) 40.334 Tj
0 -20.9455 Td
(6313 static ushort irq_mask_8259A = 0xFFFF & ~\(1<<IRQ_SLAVE\);) 36.722 Tj
0 -22.2545 Td
(6314 ) 3.01 Tj
0 -23.5636 Td
(6315 static void) 9.632 Tj
0 -24.8727 Td
(6316 irq_setmask_8259A\(ushort mask\)) 21.07 Tj
0 -26.1818 Td
(6317 {) 3.612 Tj
0 -27.4909 Td
(6318   irq_mask_8259A = mask;) 17.458 Tj
0 -28.8 Td
(6319 ) 3.01 Tj
0 -30.1091 Td
(6320   outb\(IO_PIC1+1, \(char\)mask\);) 21.07 Tj
0 -31.4182 Td
(6321   outb\(IO_PIC2+1, \(char\)\(mask >> 8\)\);) 25.284 Tj
0 -32.7273 Td
(6322 }) 3.612 Tj
0 -34.0364 Td
(6323 ) 3.01 Tj
0 -35.3454 Td
(6324 void) 5.418 Tj
0 -36.6545 Td
(6325 irq_enable\(int irq\)) 14.448 Tj
0 -37.9636 Td
(6326 {) 3.612 Tj
0 -39.2727 Td
(6327   irq_setmask_8259A\(irq_mask_8259A & ~\(1<<irq\)\);) 31.906 Tj
0 -40.5818 Td
(6328 }) 3.612 Tj
0 -41.8909 Td
(6329 ) 3.01 Tj
0 -43.2 Td
(6330 // Initialize the 8259A interrupt controllers.) 30.702 Tj
0 -44.5091 Td
(6331 void) 5.418 Tj
0 -45.8182 Td
(6332 pic_init\(void\)) 11.438 Tj
0 -47.1272 Td
(6333 {) 3.612 Tj
0 -48.4363 Td
(6334   // mask all interrupts) 17.458 Tj
0 -49.7454 Td
(6335   outb\(IO_PIC1+1, 0xFF\);) 17.458 Tj
0 -51.0545 Td
(6336   outb\(IO_PIC2+1, 0xFF\);) 17.458 Tj
0 -52.3636 Td
(6337 ) 3.01 Tj
0 -53.6727 Td
(6338   // Set up master \(8259A-1\)) 19.866 Tj
0 -54.9818 Td
(6339 ) 3.01 Tj
0 -56.2909 Td
(6340   // ICW1:  0001g0hi) 15.05 Tj
0 -57.6 Td
(6341   //    g:  0 = edge triggering, 1 = level triggering) 34.916 Tj
0 -58.9091 Td
(6342   //    h:  0 = cascaded PICs, 1 = master only) 30.702 Tj
0 -60.2181 Td
(6343   //    i:  0 = no ICW4, 1 = ICW4 required) 28.294 Tj
0 -61.5272 Td
(6344   outb\(IO_PIC1, 0x11\);) 16.254 Tj
0 -62.8363 Td
(6345 ) 3.01 Tj
0 -64.1454 Td
(6346   // ICW2:  Vector offset) 18.06 Tj
0 -65.4545 Td
(6347   outb\(IO_PIC1+1, IRQ_OFFSET\);) 21.07 Tj
0 -66.7636 Td
(6348 ) 3.01 Tj
0 -68.0727 Td
(6349 ) 3.01 Tj
0 -72 Td
(Sheet 63) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/picirq.c  Page 2) 23.478 Tj
0 -3.92728 Td
(6350   // ICW3:  \(master PIC\) bit mask of IR lines connected to slaves) 42.14 Tj
0 -5.23637 Td
(6351   //        \(slave PIC\) 3-bit # of slave's connection to master) 40.936 Tj
0 -6.54546 Td
(6352   outb\(IO_PIC1+1, 1<<IRQ_SLAVE\);) 22.274 Tj
0 -7.85455 Td
(6353 ) 3.01 Tj
0 -9.16364 Td
(6354   // ICW4:  000nbmap) 15.05 Tj
0 -10.4727 Td
(6355   //    n:  1 = special fully nested mode) 27.692 Tj
0 -11.7818 Td
(6356   //    b:  1 = buffered mode) 20.468 Tj
0 -13.0909 Td
(6357   //    m:  0 = slave PIC, 1 = master PIC) 27.692 Tj
0 -14.4 Td
(6358   //      \(ignored when b is 0, as the master/slave role) 36.722 Tj
0 -15.7091 Td
(6359   //      can be hardwired\).) 19.866 Tj
0 -17.0182 Td
(6360   //    a:  1 = Automatic EOI mode) 23.478 Tj
0 -18.3273 Td
(6361   //    p:  0 = MCS-80/85 mode, 1 = intel x86 mode) 33.11 Tj
0 -19.6364 Td
(6362   outb\(IO_PIC1+1, 0x3\);) 16.856 Tj
0 -20.9455 Td
(6363 ) 3.01 Tj
0 -22.2545 Td
(6364   // Set up slave \(8259A-2\)) 19.264 Tj
0 -23.5636 Td
(6365   outb\(IO_PIC2, 0x11\);                  // ICW1) 31.304 Tj
0 -24.8727 Td
(6366   outb\(IO_PIC2+1, IRQ_OFFSET + 8\);      // ICW2) 31.304 Tj
0 -26.1818 Td
(6367   outb\(IO_PIC2+1, IRQ_SLAVE\);           // ICW3) 31.304 Tj
0 -27.4909 Td
(6368   // NB Automatic EOI mode doesn't tend to work on the slave.) 39.732 Tj
0 -28.8 Td
(6369   // Linux source code says it's "to be investigated".) 35.518 Tj
0 -30.1091 Td
(6370   outb\(IO_PIC2+1, 0x3\);                 // ICW4) 31.304 Tj
0 -31.4182 Td
(6371 ) 3.01 Tj
0 -32.7273 Td
(6372   // OCW3:  0ef01prs) 15.05 Tj
0 -34.0364 Td
(6373   //   ef:  0x = NOP, 10 = clear specific mask, 11 = set specific mask) 45.15 Tj
0 -35.3454 Td
(6374   //    p:  0 = no polling, 1 = polling mode) 29.498 Tj
0 -36.6545 Td
(6375   //   rs:  0x = NOP, 10 = read IRR, 11 = read ISR) 33.11 Tj
0 -37.9636 Td
(6376   outb\(IO_PIC1, 0x68\);             // clear specific mask) 37.324 Tj
0 -39.2727 Td
(6377   outb\(IO_PIC1, 0x0a\);             // read IRR by default) 37.324 Tj
0 -40.5818 Td
(6378 ) 3.01 Tj
0 -41.8909 Td
(6379   outb\(IO_PIC2, 0x68\);             // OCW3) 28.294 Tj
0 -43.2 Td
(6380   outb\(IO_PIC2, 0x0a\);             // OCW3) 28.294 Tj
0 -44.5091 Td
(6381 ) 3.01 Tj
0 -45.8182 Td
(6382   if\(irq_mask_8259A != 0xFFFF\)) 21.07 Tj
0 -47.1272 Td
(6383     irq_setmask_8259A\(irq_mask_8259A\);) 25.886 Tj
0 -48.4363 Td
(6384 }) 3.612 Tj
0 -49.7454 Td
(6385 ) 3.01 Tj
0 -51.0545 Td
(6386 ) 3.01 Tj
0 -52.3636 Td
(6387 ) 3.01 Tj
0 -53.6727 Td
(6388 ) 3.01 Tj
0 -54.9818 Td
(6389 ) 3.01 Tj
0 -56.2909 Td
(6390 ) 3.01 Tj
0 -57.6 Td
(6391 ) 3.01 Tj
0 -58.9091 Td
(6392 ) 3.01 Tj
0 -60.2181 Td
(6393 ) 3.01 Tj
0 -61.5272 Td
(6394 ) 3.01 Tj
0 -62.8363 Td
(6395 ) 3.01 Tj
0 -64.1454 Td
(6396 ) 3.01 Tj
0 -65.4545 Td
(6397 ) 3.01 Tj
0 -66.7636 Td
(6398 ) 3.01 Tj
0 -68.0727 Td
(6399 ) 3.01 Tj
0 -72 Td
(Sheet 63) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 71 71
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/console.c  Page 1) 24.08 Tj
0 -3.92728 Td
(6400 #include "types.h") 13.846 Tj
0 -5.23637 Td
(6401 #include "x86.h") 12.642 Tj
0 -6.54546 Td
(6402 #include "traps.h") 13.846 Tj
0 -7.85455 Td
(6403 #include "defs.h") 13.244 Tj
0 -9.16364 Td
(6404 #include "spinlock.h") 15.652 Tj
0 -10.4727 Td
(6405 #include "dev.h") 12.642 Tj
0 -11.7818 Td
(6406 #include "param.h") 13.846 Tj
0 -13.0909 Td
(6407 #include "mmu.h") 12.642 Tj
0 -14.4 Td
(6408 ) 3.01 Tj
0 -15.7091 Td
(6409 struct spinlock console_lock;) 20.468 Tj
0 -17.0182 Td
(6410 int panicked = 0;) 13.244 Tj
0 -18.3273 Td
(6411 int use_console_lock = 0;) 18.06 Tj
0 -19.6364 Td
(6412 ) 3.01 Tj
0 -20.9455 Td
(6413 // Copy console output to parallel port, which you can tell) 38.528 Tj
0 -22.2545 Td
(6414 // .bochsrc to copy to the stdout:) 23.478 Tj
0 -23.5636 Td
(6415 //   parport1: enabled=1, file="/dev/stdout") 29.498 Tj
0 -24.8727 Td
(6416 static void) 9.632 Tj
0 -26.1818 Td
(6417 lpt_putc\(int c\)) 12.04 Tj
0 -27.4909 Td
(6418 {) 3.612 Tj
0 -28.8 Td
(6419   int i;) 7.826 Tj
0 -30.1091 Td
(6420 ) 3.01 Tj
0 -31.4182 Td
(6421   for\(i = 0; !\(inb\(0x378+1\) & 0x80\) && i < 12800; i++\)) 35.518 Tj
0 -32.7273 Td
(6422     ;) 6.02 Tj
0 -34.0364 Td
(6423   outb\(0x378+0, c\);) 14.448 Tj
0 -35.3454 Td
(6424   outb\(0x378+2, 0x08|0x04|0x01\);) 22.274 Tj
0 -36.6545 Td
(6425   outb\(0x378+2, 0x08\);) 16.254 Tj
0 -37.9636 Td
(6426 }) 3.612 Tj
0 -39.2727 Td
(6427 ) 3.01 Tj
0 -40.5818 Td
(6428 static void) 9.632 Tj
0 -41.8909 Td
(6429 cons_putc\(int c\)) 12.642 Tj
0 -43.2 Td
(6430 {) 3.612 Tj
0 -44.5091 Td
(6431   int crtport = 0x3d4; // io port of CGA) 27.09 Tj
0 -45.8182 Td
(6432   ushort *crt = \(ushort*\) 0xB8000; // base of CGA memory) 36.722 Tj
0 -47.1272 Td
(6433   int ind;) 9.03 Tj
0 -48.4363 Td
(6434 ) 3.01 Tj
0 -49.7454 Td
(6435   if\(panicked\){) 12.04 Tj
0 -51.0545 Td
(6436     cli\(\);) 9.03 Tj
0 -52.3636 Td
(6437     for\(;;\)) 9.632 Tj
0 -53.6727 Td
(6438       ;) 7.224 Tj
0 -54.9818 Td
(6439   }) 4.816 Tj
0 -56.2909 Td
(6440 ) 3.01 Tj
0 -57.6 Td
(6441   lpt_putc\(c\);) 11.438 Tj
0 -58.9091 Td
(6442 ) 3.01 Tj
0 -60.2181 Td
(6443   // cursor position, 16 bits, col + 80*row) 28.896 Tj
0 -61.5272 Td
(6444   outb\(crtport, 14\);) 15.05 Tj
0 -62.8363 Td
(6445   ind = inb\(crtport + 1\) << 8;) 21.07 Tj
0 -64.1454 Td
(6446   outb\(crtport, 15\);) 15.05 Tj
0 -65.4545 Td
(6447   ind |= inb\(crtport + 1\);) 18.662 Tj
0 -66.7636 Td
(6448 ) 3.01 Tj
0 -68.0727 Td
(6449   c &= 0xff;) 10.234 Tj
0 -72 Td
(Sheet 64) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/console.c  Page 2) 24.08 Tj
0 -3.92728 Td
(6450   if\(c == '\\n'\){) 12.642 Tj
0 -5.23637 Td
(6451     ind -= \(ind % 80\);) 16.254 Tj
0 -6.54546 Td
(6452     ind += 80;) 11.438 Tj
0 -7.85455 Td
(6453   } else {) 9.03 Tj
0 -9.16364 Td
(6454     c |= 0x0700; // black on white) 23.478 Tj
0 -10.4727 Td
(6455     crt[ind] = c;) 13.244 Tj
0 -11.7818 Td
(6456     ind++;) 9.03 Tj
0 -13.0909 Td
(6457   }) 4.816 Tj
0 -14.4 Td
(6458 ) 3.01 Tj
0 -15.7091 Td
(6459   if\(\(ind / 80\) >= 24\){) 16.856 Tj
0 -17.0182 Td
(6460     // scroll up) 12.642 Tj
0 -18.3273 Td
(6461     memmove\(crt, crt + 80, sizeof\(crt[0]\) * \(23 * 80\)\);) 36.12 Tj
0 -19.6364 Td
(6462     ind -= 80;) 11.438 Tj
0 -20.9455 Td
(6463     memset\(crt + ind, 0, sizeof\(crt[0]\) * \(\(24 * 80\) - ind\)\);) 39.732 Tj
0 -22.2545 Td
(6464   }) 4.816 Tj
0 -23.5636 Td
(6465 ) 3.01 Tj
0 -24.8727 Td
(6466   outb\(crtport, 14\);) 15.05 Tj
0 -26.1818 Td
(6467   outb\(crtport + 1, ind >> 8\);) 21.07 Tj
0 -27.4909 Td
(6468   outb\(crtport, 15\);) 15.05 Tj
0 -28.8 Td
(6469   outb\(crtport + 1, ind\);) 18.06 Tj
0 -30.1091 Td
(6470 }) 3.612 Tj
0 -31.4182 Td
(6471 ) 3.01 Tj
0 -32.7273 Td
(6472 void) 5.418 Tj
0 -34.0364 Td
(6473 printint\(int xx, int base, int sgn\)) 24.08 Tj
0 -35.3454 Td
(6474 {) 3.612 Tj
0 -36.6545 Td
(6475   char buf[16];) 12.04 Tj
0 -37.9636 Td
(6476   char digits[] = "0123456789ABCDEF";) 25.284 Tj
0 -39.2727 Td
(6477   int i = 0, neg = 0;) 15.652 Tj
0 -40.5818 Td
(6478   uint x;) 8.428 Tj
0 -41.8909 Td
(6479 ) 3.01 Tj
0 -43.2 Td
(6480   if\(sgn && xx < 0\){) 15.05 Tj
0 -44.5091 Td
(6481     neg = 1;) 10.234 Tj
0 -45.8182 Td
(6482     x = 0 - xx;) 12.04 Tj
0 -47.1272 Td
(6483   } else {) 9.03 Tj
0 -48.4363 Td
(6484     x = xx;) 9.632 Tj
0 -49.7454 Td
(6485   }) 4.816 Tj
0 -51.0545 Td
(6486 ) 3.01 Tj
0 -52.3636 Td
(6487   do {) 6.622 Tj
0 -53.6727 Td
(6488     buf[i++] = digits[x % base];) 22.274 Tj
0 -54.9818 Td
(6489   } while\(\(x /= base\) != 0\);) 19.866 Tj
0 -56.2909 Td
(6490   if\(neg\)) 8.428 Tj
0 -57.6 Td
(6491     buf[i++] = '-';) 14.448 Tj
0 -58.9091 Td
(6492 ) 3.01 Tj
0 -60.2181 Td
(6493   while\(--i >= 0\)) 13.244 Tj
0 -61.5272 Td
(6494     cons_putc\(buf[i]\);) 16.254 Tj
0 -62.8363 Td
(6495 }) 3.612 Tj
0 -64.1454 Td
(6496 ) 3.01 Tj
0 -65.4545 Td
(6497 ) 3.01 Tj
0 -66.7636 Td
(6498 ) 3.01 Tj
0 -68.0727 Td
(6499 ) 3.01 Tj
0 -72 Td
(Sheet 64) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 72 72
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/console.c  Page 3) 24.08 Tj
0 -3.92728 Td
(6500 // Print to the console. only understands %d, %x, %p, %s.) 37.324 Tj
0 -5.23637 Td
(6501 void) 5.418 Tj
0 -6.54546 Td
(6502 cprintf\(char *fmt, ...\)) 16.856 Tj
0 -7.85455 Td
(6503 {) 3.612 Tj
0 -9.16364 Td
(6504   int i, state = 0, c, locking = 0;) 24.08 Tj
0 -10.4727 Td
(6505   uint *ap = \(uint*\)\(void*\)&fmt + 1;) 24.682 Tj
0 -11.7818 Td
(6506 ) 3.01 Tj
0 -13.0909 Td
(6507   if\(use_console_lock\){) 16.856 Tj
0 -14.4 Td
(6508     locking = 1;) 12.642 Tj
0 -15.7091 Td
(6509     acquire\(&console_lock\);) 19.264 Tj
0 -17.0182 Td
(6510   }) 4.816 Tj
0 -18.3273 Td
(6511 ) 3.01 Tj
0 -19.6364 Td
(6512   for\(i = 0; fmt[i]; i++\){) 18.662 Tj
0 -20.9455 Td
(6513     c = fmt[i] & 0xff;) 16.254 Tj
0 -22.2545 Td
(6514     if\(state == 0\){) 14.448 Tj
0 -23.5636 Td
(6515       if\(c == '%'\){) 14.448 Tj
0 -24.8727 Td
(6516         state = '%';) 15.05 Tj
0 -26.1818 Td
(6517       } else {) 11.438 Tj
0 -27.4909 Td
(6518         cons_putc\(c\);) 15.652 Tj
0 -28.8 Td
(6519       }) 7.224 Tj
0 -30.1091 Td
(6520     } else if\(state == '%'\){) 19.866 Tj
0 -31.4182 Td
(6521       if\(c == 'd'\){) 14.448 Tj
0 -32.7273 Td
(6522         printint\(*ap, 10, 1\);) 20.468 Tj
0 -34.0364 Td
(6523         ap++;) 10.836 Tj
0 -35.3454 Td
(6524       } else if\(c == 'x' || c == 'p'\){) 25.886 Tj
0 -36.6545 Td
(6525         printint\(*ap, 16, 0\);) 20.468 Tj
0 -37.9636 Td
(6526         ap++;) 10.836 Tj
0 -39.2727 Td
(6527       } else if\(c == 's'\){) 18.662 Tj
0 -40.5818 Td
(6528         char *s = \(char*\)*ap;) 20.468 Tj
0 -41.8909 Td
(6529         ap++;) 10.836 Tj
0 -43.2 Td
(6530         if\(s == 0\){) 14.448 Tj
0 -44.5091 Td
(6531           cons_putc\('0'\);) 18.06 Tj
0 -45.8182 Td
(6532         }else{) 11.438 Tj
0 -47.1272 Td
(6533           while\(*s != 0\){) 18.06 Tj
0 -48.4363 Td
(6534             cons_putc\(*s\);) 18.662 Tj
0 -49.7454 Td
(6535             s++;) 12.642 Tj
0 -51.0545 Td
(6536           }) 9.632 Tj
0 -52.3636 Td
(6537         }) 8.428 Tj
0 -53.6727 Td
(6538       } else if\(c == '%'\){) 18.662 Tj
0 -54.9818 Td
(6539         cons_putc\(c\);) 15.652 Tj
0 -56.2909 Td
(6540       } else {) 11.438 Tj
0 -57.6 Td
(6541         // Unknown % sequence.  Print it to draw attention.) 38.528 Tj
0 -58.9091 Td
(6542         cons_putc\('%'\);) 16.856 Tj
0 -60.2181 Td
(6543         cons_putc\(c\);) 15.652 Tj
0 -61.5272 Td
(6544       }) 7.224 Tj
0 -62.8363 Td
(6545       state = 0;) 12.642 Tj
0 -64.1454 Td
(6546     }) 6.02 Tj
0 -65.4545 Td
(6547   }) 4.816 Tj
0 -66.7636 Td
(6548 ) 3.01 Tj
0 -68.0727 Td
(6549 ) 3.01 Tj
0 -72 Td
(Sheet 65) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/console.c  Page 4) 24.08 Tj
0 -3.92728 Td
(6550   if\(locking\)) 10.836 Tj
0 -5.23637 Td
(6551     release\(&console_lock\);) 19.264 Tj
0 -6.54546 Td
(6552 }) 3.612 Tj
0 -7.85455 Td
(6553 ) 3.01 Tj
0 -9.16364 Td
(6554 void) 5.418 Tj
0 -10.4727 Td
(6555 panic\(char *s\)) 11.438 Tj
0 -11.7818 Td
(6556 {) 3.612 Tj
0 -13.0909 Td
(6557   int i;) 7.826 Tj
0 -14.4 Td
(6558   uint pcs[10];) 12.04 Tj
0 -15.7091 Td
(6559 ) 3.01 Tj
0 -17.0182 Td
(6560   __asm __volatile\("cli"\);) 18.662 Tj
0 -18.3273 Td
(6561   use_console_lock = 0;) 16.856 Tj
0 -19.6364 Td
(6562   cprintf\("panic \(%d\): ", cpu\(\)\);) 22.876 Tj
0 -20.9455 Td
(6563   cprintf\(s, 0\);) 12.642 Tj
0 -22.2545 Td
(6564   cprintf\("\\n", 0\);) 14.448 Tj
0 -23.5636 Td
(6565   getcallerpcs\(&s, pcs\);) 17.458 Tj
0 -24.8727 Td
(6566   for\(i=0; i<10; i++\)) 15.652 Tj
0 -26.1818 Td
(6567     cprintf\(" %p", pcs[i]\);) 19.264 Tj
0 -27.4909 Td
(6568   panicked = 1; // freeze other CPU) 24.08 Tj
0 -28.8 Td
(6569   for\(;;\)) 8.428 Tj
0 -30.1091 Td
(6570     ;) 6.02 Tj
0 -31.4182 Td
(6571 }) 3.612 Tj
0 -32.7273 Td
(6572 ) 3.01 Tj
0 -34.0364 Td
(6573 int) 4.816 Tj
0 -35.3454 Td
(6574 console_write\(int minor, char *buf, int n\)) 28.294 Tj
0 -36.6545 Td
(6575 {) 3.612 Tj
0 -37.9636 Td
(6576   int i;) 7.826 Tj
0 -39.2727 Td
(6577 ) 3.01 Tj
0 -40.5818 Td
(6578   acquire\(&console_lock\);) 18.06 Tj
0 -41.8909 Td
(6579 ) 3.01 Tj
0 -43.2 Td
(6580   for\(i = 0; i < n; i++\) {) 18.662 Tj
0 -44.5091 Td
(6581     cons_putc\(buf[i] & 0xff\);) 20.468 Tj
0 -45.8182 Td
(6582   }) 4.816 Tj
0 -47.1272 Td
(6583 ) 3.01 Tj
0 -48.4363 Td
(6584   release\(&console_lock\);) 18.06 Tj
0 -49.7454 Td
(6585 ) 3.01 Tj
0 -51.0545 Td
(6586   return n;) 9.632 Tj
0 -52.3636 Td
(6587 }) 3.612 Tj
0 -53.6727 Td
(6588 ) 3.01 Tj
0 -54.9818 Td
(6589 ) 3.01 Tj
0 -56.2909 Td
(6590 ) 3.01 Tj
0 -57.6 Td
(6591 ) 3.01 Tj
0 -58.9091 Td
(6592 ) 3.01 Tj
0 -60.2181 Td
(6593 ) 3.01 Tj
0 -61.5272 Td
(6594 ) 3.01 Tj
0 -62.8363 Td
(6595 ) 3.01 Tj
0 -64.1454 Td
(6596 ) 3.01 Tj
0 -65.4545 Td
(6597 ) 3.01 Tj
0 -66.7636 Td
(6598 ) 3.01 Tj
0 -68.0727 Td
(6599 ) 3.01 Tj
0 -72 Td
(Sheet 65) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 73 73
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/console.c  Page 5) 24.08 Tj
0 -3.92728 Td
(6600 #define KBSTATP         0x64    // kbd controller status port\(I\)) 41.538 Tj
0 -5.23637 Td
(6601 #define KBS_DIB         0x01    // kbd data in buffer) 34.916 Tj
0 -6.54546 Td
(6602 #define KBDATAP         0x60    // kbd data port\(I\)) 33.712 Tj
0 -7.85455 Td
(6603 ) 3.01 Tj
0 -9.16364 Td
(6604 #define NO              0) 18.06 Tj
0 -10.4727 Td
(6605 ) 3.01 Tj
0 -11.7818 Td
(6606 #define SHIFT           \(1<<0\)) 21.07 Tj
0 -13.0909 Td
(6607 #define CTL             \(1<<1\)) 21.07 Tj
0 -14.4 Td
(6608 #define ALT             \(1<<2\)) 21.07 Tj
0 -15.7091 Td
(6609 ) 3.01 Tj
0 -17.0182 Td
(6610 #define CAPSLOCK        \(1<<3\)) 21.07 Tj
0 -18.3273 Td
(6611 #define NUMLOCK         \(1<<4\)) 21.07 Tj
0 -19.6364 Td
(6612 #define SCROLLLOCK      \(1<<5\)) 21.07 Tj
0 -20.9455 Td
(6613 ) 3.01 Tj
0 -22.2545 Td
(6614 #define E0ESC           \(1<<6\)) 21.07 Tj
0 -23.5636 Td
(6615 ) 3.01 Tj
0 -24.8727 Td
(6616 // Special keycodes) 14.448 Tj
0 -26.1818 Td
(6617 #define KEY_HOME        0xE0) 19.866 Tj
0 -27.4909 Td
(6618 #define KEY_END         0xE1) 19.866 Tj
0 -28.8 Td
(6619 #define KEY_UP          0xE2) 19.866 Tj
0 -30.1091 Td
(6620 #define KEY_DN          0xE3) 19.866 Tj
0 -31.4182 Td
(6621 #define KEY_LF          0xE4) 19.866 Tj
0 -32.7273 Td
(6622 #define KEY_RT          0xE5) 19.866 Tj
0 -34.0364 Td
(6623 #define KEY_PGUP        0xE6) 19.866 Tj
0 -35.3454 Td
(6624 #define KEY_PGDN        0xE7) 19.866 Tj
0 -36.6545 Td
(6625 #define KEY_INS         0xE8) 19.866 Tj
0 -37.9636 Td
(6626 #define KEY_DEL         0xE9) 19.866 Tj
0 -39.2727 Td
(6627 ) 3.01 Tj
0 -40.5818 Td
(6628 static uchar shiftcode[256] =) 20.468 Tj
0 -41.8909 Td
(6629 {) 3.612 Tj
0 -43.2 Td
(6630   [0x1D] CTL,) 10.836 Tj
0 -44.5091 Td
(6631   [0x2A] SHIFT,) 12.04 Tj
0 -45.8182 Td
(6632   [0x36] SHIFT,) 12.04 Tj
0 -47.1272 Td
(6633   [0x38] ALT,) 10.836 Tj
0 -48.4363 Td
(6634   [0x9D] CTL,) 10.836 Tj
0 -49.7454 Td
(6635   [0xB8] ALT) 10.234 Tj
0 -51.0545 Td
(6636 };) 4.214 Tj
0 -52.3636 Td
(6637 ) 3.01 Tj
0 -53.6727 Td
(6638 static uchar togglecode[256] =) 21.07 Tj
0 -54.9818 Td
(6639 {) 3.612 Tj
0 -56.2909 Td
(6640   [0x3A] CAPSLOCK,) 13.846 Tj
0 -57.6 Td
(6641   [0x45] NUMLOCK,) 13.244 Tj
0 -58.9091 Td
(6642   [0x46] SCROLLLOCK) 14.448 Tj
0 -60.2181 Td
(6643 };) 4.214 Tj
0 -61.5272 Td
(6644 ) 3.01 Tj
0 -62.8363 Td
(6645 ) 3.01 Tj
0 -64.1454 Td
(6646 ) 3.01 Tj
0 -65.4545 Td
(6647 ) 3.01 Tj
0 -66.7636 Td
(6648 ) 3.01 Tj
0 -68.0727 Td
(6649 ) 3.01 Tj
0 -72 Td
(Sheet 66) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/console.c  Page 6) 24.08 Tj
0 -3.92728 Td
(6650 static uchar normalmap[256] =) 20.468 Tj
0 -5.23637 Td
(6651 {) 3.612 Tj
0 -6.54546 Td
(6652   NO,   0x1B, '1',  '2',  '3',  '4',  '5',  '6',  // 0x00) 37.324 Tj
0 -7.85455 Td
(6653   '7',  '8',  '9',  '0',  '-',  '=',  '\\b', '\\t',) 32.508 Tj
0 -9.16364 Td
(6654   'q',  'w',  'e',  'r',  't',  'y',  'u',  'i',  // 0x10) 37.324 Tj
0 -10.4727 Td
(6655   'o',  'p',  '[',  ']',  '\\n', NO,   'a',  's',) 31.906 Tj
0 -11.7818 Td
(6656   'd',  'f',  'g',  'h',  'j',  'k',  'l',  ';',  // 0x20) 37.324 Tj
0 -13.0909 Td
(6657   '\\'', '`',  NO,   '\\\\', 'z',  'x',  'c',  'v',) 31.906 Tj
0 -14.4 Td
(6658   'b',  'n',  'm',  ',',  '.',  '/',  NO,   '*',  // 0x30) 37.324 Tj
0 -15.7091 Td
(6659   NO,   ' ',  NO,   NO,   NO,   NO,   NO,   NO,) 31.304 Tj
0 -17.0182 Td
(6660   NO,   NO,   NO,   NO,   NO,   NO,   NO,   '7',  // 0x40) 37.324 Tj
0 -18.3273 Td
(6661   '8',  '9',  '-',  '4',  '5',  '6',  '+',  '1',) 31.906 Tj
0 -19.6364 Td
(6662   '2',  '3',  '0',  '.',  NO,   NO,   NO,   NO,   // 0x50) 37.324 Tj
0 -20.9455 Td
(6663   [0x97] KEY_HOME,) 13.846 Tj
0 -22.2545 Td
(6664   [0x9C] '\\n',      // KP_Enter) 21.672 Tj
0 -23.5636 Td
(6665   [0xB5] '/',       // KP_Div) 20.468 Tj
0 -24.8727 Td
(6666   [0xC8] KEY_UP,) 12.642 Tj
0 -26.1818 Td
(6667   [0xC9] KEY_PGUP,) 13.846 Tj
0 -27.4909 Td
(6668   [0xCB] KEY_LF,) 12.642 Tj
0 -28.8 Td
(6669   [0xCD] KEY_RT,) 12.642 Tj
0 -30.1091 Td
(6670   [0xCF] KEY_END,) 13.244 Tj
0 -31.4182 Td
(6671   [0xD0] KEY_DN,) 12.642 Tj
0 -32.7273 Td
(6672   [0xD1] KEY_PGDN,) 13.846 Tj
0 -34.0364 Td
(6673   [0xD2] KEY_INS,) 13.244 Tj
0 -35.3454 Td
(6674   [0xD3] KEY_DEL) 12.642 Tj
0 -36.6545 Td
(6675 };) 4.214 Tj
0 -37.9636 Td
(6676 ) 3.01 Tj
0 -39.2727 Td
(6677 static uchar shiftmap[256] =) 19.866 Tj
0 -40.5818 Td
(6678 {) 3.612 Tj
0 -41.8909 Td
(6679   NO,   033,  '!',  '@',  '#',  '$',  '%',  '^',  // 0x00) 37.324 Tj
0 -43.2 Td
(6680   '&',  '*',  '\(',  '\)',  '_',  '+',  '\\b', '\\t',) 32.508 Tj
0 -44.5091 Td
(6681   'Q',  'W',  'E',  'R',  'T',  'Y',  'U',  'I',  // 0x10) 37.324 Tj
0 -45.8182 Td
(6682   'O',  'P',  '{',  '}',  '\\n', NO,   'A',  'S',) 31.906 Tj
0 -47.1272 Td
(6683   'D',  'F',  'G',  'H',  'J',  'K',  'L',  ':',  // 0x20) 37.324 Tj
0 -48.4363 Td
(6684   '"',  '~',  NO,   '|',  'Z',  'X',  'C',  'V',) 31.906 Tj
0 -49.7454 Td
(6685   'B',  'N',  'M',  '<',  '>',  '?',  NO,   '*',  // 0x30) 37.324 Tj
0 -51.0545 Td
(6686   NO,   ' ',  NO,   NO,   NO,   NO,   NO,   NO,) 31.304 Tj
0 -52.3636 Td
(6687   NO,   NO,   NO,   NO,   NO,   NO,   NO,   '7',  // 0x40) 37.324 Tj
0 -53.6727 Td
(6688   '8',  '9',  '-',  '4',  '5',  '6',  '+',  '1',) 31.906 Tj
0 -54.9818 Td
(6689   '2',  '3',  '0',  '.',  NO,   NO,   NO,   NO,   // 0x50) 37.324 Tj
0 -56.2909 Td
(6690   [0x97] KEY_HOME,) 13.846 Tj
0 -57.6 Td
(6691   [0x9C] '\\n',      // KP_Enter) 21.672 Tj
0 -58.9091 Td
(6692   [0xB5] '/',       // KP_Div) 20.468 Tj
0 -60.2181 Td
(6693   [0xC8] KEY_UP,) 12.642 Tj
0 -61.5272 Td
(6694   [0xC9] KEY_PGUP,) 13.846 Tj
0 -62.8363 Td
(6695   [0xCB] KEY_LF,) 12.642 Tj
0 -64.1454 Td
(6696   [0xCD] KEY_RT,) 12.642 Tj
0 -65.4545 Td
(6697   [0xCF] KEY_END,) 13.244 Tj
0 -66.7636 Td
(6698   [0xD0] KEY_DN,) 12.642 Tj
0 -68.0727 Td
(6699   [0xD1] KEY_PGDN,) 13.846 Tj
0 -72 Td
(Sheet 66) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 74 74
%%BeginPageSetup
%%PageOrientation: Landscape
__tumble pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/console.c  Page 7) 24.08 Tj
0 -3.92728 Td
(6700   [0xD2] KEY_INS,) 13.244 Tj
0 -5.23637 Td
(6701   [0xD3] KEY_DEL) 12.642 Tj
0 -6.54546 Td
(6702 };) 4.214 Tj
0 -7.85455 Td
(6703 ) 3.01 Tj
0 -9.16364 Td
(6704 #define C\(x\) \(x - '@'\)) 16.254 Tj
0 -10.4727 Td
(6705 ) 3.01 Tj
0 -11.7818 Td
(6706 static uchar ctlmap[256] =) 18.662 Tj
0 -13.0909 Td
(6707 {) 3.612 Tj
0 -14.4 Td
(6708   NO,      NO,      NO,      NO,      NO,      NO,      NO,      NO,) 43.946 Tj
0 -15.7091 Td
(6709   NO,      NO,      NO,      NO,      NO,      NO,      NO,      NO,) 43.946 Tj
0 -17.0182 Td
(6710   C\('Q'\),  C\('W'\),  C\('E'\),  C\('R'\),  C\('T'\),  C\('Y'\),  C\('U'\),  C\('I'\),) 46.354 Tj
0 -18.3273 Td
(6711   C\('O'\),  C\('P'\),  NO,      NO,      '\\r',    NO,      C\('A'\),  C\('S'\),) 46.354 Tj
0 -19.6364 Td
(6712   C\('D'\),  C\('F'\),  C\('G'\),  C\('H'\),  C\('J'\),  C\('K'\),  C\('L'\),  NO,) 43.946 Tj
0 -20.9455 Td
(6713   NO,      NO,      NO,      C\('\\\\'\), C\('Z'\),  C\('X'\),  C\('C'\),  C\('V'\),) 46.354 Tj
0 -22.2545 Td
(6714   C\('B'\),  C\('N'\),  C\('M'\),  NO,      NO,      C\('/'\),  NO,      NO,) 43.946 Tj
0 -23.5636 Td
(6715   [0x97] KEY_HOME,) 13.846 Tj
0 -24.8727 Td
(6716   [0xB5] C\('/'\),    // KP_Div) 20.468 Tj
0 -26.1818 Td
(6717   [0xC8] KEY_UP,) 12.642 Tj
0 -27.4909 Td
(6718   [0xC9] KEY_PGUP,) 13.846 Tj
0 -28.8 Td
(6719   [0xCB] KEY_LF,) 12.642 Tj
0 -30.1091 Td
(6720   [0xCD] KEY_RT,) 12.642 Tj
0 -31.4182 Td
(6721   [0xCF] KEY_END,) 13.244 Tj
0 -32.7273 Td
(6722   [0xD0] KEY_DN,) 12.642 Tj
0 -34.0364 Td
(6723   [0xD1] KEY_PGDN,) 13.846 Tj
0 -35.3454 Td
(6724   [0xD2] KEY_INS,) 13.244 Tj
0 -36.6545 Td
(6725   [0xD3] KEY_DEL) 12.642 Tj
0 -37.9636 Td
(6726 };) 4.214 Tj
0 -39.2727 Td
(6727 ) 3.01 Tj
0 -40.5818 Td
(6728 static uchar *charcode[4] = {) 20.468 Tj
0 -41.8909 Td
(6729   normalmap,) 10.234 Tj
0 -43.2 Td
(6730   shiftmap,) 9.632 Tj
0 -44.5091 Td
(6731   ctlmap,) 8.428 Tj
0 -45.8182 Td
(6732   ctlmap) 7.826 Tj
0 -47.1272 Td
(6733 };) 4.214 Tj
0 -48.4363 Td
(6734 ) 3.01 Tj
0 -49.7454 Td
(6735 #define KBD_BUF 64) 13.846 Tj
0 -51.0545 Td
(6736 char kbd_buf[KBD_BUF];) 16.254 Tj
0 -52.3636 Td
(6737 int kbd_r;) 9.03 Tj
0 -53.6727 Td
(6738 int kbd_w;) 9.03 Tj
0 -54.9818 Td
(6739 struct spinlock kbd_lock;) 18.06 Tj
0 -56.2909 Td
(6740 static uint shift;) 13.846 Tj
0 -57.6 Td
(6741 ) 3.01 Tj
0 -58.9091 Td
(6742 void) 5.418 Tj
0 -60.2181 Td
(6743 kbd_intr\(\)) 9.03 Tj
0 -61.5272 Td
(6744 {) 3.612 Tj
0 -62.8363 Td
(6745   uint st, data, c;) 14.448 Tj
0 -64.1454 Td
(6746 ) 3.01 Tj
0 -65.4545 Td
(6747   acquire\(&kbd_lock\);) 15.652 Tj
0 -66.7636 Td
(6748 ) 3.01 Tj
0 -68.0727 Td
(6749 ) 3.01 Tj
0 -72 Td
(Sheet 67) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/console.c  Page 8) 24.08 Tj
0 -3.92728 Td
(6750   st = inb\(KBSTATP\);) 15.05 Tj
0 -5.23637 Td
(6751   if\(\(st & KBS_DIB\) == 0\)) 18.06 Tj
0 -6.54546 Td
(6752     goto out;) 10.836 Tj
0 -7.85455 Td
(6753   data = inb\(KBDATAP\);) 16.254 Tj
0 -9.16364 Td
(6754 ) 3.01 Tj
0 -10.4727 Td
(6755   if\(data == 0xE0\) {) 15.05 Tj
0 -11.7818 Td
(6756     shift |= E0ESC;) 14.448 Tj
0 -13.0909 Td
(6757     goto out;) 10.836 Tj
0 -14.4 Td
(6758   } else if\(data & 0x80\) {) 18.662 Tj
0 -15.7091 Td
(6759     // Key released) 14.448 Tj
0 -17.0182 Td
(6760     data = \(shift & E0ESC ? data : data & 0x7F\);) 31.906 Tj
0 -18.3273 Td
(6761     shift &= ~\(shiftcode[data] | E0ESC\);) 27.09 Tj
0 -19.6364 Td
(6762     goto out;) 10.836 Tj
0 -20.9455 Td
(6763   } else if\(shift & E0ESC\) {) 19.866 Tj
0 -22.2545 Td
(6764     // Last character was an E0 escape; or with 0x80) 34.314 Tj
0 -23.5636 Td
(6765     data |= 0x80;) 13.244 Tj
0 -24.8727 Td
(6766     shift &= ~E0ESC;) 15.05 Tj
0 -26.1818 Td
(6767   }) 4.816 Tj
0 -27.4909 Td
(6768 ) 3.01 Tj
0 -28.8 Td
(6769   shift |= shiftcode[data];) 19.264 Tj
0 -30.1091 Td
(6770   shift ^= togglecode[data];) 19.866 Tj
0 -31.4182 Td
(6771 ) 3.01 Tj
0 -32.7273 Td
(6772   c = charcode[shift & \(CTL | SHIFT\)][data];) 29.498 Tj
0 -34.0364 Td
(6773   if\(shift & CAPSLOCK\) {) 17.458 Tj
0 -35.3454 Td
(6774     if\('a' <= c && c <= 'z'\)) 19.866 Tj
0 -36.6545 Td
(6775       c += 'A' - 'a';) 15.652 Tj
0 -37.9636 Td
(6776     else if\('A' <= c && c <= 'Z'\)) 22.876 Tj
0 -39.2727 Td
(6777       c += 'a' - 'A';) 15.652 Tj
0 -40.5818 Td
(6778   }) 4.816 Tj
0 -41.8909 Td
(6779 ) 3.01 Tj
0 -43.2 Td
(6780   switch\(c\){) 10.234 Tj
0 -44.5091 Td
(6781   case 0:) 8.428 Tj
0 -45.8182 Td
(6782     // Ignore unknown keystrokes.) 22.876 Tj
0 -47.1272 Td
(6783     break;) 9.03 Tj
0 -48.4363 Td
(6784 ) 3.01 Tj
0 -49.7454 Td
(6785   case C\('T'\):) 11.438 Tj
0 -51.0545 Td
(6786     cprintf\("#"\);  // Let user know we're still alive.) 35.518 Tj
0 -52.3636 Td
(6787     break;) 9.03 Tj
0 -53.6727 Td
(6788 ) 3.01 Tj
0 -54.9818 Td
(6789   case C\('P'\):) 11.438 Tj
0 -56.2909 Td
(6790     procdump\(\);) 12.04 Tj
0 -57.6 Td
(6791     break;) 9.03 Tj
0 -58.9091 Td
(6792 ) 3.01 Tj
0 -60.2181 Td
(6793   default:) 9.03 Tj
0 -61.5272 Td
(6794     if\(\(\(kbd_w + 1\) % KBD_BUF\) != kbd_r\){) 27.692 Tj
0 -62.8363 Td
(6795       kbd_buf[kbd_w++] = c;) 19.264 Tj
0 -64.1454 Td
(6796       if\(kbd_w >= KBD_BUF\)) 18.662 Tj
0 -65.4545 Td
(6797         kbd_w = 0;) 13.846 Tj
0 -66.7636 Td
(6798       wakeup\(&kbd_r\);) 15.652 Tj
0 -68.0727 Td
(6799     }) 6.02 Tj
0 -72 Td
(Sheet 67) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Page: 75 75
%%BeginPageSetup
%%PageOrientation: Landscape
pdfStartPage
%%EndPageSetup
[] 0 d
1 i
0 j
0 J
10 M
1 w
0 g
0 G
q
q
[0.1 0 0 0.1 0 0] cm
q
Q
q
180 3960 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 738.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/console.c  Page 9) 24.08 Tj
0 -3.92728 Td
(6800     break;) 9.03 Tj
0 -5.23637 Td
(6801   }) 4.816 Tj
0 -6.54546 Td
(6802 ) 3.01 Tj
0 -7.85455 Td
(6803 out:) 5.418 Tj
0 -9.16364 Td
(6804   release\(&kbd_lock\);) 15.652 Tj
0 -10.4727 Td
(6805 }) 3.612 Tj
0 -11.7818 Td
(6806 ) 3.01 Tj
0 -13.0909 Td
(6807 int) 4.816 Tj
0 -14.4 Td
(6808 console_read\(int minor, char *dst, int n\)) 27.692 Tj
0 -15.7091 Td
(6809 {) 3.612 Tj
0 -17.0182 Td
(6810   uint target = n;) 13.846 Tj
0 -18.3273 Td
(6811 ) 3.01 Tj
0 -19.6364 Td
(6812   acquire\(&kbd_lock\);) 15.652 Tj
0 -20.9455 Td
(6813 ) 3.01 Tj
0 -22.2545 Td
(6814   while\(kbd_w == kbd_r\) {) 18.06 Tj
0 -23.5636 Td
(6815     sleep\(&kbd_r, &kbd_lock\);) 20.468 Tj
0 -24.8727 Td
(6816   }) 4.816 Tj
0 -26.1818 Td
(6817 ) 3.01 Tj
0 -27.4909 Td
(6818   while\(n > 0 && kbd_w != kbd_r\){) 22.876 Tj
0 -28.8 Td
(6819     *dst = \(kbd_buf[kbd_r]\) & 0xff;) 24.08 Tj
0 -30.1091 Td
(6820     cons_putc\(*dst & 0xff\);) 19.264 Tj
0 -31.4182 Td
(6821     dst++;) 9.03 Tj
0 -32.7273 Td
(6822     --n;) 7.826 Tj
0 -34.0364 Td
(6823     kbd_r++;) 10.234 Tj
0 -35.3454 Td
(6824     if\(kbd_r >= KBD_BUF\)) 17.458 Tj
0 -36.6545 Td
(6825       kbd_r = 0;) 12.642 Tj
0 -37.9636 Td
(6826   }) 4.816 Tj
0 -39.2727 Td
(6827 ) 3.01 Tj
0 -40.5818 Td
(6828   release\(&kbd_lock\);) 15.652 Tj
0 -41.8909 Td
(6829 ) 3.01 Tj
0 -43.2 Td
(6830   return target - n;) 15.05 Tj
0 -44.5091 Td
(6831 }) 3.612 Tj
0 -45.8182 Td
(6832 ) 3.01 Tj
0 -47.1272 Td
(6833 void) 5.418 Tj
0 -48.4363 Td
(6834 console_init\(\)) 11.438 Tj
0 -49.7454 Td
(6835 {) 3.612 Tj
0 -51.0545 Td
(6836   initlock\(&console_lock, "console"\);) 25.284 Tj
0 -52.3636 Td
(6837   initlock\(&kbd_lock, "kbd"\);) 20.468 Tj
0 -53.6727 Td
(6838 ) 3.01 Tj
0 -54.9818 Td
(6839   devsw[CONSOLE].write = console_write;) 26.488 Tj
0 -56.2909 Td
(6840   devsw[CONSOLE].read = console_read;) 25.284 Tj
0 -57.6 Td
(6841 ) 3.01 Tj
0 -58.9091 Td
(6842   irq_enable\(IRQ_KBD\);) 16.254 Tj
0 -60.2181 Td
(6843   ioapic_enable\(IRQ_KBD, 0\);) 19.866 Tj
0 -61.5272 Td
(6844 ) 3.01 Tj
0 -62.8363 Td
(6845   use_console_lock = 1;) 16.856 Tj
0 -64.1454 Td
(6846 }) 3.612 Tj
0 -65.4545 Td
(6847 ) 3.01 Tj
0 -66.7636 Td
(6848 ) 3.01 Tj
0 -68.0727 Td
(6849 ) 3.01 Tj
0 -72 Td
(Sheet 68) 4.816 Tj
Q
Q
q
180 500 5760 3460 re
W
q
[10 0 0 10 0 0] cm
[1 0 0 1 0 0] Tm
0 0 Td
[0 -7.0183 7.25185 0 564.72 392.865] Tm
0 0 Td
/F10_0 1 Tf
(Sep  8 11:37 2006  xv6/8253pit.c  Page 1) 24.08 Tj
0 -3.92728 Td
(6850 #include "types.h") 13.846 Tj
0 -5.23637 Td
(6851 #include "x86.h") 12.642 Tj
0 -6.54546 Td
(6852 #include "defs.h") 13.244 Tj
0 -7.85455 Td
(6853 #include "traps.h") 13.846 Tj
0 -9.16364 Td
(6854 ) 3.01 Tj
0 -10.4727 Td
(6855 // Register definitions for the Intel) 25.284 Tj
0 -11.7818 Td
(6856 // 8253/8254/82C54 Programmable Interval Timer \(PIT\).) 34.916 Tj
0 -13.0909 Td
(6857 ) 3.01 Tj
0 -14.4 Td
(6858 #define IO_TIMER1       0x040           // 8253 Timer #1) 36.722 Tj
0 -15.7091 Td
(6859 #define IO_TIMER2       0x048           // 8253 Timer #2 \(EISA only\)) 43.946 Tj
0 -17.0182 Td
(6860 ) 3.01 Tj
0 -18.3273 Td
(6861 // Frequency of all three count-down timers; \(TIMER_FREQ/freq\) is the) 44.548 Tj
0 -19.6364 Td
(6862 // appropriate count to generate a frequency of freq hz.) 36.722 Tj
0 -20.9455 Td
(6863 ) 3.01 Tj
0 -22.2545 Td
(6864 #define TIMER_FREQ      1193182) 21.672 Tj
0 -23.5636 Td
(6865 #define TIMER_DIV\(x\)    \(\(TIMER_FREQ+\(x\)/2\)/\(x\)\)) 31.906 Tj
0 -24.8727 Td
(6866 ) 3.01 Tj
0 -26.1818 Td
(6867 #define TIMER_CNTR0     \(IO_TIMER1 + 0\) // timer 0 counter port) 40.936 Tj
0 -27.4909 Td
(6868 #define TIMER_CNTR1     \(IO_TIMER1 + 1\) // timer 1 counter port) 40.936 Tj
0 -28.8 Td
(6869 #define TIMER_CNTR2     \(IO_TIMER1 + 2\) // timer 2 counter port) 40.936 Tj
0 -30.1091 Td
(6870 #define TIMER_MODE      \(IO_TIMER1 + 3\) // timer mode port) 37.926 Tj
0 -31.4182 Td
(6871 #define TIMER_SEL0      0x00    // select counter 0) 33.712 Tj
0 -32.7273 Td
(6872 #define TIMER_SEL1      0x40    // select counter 1) 33.712 Tj
0 -34.0364 Td
(6873 #define TIMER_SEL2      0x80    // select counter 2) 33.712 Tj
0 -35.3454 Td
(6874 #define TIMER_INTTC     0x00    // mode 0, intr on terminal cnt) 40.936 Tj
0 -36.6545 Td
(6875 #define TIMER_ONESHOT   0x02    // mode 1, one shot) 33.712 Tj
0 -37.9636 Td
(6876 #define TIMER_RATEGEN   0x04    // mode 2, rate generator) 37.324 Tj
0 -39.2727 Td
(6877 #define TIMER_SQWAVE    0x06    // mode 3, square wave) 35.518 Tj
0 -40.5818 Td
(6878 #define TIMER_SWSTROBE  0x08    // mode 4, s/w triggered strobe) 40.936 Tj
0 -41.8909 Td
(6879 #define TIMER_HWSTROBE  0x0a    // mode 5, h/w triggered strobe) 40.936 Tj
0 -43.2 Td
(6880 #define TIMER_LATCH     0x00    // latch counter for reading) 39.13 Tj
0 -44.5091 Td
(6881 #define TIMER_LSB       0x10    // r/w counter LSB) 33.11 Tj
0 -45.8182 Td
(6882 #define TIMER_MSB       0x20    // r/w counter MSB) 33.11 Tj
0 -47.1272 Td
(6883 #define TIMER_16BIT     0x30    // r/w counter 16 bits, LSB first) 42.14 Tj
0 -48.4363 Td
(6884 #define TIMER_BCD       0x01    // count in BCD) 31.304 Tj
0 -49.7454 Td
(6885 ) 3.01 Tj
0 -51.0545 Td
(6886 void) 5.418 Tj
0 -52.3636 Td
(6887 pit8253_timerinit\(void\)) 16.856 Tj
0 -53.6727 Td
(6888 {) 3.612 Tj
0 -54.9818 Td
(6889   // initialize 8253 clock to interrupt 100 times/sec) 34.916 Tj
0 -56.2909 Td
(6890   outb\(TIMER_MODE, TIMER_SEL0 | TIMER_RATEGEN | TIMER_16BIT\);) 39.732 Tj
0 -57.6 Td
(6891   outb\(IO_TIMER1, TIMER_DIV\(100\) % 256\);) 27.09 Tj
0 -58.9091 Td
(6892   outb\(IO_TIMER1, TIMER_DIV\(100\) / 256\);) 27.09 Tj
0 -60.2181 Td
(6893   irq_enable\(IRQ_TIMER\);) 17.458 Tj
0 -61.5272 Td
(6894 }) 3.612 Tj
0 -62.8363 Td
(6895 ) 3.01 Tj
0 -64.1454 Td
(6896 ) 3.01 Tj
0 -65.4545 Td
(6897 ) 3.01 Tj
0 -66.7636 Td
(6898 ) 3.01 Tj
0 -68.0727 Td
(6899 ) 3.01 Tj
0 -72 Td
(Sheet 68) 4.816 Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Trailer
end
%%DocumentSuppliedResources:
%%+ font LTWFJF+OurCharSet
%%EOF