This commit is contained in:
Baptiste Wicht 2014-04-06 17:01:28 +02:00
parent 6ad3f4b15f
commit de5af66a96
4 changed files with 12 additions and 12 deletions

View File

@ -18,9 +18,9 @@ namespace scheduler {
constexpr const size_t MAX_PROCESS = 128; constexpr const size_t MAX_PROCESS = 128;
struct sleep_queue_ptr { struct queue_ptr {
sleep_queue_ptr* next; queue_ptr* next;
sleep_queue_ptr* prev; queue_ptr* prev;
pid_t pid; pid_t pid;
}; };
@ -40,7 +40,7 @@ scheduler::process_t& get_process(pid_t pid);
void irq_register_tasklet(const tasklet& task); void irq_register_tasklet(const tasklet& task);
sleep_queue_ptr* queue_ptr(pid_t pid); queue_ptr* sleep_queue_ptr(pid_t pid);
void block_process(); void block_process();
void unblock_process(pid_t pid); void unblock_process(pid_t pid);

View File

@ -5,8 +5,8 @@
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
//======================================================================= //=======================================================================
#ifndef SCHEDULER_H #ifndef SCHEDULER_ASM_H
#define SCHEDULER_H #define SCHEDULER_ASM_H
extern "C" { extern "C" {

View File

@ -13,8 +13,8 @@
struct sleep_queue { struct sleep_queue {
private: private:
volatile scheduler::sleep_queue_ptr* head = nullptr; volatile scheduler::queue_ptr* head = nullptr;
volatile scheduler::sleep_queue_ptr* tail = nullptr; volatile scheduler::queue_ptr* tail = nullptr;
public: public:
void wake_up(){ void wake_up(){
@ -39,7 +39,7 @@ public:
//Get the current process information //Get the current process information
auto pid = scheduler::get_pid(); auto pid = scheduler::get_pid();
auto queue_ptr = scheduler::queue_ptr(pid); auto queue_ptr = scheduler::sleep_queue_ptr(pid);
queue_ptr->pid = pid; queue_ptr->pid = pid;
queue_ptr->next = nullptr; queue_ptr->next = nullptr;
queue_ptr->prev = nullptr; queue_ptr->prev = nullptr;

View File

@ -40,7 +40,7 @@ namespace {
struct process_control_t { struct process_control_t {
scheduler::process_t process; scheduler::process_t process;
scheduler::process_state state; scheduler::process_state state;
scheduler::sleep_queue_ptr queue_ptr; scheduler::queue_ptr sleep_queue_ptr;
size_t rounds; size_t rounds;
size_t sleep_timeout; size_t sleep_timeout;
std::vector<std::vector<std::string>> handles; std::vector<std::vector<std::string>> handles;
@ -863,11 +863,11 @@ scheduler::process_t& scheduler::get_process(pid_t pid){
return pcb[pid].process; return pcb[pid].process;
} }
scheduler::sleep_queue_ptr* scheduler::queue_ptr(scheduler::pid_t pid){ scheduler::queue_ptr* scheduler::sleep_queue_ptr(scheduler::pid_t pid){
thor_assert(is_started(), "The scheduler is not started"); thor_assert(is_started(), "The scheduler is not started");
thor_assert(pid < scheduler::MAX_PROCESS, "pid out of bounds"); thor_assert(pid < scheduler::MAX_PROCESS, "pid out of bounds");
return &pcb[pid].queue_ptr; return &pcb[pid].sleep_queue_ptr;
} }
void scheduler::block_process(){ void scheduler::block_process(){