|
Turnstone Operating System
|
Synchronization primitives. More...
#include <cpu.h>#include <cpu/sync.h>#include <cpu/task.h>#include <apic.h>#include <logging.h>#include <utils.h>Classes | |
| struct | lock_t |
| struct | semaphore_t |
Typedefs | |
| typedef struct lock_t | lock_t |
| typedef uint32_t(* | lock_get_local_apic_id_getter_f) (void) |
| typedef task_t *(* | lock_current_task_getter_f) (void) |
| typedef void(* | lock_task_yielder_f) (void) |
| typedef struct semaphore_t | semaphore_t |
Functions | |
| MODULE ("turnstone.kernel.cpu.sync") | |
| void | video_text_print (const char *str) |
| void | future_task_wait_toggler (uint64_t task_id) |
| static uint32_t | lock_get_local_apic_id (void) |
| static task_t * | lock_get_current_task (void) |
| void | lock_task_yield (void) |
| lock_t * | lock_create_with_heap_for_future (memory_heap_t *heap, boolean_t for_future, uint64_t task_id) |
| creates lock | |
| int8_t | lock_destroy (lock_t *lock) |
| destroys lock | |
| void | lock_acquire (lock_t *lock) |
| acquires lock | |
| void | lock_release (lock_t *lock) |
| relaases lock | |
| semaphore_t * | semaphore_create_with_heap (memory_heap_t *heap, uint64_t count) |
| create semaphore | |
| int8_t | semaphore_destroy (semaphore_t *semaphore) |
| destroys semaphore | |
| int8_t | semaphore_acquire_with_count (semaphore_t *semaphore, uint64_t count) |
| acquires slots at semaphore | |
| int8_t | semaphore_release_with_count (semaphore_t *semaphore, uint64_t count) |
| releases slots at semaphore | |
Synchronization primitives.
This work is licensed under TURNSTONE OS Public License. Please read and understand latest version of Licence.
| typedef struct lock_t lock_t |
lock type
lock type preventing sync.h recursion
| typedef struct semaphore_t semaphore_t |
semaphore type
| void lock_acquire | ( | lock_t * | lock | ) |
acquires lock
| [in] | lock | lock to acquire |
| lock_t * lock_create_with_heap_for_future | ( | memory_heap_t * | heap, |
| boolean_t | for_future, | ||
| uint64_t | task_id ) |
creates lock
| [in] | heap | heap for lock |
| [in] | for_future | is lock for future |
destroys lock
| [in] | lock | lock to destroy |
| void lock_release | ( | lock_t * | lock | ) |
relaases lock
| [in] | lock | lock to release |
| int8_t semaphore_acquire_with_count | ( | semaphore_t * | semaphore, |
| uint64_t | count ) |
acquires slots at semaphore
| [in] | semaphore | semaphore to acquire |
| [in] | count | semaphore decrease value |
| semaphore_t * semaphore_create_with_heap | ( | memory_heap_t * | heap, |
| uint64_t | count ) |
create semaphore
| [in] | heap | heap where semaphore resides |
| [in] | count | semaphore count value |
| int8_t semaphore_destroy | ( | semaphore_t * | semaphore | ) |
destroys semaphore
| [in] | semaphore | semaphore to destroy |
| int8_t semaphore_release_with_count | ( | semaphore_t * | semaphore, |
| uint64_t | count ) |
releases slots at semaphore
| [in] | semaphore | semaphore to release |
| [in] | count | semaphore increase value |