X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Fnvram.c;h=ef37366ee28b06e2603aa48eedcb507946c68101;hb=783acda8c0173cb6ad0331ca26c69f7a83b2f377;hp=0001ee9fc5d84c7b9265fa453a489c7e99ef1ddd;hpb=d5dcf31799fddceebb6456bb1365eb679459a529;p=palacios-OLD.git diff --git a/palacios/src/devices/nvram.c b/palacios/src/devices/nvram.c index 0001ee9..ef37366 100644 --- a/palacios/src/devices/nvram.c +++ b/palacios/src/devices/nvram.c @@ -2,9 +2,15 @@ #include #include -extern struct vmm_os_hooks *os_hooks; -extern void SerialPrint(const char *format, ...); +#ifndef DEBUG_NVRAM +#undef PrintDebug +#define PrintDebug(fmt, args...) +#endif + + + + #define NVRAM_REG_PORT 0x70 #define NVRAM_DATA_PORT 0x71 @@ -117,11 +123,11 @@ static int set_nvram_defaults(struct vm_device *dev) nvram_state->mem_state[NVRAM_REG_EXT_MEMORY_2ND_LOW]= 0x00; // Set the extended memory beyond 16 MB to 128-16 MB - // nvram_state->mem_state[NVRAM_REG_AMI_BIG_MEMORY_HIGH]= 0x7; - //nvram_state->mem_state[NVRAM_REG_AMI_BIG_MEMORY_LOW]= 0x00; + nvram_state->mem_state[NVRAM_REG_AMI_BIG_MEMORY_HIGH] = 0x7; + nvram_state->mem_state[NVRAM_REG_AMI_BIG_MEMORY_LOW] = 0x00; - nvram_state->mem_state[NVRAM_REG_AMI_BIG_MEMORY_HIGH]= 0x00; - nvram_state->mem_state[NVRAM_REG_AMI_BIG_MEMORY_LOW]= 0x00; + //nvram_state->mem_state[NVRAM_REG_AMI_BIG_MEMORY_HIGH]= 0x00; + //nvram_state->mem_state[NVRAM_REG_AMI_BIG_MEMORY_LOW]= 0x00; // This is the harddisk type.... Set accordingly... @@ -153,7 +159,7 @@ int nvram_reset_device(struct vm_device * dev) { struct nvram_internal *data = (struct nvram_internal *) dev->private_data; - SerialPrint("nvram: reset device\n"); + PrintDebug("nvram: reset device\n"); @@ -171,14 +177,14 @@ int nvram_reset_device(struct vm_device * dev) int nvram_start_device(struct vm_device *dev) { - SerialPrint("nvram: start device\n"); + PrintDebug("nvram: start device\n"); return 0; } int nvram_stop_device(struct vm_device *dev) { - SerialPrint("nvram: stop device\n"); + PrintDebug("nvram: stop device\n"); return 0; } @@ -241,7 +247,7 @@ int nvram_init_device(struct vm_device * dev) { struct nvram_internal *data = (struct nvram_internal *) dev->private_data; - SerialPrint("nvram: init_device\n"); + PrintDebug("nvram: init_device\n"); memset(data->mem_state, 0, NVRAM_REG_MAX); @@ -284,9 +290,9 @@ static struct vm_device_ops dev_ops = { struct vm_device *create_nvram() { - struct nvram_internal * nvram_state = os_hooks->malloc(sizeof(struct nvram_internal)+1000); + struct nvram_internal * nvram_state = (struct nvram_internal *)V3_Malloc(sizeof(struct nvram_internal)+1000); - SerialPrint("internal at %x\n",nvram_state); + PrintDebug("internal at %x\n",nvram_state); struct vm_device *device = create_device("NVRAM", &dev_ops, nvram_state);