diff options
author | Richard Braun <rbraun@sceen.net> | 2016-08-29 20:22:44 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2016-08-29 20:22:44 +0200 |
commit | 44e8b7765613c29b66d17563c7c0cb5679fdb955 (patch) | |
tree | a555f312689cba32d26e09cb3234f9683f2cad3d /vm/vm_map.c | |
parent | 1617ee67c9611dcad01c2dd378ccff600ccbf98b (diff) | |
download | gnumach-44e8b7765613c29b66d17563c7c0cb5679fdb955.tar.gz gnumach-44e8b7765613c29b66d17563c7c0cb5679fdb955.tar.bz2 gnumach-44e8b7765613c29b66d17563c7c0cb5679fdb955.zip |
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/vm_map.c')
-rw-r--r-- | vm/vm_map.c | 13 |
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"); |