
{    DECK:  RFT$R1_INTERFACE_DEFS
{
{    The purpose of this deck is to define the CYBIL types which are used
{    to interface between the RING 1 and RING 3 RHFAM/VE code.



{    The ring 3 identifier is passed to ring 1 when a request is issued.  The
{    identifier should be unique for the corresponding task.  The ring 1 code
{    assigns its own unique identifier, then passes the identifier and the
{    address of the request to ring 3.  The ring 3 code uses the address to
{    monitor the completion of the request.  A system flag is sent to ring 3
{    when a request is completed and the ring 3 code must check to see which
{    request was completed (This is not necessary if the ring 3 code only has
{    a single outstanding request).

{    NOTE:  These structures are allocated in task private and therefore
{    inherit ring 3 privileges. Any pointers that are stored in
{    these structures must point to structures that are allocated in
{    a segment that is writable at ring 3.  If this is not done, a segment
{    access error will occur if the routine allocating and storing the
{    structure pointer is running at a ring below 3.


  TYPE
      rft$request_identifier = RECORD
        ring_1_id: rft$r1_request_id,
        ring_3_id: rft$r3_request_id,
      RECEND;

  TYPE
      rft$r1_request_id = RECORD
        entry: 1..rfc$max_r1_request_id,
        address: ^rft$request_response_buffer,
      RECEND;

  TYPE
      rft$r3_request_id = RECORD
        entry: 1..rfc$max_r3_request_id,
        nad: rft$local_nads,
        pp: 1..2,  {only used for pp requests}
        location: rft$request_selector,
      RECEND;

  TYPE
      rft$request_selector = RECORD
        CASE  kind: rft$request_types  OF
        = rfc$pp_request =
          logical_pp: iot$pp_number,
        = rfc$unit_request =
          logical_unit: iot$logical_unit,
        CASEND,
      RECEND;

  TYPE
      rft$request_types = (rfc$pp_request, rfc$unit_request);

  TYPE
      rft$outstanding_requests = RECORD
        next_entry: ^rft$outstanding_requests,
        retry_count: 0..rfc$max_nad_retries,
        request_kind: rft$nad_request_kinds,
        request_status: ^cell,
        request_id: rft$request_identifier,
        posted: BOOLEAN,
        processing_request: BOOLEAN,
        waiting_event: ^rft$rhfam_event_table_entry,
      RECEND;

  TYPE
      rft$load_dump_status = RECORD
        state: rft$load_dump_states,
        mc_lfn: amt$local_file_name,
        mc_file_id: amt$file_identifier,
        mc_length: integer,
        mc_offset: integer,
        initial_phase: BOOLEAN,
        init_prams: rft$mc_initialization_prams,
        time_of_first_go: integer,
        current_nad_address: rft$nad_memory_size,
        mc_image: ^CELL,
        buffers_in_use: rft$buffer_count,
        number_of_buffers: rft$buffer_count,
        buffer_list: ^rft$buffer_list,
        nt_data : rft$nad_test_data,
        nt_length: rft$bytes_transferred,
        nt_offset: rft$bytes_transferred,
        mem_test_first_pass: BOOLEAN,
      RECEND;

  TYPE
      rft$connection_mgmt_status = RECORD
        CASE internal_use: boolean OF
        = TRUE =
          server_entry_p: ^rft$rhfam_server_table_entry,
          incoming_connect: ^rft$incoming_connect,
        = FALSE =
          connection: ^rft$connection_entry,
          activity_status: ^ost$activity_status,
        CASEND,
      RECEND;

  TYPE
    rft$data_transfer_status = RECORD
      connection_name: amt$local_file_name,
      connection_entry_p : ^rft$connection_entry,
      transmission_mode: rft$transmission_modes,
      wait: ost$wait,
      activity_status: ^ost$activity_status,
      data_transferred: ^rft$bytes_transferred,
      block_size: rft$block_size,
      file_mark: rft$record_marks,
      termination_mark: rft$record_marks,
      connection_descriptor: rft$connection_descriptor,
      data_area: rft$data_buffers,
      network_wired_data: boolean,
      data_exhausted: boolean,
      total_blocks_queued: rft$outstanding_blocks,
      next_to_queue_index: rft$data_fragment_count,
      next_to_queue_offset: rft$data_length,
      next_to_queue_abn: rft$application_block_number,
      current_fragment_index: rft$data_fragment_count,
      current_fragment_offset: rft$data_length,
      current_abn: rft$application_block_number,
      block_descriptors: ^rft$block_descriptors,
      block_descriptor_in: rft$outstanding_blocks,
      block_descriptor_out: rft$outstanding_blocks,
      next_to_advise_out_index: rft$data_fragment_count,
      next_to_advise_out_offset: rft$data_length,
      next_to_advise_in_index: rft$data_fragment_count,
      next_to_advise_in_offset: rft$data_length,
      complete_index: rft$data_fragment_count,
      complete_offset: rft$data_length,
      header_buffers: ^rft$header_buffers,
      present_r1_out_ptr: rft$command_entry,
      bytes_transferred: rft$bytes_transferred,
      outgoing_message_count: rft$blocks_transferred,
      previous_error: ost$status,
      reason_for_termination: rft$termination_kinds,
      reserved_buffer_list: ^rft$buffer_list,
      reserved_buffer_count: rft$buffer_count,
      next_wired_buffer_in: rft$buffer_count,
      next_wired_buffer_out: rft$buffer_count,
      switch_to_wired_buffers: boolean,
      outstanding_control_messages: ^rft$outgoing_control_message,
      control_message_header: rft$nbp_control_message_header,
      maximum_outstanding_blocks: rft$outstanding_blocks,
      CASE transfer_kind: rft$transfer_kinds OF
      = rfc$tk_send_data =
        end_of_message: boolean,
        residue_data_on_send: boolean,
      = rfc$tk_receive_data =
        file_mark_received: rft$record_marks,
        complete_message_received: boolean,
        end_of_message_p: ^boolean,
      CASEND,
    RECEND;

  TYPE rft$transfer_kinds = (rfc$tk_send_data, rfc$tk_receive_data);

  TYPE
    rft$outstanding_blocks = 0 .. rfc$max_outstanding_blocks;

  TYPE
    rft$block_descriptors = ARRAY [1..*] OF
          rft$block_descriptor;

  TYPE
    rft$block_descriptor = RECORD
      block_sequence_number: rft$application_block_number,
      data_fragment_index: rft$data_fragment_count,
      data_fragment_offset: rft$data_length,
      byte_count: rft$block_size,
      wired_buffer_index: rft$buffer_count,
    RECEND;

  TYPE
    rft$header_buffers = ARRAY [1..*] OF
          rft$header_buffer;

  TYPE
    rft$header_buffer = RECORD
      header: ALIGNED [ 0 MOD 16 ] rft$nbp_block_header,
    RECEND;

  TYPE
    rft$transfer_state = RECORD
      CASE transfer_state: rft$transfer_states OF
      = rfc$ts_intermediate, rfc$ts_normal, rfc$ts_resource_limit,
        rfc$ts_resource_limit_change, rfc$ts_retryable_error,
        rfc$ts_broken, rfc$ts_fatal_error =
        ,
      = rfc$ts_alert =
        alert_kind: rft$alert_kinds,
      CASEND,
    RECEND;

  TYPE
    rft$transfer_states = (rfc$ts_intermediate, rfc$ts_normal, rfc$ts_alert,
      rfc$ts_resource_limit, rfc$ts_resource_limit_change, rfc$ts_retryable_error,
      rfc$ts_broken, rfc$ts_fatal_error);

  TYPE
    rft$alert_kinds = (rfc$ak_message_block, rfc$ak_record_block, rfc$ak_eor_block,
      rfc$ak_eof_block, rfc$ak_eoi_block, rfc$ak_long_input, rfc$ak_end_of_message);

  TYPE
    rft$transfer_mode = RECORD
      CASE transfer_mode: rft$transfer_modes OF
      = rfc$tm_message_mode, rfc$tm_unformatted_mode =
        ,
      = rfc$tm_record_mode =
        termination_mark: rft$record_marks,
      CASEND,
    RECEND;

  TYPE
    rft$transfer_modes = (rfc$tm_message_mode, rfc$tm_unformatted_mode, rfc$tm_record_mode);

  TYPE
    rft$network_wired_buffer_count =  0 .. rfc$max_network_wired_buffers;

  TYPE
    rft$network_wired_buffers = RECORD
      lock: ost$signature_lock,
      maximum_buffers: rft$network_wired_buffer_count,
      current_buffers: rft$network_wired_buffer_count,
    RECEND;

  TYPE
    rft$buffer_list = ARRAY [1..*] OF rft$wired_buffer_def;

  TYPE
      rft$wired_buffer_def = RECORD
        length: nlt$bm_buffer_length,
        byte_count: nlt$bm_buffer_length,
        current_offset: nlt$bm_buffer_length,
        descriptor: ^nlt$bm_message_descriptor,
        buffer: ^CELL,
      RECEND;

  TYPE
      rft$buffer_count = 0..rfc$max_wired_buffers_per_req+1;

  TYPE
      rft$io_fragment = RECORD
        wired: BOOLEAN,
        length: rft$transfer_length,
        address: ^CELL,
      RECEND;

  TYPE
      rft$nad_request_kinds = (rfc$rk_local_nad_load, rfc$rk_local_nad_status,
        rfc$rk_local_nad_dump, rfc$rk_local_nad_gen_stat, rfc$rk_send_data,
        rfc$rk_receive_data, rfc$rk_request_connection,
        rfc$rk_accept_connect_request, rfc$rk_reject_connect_request,
        rfc$rk_obtain_connect_request, rfc$rk_remote_nad_dump,
        rfc$rk_remote_nad_load, rfc$rk_remote_nad_gen_stat,
        rfc$rk_path_status, rfc$rk_disconnect_path,
        rfc$rk_send_control_mess, rfc$rk_receive_control_mess,
        rfc$rk_resume_pp, rfc$rk_idle_pp);

  TYPE
      rft$load_dump_states = (rfc$lt_mem_test_begin, rfc$lt_mem_test_write,
        rfc$lt_mem_test_read, rfc$ls_begin_load, rfc$ls_sending_microcode,
        rfc$ls_sending_init_prams, rfc$ls_send_go, rfc$ls_go_sent,
        rfc$ls_get_mc_status, rfc$ds_begin_dump, rfc$ds_continue_dump,
        rfc$ds_end_of_dump);

  TYPE
      rft$nad_test_data = (rfc$nt_inc_addr, rfc$nt_dec_addr, rfc$nt_con_5555,
        rfc$nt_con_aaaa);

  TYPE
      rft$failure_data_symptoms =
        (rfc$function_timeout, rfc$channel_activate_failed, rfc$channel_hung_empty, rfc$prime_flag_timeout,
         rfc$flag_function_timeout, rfc$abnormal_nad_response, rfc$nad_hardware_abnormal,
         rfc$input_terminated_early, rfc$output_terminated_early, rfc$channel_parity_error,
         rfc$universal_command_timeout, rfc$memory_error_address, rfc$concurrent_channel_error);

?? PUSH (LISTEXT := ON) ??
*copyc amt$local_file_name
*copyc amt$file_identifier
*copyc iot$pp_number
*copyc iot$logical_unit
*copyc ost$wait
*copyc ost$status
*copyc ost$activity_status
*copyc nat$data_fragments
*copyc nlt$bm_message_descriptor
*copyc rfc$r1_interface_defs
*copyc rfd$mc_initialization_prams
*copyc rft$network_block_protocol
*copyc rft$pp_interface_defs
*copyc rft$configuration_defs
*copyc rft$rhfam_event_table
*copyc rft$rhfam_server_table
*copyc rft$rhfam_job_table
?? POP ??

