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

Function pmap_pte

freebsd/arm64/arm64/pmap.c:552–592  ·  view source on GitHub ↗

* Returns the lowest valid pte block or table entry for a given virtual * address. If there are no valid entries return NULL and set the level to * the first invalid level. */

Source from the content-addressed store, hash-verified

550 * the first invalid level.
551 */
552static __inline pt_entry_t *
553pmap_pte(pmap_t pmap, vm_offset_t va, int *level)
554{
555 pd_entry_t *l1, *l2, desc;
556 pt_entry_t *l3;
557
558 l1 = pmap_l1(pmap, va);
559 if (l1 == NULL) {
560 *level = 0;
561 return (NULL);
562 }
563 desc = pmap_load(l1) & ATTR_DESCR_MASK;
564 if (desc == L1_BLOCK) {
565 *level = 1;
566 return (l1);
567 }
568
569 if (desc != L1_TABLE) {
570 *level = 1;
571 return (NULL);
572 }
573
574 l2 = pmap_l1_to_l2(l1, va);
575 desc = pmap_load(l2) & ATTR_DESCR_MASK;
576 if (desc == L2_BLOCK) {
577 *level = 2;
578 return (l2);
579 }
580
581 if (desc != L2_TABLE) {
582 *level = 2;
583 return (NULL);
584 }
585
586 *level = 3;
587 l3 = pmap_l2_to_l3(l2, va);
588 if ((pmap_load(l3) & ATTR_DESCR_MASK) != L3_PAGE)
589 return (NULL);
590
591 return (l3);
592}
593
594bool
595pmap_ps_enabled(pmap_t pmap __unused)

Callers 15

pmap_extractFunction · 0.70
pmap_extract_and_holdFunction · 0.70
pmap_kremoveFunction · 0.70
pmap_kremove_deviceFunction · 0.70
pmap_qremoveFunction · 0.70
pmap_remove_allFunction · 0.70
pmap_sremoveFunction · 0.70
pmap_page_wired_mappingsFunction · 0.70
pmap_page_test_mappingsFunction · 0.70
pmap_is_prefaultableFunction · 0.70
pmap_remove_writeFunction · 0.70
pmap_change_attr_lockedFunction · 0.70

Calls 3

pmap_l1Function · 0.85
pmap_l1_to_l2Function · 0.85
pmap_l2_to_l3Function · 0.85

Tested by

no test coverage detected