19#ifndef _COPPERPLATE_EVENTOBJ_H
20#define _COPPERPLATE_EVENTOBJ_H
22#include <boilerplate/compiler.h>
23#include <copperplate/reference.h>
25struct eventobj_waitentry {
30#ifdef CONFIG_XENO_COBALT
32#include <cobalt/uapi/event.h>
34struct eventobj_corespec {
38struct eventobj_wait_struct {
41#define EVOBJ_FIFO COBALT_EVENT_FIFO
42#define EVOBJ_PRIO COBALT_EVENT_PRIO
44#define EVOBJ_ALL COBALT_EVENT_ALL
45#define EVOBJ_ANY COBALT_EVENT_ANY
49#include <copperplate/syncobj.h>
51struct eventobj_corespec {
57struct eventobj_wait_struct {
71 struct eventobj_corespec core;
72 fnref_type(
void (*)(
struct eventobj *evobj)) finalizer;
79int eventobj_init(
struct eventobj *evobj,
80 unsigned int value,
int flags,
81 fnref_type(
void (*)(
struct eventobj *evobj)) finalizer) __must_check;
83int eventobj_destroy(
struct eventobj *evobj);
85void eventobj_uninit(
struct eventobj *evobj);
87int eventobj_post(
struct eventobj *evobj,
90int eventobj_wait(
struct eventobj *evobj,
94 const struct timespec *timeout) __must_check;
96int eventobj_clear(
struct eventobj *evobj,
98 unsigned int *bits_r);
100int eventobj_inquire(
struct eventobj *evobj,
size_t waitsz,
101 struct eventobj_waitentry *waitlist,
102 unsigned int *bits_r);