24 lines
775 B
C++
24 lines
775 B
C++
/*
|
|
* UserRange.hpp
|
|
* Cross-CPU invalidation and teardown of user address-space mappings
|
|
* Copyright (c) 2026 Daniel Hammer
|
|
*/
|
|
|
|
#pragma once
|
|
#include <cstdint>
|
|
|
|
namespace Memory {
|
|
|
|
// Register the TLB-shootdown IPI handler. Must run before any AP is
|
|
// booted, since a shootdown targets every CPU running the address space.
|
|
void InitUserRange();
|
|
|
|
// Invalidate a user range on every CPU currently running the address
|
|
// space. Call this after removing PTEs and before releasing their frames.
|
|
void ShootdownUserRange(uint64_t pml4Phys, uint64_t startVa, uint32_t pages);
|
|
|
|
// Safely remove ordinary PFA-backed user mappings and release their frames.
|
|
void UnmapAndFreeUserRange(uint64_t pml4Phys, uint64_t startVa, uint64_t pages);
|
|
|
|
}
|