summaryrefslogtreecommitdiffstats
path: root/sys/ia64/ia64/machdep.c
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2011-03-21 18:20:53 +0000
committermarcel <marcel@FreeBSD.org>2011-03-21 18:20:53 +0000
commitcd817c0d10fe079570be2b80756763c1190a1328 (patch)
tree82a9e831ac92cd717131bf3d3ec785953569e754 /sys/ia64/ia64/machdep.c
parent8a3060a4835ec28a0162adcbd29c5a00eca05115 (diff)
downloadFreeBSD-src-cd817c0d10fe079570be2b80756763c1190a1328.zip
FreeBSD-src-cd817c0d10fe079570be2b80756763c1190a1328.tar.gz
Fix switching to physical mode as part of calling into EFI runtime
services or PAL procedures. The new implementation is based on specific functions that are known to be called in certain scenarios only. This in particular fixes the PAL call to obtain information about translation registers. In general, the new implementation does not bank on virtual addresses being direct-mapped and will work when the kernel uses PBVM. When new scenarios need to be supported, new functions are added if the existing functions cannot be changed to handle the new scenario. If a single generic implementation is possible, it will become clear in due time. While here, change bootinfo to a pointer type in anticipation of future development.
Diffstat (limited to 'sys/ia64/ia64/machdep.c')
-rw-r--r--sys/ia64/ia64/machdep.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c
index 0941c6b..49a49bb 100644
--- a/sys/ia64/ia64/machdep.c
+++ b/sys/ia64/ia64/machdep.c
@@ -116,7 +116,7 @@ SYSCTL_UINT(_hw_freq, OID_AUTO, itc, CTLFLAG_RD, &itc_freq, 0,
int cold = 1;
u_int64_t pa_bootinfo;
-struct bootinfo bootinfo;
+struct bootinfo *bootinfo;
struct pcpu pcpu0;
@@ -684,11 +684,11 @@ ia64_init(void)
* pa_bootinfo is the physical address of the bootinfo block as
* passed to us by the loader and set in locore.s.
*/
- bootinfo = *(struct bootinfo *)(IA64_PHYS_TO_RR7(pa_bootinfo));
+ bootinfo = (struct bootinfo *)(IA64_PHYS_TO_RR7(pa_bootinfo));
- if (bootinfo.bi_magic != BOOTINFO_MAGIC || bootinfo.bi_version != 1) {
- bzero(&bootinfo, sizeof(bootinfo));
- bootinfo.bi_kernend = (vm_offset_t) round_page(_end);
+ if (bootinfo->bi_magic != BOOTINFO_MAGIC || bootinfo->bi_version != 1) {
+ bzero(bootinfo, sizeof(*bootinfo));
+ bootinfo->bi_kernend = (vm_offset_t)round_page(_end);
}
/*
@@ -708,20 +708,20 @@ ia64_init(void)
}
metadata_missing = 0;
- if (bootinfo.bi_modulep)
- preload_metadata = (caddr_t)bootinfo.bi_modulep;
+ if (bootinfo->bi_modulep)
+ preload_metadata = (caddr_t)bootinfo->bi_modulep;
else
metadata_missing = 1;
- if (envmode == 0 && bootinfo.bi_envp)
- kern_envp = (caddr_t)bootinfo.bi_envp;
+ if (envmode == 0 && bootinfo->bi_envp)
+ kern_envp = (caddr_t)bootinfo->bi_envp;
else
kern_envp = static_env;
/*
* Look at arguments passed to us and compute boothowto.
*/
- boothowto = bootinfo.bi_boothowto;
+ boothowto = bootinfo->bi_boothowto;
if (boothowto & RB_VERBOSE)
bootverbose = 1;
@@ -731,15 +731,15 @@ ia64_init(void)
*/
kernstart = trunc_page(kernel_text);
#ifdef DDB
- ksym_start = bootinfo.bi_symtab;
- ksym_end = bootinfo.bi_esymtab;
+ ksym_start = bootinfo->bi_symtab;
+ ksym_end = bootinfo->bi_esymtab;
kernend = (vm_offset_t)round_page(ksym_end);
#else
kernend = (vm_offset_t)round_page(_end);
#endif
/* But if the bootstrap tells us otherwise, believe it! */
- if (bootinfo.bi_kernend)
- kernend = round_page(bootinfo.bi_kernend);
+ if (bootinfo->bi_kernend)
+ kernend = round_page(bootinfo->bi_kernend);
/*
* Setup the PCPU data for the bootstrap processor. It is needed
@@ -775,7 +775,7 @@ ia64_init(void)
* Wire things up so we can call the firmware.
*/
map_pal_code();
- efi_boot_minimal(bootinfo.bi_systab);
+ efi_boot_minimal(bootinfo->bi_systab);
ia64_xiv_init();
ia64_sal_init();
calculate_frequencies();
@@ -784,8 +784,8 @@ ia64_init(void)
printf("WARNING: loader(8) metadata is missing!\n");
/* Get FPSWA interface */
- fpswa_iface = (bootinfo.bi_fpswa == 0) ? NULL :
- (struct fpswa_iface *)IA64_PHYS_TO_RR7(bootinfo.bi_fpswa);
+ fpswa_iface = (bootinfo->bi_fpswa == 0) ? NULL :
+ (struct fpswa_iface *)IA64_PHYS_TO_RR7(bootinfo->bi_fpswa);
/* Init basic tunables, including hz */
init_param1();
@@ -940,7 +940,7 @@ uint64_t
ia64_get_hcdp(void)
{
- return (bootinfo.bi_hcdp);
+ return (bootinfo->bi_hcdp);
}
void
OpenPOWER on IntegriCloud