Bug fix the handling of struct mem_range for the athlon

This commit is contained in:
Eric W. Biederman 2002-07-06 01:25:52 +00:00
commit b3b9071f43
2 changed files with 15 additions and 4 deletions

View file

@ -1,4 +1,5 @@
// Needed so the AMD K7 runs correctly.
#include <mem.h>
#include <printk.h>
#include <cpu/p6/msr.h>
#include <cpu/cpufixup.h>
@ -11,11 +12,21 @@
#define MTRRVARDRAMEN (1 << 20)
void
k7_cpufixup(unsigned long ram_kilobytes)
void k7_cpufixup(struct mem_range *mem)
{
unsigned long lo = 0, hi = 0, i;
unsigned long ram_megabytes = ram_kilobytes * 1024;
unsigned long ram_megabytes;
/* For now no Athlon board has significant holes in it's
* address space so just find the last memory region
* and compute the end of memory from that.
*/
for(i = 0; mem[i].sizek; i++)
;
if (i == 0)
return;
ram_megabytes = (mem[i-1].basek + mem[i-1].sizek) *1024;
// 8 MB alignment please
ram_megabytes += 0x7fffff;

View file

@ -17,7 +17,7 @@ struct mem_range *sizeram(void)
mem[1].basek = 1024;
mem[1].sizek = size - mem[1].basek;
mem[2].basek = 0;
mem[2].sizke = 0;
mem[2].sizek = 0;
return &mem;
}