summaryrefslogtreecommitdiff
path: root/vm
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2016-08-29 20:22:44 +0200
committerRichard Braun <rbraun@sceen.net>2016-08-29 20:22:44 +0200
commit44e8b7765613c29b66d17563c7c0cb5679fdb955 (patch)
treea555f312689cba32d26e09cb3234f9683f2cad3d /vm
parent1617ee67c9611dcad01c2dd378ccff600ccbf98b (diff)
vm: fix boot on xen
* vm/vm_map.c (_vm_map_entry_create: Make sure there is a thread before accessing VM privilege.
Diffstat (limited to 'vm')
-rw-r--r--vm/vm_map.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/vm/vm_map.c b/vm/vm_map.c
index acac66e4..e73a124a 100644
--- a/vm/vm_map.c
+++ b/vm/vm_map.c
@@ -256,10 +256,17 @@ vm_map_entry_t _vm_map_entry_create(map_header)
* currently impossible to predict which map the default pager
* may depend on.
*/
- vm_privilege = current_thread()->vm_privilege;
- current_thread()->vm_privilege = TRUE;
+
+ if (current_thread()) {
+ vm_privilege = current_thread()->vm_privilege;
+ current_thread()->vm_privilege = TRUE;
+ }
+
entry = (vm_map_entry_t) kmem_cache_alloc(&vm_map_entry_cache);
- current_thread()->vm_privilege = vm_privilege;
+
+ if (current_thread()) {
+ current_thread()->vm_privilege = vm_privilege;
+ }
if (entry == VM_MAP_ENTRY_NULL)
panic("vm_map_entry_create");