mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-30 05:58:22 +00:00
slab: rewrite slab allocator
This commit is contained in:
@@ -25,7 +25,7 @@ typedef struct cpu_t {
|
||||
vmmcontext_t *vmmctx; // expected to be here by other code
|
||||
|
||||
long hardware_id; // expected to be here by other code
|
||||
long internal_id;
|
||||
long internal_id; // expected to be here by other code
|
||||
|
||||
timekeeper_source_t *timekeeper_source;
|
||||
timekeeper_source_info_t *timekeeper_source_info;
|
||||
@@ -125,6 +125,12 @@ static inline void set_current_vmm_context(vmmcontext_t *context) {
|
||||
asm volatile ("mov %%rax, %%gs:16" : : "a"(context) : "memory");
|
||||
}
|
||||
|
||||
static inline long current_cpu_internal_id(void) {
|
||||
long id;
|
||||
asm volatile ("mov %%gs:32, %%rax" : "=a"(id) : : "memory");
|
||||
return id;
|
||||
}
|
||||
|
||||
static inline long current_cpu_id(void) {
|
||||
long id;
|
||||
asm volatile ("mov %%gs:24, %%rax" : "=a"(id) : : "memory");
|
||||
|
||||
Reference in New Issue
Block a user