The Pedigree Project 0.1
UserMemoryPolicy.cc
1/* Copyright (c) 2026, Pedigree Developers. */
2#include "pedigree/kernel/processor/UserMemoryPolicy.h"
3#include "pedigree/kernel/processor/VirtualAddressSpace.h"
4
5UserMemoryOperation::UserMemoryOperation(VirtualAddressSpace& space)
6 : m_EventDeferral(),
7 m_TerminationDeferral(),
8 m_Policy(space.userMemoryPolicy()),
9 m_Privileged(false) {
10 if (m_Policy) {
11 m_Policy->enterOperation();
12 m_Privileged = m_Policy->callerHasMemoryLockPrivilege();
13 }
14}
15
16UserMemoryOperation::~UserMemoryOperation() {
17 if (m_Policy)
18 m_Policy->leaveOperation();
19}