Commit 6bfb8625 authored by Philippe Gerum's avatar Philippe Gerum
Browse files

lib/sched: add sched-specific implementation file

parent c78307fd
......@@ -15,6 +15,7 @@
#include <evl/flags.h>
#include <evl/syscall.h>
#include <evl/thread.h>
#include <evl/sched.h>
#include <evl/xbuf.h>
#include <evl/poll.h>
#include <evl/proxy.h>
......
/*
* SPDX-License-Identifier: MIT
*
* Copyright (C) 2019 Philippe Gerum <rpm@xenomai.org>
*/
#ifndef _EVL_SCHED_H
#define _EVL_SCHED_H
#include <sys/types.h>
#include <uapi/evl/sched.h>
#ifdef __cplusplus
extern "C" {
#endif
int evl_sched_control(int policy,
union evl_sched_ctlparam *param,
union evl_sched_ctlinfo *info,
int cpu);
#ifdef __cplusplus
}
#endif
#endif /* _EVL_SCHED_H */
......@@ -17,11 +17,6 @@ ssize_t evl_log(int proxyfd, const void *buf, size_t len);
int evl_printf(int proxyfd, const char *fmt, ...);
int evl_sched_control(int policy,
union evl_sched_ctlparam *param,
union evl_sched_ctlinfo *info,
int cpu);
#ifdef __cplusplus
}
#endif
......
/*
* SPDX-License-Identifier: MIT
*
* Copyright (C) 2019 Philippe Gerum <rpm@xenomai.org>
*/
#include <sys/types.h>
#include <sys/ioctl.h>
#include <errno.h>
#include <evl/thread.h>
#include <evl/syscall.h>
#include <evl/sched.h>
#include <uapi/evl/control.h>
#include "internal.h"
int evl_sched_control(int policy,
union evl_sched_ctlparam *param,
union evl_sched_ctlinfo *info,
int cpu)
{
struct evl_sched_ctlreq ctlreq;
int ret;
if (evl_ctlfd < 0)
return -ENXIO;
ctlreq.policy = policy;
ctlreq.cpu = cpu;
ctlreq.param = param;
ctlreq.info = info;
if (evl_is_inband())
ret = ioctl(evl_ctlfd, EVL_CTLIOC_SCHEDCTL, &ctlreq);
else
ret = oob_ioctl(evl_ctlfd, EVL_CTLIOC_SCHEDCTL, &ctlreq);
return ret ? -errno : 0;
}
......@@ -14,7 +14,6 @@
#include <evl/thread.h>
#include <evl/syscall.h>
#include <evl/utils.h>
#include <uapi/evl/sched.h>
#include <uapi/evl/control.h>
#include "internal.h"
......@@ -38,27 +37,3 @@ int evl_printf(int proxyfd, const char *fmt, ...)
return evl_log(proxyfd, buf, len);
}
int evl_sched_control(int policy,
union evl_sched_ctlparam *param,
union evl_sched_ctlinfo *info,
int cpu)
{
struct evl_sched_ctlreq ctlreq;
int ret;
if (evl_ctlfd < 0)
return -ENXIO;
ctlreq.policy = policy;
ctlreq.cpu = cpu;
ctlreq.param = param;
ctlreq.info = info;
if (evl_is_inband())
ret = ioctl(evl_ctlfd, EVL_CTLIOC_SCHEDCTL, &ctlreq);
else
ret = oob_ioctl(evl_ctlfd, EVL_CTLIOC_SCHEDCTL, &ctlreq);
return ret ? -errno : 0;
}
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