orca-software
Classes | Macros | Variables
kernel.h File Reference

Go to the source code of this file.

Classes

struct  tcb_entry
 Task control block (TCB) and processor control block (PCB) entry data structures. More...
 
struct  pcb_entry
 

Macros

#define TASK_IDLE   0
 
#define TASK_READY   1
 
#define TASK_RUNNING   2
 
#define TASK_BLOCKED   3
 
#define TASK_DELAYED   4
 
#define TASK_WAITING   5
 

Variables

struct tcb_entry krnl_tcb [MAX_TASKS]
 The task control block and processor control block.
 
struct pcb_entry krnl_pcb
 
struct tcb_entrykrnl_task
 
uint16_t krnl_tasks
 
uint16_t krnl_current_task
 
uint16_t krnl_schedule
 
struct queuekrnl_run_queue
 
struct queuekrnl_delay_queue
 
struct queuekrnl_rt_queue
 
struct queuekrnl_event_queue
 
uint8_t krnl_heap [HEAP_SIZE]
 
uint32_t krnl_free
 

Detailed Description

Author
Sergio Johann Filho
Date
February 2016

LICENSE

This source code is licensed under the GNU General Public License, Version 2. See the file 'doc/license/gpl-2.0.txt' for more details.

DESCRIPTION

Kernel data structures.

Macro Definition Documentation

§ TASK_BLOCKED

#define TASK_BLOCKED   3

task blocked, can be resumed later (on run queue)

§ TASK_DELAYED

#define TASK_DELAYED   4

task being delayed (on delay queue)

§ TASK_IDLE

#define TASK_IDLE   0

task does not exist / not ready

§ TASK_READY

#define TASK_READY   1

task ready to run (on run queue)

§ TASK_RUNNING

#define TASK_RUNNING   2

task running (only one task/core can be in this state, on run queue)

§ TASK_WAITING

#define TASK_WAITING   5

task waiting for an event (on event queue)

Variable Documentation

§ krnl_current_task

uint16_t krnl_current_task

the current running task id

§ krnl_delay_queue

struct queue* krnl_delay_queue

pointer to a queue of delayed tasks

§ krnl_event_queue

struct queue* krnl_event_queue

pointer to a queue of tasks waiting for an event

§ krnl_free

uint32_t krnl_free

amount of free heap memory, in bytes

§ krnl_heap

uint8_t krnl_heap[HEAP_SIZE]

contiguous heap memory area to be used as a memory pool. the memory allocator (malloc() and free()) controls this data structure

§ krnl_rt_queue

struct queue* krnl_rt_queue

pointer to a queue of real time tasks

§ krnl_run_queue

struct queue* krnl_run_queue

pointer to a queue of best effort tasks

§ krnl_schedule

uint16_t krnl_schedule

scheduler enable / disable flag

§ krnl_task

struct tcb_entry* krnl_task

pointer to a task control block entry

§ krnl_tasks

uint16_t krnl_tasks

number of tasks in the system