Print this page
9452 ptable_dcmd() needs a little cleanup

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/mdb/i86pc/modules/unix/i86mmu.c
          +++ new/usr/src/cmd/mdb/i86pc/modules/unix/i86mmu.c
↓ open down ↓ 827 lines elided ↑ open up ↑
 828  828  {
 829  829          struct hat *hatp;
 830  830          struct hat hat;
 831  831          htable_t *ht;
 832  832          htable_t htable;
 833  833          uintptr_t base;
 834  834          int h;
 835  835          int entry;
 836  836          uintptr_t pagesize;
 837  837          x86pte_t pte;
 838      -        x86pte_t buf;
 839  838          physaddr_t paddr;
 840  839          size_t len;
 841  840  
 842  841          /*
 843  842           * The hats are kept in a list with khat at the head.
 844  843           */
 845  844          for (hatp = khat; hatp != NULL; hatp = hat.hat_next) {
 846  845                  /*
 847  846                   * read the hat and its hash table
 848  847                   */
↓ open down ↓ 43 lines elided ↑ open up ↑
 892  891                  if (level == (uint64_t)-1)
 893  892                          level = 0;
 894  893                  mdb_warn("couldn't find matching htable, using level=%lu, "
 895  894                      "base address=0x0\n", level);
 896  895                  base = 0;
 897  896                  pagesize = mmu.level_size[level];
 898  897          }
 899  898  
 900  899          paddr = mmu_ptob((physaddr_t)pfn);
 901  900          for (entry = 0; entry < mmu.ptes_per_table; ++entry) {
 902      -                len = mdb_pread(&buf, mmu.pte_size,
      901 +                len = mdb_pread(&pte, mmu.pte_size,
 903  902                      paddr + entry * mmu.pte_size);
 904  903                  if (len != mmu.pte_size)
 905  904                          return (DCMD_ERR);
 906      -                        pte = buf;
 907  905  
 908  906                  if (pte == 0)
 909  907                          continue;
 910  908  
 911  909                  mdb_printf("[%3d] va=0x%p ", entry,
 912  910                      VA_SIGN_EXTEND(base + entry * pagesize));
 913  911                  do_pte_dcmd(level, pte);
 914  912          }
 915  913  
 916  914  done:
↓ open down ↓ 206 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX