46
47
48 static kcondvar_t _nsc_delay_cv;
49 static kmutex_t _nsc_delay_mutex;
50
51 static nsc_service_t *_nsc_services;
52 static kmutex_t _nsc_svc_mutex;
53
54 static int _nsc_rmmap_inuse(nsc_rmmap_t *, ulong_t *, size_t *);
55
56 static void _nsc_sprint_dec(char **, int, int, int);
57 static void _nsc_sprint_hex(char **, unsigned int, int, int, int, int);
58
59 clock_t HZ;
60
61 extern nsc_rmhdr_t *_nsc_rmhdr_ptr;
62
63 void
64 _nsc_init_gen()
65 {
66 HZ = drv_usectohz(1000000);
67 }
68
69
70 void
71 nsc_decode_param(nsc_def_t *args, nsc_def_t *def, long *v)
72 {
73 nsc_def_t *dp;
74
75 for (; def && def->name; def++) {
76 for (dp = args; dp && dp->name; dp++) {
77 if (strcmp(dp->name, def->name) == 0) {
78 v[def->offset] = dp->value;
79 break;
80 }
81 }
82
83 if ((!dp || !dp->name) && !v[def->offset])
84 v[def->offset] = def->value;
85 }
86 }
|
46
47
48 static kcondvar_t _nsc_delay_cv;
49 static kmutex_t _nsc_delay_mutex;
50
51 static nsc_service_t *_nsc_services;
52 static kmutex_t _nsc_svc_mutex;
53
54 static int _nsc_rmmap_inuse(nsc_rmmap_t *, ulong_t *, size_t *);
55
56 static void _nsc_sprint_dec(char **, int, int, int);
57 static void _nsc_sprint_hex(char **, unsigned int, int, int, int, int);
58
59 clock_t HZ;
60
61 extern nsc_rmhdr_t *_nsc_rmhdr_ptr;
62
63 void
64 _nsc_init_gen()
65 {
66 HZ = drv_sectohz(1);
67 }
68
69
70 void
71 nsc_decode_param(nsc_def_t *args, nsc_def_t *def, long *v)
72 {
73 nsc_def_t *dp;
74
75 for (; def && def->name; def++) {
76 for (dp = args; dp && dp->name; dp++) {
77 if (strcmp(dp->name, def->name) == 0) {
78 v[def->offset] = dp->value;
79 break;
80 }
81 }
82
83 if ((!dp || !dp->name) && !v[def->offset])
84 v[def->offset] = def->value;
85 }
86 }
|