/usr/share/doc/HOWTO/ja-html/The-Linux-Kernel-16.html is in doc-linux-ja-html 2006.05.25-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
<TITLE>The Linux Kernel: Linux ¥Ç¡¼¥¿¹½Â¤</TITLE>
<LINK HREF="The-Linux-Kernel-17.html" REL=next>
<LINK HREF="The-Linux-Kernel-15.html" REL=previous>
<LINK HREF="The-Linux-Kernel.html#toc16" REL=contents>
</HEAD>
<BODY>
<A HREF="The-Linux-Kernel-17.html">¼¡¤Î¥Ú¡¼¥¸</A>
<A HREF="The-Linux-Kernel-15.html">Á°¤Î¥Ú¡¼¥¸</A>
<A HREF="The-Linux-Kernel.html#toc16">Ìܼ¡¤Ø</A>
<HR>
<H2><A NAME="chapter_ds"></A> <A NAME="s16">16. Linux ¥Ç¡¼¥¿¹½Â¤</A></H2>
<P>
<FIGURE>
<PH VSPACE="1">
<IMG SRC="./The-Linux-Kernel-images/penguin2.gif">
</FIGURE>
<P>
<P>¤³¤Î¾Ï¤Ç¤Ï¡¢¼çÍפʥǡ¼¥¿¹½Â¤ÂΤòÎóµó¤·¤Æ¤¤¤ë¡£¤³¤ì¤é¤Ï¡¢Linux ¤Ç»ÈÍѤµ¤ì¡¢
Ëܽñ¤Ë¤ª¤¤¤Æ¤â½Ò¤Ù¤é¤ì¤Æ¤¤¤ë¤â¤Î¤Ç¤¢¤ë¡£¤³¤ì¤é¤Î¹½Â¤ÂΤˤϡ¢Ëܽñ¤Ç¤ÎÂκۤò
À°¤¨¤ë¤¿¤á¤Ë¡¢¼ã´³¤ÎÊÔ½¸¤¬²Ã¤¨¤é¤ì¤Æ¤¤¤ë¡£
<P>
<P>
<A NAME="arp_table"></A> <H2><A NAME="ss16.1">16.1 arp_table(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/net/ipv4/arp.c">net/ipv4/arp.c</A>]
<PRE>
struct arp_table
{
struct arp_table *next; /* Linked entry list */
unsigned long last_used; /* For expiry */
unsigned long last_updated; /* For expiry */
unsigned int flags; /* Control status */
u32 ip; /* ip address of entry */
u32 mask; /* netmask - used for generalised
proxy arps (tridge)*/
unsigned char ha[MAX_ADDR_LEN]; /* Hardware address */
struct device *dev; /* Device the entry is tied to */
struct hh_cache *hh; /* Hardware headers chain */
/*
* The following entries are only used for unresolved hw addresses.
*/
struct timer_list timer; /* expire timer */
int retries; /* remaining retries */
struct sk_buff_head skb; /* list of queued packets */
};
</PRE>
<P>
<P>
<A NAME="blk_dev_struct"></A> <H2><A NAME="ss16.2">16.2 blk_dev_struct</A>
</H2>
<P><CODE>blk_dev_struct</CODE> ¥Ç¡¼¥¿¹½Â¤ÂΤ¬»ÈÍѤµ¤ì¤ë¤Î¤Ï¡¢¥Ð¥Ã¥Õ¥¡¥¥ã¥Ã¥·¥å·Ðͳ
¤Ç¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹¤òÍøÍѤǤ¤ë¤è¤¦¤Ë¡¢¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹¤òÅÐÏ¿¤¹¤ë¤¿¤á¤Ç¤¢¤ë¡£
¤½¤ì¤é¤Ï¡¢<CODE>blk_dev</CODE> ÇÛÎóÆâ¤ËÊÝ»ý¤µ¤ì¤ë¡£<BR>
[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/blkdev.h">include/linux/blkdev.h</A>]
<P>
<PRE>
struct blk_dev_struct {
void (*request_fn)(void);
struct request * current_request;
struct request plug;
struct tq_struct plug_tq;
};
...
...
extern struct blk_dev_struct blk_dev[MAX_BLKDEV];
</PRE>
<P>
<A NAME="buffer_head"></A> <H2><A NAME="ss16.3">16.3 buffer_head</A>
</H2>
<P><CODE>buffer_head</CODE> ¥Ç¡¼¥¿¹½Â¤ÂΤϡ¢¥Ð¥Ã¥Õ¥¡¥¥ã¥Ã¥·¥å¤Ë¤¢¤ë¥Ö¥í¥Ã¥¯
¥Ð¥Ã¥Õ¥¡¤Î¾ðÊó¤òÊÝ»ý¤¹¤ë¤¿¤á¤Î¤â¤Î¤Ç¤¢¤ë¡£<BR>
[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/fs.h">include/linux/fs.h</A>]
<PRE>
/* bh state bits */
#define BH_Uptodate 0 /* 1 if the buffer contains valid data */
#define BH_Dirty 1 /* 1 if the buffer is dirty */
#define BH_Lock 2 /* 1 if the buffer is locked */
#define BH_Req 3 /* 0 if the buffer has been invalidated */
#define BH_Touched 4 /* 1 if the buffer has been touched (aging) */
#define BH_Has_aged 5 /* 1 if the buffer has been aged (aging) */
#define BH_Protected 6 /* 1 if the buffer is protected */
#define BH_FreeOnIO 7 /* 1 to discard the buffer_head after IO */
struct buffer_head {
/* First cache line: */
unsigned long b_blocknr; /* block number */
kdev_t b_dev; /* device (B_FREE = free) */
kdev_t b_rdev; /* Real device */
unsigned long b_rsector; /* Real buffer location on disk */
struct buffer_head *b_next; /* Hash queue list */
struct buffer_head *b_this_page; /* circular list of buffers in one
page */
/* Second cache line: */
unsigned long b_state; /* buffer state bitmap (above) */
struct buffer_head *b_next_free;
unsigned int b_count; /* users using this block */
unsigned long b_size; /* block size */
/* Non-performance-critical data follows. */
char *b_data; /* pointer to data block */
unsigned int b_list; /* List that this buffer appears */
unsigned long b_flushtime; /* Time when this (dirty) buffer
* should be written */
unsigned long b_lru_time; /* Time when this buffer was
* last used. */
struct wait_queue *b_wait;
struct buffer_head *b_prev; /* doubly linked hash list */
struct buffer_head *b_prev_free; /* doubly linked list of buffers */
struct buffer_head *b_reqnext; /* request queue */
};
</PRE>
<P>
<A NAME="device"></A> <H2><A NAME="ss16.4">16.4 device</A>
</H2>
<P>¥·¥¹¥Æ¥à¾å¤Î¤¹¤Ù¤Æ¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥Ç¥Ð¥¤¥¹¤Ï¡¢<CODE>device</CODE> ¥Ç¡¼¥¿¹½Â¤ÂÎ
¤Ë¤è¤Ã¤Æɽ¸½¤µ¤ì¤ë¡£<BR>
[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/netdevice.h">include/linux/netdevice.h</A>]
<P>
<PRE>
struct device
{
/*
* This is the first field of the "visible" part of this structure
* (i.e. as seen by users in the "Space.c" file). It is the name
* the interface.
*/
char *name;
/* I/O specific fields */
unsigned long rmem_end; /* shmem "recv" end */
unsigned long rmem_start; /* shmem "recv" start */
unsigned long mem_end; /* shared mem end */
unsigned long mem_start; /* shared mem start */
unsigned long base_addr; /* device I/O address */
unsigned char irq; /* device IRQ number */
/* Low-level status flags. */
volatile unsigned char start, /* start an operation */
interrupt; /* interrupt arrived */
unsigned long tbusy; /* transmitter busy */
struct device *next;
/* The device initialization function. Called only once. */
int (*init)(struct device *dev);
/* Some hardware also needs these fields, but they are not part of
the usual set specified in Space.c. */
unsigned char if_port; /* Selectable AUI,TP, */
unsigned char dma; /* DMA channel */
struct enet_statistics* (*get_stats)(struct device *dev);
/*
* This marks the end of the "visible" part of the structure. All
* fields hereafter are internal to the system, and may change at
* will (read: may be cleaned up at will).
*/
/* These may be needed for future network-power-down code. */
unsigned long trans_start; /* Time (jiffies) of
last transmit */
unsigned long last_rx; /* Time of last Rx */
unsigned short flags; /* interface flags (BSD)*/
unsigned short family; /* address family ID */
unsigned short metric; /* routing metric */
unsigned short mtu; /* MTU value */
unsigned short type; /* hardware type */
unsigned short hard_header_len; /* hardware hdr len */
void *priv; /* private data */
/* Interface address info. */
unsigned char broadcast[MAX_ADDR_LEN];
unsigned char pad;
unsigned char dev_addr[MAX_ADDR_LEN];
unsigned char addr_len; /* hardware addr len */
unsigned long pa_addr; /* protocol address */
unsigned long pa_brdaddr; /* protocol broadcast addr*/
unsigned long pa_dstaddr; /* protocol P-P other addr*/
unsigned long pa_mask; /* protocol netmask */
unsigned short pa_alen; /* protocol address len */
struct dev_mc_list *mc_list; /* M'cast mac addrs */
int mc_count; /* No installed mcasts */
struct ip_mc_list *ip_mc_list; /* IP m'cast filter chain */
__u32 tx_queue_len; /* Max frames per queue */
/* For load balancing driver pair support */
unsigned long pkt_queue; /* Packets queued */
struct device *slave; /* Slave device */
struct net_alias_info *alias_info; /* main dev alias info */
struct net_alias *my_alias; /* alias devs */
/* Pointer to the interface buffers. */
struct sk_buff_head buffs[DEV_NUMBUFFS];
/* Pointers to interface service routines. */
int (*open)(struct device *dev);
int (*stop)(struct device *dev);
int (*hard_start_xmit) (struct sk_buff *skb,
struct device *dev);
int (*hard_header) (struct sk_buff *skb,
struct device *dev,
unsigned short type,
void *daddr,
void *saddr,
unsigned len);
int (*rebuild_header)(void *eth,
struct device *dev,
unsigned long raddr,
struct sk_buff *skb);
void (*set_multicast_list)(struct device *dev);
int (*set_mac_address)(struct device *dev,
void *addr);
int (*do_ioctl)(struct device *dev,
struct ifreq *ifr,
int cmd);
int (*set_config)(struct device *dev,
struct ifmap *map);
void (*header_cache_bind)(struct hh_cache **hhp,
struct device *dev,
unsigned short htype,
__u32 daddr);
void (*header_cache_update)(struct hh_cache *hh,
struct device *dev,
unsigned char * haddr);
int (*change_mtu)(struct device *dev,
int new_mtu);
struct iw_statistics* (*get_wireless_stats)(struct device *dev);
};
</PRE>
<P>
<A NAME="dev_base"></A>
<PRE>
...
...
extern struct device *dev_base;
</PRE>
<P>
<P>
<A NAME="device_struct"></A> <H2><A NAME="ss16.5">16.5 device_struct</A>
</H2>
<P><CODE>device_struct</CODE> ¥Ç¡¼¥¿¹½Â¤ÂΤϡ¢¥¥ã¥é¥¯¥¿¥Ç¥Ð¥¤¥¹¤È¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹
¤òÅÐÏ¿¤¹¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¡£(¤½¤ì¤é¤Ï¡¢¥Ç¥Ð¥¤¥¹Ì¾¤È¡¢¤½¤Î¥Ç¥Ð¥¤¥¹¤Ë»ÈÍѤǤ¤ë
¥Õ¥¡¥¤¥ëÁàºî¥ë¡¼¥Á¥ó¤Î¥»¥Ã¥È¤È¤òÊÝ»ý¤¹¤ë¡£) <CODE>chrdevs</CODE> ¤È <CODE>blkdevs</CODE> ÇÛÎó¤Ë¤¢¤ë¸Ä¡¹¤Î͸ú¤ÊÈÖ¹æ¤Ï¡¢¥¥ã¥é¥¯¥¿¥Ç¥Ð¥¤¥¹¤È¥Ö¥í¥Ã¥¯
¥Ç¥Ð¥¤¥¹¤È¤ò¤½¤ì¤¾¤ì¤Ëɽ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£<BR>
[in
<A HREF="./The-Linux-Kernel-images/linux/fs/devices.c">fs/devices.c</A>]
<P>
<P>
<PRE>
struct device_struct {
const char * name;
struct file_operations * fops;
};
</PRE>
(ÌõÃí)
<PRE>
static struct device_struct chrdevs[MAX_CHRDEV] = {
{ NULL, NULL },
};
static struct device_struct blkdevs[MAX_BLKDEV] = {
{ NULL, NULL },
};
</PRE>
<P>
<A NAME="dma_chan"></A> <H2><A NAME="ss16.6">16.6 dma_chan(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/kernel/dma.c">kernel/dma.c</A>]
<PRE>
struct dma_chan {
int lock;
const char *device_id;
};
</PRE>
<P>
<A NAME="ext2_inode"></A> <H2><A NAME="ss16.7">16.7 ext2_inode(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/ext2_fs.h">include/linux/ext2_fs.h</A>]
<PRE>
struct ext2_inode {
__u16 i_mode; /* File mode */
__u16 i_uid; /* Owner Uid */
__u32 i_size; /* Size in bytes */
__u32 i_atime; /* Access time */
__u32 i_ctime; /* Creation time */
__u32 i_mtime; /* Modification time */
__u32 i_dtime; /* Deletion Time */
__u16 i_gid; /* Group Id */
__u16 i_links_count; /* Links count */
__u32 i_blocks; /* Blocks count */
__u32 i_flags; /* File flags */
union {
struct {
__u32 l_i_reserved1;
} linux1;
struct {
__u32 h_i_translator;
} hurd1;
struct {
__u32 m_i_reserved1;
} masix1;
} osd1; /* OS dependent 1 */
__u32 i_block[EXT2_N_BLOCKS];/* Pointers to blocks */
__u32 i_version; /* File version (for NFS) */
__u32 i_file_acl; /* File ACL */
__u32 i_dir_acl; /* Directory ACL */
__u32 i_faddr; /* Fragment address */
union {
struct {
__u8 l_i_frag; /* Fragment number */
__u8 l_i_fsize; /* Fragment size */
__u16 i_pad1;
__u32 l_i_reserved2[2];
} linux2;
struct {
__u8 h_i_frag; /* Fragment number */
__u8 h_i_fsize; /* Fragment size */
__u16 h_i_mode_high;
__u16 h_i_uid_high;
__u16 h_i_gid_high;
__u32 h_i_author;
} hurd2;
struct {
__u8 m_i_frag; /* Fragment number */
__u8 m_i_fsize; /* Fragment size */
__u16 m_pad1;
__u32 m_i_reserved2[2];
} masix2;
} osd2; /* OS dependent 2 */
};
</PRE>
<P>
<P>
<A NAME="ext2_inode_info"></A> <H2><A NAME="ss16.8">16.8 ext2_inode_info(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/ext2_fs_i.h">include/linux/ext2_fs_i.h</A>]
<PRE>
struct ext2_inode_info {
__u32 i_data[15];
__u32 i_flags;
__u32 i_faddr;
__u8 i_frag_no;
__u8 i_frag_size;
__u16 i_osync;
__u32 i_file_acl;
__u32 i_dir_acl;
__u32 i_dtime;
__u32 i_version;
__u32 i_block_group;
__u32 i_next_alloc_block;
__u32 i_next_alloc_goal;
__u32 i_prealloc_block;
__u32 i_prealloc_count;
int i_new_inode:1; /* Is a freshly allocated inode */
};
</PRE>
<P>
<A NAME="fib_info"></A> <H2><A NAME="ss16.9">16.9 fib_info(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/net/ipv4/route.c">net/ipv4/route.c</A>]
<PRE>
struct fib_info
{
struct fib_info *fib_next;
struct fib_info *fib_prev;
__u32 fib_gateway;
struct device *fib_dev;
int fib_refcnt;
unsigned long fib_window;
unsigned short fib_flags;
unsigned short fib_mtu;
unsigned short fib_irtt;
};
</PRE>
<P>
<A NAME="fib_node"></A> <H2><A NAME="ss16.10">16.10 fib_node(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/net/ipv4/route.c">net/ipv4/route.c</A>]
<PRE>
struct fib_node
{
struct fib_node *fib_next;
__u32 fib_dst;
unsigned long fib_use;
struct fib_info *fib_info;
short fib_metric;
unsigned char fib_tos;
};
</PRE>
<P>
<A NAME="fib_zone"></A> <H2><A NAME="ss16.11">16.11 fib_zone(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/net/ipv4/route.c">net/ipv4/route.c</A>]
<PRE>
struct fib_zone
{
struct fib_zone *fz_next;
struct fib_node **fz_hash_table;
struct fib_node *fz_list;
int fz_nent;
int fz_logmask;
__u32 fz_mask;
};
</PRE>
<P>
<P>
<A NAME="file"></A> <H2><A NAME="ss16.12">16.12 file</A>
</H2>
<P>¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¢¥½¥±¥Ã¥ÈÅù¤Ï¡¢¤½¤ì¤¾¤ì <CODE>file</CODE> ¥Ç¡¼¥¿¹½Â¤ÂÎ
¤Ë¤è¤Ã¤Æɽ¤µ¤ì¤ë¡£<BR>
[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/fs.h">include/linux/fs.h</A>]
<P>
<PRE>
struct file {
mode_t f_mode;
loff_t f_pos;
unsigned short f_flags;
unsigned short f_count;
unsigned long f_reada, f_ramax, f_raend, f_ralen, f_rawin;
struct file *f_next, *f_prev;
int f_owner; /* pid or -pgrp where SIGIO should be sent */
struct inode * f_inode;
struct file_operations * f_op;
unsigned long f_version;
void *private_data; /* needed for tty driver, and maybe others */
};
</PRE>
<P>
<A NAME="files_struct"></A> <H2><A NAME="ss16.13">16.13 files_struct</A>
</H2>
<P><CODE>file_struct</CODE> ¥Ç¡¼¥¿¹½Â¤ÂΤϡ¢¥×¥í¥»¥¹¤¬¥ª¡¼¥×¥ó¤·¤¿¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ
µ½Ò¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£<BR>
[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/sched.h">include/linux/sched.h</A>]
<P>
<PRE>
struct files_struct {
int count;
fd_set close_on_exec;
fd_set open_fds;
struct file * fd[NR_OPEN];
};
</PRE>
[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/fs.h">include/linux/fs.h</A>]
<PRE>
#define NR_OPEN 256
</PRE>
<P>
<A NAME="file_system_type"></A> <H2><A NAME="ss16.14">16.14 file_system_type(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/fs.h">include/linux/fs.h</A>]
<PRE>
struct file_system_type {
struct super_block *(*read_super) (struct super_block *, void *, int);
const char *name;
int requires_dev;
struct file_system_type * next;
};
</PRE>
[in
<A HREF="./The-Linux-Kernel-images/linux/fs/super.c">fs/super.c</A>]
<PRE>
static struct file_system_type *file_systems = (struct file_system_type *) NULL;
</PRE>
<P>
<P>
<A NAME="free_area"></A> <H2><A NAME="ss16.15">16.15 free_area(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/mm/page_alloc.c">mm/page_alloc.c</A>]
<PRE>
/*
* Free area management
*
* The free_area_list arrays point to the queue heads
* of the free areas of different sizes
*/
#define NR_MEM_LISTS 6
/* The start of this MUST match the start of "struct page" */
struct free_area_struct {
struct page *next;
struct page *prev;
unsigned int * map;
};
#define memory_head(x) ((struct page *)(x))
static struct free_area_struct free_area[NR_MEM_LISTS];
</PRE>
<P>(ÌõÃí: »²¹Í linux-2.0.11)
<PRE>
struct free_area_struct {
struct page list;
unsigned int * map;
};
</PRE>
<P>
<P>
<A NAME="fs_struct"></A> <H2><A NAME="ss16.16">16.16 fs_struct</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/sched.h">include/linux/sched.h</A>]
<PRE>
struct fs_struct {
int count;
unsigned short umask;
struct inode * root, * pwd;
};
</PRE>
<P>
<P>
<A NAME="gendisk"></A> <H2><A NAME="ss16.17">16.17 gendisk</A>
</H2>
<P><CODE>gendisk</CODE> ¥Ç¡¼¥¿¹½Â¤ÂΤϡ¢¥Ï¡¼¥É¥Ç¥£¥¹¥¯¤Ë´Ø¤¹¤ë¾ðÊó¤òÊÝ»ý¤·¤Æ¤¤¤ë¡£
¤³¤ì¤é¤Ï¡¢½é´ü²½¤Î²áÄø¤Ç¡¢¥Ç¥£¥¹¥¯¤¬¸«¤¤¤À¤µ¤ì¡¢¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤¬¸¡½Ð¤µ¤ì¤ë
ºÝ¤Ë»ÈÍѤµ¤ì¤ë¡£<BR>
[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/genhd.h">include/linux/genhd.h</A>]
<PRE>
struct hd_struct {
long start_sect;
long nr_sects;
};
struct gendisk {
int major; /* major number of driver */
const char *major_name; /* name of major driver */
int minor_shift; /* number of times minor is shifted to
get real minor */
int max_p; /* maximum partitions per device */
int max_nr; /* maximum number of real devices */
void (*init)(struct gendisk *);
/* Initialization called before we
do our thing */
struct hd_struct *part; /* partition table */
int *sizes; /* device size in blocks, copied to
blk_size[] */
int nr_real; /* number of real devices */
void *real_devices; /* internal use */
struct gendisk *next;
};
</PRE>
(ÌõÃí)
<PRE>
extern struct gendisk *gendisk_head; /* linked list of disks */
</PRE>
<P>
<P>
<A NAME="hh_cache"></A> <H2><A NAME="ss16.18">16.18 hh_cache(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/netdevice.h">include/linux/netdevice.h</A>]
<PRE>
struct hh_cache
{
struct hh_cache *hh_next;
void *hh_arp; /* Opaque pointer, used by
* any address resolution module,
* not only ARP.
*/
int hh_refcnt; /* number of users */
unsigned short hh_type; /* protocol identifier, f.e ETH_P_IP */
char hh_uptodate; /* hh_data is valid */
char hh_data[16]; /* cached hardware header */
};
</PRE>
<P>
<P>
<A NAME="ide_drive_t"></A> <H2><A NAME="ss16.19">16.19 ide_drive_t(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/drivers/block/ide.h">drivers/block/ide.h</A>]
<PRE>
typedef struct ide_drive_s {
special_t special; /* special action flags */
unsigned present : 1; /* drive is physically present */
unsigned noprobe : 1; /* from: hdx=noprobe */
unsigned keep_settings : 1; /* restore settings after drive reset */
unsigned busy : 1; /* currently doing revalidate_disk() */
unsigned removable : 1; /* 1 if need to do check_media_change */
unsigned using_dma : 1; /* disk is using dma for read/write */
unsigned forced_geom : 1; /* 1 if hdx=c,h,s was given at boot */
unsigned unmask : 1; /* flag: okay to unmask other irqs */
unsigned no_unmask : 1; /* disallow setting unmask bit */
unsigned no_io_32bit : 1; /* disallow enabling 32bit I/O */
unsigned nobios : 1; /* flag: do not probe bios for drive */
unsigned slow : 1; /* flag: slow data port */
unsigned autotune : 2; /* 1=autotune, 2=noautotune, 0=default */
#if FAKE_FDISK_FOR_EZDRIVE
unsigned remap_0_to_1 : 1; /* flag: partitioned with ezdrive */
#endif /* FAKE_FDISK_FOR_EZDRIVE */
unsigned no_geom : 1; /* flag: do not set geometry */
ide_media_t media; /* disk, cdrom, tape, floppy */
select_t select; /* basic drive/head select reg value */
byte ctl; /* "normal" value for IDE_CONTROL_REG */
byte ready_stat; /* min status value for drive ready */
byte mult_count; /* current multiple sector setting */
byte mult_req; /* requested multiple sector setting */
byte tune_req; /* requested drive tuning setting */
byte io_32bit; /* 0=16-bit, 1=32-bit, 2/3=32bit+sync */
byte bad_wstat; /* used for ignoring WRERR_STAT */
byte sect0; /* offset of first sector for DM6:DDO */
byte usage; /* current "open()" count for drive */
byte head; /* "real" number of heads */
byte sect; /* "real" sectors per track */
byte bios_head; /* BIOS/fdisk/LILO number of heads */
byte bios_sect; /* BIOS/fdisk/LILO sectors per track */
unsigned short bios_cyl; /* BIOS/fdisk/LILO number of cyls */
unsigned short cyl; /* "real" number of cyls */
void *hwif; /* actually (ide_hwif_t *) */
struct wait_queue *wqueue; /* used to wait for drive in open() */
struct hd_driveid *id; /* drive model identification info */
struct hd_struct *part; /* drive partition table */
char name[4]; /* drive name, such as "hda" */
#ifdef CONFIG_BLK_DEV_IDECD
struct cdrom_info cdrom_info; /* for ide-cd.c */
#endif /* CONFIG_BLK_DEV_IDECD */
#ifdef CONFIG_BLK_DEV_IDETAPE
idetape_tape_t tape; /* for ide-tape.c */
#endif /* CONFIG_BLK_DEV_IDETAPE */
#ifdef CONFIG_BLK_DEV_IDEFLOPPY
void *floppy; /* for ide-floppy.c */
#endif /* CONFIG_BLK_DEV_IDEFLOPPY */
#ifdef CONFIG_BLK_DEV_IDESCSI
void *scsi; /* for ide-scsi.c */
#endif /* CONFIG_BLK_DEV_IDESCSI */
} ide_drive_t;
</PRE>
<P>
<P>
<A NAME="ide_hwif_t"></A> <H2><A NAME="ss16.20">16.20 ide_hwif_t(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/drivers/block/ide.h">drivers/block/ide.h</A>]
<P>
<PRE>
typedef struct hwif_s {
struct hwif_s *next; /* for linked-list in ide_hwgroup_t */
void *hwgroup; /* actually (ide_hwgroup_t *) */
unsigned short io_base; /* base io port addr */
unsigned short ctl_port; /* usually io_base+0x206 */
ide_drive_t drives[MAX_DRIVES]; /* drive info */
struct gendisk *gd; /* gendisk structure */
ide_tuneproc_t *tuneproc; /* routine to tune PIO mode for drives */
#if defined(CONFIG_BLK_DEV_HT6560B) || defined(CONFIG_BLK_DEV_PROMISE)
ide_selectproc_t *selectproc; /* tweaks hardware to select drive */
#endif
ide_dmaproc_t *dmaproc; /* dma read/write/abort routine */
unsigned long *dmatable; /* dma physical region descriptor table */
unsigned short dma_base; /* base addr for dma ports (triton) */
byte irq; /* our irq number */
byte major; /* our major number */
char name[5]; /* name of interface, eg. "ide0" */
byte index; /* 0 for ide0; 1 for ide1; ... */
hwif_chipset_t chipset; /* sub-module for tuning.. */
unsigned noprobe : 1; /* don't probe for this interface */
unsigned present : 1; /* this interface exists */
unsigned serialized : 1; /* serialized operation with mate hwif */
unsigned sharing_irq: 1; /* 1 = sharing irq with another hwif */
#ifdef CONFIG_BLK_DEV_PROMISE
unsigned is_promise2: 1; /* 2nd i/f on promise DC4030 */
#endif /* CONFIG_BLK_DEV_PROMISE */
#if (DISK_RECOVERY_TIME > 0)
unsigned long last_time; /* time when previous rq was done */
#endif
#ifdef CONFIG_BLK_DEV_IDECD
struct request request_sense_request; /* from ide-cd.c */
struct packet_command request_sense_pc; /* from ide-cd.c */
#endif /* CONFIG_BLK_DEV_IDECD */
#ifdef CONFIG_BLK_DEV_IDETAPE
ide_drive_t *tape_drive; /* Pointer to the tape on this interface */
#endif /* CONFIG_BLK_DEV_IDETAPE */
} ide_hwif_t;
</PRE>
<PRE>
...
...
#ifndef _IDE_C
extern ide_hwif_t ide_hwifs[]; /* master data repository */
#endif
</PRE>
<P>
<P>
<A NAME="inode"></A> <H2><A NAME="ss16.21">16.21 inode</A>
</H2>
<P>VFS <CODE>inode</CODE> ¥Ç¡¼¥¿¹½Â¤ÂΤϡ¢¥Ç¥£¥¹¥¯¾å¤Î¥Õ¥¡¥¤¥ë¤ä¥Ç¥£¥ì¥¯¥È¥ê¤Î
¾ðÊó¤òÊÝ»ý¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£<BR>
[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/fs.h">include/linux/fs.h</A>]
<P>
<PRE>
struct inode {
kdev_t i_dev;
unsigned long i_ino;
umode_t i_mode;
nlink_t i_nlink;
uid_t i_uid;
gid_t i_gid;
kdev_t i_rdev;
off_t i_size;
time_t i_atime;
time_t i_mtime;
time_t i_ctime;
unsigned long i_blksize;
unsigned long i_blocks;
unsigned long i_version;
unsigned long i_nrpages;
struct semaphore i_sem;
struct inode_operations *i_op;
struct super_block *i_sb;
struct wait_queue *i_wait;
struct file_lock *i_flock;
struct vm_area_struct *i_mmap;
struct page *i_pages;
struct dquot *i_dquot[MAXQUOTAS];
struct inode *i_next, *i_prev;
struct inode *i_hash_next, *i_hash_prev;
struct inode *i_bound_to, *i_bound_by;
struct inode *i_mount;
unsigned short i_count;
unsigned short i_flags;
unsigned char i_lock;
unsigned char i_dirt;
unsigned char i_pipe;
unsigned char i_sock;
unsigned char i_seek;
unsigned char i_update;
unsigned short i_writecount;
union {
struct pipe_inode_info pipe_i;
struct minix_inode_info minix_i;
struct ext_inode_info ext_i;
struct ext2_inode_info ext2_i;
struct hpfs_inode_info hpfs_i;
struct msdos_inode_info msdos_i;
struct umsdos_inode_info umsdos_i;
struct iso_inode_info isofs_i;
struct nfs_inode_info nfs_i;
struct xiafs_inode_info xiafs_i;
struct sysv_inode_info sysv_i;
struct affs_inode_info affs_i;
struct ufs_inode_info ufs_i;
struct socket socket_i;
void *generic_ip;
} u;
};
</PRE>
<A NAME="first_inode"></A> <P>(ÌõÃí)
[in
<A HREF="./The-Linux-Kernel-images/linux/fs/inode.c">fs/inode.c</A>]
<PRE>
static struct inode * first_inode;
</PRE>
<P>
<A NAME="ipc_perm"></A> <H2><A NAME="ss16.22">16.22 ipc_perm</A>
</H2>
<P><CODE>ipc_perm</CODE> ¥Ç¡¼¥¿¹½Â¤ÂΤϡ¢System V IPC ¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¢¥¯¥»¥¹
µö²Ä¾ðÊó¤òµ½Ò¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£<BR>
[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/ipc.h">include/linux/ipc.h</A>]
<P>
<PRE>
struct ipc_perm
{
key_t key;
ushort uid; /* owner euid and egid */
ushort gid;
ushort cuid; /* creator euid and egid */
ushort cgid;
ushort mode; /* access modes see mode flags below */
ushort seq; /* sequence number */
};
</PRE>
<P>
<P>
<A NAME="ipfrag"></A> <H2><A NAME="ss16.23">16.23 ipfrag(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/include/net/ip.h">include/net/ip.h</A>]
<PRE>
struct ipfrag
{
int offset; /* offset of fragment in IP datagram */
int end; /* last byte of data in datagram */
int len; /* length of this fragment */
struct sk_buff *skb; /* complete received fragment */
unsigned char *ptr; /* pointer into real fragment data */
struct ipfrag *next; /* linked list pointers */
struct ipfrag *prev;
};
</PRE>
<P>
<A NAME="ipq"></A> <H2><A NAME="ss16.24">16.24 ipq(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/include/net/ip.h">include/net/ip.h</A>]
<PRE>
struct ipq
{
unsigned char *mac; /* pointer to MAC header */
struct iphdr *iph; /* pointer to IP header */
int len; /* total length of original datagram */
short ihlen; /* length of the IP header */
short maclen; /* length of the MAC header */
struct timer_list timer; /* when will this queue expire? */
struct ipfrag *fragments; /* linked list of received fragments */
struct ipq *next; /* linked list pointers */
struct ipq *prev;
struct device *dev; /* Device - for icmp replies */
};
</PRE>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/net/ipv4/ip_fragment.c">net/ipv4/ip_fragment.c</A>]
<PRE>
static struct ipq *ipqueue = NULL;
</PRE>
<P>
<P>
<A NAME="irqaction"></A> <H2><A NAME="ss16.25">16.25 irqaction</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/interrupt.h">include/linux/interrupt.h</A>]
<P><CODE>irqaction</CODE> ¥Ç¡¼¥¿¹½Â¤ÂΤϡ¢¥·¥¹¥Æ¥à¤Î³ä¤ê¹þ¤ß¥Ï¥ó¥É¥é¡¼¤òµ½Ò
¤¹¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¤â¤Î¤Ç¤¢¤ë¡£
<P>
<PRE>
struct irqaction {
void (*handler)(int, void *, struct pt_regs *);
unsigned long flags;
unsigned long mask;
const char *name;
void *dev_id;
struct irqaction *next;
};
</PRE>
<P>
<A NAME="irq_action"></A> <H2><A NAME="ss16.26">16.26 irq_action</A>
</H2>
<P>[in arch/*/kernel/irq.c](
<A HREF="./The-Linux-Kernel-images/linux/arch/i386/kernel/irq.c">i386</A>,
<A HREF="./The-Linux-Kernel-images/linux/arch/alpha/kernel/irq.c">alpha</A>)
<PRE>
static struct irqaction *irq_action[16] = {
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL
};
</PRE>
<P>
<P>
<A NAME="kdev_t"></A> <H2><A NAME="ss16.27">16.27 kdev_t(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/kdev_t.h">include/linux/kdev_t.h</A>]
<PRE>
typedef unsigned short kdev_t;
</PRE>
<P>
<P>
<A NAME="linux_binfmt"></A> <H2><A NAME="ss16.28">16.28 linux_binfmt</A>
</H2>
<P>Linux ¤¬Íý²ò¤¹¤ë¥Ð¥¤¥Ê¥ê¥Õ¥¡¥¤¥ë¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï¡¢¤½¤ì¤¾¤ì <CODE>linux_binfmt</CODE> ¥Ç¡¼¥¿¹½Â¤ÂΤˤè¤Ã¤Æɽ¸½¤µ¤ì¤ë¡£<BR>
[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/binfmts.h">include/linux/binfmts.h</A>]
<PRE>
struct linux_binfmt {
struct linux_binfmt * next;
long *use_count;
int (*load_binary)(struct linux_binprm *, struct pt_regs * regs);
int (*load_shlib)(int fd);
int (*core_dump)(long signr, struct pt_regs * regs);
};
</PRE>
<P>
<A NAME="mem_map_t"></A> <H2><A NAME="ss16.29">16.29 mem_map_t</A>
</H2>
<P><CODE>mem_map_t</CODE> ¥Ç¡¼¥¿¹½Â¤ÂÎ(¥Ú¡¼¥¸¤È¤â¸Æ¤Ð¤ì¤ë)¤Ï¡¢ÊªÍý¥á¥â¥ê¤Ë¤¢¤ë
¸Ä¡¹¤Î¥Ú¡¼¥¸¤Ë´Ø¤¹¤ë¾ðÊó¤òÊÝ»ý¤¹¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¡£<BR>
[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/mm.h">include/linux/mm.h</A>]
<P>
<PRE>
typedef struct page {
/* these must be first (free area handling) */
struct page *next;
struct page *prev;
struct inode *inode;
unsigned long offset;
struct page *next_hash;
atomic_t count;
unsigned flags; /* atomic flags, some possibly
updated asynchronously */
unsigned dirty:16,
age:8;
struct wait_queue *wait;
struct page *prev_hash;
struct buffer_head *buffers;
unsigned long swap_unlock_entry;
unsigned long map_nr; /* page->map_nr == page - mem_map */
} mem_map_t;
.....
.....
extern mem_map_t * mem_map;
</PRE>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/pagemap.h">include/linux/pagemap.h</A>]
<PRE>
extern struct page * page_hash_table[PAGE_HASH_SIZE];
</PRE>
<P>
<A NAME="mm_struct"></A> <H2><A NAME="ss16.30">16.30 mm_struct</A>
</H2>
<P><CODE>mm_struct</CODE> ¥Ç¡¼¥¿¹½Â¤ÂΤϡ¢¥¿¥¹¥¯¤â¤·¤¯¤Ï¥×¥í¥»¥¹¤Î²¾ÁÛ¥á¥â¥ê¤ò
µ½Ò¤¹¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¡£<BR>
[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/sched.h">include/linux/sched.h</A>]
<P>
<PRE>
struct mm_struct {
int count;
pgd_t * pgd;
unsigned long context;
unsigned long start_code, end_code, start_data, end_data;
unsigned long start_brk, brk, start_stack, start_mmap;
unsigned long arg_start, arg_end, env_start, env_end;
unsigned long rss, total_vm, locked_vm;
unsigned long def_flags;
struct vm_area_struct * mmap;
struct vm_area_struct * mmap_avl;
struct semaphore mmap_sem;
};
</PRE>
<P>
<P>
<A NAME="module"></A> <H2><A NAME="ss16.31">16.31 module(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/module.h">include/linux/module.h</A>]
<PRE>
struct module {
struct module *next;
struct module_ref *ref; /* the list of modules that refer to me */
struct symbol_table *symtab;
const char *name;
int size; /* size of module in pages */
void* addr; /* address of module */
int state;
void (*cleanup)(void); /* cleanup routine */
};
</PRE>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/kernel/module.c">kernel/module.c</A>]
<PRE>
static struct module kernel_module;
static struct module *module_list = &kernel_module;
</PRE>
<P>
<P>
<P>
<A NAME="msg"></A> <H2><A NAME="ss16.32">16.32 msg(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/msg.h">include/linux/msg.h</A>]
<PRE>
struct msg {
struct msg *msg_next; /* next message on queue */
long msg_type;
char *msg_spot; /* message text address */
time_t msg_stime; /* msgsnd time */
short msg_ts; /* message text size */
};
</PRE>
<P>
<P>
<A NAME="msqid_ds"></A> <H2><A NAME="ss16.33">16.33 msqid_ds(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/msg.h">include/linux/msg.h</A>]
<PRE>
struct msqid_ds {
struct ipc_perm msg_perm;
struct msg *msg_first; /* first message on queue */
struct msg *msg_last; /* last message in queue */
time_t msg_stime; /* last msgsnd time */
time_t msg_rtime; /* last msgrcv time */
time_t msg_ctime; /* last change time */
struct wait_queue *wwait;
struct wait_queue *rwait;
ushort msg_cbytes; /* current number of bytes on queue */
ushort msg_qnum; /* number of messages in queue */
ushort msg_qbytes; /* max number of bytes on queue */
ushort msg_lspid; /* pid of last msgsnd */
ushort msg_lrpid; /* last receive pid */
};
...
...
#define MSGMNI 128 /* <= 1K */ /* max # of msg queue identifiers */
</PRE>
<P>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/ipc/msg.c">ipc/msg.c</A>]
<PRE>
static struct msqid_ds *msgque[MSGMNI];
</PRE>
<P>
<A NAME="packet_type"></A> <H2><A NAME="ss16.34">16.34 packet_type(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/netdevice.h">include/linux/netdevice.h</A>]
<PRE>
struct packet_type {
unsigned short type; /* This is really htons(ether_type). */
struct device * dev;
int (*func) (struct sk_buff *, struct device *,
struct packet_type *);
void *data;
struct packet_type *next;
};
</PRE>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/net/core/dev.c">net/core/dev.c</A>]
<PRE>
struct packet_type *ptype_base[16];
struct packet_type *ptype_all = NULL; /* Taps */
</PRE>
<P>
<A NAME="pci_bus"></A> <H2><A NAME="ss16.35">16.35 pci_bus</A>
</H2>
<P>¥·¥¹¥Æ¥à¾å¤Î¤¹¤Ù¤Æ¤Î PCI ¥Ð¥¹¤Ï¡¢<CODE>pci_bus</CODE> ¥Ç¡¼¥¿¹½Â¤ÂΤˤè¤Ã¤Æ
ɽ¸½¤µ¤ì¤Æ¤¤¤ë¡£<BR>
[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/pci.h">include/linux/pci.h</A>]
<P>
<PRE>
struct pci_bus {
struct pci_bus *parent; /* parent bus this bridge is on */
struct pci_bus *children; /* chain of P2P bridges on this bus */
struct pci_bus *next; /* chain of all PCI buses */
struct pci_dev *self; /* bridge device as seen by parent */
struct pci_dev *devices; /* devices behind this bridge */
void *sysdata; /* hook for sys-specific extension */
unsigned char number; /* bus number */
unsigned char primary; /* number of primary bridge */
unsigned char secondary; /* number of secondary bridge */
unsigned char subordinate; /* max number of subordinate buses */
};
...
...
extern struct pci_bus pci_root; /* root bus */
</PRE>
<P>
<P>
<A NAME="pci_dev"></A> <H2><A NAME="ss16.36">16.36 pci_dev</A>
</H2>
<P>PCI-PCI ¥Ö¥ê¥Ã¥¸¤È PCI-ISA ¥Ö¥ê¥Ã¥¸¤ò´Þ¤à¡¢¥·¥¹¥Æ¥à¾å¤Î¤¹¤Ù¤Æ¤Î PCI ¥Ç¥Ð¥¤¥¹
¤Ï¡¢<CODE>pci_dev</CODE> ¥Ç¡¼¥¿¹½Â¤ÂΤˤè¤Ã¤Æɽ¸½¤µ¤ì¤ë¡£<BR>
[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/pci.h">include/linux/pci.h</A>]
<PRE>
/*
* There is one pci_dev structure for each slot-number/function-number
* combination:
*/
struct pci_dev {
struct pci_bus *bus; /* bus this device is on */
struct pci_dev *sibling; /* next device on this bus */
struct pci_dev *next; /* chain of all devices */
void *sysdata; /* hook for sys-specific extension */
unsigned int devfn; /* encoded device & function index */
unsigned short vendor;
unsigned short device;
unsigned int class; /* 3 bytes: (base,sub,prog-if) */
unsigned int master : 1; /* set if device is master capable */
/*
* In theory, the irq level can be read from configuration
* space and all would be fine. However, old PCI chips don't
* support these registers and return 0 instead. For example,
* the Vision864-P rev 0 chip can uses INTA, but returns 0 in
* the interrupt line and pin registers. pci_init()
* initializes this field with the value at PCI_INTERRUPT_LINE
* and it is the job of pcibios_fixup() to change it if
* necessary. The field must not be 0 unless the device
* cannot generate interrupts at all.
*/
unsigned char irq; /* irq generated by this device */
};
...
...
extern struct pci_dev *pci_devices; /* list of all devices */
</PRE>
<P>
<A NAME="pipe_inode_info"></A> <H2><A NAME="ss16.37">16.37 pipe_inode_info(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/pipe_fs_i.h">include/linux/pipe_fs_i.h</A>]
<P>
<PRE>
struct pipe_inode_info {
struct wait_queue * wait;
char * base;
unsigned int start;
unsigned int len;
unsigned int lock;
unsigned int rd_openers;
unsigned int wr_openers;
unsigned int readers;
unsigned int writers;
};
#define PIPE_WAIT(inode) ((inode).u.pipe_i.wait)
#define PIPE_BASE(inode) ((inode).u.pipe_i.base)
#define PIPE_START(inode) ((inode).u.pipe_i.start)
#define PIPE_LEN(inode) ((inode).u.pipe_i.len)
#define PIPE_RD_OPENERS(inode) ((inode).u.pipe_i.rd_openers)
#define PIPE_WR_OPENERS(inode) ((inode).u.pipe_i.wr_openers)
#define PIPE_READERS(inode) ((inode).u.pipe_i.readers)
#define PIPE_WRITERS(inode) ((inode).u.pipe_i.writers)
#define PIPE_LOCK(inode) ((inode).u.pipe_i.lock)
#define PIPE_SIZE(inode) PIPE_LEN(inode)
...
...
</PRE>
<P>
<A NAME="proto_ops"></A> <H2><A NAME="ss16.38">16.38 proto_ops(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/net.h">include/linux/net.h</A>]
<PRE>
struct proto_ops {
int family;
int (*create) (struct socket *sock, int protocol);
int (*dup) (struct socket *newsock, struct socket *oldsock);
int (*release) (struct socket *sock, struct socket *peer);
int (*bind) (struct socket *sock, struct sockaddr *umyaddr,
int sockaddr_len);
int (*connect) (struct socket *sock, struct sockaddr *uservaddr,
int sockaddr_len, int flags);
int (*socketpair) (struct socket *sock1, struct socket *sock2);
int (*accept) (struct socket *sock, struct socket *newsock,
int flags);
int (*getname) (struct socket *sock, struct sockaddr *uaddr,
int *usockaddr_len, int peer);
int (*select) (struct socket *sock, int sel_type,
select_table *wait);
int (*ioctl) (struct socket *sock, unsigned int cmd,
unsigned long arg);
int (*listen) (struct socket *sock, int len);
int (*shutdown) (struct socket *sock, int flags);
int (*setsockopt) (struct socket *sock, int level, int optname,
char *optval, int optlen);
int (*getsockopt) (struct socket *sock, int level, int optname,
char *optval, int *optlen);
int (*fcntl) (struct socket *sock, unsigned int cmd,
unsigned long arg);
int (*sendmsg) (struct socket *sock, struct msghdr *m,
int total_len, int nonblock, int flags);
int (*recvmsg) (struct socket *sock, struct msghdr *m,
int total_len, int nonblock, int flags, int *addr_len);
};
</PRE>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/net/socket.c">net/socket.c</A>]
<PRE>
static struct proto_ops *pops[NPROTO];
</PRE>
<P>
<A NAME="request"></A> <H2><A NAME="ss16.39">16.39 request</A>
</H2>
<P><CODE>request</CODE> ¥Ç¡¼¥¿¹½Â¤ÂΤϡ¢¥·¥¹¥Æ¥à¾å¤Î¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹¤ËÂФ·¤Æ
¥ê¥¯¥¨¥¹¥È¤òÁ÷¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¡£¤½¤Î¥ê¥¯¥¨¥¹¥È¤Ï¡¢¾ï¤Ë¡¢¥Ð¥Ã¥Õ¥¡¥¥ã¥Ã¥·¥å¤Ë
ÂФ¹¤ë¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤ÎÆɤ߽ñ¤¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£<BR>
[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/blkdev.h">include/linux/blkdev.h</A>]
<PRE>
struct request {
volatile int rq_status;
#define RQ_INACTIVE (-1)
#define RQ_ACTIVE 1
#define RQ_SCSI_BUSY 0xffff
#define RQ_SCSI_DONE 0xfffe
#define RQ_SCSI_DISCONNECTING 0xffe0
kdev_t rq_dev;
int cmd; /* READ or WRITE */
int errors;
unsigned long sector;
unsigned long nr_sectors;
unsigned long current_nr_sectors;
char * buffer;
struct semaphore * sem;
struct buffer_head * bh;
struct buffer_head * bhtail;
struct request * next;
};
</PRE>
<P>
<P>(ÌõÃí)
[in
<A HREF="./The-Linux-Kernel-images/linux/drivers/block/ll_rw_blk.c">drivers/block/ll_rw_blk.c</A>]
<PRE>
static struct request all_requests[NR_REQUEST];
</PRE>
<P>
<A NAME="rtable"></A> <H2><A NAME="ss16.40">16.40 rtable</A>
</H2>
<P><CODE>rtable</CODE> ¥Ç¡¼¥¿¹½Â¤ÂΤϡ¢¤¢¤ë IP ¥Û¥¹¥È¤Ë¥Ñ¥±¥Ã¥È¤òÁ÷¿®¤¹¤ëºÝ¤Ë
¼è¤ë¤Ù¤¥ë¡¼¥È¤Ë´Ø¤¹¤ë¾ðÊó¤òÊÝ»ý¤¹¤ë¤â¤Î¤Ç¡¢IP ¥ë¡¼¥È¥¥ã¥Ã¥·¥å¤ÎÆâÉô¤Ç
»ÈÍѤµ¤ì¤ë¡£<BR>
[in
<A HREF="./The-Linux-Kernel-images/linux/include/net/route.h">include/net/route.h</A>]
<PRE>
struct rtable
{
struct rtable *rt_next;
__u32 rt_dst;
__u32 rt_src;
__u32 rt_gateway;
atomic_t rt_refcnt;
atomic_t rt_use;
unsigned long rt_window;
atomic_t rt_lastuse;
struct hh_cache *rt_hh;
struct device *rt_dev;
unsigned short rt_flags;
unsigned short rt_mtu;
unsigned short rt_irtt;
unsigned char rt_tos;
};
</PRE>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/net/ipv4/route.c">net/ipv4/route.c</A>]
<PRE>
struct rtable *ip_rt_hash_table[RT_HASH_DIVISOR];
</PRE>
<P>
<P>
<A NAME="Scsi_Cmnd"></A> <H2><A NAME="ss16.41">16.41 Scsi_Cmnd(ÌõÃí)</A>
</H2>
<P>(´Êά²½¤·¤Æ¤¤¤Þ¤¹)<BR>
[in
<A HREF="./The-Linux-Kernel-images/linux/drivers/scsi/scsi.h">drivers/scsi/scsi.h</A>]
<PRE>
typedef struct scsi_cmnd {
struct Scsi_Host * host;
Scsi_Device * device;
unsigned char target, lun, channel;
unsigned char cmd_len;
unsigned char old_cmd_len;
struct scsi_cmnd *next, *prev, *device_next, *reset_chain;
/* These elements define the operation we are about to perform */
unsigned char cmnd[12];
unsigned request_bufflen; /* Actual request size */
void * request_buffer; /* Actual requested buffer */
/* These elements define the operation we ultimately want to perform */
unsigned char data_cmnd[12];
unsigned short old_use_sg; /* We save use_sg here when requesting
* sense info */
unsigned short use_sg; /* Number of pieces of scatter-gather */
unsigned short sglist_len; /* size of malloc'd scatter-gather list */
unsigned short abort_reason;/* If the mid-level code requests an
* abort, this is the reason. */
unsigned bufflen; /* Size of data buffer */
void *buffer; /* Data buffer */
unsigned underflow; /* Return error if less than this amount is
* transfered */
unsigned transfersize; /* How much we are guaranteed to transfer with
* each SCSI transfer (ie, between disconnect /
* reconnects. Probably == sector size */
struct request request; /* A copy of the command we are working on */
unsigned char sense_buffer[16]; /* Sense for this command, if needed */
unsigned long serial_number;
unsigned long serial_number_at_timeout;
int retries;
int allowed;
int timeout_per_command, timeout_total, timeout;
unsigned volatile char internal_timeout;
unsigned flags;
int this_count;
void (*scsi_done)(struct scsi_cmnd *);
void (*done)(struct scsi_cmnd *); /* Mid-level done function */
Scsi_Pointer SCp; /* Scratchpad used by some host adapters */
unsigned char * host_scribble;
int result; /* Status code from lower level driver */
unsigned char tag; /* SCSI-II queued command tag */
unsigned long pid; /* Process ID, starts at 0 */
} Scsi_Cmnd;
</PRE>
<P>
<A NAME="Scsi_Device"></A> <H2><A NAME="ss16.42">16.42 Scsi_Device(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/drivers/scsi/scsi.h">drivers/scsi/scsi.h</A>]
<PRE>
typedef struct scsi_device {
struct scsi_device * next; /* Used for linked list */
unsigned char id, lun, channel;
unsigned int manufacturer; /* Manufacturer of device, for using
* vendor-specific cmd's */
int attached; /* # of high level drivers attached to
* this */
int access_count; /* Count of open channels/mounts */
struct wait_queue * device_wait;/* Used to wait if device is busy */
struct Scsi_Host * host;
void (*scsi_request_fn)(void); /* Used to jumpstart things after an
* ioctl */
struct scsi_cmnd *device_queue; /* queue of SCSI Command structures */
void *hostdata; /* available to low-level driver */
char type;
char scsi_level;
char vendor[8], model[16], rev[4];
unsigned char current_tag; /* current tag */
unsigned char sync_min_period; /* Not less than this period */
unsigned char sync_max_offset; /* Not greater than this offset */
unsigned char queue_depth; /* How deep a queue to use */
unsigned writeable:1;
unsigned removable:1;
unsigned random:1;
unsigned has_cmdblocks:1;
unsigned changed:1; /* Data invalid due to media change */
unsigned busy:1; /* Used to prevent races */
unsigned lockable:1; /* Able to prevent media removal */
unsigned borken:1; /* Tell the Seagate driver to be
* painfully slow on this device */
unsigned tagged_supported:1; /* Supports SCSI-II tagged queuing */
unsigned tagged_queue:1; /* SCSI-II tagged queuing enabled */
unsigned disconnect:1; /* can disconnect */
unsigned soft_reset:1; /* Uses soft reset option */
unsigned sync:1; /* Negotiate for sync transfers */
unsigned single_lun:1; /* Indicates we should only allow I/O to
* one of the luns for the device at a
* time. */
unsigned was_reset:1; /* There was a bus reset on the bus for
* this device */
unsigned expecting_cc_ua:1; /* Expecting a CHECK_CONDITION/UNIT_ATTN
* because we did a bus reset. */
} Scsi_Device;
...
...
extern Scsi_Device * scsi_devices;
</PRE>
<P>
<P>
<A NAME="Scsi_Device_Template"></A> <H2><A NAME="ss16.43">16.43 Scsi_Device_Template</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/drivers/scsi/hosts.h">drivers/scsi/hosts.h</A>]
<PRE>
struct Scsi_Device_Template
{
struct Scsi_Device_Template * next;
const char * name;
const char * tag;
long * usage_count; /* Used for loadable modules */
unsigned char scsi_type;
unsigned char major;
unsigned char nr_dev; /* Number currently attached */
unsigned char dev_noticed; /* Number of devices detected. */
unsigned char dev_max; /* Current size of arrays */
unsigned blk:1; /* 0 if character device */
int (*detect)(Scsi_Device *); /* Returns 1 if we can attach this device */
int (*init)(void); /* Sizes arrays based
upon number of devices
* detected */
void (*finish)(void); /* Perform initialization after attachment */
int (*attach)(Scsi_Device *); /* Attach devices to arrays */
void (*detach)(Scsi_Device *);
};
...
...
extern struct Scsi_Device_Template * scsi_devicelist;
</PRE>
<P>
<P>
<A NAME="Scsi_Disk"></A> <H2><A NAME="ss16.44">16.44 Scsi_Disk(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/drivers/scsi/sd.h">drivers/scsi/sd.h</A>
<PRE>
ypedef struct scsi_disk {
unsigned capacity; /* size in blocks */
unsigned sector_size; /* size in bytes */
Scsi_Device *device;
unsigned char ready; /* flag ready for FLOPTICAL */
unsigned char write_prot; /* flag write_protect for rmvable dev */
unsigned char sector_bit_size; /* sector_size = 2
to the bit size power */
unsigned char sector_bit_shift; /* power of 2 sectors per FS block */
unsigned ten:1; /* support ten byte read / write */
unsigned remap:1; /* support remapping */
unsigned has_part_table:1; /* has partition table */
} Scsi_Disk;
extern Scsi_Disk * rscsi_disks;
</PRE>
<P>
<P>
<A NAME="Scsi_Host"></A> <H2><A NAME="ss16.45">16.45 Scsi_Host(ÌõÃí)</A>
</H2>
<P>(´Êά²½¤·¤Æ¤¤¤Þ¤¹)<BR>
[in
<A HREF="./The-Linux-Kernel-images/linux/drivers/scsi/hosts.h">drivers/scsi/hosts.h</A>]
<PRE>
struct Scsi_Host
{
struct Scsi_Host * next;
unsigned short extra_bytes;
volatile unsigned char host_busy;
char host_no; /* Used for IOCTL_GET_IDLUN, /proc/scsi et al. */
unsigned long last_reset;
struct wait_queue *host_wait;
Scsi_Cmnd *host_queue;
Scsi_Host_Template * hostt;
unsigned int max_id;
unsigned int max_lun;
unsigned int max_channel;
struct Scsi_Host * block;
unsigned wish_block:1;
/* These parameters should be set by the detect routine */
unsigned char *base;
unsigned int io_port;
unsigned char n_io_port;
unsigned char irq;
unsigned char dma_channel;
unsigned int unique_id;
int this_id;
int can_queue;
short cmd_per_lun;
short unsigned int sg_tablesize;
unsigned unchecked_isa_dma:1;
unsigned use_clustering:1;
unsigned loaded_as_module:1;
void (*select_queue_depths)(struct Scsi_Host *, Scsi_Device *);
unsigned long hostdata[0]; /* Used for storage of host specific stuff */
};
</PRE>
<P>
<P>
<A NAME="Scsi_Host_Template"></A> <H2><A NAME="ss16.46">16.46 Scsi_Host_Template(ÌõÃí)</A>
</H2>
<P>(´Êά²½¤·¤Æ¤¤¤Þ¤¹¡£)<BR>
[in
<A HREF="./The-Linux-Kernel-images/linux/drivers/scsi/hosts.h">drivers/scsi/hosts.h</A>]
<PRE>
typedef struct SHT
{
/* Used with loadable modules so we can construct a linked list. */
struct SHT * next;
/* Used with loadable modules so that
we know when it is safe to unload */
long * usage_count;
struct proc_dir_entry *proc_dir;
int (*proc_info)(char *, char **, off_t, int, int, int);
const char *name;
int (* detect)(struct SHT *);
int (*release)(struct Scsi_Host *);
const char *(* info)(struct Scsi_Host *);
int (* command)(Scsi_Cmnd *);
int (* queuecommand)(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
int (* abort)(Scsi_Cmnd *);
int (* reset)(Scsi_Cmnd *, unsigned int);
int (* slave_attach)(int, int);
int (* bios_param)(Disk *, kdev_t, int []);
int can_queue;
int this_id;
short unsigned int sg_tablesize;
short cmd_per_lun;
unsigned char present;
unsigned unchecked_isa_dma:1;
unsigned use_clustering:1;
} Scsi_Host_Template;
extern struct Scsi_Host * scsi_hostlist;
</PRE>
[in
<A HREF="./The-Linux-Kernel-images/linux/drivers/scsi/hosts.c">drivers/scsi/hosts.c</A>]
<PRE>
static Scsi_Host_Template builtin_scsi_hosts[] =
...
...
</PRE>
<P>
<A NAME="sem"></A> <H2><A NAME="ss16.47">16.47 sem(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/sem.h">include/linux/sem.h</A>]
<PRE>
struct sem {
short semval; /* current value */
short sempid; /* pid of last operation */
};
</PRE>
<P>
<A NAME="semaphore"></A> <H2><A NAME="ss16.48">16.48 semaphore</A>
</H2>
<P>¥»¥Þ¥Õ¥©¤Ï¡¢½ÅÍפʥǡ¼¥¿¹½Â¤¤ä¥³¡¼¥ÉÎΰè¤òÊݸ¤ë¤¿¤á¤ËÍøÍѤµ¤ì¤ë»ÅÁȤß
¤Ç¤¢¤ë¡£<BR>
[in include/asm/semaphore.h](
<A HREF="./The-Linux-Kernel-images/linux/include/asm-i386/semaphore.h">i386</A>,
<A HREF="./The-Linux-Kernel-images/linux/include/asm-alpha/semaphore.h">alpha</A>]
<PRE>
struct semaphore {
int count;
int waking;
int lock ; /* to make waking testing atomic */
struct wait_queue *wait;
};
</PRE>
<P>
<A NAME="semid_ds"></A> <H2><A NAME="ss16.49">16.49 semid_ds(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/sem.h">include/linux/sem.h</A>]
<PRE>
struct semid_ds {
struct ipc_perm sem_perm; /* permissions .. see ipc.h */
time_t sem_otime; /* last semop time */
time_t sem_ctime; /* last change time */
struct sem *sem_base; /* ptr to first semaphore in array */
struct sem_queue *sem_pending; /* pending operations to be processed */
struct sem_queue **sem_pending_last; /* last pending operation */
struct sem_undo *undo; /* undo requests on this array */
ushort sem_nsems; /* no. of semaphores in array */
};
</PRE>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/ipc/sem.c">ipc/sem.c</A>]
<PRE>
static struct semid_ds *semary[SEMMNI];
</PRE>
<P>
<A NAME="sem_queue"></A> <H2><A NAME="ss16.50">16.50 sem_queue(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/sem.h">include/linux/sem.h</A>]
<PRE>
struct sem_queue {
struct sem_queue * next; /* next entry in the queue */
struct sem_queue ** prev; /* previous entry in the queue,
*(q->prev) == q */
struct wait_queue * sleeper; /* sleeping process */
struct sem_undo * undo; /* undo structure */
int pid; /* process id of requesting process */
int status; /* completion status of operation */
struct semid_ds * sma; /* semaphore array for operations */
struct sembuf * sops; /* array of pending operations */
int nsops; /* number of operations */
};
</PRE>
<P>
<A NAME="sem_undo"></A> <H2><A NAME="ss16.51">16.51 sem_undo(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/sem.h">include/linux/sem.h</A>]
<PRE>
struct sem_undo {
struct sem_undo * proc_next; /* next entry on this process */
struct sem_undo * id_next; /* next entry on this semaphore set */
int semid; /* semaphore set identifier */
short * semadj; /* array of adjustments,
one per semaphore */
};
</PRE>
<P>
<A NAME="shmid_ds"></A> <H2><A NAME="ss16.52">16.52 shmid_ds(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/shm.h">include/linux/shm.h</A>]
<PRE>
struct shmid_ds {
struct ipc_perm shm_perm; /* operation perms */
int shm_segsz; /* size of segment (bytes) */
time_t shm_atime; /* last attach time */
time_t shm_dtime; /* last detach time */
time_t shm_ctime; /* last change time */
unsigned short shm_cpid; /* pid of creator */
unsigned short shm_lpid; /* pid of last operator */
short shm_nattch; /* no. of current attaches */
/* the following are private */
unsigned short shm_npages; /* size of segment (pages) */
unsigned long *shm_pages; /* array of ptrs to frames -> SHMMAX */
struct vm_area_struct *attaches; /* descriptors for attaches */
};
</PRE>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/ipc/shm.c">ipc/shm.c</A>]
<PRE>
static struct shmid_ds *shm_segs[SHMMNI];
</PRE>
<P>
<A NAME="sigaction"></A> <H2><A NAME="ss16.53">16.53 sigaction(ÌõÃí)</A>
</H2>
<P>[in include/asm/signal.h](
<A HREF="./The-Linux-Kernel-images/linux/include/asm-i386/signal.h">i386</A>,
<A HREF="./The-Linux-Kernel-images/linux/include/asm-alpha/signal.h">alpha</A>)
<PRE>
struct sigaction {
__sighandler_t sa_handler;
sigset_t sa_mask;
unsigned long sa_flags;
void (*sa_restorer)(void);
};
</PRE>
<P>
<A NAME="signal_struct"></A> <H2><A NAME="ss16.54">16.54 signal_struct(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/sched.h">include/linux/sched.h</A>]
<PRE>
struct signal_struct {
int count;
struct sigaction action[32];
};
</PRE>
<P>
<P>
<A NAME="sk_buff"></A> <H2><A NAME="ss16.55">16.55 sk_buff</A>
</H2>
<P><CODE>sk_buff</CODE> ¥Ç¡¼¥¿¹½Â¤ÂΤϡ¢¥Í¥Ã¥È¥ï¡¼¥¯¥Ç¡¼¥¿¤¬¥×¥í¥È¥³¥ë³¬Áؤò°ÜÆ°
¤¹¤ëºÝ¤Ë¡¢¤½¤Î¥Ç¡¼¥¿¤òµ½Ò¤¹¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¤â¤Î¤Ç¤¢¤ë¡£<BR>
[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/skbuff.h">include/linux/skbuff.h</A>]
<P>
<PRE>
struct sk_buff
{
struct sk_buff *next; /* Next buffer in list */
struct sk_buff *prev; /* Previous buffer in list */
struct sk_buff_head *list; /* List we are on */
int magic_debug_cookie;
struct sk_buff *link3; /* Link for IP protocol level buffer chains*/
struct sock *sk; /* Socket we are owned by */
unsigned long when; /* used to compute rtt's */
struct timeval stamp; /* Time we arrived */
struct device *dev; /* Device we arrived on/are leaving by */
union
{
struct tcphdr *th;
struct ethhdr *eth;
struct iphdr *iph;
struct udphdr *uh;
unsigned char *raw;
/* for passing file handles in a unix domain socket */
void *filp;
} h;
union
{
/* As yet incomplete physical layer views */
unsigned char *raw;
struct ethhdr *ethernet;
} mac;
struct iphdr *ip_hdr; /* For IPPROTO_RAW */
unsigned long len; /* Length of actual data */
unsigned long csum; /* Checksum */
__u32 saddr; /* IP source address */
__u32 daddr; /* IP target address */
__u32 raddr; /* IP next hop address */
__u32 seq; /* TCP sequence number */
__u32 end_seq; /* seq [+ fin] [+ syn] + datalen */
__u32 ack_seq; /* TCP ack sequence number */
unsigned char proto_priv[16];
volatile char acked, /* Are we acked ? */
used, /* Are we in use ? */
free, /* How to free this buffer */
arp; /* Has IP/ARP resolution finished */
unsigned char tries, /* Times tried */
lock, /* Are we locked ? */
localroute, /* Local routing asserted for this frame */
pkt_type, /* Packet class */
pkt_bridged, /* Tracker for bridging */
ip_summed; /* Driver fed us an IP checksum */
#define PACKET_HOST 0 /* To us */
#define PACKET_BROADCAST 1 /* To all */
#define PACKET_MULTICAST 2 /* To group */
#define PACKET_OTHERHOST 3 /* To someone else */
unsigned short users; /* User count - see datagram.c,tcp.c */
unsigned short protocol; /* Packet protocol from driver. */
unsigned int truesize; /* Buffer size */
atomic_t count; /* reference count */
struct sk_buff *data_skb; /* Link to the actual data skb */
unsigned char *head; /* Head of buffer */
unsigned char *data; /* Data head pointer */
unsigned char *tail; /* Tail pointer */
unsigned char *end; /* End pointer */
void (*destructor)(struct sk_buff *); /* Destruct function */
__u16 redirport; /* Redirect port */
};
</PRE>
<P>
<A NAME="sk_buff_head"></A> <H2><A NAME="ss16.56">16.56 sk_buff_head(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/skbuff.h">include/linux/skbuff.h</A>]
<PRE>
struct sk_buff_head
{
struct sk_buff * next;
struct sk_buff * prev;
__u32 qlen; /* Must be same length as a pointer
for using debugging */
#if CONFIG_SKB_CHECK
int magic_debug_cookie;
#endif
};
</PRE>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/net/core/dev.c">net/core/dev.c</A>]
<PRE>
static struct sk_buff_head backlog;
</PRE>
<P>
<P>
<A NAME="sock"></A> <H2><A NAME="ss16.57">16.57 sock</A>
</H2>
<P>¸Ä¡¹¤Î <CODE>sock</CODE> ¥Ç¡¼¥¿¹½Â¤ÂΤϡ¢BSD ¥½¥±¥Ã¥È¤Ë´Ø¤¹¤ë¥×¥í¥È¥³¥ë¸ÇͤÎ
¾ðÊó¤òÊÝ»ý¤¹¤ë¤¿¤á¤Î¤â¤Î¤Ç¤¢¤ë¡£Î㤨¤Ð¡¢INET(Internet Address Domain)¥½¥±¥Ã¥È
¤Î¾ì¹ç¡¢¤³¤Î¥Ç¡¼¥¿¹½Â¤ÂΤˤϡ¢TCP/IP ¤È UDP/IP ¸ÇͤξðÊó¤Î¤¹¤Ù¤Æ¤¬ÊÝ»ý¤µ¤ì¤ë
¤³¤È¤Ë¤Ê¤ë¡£<BR>
[in
<A HREF="./The-Linux-Kernel-images/linux/include/net/sock.h">include/net/sock.h</A>]
<PRE>
struct sock
{
/* This must be first. */
struct sock *sklist_next;
struct sock *sklist_prev;
struct options *opt;
atomic_t wmem_alloc;
atomic_t rmem_alloc;
unsigned long allocation; /* Allocation mode */
__u32 write_seq;
__u32 sent_seq;
__u32 acked_seq;
__u32 copied_seq;
__u32 rcv_ack_seq;
unsigned short rcv_ack_cnt; /* count of same ack */
__u32 window_seq;
__u32 fin_seq;
__u32 urg_seq;
__u32 urg_data;
__u32 syn_seq;
int users; /* user count */
/*
* Not all are volatile, but some are, so we
* might as well say they all are.
*/
volatile char dead,
urginline,
intr,
blog,
done,
reuse,
keepopen,
linger,
delay_acks,
destroy,
ack_timed,
no_check,
zapped,
broadcast,
nonagle,
bsdism;
unsigned long lingertime;
int proc;
struct sock *next;
struct sock **pprev;
struct sock *bind_next;
struct sock **bind_pprev;
struct sock *pair;
int hashent;
struct sock *prev;
struct sk_buff *volatile send_head;
struct sk_buff *volatile send_next;
struct sk_buff *volatile send_tail;
struct sk_buff_head back_log;
struct sk_buff *partial;
struct timer_list partial_timer;
long retransmits;
struct sk_buff_head write_queue,
receive_queue;
struct proto *prot;
struct wait_queue **sleep;
__u32 daddr;
__u32 saddr; /* Sending source */
__u32 rcv_saddr; /* Bound address */
unsigned short max_unacked;
unsigned short window;
__u32 lastwin_seq; /* sequence number when we last
updated the window we offer */
__u32 high_seq; /* sequence number when we did
current fast retransmit */
volatile unsigned long ato; /* ack timeout */
volatile unsigned long lrcvtime; /* jiffies at last data rcv */
volatile unsigned long idletime; /* jiffies at last rcv */
unsigned int bytes_rcv;
/*
* mss is min(mtu, max_window)
*/
unsigned short mtu; /* mss negotiated in the syn's */
volatile unsigned short mss; /* current eff. mss - can change */
volatile unsigned short user_mss; /* mss requested by user in ioctl */
volatile unsigned short max_window;
unsigned long window_clamp;
unsigned int ssthresh;
unsigned short num;
volatile unsigned short cong_window;
volatile unsigned short cong_count;
volatile unsigned short packets_out;
volatile unsigned short shutdown;
volatile unsigned long rtt;
volatile unsigned long mdev;
volatile unsigned long rto;
volatile unsigned short backoff;
int err, err_soft;/* Soft holds errors that don't
cause failure but are the cause
of a persistent failure not
just 'timed out' */
unsigned char protocol;
volatile unsigned char state;
unsigned char ack_backlog;
unsigned char max_ack_backlog;
unsigned char priority;
unsigned char debug;
int rcvbuf;
int sndbuf;
unsigned short type;
unsigned char localroute; /* Route locally only */
/*
* This is where all the private (optional) areas that don't
* overlap will eventually live.
*/
union
{
struct unix_opt af_unix;
#if defined(CONFIG_ATALK) || defined(CONFIG_ATALK_MODULE)
struct atalk_sock af_at;
#endif
#if defined(CONFIG_IPX) || defined(CONFIG_IPX_MODULE)
struct ipx_opt af_ipx;
#endif
#ifdef CONFIG_INET
struct inet_packet_opt af_packet;
#ifdef CONFIG_NUTCP
struct tcp_opt af_tcp;
#endif
#endif
} protinfo;
/*
* IP 'private area'
*/
int ip_ttl; /* TTL setting */
int ip_tos; /* TOS */
struct tcphdr dummy_th;
struct timer_list keepalive_timer; /* TCP keepalive hack */
struct timer_list retransmit_timer; /* TCP retransmit timer */
struct timer_list delack_timer; /* TCP delayed ack timer */
int ip_xmit_timeout; /* Why the timeout is running */
struct rtable *ip_route_cache; /* Cached output route */
unsigned char ip_hdrincl; /* Include headers ? */
#ifdef CONFIG_IP_MULTICAST
int ip_mc_ttl; /* Multicasting TTL */
int ip_mc_loop; /* Loopback */
char ip_mc_name[MAX_ADDR_LEN]; /* Multicast device name */
struct ip_mc_socklist *ip_mc_list; /* Group array */
#endif
/*
* This part is used for the timeout functions (timer.c).
*/
int timeout; /* What are we waiting for? */
struct timer_list timer; /* This is the TIME_WAIT/receive
* timer when we are doing IP
*/
struct timeval stamp;
/*
* Identd
*/
struct socket *socket;
/*
* Callbacks
*/
void (*state_change)(struct sock *sk);
void (*data_ready)(struct sock *sk,int bytes);
void (*write_space)(struct sock *sk);
void (*error_report)(struct sock *sk);
};
</PRE>
<A NAME="udp_hash"></A> <P>(ÌõÃí)[in
<A HREF="./The-Linux-Kernel-images/linux/net/ipv4/udp.c">net/ipv4/udp.c</A>]
<PRE>
struct sock *udp_hash[UDP_HTABLE_SIZE];
</PRE>
<A NAME="tcp_listening_hash"></A> <P>(ÌõÃí)[in
<A HREF="./The-Linux-Kernel-images/linux/net/ipv4/tcp.c">net/ipv4/tcp.c</A>]
<PRE>
struct sock *tcp_established_hash[TCP_HTABLE_SIZE];
...
struct sock *tcp_listening_hash[TCP_LHTABLE_SIZE];
...
struct sock *tcp_bound_hash[TCP_BHTABLE_SIZE];
</PRE>
<P>
<A NAME="sockaddr"></A> <H2><A NAME="ss16.58">16.58 sockaddr(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/socket.h">include/linux/socket.h</A>]
<PRE>
struct sockaddr
{
unsigned short sa_family; /* address family, AF_xxx */
char sa_data[14]; /* 14 bytes of protocol address */
};
</PRE>
<P>
<P>
<A NAME="socket"></A> <H2><A NAME="ss16.59">16.59 socket</A>
</H2>
<P>¸Ä¡¹¤Î <CODE>socket</CODE> ¥Ç¡¼¥¿¹½Â¤ÂΤϡ¢BSD ¥½¥±¥Ã¥È¤Ë´Ø¤¹¤ë¾ðÊó¤òÊÝ»ý¤¹¤ë
¤â¤Î¤Ç¤¢¤ë¡£¤·¤«¤·¡¢¤³¤ì¤ÏñÆȤǸºß¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢VFS <CODE>inode</CODE>
¥Ç¡¼¥¿¹½Â¤ÂΤΰìÉô¤È¤·¤Æ¸ºß¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£<BR>
[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/net.h">include/linux/net.h</A>]<BR>
<PRE>
struct socket {
short type; /* SOCK_STREAM, ... */
socket_state state;
long flags;
struct proto_ops *ops; /* protocols do most everything */
void *data; /* protocol data */
struct socket *conn; /* server socket connected to */
struct socket *iconn; /* incomplete client conn.s */
struct socket *next;
struct wait_queue **wait; /* ptr to place to wait on */
struct inode *inode;
struct fasync_struct *fasync_list; /* Asynchronous wake up list */
struct file *file; /* File back pointer for gc */
};
</PRE>
<P>
<A NAME="super_block"></A> <H2><A NAME="ss16.60">16.60 super_block(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/fs.h">include/linux/fs.h</A>]
<PRE>
struct super_block {
kdev_t s_dev;
unsigned long s_blocksize;
unsigned char s_blocksize_bits;
unsigned char s_lock;
unsigned char s_rd_only;
unsigned char s_dirt;
struct file_system_type *s_type;
struct super_operations *s_op;
struct dquot_operations *dq_op;
unsigned long s_flags;
unsigned long s_magic;
unsigned long s_time;
struct inode * s_covered;
struct inode * s_mounted;
struct wait_queue * s_wait;
union {
struct minix_sb_info minix_sb;
struct ext_sb_info ext_sb;
struct ext2_sb_info ext2_sb;
struct hpfs_sb_info hpfs_sb;
struct msdos_sb_info msdos_sb;
struct isofs_sb_info isofs_sb;
struct nfs_sb_info nfs_sb;
struct xiafs_sb_info xiafs_sb;
struct sysv_sb_info sysv_sb;
struct affs_sb_info affs_sb;
struct ufs_sb_info ufs_sb;
void *generic_sbp;
} u;
};
...
...
extern struct super_block super_blocks[NR_SUPER];
</PRE>
<P>
<A NAME="swap_control"></A> <H2><A NAME="ss16.61">16.61 swap_control(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/swapctl.h">include/linux/swapctl.h</A>]
<PRE>
typedef struct swap_control_v5
{
int sc_max_page_age;
int sc_page_advance;
int sc_page_decline;
int sc_page_initial_age;
int sc_max_buff_age;
int sc_buff_advance;
int sc_buff_decline;
int sc_buff_initial_age;
int sc_age_cluster_fract;
int sc_age_cluster_min;
int sc_pageout_weight;
int sc_bufferout_weight;
int sc_buffer_grace;
int sc_nr_buffs_to_free;
int sc_nr_pages_to_free;
enum RCL_POLICY sc_policy;
} swap_control_v5;
typedef struct swap_control_v5 swap_control_t;
extern swap_control_t swap_control;
</PRE>
<P>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/mm/swap.c">mm/swap.c</A>]
<PRE>
/*
* Constants for the page aging mechanism: the maximum age (actually,
* the maximum "youthfulness"); the quanta by which pages rejuvenate
* and age; and the initial age for new pages.
*/
swap_control_t swap_control = {
20, 3, 1, 3, /* Page aging */
10, 2, 2, 4, /* Buffer aging */
32, 4, /* Aging cluster */
8192, 8192, /* Pageout and bufferout weights */
-200, /* Buffer grace */
1, 1, /* Buffs/pages to free */
RCL_ROUND_ROBIN /* Balancing policy */
};
</PRE>
<P>
<A NAME="swap_info_struct"></A> <H2><A NAME="ss16.62">16.62 swap_info_struct(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/swap.h">include/linux/swap.h</A>]
<PRE>
struct swap_info_struct {
unsigned int flags;
kdev_t swap_device;
struct inode * swap_file;
unsigned char * swap_map;
unsigned char * swap_lockmap;
int lowest_bit;
int highest_bit;
int cluster_next;
int cluster_nr;
int prio; /* swap priority */
int pages;
unsigned long max;
int next; /* next entry on swap list */
};
extern int nr_swap_pages;
extern int nr_free_pages;
extern atomic_t nr_async_pages;
extern int min_free_pages;
extern int free_pages_low;
extern int free_pages_high;
</PRE>
<P>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/mm/swap.c">mm/swap.c</A>]
<PRE>
/*
* We identify three levels of free memory. We never let free mem
* fall below the min_free_pages except for atomic allocations. We
* start background swapping if we fall below free_pages_high free
* pages, and we begin intensive swapping below free_pages_low.
*
* Keep these three variables contiguous for sysctl(2).
*/
int min_free_pages = 20;
int free_pages_low = 30;
int free_pages_high = 40;
/* We track the number of pages currently being asynchronously swapped
out, so that we don't try to swap TOO many pages out at once */
atomic_t nr_async_pages = 0;
</PRE>
<P>
<P>
<P>
<A NAME="task_struct"></A> <H2><A NAME="ss16.63">16.63 task_struct</A>
</H2>
<P>¸Ä¡¹¤Î <CODE>task_struct</CODE> ¥Ç¡¼¥¿¹½Â¤ÂΤϡ¢¥·¥¹¥Æ¥à¾å¤Î¡¢¤Ò¤È¤Ä¤Î¥×¥í¥»¥¹
¤â¤·¤¯¤Ï¥¿¥¹¥¯¤Ë¤Ä¤¤¤Æµ½Ò¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£<BR>
[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/sched.h">include/linux/sched.h</A>]
<PRE>
struct task_struct {
/* these are hardcoded - don't touch */
volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */
long counter;
long priority;
unsigned long signal;
unsigned long blocked; /* bitmap of masked signals */
unsigned long flags; /* per process flags, defined below */
int errno;
long debugreg[8]; /* Hardware debugging registers */
struct exec_domain *exec_domain;
/* various fields */
struct linux_binfmt *binfmt;
struct task_struct *next_task, *prev_task;
struct task_struct *next_run, *prev_run;
unsigned long saved_kernel_stack;
unsigned long kernel_stack_page;
int exit_code, exit_signal;
/* ??? */
unsigned long personality;
int dumpable:1;
int did_exec:1;
int pid;
int pgrp;
int tty_old_pgrp;
int session;
/* boolean value for session group leader */
int leader;
int groups[NGROUPS];
/*
* pointers to (original) parent process, youngest child, younger sibling,
* older sibling, respectively. (p->father can be replaced with
* p->p_pptr->pid)
*/
struct task_struct *p_opptr, *p_pptr, *p_cptr,
*p_ysptr, *p_osptr;
struct wait_queue *wait_chldexit;
unsigned short uid,euid,suid,fsuid;
unsigned short gid,egid,sgid,fsgid;
unsigned long timeout, policy, rt_priority;
unsigned long it_real_value, it_prof_value, it_virt_value;
unsigned long it_real_incr, it_prof_incr, it_virt_incr;
struct timer_list real_timer;
long utime, stime, cutime, cstime, start_time;
/* mm fault and swap info: this can arguably be seen as either
mm-specific or thread-specific */
unsigned long min_flt, maj_flt, nswap, cmin_flt, cmaj_flt, cnswap;
int swappable:1;
unsigned long swap_address;
unsigned long old_maj_flt; /* old value of maj_flt */
unsigned long dec_flt; /* page fault count of the last time */
unsigned long swap_cnt; /* number of pages to swap on next pass */
/* limits */
struct rlimit rlim[RLIM_NLIMITS];
unsigned short used_math;
char comm[16];
/* file system info */
int link_count;
struct tty_struct *tty; /* NULL if no tty */
/* ipc stuff */
struct sem_undo *semundo;
struct sem_queue *semsleeping;
/* ldt for this task - used by Wine. If NULL, default_ldt is used */
struct desc_struct *ldt;
/* tss for this task */
struct thread_struct tss;
/* filesystem information */
struct fs_struct *fs;
/* open file information */
struct files_struct *files;
/* memory management info */
struct mm_struct *mm;
/* signal handlers */
struct signal_struct *sig;
#ifdef __SMP__
int processor;
int last_processor;
int lock_depth; /* Lock depth.
We can context switch in and out
of holding a syscall kernel lock... */
#endif
};
</PRE>
<P>
<A NAME="task"></A>
<PRE>
...
...
extern struct task_struct *task[NR_TASKS];
...
extern struct task_struct *current_set[NR_CPUS];
/*
* On a single processor system this comes out as current_set[0] when cpp
* has finished with it, which gcc will optimise away.
*/
#define current (0+current_set[smp_processor_id()]) /* Current on this processor */
extern unsigned long volatile jiffies;
</PRE>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/tasks.h">include/linux/tasks.h</A>]
<PRE>
#define NR_TASKS 512
</PRE>
<P>
<A NAME="processor_mask"></A>
(ÌõÃí: °Ê²¼¤Î¥³¡¼¥É¤Ï¡¢patch-1.3.99 ¤ÇÆþ¤ê¤Þ¤·¤¿¤¬¡¢¤ª¤½¤é¤¯ÍøÍѤµ¤ì¤ë¤³¤È¤Î
¤Ê¤¤¤Þ¤Þ¡¢v2.2.0 °Ê¹ß¤Ç¾ÃÌǤ·¤Æ¤¤¤Þ¤¹¡£)<BR>
[in
<A HREF="./The-Linux-Kernel-images/linux/kernel/sched.c">kernel/sched.c</A>]
<P>
<PRE>
#ifdef PAST_2_0
/* This process is locked to a processor group */
if (p->processor_mask && !(p->processor_mask & (1<<this_cpu))
return -1000;
</PRE>
<P>
<A NAME="timer_list"></A> <H2><A NAME="ss16.64">16.64 timer_list</A>
</H2>
<P><CODE>timer_list</CODE> ¤È¤¤¤¦¥Ç¡¼¥¿¹½Â¤¤Ë¤è¤Ã¤Æ¡¢¥×¥í¥»¥¹¤Î¥ê¥¢¥ë¥¿¥¤¥à
¥¿¥¤¥Þ¡¼¤¬¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£<BR>
[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/timer.h">include/linux/timer.h</A>]
<P>
<PRE>
struct timer_list {
struct timer_list *next;
struct timer_list *prev;
unsigned long expires;
unsigned long data;
void (*function)(unsigned long);
};
</PRE>
<P>
<P>
<A NAME="timer_struct"></A> <H2><A NAME="ss16.65">16.65 timer_struct(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/timer.h">include/linux/timer.h</A>]
<PRE>
struct timer_struct {
unsigned long expires;
void (*fn)(void);
};
extern unsigned long timer_active;
extern struct timer_struct timer_table[32];
</PRE>
<P>
<P>
<A NAME="tq_struct"></A> <H2><A NAME="ss16.66">16.66 tq_struct</A>
</H2>
<P>¸Ä¡¹¤Î¥¿¥¹¥¯¥¥å¡¼(<CODE>tq_struct</CODE>)¥Ç¡¼¥¿¹½Â¤ÂΤϡ¢¥¥å¡¼¾å¤ËÅÐÏ¿¤µ¤ì¤¿
»Å»ö¤Ë´Ø¤¹¤ë¾ðÊó¤òÊÝ»ý¤·¤Æ¤¤¤ë¡£Ä̾盧¤ì¤é¤Î¥¿¥¹¥¯¤Ï¡¢¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤Ë
¤È¤Ã¤ÆɬÍפʤΤÀ¤¬¡¢¤¹¤°¤Ë¼Â¹Ô¤¹¤ëɬÍפΤʤ¤¥¿¥¹¥¯¤Ç¤¢¤ë¡£<BR>
[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/tqueue.h">include/linux/tqueue.h</A>]
<P>
<PRE>
struct tq_struct {
struct tq_struct *next; /* linked list of active bh's */
int sync; /* must be initialized to zero */
void (*routine)(void *); /* function to call */
void *data; /* argument to function */
};
</PRE>
<P>
<P>
<A NAME="vfsmount"></A> <H2><A NAME="ss16.67">16.67 vfsmount(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/mount.h">include/linux/mount.h</A>]
<PRE>
struct vfsmount
{
kdev_t mnt_dev; /* Device this applies to */
char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */
char *mnt_dirname; /* Name of directory mounted on */
unsigned int mnt_flags; /* Flags of this device */
struct semaphore mnt_sem; /* lock device while I/O in progress */
struct super_block *mnt_sb; /* pointer to superblock */
struct file *mnt_quotas[MAXQUOTAS]; /* fp's to quotafiles */
time_t mnt_iexp[MAXQUOTAS]; /* expiretime for inodes */
time_t mnt_bexp[MAXQUOTAS]; /* expiretime for blocks */
struct vfsmount *mnt_next; /* pointer to next in linkedlist */
};
</PRE>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/fs/super.c">fs/super.c</A>]
<PRE>
static struct vfsmount *vfsmntlist = (struct vfsmount *) NULL,
*vfsmnttail = (struct vfsmount *) NULL,
*mru_vfsmnt = (struct vfsmount *) NULL;
</PRE>
<P>
<P>
<A NAME="vm_area_struct"></A> <H2><A NAME="ss16.68">16.68 vm_area_struct</A>
</H2>
<P>¸Ä¡¹¤Î <CODE>vm_area</CODE> ¥Ç¡¼¥¿¹½Â¤ÂΤϡ¢¤¢¤ë¥×¥í¥»¥¹¤Î²¾ÁÛ¥á¥â¥ê¥¨¥ê¥¢¤ò
µ½Ò¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£<BR>
[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/mm.h">include/linux/mm.h</A>]
<P>
<PRE>
struct vm_area_struct {
struct mm_struct * vm_mm; /* VM area parameters */
unsigned long vm_start;
unsigned long vm_end;
pgprot_t vm_page_prot;
unsigned short vm_flags;
/* AVL tree of VM areas per task, sorted by address */
short vm_avl_height;
struct vm_area_struct * vm_avl_left;
struct vm_area_struct * vm_avl_right;
/* linked list of VM areas per task, sorted by address */
struct vm_area_struct * vm_next;
/* for areas with inode, the circular list inode->i_mmap */
/* for shm areas, the circular list of attaches */
/* otherwise unused */
struct vm_area_struct * vm_next_share;
struct vm_area_struct * vm_prev_share;
/* more */
struct vm_operations_struct * vm_ops;
unsigned long vm_offset;
struct inode * vm_inode;
unsigned long vm_pte; /* shared mem */
};
</PRE>
<P>
<A NAME="vm_operations_struct"></A> <H2><A NAME="ss16.69">16.69 vm_operations_struct(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/mm.h">include/linux/mm.h</A>]
<P>
<PRE>
struct vm_operations_struct {
void (*open)(struct vm_area_struct * area);
void (*close)(struct vm_area_struct * area);
void (*unmap)(struct vm_area_struct *area, unsigned long, size_t);
void (*protect)(struct vm_area_struct *area, unsigned long, size_t,
unsigned int newprot);
int (*sync)(struct vm_area_struct *area, unsigned long, size_t,
unsigned int flags);
void (*advise)(struct vm_area_struct *area, unsigned long, size_t,
unsigned int advise);
unsigned long (*nopage)(struct vm_area_struct * area,
unsigned long address, int write_access);
unsigned long (*wppage)(struct vm_area_struct * area,
unsigned long address, unsigned long page);
int (*swapout)(struct vm_area_struct *, unsigned long, pte_t *);
pte_t (*swapin)(struct vm_area_struct *, unsigned long, unsigned long);
};
</PRE>
<P>
<A NAME="wait_queue"></A> <H2><A NAME="ss16.70">16.70 wait_queue(ÌõÃí)</A>
</H2>
<P>[in
<A HREF="./The-Linux-Kernel-images/linux/include/linux/wait.h">include/linux/wait.h</A>]
<PRE>
struct wait_queue {
struct task_struct * task;
struct wait_queue * next;
};
</PRE>
<P>
<P>
<P>
<P>
<P>
<HR>
<A HREF="The-Linux-Kernel-17.html">¼¡¤Î¥Ú¡¼¥¸</A>
<A HREF="The-Linux-Kernel-15.html">Á°¤Î¥Ú¡¼¥¸</A>
<A HREF="The-Linux-Kernel.html#toc16">Ìܼ¡¤Ø</A>
</BODY>
</HTML>
|