Lines Matching refs:xcp

153 xenconssetup_avintr(struct xencons *xcp, int attach)
166 "xencons", xcp->console_irq, (caddr_t)xcp, NULL, NULL,
167 xcp->dip);
176 xcp->console_irq);
180 mutex_enter(&xcp->excl);
181 cv_signal(&xcp->excl_cv);
182 mutex_exit(&xcp->excl);
190 xenconssetup_add_avintr(struct xencons *xcp)
192 xenconssetup_avintr(xcp, B_TRUE);
196 xenconssetup_rem_avintr(struct xencons *xcp)
198 xenconssetup_avintr(xcp, B_FALSE);
205 struct xencons *xcp;
225 xcp = ddi_get_soft_state(xencons_soft_state, instance);
226 if (xcp == NULL)
235 mutex_enter(&xcp->excl);
237 (void (*)(void *))xenconssetup_rem_avintr, xcp, TQ_SLEEP);
238 cv_wait(&xcp->excl_cv, &xcp->excl);
239 mutex_exit(&xcp->excl);
245 xencons_soft_state_free(xcp);
254 xenconssetup(struct xencons *xcp)
256 xcp->ifp = (volatile struct xencons_interface *)HYPERVISOR_console_page;
265 xcp->console_irq = ec_bind_virq_to_irq(VIRQ_CONSOLE, 0);
285 mutex_enter(&xcp->excl);
287 (void (*)(void *))xenconssetup_add_avintr, xcp, TQ_SLEEP);
288 cv_wait(&xcp->excl_cv, &xcp->excl);
289 mutex_exit(&xcp->excl);
291 (void) xvdi_alloc_evtchn(xcp->dip);
292 xcp->evtchn = xvdi_get_evtchn(xcp->dip);
293 (void) ddi_add_intr(xcp->dip, 0, NULL, NULL, xenconsintr,
294 (caddr_t)xcp);
302 struct xencons *xcp;
311 xcp = xencons_console;
312 xenconssetup(xcp);
323 xcp = ddi_get_soft_state(xencons_soft_state, instance);
324 ASSERT(xcp != NULL); /* can't fail - we only just allocated it */
329 xcp->unit = instance;
330 xcp->dip = devi;
333 xcp->polledio.cons_polledio_version = CONSPOLLEDIO_V0;
334 xcp->polledio.cons_polledio_argument = (cons_polledio_arg_t)xcp;
335 xcp->polledio.cons_polledio_putchar = xenconsputchar;
336 xcp->polledio.cons_polledio_getchar = xenconsgetchar;
337 xcp->polledio.cons_polledio_ischar = xenconsischar;
338 xcp->polledio.cons_polledio_enter = NULL;
339 xcp->polledio.cons_polledio_exit = NULL;
345 xcp->priv = kmem_zalloc(sizeof (struct asyncline), KM_SLEEP);
346 xcp->priv->async_common = xcp;
347 cv_init(&xcp->priv->async_flags_cv, NULL, CV_DRIVER, NULL);
350 mutex_init(&xcp->excl, NULL, MUTEX_DRIVER, NULL);
351 cv_init(&xcp->excl_cv, NULL, CV_DEFAULT, NULL);
358 xencons_soft_state_free(xcp);
363 xencons_console = xcp;
364 xenconssetup(xcp);
376 struct xencons *xcp;
379 xcp = ddi_get_soft_state(xencons_soft_state, instance);
380 if (xcp == NULL)
385 if (xcp->dip == NULL)
388 *result = (void *) xcp->dip;
405 xencons_soft_state_free(struct xencons *xcp)
407 mutex_destroy(&xcp->excl);
408 cv_destroy(&xcp->excl_cv);
409 kmem_free(xcp->priv, sizeof (struct asyncline));
410 ddi_soft_state_free(xencons_soft_state, xcp->unit);
417 struct xencons *xcp;
423 xcp = ddi_get_soft_state(xencons_soft_state, unit);
424 if (xcp == NULL)
426 async = xcp->priv;
427 mutex_enter(&xcp->excl);
445 mutex_exit(&xcp->excl);
454 mutex_exit(&xcp->excl);
475 struct xencons *xcp;
482 xcp = async->async_common;
484 instance = xcp->unit;
488 mutex_enter(&xcp->excl);
518 mutex_exit(&xcp->excl);
532 xencons_rxint(struct xencons *xcp)
548 mutex_enter(&xcp->excl);
552 mutex_exit(&xcp->excl);
556 async = xcp->priv;
557 instance = xcp->unit;
558 ifp = xcp->ifp;
572 mutex_exit(&xcp->excl);
587 mutex_exit(&xcp->excl);
600 if ((abort_enable == KIOCABORTENABLE) && (xcp->flags & ASY_CONSOLE)) {
620 mutex_exit(&xcp->excl);
628 (void) xcasync_flowcontrol_sw_input(xcp, FLOW_STOP,
631 mutex_exit(&xcp->excl);
635 (void) xcasync_flowcontrol_sw_input(xcp, FLOW_START,
641 mutex_exit(&xcp->excl);
655 xcasync_flowcontrol_sw_output(xcp, FLOW_STOP);
659 xcasync_flowcontrol_sw_output(xcp, FLOW_START);
664 xcasync_flowcontrol_sw_output(xcp, FLOW_START);
672 mutex_exit(&xcp->excl);
687 ec_notify_via_evtchn(xcp->evtchn);
696 xencons_txint(struct xencons *xcp)
705 if (mutex_owner(&xcp->excl) == curthread) {
709 mutex_enter(&xcp->excl);
711 mutex_exit(&xcp->excl);
716 async = xcp->priv;
720 mutex_exit(&xcp->excl);
733 struct xencons *xcp = (struct xencons *)arg;
734 volatile struct xencons_interface *ifp = xcp->ifp;
737 xencons_rxint(xcp);
739 xencons_txint(xcp);
749 struct xencons *xcp = (struct xencons *)arg;
751 xencons_rxint(xcp);
752 xencons_txint(xcp);
763 struct xencons *xcp = async->async_common;
771 int instance = xcp->unit;
775 ASSERT(mutex_owned(&xcp->excl));
781 (void) xcasync_flowcontrol_sw_input(xcp, FLOW_CHECK, IN_FLOW_NULL);
805 mutex_exit(&xcp->excl);
807 mutex_enter(&xcp->excl);
846 mutex_exit(&xcp->excl);
849 mutex_enter(&xcp->excl);
860 volatile struct xencons_interface *ifp = xcp->ifp;
877 ec_notify_via_evtchn(xcp->evtchn);
893 struct xencons *xcp = async->async_common;
900 int instance = xcp->unit;
968 mutex_enter(&xcp->excl);
1010 (cons_polledio_arg_t)&xcp->polledio;
1032 xcp->flags |= ASY_CONSOLE;
1034 xcp->flags &= ~ASY_CONSOLE;
1050 (xcp->flags & ASY_CONSOLE) != 0;
1065 mutex_exit(&xcp->excl);
1095 struct xencons *xcp;
1098 xcp = async->async_common;
1103 mutex_enter(&xcp->excl);
1105 mutex_exit(&xcp->excl);
1110 mutex_enter(&xcp->excl);
1115 mutex_exit(&xcp->excl);
1135 mutex_enter(&xcp->excl);
1137 mutex_exit(&xcp->excl);
1151 mutex_enter(&xcp->excl);
1160 mutex_exit(&xcp->excl);
1174 mutex_enter(&xcp->excl);
1176 mutex_exit(&xcp->excl);
1187 mutex_enter(&xcp->excl);
1189 mutex_exit(&xcp->excl);
1193 mutex_enter(&xcp->excl);
1194 mutex_enter(&xcp->excl);
1196 (void) xcasync_flowcontrol_sw_input(xcp, FLOW_STOP,
1199 mutex_exit(&xcp->excl);
1200 mutex_exit(&xcp->excl);
1205 mutex_enter(&xcp->excl);
1206 mutex_enter(&xcp->excl);
1208 (void) xcasync_flowcontrol_sw_input(xcp, FLOW_START,
1211 mutex_exit(&xcp->excl);
1212 mutex_exit(&xcp->excl);
1242 struct xencons *xcp;
1246 xcp = ddi_get_soft_state(xencons_soft_state, instance);
1247 ASSERT(xcp != NULL);
1248 async = xcp->priv;
1253 mutex_enter(&xcp->excl);
1256 mutex_exit(&xcp->excl);
1262 mutex_exit(&xcp->excl);
1265 mutex_exit(&xcp->excl);
1281 struct xencons *xcp = xencons_console;
1282 volatile struct xencons_interface *ifp = xcp->ifp;
1309 ec_notify_via_evtchn(xcp->evtchn);
1319 struct xencons *xcp = (struct xencons *)arg;
1320 volatile struct xencons_interface *ifp = xcp->ifp;
1322 if (xcp->polldix < xcp->polllen)
1327 xcp->polldix = 0;
1328 xcp->polllen = 0;
1330 xcp->polllen = HYPERVISOR_console_io(CONSOLEIO_read, 1,
1331 (char *)xcp->pollbuf);
1332 return (xcp->polllen != 0);
1343 xcp->pollbuf[0] = ifp->in[MASK_XENCONS_IDX(cons++, ifp->in)];
1346 xcp->polllen = 1;
1348 return (xcp->polllen != 0);
1357 struct xencons *xcp = (struct xencons *)arg;
1359 ec_wait_on_evtchn(xcp->evtchn, (int (*)(void *))xenconsischar, arg);
1361 return (xcp->pollbuf[xcp->polldix++]);
1430 xcasync_flowcontrol_sw_output(struct xencons *xcp, async_flowc_action onoff)
1432 struct asyncline *async = xcp->priv;
1433 int instance = xcp->unit;
1435 ASSERT(mutex_owned(&xcp->excl));
1475 xcasync_flowcontrol_sw_input(struct xencons *xcp, async_flowc_action onoff,
1478 struct asyncline *async = xcp->priv;
1479 int instance = xcp->unit;
1482 ASSERT(mutex_owned(&xcp->excl));