26 #include <sys/types.h>
27 #include <sys/ksynch.h>
28 #include <sys/errno.h>
29 #include <sys/uio.h>
30 #include <sys/ddi.h>
31
32 #define __NSC_GEN__
33 #include "nsc_dev.h"
34
35 #ifdef DS_DDICT
36 #include "../contract.h"
37 #endif
38
39 #include "../nsctl.h"
40
41
42 #define _I(x) (((long)(&((nsc_io_t *)0)->x))/sizeof (long))
43
44
45 nsc_def_t _nsc_cache_def[] = {
46 "AllocBuf", (uintptr_t)nsc_ioerr, _I(alloc_buf),
47 "FreeBuf", (uintptr_t)nsc_fatal, _I(free_buf),
48 "Read", (uintptr_t)nsc_fatal, _I(read),
49 "Write", (uintptr_t)nsc_fatal, _I(write),
50 "Zero", (uintptr_t)nsc_fatal, _I(zero),
51 "Copy", (uintptr_t)nsc_ioerr, _I(copy),
52 "CopyDirect", (uintptr_t)nsc_ioerr, _I(copy_direct),
53 "Uncommit", (uintptr_t)nsc_null, _I(uncommit),
54 "AllocHandle", (uintptr_t)nsc_null, _I(alloc_h),
55 "FreeHandle", (uintptr_t)nsc_fatal, _I(free_h),
56 "TrackSize", (uintptr_t)nsc_null, _I(trksize),
57 "Discard", (uintptr_t)nsc_null, _I(discard),
58 "Sizes", (uintptr_t)nsc_null, _I(sizes),
59 "GetPinned", (uintptr_t)nsc_null, _I(getpin),
60 "NodeHints", (uintptr_t)nsc_inval, _I(nodehints),
61 0, 0, 0
62 };
63
64
65 static int _nsc_alloc_buf_h(blind_t, nsc_off_t, nsc_size_t, int,
66 nsc_buf_t **, nsc_fd_t *);
67 static int _nsc_copy_h(nsc_buf_t *, nsc_buf_t *, nsc_off_t,
68 nsc_off_t, nsc_size_t);
69
70 extern nsc_io_t *_nsc_reserve_io(char *, int);
71 extern void _nsc_release_io(nsc_io_t *);
72
73 extern kmutex_t _nsc_io_lock;
74
75
76
77
78 /* ARGSUSED */
79
80 void
81 _nsc_add_cache(nsc_io_t *io)
|
26 #include <sys/types.h>
27 #include <sys/ksynch.h>
28 #include <sys/errno.h>
29 #include <sys/uio.h>
30 #include <sys/ddi.h>
31
32 #define __NSC_GEN__
33 #include "nsc_dev.h"
34
35 #ifdef DS_DDICT
36 #include "../contract.h"
37 #endif
38
39 #include "../nsctl.h"
40
41
42 #define _I(x) (((long)(&((nsc_io_t *)0)->x))/sizeof (long))
43
44
45 nsc_def_t _nsc_cache_def[] = {
46 { "AllocBuf", (uintptr_t)nsc_ioerr, _I(alloc_buf) },
47 { "FreeBuf", (uintptr_t)nsc_fatal, _I(free_buf) },
48 { "Read", (uintptr_t)nsc_fatal, _I(read) },
49 { "Write", (uintptr_t)nsc_fatal, _I(write) },
50 { "Zero", (uintptr_t)nsc_fatal, _I(zero) },
51 { "Copy", (uintptr_t)nsc_ioerr, _I(copy) },
52 { "CopyDirect", (uintptr_t)nsc_ioerr, _I(copy_direct) },
53 { "Uncommit", (uintptr_t)nsc_null, _I(uncommit) },
54 { "AllocHandle", (uintptr_t)nsc_null, _I(alloc_h) },
55 { "FreeHandle", (uintptr_t)nsc_fatal, _I(free_h) },
56 { "TrackSize", (uintptr_t)nsc_null, _I(trksize) },
57 { "Discard", (uintptr_t)nsc_null, _I(discard) },
58 { "Sizes", (uintptr_t)nsc_null, _I(sizes) },
59 { "GetPinned", (uintptr_t)nsc_null, _I(getpin) },
60 { "NodeHints", (uintptr_t)nsc_inval, _I(nodehints) },
61 { NULL, (uintptr_t)NULL, 0 }
62 };
63
64
65 static int _nsc_alloc_buf_h(blind_t, nsc_off_t, nsc_size_t, int,
66 nsc_buf_t **, nsc_fd_t *);
67 static int _nsc_copy_h(nsc_buf_t *, nsc_buf_t *, nsc_off_t,
68 nsc_off_t, nsc_size_t);
69
70 extern nsc_io_t *_nsc_reserve_io(char *, int);
71 extern void _nsc_release_io(nsc_io_t *);
72
73 extern kmutex_t _nsc_io_lock;
74
75
76
77
78 /* ARGSUSED */
79
80 void
81 _nsc_add_cache(nsc_io_t *io)
|