117 list_t* temp = pcpu_rcu->ready;
118 pcpu_rcu->ready = pcpu_rcu->waiting;
119 pcpu_rcu->waiting = temp;
124 list_t* temp = pcpu_rcu->waiting;
125 pcpu_rcu->waiting = pcpu_rcu->batch;
126 pcpu_rcu->batch = temp;
129 pcpu_rcu->grace =
grace + 1;
#define assert(expression)
#define CLI_SCOPE()
Macro to increment CLI depth for the duration of the current scope.
#define SELF_PTR(ptr)
Macro to get a pointer to a percpu variable on the current CPU.
#define SELF
Macro to access data in the current cpu.
#define PERCPU_DEFINE_CTOR(type, name)
Macro to define a percpu variable with a constructor.
#define CPU_MAX
Maximum number of CPUs supported.
static uint16_t cpu_amount(void)
Gets the number of identified CPUs.
#define CPU_FOR_EACH(cpu)
Macro to iterate over all CPUs.
void cache_free(void *obj)
Free an object back to its cache.
uint64_t wait_unblock(wait_queue_t *queue, uint64_t amount, errno_t err)
Unblock threads waiting on a wait queue.
void wait_queue_deinit(wait_queue_t *queue)
Deinitialize wait queue.
#define WAIT_ALL
Used to indicate that the wait should unblock all waiting threads.
void wait_queue_init(wait_queue_t *queue)
Initialize wait queue.
#define WAIT_BLOCK_LOCK(queue, lock, condition)
Blocks until the condition is true, condition will be tested on every wakeup. Will release the lock b...
bool sched_is_idle(cpu_t *cpu)
Checks if the CPU is currently idle.
static void lock_init(lock_t *lock)
Initializes a lock.
#define LOCK_CREATE()
Create a lock initializer.
#define LOCK_SCOPE(lock)
Acquires a lock for the reminder of the current scope.
static void lock_release(lock_t *lock)
Releases a lock.
static void lock_acquire(lock_t *lock)
Acquires a lock, blocking until it is available.
void rcu_report_quiescent(void)
Called during a context switch to report a quiescent state.
void rcu_call_free(void *arg)
Helper callback to free a pointer.
void rcu_call_cache_free(void *arg)
Helper callback to free a cache object.
void(* rcu_callback_t)(void *arg)
RCU callback function type.
void rcu_synchronize(void)
Wait for all pre-existing RCU read-side critical sections to complete.
void rcu_call(rcu_entry_t *entry, rcu_callback_t func, void *arg)
Add a callback to be executed after a grace period.
#define BITMAP_CREATE_ZERO(name, bits)
Define and create a zero-initialized bitmap and its buffer.
static bool bitmap_is_empty(bitmap_t *map)
Check if the bitmap is empty (all bits clear).
static void bitmap_clear(bitmap_t *map, uint64_t index)
Clear a bit in the bitmap.
static bool bitmap_is_set(bitmap_t *map, uint64_t idx)
Check if a bit is set in the bitmap.
static void bitmap_set_range(bitmap_t *map, uint64_t low, uint64_t high)
Set a range of bits in the bitmap.
#define ARRAY_SIZE(x)
Get the number of elements in a static array.
static void list_push_back(list_t *list, list_entry_t *entry)
Pushes an entry to the end of the list.
static bool list_is_empty(list_t *list)
Checks if a list is empty.
static void list_entry_init(list_entry_t *entry)
Initializes a list entry.
static list_entry_t * list_pop_front(list_t *list)
Pops the first entry from the list.
static void list_init(list_t *list)
Initializes a list.
#define NULL
Pointer error value.
#define CONTAINER_OF(ptr, type, member)
Container of macro.
static bool rcu_check_quiescent(void)
static void rcu_advance(bool wake)
static void rcu_invoke_callbacks(void)
static void rcu_synchronize_callback(void *arg)
static void rcu_start_grace(void)
#define RFLAGS_INTERRUPT_ENABLE
static uint64_t rflags_read(void)
_PUBLIC void free(void *ptr)
A simple ticket lock implementation.
Intrusive RCU head structure.
list_t * waiting
Callbacks waiting for the current grace period to end.
list_t * batch
Callbacks queued during the current grace period.
list_t * ready
Callbacks whose grace period has ended.
uint64_t grace
The last grace period observed by this CPU.
The primitive that threads block on.