|
|
1.1 root 1: #ifndef __KERNEL_DDI_GLOB_H__
2: #define __KERNEL_DDI_GLOB_H__
3:
4: /*
5: * This internal header file defines structures and an access procedure for
6: * DDI/DKI global data that must be shared between all CPUs. Note that this
7: * may not be all the truly global context; examine the STREAMS header files
8: * for additional global data specific to STREAMS.
9: */
10:
11: /*
12: *-IMPORTS:
13: * <common/ccompat.h>
14: * __EXTERN_C_BEGIN__
15: * __EXTERN_C_END__
16: * __PROTO ()
17: * <kernel/_lock.h>
18: * lock_t
19: * <kernel/_toid.h>
20: * toid_t
21: * <kernel/x86lock.h>
22: * atomic_uchar_t
23: */
24:
25: #include <common/ccompat.h>
26: #include <kernel/x86lock.h>
27: #include <kernel/_lock.h>
28: #include <kernel/_toid.h>
29: #include <kernel/ddi_data.h>
30:
31:
32: /*
33: * Timeout events are stored on a global queue, both while they are pending
34: * and once they have expired. When an event expires, it is bound to a CPU
35: * (if one was not specified when the event was created) and a function to
36: * process expired events on that CPU is deferred.
37: */
38:
39: typedef struct timeout timeout_t;
40:
41: typedef struct tlist {
42: __lock_t * td_lock;
43: toid_t td_id;
44: timeout_t * td_first;
45: timeout_t * td_run;
46: } timelist_t;
47:
48:
49: /*
50: * Truly global data used by the DDI/DKI system (except for STREAMS global
51: * data).
52: */
53:
54: struct ddi_global_data {
55: /*
56: * The defer-table data is at the front of the structure because it is
57: * typically manipulated by hand-coded assembly-language routines.
58: */
59:
60: defer_t dg_defint; /* interrupt-level defers */
61: defer_t dg_defproc; /* process-level defers */
62:
63: __lock_t * dg_polllock; /* global lock on polling */
64: __lock_t * dg_proclock; /* process reference count */
65:
66: timelist_t dg_timeouts; /* timeout data */
67:
68: atomic_uchar_t dg_run_bufcalls; /* bufcall check deferred */
69: atomic_uchar_t dg_run_strsched; /* STREAMS service deferred */
70: atomic_uchar_t dg_run_time; /* timeout check deferred */
71: };
72:
73: typedef struct ddi_global_data dgdata_t;
74:
75:
76: __EXTERN_C_BEGIN__
77:
78: dgdata_t * ddi_global_data __PROTO ((void));
79:
80: __EXTERN_C_END__
81:
82:
83: extern dgdata_t __ddi_global_data;
84:
85: #define ddi_global_data() (& __ddi_global_data)
86:
87:
88: #endif /* ! defined (__KERNEL_DDI_GLOB_H__) */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.