diff options
author | marcel <marcel@FreeBSD.org> | 2011-03-16 03:53:18 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2011-03-16 03:53:18 +0000 |
commit | 8e0b0a22844d3d1383011c024b1eb1a3b2ee51a8 (patch) | |
tree | 55215f77e655236a449e347f8f98d98dfb718eed /sys/boot/ia64/ski/skimd.c | |
parent | e79931d6175d1a1999786ee313a144784de8d6a9 (diff) | |
download | FreeBSD-src-8e0b0a22844d3d1383011c024b1eb1a3b2ee51a8.zip FreeBSD-src-8e0b0a22844d3d1383011c024b1eb1a3b2ee51a8.tar.gz |
MFaltix:
Add support for Pre-Boot Virtual Memory (PBVM) to the loader.
PBVM allows us to link the kernel at a fixed virtual address without
having to make any assumptions about the physical memory layout. On
the SGI Altix 350 for example, there's no usuable physical memory
below 192GB. Also, the PBVM allows us to control better where we're
going to physically load the kernel and its modules so that we can
make sure we load the kernel in memory that's close to the BSP.
The PBVM is managed by a simple page table. The minimum size of the
page table is 4KB (EFI page size) and the maximum is currently set
to 1MB. A page in the PBVM is 64KB, as that's the maximum alignment
one can specify in a linker script. The bottom line is that PBVM is
between 64KB and 8GB in size.
The loader maps the PBVM page table at a fixed virtual address and
using a single translations. The PBVM itself is also mapped using a
single translation for a maximum of 32MB.
While here, increase the heap in the EFI loader from 512KB to 2MB
and set the stage for supporting relocatable modules.
Diffstat (limited to 'sys/boot/ia64/ski/skimd.c')
-rw-r--r-- | sys/boot/ia64/ski/skimd.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/sys/boot/ia64/ski/skimd.c b/sys/boot/ia64/ski/skimd.c index bec2ec0..8db358c 100644 --- a/sys/boot/ia64/ski/skimd.c +++ b/sys/boot/ia64/ski/skimd.c @@ -33,24 +33,31 @@ __FBSDID("$FreeBSD$"); #include "libski.h" -#define PHYS_START (4L*1024*1024*1024) -#define PHYS_SIZE (64L*1024*1024 - 4L*1024) - extern void acpi_stub_init(void); extern void efi_stub_init(struct bootinfo *); extern void sal_stub_init(void); -uint64_t -ldr_alloc(vm_offset_t va) +vm_paddr_t +ia64_platform_alloc(vm_offset_t va, vm_size_t sz __unused) { + vm_paddr_t pa; + + if (va == 0) + pa = 1024 * 1024; + else + pa = (va - IA64_PBVM_BASE) + (64 * 1024 * 1024); - if (va >= PHYS_SIZE) - return (0); - return (va + PHYS_START); + return (pa); +} + +void +ia64_platform_free(vm_offset_t va __unused, vm_paddr_t pa __unused, + vm_size_t sz __unused) +{ } int -ldr_bootinfo(struct bootinfo *bi, uint64_t *bi_addr) +ia64_platform_bootinfo(struct bootinfo *bi, struct bootinfo **res) { static struct bootinfo bootinfo; @@ -58,17 +65,16 @@ ldr_bootinfo(struct bootinfo *bi, uint64_t *bi_addr) sal_stub_init(); acpi_stub_init(); - *bi_addr = (uint64_t)(&bootinfo); - bootinfo = *bi; + *res = &bootinfo; return (0); } int -ldr_enter(const char *kernel) +ia64_platform_enter(const char *kernel) { while (*kernel == '/') kernel++; - ssc(0, (uint64_t)kernel, 0, 0, SSC_LOAD_SYMBOLS); + ssc(0, (uint64_t)kernel, 0, 0, SSC_LOAD_SYMBOLS); return (0); } |