Turnstone Operating System
|
synchronization interface More...
Macros | |
#define | ___CPU_SYNC_H 0 |
#define | SYNC_LOCK_SIZE 0x28 |
#define | lock_create_with_heap(h) lock_create_with_heap_for_future(h, 0, 0) |
macro for creating lock with heap More... | |
#define | lock_create() lock_create_with_heap(NULL) |
macro for creating lock with default heap | |
#define | lock_create_for_future(tid) lock_create_with_heap_for_future(NULL, true, tid) |
macro for creating future lock with default heap | |
#define | semaphore_create(c) semaphore_create_with_heap(NULL, c) |
creats sempahore at default heap with count More... | |
#define | semaphore_acquire(s) semaphore_acquire_with_count(s, 1) |
acquires one slot at semaphore More... | |
#define | semaphore_release(s) semaphore_release_with_count(s, 1) |
releases one slot at semaphore More... | |
Typedefs | |
typedef struct lock_t | lock_t |
typedef struct semaphore_t | semaphore_t |
Functions | |
lock_t * | lock_create_with_heap_for_future (memory_heap_t *heap, boolean_t for_future, uint64_t task_id) |
creates lock More... | |
int8_t | lock_destroy (lock_t *lock) |
destroys lock More... | |
void | lock_acquire (lock_t *lock) |
acquires lock More... | |
void | lock_release (lock_t *lock) |
relaases lock More... | |
semaphore_t * | semaphore_create_with_heap (memory_heap_t *heap, uint64_t count) |
create semaphore More... | |
int8_t | semaphore_destroy (semaphore_t *semaphore) |
destroys semaphore More... | |
int8_t | semaphore_acquire_with_count (semaphore_t *semaphore, uint64_t count) |
acquires slots at semaphore More... | |
int8_t | semaphore_release_with_count (semaphore_t *semaphore, uint64_t count) |
releases slots at semaphore More... | |
synchronization interface
This work is licensed under TURNSTONE OS Public License. Please read and understand latest version of Licence.
#define ___CPU_SYNC_H 0 |
prevent duplicate header error macro
#define lock_create_with_heap | ( | h | ) | lock_create_with_heap_for_future(h, 0, 0) |
macro for creating lock with heap
[in] | h | heap |
#define semaphore_acquire | ( | s | ) | semaphore_acquire_with_count(s, 1) |
acquires one slot at semaphore
[in] | s | semaphore to acquire |
#define semaphore_create | ( | c | ) | semaphore_create_with_heap(NULL, c) |
creats sempahore at default heap with count
[in] | c | count |
#define semaphore_release | ( | s | ) | semaphore_release_with_count(s, 1) |
releases one slot at semaphore
[in] | s | semaphore to release |
#define SYNC_LOCK_SIZE 0x28 |
memory size for lock
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 |