Fix allocation of 128MB extended memory region, broken since some careless

modifications in December.

MFC after:	3 days
This commit is contained in:
Nathan Whitehorn 2014-07-20 00:08:50 +00:00
parent 3ddad7da27
commit 31411fea11
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=268898

View file

@ -110,14 +110,6 @@ ps3_probe(platform_t plat)
static int
ps3_attach(platform_t plat)
{
uint64_t junk;
int count;
struct mem_region avail_regions[2];
ps3_mem_regions(plat, NULL, NULL, avail_regions, &count);
lv1_allocate_memory(avail_regions[1].mr_size, 24 /* 16 MB pages */,
0, 0x04 /* any address */, &avail_regions[1].mr_start, &junk);
pmap_mmu_install("mmu_ps3", BUS_PROBE_SPECIFIC);
cpu_idle_hook = ps3_cpu_idle;
@ -152,6 +144,11 @@ ps3_mem_regions(platform_t plat, struct mem_region *phys, int *physsz,
/* Convert to maximum amount we can allocate in 16 MB pages */
avail_regions[1].mr_size -= avail_regions[0].mr_size;
avail_regions[1].mr_size -= avail_regions[1].mr_size % (16*1024*1024);
/* Allocate extended memory region */
lv1_allocate_memory(avail_regions[1].mr_size, 24 /* 16 MB pages */,
0, 0x04 /* any address */, &avail_regions[1].mr_start, &junk);
*availsz = 2;
if (phys != NULL) {