From 99db2ac14d503cefeaff7b3555e3692dea901fd4 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 22 Nov 2009 20:40:10 +0100 Subject: Replace phys_mem_va with VM_MIN_KERNEL_ADDRESS * i386/i386/vm_param.h (phystokv): Use VM_MIN_KERNEL_ADDRESS instead of phys_mem_va. (_kvtophys): New macro. * i386/i386at/model_dep.c (phys_mem_va): Remove variable. --- i386/i386/vm_param.h | 9 ++++++--- i386/i386at/model_dep.c | 6 ------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/i386/i386/vm_param.h b/i386/i386/vm_param.h index 1b79dda..57a2166 100644 --- a/i386/i386/vm_param.h +++ b/i386/i386/vm_param.h @@ -50,10 +50,13 @@ /* * Physical memory is direct-mapped to virtual memory - * starting at virtual address phys_mem_va. + * starting at virtual address VM_MIN_KERNEL_ADDRESS. */ -extern vm_offset_t phys_mem_va; -#define phystokv(a) ((vm_offset_t)(a) + phys_mem_va) +#define phystokv(a) ((vm_offset_t)(a) + VM_MIN_KERNEL_ADDRESS) +/* + * This can not be used with virtual mappings, but can be used during bootstrap + */ +#define _kvtophys(a) ((vm_offset_t)(a) - VM_MIN_KERNEL_ADDRESS) /* * Kernel virtual memory is actually at 0xc0000000 in linear addresses. diff --git a/i386/i386at/model_dep.c b/i386/i386at/model_dep.c index 7dfeb1c..1dcb8f6 100644 --- a/i386/i386at/model_dep.c +++ b/i386/i386at/model_dep.c @@ -80,9 +80,6 @@ static vm_offset_t kern_sym_start, kern_sym_end; vm_offset_t phys_first_addr = 0; vm_offset_t phys_last_addr; -/* Virtual address of physical memory, for the kvtophys/phystokv macros. */ -vm_offset_t phys_mem_va; - /* A copy of the multiboot info structure passed by the boot loader. */ struct multiboot_info boot_info; @@ -377,9 +374,6 @@ void c_boot_entry(vm_offset_t bi) boot_info = *(struct multiboot_info*)phystokv(bi); int cpu_type; - /* XXX we currently assume phys_mem_va is always 0 here - - if it isn't, we must tweak the pointers in the boot_info. */ - /* Before we do _anything_ else, print the hello message. If there are no initialized console devices yet, it will be stored and printed at the first opportunity. */ -- cgit v1.2.3