Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cpu/percpu: remove spinlock around pagetable
The PerCpu structure can only be accessed from the current CPU, so there is no need for locking. Moreover, if the pagetable is acquired more than once this will cause a deadlock. Replace the spinlock instead with a RefCell, and return a RefMut from `PerCpu::get_pgtable()`. This way, if we attempt to acquire more than one coexisting reference to the per-cpu pagetable more than once, we will panic immediately. Signed-off-by: Carlos López <[email protected]>
- Loading branch information