Commit 824a088b authored by Jorge Ramirez-Ortiz's avatar Jorge Ramirez-Ortiz Committed by Philippe Gerum
Browse files

uapi: evl: define the user available elements and utilities



Elements:
--------
Basic features that cant be implemented from userland sharable between
processes.

Threads, monitors, xbufs and clocks -> every instance is backed by a
device in /dev/evl which allows sharing.

Utilities
---------
poll is a private-process construct; all poll groups are obtained from a
single multiplex device: /dev/evl/poll. They cannot be shared.

timers are in essence timerfd directly obtained from clocks, they don't
exist on their own, and are process-local too.

proxies are backed by a device in /dev/evl to allow for sharing, but
this is not something essential.
Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
parent 4f8b5323
......@@ -7,6 +7,10 @@
#ifndef _EVL_UAPI_CLOCK_H
#define _EVL_UAPI_CLOCK_H
#define EVL_CLOCK_MONOTONIC_DEV "monotonic"
#define EVL_CLOCK_REALTIME_DEV "realtime"
#define EVL_CLOCK_DEV "clock"
#define EVL_CLOCK_MONOTONIC (-CLOCK_MONOTONIC)
#define EVL_CLOCK_REALTIME (-CLOCK_REALTIME)
......
......@@ -10,6 +10,8 @@
#include <uapi/evl/types.h>
#include <uapi/evl/factory.h>
#define EVL_MONITOR_DEV "monitor"
#define EVL_MONITOR_EV 0 /* Event monitor. */
#define EVL_MONITOR_PI 1 /* Gate with priority inheritance. */
#define EVL_MONITOR_PP 2 /* Gate with priority protection (ceiling). */
......
......@@ -7,6 +7,8 @@
#ifndef _EVL_UAPI_POLL_H
#define _EVL_UAPI_POLL_H
#define EVL_POLL_DEV "poll"
#define EVL_POLL_IOCBASE 'p'
#define EVL_POLL_CTLADD 0
......
......@@ -7,6 +7,8 @@
#ifndef _EVL_UAPI_PROXY_H
#define _EVL_UAPI_PROXY_H
#define EVL_PROXY_DEV "proxy"
struct evl_proxy_attrs {
__u32 fd;
__u32 bufsz;
......
......@@ -10,6 +10,8 @@
#include <uapi/evl/sched.h>
#define EVL_THREAD_DEV "thread"
/* State flags (shared) */
#define T_SUSP 0x00000001 /*< Suspended */
......
......@@ -7,6 +7,8 @@
#ifndef _EVL_UAPI_XBUF_H
#define _EVL_UAPI_XBUF_H
#define EVL_XBUF_DEV "xbuf"
struct evl_xbuf_attrs {
__u32 i_bufsz;
__u32 o_bufsz;
......
......@@ -960,7 +960,7 @@ static struct attribute *clock_attrs[] = {
ATTRIBUTE_GROUPS(clock);
struct evl_factory evl_clock_factory = {
.name = "clock",
.name = EVL_CLOCK_DEV,
.fops = &clock_fops,
.nrdev = CONFIG_EVL_NR_CLOCKS,
.attrs = clock_groups,
......@@ -1030,7 +1030,7 @@ static void adjust_realtime_clock(struct evl_clock *clock)
}
struct evl_clock evl_mono_clock = {
.name = "monotonic",
.name = EVL_CLOCK_MONOTONIC_DEV,
.resolution = 1, /* nanosecond. */
.ops = {
.read = read_mono_clock,
......@@ -1046,7 +1046,7 @@ struct evl_clock evl_mono_clock = {
EXPORT_SYMBOL_GPL(evl_mono_clock);
struct evl_clock evl_realtime_clock = {
.name = "realtime",
.name = EVL_CLOCK_REALTIME_DEV,
.resolution = 1, /* nanosecond. */
.ops = {
.read = read_realtime_clock,
......
......@@ -722,7 +722,7 @@ static struct attribute *monitor_attrs[] = {
ATTRIBUTE_GROUPS(monitor);
struct evl_factory evl_monitor_factory = {
.name = "monitor",
.name = EVL_MONITOR_DEV,
.fops = &monitor_fops,
.build = monitor_factory_build,
.dispose = monitor_factory_dispose,
......
......@@ -656,7 +656,7 @@ static const struct file_operations poll_fops = {
};
struct evl_factory evl_poll_factory = {
.name = "poll",
.name = EVL_POLL_DEV,
.fops = &poll_fops,
.flags = EVL_FACTORY_SINGLE,
};
......@@ -262,7 +262,7 @@ static void proxy_factory_dispose(struct evl_element *e)
}
struct evl_factory evl_proxy_factory = {
.name = "proxy",
.name = EVL_PROXY_DEV,
.fops = &proxy_fops,
.build = proxy_factory_build,
.dispose = proxy_factory_dispose,
......
......@@ -2483,7 +2483,7 @@ static struct attribute *thread_attrs[] = {
ATTRIBUTE_GROUPS(thread);
struct evl_factory evl_thread_factory = {
.name = "thread",
.name = EVL_THREAD_DEV,
.fops = &thread_fops,
.build = thread_factory_build,
.dispose = thread_factory_dispose,
......
......@@ -776,7 +776,7 @@ static struct attribute *xbuf_attrs[] = {
ATTRIBUTE_GROUPS(xbuf);
struct evl_factory evl_xbuf_factory = {
.name = "xbuf",
.name = EVL_XBUF_DEV,
.fops = &xbuf_fops,
.build = xbuf_factory_build,
.dispose = xbuf_factory_dispose,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment