libevl/include/evl/thread.h

72 lines
1.3 KiB
C
Raw Permalink Normal View History

/*
* SPDX-License-Identifier: MIT
*
* Copyright (C) 2018 Philippe Gerum <rpm@xenomai.org>
*/
2019-03-10 23:25:02 +08:00
#ifndef _EVL_THREAD_H
#define _EVL_THREAD_H
#include <linux/types.h>
#include <limits.h>
#include <stdbool.h>
#include <sched.h>
2019-03-10 23:25:02 +08:00
#include <evl/syscall.h>
#include <uapi/evl/signal.h>
2019-03-10 23:25:02 +08:00
#include <uapi/evl/thread.h>
#include <uapi/evl/sched.h>
#include <uapi/evl/factory.h>
#define EVL_STACK_DEFAULT \
({ \
int __ret = PTHREAD_STACK_MIN; \
if (__ret < 65536) \
__ret = 65536; \
__ret; \
})
#define evl_attach_self(__fmt, __args...) \
evl_attach_thread(EVL_CLONE_PRIVATE, __fmt, ##__args)
#ifdef __cplusplus
extern "C" {
#endif
int evl_attach_thread(int flags, const char *fmt, ...);
int evl_detach_thread(int flags);
int evl_detach_self(void);
2019-02-08 02:32:17 +08:00
int evl_get_self(void);
2019-02-08 02:32:17 +08:00
int evl_switch_oob(void);
int evl_switch_inband(void);
bool evl_is_inband(void);
2019-02-08 02:32:17 +08:00
int evl_get_state(int efd, struct evl_thread_state *statebuf);
int evl_unblock_thread(int efd);
int evl_demote_thread(int efd);
int evl_set_thread_mode(int efd, int mask,
int *oldmask);
int evl_clear_thread_mode(int efd, int mask,
int *oldmask);
int evl_subscribe(int ofd,
unsigned int backlog_count,
int flags);
int evl_unsubscribe(int ofd);
#ifdef __cplusplus
}
#endif
2019-03-10 23:25:02 +08:00
#endif /* _EVL_THREAD_H */