MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sysctl_kmaps_match

Function sysctl_kmaps_match

freebsd/amd64/amd64/pmap.c:11215–11229  ·  view source on GitHub ↗

* Determine whether the attributes specified by a page table entry match those * being tracked by the current range. This is not quite as simple as a direct * flag comparison since some PAT modes have multiple representations. */

Source from the content-addressed store, hash-verified

11213 * flag comparison since some PAT modes have multiple representations.
11214 */
11215static bool
11216sysctl_kmaps_match(struct pmap_kernel_map_range *range, pt_entry_t attrs)
11217{
11218 pt_entry_t diff, mask;
11219
11220 mask = X86_PG_G | X86_PG_RW | X86_PG_U | X86_PG_PDE_CACHE | pg_nx;
11221 diff = (range->attrs ^ attrs) & mask;
11222 if (diff == 0)
11223 return (true);
11224 if ((diff & ~X86_PG_PDE_PAT) == 0 &&
11225 pmap_pat_index(kernel_pmap, range->attrs, true) ==
11226 pmap_pat_index(kernel_pmap, attrs, true))
11227 return (true);
11228 return (false);
11229}
11230
11231static void
11232sysctl_kmaps_reinit(struct pmap_kernel_map_range *range, vm_offset_t va,

Callers 1

sysctl_kmaps_checkFunction · 0.70

Calls 1

pmap_pat_indexFunction · 0.70

Tested by

no test coverage detected