1/* 2 * $FreeBSD$ 3 * 4 */ 5#ifndef _XENCONS_RING_H 6#define _XENCONS_RING_H 7 8#define CN_LOCK(l) \ 9 do { \ 10 if (panicstr == NULL) \ 11 mtx_lock_spin(&(l)); \ 12 } while (0) 13#define CN_UNLOCK(l) \ 14 do { \ 15 if (panicstr == NULL) \ 16 mtx_unlock_spin(&(l)); \ 17 } while (0) 18 19int xencons_ring_init(void); 20int xencons_ring_send(const char *data, unsigned len); 21void xencons_rx(char *buf, unsigned len); 22void xencons_tx(void); 23 24 25typedef void (xencons_receiver_func)(char *buf, unsigned len); 26void xencons_ring_register_receiver(xencons_receiver_func *f); 27 28void xencons_handle_input(void *unused); 29int xencons_has_input(void); 30 31#endif /* _XENCONS_RING_H */ 32