Commit | Line | Data |
---|---|---|
4151b1f7 | 1 | /* in_systm.h 4.11 82/05/31 */ |
8e112dd4 BJ |
2 | |
3 | /* | |
4 | * Miscellaneous internetwork | |
5 | * definitions for kernel. | |
6 | */ | |
7 | ||
9c8692e9 | 8 | #ifndef LOCORE |
8e112dd4 BJ |
9 | /* |
10 | * Network types. | |
11 | * | |
12 | * Internally the system keeps counters in the headers with the bytes | |
13 | * swapped so that VAX instructions will work on them. It reverses | |
14 | * the bytes before transmission at each protocol level. The n_ types | |
15 | * represent the types with the bytes in ``high-ender'' order. | |
16 | */ | |
17 | typedef u_short n_short; /* short as received from the net */ | |
18 | typedef u_long n_long; /* long as received from the net */ | |
8e112dd4 BJ |
19 | |
20 | typedef u_long n_time; /* ms since 00:00 GMT, byte rev */ | |
9c8692e9 | 21 | #endif |
8e112dd4 BJ |
22 | |
23 | /* | |
8a13b737 | 24 | * The internet code runs off software interrupts. |
8a13b737 | 25 | * |
8e112dd4 BJ |
26 | * You can switch into the network by doing splnet() and return by splx(). |
27 | * The software interrupt level for the network is higher than the software | |
28 | * level for the clock (so you can enter the network in routines called | |
29 | * at timeout time). Splimp is an ipl high enough to block all imps. | |
2b4b57cd | 30 | * While manipulating the mbuf buffer pool you have to block imps. |
8e112dd4 | 31 | */ |
9c8692e9 | 32 | |
8e112dd4 | 33 | /* splnet is defined in ../sys/asm.sed */ |
4151b1f7 SL |
34 | #include "ec.h" |
35 | #if NEC > 0 | |
7d6f1cd5 SL |
36 | #define splimp spl6 |
37 | #else | |
38 | #define splimp spl5 | |
39 | #endif | |
9c8692e9 BJ |
40 | #define setsoftnet() mtpr(SIRR, 12) |
41 | ||
42 | /* | |
43 | * Each ``pup-level-1'' input queue has a bit in a ``netisr'' status | |
44 | * word which is used to de-multiplex a single software | |
45 | * interrupt used for scheduling the network code to calls | |
46 | * on the lowest level routine of each protocol. | |
47 | */ | |
48 | #define NETISR_RAW 0 /* same as AF_UNSPEC */ | |
49 | #define NETISR_IP 2 /* same as AF_INET */ | |
50 | #define NETISR_NS 6 /* same as AF_NS */ | |
51 | ||
52 | #define schednetisr(anisr) { netisr |= 1<<(anisr); setsoftnet(); } | |
53 | ||
54 | #ifndef LOCORE | |
55 | #ifdef KERNEL | |
56 | int netisr; /* scheduling bits for network */ | |
57 | #endif | |
58 | ||
8e112dd4 | 59 | |
8e112dd4 | 60 | #ifdef KERNEL |
2b4b57cd | 61 | n_time iptime(); |
8e112dd4 BJ |
62 | #endif |
63 | ||
64 | #ifdef KPROF | |
65 | #include "../inet/count.h" | |
66 | #define COUNT(i) nrcount[i]++ | |
67 | int nrcount[NCOUNTERS+1]; | |
68 | #else | |
69 | #define COUNT(i) | |
70 | #endif | |
9c8692e9 | 71 | #endif |