COMPILATION LISTING OF SEGMENT copy_stack_0 Compiled by: Multics PL/I Compiler, Release 32f, of October 9, 1989 Compiled at: Bull HN, Phoenix AZ, System-M Compiled on: 11/11/89 1005.0 mst Sat Options: optimize map 1 /****^ *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Bull Inc., 1987 * 4* * * 5* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 6* * * 7* * Copyright (c) 1972 by Massachusetts Institute of * 8* * Technology and Honeywell Information Systems, Inc. * 9* * * 10* *********************************************************** */ 11 12 13 copy_stack_0: 14 proc (processid, to_ptr, code); 15 16 /* Copies the stack_0 assigned to a specified process 17* 18* This routine examines stack_0_data for an active stack_0 19* assigned to the specified apte. If found, it is copied 20* to the specified location using initializer_abs_seg; 21* otherwise, an error code is returned. 22* 23* Written March 1981 by J. Bongiovanni */ 24 25 26 /* Parameter */ 27 28 dcl processid bit (36) aligned; /* process id which owns stack */ 29 dcl to_ptr ptr; /* where to copy stack_0 */ 30 dcl code fixed bin (35); /* error code */ 31 32 /* Automatic */ 33 34 dcl paptep bit (18); 35 dcl sdte_found bit (1); 36 dcl sdte_inx fixed bin; 37 dcl stack_ptr ptr; 38 dcl stack_sdw bit (72) aligned; 39 dcl stack_sdw_ptr ptr; 40 dcl stack_size fixed bin (19); 41 42 /* Based */ 43 44 dcl stack_copy (stack_size) fixed bin (35) aligned based; 45 46 /* The following include files are referenced at the end of the program: 47* 48* sdw 49* stack_0_data 50**/ 51 52 /* External */ 53 54 dcl initializer_abs_seg$ external; 55 dcl error_table_$bad_arg fixed bin (35) external; 56 dcl error_table_$stack_not_active fixed bin (35) external; 57 dcl sst$ external; 58 59 /* Entry */ 60 61 dcl get_ptrs_$given_astep entry (ptr) returns (bit (72) aligned); 62 dcl privileged_mode_ut$swap_sdw entry (ptr, ptr); 63 dcl sdw_util_$get_size entry (pointer, fixed bin (19)); 64 65 66 /* Check sdt for a stack belonging to this processid */ 67 68 code = 0; 69 sdtp = addr (stack_0_data$); 70 paptep = substr (processid, 1, 18); /* apte offset */ 71 if paptep="0"b then do; /* null offset - invalid */ 72 code = error_table_$bad_arg; 73 return; 74 end; 75 76 77 78 sdte_found = "0"b; 79 do sdte_inx = 1 repeat sdte_inx + 1 80 while (sdte_inx<=sdt.num_stacks&^sdte_found); 81 if stacks (sdte_inx).aptep=paptep then sdte_found = "1"b; 82 end; 83 84 if ^sdte_found then do; 85 code = error_table_$stack_not_active; 86 return; 87 end; 88 89 sdtep = addr (sdt.stacks (sdte_inx-1)); 90 stack_ptr = addr (initializer_abs_seg$); 91 stack_sdw_ptr = addr (stack_sdw); 92 stack_sdw = get_ptrs_$given_astep (ptr (addr (sst$), sdte.astep)); /* build sdw for stack */ 93 call sdw_util_$get_size (addr (stack_sdw), stack_size); 94 95 call privileged_mode_ut$swap_sdw (stack_ptr, stack_sdw_ptr); /* initializer_abs_seg is now stack */ 96 97 to_ptr -> stack_copy = stack_ptr -> stack_copy; 98 99 stack_sdw = "0"b; 100 call privileged_mode_ut$swap_sdw (stack_ptr, stack_sdw_ptr); 101 102 return; 103 104 105 /* BEGIN INCLUDE FILE ... stack_0_data.incl.pl1 */ 1 2 1 3 /* Created 790509 by Mike Grady */ 1 4 1 5 dcl stack_0_data$ fixed bin ext; /* shared stack 0 data base seg */ 1 6 dcl stack_0_data_init_number_of_stacks fixed bin; /* Make PL/I work */ 1 7 dcl sdtp ptr; 1 8 1 9 dcl 1 sdt aligned based (sdtp), /* stack 0 database */ 1 10 2 lock bit (36), /* lock before changing threads */ 1 11 2 num_stacks fixed bin, /* number of stacks in pool */ 1 12 2 freep bit (18), /* head of free thread, managed LIFO */ 1 13 2 pad fixed bin, 1 14 2 stacks (stack_0_data_init_number_of_stacks 1 15 refer (sdt.num_stacks)) like sdte; 1 16 1 17 dcl sdtep ptr; 1 18 1 19 dcl 1 sdte aligned based (sdtep), /* stack data table entry */ 1 20 2 nextp bit (18) unal, /* thread to next free entry (if free) */ 1 21 2 pad bit (18) unal, 1 22 2 astep bit (18) unal, /* ptr to ASTE for this stack seg */ 1 23 2 aptep bit (18) unal, /* ptr to APTE of process using this stack, if not free */ 1 24 2 sdw bit (72); /* SDW for this stack seg */ 1 25 1 26 /* END INCLUDE FILE ... stack_0_data.incl.pl1 */ 105 106 107 end copy_stack_0; 108 109 110 111 SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/11/89 0805.1 copy_stack_0.pl1 >spec>install>1111>copy_stack_0.pl1 105 1 10/25/79 0712.2 stack_0_data.incl.pl1 >ldd>include>stack_0_data.incl.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. aptep 5(18) based bit(18) array level 3 packed packed unaligned dcl 1-9 set ref 81 astep 1 based bit(18) level 2 packed packed unaligned dcl 1-19 ref 92 92 code parameter fixed bin(35,0) dcl 30 set ref 13 68* 72* 85* error_table_$bad_arg 000012 external static fixed bin(35,0) dcl 55 ref 72 error_table_$stack_not_active 000014 external static fixed bin(35,0) dcl 56 ref 85 get_ptrs_$given_astep 000020 constant entry external dcl 61 ref 92 initializer_abs_seg$ 000010 external static fixed bin(17,0) dcl 54 set ref 90 num_stacks 1 based fixed bin(17,0) level 2 dcl 1-9 ref 79 paptep 000100 automatic bit(18) packed unaligned dcl 34 set ref 70* 71 81 privileged_mode_ut$swap_sdw 000022 constant entry external dcl 62 ref 95 100 processid parameter bit(36) dcl 28 ref 13 70 sdt based structure level 1 dcl 1-9 sdte based structure level 1 dcl 1-19 sdte_found 000101 automatic bit(1) packed unaligned dcl 35 set ref 78* 79 81* 84 sdte_inx 000102 automatic fixed bin(17,0) dcl 36 set ref 79* 79* 81* 82 89 sdtep 000116 automatic pointer dcl 1-17 set ref 89* 92 92 sdtp 000114 automatic pointer dcl 1-7 set ref 69* 79 81 89 sdw_util_$get_size 000024 constant entry external dcl 63 ref 93 sst$ 000016 external static fixed bin(17,0) dcl 57 set ref 92 92 stack_0_data$ 000026 external static fixed bin(17,0) dcl 1-5 set ref 69 stack_copy based fixed bin(35,0) array dcl 44 set ref 97* 97 stack_ptr 000104 automatic pointer dcl 37 set ref 90* 95* 97 100* stack_sdw 000106 automatic bit(72) dcl 38 set ref 91 92* 93 93 99* stack_sdw_ptr 000110 automatic pointer dcl 39 set ref 91* 95* 100* stack_size 000112 automatic fixed bin(19,0) dcl 40 set ref 93* 97 stacks 4 based structure array level 2 dcl 1-9 set ref 89 to_ptr parameter pointer dcl 29 ref 13 97 NAME DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. stack_0_data_init_number_of_stacks automatic fixed bin(17,0) dcl 1-6 NAME DECLARED BY EXPLICIT CONTEXT. copy_stack_0 000012 constant entry external dcl 13 NAMES DECLARED BY CONTEXT OR IMPLICATION. addr builtin function ref 69 89 90 91 92 92 93 93 ptr builtin function ref 92 92 substr builtin function ref 70 STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 320 350 171 330 Length 542 171 30 156 126 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME copy_stack_0 92 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME copy_stack_0 000100 paptep copy_stack_0 000101 sdte_found copy_stack_0 000102 sdte_inx copy_stack_0 000104 stack_ptr copy_stack_0 000106 stack_sdw copy_stack_0 000110 stack_sdw_ptr copy_stack_0 000112 stack_size copy_stack_0 000114 sdtp copy_stack_0 000116 sdtep copy_stack_0 THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out return_mac ext_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. get_ptrs_$given_astep privileged_mode_ut$swap_sdw sdw_util_$get_size THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$bad_arg error_table_$stack_not_active initializer_abs_seg$ sst$ stack_0_data$ LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 13 000006 68 000017 69 000021 70 000023 71 000026 72 000027 73 000031 78 000032 79 000033 81 000046 82 000056 84 000060 85 000062 86 000066 89 000067 90 000074 91 000077 92 000101 93 000120 95 000133 97 000144 99 000155 100 000157 102 000170 ----------------------------------------------------------- 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