kernel: add support for getting percpu variables that belong to other CPUs
This commit is contained in:
@@ -24,7 +24,7 @@ extern kern_status_t init_per_cpu_areas(void)
|
||||
return KERN_OK;
|
||||
}
|
||||
|
||||
extern void *__percpu_get(void *var)
|
||||
extern void *__percpu_get(unsigned int cpu, void *var)
|
||||
{
|
||||
uintptr_t pvar = (uintptr_t)var;
|
||||
uintptr_t percpu_start = (uintptr_t)__percpu_start;
|
||||
@@ -36,5 +36,5 @@ extern void *__percpu_get(void *var)
|
||||
|
||||
size_t var_offset = pvar - percpu_start;
|
||||
|
||||
return (char *)percpu_buffer + (this_cpu() * percpu_stride) + var_offset;
|
||||
return (char *)percpu_buffer + (cpu * percpu_stride) + var_offset;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user