The current write() path stays using yield() until the xl/xenconsoled race
condition it tickles is understood.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
#include <xtf/types.h>
#include <xtf/atomic.h>
+#include <xtf/bitops.h>
#include <xtf/console.h>
#include <xtf/hypercall.h>
#include <xtf/lib.h>
#include <xtf/libc.h>
+#include <xtf/traps.h>
/*
* Output functions, registered if/when available.
void init_pv_console(xencons_interface_t *ring, evtchn_port_t port)
{
+ if ( port >= (sizeof(shared_info.evtchn_pending) * CHAR_BIT) )
+ panic("evtchn %u out of evtchn_pending[] range\n", port);
+
pv_ring = ring;
pv_evtchn = port;
register_console_callback(pv_console_write);
hypercall_sched_op(SCHEDOP_yield, NULL);
}
+static inline long hypercall_poll(evtchn_port_t port)
+{
+ struct sched_poll poll = { .ports = &port, .nr_ports = 1 };
+
+ return hypercall_sched_op(SCHEDOP_poll, &poll);
+}
+
static inline int hypercall_register_callback(const xen_callback_register_t *arg)
{
return hypercall_callback_op(CALLBACKOP_register, arg);
#include <stdarg.h>
#include <stddef.h>
#include <inttypes.h>
+#include <limits.h>
/**
* An array which the linker resolves to 0.