MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vmm_handler

Function vmm_handler

freebsd/amd64/vmm/vmm.c:381–422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

379}
380
381static int
382vmm_handler(module_t mod, int what, void *arg)
383{
384 int error;
385
386 switch (what) {
387 case MOD_LOAD:
388 if (vmm_is_hw_supported()) {
389 vmmdev_init();
390 error = vmm_init();
391 if (error == 0)
392 vmm_initialized = 1;
393 } else {
394 error = ENXIO;
395 }
396 break;
397 case MOD_UNLOAD:
398 if (vmm_is_hw_supported()) {
399 error = vmmdev_cleanup();
400 if (error == 0) {
401 vmm_resume_p = NULL;
402 iommu_cleanup();
403 if (vmm_ipinum != IPI_AST)
404 lapic_ipi_free(vmm_ipinum);
405 error = vmmops_modcleanup();
406 /*
407 * Something bad happened - prevent new
408 * VMs from being created
409 */
410 if (error)
411 vmm_initialized = 0;
412 }
413 } else {
414 error = 0;
415 }
416 break;
417 default:
418 error = 0;
419 break;
420 }
421 return (error);
422}
423
424static moduledata_t vmm_kmod = {
425 "vmm",

Callers

nothing calls this directly

Calls 6

vmm_is_hw_supportedFunction · 0.85
vmmdev_initFunction · 0.85
vmm_initFunction · 0.85
vmmdev_cleanupFunction · 0.85
iommu_cleanupFunction · 0.85
lapic_ipi_freeFunction · 0.85

Tested by

no test coverage detected