aboutsummaryrefslogtreecommitdiff
path: root/sys/arm/arm/devmap.c
diff options
context:
space:
mode:
authorSvatopluk Kraus <skra@FreeBSD.org>2016-02-02 21:17:25 +0000
committerSvatopluk Kraus <skra@FreeBSD.org>2016-02-02 21:17:25 +0000
commit677ba8502b4a69e06ae9d708d7091e8240d41cfa (patch)
tree52663e069f164785f5474003259fc57930abe2b8 /sys/arm/arm/devmap.c
parentfb872bbc6857937e69506e18bc474a2f8e815117 (diff)
downloadsrc-677ba8502b4a69e06ae9d708d7091e8240d41cfa.tar.gz
src-677ba8502b4a69e06ae9d708d7091e8240d41cfa.zip
Use pmap_preboot_map_attr() directly in arm_devmap_bootstrap()
instead of hiding behind pmap_map_chunk(). It's not longer needed after old pmap-v6 code was removed. For compatibility with __ARM_ARCH < 6, define PTE_DEVICE in devmap.c file. Certainly, it would be nice if VM_MEMATTR_DEVICE could be used even for __ARM_ARCH < 6.
Notes
Notes: svn path=/head/; revision=295168
Diffstat (limited to 'sys/arm/arm/devmap.c')
-rw-r--r--sys/arm/arm/devmap.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/arm/arm/devmap.c b/sys/arm/arm/devmap.c
index 823210f90604..380e12941dc2 100644
--- a/sys/arm/arm/devmap.c
+++ b/sys/arm/arm/devmap.c
@@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$");
#include <vm/vm.h>
#include <vm/vm_extern.h>
#include <vm/pmap.h>
+#include <machine/acle-compat.h>
#include <machine/armreg.h>
#include <machine/devmap.h>
#include <machine/vmparam.h>
@@ -52,6 +53,9 @@ static boolean_t devmap_bootstrap_done = false;
#define PTE_DEVICE VM_MEMATTR_DEVICE
#elif defined(__arm__)
#define MAX_VADDR ARM_VECTORS_HIGH
+#if __ARM_ARCH >= 6
+#define PTE_DEVICE VM_MEMATTR_DEVICE
+#endif
#endif
/*
@@ -204,8 +208,13 @@ arm_devmap_bootstrap(vm_offset_t l1pt, const struct arm_devmap_entry *table)
for (pd = devmap_table; pd->pd_size != 0; ++pd) {
#if defined(__arm__)
+#if __ARM_ARCH >= 6
+ pmap_preboot_map_attr(pd->pd_pa, pd->pd_va, pd->pd_size,
+ pd->pd_prot, pd->pd_cache);
+#else
pmap_map_chunk(l1pt, pd->pd_va, pd->pd_pa, pd->pd_size,
- pd->pd_prot,pd->pd_cache);
+ pd->pd_prot, pd->pd_cache);
+#endif
#elif defined(__aarch64__)
pmap_kenter_device(pd->pd_va, pd->pd_size, pd->pd_pa);
#endif