aboutsummaryrefslogtreecommitdiff
path: root/kernel/include
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/include')
-rw-r--r--kernel/include/paging.h6
-rw-r--r--kernel/include/region.h2
2 files changed, 8 insertions, 0 deletions
diff --git a/kernel/include/paging.h b/kernel/include/paging.h
index 720d6b3..44014a2 100644
--- a/kernel/include/paging.h
+++ b/kernel/include/paging.h
@@ -19,6 +19,12 @@ uint32_t pd_get_frame(void* vaddr); // get physical frame for virtual address
int pd_map_page(void* vaddr, uint32_t frame_id, bool rw); // returns nonzero on error
void pd_unmap_page(void* vaddr); // does nothing if page not mapped
+// Note on concurrency : we expect that multiple threads will not try to map/unmap
+// pages in the same region at the same time. It can nevertheless happen that
+// several threads try to map pages that belong to the same 4M-section, and in that
+// case both might require the allocation of a new PT at the same location. These
+// cases are well-handled (the pagedir_t type contains a mutex used for this)
+
pagedir_t *create_pagedir(); // returns zero on error
void delete_pagedir(pagedir_t *pd);
diff --git a/kernel/include/region.h b/kernel/include/region.h
index 5f44626..ac68047 100644
--- a/kernel/include/region.h
+++ b/kernel/include/region.h
@@ -2,6 +2,8 @@
// Kernel virtual memory region allocator
+// This is entirely thread-safe
+
#include <sys.h>
#include <paging.h>