Use pointer metadata for page metadata

This commit is contained in:
Zhang Junyang
2024-10-03 15:41:56 +08:00
committed by Tate, Hongliang Tian
parent cd22854f59
commit 60365a818a
17 changed files with 223 additions and 290 deletions

View File

@ -1,9 +1,10 @@
// SPDX-License-Identifier: MPL-2.0
use crate::{
impl_page_meta,
mm::{
kspace::kvirt_area::{KVirtArea, Tracked},
page::{allocator, meta::KernelStackMeta},
page::allocator,
page_prop::{CachePolicy, PageFlags, PageProperty, PrivilegedPageFlags},
PAGE_SIZE,
},
@ -34,6 +35,11 @@ pub struct KernelStack {
has_guard_page: bool,
}
#[derive(Debug, Default)]
struct KernelStackMeta {}
impl_page_meta!(KernelStackMeta);
impl KernelStack {
/// Generates a kernel stack with guard pages.
/// 4 additional pages are allocated and regarded as guard pages, which should not be accessed.