kernel: Define a constant to check for default memory access
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
apio 2023-05-07 21:38:38 +02:00
parent b25e212880
commit 72dadc6706
Signed by: apio
GPG Key ID: B8A7D06E42258954
2 changed files with 4 additions and 1 deletions

View File

@ -276,7 +276,8 @@ namespace CPU
static void backtrace_impl(u64 base_pointer, void (*callback)(u64, void*), void* arg)
{
StackFrame* current_frame = (StackFrame*)base_pointer;
while (current_frame && MemoryManager::validate_access(current_frame, sizeof(*current_frame), 0) &&
while (current_frame &&
MemoryManager::validate_access(current_frame, sizeof(*current_frame), MemoryManager::DEFAULT_ACCESS) &&
current_frame->instruction)
{
callback(current_frame->instruction, arg);

View File

@ -6,6 +6,8 @@
namespace MemoryManager
{
constexpr int DEFAULT_ACCESS = 0;
void init();
Result<void> protect_kernel_sections();