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 tty_buf:   proc;
14 
15 
16 /* Program to create ring-0 tty_buf segment
17 
18    Written Jan. 81 by J. Bongiovanni                                                                          */
19 
20 
21 dcl 1 cdsa like cds_args aligned;
22 dcl code fixed bin (35);
23 dcl p ptr;
24 
25 
26 dcl my_name char (7) init ("tty_buf") int static options (constant);
27 
28 
29 %include cds_args;
30 %include tty_buf;
31 
32 dcl com_err_ entry options (variable);
33 dcl create_data_segment_ entry (ptr, fixed bin(35));
34 dcl get_temp_segment_ entry (char(*), ptr, fixed bin(35));
35 dcl release_temp_segment_ entry entry options(variable);
36 
37 dcl cleanup condition;
38 
39 
40 
41      ttybp = null();
42      on cleanup call release_temp_segment_ (my_name, ttybp, code);
43 
44      call get_temp_segment_ (my_name, ttybp, code);
45      if code ^= 0 then do;
46           call com_err_ (code, my_name, "Getting temp segment");
47           return;
48      end;
49 
50      unspec (cdsa) = ""b;
51      cdsa.have_text = "1"b;
52      cdsa.p (1) = ttybp;
53      cdsa.len (1) = size (tty_buf);
54      cdsa.struct_name (1), cdsa.seg_name = my_name;
55      cdsa.num_exclude_names = 0;
56      cdsa.exclude_array_ptr = null();
57 
58      call create_data_segment_ (addr (cdsa), code);
59      if code ^= 0 then call com_err_ (code, my_name, "Creating data segment");
60 
61      call release_temp_segment_ (my_name, ttybp, code);
62 
63 end tty_buf;