/* *********************************************************** * * * Copyright, (C) Honeywell Information Systems Inc., 1982 * * * * Copyright (c) 1972 by Massachusetts Institute of * * Technology and Honeywell Information Systems, Inc. * * * *********************************************************** */ /* DATMK_ - Data Segment Grower for Multics. 6/22/68 - Noel I. Morris */ /* 29 May 69 - James D. Mills */ /* 20 Oct 70 - Barry L. Wolman (areas on mod 8 boundary) */ /* 16 Oct 1972 - Melanie B. Weaver (broke into 2 pieces; converted t0 v2pl1) */ /* Calling Sequence: call datmk_ (arg_list_ptr_ptr, mcptr, fault_ptr); Where: arg_list_ptr_ptr = pointer to EPL or PL/1 -compiled argument list. mcptr = pointer to machine conditions. fault_ptr = pointer to linkage fault-pair. The EPL-compiled argument list appears as follows: dec n number of words to grow data segment dec x x = 0, 1, or 2 ... If "x" = 0, no initialization is to be done. If "x" = 1, the third location points to the initialization procedure. If "x" = 2, the third location is the first location of the initialization procedure. The PL/1-compiled argument list appears as follows: dec n number of words to grow data segment dec x x = 0, 3, or 4 ... If "x" = 0, no initialization is to be done. If "x" = 3, the third location is the first of n words which must be copied into the newly-grown space to initialize it. If "x" = 4, the newly-grown space must be initialized as an area. There is no third argument. */ datmk_: proc (arg_list_ptr_ptr, mcptr, fault_ptr); dcl (arg_list_ptr_ptr, /* argument list pointer */ mcptr, /* pointer to machine conditions */ fault_ptr) ptr; /* pointer to linkage fault-pair */ dcl seg_ptr ptr, /* pointer to segment name */ def_ptr ptr, /* pointer to definition section */ seg char (32), /* segment name */ rcode fixed bin(35), /* error code */ lseg fixed bin (9), /* length of segment name */ type_pair_ptr ptr, /* pointer to type-pair block */ data_ptr ptr, /* pointer to the grown data */ based_ptr ptr based ; /* pointer to pointer */ dcl (addr, addrel, bin, fixed, null, substr) builtin; dcl hcs_$fs_get_seg_ptr ext entry(char(*), ptr, fixed bin(35)); dcl hcs_$rest_of_datmk_ ext entry(ptr, ptr, fixed bin(35)); /* does actual initialization */ dcl hcs_$make_seg ext entry(char(*), char(*), char(*), fixed bin(5), ptr, fixed bin(35)); dcl hcs_$link_force ext entry(ptr, fixed bin(17), fixed bin(35)); dcl 1 datmk_info aligned, /* contains info for rest_of_datmk_ */ %include datmk_info; /* */ %include linkdcl; /* */ /* Step 1. Assume definition does not exist. Extract the segment name and symbol from the fault pair information. */ def_ptr = addrel (fault_ptr, fault_ptr -> link.head_ptr) -> header.def_ptr; /* Get linkage definitions pointer. */ type_pair_ptr = addrel (def_ptr, addrel (def_ptr, fault_ptr -> link.exp_ptr) -> exp_word.type_ptr); /* Generate pointer to type-pair block. */ if fixed (type_pair_ptr -> type_pair.type, 18) ^= 4 then go to type_error; /* Must be a type 4 link. */ seg_ptr = addrel (def_ptr, type_pair_ptr -> type_pair.seg_ptr); /* Generate pointer to segment name. */ lseg = bin(seg_ptr -> name.nchars, 9); /* Get length of name. */ seg = substr (seg_ptr -> name.char_string, 1, lseg); /* Make a copy of the segment name. */ sym_ptr = addrel (def_ptr, type_pair_ptr -> type_pair.ext_ptr); /* Generate pointer to symbol name. */ /* Step 2. Get a pointer to the data segment, try to snap the link and return. If this fails, call hcs_$rest_of_datmk_, which gets a pointer to the linkage section, determines the value of the new def, and initializes the new item, if requested. if the data or linkage segments do not exist, they are created and initialized. */ /* Extract caller pointer to SCU data. */ call hcs_$fs_get_seg_ptr ( seg, text_ptr, rcode);/* Get a pointer to text segment. */ if text_ptr = null then do; /* If text segment not found ... */ call hcs_$make_seg ("", "", seg, 01011b, text_ptr, rcode); /* Create the text segment. */ if text_ptr = null then go to text_error; /* Check for error in creating text segment. */ end; else do; /* Check for existing segment */ call hcs_$link_force (fault_ptr, 0, rcode); /* Try to force the link */ if rcode = 0 then return; /* If successful, the definition exists. Return. */ end; /* fill in structure for rest_of_datmk_ */ segname = substr(seg_ptr -> name.char_string, 1, lseg); call hcs_$link_force(arg_list_ptr_ptr, 0, rcode); /* get ptr to argument list */ arg_list_ptr = arg_list_ptr_ptr -> based_ptr; call hcs_$rest_of_datmk_(addr(datmk_info), data_ptr, rcode); /* let subroutine grow and initialize segment */ if rcode ^= 0 then return; /* now we have everything set up and can snap the link */ call hcs_$link_force(fault_ptr, 0, rcode); type_error: text_error: return; /* If original link couldn't be snapped for some reason, we return anyway. datmk_'s "caller" should check to see if the link was snapped, and if not, print linkage error message. */ end datmk_; */ ----------------------------------------------------------- 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 */