1 /****^  ***********************************************************
  2         *                                                         *
  3         * Copyright, (C) Honeywell Bull Inc., 1987                *
  4         *                                                         *
  5         * Copyright, (C) Honeywell Information Systems Inc., 1983 *
  6         *                                                         *
  7         *********************************************************** */
  8 
  9 
 10 delete_segs:
 11      procedure;
 12 
 13 /* RE Mullen, v2pl1 oct 1973 */
 14 
 15 /* Modified by Andre Bensoussan for new storage system - Feb 1975 */
 16 /* 5/13/76 by BSG for prewithdrawing */
 17 /* Modified March 1982, J. Bongiovanni, not to deposit addresses for init
 18    and temp segs */
 19 /* Modified August 1982, J. Bongiovanni, to eliminate RLV parasites */
 20 /* Modified November 1982 by C. Hornig to zero LOT entries */
 21 /* Modified October 1983 to properly handle abs-segs */
 22 /* Modified December 1983 by Keith Loepere for breakpoint page processing */
 23 
 24           dcl     list                   bit (18) unaligned based (aste_list_ptr);
 25 
 26           dcl     seg_size               fixed bin (26);
 27           dcl     segno                  fixed bin (15);
 28           dcl     ptsi                   fixed bin (2);     /* page table size index (0-3 => 4k-256k) */
 29           dcl     aste_list_ptr          ptr;
 30 
 31           dcl     pc$cleanup             entry (ptr);
 32           dcl     pc$truncate            entry (ptr, fixed bin);
 33           dcl     ptw_util_$make_null    entry (ptr, bit (22) aligned);
 34           dcl     sdw_util_$get_size     entry (ptr, fixed bin (26));
 35           dcl     thread$cin             entry (ptr, bit (18));
 36           dcl     thread$out             entry (ptr, bit (18));
 37 
 38           dcl     dseg$                  (0:4095) fixed bin (71) external;
 39           dcl     lot$                   (0:4095) fixed bin (35) external;
 40           dcl     slt$                   external;
 41           dcl     sst$                   external;
 42           dcl     sst$ainitp             bit (18) unaligned external;
 43           dcl     sst$atempp             bit (18) unaligned external;
 44           dcl     1 sst$level            (0:3) aligned external,
 45                     2 ausedp             bit (18) unaligned,
 46                     2 no_aste            bit (18) unaligned;
 47 
 48           dcl     (addr, addrel, divide, ptr, rel, size, fixed) builtin;
 49 %page;
 50 /* * * * * * * * * TEMP * * * * * * * * * */
 51 
 52 temp:
 53      entry;
 54 
 55           sltp = addr (slt$);
 56           aste_list_ptr = addr (sst$atempp);
 57           call expunge_segs;
 58           return;
 59 
 60 /* * * * * * * * * * * DELETE_SEGS_INIT * * * * * * * * * */
 61 
 62 delete_segs_init:
 63      entry;
 64 
 65           sltp = addr (slt$);                               /* Get pointer to the SLT. */
 66           aste_list_ptr = addr (sst$ainitp);
 67           call expunge_segs;
 68           do segno = slt.first_init_seg to slt.last_init_seg;
 69                                                             /* Iterate through the SLT init segs. */
 70                dseg$ (segno) = 0;                           /* Clear the SDW. */
 71                lot$ (segno) = 0;
 72           end;
 73           return;
 74 
 75 expunge_segs: proc;                                         /* delete segs in sst list */
 76 
 77           do while (aste_list_ptr -> list ^= "0"b);         /* Loop over all entries on list. */
 78                astep = ptr (addr (sst$), aste_list_ptr -> list); /* Set AST pointer to next (top) entry. */
 79                segno = fixed (astep -> aste.strp, 15);      /* Get segment number from AST entry */
 80                sltep = addr (slt.seg (segno));
 81                if slte.breakpointable & slte.wired then do; /* don't truncate breakpoint_page */
 82                          call sdw_util_$get_size (addr (dseg$ (segno)), seg_size);
 83                          call ptw_util_$make_null (addrel (astep, size (aste) + divide (seg_size, 1024, 17) - 1), make_sdw_null_addr);
 84                     end;
 85                dseg$ (segno) = 0;                           /* Zero the SDW. */
 86                lot$ (segno) = 0;
 87                ptsi = fixed (astep -> aste.ptsi, 2);
 88                astep -> aste.ddnp = "0"b;                   /* Uninhibit depositable address reporting */
 89 
 90                if slte.abs_seg then call pc$cleanup (astep);/* Just flush pages not in hc part */
 91                else call pc$truncate (astep, 0);            /* free hc part pages */
 92 
 93                call thread$out (astep, aste_list_ptr -> list); /* Thread entry out of its list. */
 94 
 95                call thread$cin (astep, sst$level.ausedp (ptsi));
 96                                                             /* thread the entry into the used list */
 97                sst$level.ausedp (ptsi) = rel (astep);
 98                astep -> aste_part.two = "0"b;               /* Zero the ASTE except fp, bp, ptsi and marker */
 99           end;
100           return;
101      end;
102 %page;
103 %include aste;
104 %include null_addresses;
105 %include slt;
106 %include slte;
107      end delete_segs;