X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=linux_module%2Fpalacios-dev.c;h=71e861d27ee205674c7034ea082bfe85ee29c4f7;hb=cf1a814109e7cb32b3f328ed5fdc79ccd6a34e17;hp=66458602fc78ccac096eea776e0559c93d6f7443;hpb=861ce318738e31181f20286c9669979acf0f62d3;p=palacios.git diff --git a/linux_module/palacios-dev.c b/linux_module/palacios-dev.c index 6645860..71e861d 100644 --- a/linux_module/palacios-dev.c +++ b/linux_module/palacios-dev.c @@ -21,20 +21,11 @@ #include "palacios.h" #include "palacios-mm.h" #include "palacios-vm.h" -#include "palacios-stream.h" -#include "palacios-file.h" #include "palacios-serial.h" -#include "palacios-socket.h" #include "palacios-vnet.h" -#include "palacios-packet.h" -#ifdef V3_CONFIG_EXT_INSPECTOR -#include "palacios-inspector.h" -#endif +#include "linux-exts.h" -#ifdef V3_CONFIG_KEYED_STREAMS -#include "palacios-keyed-stream.h" -#endif MODULE_LICENSE("GPL"); @@ -51,9 +42,6 @@ static u8 v3_minor_map[MAX_VMS / 8] = {[0 ... (MAX_VMS / 8) - 1] = 0}; struct class * v3_class = NULL; static struct cdev ctrl_dev; -void * v3_base_addr = NULL; -unsigned int v3_pages = 0; - static int register_vm( void ) { int i, j = 0; int avail = 0; @@ -137,9 +125,9 @@ static long v3_dev_ioctl(struct file * filp, printk("Launching VM\n"); - INIT_LIST_HEAD(&(guest->streams)); - INIT_LIST_HEAD(&(guest->files)); - INIT_LIST_HEAD(&(guest->sockets)); + INIT_LIST_HEAD(&(guest->exts)); + + #ifdef V3_CONFIG_HOST_DEVICE INIT_LIST_HEAD(&(guest->hostdev.devs)); #endif @@ -208,8 +196,6 @@ static struct file_operations v3_ctrl_fops = { }; -extern unsigned int v3_pages; -extern void * v3_base_addr; static int __init v3_init(void) { dev_t dev = MKDEV(0, 0); // We dynamicallly assign the major number @@ -218,6 +204,16 @@ static int __init v3_init(void) { palacios_init_mm(); + + // Initialize Palacios + + palacios_vmm_init(); + + + // initialize extensions + init_lnx_extensions(); + + v3_class = class_create(THIS_MODULE, "vms"); if (IS_ERR(v3_class)) { printk("Failed to register V3 VM device class\n"); @@ -251,48 +247,13 @@ static int __init v3_init(void) { goto failure1; } - if ((v3_pages > 0) && (v3_base_addr != NULL)) { - add_palacios_memory(__pa(v3_base_addr), v3_pages); - } - // Initialize Palacios - - palacios_vmm_init(); -#ifdef V3_CONFIG_STREAM - palacios_init_stream(); -#endif - -#ifdef V3_CONFIG_FILE - palacios_file_init(); -#endif - -#ifdef V3_CONFIG_KEYED_STREAMS - palacios_init_keyed_streams(); -#endif - -#ifdef V3_CONFIG_CONSOLE - palacios_init_console(); -#endif - -#ifdef V3_CONFIG_GRAPHICS_CONSOLE - palacios_init_graphics_console(); -#endif - -#ifdef V3_CONFIG_EXT_INSPECTOR - palacios_init_inspector(); -#endif -#ifdef V3_CONFIG_SOCKET - palacios_socket_init(); -#endif -#ifdef V3_CONFIG_PACKET - palacios_init_packet(NULL); -#endif #ifdef V3_CONFIG_VNET - palacios_init_vnet(); + palacios_vnet_init(); #endif #ifdef V3_CONFIG_HOST_DEVICE @@ -339,17 +300,12 @@ static void __exit v3_exit(void) { class_destroy(v3_class); + deinit_lnx_extensions(); -#ifdef V3_CONFIG_EXT_INSPECTOR - palacios_deinit_inspector(); -#endif -#ifdef V3_CONFIG_FILE - palacios_file_deinit(); -#endif -#ifdef V3_CONFIG_STREAM - palacios_deinit_stream(); +#ifdef V3_CONFIG_VNET + palacios_vnet_deinit(); #endif palacios_deinit_mm();