diff options
author | Nathan Whitehorn <nwhitehorn@FreeBSD.org> | 2018-01-19 17:46:31 +0000 |
---|---|---|
committer | Nathan Whitehorn <nwhitehorn@FreeBSD.org> | 2018-01-19 17:46:31 +0000 |
commit | 9a8196ce190e6a13ae50849b3384496e7aa57b0c (patch) | |
tree | 37d438ae0cb7467f2554251b0722642b637a7008 /sys/amd64/include | |
parent | b3327f62f0cdabe91d36959001a065a1c3eb3d85 (diff) | |
download | src-9a8196ce190e6a13ae50849b3384496e7aa57b0c.tar.gz src-9a8196ce190e6a13ae50849b3384496e7aa57b0c.zip |
Remove SFBUF_OPTIONAL_DIRECT_MAP and such hacks, replacing them across the
kernel by PHYS_TO_DMAP() as previously present on amd64, arm64, riscv, and
powerpc64. This introduces a new MI macro (PMAP_HAS_DMAP) that can be
evaluated at runtime to determine if the architecture has a direct map;
if it does not (or does) unconditionally and PMAP_HAS_DMAP is either 0 or
1, the compiler can remove the conditional logic.
As part of this, implement PHYS_TO_DMAP() on sparc64 and mips64, which had
similar things but spelled differently. 32-bit MIPS has a partial direct-map
that maps poorly to this concept and is unchanged.
Reviewed by: kib
Suggestions from: marius, alc, kib
Runtime tested on: amd64, powerpc64, powerpc, mips64
Notes
Notes:
svn path=/head/; revision=328168
Diffstat (limited to 'sys/amd64/include')
-rw-r--r-- | sys/amd64/include/vmparam.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/amd64/include/vmparam.h b/sys/amd64/include/vmparam.h index 6d63201c6581..bb8c3221eb6f 100644 --- a/sys/amd64/include/vmparam.h +++ b/sys/amd64/include/vmparam.h @@ -190,6 +190,7 @@ * because the result is not actually accessed until later, but the early * vt fb startup needs to be reworked. */ +#define PMAP_HAS_DMAP 1 #define PHYS_TO_DMAP(x) ({ \ KASSERT(dmaplimit == 0 || (x) < dmaplimit, \ ("physical address %#jx not covered by the DMAP", \ |