static int hvterm_hvsi_open(struct hvc_struct *hp, int data) { struct hvterm_priv *pv = hvterm_privs[hp->vtermno]; int rc; pr_devel("HVSI@%x: open !\n", pv->termno); rc = notifier_add_irq(hp, data); if (rc) return rc; return hvsilib_open(&pv->hvsi, hp); }
/* * IRQ based callbacks. */ static int hvc_tile_notifier_add_irq(struct hvc_struct *hp, int irq) { int rc; int cpu = raw_smp_processor_id(); /* Choose an arbitrary cpu */ HV_Coord coord = { .x = cpu_x(cpu), .y = cpu_y(cpu) }; rc = notifier_add_irq(hp, irq); if (rc) return rc; /* * Request that the hypervisor start sending us interrupts. * If the hypervisor returns an error, we still return 0, so that * we can fall back to polling. */ if (hv_console_set_ipi(KERNEL_PL, irq, coord) < 0) notifier_del_irq(hp, irq); return 0; }