

            mkq$xs (4) --- initialize a hardware defined queue       06/28/82


            _C_a_l_l_i_n_g _I_n_f_o_r_m_a_t_i_o_n

                 integer function mkq$xs (ptr_to_free, room, qu)
                 shortcall mkq$xs (4)

                 pointer ptr_to_free
                 integer room
                 queue_control_block qu

                 Library: shortlb
                 Also declared in =incl=/shortlb.r.i


            _F_u_n_c_t_i_o_n

                 This function initializes a queue control block so it can be
                 used  by  the  other queue functions.  Queues are a machine-
                 defined  data  type  on  higher-level  Prime  machines,  and
                 operations   on   queues   are   guaranteed  "atomic"  (non-
                 interruptable).  However, queues require special definition.

                 Queues must be a fixed size in length, and that length  must
                 be  2  ** k words long, with 4 <= k <= 16.  Furthermore, the
                 queue must start on a 2 ** k word boundary.

                 To make things easier for the  user,  this  function  simply
                 requires  that  the  user  pass  a pointer to a free area in
                 memory, and the  length  of  that  area  ('ptr_to_free'  and
                 'room',  respectively).   The  function  then determines the
                 largest queue that can fit into that  free  area  and  still
                 meet  the  queue-related requirements.  The function updates
                 the queue control block 'qu' to reflect this placement,  and
                 then  returns  the number of available words in the queue as
                 the function value.

                 If no queue can be allocated  in  the  space  provided,  the
                 function  returns  a zero value.  It should be noted that it
                 is possible that the size of the queue created may  be  only
                 half  of  the free area due to the address boundary restric-
                 tions.  Non-zero function returns are always (2 ** k) - 1.

                 The  declaration   'queue_control_block'   is   defined   in
                 =incl=/shortlb.r.i;  this  file  should  be included if this
                 routine is used.


            _I_m_p_l_e_m_e_n_t_a_t_i_o_n

                 Implemented as a PMA routine entered via a JSXB (shortcall).

                 Note that any routine using this call must be compiled using
                 the "-q" option of 'fc'.






            mkq$xs (4)                    - 1 -                    mkq$xs (4)




            mkq$xs (4) --- initialize a hardware defined queue       06/28/82


            _A_r_g_u_m_e_n_t_s _M_o_d_i_f_i_e_d

                 qu


            _B_u_g_s

                 The function uses 'qu' for some temporary values;  'qu'  may
                 be partially initialized even if no queue can be created.

                 Locally supported.


            _S_e_e _A_l_s_o

                 abq$xs  (4),  atq$xs  (4),  fc  (1), rbq$xs (4), rtq$xs (4),
                 tsq$xs (4), _S_y_s_t_e_m _A_r_c_h_i_t_e_c_t_u_r_e _R_e_f_e_r_e_n_c_e _G_u_i_d_e  (Prime  PDR
                 3060)








































            mkq$xs (4)                    - 2 -                    mkq$xs (4)


