Bug fix the handling of struct mem_range for the athlon
This commit is contained in:
parent
46fd6ab5e1
commit
b3b9071f43
2 changed files with 15 additions and 4 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue