diff options
author | Marvin Borner | 2021-04-09 13:10:03 +0200 |
---|---|---|
committer | Marvin Borner | 2021-04-09 13:10:03 +0200 |
commit | eeb88df1d501ccec4737c18dddb7ca0a1176304f (patch) | |
tree | d36b563a27a4a7bdeae662eb5aa44ca082b57e0b /kernel/inc | |
parent | f8d841fe268ebba43686729af535e035702438f7 (diff) |
Added readable/writable checks
Diffstat (limited to 'kernel/inc')
-rw-r--r-- | kernel/inc/mm.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/kernel/inc/mm.h b/kernel/inc/mm.h index b7032c8..b82b441 100644 --- a/kernel/inc/mm.h +++ b/kernel/inc/mm.h @@ -82,8 +82,11 @@ struct page_dir { union page_dir_entry entries[PAGE_COUNT]; } PACKED; +union page_table_entry *virtual_entry(struct page_dir *dir, u32 vaddr); u8 virtual_present(struct page_dir *dir, u32 vaddr) NONNULL; u32 virtual_to_physical(struct page_dir *dir, u32 vaddr) NONNULL; +u8 virtual_user_readable(struct page_dir *dir, u32 vaddr) NONNULL; +u8 virtual_user_writable(struct page_dir *dir, u32 vaddr) NONNULL; void virtual_map(struct page_dir *dir, struct memory_range prange, u32 vaddr, u32 flags) NONNULL; void virtual_remap_readonly(struct page_dir *dir, struct memory_range vrange); struct memory_range virtual_alloc(struct page_dir *dir, struct memory_range physical_range, @@ -128,8 +131,9 @@ void memory_backup_dir(struct page_dir **backup) NONNULL; // Bypass should almost never be used void memory_bypass_enable(void); void memory_bypass_disable(void); -u8 memory_is_user(u32 addr); -u8 memory_valid(const void *addr) NONNULL; +u8 memory_is_user(const void *addr) NONNULL; +u8 memory_readable(const void *addr) NONNULL; +u8 memory_writable(const void *addr) NONNULL; // User interface res memory_sys_alloc(struct page_dir *dir, u32 size, u32 *addr, u32 *id, u8 shared) NONNULL; |