Main QRES kernel module implementation file. More...
#include <linux/aquosa/rres_config.h>
#include "qres_config.h"
#include <linux/aquosa/qos_debug.h>
#include <linux/aquosa/qos_prof.h>
#include "qres_gw_ks.h"
#include "qsup_gw_ks.h"
#include "qres_kpi_protected.h"
#include <linux/aquosa/qos_types.h>
#include <linux/aquosa/qos_memory.h>
#include <linux/aquosa/qos_func.h>
#include <linux/aquosa/kal_sched.h>
Go to the source code of this file.
Defines | |
#define | QOS_DEBUG_LEVEL QRES_MOD_DEBUG_LEVEL |
#define | COPY_FROM_USER_TO(void_ptr, size, typed_ptr) |
Find the task identified by <pid, tid>, and check if affecting its reservation status would be legal or not. | |
#define | call_sync(func) |
Functions | |
static qos_rv | find_task (pid_t pid, tid_t tid, struct task_struct **p_ptsk) |
Find the thread identified by the caller through <pid, tid>. | |
qos_func_define (qos_rv, qres_gw_destroy_server, qres_sid_t sid) | |
qos_func_define (qos_rv, qres_gw_attach_task, qres_attach_iparams_t *iparams) | |
qos_func_define (qos_rv, qres_gw_detach_task, qres_attach_iparams_t *iparams) | |
qos_func_define (qos_rv, qres_gw_set_params, qres_iparams_t *iparams) | |
qos_func_define (qos_rv, qres_gw_get_params, qres_iparams_t *iparams) | |
qos_func_define (qos_rv, qres_gw_get_exec_time, qres_time_iparams_t *iparams) | |
Get the execution time of the server since its creation. | |
qos_func_define (qos_rv, qres_gw_get_curr_budget, qres_time_iparams_t *iparams) | |
qos_func_define (qos_rv, qres_gw_get_next_budget, qres_time_iparams_t *iparams) | |
qos_func_define (qos_rv, qres_gw_get_appr_budget, qres_time_iparams_t *iparams) | |
qos_func_define (qos_rv, qres_gw_get_server_id, qres_attach_iparams_t *iparams) | |
qos_func_define (qos_rv, qres_gw_get_deadline, qres_timespec_iparams_t *iparams) | |
qos_func_define (qos_rv, qres_gw_set_weight, qres_weight_iparams_t *iparams) | |
qos_func_define (qos_rv, qres_gw_get_weight, qres_weight_iparams_t *iparams) | |
qos_rv | qres_gw_ks (qres_op_t op, void __user *up_iparams, unsigned long size) |
Main US-to-KS gateway function. |
Main QRES kernel module implementation file.
Handle all requests made on server through the QRES library.
Definition in file qres_gw_ks.c.
#define call_sync | ( | func | ) |
({ \ kal_irq_state flags; \ qos_rv __rv; \ kal_spin_lock_irqsave(rres_get_spinlock(), &flags); \ __rv = (func); \ kal_spin_unlock_irqrestore(rres_get_spinlock(), &flags); \ __rv; \ })
Definition at line 72 of file qres_gw_ks.c.
Referenced by qres_gw_ks().
#define COPY_FROM_USER_TO | ( | void_ptr, | |||
size, | |||||
typed_ptr | ) |
do { \ if ((size) != sizeof(*(typed_ptr))) { \ qos_log_crit("Got %lu bytes, expecting %zu", \ (size), sizeof(*(typed_ptr))); \ return(QOS_E_INTERNAL_ERROR); \ } \ if (copy_from_user(typed_ptr, void_ptr, (size))) \ return(QOS_E_INVALID_PARAM); \ } while (0)
Find the task identified by <pid, tid>, and check if affecting its reservation status would be legal or not.
Definition at line 62 of file qres_gw_ks.c.
Referenced by qres_gw_ks().
#define QOS_DEBUG_LEVEL QRES_MOD_DEBUG_LEVEL |
Definition at line 14 of file qres_gw_ks.c.
Find the thread identified by the caller through <pid, tid>.
The caller thread may refer to itself as <0, 0>.
Definition at line 35 of file qres_gw_ks.c.
References current, qos_chk_do, QOS_E_INTERNAL_ERROR, QOS_E_INVALID_PARAM, and QOS_OK.
Referenced by qos_func_define().
qos_func_define | ( | qos_rv | , | |
qres_gw_get_weight | , | |||
qres_weight_iparams_t * | iparams | |||
) |
Definition at line 220 of file qres_gw_ks.c.
References QOS_E_NOT_FOUND, QOS_OK, qres_find_by_id(), qres_server::rres, rres_get_weight(), qres_weight_iparams_t::server_id, and qres_weight_iparams_t::weight.
qos_func_define | ( | qos_rv | , | |
qres_gw_set_weight | , | |||
qres_weight_iparams_t * | iparams | |||
) |
Definition at line 208 of file qres_gw_ks.c.
References QOS_E_INVALID_PARAM, QOS_E_NOT_FOUND, QOS_OK, qres_find_by_id(), qres_server::rres, rres_set_weight(), qres_weight_iparams_t::server_id, and qres_weight_iparams_t::weight.
qos_func_define | ( | qos_rv | , | |
qres_gw_get_deadline | , | |||
qres_timespec_iparams_t * | iparams | |||
) |
Definition at line 198 of file qres_gw_ks.c.
References QOS_E_NOT_FOUND, qres_find_by_id(), qres_get_deadline(), qres_timespec_iparams_t::server_id, and qres_timespec_iparams_t::timespec.
qos_func_define | ( | qos_rv | , | |
qres_gw_get_server_id | , | |||
qres_attach_iparams_t * | iparams | |||
) |
Definition at line 183 of file qres_gw_ks.c.
References find_task(), qres_attach_iparams_t::pid, qos_chk_ok_ret, QOS_E_NOT_FOUND, qos_log_debug, QOS_OK, rres_find_by_task(), rres_get_sid(), qres_attach_iparams_t::server_id, and qres_attach_iparams_t::tid.
qos_func_define | ( | qos_rv | , | |
qres_gw_get_appr_budget | , | |||
qres_time_iparams_t * | iparams | |||
) |
Definition at line 170 of file qres_gw_ks.c.
References qres_time_iparams_t::abs_time, qres_time_iparams_t::exec_time, QOS_E_NOT_FOUND, QOS_OK, qres_find_by_id(), qres_get_appr_budget(), and qres_time_iparams_t::server_id.
qos_func_define | ( | qos_rv | , | |
qres_gw_get_next_budget | , | |||
qres_time_iparams_t * | iparams | |||
) |
Definition at line 157 of file qres_gw_ks.c.
References qres_time_iparams_t::abs_time, qres_time_iparams_t::exec_time, QOS_E_NOT_FOUND, QOS_OK, qres_find_by_id(), qres_get_next_budget(), and qres_time_iparams_t::server_id.
qos_func_define | ( | qos_rv | , | |
qres_gw_get_curr_budget | , | |||
qres_time_iparams_t * | iparams | |||
) |
Definition at line 144 of file qres_gw_ks.c.
References qres_time_iparams_t::abs_time, qres_time_iparams_t::exec_time, QOS_E_NOT_FOUND, QOS_OK, qres_find_by_id(), qres_get_curr_budget(), and qres_time_iparams_t::server_id.
qos_func_define | ( | qos_rv | , | |
qres_gw_get_exec_time | , | |||
qres_time_iparams_t * | iparams | |||
) |
Get the execution time of the server since its creation.
This is the total amount of time for which the tasks attached to the server have been scheduled by the system
Definition at line 133 of file qres_gw_ks.c.
References qres_time_iparams_t::abs_time, qres_time_iparams_t::exec_time, QOS_E_NOT_FOUND, qres_find_by_id(), qres_get_exec_abs_time(), and qres_time_iparams_t::server_id.
qos_func_define | ( | qos_rv | , | |
qres_gw_get_params | , | |||
qres_iparams_t * | iparams | |||
) |
Definition at line 119 of file qres_gw_ks.c.
References qres_iparams_t::params, QOS_E_NOT_FOUND, qres_find_by_id(), qres_get_params(), and qres_iparams_t::server_id.
qos_func_define | ( | qos_rv | , | |
qres_gw_set_params | , | |||
qres_iparams_t * | iparams | |||
) |
Definition at line 110 of file qres_gw_ks.c.
References qres_iparams_t::params, QOS_E_NOT_FOUND, qres_find_by_id(), qres_set_params(), and qres_iparams_t::server_id.
qos_func_define | ( | qos_rv | , | |
qres_gw_detach_task | , | |||
qres_attach_iparams_t * | iparams | |||
) |
Definition at line 99 of file qres_gw_ks.c.
References find_task(), qres_attach_iparams_t::pid, qos_chk_ok_ret, QOS_E_NOT_FOUND, qres_detach_task(), qres_find_by_id(), qres_attach_iparams_t::server_id, and qres_attach_iparams_t::tid.
qos_func_define | ( | qos_rv | , | |
qres_gw_attach_task | , | |||
qres_attach_iparams_t * | iparams | |||
) |
Definition at line 88 of file qres_gw_ks.c.
References find_task(), qres_attach_iparams_t::pid, qos_chk_ok_ret, QOS_E_NOT_FOUND, qres_attach_task(), qres_find_by_id(), qres_attach_iparams_t::server_id, and qres_attach_iparams_t::tid.
qos_func_define | ( | qos_rv | , | |
qres_gw_destroy_server | , | |||
qres_sid_t | sid | |||
) |
Definition at line 81 of file qres_gw_ks.c.
References QOS_E_NOT_FOUND, qres_destroy_server(), and qres_find_by_id().