Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/include/pmap.h
Show First 20 Lines • Show All 100 Lines • ▼ Show 20 Lines | typedef struct pv_entry { | ||||
vm_offset_t pv_va; /* virtual address for mapping */ | vm_offset_t pv_va; /* virtual address for mapping */ | ||||
TAILQ_ENTRY(pv_entry) pv_next; | TAILQ_ENTRY(pv_entry) pv_next; | ||||
} *pv_entry_t; | } *pv_entry_t; | ||||
/* | /* | ||||
* pv_entries are allocated in chunks per-process. This avoids the | * pv_entries are allocated in chunks per-process. This avoids the | ||||
* need to track per-pmap assignments. | * need to track per-pmap assignments. | ||||
*/ | */ | ||||
#if PAGE_SIZE == PAGE_SIZE_4K | |||||
#define _NPCM 3 | #define _NPCM 3 | ||||
#define _NPCPV 168 | #define _NPCPV 168 | ||||
#define _NPAD 0 | |||||
#elif PAGE_SIZE == PAGE_SIZE_16K | |||||
#define _NPCM 11 | |||||
#define _NPCPV 677 | |||||
#define _NPAD 1 | |||||
#else | |||||
#error Unsupported page size | |||||
#endif | |||||
#define PV_CHUNK_HEADER \ | #define PV_CHUNK_HEADER \ | ||||
pmap_t pc_pmap; \ | pmap_t pc_pmap; \ | ||||
TAILQ_ENTRY(pv_chunk) pc_list; \ | TAILQ_ENTRY(pv_chunk) pc_list; \ | ||||
uint64_t pc_map[_NPCM]; /* bitmap; 1 = free */ \ | uint64_t pc_map[_NPCM]; /* bitmap; 1 = free */ \ | ||||
TAILQ_ENTRY(pv_chunk) pc_lru; | TAILQ_ENTRY(pv_chunk) pc_lru; | ||||
struct pv_chunk_header { | struct pv_chunk_header { | ||||
PV_CHUNK_HEADER | PV_CHUNK_HEADER | ||||
}; | }; | ||||
struct pv_chunk { | struct pv_chunk { | ||||
PV_CHUNK_HEADER | PV_CHUNK_HEADER | ||||
struct pv_entry pc_pventry[_NPCPV]; | struct pv_entry pc_pventry[_NPCPV]; | ||||
uint64_t pc_pad[_NPAD]; | |||||
}; | }; | ||||
markj: Maybe have a field `uint64_t pv_pad[_NPAD]` and define `_NPAD` to be 0 and 1 for the 4KB and… | |||||
struct thread; | struct thread; | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
extern struct pmap kernel_pmap_store; | extern struct pmap kernel_pmap_store; | ||||
#define kernel_pmap (&kernel_pmap_store) | #define kernel_pmap (&kernel_pmap_store) | ||||
#define pmap_kernel() kernel_pmap | #define pmap_kernel() kernel_pmap | ||||
#define PMAP_ASSERT_LOCKED(pmap) \ | #define PMAP_ASSERT_LOCKED(pmap) \ | ||||
▲ Show 20 Lines • Show All 78 Lines • Show Last 20 Lines |
Maybe have a field uint64_t pv_pad[_NPAD] and define _NPAD to be 0 and 1 for the 4KB and 16KB cases, respectively.