summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2003-03-25 00:07:06 +0000
committerjake <jake@FreeBSD.org>2003-03-25 00:07:06 +0000
commit783ae539c3e44d35afb500b405ff986b3033bc4a (patch)
tree553401a4d58eb98b1e208a82c3ba2c32b848a225 /sys/amd64/include
parent0079e3d786d0b0a2647229d3498a426a039a5016 (diff)
downloadFreeBSD-src-783ae539c3e44d35afb500b405ff986b3033bc4a.zip
FreeBSD-src-783ae539c3e44d35afb500b405ff986b3033bc4a.tar.gz
- Add vm_paddr_t, a physical address type. This is required for systems
where physical addresses larger than virtual addresses, such as i386s with PAE. - Use this to represent physical addresses in the MI vm system and in the i386 pmap code. This also changes the paddr parameter to d_mmap_t. - Fix printf formats to handle physical addresses >4G in the i386 memory detection code, and due to kvtop returning vm_paddr_t instead of u_long. Note that this is a name change only; vm_paddr_t is still the same as vm_offset_t on all currently supported platforms. Sponsored by: DARPA, Network Associates Laboratories Discussed with: re, phk (cdevsw change)
Diffstat (limited to 'sys/amd64/include')
-rw-r--r--sys/amd64/include/_types.h1
-rw-r--r--sys/amd64/include/md_var.h2
-rw-r--r--sys/amd64/include/mptable.h2
-rw-r--r--sys/amd64/include/pmap.h19
4 files changed, 13 insertions, 11 deletions
diff --git a/sys/amd64/include/_types.h b/sys/amd64/include/_types.h
index 155f55f..69b6a0d 100644
--- a/sys/amd64/include/_types.h
+++ b/sys/amd64/include/_types.h
@@ -87,6 +87,7 @@ typedef __uint64_t __uint_least64_t;
typedef __uint64_t __u_register_t;
typedef __uint64_t __vm_offset_t;
typedef __int64_t __vm_ooffset_t;
+typedef __uint64_t __vm_paddr_t;
typedef __uint64_t __vm_pindex_t;
typedef __uint64_t __vm_size_t;
diff --git a/sys/amd64/include/md_var.h b/sys/amd64/include/md_var.h
index 5f52c259..9143d19 100644
--- a/sys/amd64/include/md_var.h
+++ b/sys/amd64/include/md_var.h
@@ -96,7 +96,7 @@ int i586_copyout(const void *kaddr, void *udaddr, size_t len);
void i686_pagezero(void *addr);
void init_AMD_Elan_sc520(void);
int is_physical_memory(vm_offset_t addr);
-u_long kvtop(void *addr);
+vm_paddr_t kvtop(void *addr);
void setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int selec);
void swi_vm(void *);
int user_dbreg_trap(void);
diff --git a/sys/amd64/include/mptable.h b/sys/amd64/include/mptable.h
index edd83e3..12d7578 100644
--- a/sys/amd64/include/mptable.h
+++ b/sys/amd64/include/mptable.h
@@ -2576,7 +2576,7 @@ ap_init(void)
if (PCPU_GET(cpuid) != apic_id) {
printf("SMP: cpuid = %d\n", PCPU_GET(cpuid));
printf("SMP: apic_id = %d\n", apic_id);
- printf("PTD[MPPTDI] = %p\n", (void *)PTD[MPPTDI]);
+ printf("PTD[MPPTDI] = %#jx\n", (uintmax_t)PTD[MPPTDI]);
panic("cpuid mismatch! boom!!");
}
diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h
index 92493e1..8688b46 100644
--- a/sys/amd64/include/pmap.h
+++ b/sys/amd64/include/pmap.h
@@ -70,7 +70,7 @@
/* Our various interpretations of the above */
#define PG_W PG_AVAIL1 /* "Wired" pseudoflag */
#define PG_MANAGED PG_AVAIL2
-#define PG_FRAME (~PAGE_MASK)
+#define PG_FRAME (~((vm_paddr_t)PAGE_MASK))
#define PG_PROT (PG_RW|PG_U) /* all protection bits . */
#define PG_N (PG_NC_PWT|PG_NC_PCD) /* Non-cacheable */
@@ -168,10 +168,11 @@ extern pd_entry_t *IdlePTD; /* physical address of "Idle" state directory */
* Extract the physical page address associated
* kernel virtual address.
*/
-static __inline vm_offset_t
+static __inline vm_paddr_t
pmap_kextract(vm_offset_t va)
{
- vm_offset_t pa;
+ vm_paddr_t pa;
+
if ((pa = (vm_offset_t) PTD[va >> PDRSHIFT]) & PG_PS) {
pa = (pa & ~(NBPDR - 1)) | (va & (NBPDR - 1));
} else {
@@ -237,19 +238,19 @@ extern struct ppro_vmtrr PPro_vmtrr[NPPROVMTRR];
extern caddr_t CADDR1;
extern pt_entry_t *CMAP1;
-extern vm_offset_t avail_end;
-extern vm_offset_t avail_start;
+extern vm_paddr_t avail_end;
+extern vm_paddr_t avail_start;
extern vm_offset_t clean_eva;
extern vm_offset_t clean_sva;
-extern vm_offset_t phys_avail[];
+extern vm_paddr_t phys_avail[];
extern char *ptvmmap; /* poor name! */
extern vm_offset_t virtual_avail;
extern vm_offset_t virtual_end;
-void pmap_bootstrap(vm_offset_t, vm_offset_t);
-void pmap_kenter(vm_offset_t va, vm_offset_t pa);
+void pmap_bootstrap(vm_paddr_t, vm_paddr_t);
+void pmap_kenter(vm_offset_t va, vm_paddr_t pa);
void pmap_kremove(vm_offset_t);
-void *pmap_mapdev(vm_offset_t, vm_size_t);
+void *pmap_mapdev(vm_paddr_t, vm_size_t);
void pmap_unmapdev(vm_offset_t, vm_size_t);
pt_entry_t *pmap_pte(pmap_t, vm_offset_t) __pure2;
void pmap_set_opt(void);
OpenPOWER on IntegriCloud