Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/include/vmparam.h
Show First 20 Lines • Show All 233 Lines • ▼ Show 20 Lines | |||||
#define VM_MIN_ADDRESS (0) | #define VM_MIN_ADDRESS (0) | ||||
/* | /* | ||||
* XXX Allowing dmaplimit == 0 is a temporary workaround for vt(4) efifb's | * XXX Allowing dmaplimit == 0 is a temporary workaround for vt(4) efifb's | ||||
* early use of PHYS_TO_DMAP before the mapping is actually setup. This works | * early use of PHYS_TO_DMAP before the mapping is actually setup. This works | ||||
* because the result is not actually accessed until later, but the early | * because the result is not actually accessed until later, but the early | ||||
* vt fb startup needs to be reworked. | * vt fb startup needs to be reworked. | ||||
*/ | */ | ||||
#define PHYS_IN_DMAP(pa) (dmaplimit == 0 || (pa) < dmaplimit) | |||||
#define VIRT_IN_DMAP(va) ((va) >= DMAP_MIN_ADDRESS && \ | |||||
(va) < (DMAP_MIN_ADDRESS + dmaplimit)) | |||||
#define PMAP_HAS_DMAP 1 | #define PMAP_HAS_DMAP 1 | ||||
#define PHYS_TO_DMAP(x) ({ \ | #define PHYS_TO_DMAP(x) ({ \ | ||||
KASSERT(dmaplimit == 0 || (x) < dmaplimit, \ | KASSERT(PHYS_IN_DMAP(x), \ | ||||
("physical address %#jx not covered by the DMAP", \ | ("physical address %#jx not covered by the DMAP", \ | ||||
(uintmax_t)x)); \ | (uintmax_t)x)); \ | ||||
(x) | DMAP_MIN_ADDRESS; }) | (x) | DMAP_MIN_ADDRESS; }) | ||||
#define DMAP_TO_PHYS(x) ({ \ | #define DMAP_TO_PHYS(x) ({ \ | ||||
KASSERT((x) < (DMAP_MIN_ADDRESS + dmaplimit) && \ | KASSERT(VIRT_IN_DMAP(x), \ | ||||
(x) >= DMAP_MIN_ADDRESS, \ | |||||
("virtual address %#jx not covered by the DMAP", \ | ("virtual address %#jx not covered by the DMAP", \ | ||||
(uintmax_t)x)); \ | (uintmax_t)x)); \ | ||||
(x) & ~DMAP_MIN_ADDRESS; }) | (x) & ~DMAP_MIN_ADDRESS; }) | ||||
/* | /* | ||||
* amd64 maps the page array into KVA so that it can be more easily | * amd64 maps the page array into KVA so that it can be more easily | ||||
* allocated on the correct memory domains. | * allocated on the correct memory domains. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |