145 * emul64_yield_enable emul64 will yield the CPU, only if this
146 * variable contains a non-zero value. This
147 * allows the yield functionality to be turned
148 * off for experimentation purposes.
149 *
150 * The value of 1000 for emul64_yield_period has been determined by
151 * experience with running the tests.
152 */
153 static uint64_t emul64_num_delay_called = 0;
154 static int emul64_yield_length = 1000;
155 static int emul64_yield_period = 1000;
156 static int emul64_yield_enable = 1;
157 static kmutex_t emul64_yield_mutex;
158 static kcondvar_t emul64_yield_cv;
159
160 /*
161 * This array establishes a set of tunable variables that can be set by
162 * defining properties in the emul64.conf file.
163 */
164 struct prop_map emul64_properties[] = {
165 "emul64_collect_stats", &emul64_collect_stats,
166 "emul64_yield_length", &emul64_yield_length,
167 "emul64_yield_period", &emul64_yield_period,
168 "emul64_yield_enable", &emul64_yield_enable,
169 "emul64_max_task", &emul64_max_task,
170 "emul64_task_nthreads", &emul64_task_nthreads
171 };
172
173 static unsigned char *emul64_zeros = NULL; /* Block of 0s for comparison */
174
175 extern void emul64_check_cond(struct scsi_pkt *pkt, uchar_t key,
176 uchar_t asc, uchar_t ascq);
177 /* ncyl=250000 acyl=2 nhead=24 nsect=357 */
178 uint_t dkg_rpm = 3600;
179
180 static int bsd_mode_sense_dad_mode_geometry(struct scsi_pkt *);
181 static int bsd_mode_sense_dad_mode_err_recov(struct scsi_pkt *);
182 static int bsd_mode_sense_modepage_disco_reco(struct scsi_pkt *);
183 static int bsd_mode_sense_dad_mode_format(struct scsi_pkt *);
184 static int bsd_mode_sense_dad_mode_cache(struct scsi_pkt *);
185 static int bsd_readblks(struct emul64 *, ushort_t, ushort_t, diskaddr_t,
186 int, unsigned char *);
187 static int bsd_writeblks(struct emul64 *, ushort_t, ushort_t, diskaddr_t,
188 int, unsigned char *);
189 emul64_tgt_t *find_tgt(struct emul64 *, ushort_t, ushort_t);
190 static blklist_t *bsd_findblk(emul64_tgt_t *, diskaddr_t, avl_index_t *);
|
145 * emul64_yield_enable emul64 will yield the CPU, only if this
146 * variable contains a non-zero value. This
147 * allows the yield functionality to be turned
148 * off for experimentation purposes.
149 *
150 * The value of 1000 for emul64_yield_period has been determined by
151 * experience with running the tests.
152 */
153 static uint64_t emul64_num_delay_called = 0;
154 static int emul64_yield_length = 1000;
155 static int emul64_yield_period = 1000;
156 static int emul64_yield_enable = 1;
157 static kmutex_t emul64_yield_mutex;
158 static kcondvar_t emul64_yield_cv;
159
160 /*
161 * This array establishes a set of tunable variables that can be set by
162 * defining properties in the emul64.conf file.
163 */
164 struct prop_map emul64_properties[] = {
165 { "emul64_collect_stats", &emul64_collect_stats },
166 { "emul64_yield_length", &emul64_yield_length },
167 { "emul64_yield_period", &emul64_yield_period },
168 { "emul64_yield_enable", &emul64_yield_enable },
169 { "emul64_max_task", &emul64_max_task },
170 { "emul64_task_nthreads", &emul64_task_nthreads }
171 };
172
173 static unsigned char *emul64_zeros = NULL; /* Block of 0s for comparison */
174
175 extern void emul64_check_cond(struct scsi_pkt *pkt, uchar_t key,
176 uchar_t asc, uchar_t ascq);
177 /* ncyl=250000 acyl=2 nhead=24 nsect=357 */
178 uint_t dkg_rpm = 3600;
179
180 static int bsd_mode_sense_dad_mode_geometry(struct scsi_pkt *);
181 static int bsd_mode_sense_dad_mode_err_recov(struct scsi_pkt *);
182 static int bsd_mode_sense_modepage_disco_reco(struct scsi_pkt *);
183 static int bsd_mode_sense_dad_mode_format(struct scsi_pkt *);
184 static int bsd_mode_sense_dad_mode_cache(struct scsi_pkt *);
185 static int bsd_readblks(struct emul64 *, ushort_t, ushort_t, diskaddr_t,
186 int, unsigned char *);
187 static int bsd_writeblks(struct emul64 *, ushort_t, ushort_t, diskaddr_t,
188 int, unsigned char *);
189 emul64_tgt_t *find_tgt(struct emul64 *, ushort_t, ushort_t);
190 static blklist_t *bsd_findblk(emul64_tgt_t *, diskaddr_t, avl_index_t *);
|