|
PatchworkOS
|
#include <kernel/acpi/aml/runtime/mutex.h>#include <kernel/log/log.h>#include <kernel/sched/sched.h>#include <kernel/sched/thread.h>#include <errno.h>#include <stdlib.h>Go to the source code of this file.
Data Structures | |
| struct | aml_mutex_entry_t |
Functions | |
| static uint64_t | aml_mutex_stack_push (aml_mutex_id_t id, aml_sync_level_t syncLevel) |
| static uint64_t | aml_mutex_stack_pop (aml_mutex_id_t id) |
| void | aml_mutex_id_init (aml_mutex_id_t *mutex) |
| Create a new mutex and return its id. | |
| void | aml_mutex_id_deinit (aml_mutex_id_t *mutex) |
| Destroy the mutex with the given id. | |
| uint64_t | aml_mutex_acquire (aml_mutex_id_t *mutex, aml_sync_level_t syncLevel, clock_t timeout) |
| Acquire a mutex, blocking until it is available or the timeout is reached. | |
| uint64_t | aml_mutex_release (aml_mutex_id_t *mutex) |
| Release a mutex. | |
Variables | |
| static bool | initialized = false |
| static aml_sync_level_t | currentSyncLevel = 0 |
| static list_t | mutexStack |
| static atomic_int32_t | newMutexId = ATOMIC_VAR_INIT(1) |
|
inlinestatic |
Definition at line 52 of file mutex.c.
References CONTAINER_OF, currentSyncLevel, EDEADLK, aml_mutex_entry_t::entry, ERR, errno, free(), aml_mutex_entry_t::id, list_last(), list_length(), list_remove(), LOG_ERR, mutexStack, and aml_mutex_entry_t::syncLevel.
Referenced by aml_mutex_release().
|
inlinestatic |
Definition at line 23 of file mutex.c.
References currentSyncLevel, EDEADLK, aml_mutex_entry_t::entry, ERR, errno, aml_mutex_entry_t::id, id, initialized, list_entry_init(), list_init(), list_push(), LOG_ERR, malloc(), mutexStack, NULL, and aml_mutex_entry_t::syncLevel.
Referenced by aml_mutex_acquire().
|
static |
Definition at line 18 of file mutex.c.
Referenced by aml_mutex_stack_pop(), and aml_mutex_stack_push().
Definition at line 17 of file mutex.c.
Referenced by aml_mutex_stack_push().
|
static |
Definition at line 19 of file mutex.c.
Referenced by aml_mutex_stack_pop(), and aml_mutex_stack_push().
|
static |
Definition at line 21 of file mutex.c.
Referenced by aml_mutex_id_init().