COMPILATION LISTING OF SEGMENT deactivate_seg Compiled by: Multics PL/I Compiler, Release 28d, of October 4, 1983 Compiled at: Honeywell Multics Op. - System M Compiled on: 02/29/84 0813.6 mst Wed Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 4* * * 5* * Copyright (c) 1972 by Massachusetts Institute of * 6* * Technology and Honeywell Information Systems, Inc. * 7* * * 8* *********************************************************** */ 9 10 11 deactivate_seg: proc (); 12 13 /* Written April 1, 1976 by R. Bratt for testing of demand deactivate 14* Added -force control argument, for hphcs_, 04/21/81, W. Olin Sibert 15* Fixed error msg. 1/23/84 C Spitzer 16* */ 17 18 dcl (argno, nargs) fixed bin; 19 dcl code fixed bin (35); 20 dcl ap ptr; 21 dcl al fixed bin (21); 22 dcl arg char (al) based (ap); 23 24 dcl segno fixed bin (17); 25 dcl segptr ptr; 26 dcl dname char (168); 27 dcl ename char (32); 28 dcl force_sw bit (1) aligned; 29 dcl terminate_sw bit (1) aligned; 30 dcl uid bit (36) aligned; 31 32 dcl error_table_$badopt fixed bin (35) external static; 33 dcl error_table_$noarg fixed bin (35) external static; 34 dcl error_table_$too_many_args fixed bin (35) external static; 35 36 dcl cu_$arg_count entry (fixed bin, fixed bin (35)); 37 dcl cu_$arg_ptr entry (fixed bin, ptr, fixed bin (21), fixed bin (35)); 38 dcl com_err_ entry options (variable); 39 dcl cv_oct_check_ entry (char (*), fixed bin (35)) returns (fixed bin); 40 dcl expand_pathname_ entry (char (*), char (*), char (*), fixed bin (35)); 41 dcl hcs_$get_uid_seg entry (pointer, bit (36) aligned, fixed bin (35)); 42 dcl hcs_$initiate entry (char (*), char (*), char (*), fixed bin (1), fixed bin (2), ptr, fixed bin (35)); 43 dcl hcs_$terminate_noname entry (ptr, fixed bin (35)); 44 dcl hphcs_$deactivate entry (bit (36) aligned, fixed bin (35)); 45 dcl pathname_ entry (char(*), char(*)) returns(char(168)); 46 dcl phcs_$deactivate entry (ptr, fixed bin (35)); 47 dcl phcs_$initiate entry (char (*), char (*), char (*), fixed bin (1), fixed bin (2), ptr, fixed bin (35)); 48 49 dcl WHOAMI char (32) internal static options (constant) init ("deactivate_seg"); 50 51 dcl (cleanup, linkage_error) condition; 52 53 dcl (baseptr, char, null) builtin; 54 55 /* */ 56 57 segno = -1; 58 dname = ""; 59 terminate_sw = "0"b; 60 force_sw = "0"b; 61 62 call cu_$arg_count (nargs, code); 63 if code ^= 0 then do; 64 call com_err_ (code, WHOAMI); 65 MAIN_RETURN: return; 66 end; 67 68 do argno = 1 to nargs; 69 call cu_$arg_ptr (argno, ap, al, (0)); 70 if (arg = "-force") | (arg = "-fc") then force_sw = "1"b; 71 else if (char (arg, 1) = "-") then do; 72 call com_err_ (error_table_$badopt, WHOAMI, "^a", arg); 73 goto MAIN_RETURN; 74 end; 75 76 else do; /* segno or pathname */ 77 if (segno >= 0) | (dname ^= "") then do; 78 code = error_table_$too_many_args; 79 goto USAGE; 80 end; 81 82 segno = cv_oct_check_ (arg, code); 83 if code ^= 0 then do; /* Not a segno, try a pathname */ 84 call expand_pathname_ (arg, dname, ename, code); 85 if code ^= 0 then do; 86 call com_err_ (code, WHOAMI, "^a", arg); 87 goto MAIN_RETURN; 88 end; 89 else segno = -1; /* reset to default */ 90 end; 91 end; 92 end; /* of argument loop */ 93 94 if (segno = -1) & (dname = "") then do; 95 code = error_table_$noarg; 96 USAGE: call com_err_ (code, WHOAMI, "^/Usage:^-^a segno|pathname {-force}", WHOAMI); 97 goto MAIN_RETURN; 98 end; 99 100 /* */ 101 102 on condition (linkage_error) begin; 103 call com_err_ (0, WHOAMI, "This procedure requires privileged access: phcs_^[, hphcs_^].", force_sw); 104 goto MAIN_RETURN; 105 end; 106 107 on condition (cleanup) begin; 108 if terminate_sw then 109 if segptr ^= null () then 110 call hcs_$terminate_noname (segptr, (0)); 111 segptr = null (); 112 end; 113 114 if (dname ^= "") then do; /* must initiate it first */ 115 call hcs_$initiate (dname, ename, "", 0, 1, segptr, code); 116 if segptr = null () then /* A directory, maybe? */ 117 call phcs_$initiate (dname, ename, "", 0, 0, segptr, code); 118 else terminate_sw = "1"b; 119 120 if segptr = null () then do; /* If still null, give up */ 121 PATH_ERROR: call com_err_ (code, WHOAMI, "^a^[>^]^a", dname, (dname ^= ">"), ename); 122 goto MAIN_RETURN; 123 end; 124 125 call hcs_$get_uid_seg (segptr, uid, code); 126 if code ^= 0 then goto PATH_ERROR; 127 end; 128 129 else do; /* Otherwise, just get the UID */ 130 segptr = baseptr (segno); 131 call hcs_$get_uid_seg (segptr, uid, code); 132 if code ^= 0 then do; 133 call com_err_ (code, WHOAMI, "Segment ^o", segno); 134 goto MAIN_RETURN; 135 end; 136 end; 137 138 if force_sw then /* Highly privileged */ 139 call hphcs_$deactivate (uid, code); 140 else call phcs_$deactivate (segptr, code); 141 142 if code ^= 0 then /* Mention it */ 143 call com_err_ (code, WHOAMI, "Deactivating ^[^o^;^s^a^]", 144 (segno >= 0), segno, pathname_ (dname, ename)); 145 146 if terminate_sw then call hcs_$terminate_noname (segptr, (0)); 147 148 goto MAIN_RETURN; /* All done */ 149 150 end deactivate_seg; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 02/29/84 0812.0 deactivate_seg.pl1 >spec>on>6727>deactivate_seg.pl1 NAMES DECLARED IN THIS COMPILATION. IDENTIFIER OFFSET LOC STORAGE CLASS DATA TYPE ATTRIBUTES AND REFERENCES (* indicates a set context) NAMES DECLARED BY DECLARE STATEMENT. WHOAMI 000000 constant char(32) initial unaligned dcl 49 set ref 64* 72* 86* 96* 96* 103* 121* 133* 142* al 000106 automatic fixed bin(21,0) dcl 21 set ref 69* 70 70 71 72 72 82 82 84 84 86 86 ap 000104 automatic pointer dcl 20 set ref 69* 70 70 71 72 82 84 86 arg based char unaligned dcl 22 set ref 70 70 71 72* 82* 84* 86* argno 000100 automatic fixed bin(17,0) dcl 18 set ref 68* 69* baseptr builtin function dcl 53 ref 130 char builtin function dcl 53 ref 71 cleanup 000200 stack reference condition dcl 51 ref 107 code 000102 automatic fixed bin(35,0) dcl 19 set ref 62* 63 64* 78* 82* 83 84* 85 86* 95* 96* 115* 116* 121* 125* 126 131* 132 133* 138* 140* 142 142* com_err_ 000022 constant entry external dcl 38 ref 64 72 86 96 103 121 133 142 cu_$arg_count 000016 constant entry external dcl 36 ref 62 cu_$arg_ptr 000020 constant entry external dcl 37 ref 69 cv_oct_check_ 000024 constant entry external dcl 39 ref 82 dname 000112 automatic char(168) unaligned dcl 26 set ref 58* 77 84* 94 114 115* 116* 121* 121 142* 142* ename 000164 automatic char(32) unaligned dcl 27 set ref 84* 115* 116* 121* 142* 142* error_table_$badopt 000010 external static fixed bin(35,0) dcl 32 set ref 72* error_table_$noarg 000012 external static fixed bin(35,0) dcl 33 ref 95 error_table_$too_many_args 000014 external static fixed bin(35,0) dcl 34 ref 78 expand_pathname_ 000026 constant entry external dcl 40 ref 84 force_sw 000174 automatic bit(1) dcl 28 set ref 60* 70* 103* 138 hcs_$get_uid_seg 000030 constant entry external dcl 41 ref 125 131 hcs_$initiate 000032 constant entry external dcl 42 ref 115 hcs_$terminate_noname 000034 constant entry external dcl 43 ref 108 146 hphcs_$deactivate 000036 constant entry external dcl 44 ref 138 linkage_error 000206 stack reference condition dcl 51 ref 102 nargs 000101 automatic fixed bin(17,0) dcl 18 set ref 62* 68 null builtin function dcl 53 ref 108 111 116 120 pathname_ 000040 constant entry external dcl 45 ref 142 142 phcs_$deactivate 000042 constant entry external dcl 46 ref 140 phcs_$initiate 000044 constant entry external dcl 47 ref 116 segno 000107 automatic fixed bin(17,0) dcl 24 set ref 57* 77 82* 89* 94 130 133* 142 142* segptr 000110 automatic pointer dcl 25 set ref 108 108* 111* 115* 116 116* 120 125* 130* 131* 140* 146* terminate_sw 000175 automatic bit(1) dcl 29 set ref 59* 108 118* 146 uid 000176 automatic bit(36) dcl 30 set ref 125* 131* 138* NAMES DECLARED BY EXPLICIT CONTEXT. MAIN_RETURN 000160 constant label dcl 65 ref 73 87 97 104 122 134 148 PATH_ERROR 000716 constant label dcl 121 ref 126 USAGE 000431 constant label dcl 96 ref 79 deactivate_seg 000115 constant entry external dcl 11 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 1414 1462 1210 1424 Length 1662 1210 46 163 204 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME deactivate_seg 250 external procedure is an external procedure. on unit on line 102 100 on unit on unit on line 107 72 on unit STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME deactivate_seg 000100 argno deactivate_seg 000101 nargs deactivate_seg 000102 code deactivate_seg 000104 ap deactivate_seg 000106 al deactivate_seg 000107 segno deactivate_seg 000110 segptr deactivate_seg 000112 dname deactivate_seg 000164 ename deactivate_seg 000174 force_sw deactivate_seg 000175 terminate_sw deactivate_seg 000176 uid deactivate_seg THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. r_ne_as r_ge_a call_ext_out_desc call_ext_out return tra_ext enable ext_entry int_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. com_err_ cu_$arg_count cu_$arg_ptr cv_oct_check_ expand_pathname_ hcs_$get_uid_seg hcs_$initiate hcs_$terminate_noname hphcs_$deactivate pathname_ phcs_$deactivate phcs_$initiate THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$badopt error_table_$noarg error_table_$too_many_args LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 11 000114 57 000122 58 000124 59 000127 60 000130 62 000131 63 000141 64 000143 65 000160 68 000161 69 000171 70 000207 71 000224 72 000233 73 000265 77 000266 78 000274 79 000277 82 000300 83 000324 84 000326 85 000356 86 000360 87 000412 89 000413 92 000415 94 000417 95 000426 96 000431 97 000457 102 000460 103 000474 104 000525 107 000530 108 000544 111 000564 112 000567 114 000570 115 000574 116 000640 118 000710 120 000712 121 000716 122 000764 125 000765 126 001000 127 001002 130 001003 131 001007 132 001022 133 001024 134 001055 138 001056 140 001073 142 001104 146 001171 148 001205 ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved