|
PatchworkOS
69292a3
A non-POSIX operating system.
|
#include <kernel/cpu/percpu.h>#include <kernel/cpu/cpu.h>#include <kernel/log/panic.h>#include <kernel/mem/vmm.h>#include <kernel/sync/lock.h>#include <string.h>Go to the source code of this file.
Data Structures | |
| struct | percpu_section_t |
Macros | |
| #define | PERCPU_MAX_SECTIONS 128 |
Functions | |
| static | BITMAP_CREATE_ZERO (allocated, CONFIG_PERCPU_SIZE/PERCPU_ALIGNMENT) |
| static | PERCPU_DEFINE (uint64_t, pcpu_generation) |
| static | PERCPU_DEFINE (uint64_t, pcpu_ack) |
| void | percpu_init (cpu_t *cpu) |
| Initialize the percpu system. | |
| percpu_t | percpu_alloc (size_t size) |
| Allocates a percpu variable. | |
| void | percpu_free (percpu_t ptr, size_t size) |
| Frees a percpu variable. | |
| static void | percpu_run_ctors (percpu_section_t *section) |
| static void | percpu_run_dtors (percpu_section_t *section) |
| void | percpu_update (void) |
| Update percpu sections on the current CPU. | |
| void | percpu_section_init (percpu_def_t *start, percpu_def_t *end) |
| Register a percpu section and run constructors. | |
| void | percpu_section_deinit (percpu_def_t *start, percpu_def_t *end) |
| Unregister a percpu section and run destructors. | |
Variables | |
| static percpu_section_t | sections [PERCPU_MAX_SECTIONS] |
| We cant do memory allocation during early boot so we have to statically allocate the percpu sections. | |
| static size_t | sectionCount = 0 |
| static uint64_t | globalGeneration = 0 |
| static uint64_t | globalAck = 0 |
| static lock_t | lock = LOCK_CREATE() |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |