COMPILATION LISTING OF SEGMENT ptr_is_good_v2_ Compiled by: Multics PL/I Compiler, Release 28e, of February 14, 1985 Compiled at: Honeywell Multics Op. - System M Compiled on: 05/09/85 1128.5 mst Thu Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 4* * * 5* *********************************************************** */ 6 7 /* ****************************************************** 8* * * 9* * * 10* * Copyright (c) 1972 by Massachusetts Institute of * 11* * Technology and Honeywell Information Systems, Inc. * 12* * * 13* * * 14* ****************************************************** */ 15 16 ptr_is_good_v2_ : proc (a_test_ptr) returns (bit (1) aligned); 17 18 /* Adapted from the original version 2 ptr_is_good_ by J. Stern, 11/4/74 */ 19 20 dcl (alloc_len internal static, /* length of allocation bits */ 21 a_block_size, /* given block size for salvager entry */ 22 block_size, /* size of message block */ 23 hdr_alloc_len, /* length of header allocation bits */ 24 i, /* computation variable */ 25 message_begin, /* first legal beginning loc for message */ 26 offset, /* offset of given pointer */ 27 seg_size internal static) fixed bin (18); 28 29 dcl code fixed bin (35); 30 31 dcl (a_test_ptr, /* pointer to be validated (argument) */ 32 test_ptr) ptr; /* pointer to be validated (internal) */ 33 34 dcl ( 35 a_flag, /* ON if pointer is valid (argument) */ 36 flag init ("0"b), 37 salvager_entry init ("0"b) 38 ) bit (1) aligned; /* ON if pointer is valid (internal) */ 39 40 dcl hcs_$get_max_length_seg entry (ptr, fixed bin (18), fixed bin (35)); 41 42 dcl (addr, divide, fixed, mod, ptr, rel) builtin; 43 1 1 /* BEGIN include file mseg_hdr_v2.incl.pl1 */ 1 2 1 3 dcl mptr ptr, /* pointer to message segment */ 1 4 1 5 1 mseg_hdr_v2 aligned based (mptr), /* message segment header format */ 1 6 2 lock bit (36) aligned, /* standard file system lock */ 1 7 2 mseg_pattern bit (36) aligned, /* to identify message segments */ 1 8 2 pad (6) fixed bin, 1 9 2 first_ms_offset bit (18) aligned, /* offset to first logical message */ 1 10 2 last_ms_offset bit (18) aligned, /* offset to last logical message */ 1 11 2 alloc_len fixed bin, /* length of allocation bit string */ 1 12 2 space_left fixed bin, /* number of empty blocks */ 1 13 2 number_of_messages fixed bin, /* number of messages in segment */ 1 14 2 block_size fixed bin, /* message block size */ 1 15 2 switches, 1 16 3 aip bit (1) unaligned, /* ON if allocation is in progress */ 1 17 3 os bit (1) unaligned, /* ON if message segment was salvaged */ 1 18 3 ms_in_hdr bit (1) unaligned, /* ON if there is a message in the header */ 1 19 3 pad2 bit (30) unaligned, 1 20 2 version_number fixed bin, 1 21 2 hdr_ms_len fixed bin, /* length of header message, if any */ 1 22 2 hdr_ms, /* space for header message */ 1 23 3 filler (126) fixed bin, 1 24 3 hdr_ms_end fixed bin, 1 25 2 alloc_bits bit (alloc_len) aligned; /* allocation bit string */ 1 26 1 27 /* END include file mseg_hdr_v2.incl.pl1 */ 44 45 46 /* */ 47 48 49 go to COMMON; 50 51 ms_salvager_entry: entry (a_test_ptr, a_block_size) returns (bit (1) aligned); 52 53 salvager_entry = "1"b; 54 55 COMMON: 56 57 /* copy argument */ 58 59 test_ptr = a_test_ptr; 60 61 /* create offset from pointer */ 62 63 offset = fixed (rel (test_ptr), 18); 64 65 /* create message segment ptr */ 66 67 mptr = ptr (test_ptr, 0); 68 69 if salvager_entry /* get proper block size */ 70 then block_size = a_block_size; 71 else 72 block_size = mptr -> mseg_hdr_v2.block_size; 73 74 /* check block size, compute needed variables */ 75 76 if block_size <= 0 77 then go to fin; 78 79 call hcs_$get_max_length_seg (mptr, seg_size, code); 80 if code ^= 0 then go to fin; 81 alloc_len = divide (seg_size, block_size, 18, 0); 82 83 i = divide (36* (fixed (rel (addr (mptr -> mseg_hdr_v2.hdr_ms_end)), 18) + 1)+alloc_len+35, 36, 18, 0); 84 hdr_alloc_len = divide (i+block_size-1, block_size, 18, 0); 85 86 message_begin = fixed (rel (addr (mptr -> mseg_hdr_v2.hdr_ms.hdr_ms_end)))+hdr_alloc_len+1; 87 88 /* validate message pointer */ 89 90 if offset >= message_begin /* pointer is past header */ 91 then if offset <= seg_size - block_size /* pointer is not off end of segment */ 92 then if mod (offset, block_size) = 0 /* pointer points to block boundary */ 93 then flag = "1"b; /* pointer is o.k. */ 94 95 fin: a_flag = flag; /* return test indicator */ 96 return (a_flag); 97 98 end ptr_is_good_v2_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 05/06/85 1619.0 ptr_is_good_v2_.pl1 >spec>on>mseg>ptr_is_good_v2_.pl1 44 1 05/06/85 1121.8 mseg_hdr_v2.incl.pl1 >spec>on>mseg>mseg_hdr_v2.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. a_block_size parameter fixed bin(18,0) dcl 20 ref 51 69 a_flag 000110 automatic bit(1) dcl 34 set ref 95* 96 a_test_ptr parameter pointer dcl 31 ref 16 51 55 addr builtin function dcl 42 ref 83 86 alloc_len 000010 internal static fixed bin(18,0) dcl 20 set ref 81* 83 block_size 15 based fixed bin(17,0) level 2 in structure "mseg_hdr_v2" dcl 1-3 in procedure "ptr_is_good_v2_" ref 71 block_size 000100 automatic fixed bin(18,0) dcl 20 in procedure "ptr_is_good_v2_" set ref 69* 71* 76 81 84 84 90 90 code 000105 automatic fixed bin(35,0) dcl 29 set ref 79* 80 divide builtin function dcl 42 ref 81 83 84 fixed builtin function dcl 42 ref 63 83 86 flag 000111 automatic bit(1) initial dcl 34 set ref 34* 90* 95 hcs_$get_max_length_seg 000012 constant entry external dcl 40 ref 79 hdr_alloc_len 000101 automatic fixed bin(18,0) dcl 20 set ref 84* 86 hdr_ms 21 based structure level 2 dcl 1-3 hdr_ms_end 217 based fixed bin(17,0) level 3 dcl 1-3 set ref 83 86 i 000102 automatic fixed bin(18,0) dcl 20 set ref 83* 84 message_begin 000103 automatic fixed bin(18,0) dcl 20 set ref 86* 90 mod builtin function dcl 42 ref 90 mptr 000114 automatic pointer dcl 1-3 set ref 67* 71 79* 83 86 mseg_hdr_v2 based structure level 1 dcl 1-3 offset 000104 automatic fixed bin(18,0) dcl 20 set ref 63* 90 90 90 ptr builtin function dcl 42 ref 67 rel builtin function dcl 42 ref 63 83 86 salvager_entry 000112 automatic bit(1) initial dcl 34 set ref 34* 53* 69 seg_size 000011 internal static fixed bin(18,0) dcl 20 set ref 79* 81 90 test_ptr 000106 automatic pointer dcl 31 set ref 55* 63 67 NAMES DECLARED BY EXPLICIT CONTEXT. COMMON 000045 constant label dcl 55 ref 49 fin 000150 constant label dcl 95 ref 76 80 ms_salvager_entry 000032 constant entry external dcl 51 ptr_is_good_v2_ 000014 constant entry external dcl 16 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 224 240 154 234 Length 424 154 14 147 47 2 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME ptr_is_good_v2_ 92 external procedure is an external procedure. STORAGE FOR INTERNAL STATIC VARIABLES. LOC IDENTIFIER BLOCK NAME 000010 alloc_len ptr_is_good_v2_ 000011 seg_size ptr_is_good_v2_ STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME ptr_is_good_v2_ 000100 block_size ptr_is_good_v2_ 000101 hdr_alloc_len ptr_is_good_v2_ 000102 i ptr_is_good_v2_ 000103 message_begin ptr_is_good_v2_ 000104 offset ptr_is_good_v2_ 000105 code ptr_is_good_v2_ 000106 test_ptr ptr_is_good_v2_ 000110 a_flag ptr_is_good_v2_ 000111 flag ptr_is_good_v2_ 000112 salvager_entry ptr_is_good_v2_ 000114 mptr ptr_is_good_v2_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out return mod_fx1 ext_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. hcs_$get_max_length_seg NO EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 34 000004 16 000010 49 000025 51 000026 53 000043 55 000045 63 000051 67 000054 69 000056 71 000063 76 000065 79 000066 80 000101 81 000103 83 000107 84 000122 86 000126 90 000133 95 000150 96 000152 ----------------------------------------------------------- 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