X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Fnvram.c;fp=palacios%2Fsrc%2Fdevices%2Fnvram.c;h=4e9527b251d079d367727f9afa8dca5b3f8b608a;hb=e23bd2c015e987882091e8e4d24f119247b3d1a9;hp=a8bfc53f6b3497843ec9b8b5ddeb6fe0003956fd;hpb=debabd511ff9dc2d0e6cd608045ac44295fe7319;p=palacios.git diff --git a/palacios/src/devices/nvram.c b/palacios/src/devices/nvram.c index a8bfc53..4e9527b 100644 --- a/palacios/src/devices/nvram.c +++ b/palacios/src/devices/nvram.c @@ -462,7 +462,7 @@ static void set_memory_size(struct nvram_internal * nvram, addr_t bytes) { { // Set the extended memory beyond 16 MB in 64k chunks - uint16_t mem_chunks = bytes * (1024 / 64); + uint16_t mem_chunks = (bytes - (1024 * 1024 * 16)) / (1024 * 64); nvram->mem_state[NVRAM_REG_AMI_BIG_MEMORY_HIGH] = (mem_chunks >> 8) & 0x00ff; nvram->mem_state[NVRAM_REG_AMI_BIG_MEMORY_LOW] = mem_chunks & 0x00ff; }