Author: mcayland Date: Sun Jan 2 01:06:03 2011 New Revision: 1001 URL: http://tracker.coreboot.org/trac/openbios/changeset/1001
Log: Switch SPARC32 page tables over to use OFMEM's ofmem_posix_memalign() rather than its internal posix_memalign() function.
This requires a corresponding increase in the memory allocated to OFMEM in order to store the page tables.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@siriusit.co.uk Tested-by: Blue Swirl blauwirbel@gmail.com Reviewed-by: Blue Swirl blauwirbel@gmail.com
Modified: trunk/openbios-devel/arch/sparc32/lib.c trunk/openbios-devel/arch/sparc32/ofmem_sparc32.c
Modified: trunk/openbios-devel/arch/sparc32/lib.c ============================================================================== --- trunk/openbios-devel/arch/sparc32/lib.c Sun Jan 2 01:05:56 2011 (r1000) +++ trunk/openbios-devel/arch/sparc32/lib.c Sun Jan 2 01:06:03 2011 (r1001) @@ -273,7 +273,7 @@ pte = l1[(va >> SRMMU_PGDIR_SHIFT) & (SRMMU_PTRS_PER_PGD - 1)]; if ((pte & SRMMU_ET_MASK) == SRMMU_ET_INVALID) { if (alloc) { - ret = posix_memalign(&p, SRMMU_PTRS_PER_PMD * sizeof(int), + ret = ofmem_posix_memalign(&p, SRMMU_PTRS_PER_PMD * sizeof(int), SRMMU_PTRS_PER_PMD * sizeof(int)); if (ret != 0) return ret; @@ -290,7 +290,7 @@ pte = *(uint32_t *)pa2va(pa); if ((pte & SRMMU_ET_MASK) == SRMMU_ET_INVALID) { if (alloc) { - ret = posix_memalign(&p, SRMMU_PTRS_PER_PTE * sizeof(void *), + ret = ofmem_posix_memalign(&p, SRMMU_PTRS_PER_PTE * sizeof(void *), SRMMU_PTRS_PER_PTE * sizeof(void *)); if (ret != 0) return ret; @@ -602,9 +602,9 @@ mem_init(&cmem, (char *) &_vmem, (char *)&_evmem); mem_init(&cio, (char *)&_end, (char *)&_iomem);
- posix_memalign((void *)&context_table, NCTX_SWIFT * sizeof(int), + ofmem_posix_memalign((void *)&context_table, NCTX_SWIFT * sizeof(int), NCTX_SWIFT * sizeof(int)); - posix_memalign((void *)&l1, 256 * sizeof(int), 256 * sizeof(int)); + ofmem_posix_memalign((void *)&l1, 256 * sizeof(int), 256 * sizeof(int));
context_table[0] = (((unsigned long)va2pa((unsigned long)l1)) >> 4) | SRMMU_ET_PTD;
Modified: trunk/openbios-devel/arch/sparc32/ofmem_sparc32.c ============================================================================== --- trunk/openbios-devel/arch/sparc32/ofmem_sparc32.c Sun Jan 2 01:05:56 2011 (r1000) +++ trunk/openbios-devel/arch/sparc32/ofmem_sparc32.c Sun Jan 2 01:06:03 2011 (r1001) @@ -21,8 +21,7 @@
#define OF_MALLOC_BASE ((char*)OFMEM + ALIGN_SIZE(sizeof(ofmem_t), 8))
-/* Temporarily very small */ -#define MEMSIZE (1 * 1024) +#define MEMSIZE (256 * 1024) static union { char memory[MEMSIZE]; ofmem_t ofmem;