{--------------------------------------------------------------------------------------------------------
{  The procedure mmp$page_pull_hash_sva is called to hash for a page in the page table.  If the page is in
{  one of the available queues, OR if it is locked for IO, OR if it is a valid page in the page table,
{  page_count will be set to 1, pstatus will be set, and pfti will be set.  If it is an available page, the
{  page will also be relinked into the appropriate queue.
{  If the page is not found, page_count will be set to zero and pstatus will be set to ps_done.
{--------------------------------------------------------------------------------------------------------

  PROCEDURE [inline] mmp$page_pull_hash_sva
    (    sva: ost$system_virtual_address;
         aste_p: ^mmt$active_segment_table_entry;
     VAR page_count: mmt$page_frame_index;
     VAR pstatus: mmt$page_pull_status;
     VAR pfti: mmt$page_frame_index);

    VAR
      count: 1 .. 32,
      found: boolean,
      ipti: integer,
      pfte_p: ^mmt$page_frame_table_entry,
      pte_p: ^ost$page_table_entry;


    #HASH_SVA (sva, ipti, count, found);
    pfti := 0;
    IF NOT found THEN
      page_count := 0;
      pstatus := ps_done;
    ELSE
      page_count := 1;
      pte_p := ^mmv$pt_p^ [ipti];
      IF pte_p^.v THEN
        pstatus := ps_valid_in_pt;
      ELSE
        pfti := (pte_p^.rma * 512) DIV osv$page_size;
        pfte_p := ^mmv$pft_p^ [pfti];
        IF (pfte_p^.locked_page = mmc$lp_page_in_lock) OR (pfte_p^.locked_page = mmc$lp_write_protected_lock)
              OR (pfte_p^.locked_page = mmc$lp_server_allocate_lock) THEN
          pstatus := ps_locked;
        ELSEIF pfte_p^.locked_page = mmc$lp_aging_lock THEN
          mtp$error_stop ('MM - page fault for locked page');
        ELSEIF pfte_p^.queue_id < mmc$pq_first_valid_in_pt THEN
          IF pfte_p^.queue_id = mmc$pq_avail THEN
            pstatus := ps_found_in_avail;
          ELSE
            pstatus := ps_found_in_avail_modified;
          IFEND;
          pfte_p^.ijl_ordinal := aste_p^.ijl_ordinal;
          mmp$relink_page_frame (pfti, aste_p^.queue_id);
          pte_p^.v := TRUE;
        ELSE
          mtp$error_stop ('MM - bad page status on PF');
        IFEND;
      IFEND;
    IFEND;
  PROCEND mmp$page_pull_hash_sva;

?? PUSH (LISTEXT := ON)??
*copyc mmt$active_segment_table
*copyc mmt$page_frame_index
*copyc ost$hardware_subranges
*copyc mmt$page_pull_status
?? POP ??
