33
34 #include <sys/ncall/ncall.h>
35
36 #define __NSC_GEN__
37 #include "nsc_dev.h"
38
39 #ifdef DS_DDICT
40 #include "../contract.h"
41 #endif
42
43 #include "../nsctl.h"
44
45 #define NSC_DEVMIN "DevMin"
46 #define NSC_DEVMAJ "DevMaj"
47
48 #define _I(x) (((long)(&((nsc_io_t *)0)->x))/sizeof (long))
49 #define _F(x) (((long)(&((nsc_fd_t *)0)->x))/sizeof (long))
50
51
52 nsc_def_t _nsc_io_def[] = {
53 "Open", (uintptr_t)nsc_null, _I(open),
54 "Close", (uintptr_t)nsc_null, _I(close),
55 "Attach", (uintptr_t)nsc_null, _I(attach),
56 "Detach", (uintptr_t)nsc_null, _I(detach),
57 "Flush", (uintptr_t)nsc_null, _I(flush),
58 "Provide", 0, _I(provide),
59 0, 0, 0
60 };
61
62 nsc_def_t _nsc_fd_def[] = {
63 "Pinned", (uintptr_t)nsc_null, _F(sf_pinned),
64 "Unpinned", (uintptr_t)nsc_null, _F(sf_unpinned),
65 "Attach", (uintptr_t)nsc_null, _F(sf_attach),
66 "Detach", (uintptr_t)nsc_null, _F(sf_detach),
67 "Flush", (uintptr_t)nsc_null, _F(sf_flush),
68 0, 0, 0
69 };
70
71 kmutex_t _nsc_io_lock;
72 kmutex_t _nsc_devval_lock;
73
74 nsc_io_t *_nsc_io_top = NULL;
75 nsc_io_t *_nsc_null_io = NULL;
76 nsc_dev_t *_nsc_dev_top = NULL;
77 nsc_dev_t *_nsc_dev_pend = NULL;
78 nsc_path_t *_nsc_path_top = NULL;
79 nsc_devval_t *_nsc_devval_top = NULL;
80
81 extern nsc_def_t _nsc_disk_def[];
82 extern nsc_def_t _nsc_cache_def[];
83
84 extern nsc_mem_t *_nsc_local_mem;
85 extern nsc_rmmap_t *_nsc_global_map;
86
87 static clock_t _nsc_io_lbolt;
88
|
33
34 #include <sys/ncall/ncall.h>
35
36 #define __NSC_GEN__
37 #include "nsc_dev.h"
38
39 #ifdef DS_DDICT
40 #include "../contract.h"
41 #endif
42
43 #include "../nsctl.h"
44
45 #define NSC_DEVMIN "DevMin"
46 #define NSC_DEVMAJ "DevMaj"
47
48 #define _I(x) (((long)(&((nsc_io_t *)0)->x))/sizeof (long))
49 #define _F(x) (((long)(&((nsc_fd_t *)0)->x))/sizeof (long))
50
51
52 nsc_def_t _nsc_io_def[] = {
53 { "Open", (uintptr_t)nsc_null, _I(open) },
54 { "Close", (uintptr_t)nsc_null, _I(close) },
55 { "Attach", (uintptr_t)nsc_null, _I(attach) },
56 { "Detach", (uintptr_t)nsc_null, _I(detach) },
57 { "Flush", (uintptr_t)nsc_null, _I(flush) },
58 { "Provide", (uintptr_t)NULL, _I(provide) },
59 { NULL, (uintptr_t)NULL, 0 }
60 };
61
62 nsc_def_t _nsc_fd_def[] = {
63 { "Pinned", (uintptr_t)nsc_null, _F(sf_pinned) },
64 { "Unpinned", (uintptr_t)nsc_null, _F(sf_unpinned) },
65 { "Attach", (uintptr_t)nsc_null, _F(sf_attach) },
66 { "Detach", (uintptr_t)nsc_null, _F(sf_detach) },
67 { "Flush", (uintptr_t)nsc_null, _F(sf_flush) },
68 { NULL, (uintptr_t)NULL, 0 }
69 };
70
71 kmutex_t _nsc_io_lock;
72 kmutex_t _nsc_devval_lock;
73
74 nsc_io_t *_nsc_io_top = NULL;
75 nsc_io_t *_nsc_null_io = NULL;
76 nsc_dev_t *_nsc_dev_top = NULL;
77 nsc_dev_t *_nsc_dev_pend = NULL;
78 nsc_path_t *_nsc_path_top = NULL;
79 nsc_devval_t *_nsc_devval_top = NULL;
80
81 extern nsc_def_t _nsc_disk_def[];
82 extern nsc_def_t _nsc_cache_def[];
83
84 extern nsc_mem_t *_nsc_local_mem;
85 extern nsc_rmmap_t *_nsc_global_map;
86
87 static clock_t _nsc_io_lbolt;
88
|