Changeset View
Changeset View
Standalone View
Standalone View
head/sys/amd64/vmm/vmm.c
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | |||||
#include <sys/mutex.h> | #include <sys/mutex.h> | ||||
#include <sys/proc.h> | #include <sys/proc.h> | ||||
#include <sys/rwlock.h> | #include <sys/rwlock.h> | ||||
#include <sys/sched.h> | #include <sys/sched.h> | ||||
#include <sys/smp.h> | #include <sys/smp.h> | ||||
#include <sys/vnode.h> | #include <sys/vnode.h> | ||||
#include <vm/vm.h> | #include <vm/vm.h> | ||||
#include <vm/vm_param.h> | |||||
#include <vm/vm_extern.h> | |||||
#include <vm/vm_object.h> | #include <vm/vm_object.h> | ||||
#include <vm/vm_page.h> | #include <vm/vm_page.h> | ||||
#include <vm/pmap.h> | #include <vm/pmap.h> | ||||
#include <vm/vm_map.h> | #include <vm/vm_map.h> | ||||
#include <vm/vm_extern.h> | |||||
#include <vm/vm_param.h> | |||||
#include <vm/vm_pager.h> | #include <vm/vm_pager.h> | ||||
#include <vm/vm_kern.h> | #include <vm/vm_kern.h> | ||||
#include <vm/vnode_pager.h> | #include <vm/vnode_pager.h> | ||||
#include <vm/swap_pager.h> | #include <vm/swap_pager.h> | ||||
#include <vm/uma.h> | #include <vm/uma.h> | ||||
#include <machine/cpu.h> | #include <machine/cpu.h> | ||||
#include <machine/pcb.h> | #include <machine/pcb.h> | ||||
▲ Show 20 Lines • Show All 412 Lines • ▼ Show 20 Lines | vm_create(const char *name, struct vm **retvm) | ||||
* to create the virtual machine. | * to create the virtual machine. | ||||
*/ | */ | ||||
if (!vmm_initialized) | if (!vmm_initialized) | ||||
return (ENXIO); | return (ENXIO); | ||||
if (name == NULL || strlen(name) >= VM_MAX_NAMELEN) | if (name == NULL || strlen(name) >= VM_MAX_NAMELEN) | ||||
return (EINVAL); | return (EINVAL); | ||||
vmspace = vmmops_vmspace_alloc(0, VM_MAXUSER_ADDRESS); | vmspace = vmmops_vmspace_alloc(0, VM_MAXUSER_ADDRESS_LA48); | ||||
if (vmspace == NULL) | if (vmspace == NULL) | ||||
return (ENOMEM); | return (ENOMEM); | ||||
vm = malloc(sizeof(struct vm), M_VM, M_WAITOK | M_ZERO); | vm = malloc(sizeof(struct vm), M_VM, M_WAITOK | M_ZERO); | ||||
strcpy(vm->name, name); | strcpy(vm->name, name); | ||||
vm->vmspace = vmspace; | vm->vmspace = vmspace; | ||||
mtx_init(&vm->rendezvous_mtx, "vm rendezvous lock", 0, MTX_DEF); | mtx_init(&vm->rendezvous_mtx, "vm rendezvous lock", 0, MTX_DEF); | ||||
▲ Show 20 Lines • Show All 2,440 Lines • Show Last 20 Lines |