|
Turnstone Operating System
|
cpu task definitons More...
#include <cpu/descriptor.h>#include <cpu/interrupt.h>#include <memory.h>#include <memory/paging.h>#include <list.h>#include <buffer.h>#include <utils.h>Classes | |
| struct | descriptor_tss_t |
| 64 bit tss descriptor More... | |
| struct | tss_s |
| tss descriptor values More... | |
| struct | task_registers_t |
| struct | task_t |
| struct | task_list_item_t |
Macros | |
| #define | ___CPU_TASK_H 0 |
| #define | TASK_MAX_TICK_COUNT 10 |
| #define | TASK_IDLE_TASK_ID 1 |
| #define | TASK_KERNEL_TASK_ID 2 |
| #define | DESCRIPTOR_BUILD_TSS_SEG(tss, base, limit, DPL) |
| initialize tss | |
| #define | task_init_tasking() |
| #define | task_get_current_task_message_queue(queue_number) |
Typedefs | |
| typedef struct descriptor_tss_t | descriptor_tss_t |
| typedef struct tss_s | tss_t |
| short hand for struct | |
| typedef enum task_state_t | task_state_t |
| short hand for enum | |
| typedef enum task_attribute_t | task_attribute_t |
| short hand for enum | |
| typedef struct task_registers_t | task_registers_t |
| typedef struct task_t | task_t |
| short hand for struct | |
| typedef struct task_list_item_t | task_list_item_t |
Enumerations | |
| enum | task_state_t { TASK_STATE_NULL , TASK_STATE_CREATED , TASK_STATE_STARTING , TASK_STATE_RUNNING , TASK_STATE_SUSPENDED , TASK_STATE_SLEEPING , TASK_STATE_MESSAGE_WAITING , TASK_STATE_INTERRUPT_RECEIVED , TASK_STATE_FUTURE_WAITING , TASK_STATE_LOCKED , TASK_STATE_ENDED } |
| task states More... | |
| enum | task_attribute_t { TASK_ATTRIBUTE_NONE = 0x0 , TASK_ATTRIBUTE_INTERRUPTIBLE = 0x1 } |
| task attributes More... | |
Functions | |
| int8_t | task_init_tasking_ext (memory_heap_t *heap) |
| inits kernel tasking, configures tss and kernel task | |
| void | task_task_switch_set_parameters (boolean_t need_eoi) |
| sets task switch parameters | |
| void | task_task_switch_exit (void) |
| applies task switch exit parameters | |
| void | task_switch_task (void) |
| switches current task to a new one. | |
| void | task_yield (void) |
| yields task for waiting other tasks. | |
| uint64_t | task_get_id (void) |
| returns current task's id | |
| uint64_t | task_get_cpu_id (void) |
| returns current task's cpu id | |
| task_t * | task_get_current_task (void) |
| returns current task | |
| void | task_set_message_waiting (void) |
| sets current task's message waiting flag | |
| void | task_clear_message_waiting (uint64_t task_id) |
| clears current task's message waiting flag | |
| void | task_set_interruptible (void) |
| sets current task's interruptible flag | |
| void | task_set_interrupt_received (uint64_t task_id) |
| sets current task's interrupt received flag | |
| void | task_set_message_received (uint64_t tid) |
| void | task_add_message_queue (list_t *queue) |
| adds a queue to task | |
| list_t * | task_get_message_queue (uint64_t task_id, uint64_t queue_number) |
| uint64_t | task_create_task (memory_heap_t *heap, uint64_t heap_size, uint64_t stack_size, void *entry_point, uint64_t args_cnt, void **args, const char_t *task_name) |
| creates a task and apends it to wait queue | |
| boolean_t | task_idle_check_need_yield (void) |
| idle task checks if there is any task neeeds to run. it speeds up task running | |
| void | task_current_task_sleep (uint64_t wake_tick) |
| sleep for current task for ticks | |
| void | task_end_task (void) |
| void | task_exit (int32_t exit_code) |
| void | task_kill_task (uint64_t task_id, boolean_t force) |
| void | task_print_all (buffer_t *buffer) |
| buffer_t * | task_build_task_list (void) |
| buffer_t * | task_get_task_input_buffer (uint64_t tid) |
| buffer_t * | task_get_task_output_buffer (uint64_t tid) |
| buffer_t * | task_get_task_error_buffer (uint64_t tid) |
| buffer_t * | task_get_input_buffer (void) |
| dummy method for efi for getting input buffer. | |
| buffer_t * | task_get_output_buffer (void) |
| dummy method for efi for getting output buffer. | |
| buffer_t * | task_get_error_buffer (void) |
| dummy method for efi for getting error buffer. | |
| int8_t | task_set_input_buffer (buffer_t *buffer) |
| int8_t | task_set_output_buffer (buffer_t *buffer) |
| int8_t | task_set_error_buffer (buffer_t *buffer) |
| void | task_set_vmcs_physical_address (uint64_t vmcs_physical_address) |
| uint64_t | task_get_vmcs_physical_address (void) |
| void | task_set_vm (void *vm) |
| void * | task_get_vm (void) |
| void | task_remove_task_after_fault (uint64_t task_id) |
| int8_t | task_set_current_and_idle_task (void *entry_point, uint64_t stack_base, uint64_t stack_size) |
| void | task_toggle_wait_for_future (uint64_t task_id) |
| uint64_t | task_get_task_xsave_mask (void) |
| uint32_t | task_get_task_mxcsr_mask (void) |
cpu task definitons
This work is licensed under TURNSTONE OS Public License. Please read and understand latest version of Licence.
| #define ___CPU_TASK_H 0 |
prevent duplicate header error macro
| #define DESCRIPTOR_BUILD_TSS_SEG | ( | tss, | |
| base, | |||
| limit, | |||
| DPL ) |
initialize tss
| tss | address of tss slot in gdt |
| base | base address of tss struct |
| limit | length of tss - 1 |
| DPL | privilage level |
| #define task_get_current_task_message_queue | ( | queue_number | ) |
| #define task_init_tasking | ( | ) |
inits tasking with default heap
| #define TASK_KERNEL_TASK_ID 2 |
kernel task id
| #define TASK_MAX_TICK_COUNT 10 |
maximum tick count of a task without yielding
| enum task_attribute_t |
| enum task_state_t |
task states
| void task_add_message_queue | ( | list_t * | queue | ) |
adds a queue to task
| [in] | queue | queue which task will have. tasks consumes these queues |
| void task_clear_message_waiting | ( | uint64_t | task_id | ) |
clears current task's message waiting flag
| [in] | task_id | task id |
| uint64_t task_create_task | ( | memory_heap_t * | heap, |
| uint64_t | heap_size, | ||
| uint64_t | stack_size, | ||
| void * | entry_point, | ||
| uint64_t | args_cnt, | ||
| void ** | args, | ||
| const char_t * | task_name ) |
creates a task and apends it to wait queue
| [in] | heap | creator heap |
| [in] | heap_size | task's heap size, heap allocated with frame allocator |
| [in] | stack_size | task's stack size, stack allocated with frame allocator |
| [in] | entry_point | task's entry point |
| [in] | args_cnt | argument count |
| [in] | args | argument list |
| [in] | task_name | task's name |
| void task_current_task_sleep | ( | uint64_t | wake_tick | ) |
sleep for current task for ticks
| [in] | wake_tick | tick count for sleep |
| uint64_t task_get_cpu_id | ( | void | ) |
returns current task's cpu id
| task_t * task_get_current_task | ( | void | ) |
returns current task
returns current task
this method is not required for efi however is required for linking.
| buffer_t * task_get_error_buffer | ( | void | ) |
dummy method for efi for getting error buffer.
this method is not required for efi however is required for linking. NULL is returned.
| uint64_t task_get_id | ( | void | ) |
returns current task's id
returns current task's id
this method is not required for efi however is required for linking.
| buffer_t * task_get_input_buffer | ( | void | ) |
dummy method for efi for getting input buffer.
this method is not required for efi however is required for linking. NULL is returned.
| buffer_t * task_get_output_buffer | ( | void | ) |
dummy method for efi for getting output buffer.
this method is not required for efi however is required for linking. NULL is returned.
| int8_t task_init_tasking_ext | ( | memory_heap_t * | heap | ) |
inits kernel tasking, configures tss and kernel task
| [in] | heap | the heap of kernel task and tasking related variables. |
| void task_set_interrupt_received | ( | uint64_t | task_id | ) |
sets current task's interrupt received flag
| [in] | task_id | task id |
| void task_task_switch_set_parameters | ( | boolean_t | need_eoi | ) |
sets task switch parameters
| [in] | need_eoi | if task switching needs notify local apic this field should be true |
| void task_yield | ( | void | ) |
yields task for waiting other tasks.
yields task for waiting other tasks.
this method is not required for efi however is required for linking.