Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/amd64/pmap.c
Show First 20 Lines • Show All 1,462 Lines • ▼ Show 20 Lines | case PT_EPT: | ||||
break; | break; | ||||
default: | default: | ||||
panic("pmap_switch_pat_bits: bad pm_type %d", pmap->pm_type); | panic("pmap_switch_pat_bits: bad pm_type %d", pmap->pm_type); | ||||
} | } | ||||
return (entry); | return (entry); | ||||
} | } | ||||
boolean_t | |||||
pmap_is_valid_memattr(pmap_t pmap __unused, vm_memattr_t mode) | |||||
{ | |||||
return (mode >= 0 && mode < PAT_INDEX_SIZE && | |||||
pat_index[(int)mode] >= 0); | |||||
} | |||||
/* | /* | ||||
* Determine the appropriate bits to set in a PTE or PDE for a specified | * Determine the appropriate bits to set in a PTE or PDE for a specified | ||||
* caching mode. | * caching mode. | ||||
*/ | */ | ||||
int | int | ||||
pmap_cache_bits(pmap_t pmap, int mode, boolean_t is_pde) | pmap_cache_bits(pmap_t pmap, int mode, boolean_t is_pde) | ||||
{ | { | ||||
int cache_bits, pat_flag, pat_idx; | int cache_bits, pat_flag, pat_idx; | ||||
if (mode < 0 || mode >= PAT_INDEX_SIZE || pat_index[mode] < 0) | if (!pmap_is_valid_memattr(pmap, mode)) | ||||
imp: Like this change. I'd be tempted to commit it separately | |||||
Not Done Inline ActionsThis change requires more work to implement pmap_is_valid_memattr() on all arches. Until the pci bar mapping patch is finished, it is premature to spend time on it. After that, it will be a separate commit, certainly. kib: This change requires more work to implement pmap_is_valid_memattr() on all arches. Until the… | |||||
panic("Unknown caching mode %d\n", mode); | panic("Unknown caching mode %d\n", mode); | ||||
switch (pmap->pm_type) { | switch (pmap->pm_type) { | ||||
case PT_X86: | case PT_X86: | ||||
case PT_RVI: | case PT_RVI: | ||||
/* The PAT bit is different for PTE's and PDE's. */ | /* The PAT bit is different for PTE's and PDE's. */ | ||||
pat_flag = is_pde ? X86_PG_PDE_PAT : X86_PG_PTE_PAT; | pat_flag = is_pde ? X86_PG_PDE_PAT : X86_PG_PTE_PAT; | ||||
▲ Show 20 Lines • Show All 6,670 Lines • Show Last 20 Lines |
Like this change. I'd be tempted to commit it separately