Lines Matching refs:index

202 _update_all_pgdirs(int index, page_root_entry e)
210 entry->arch_data->rtdir_virt[index] = e;
228 int32 index;
232 index = VADDR_TO_PRENT(va);
233 TRACE(("%s: pr[%d].type %d\n", __FUNCTION__, index, pr[index].type));
234 if (pr && pr[index].type == DT_ROOT) {
235 pa = PRE_TO_TA(pr[index]);
240 index = VADDR_TO_PDENT(va);
241 TRACE(("%s: pd[%d].type %d\n", __FUNCTION__, index,
242 pd?(pd[index].type):-1));
243 if (pd && pd[index].type == DT_DIR) {
244 pa = PDE_TO_TA(pd[index]);
247 index = VADDR_TO_PTENT(va);
248 TRACE(("%s: pt[%d].type %d\n", __FUNCTION__, index,
249 pt?(pt[index].type):-1));
250 if (pt && pt[index].type == DT_INDIRECT) {
252 pa = PIE_TO_TA(pi[index]);
254 index = 0; // single descriptor
257 if (pt && pt[index].type == DT_PAGE) {
258 *_physicalAddress = PTE_TO_PA(pt[index]);
530 dprintf("index is %d\n", va / B_PAGE_SIZE / 1024);
653 int index;
664 index = VADDR_TO_PRENT(start);
665 if (pr[index].type != DT_ROOT) {
672 status = get_physical_page_tmap_internal(PRE_TO_PA(pr[index]),
677 pd += (index % NUM_DIRTBL_PER_PAGE) * NUM_DIRENT_PER_TBL;
679 index = VADDR_TO_PDENT(start);
680 if (pd[index].type != DT_DIR) {
688 status = get_physical_page_tmap_internal(PDE_TO_PA(pd[index]),
693 pt += (index % NUM_PAGETBL_PER_PAGE) * NUM_PAGEENT_PER_TBL;
695 for (index = VADDR_TO_PTENT(start);
696 (index < NUM_PAGEENT_PER_TBL) && (start < end);
697 index++, start += B_PAGE_SIZE) {
698 if (pt[index].type != DT_PAGE && pt[index].type != DT_INDIRECT) {
705 pt[index].type = DT_INVALID;
730 int32 index;
736 index = VADDR_TO_PRENT(va);
737 if (pr && pr[index].type == DT_ROOT) {
738 put_page_table_entry_in_pgtable(&sQueryDesc, PRE_TO_TA(pr[index]), B_KERNEL_READ_AREA, false);
742 index = VADDR_TO_PDENT(va);
743 if (pd && pd[index].type == DT_DIR) {
744 put_page_table_entry_in_pgtable(&sQueryDesc, PDE_TO_TA(pd[index]), B_KERNEL_READ_AREA, false);
748 index = VADDR_TO_PTENT(va);
749 if (pt && pt[index].type == DT_INDIRECT) {
751 put_page_table_entry_in_pgtable(&sQueryDesc, PIE_TO_TA(pi[index]), B_KERNEL_READ_AREA, false);
754 index = 0; // single descriptor
757 if (pt /*&& pt[index].type == DT_PAGE*/) {
758 *_physical = PTE_TO_PA(pt[index]);
761 *_flags |= ((pt[index].write_protect ? 0 : B_KERNEL_WRITE_AREA) | B_KERNEL_READ_AREA)
762 | (pt[index].dirty ? PAGE_MODIFIED : 0)
763 | (pt[index].accessed ? PAGE_ACCESSED : 0)
764 | ((pt[index].type == DT_PAGE) ? PAGE_PRESENT : 0);
786 int32 index;
792 index = VADDR_TO_PRENT(va);
793 if (pr[index].type != DT_ROOT) {
799 status = get_physical_page_tmap_internal(PRE_TO_PA(pr[index]),
804 pd += (index % NUM_DIRTBL_PER_PAGE) * NUM_DIRENT_PER_TBL;
807 index = VADDR_TO_PDENT(va);
808 if (pd[index].type != DT_DIR) {
815 status = get_physical_page_tmap_internal(PDE_TO_PA(pd[index]),
820 pt += (index % NUM_PAGETBL_PER_PAGE) * NUM_PAGEENT_PER_TBL;
822 index = VADDR_TO_PTENT(va);
825 if (pt[index].type == DT_INDIRECT) {
829 status = get_physical_page_tmap_internal(PIE_TO_PA(pi[index]),
834 pt += PIE_TO_PO(pi[index]) / sizeof(page_table_entry);
839 *_physical = PTE_TO_PA(pt[index]);
842 if (!pt[index].supervisor)
843 *_flags |= (pt[index].write_protect ? 0 : B_WRITE_AREA) | B_READ_AREA;
845 *_flags |= (pt[index].write_protect ? 0 : B_KERNEL_WRITE_AREA)
847 | (pt[index].dirty ? PAGE_MODIFIED : 0)
848 | (pt[index].accessed ? PAGE_ACCESSED : 0)
849 | ((pt[index].type == DT_PAGE) ? PAGE_PRESENT : 0);
875 int index;
886 index = VADDR_TO_PRENT(start);
887 if (pr[index].type != DT_ROOT) {
894 status = get_physical_page_tmap_internal(PRE_TO_PA(pr[index]),
899 pd += (index % NUM_DIRTBL_PER_PAGE) * NUM_DIRENT_PER_TBL;
901 index = VADDR_TO_PDENT(start);
902 if (pd[index].type != DT_DIR) {
910 status = get_physical_page_tmap_internal(PDE_TO_PA(pd[index]),
915 pt += (index % NUM_PAGETBL_PER_PAGE) * NUM_PAGEENT_PER_TBL;
917 for (index = VADDR_TO_PTENT(start);
918 (index < NUM_PAGEENT_PER_TBL) && (start < end);
919 index++, start += B_PAGE_SIZE) {
921 if (pt[index].type != DT_PAGE /*&& pt[index].type != DT_INDIRECT*/) {
928 pt[index].supervisor = (attributes & B_USER_PROTECTION) == 0;
930 pt[index].write_protect = (attributes & B_WRITE_AREA) == 0;
932 pt[index].write_protect = (attributes & B_KERNEL_WRITE_AREA) == 0;
956 int index;
959 index = VADDR_TO_PRENT(va);
960 if (pr[index].type != DT_ROOT) {
966 status = get_physical_page_tmap_internal(PRE_TO_PA(pr[index]),
971 pd += (index % NUM_DIRTBL_PER_PAGE) * NUM_DIRENT_PER_TBL;
974 index = VADDR_TO_PDENT(va);
975 if (pd[index].type != DT_DIR) {
982 status = get_physical_page_tmap_internal(PDE_TO_PA(pd[index]),
987 pt += (index % NUM_PAGETBL_PER_PAGE) * NUM_PAGEENT_PER_TBL;
989 index = VADDR_TO_PTENT(va);
992 if (pt[index].type == DT_INDIRECT) {
996 status = get_physical_page_tmap_internal(PIE_TO_PA(pi[index]),
1001 pt += PIE_TO_PO(pi[index]) / sizeof(page_table_entry);
1008 pt[index].dirty = 0;
1012 pt[index].accessed = 0;
1292 int index;
1301 index = VADDR_TO_PRENT(sIOSpaceBase) + i / NUM_DIRENT_PER_TBL;
1302 pd = (page_directory_entry *)PRE_TO_TA(pr[index]);
1377 int32 index;
1381 index = VADDR_TO_PRENT((addr_t)&sQueryDesc);
1382 physicalPageDir = PRE_TO_PA(sKernelVirtualPageRoot[index]);
1387 index = VADDR_TO_PDENT((addr_t)&sQueryDesc);
1388 physicalPageTable = PDE_TO_PA(pageDirEntry[index]);
1393 index = VADDR_TO_PTENT((addr_t)&sQueryDesc);
1396 physicalIndirectDesc = PTE_TO_PA(pageTableEntry[index]);
1407 index = VADDR_TO_PRENT(queryPage);
1408 physicalPageDir = PRE_TO_PA(sKernelVirtualPageRoot[index]);
1413 index = VADDR_TO_PDENT(queryPage);
1414 physicalPageTable = PDE_TO_PA(pageDirEntry[index]);
1419 index = VADDR_TO_PTENT(queryPage);
1421 put_page_indirect_entry_in_pgtable(&pageTableEntry[index], physicalIndirectDesc,
1452 uint32 index;
1459 index = VADDR_TO_PRENT(va);
1460 if (pr[index].type != DT_ROOT) {
1461 unsigned aindex = index & ~(NUM_DIRTBL_PER_PAGE-1); /* aligned */
1462 TRACE(("missing page root entry %d ai %d\n", index, aindex));
1481 pd = (page_directory_entry *)PRE_TO_TA(pr[index]);
1483 index = VADDR_TO_PDENT(va);
1484 if (pd[index].type != DT_DIR) {
1485 unsigned aindex = index & ~(NUM_PAGETBL_PER_PAGE-1); /* aligned */
1486 TRACE(("missing page dir entry %d ai %d\n", index, aindex));
1504 pt = (page_table_entry *)PDE_TO_TA(pd[index]);
1506 index = VADDR_TO_PTENT(va);
1507 put_page_table_entry_in_pgtable(&pt[index], pa, attributes,