
{    DECK : RFT$PP_INTERFACE_DEFS
{
{    The purpose of this deck is to define the various CYBIL types which
{    are used to interface between the RHFAM CPU and PP programs.


  TYPE
      rft$peripheral_request = PACKED RECORD
        fill1: 0..0ffff(16),
        next_pp_request: ^iot$io_request,
        fill2: 0..0ffffffff(16),
        next_pp_request_rma: ost$real_memory_address,
        request_length: rft$request_length,
        logical_unit: iot$logical_unit,
        recovery: iot$request_recovery,
        interrupt: iot$interrupt,
        priority: iot$priority,
        alert_mask: rft$alert_conditions,
        fill4: 0..0ffff(16),
        request_buffer_ptr: ^rft$request_response_buffer,
      RECEND;

  TYPE
      rft$request_length = 0..0ffff(16);

  TYPE
      rft$transfer_length = 0..0ffff(16);

  TYPE
      rft$alert_conditions = PACKED RECORD
        long_input_block: BOOLEAN,
        eoi_mark_encountered: BOOLEAN,
        eof_mark_encountered: BOOLEAN,
        eor_mark_encountered: BOOLEAN,
        pru_block_next: BOOLEAN,
        non_pru_block_next: BOOLEAN,
        end_of_message: BOOLEAN,
        fill_2: 0..1ff(16),
      RECEND;

  TYPE
      rft$abnormal_status = PACKED RECORD
        alert_condition_encountered: BOOLEAN,
        interface_error: BOOLEAN,
        fill1: 0..1,
        channel_parity_error: BOOLEAN,
        fill2: 0..3,
        channel_hung_empty: BOOLEAN,
        universal_command_timeout: BOOLEAN,
        function_timeout: BOOLEAN,
        flag_function_timeout: BOOLEAN,
        prime_flag_timeout: BOOLEAN,
        hardware_fault: BOOLEAN,
        channel_activate_failed: BOOLEAN,
        invalid_status_value: BOOLEAN,
        input_transfer_abnormal: BOOLEAN,
        output_transfer_abnormal: BOOLEAN,
      RECEND;

  TYPE
      rft$detailed_status = PACKED RECORD
        last_mc_function: rft$nad_function_codes,
        last_mc_status: rft$nad_status_flags,
        last_hw_function: rft$nad_function_codes,
        last_hw_status: rft$nad_status_flags,
      RECEND;

  TYPE
      rft$nad_function_codes = 0..0ffff(16);

  TYPE
      rft$request_response_buffer = RECORD
        io_request: ALIGNED [0 MOD 1024] iot$io_request,
        rhfam_request: ALIGNED [0 MOD 8] rft$peripheral_request,
        command_buffer: ALIGNED [0 MOD 8] SEQ(REP  rfc$command_buffer_size  OF rft$command),
        response: ALIGNED [0 MOD 8] iot$pp_response,
        detailed_status: ALIGNED [0 MOD 8] rft$detailed_status,
        previous_in_ptr: rft$command_entry,
        previous_out_ptr: rft$command_entry,
        asynchronous_request: BOOLEAN,
        response_posted: BOOLEAN,
        task_id: ost$global_task_id,
        request_id: rft$request_identifier,
        response_seq_number: INTEGER,
      RECEND;

  TYPE
      rft$command_entry = 1..rfc$command_buffer_size;

  TYPE
      rft$command_code = 0..0ff(16);

{    Each variant of this record must be exactly one central memory word (i.e. 8 bytes).

  TYPE
      rft$command = PACKED RECORD
        CASE  rft$command_types  OF
        = rfc$ct_pp_command =
          pp_function_code: rft$command_code,
          pp_flags: rft$function_flags,
          pp_fill: 0..0ffffffffffff(16),
        = rfc$ct_logical_command_1 =
          lc_function_code: rft$command_code,
          lc_flags: rft$function_flags,
          lc_length: rft$transfer_length,
          lc_rma: ost$real_memory_address,
        = rfc$ct_logical_command_2 =
          CASE  rft$logical_commands  OF
          = rfc$lc_obtain_connect_request, rfc$lc_receive_control_message =
            cm_physical_from: rft$physical_from,
            cm_fill: 0..0ffff(16),
            cm_path_id: rft$path_identifier,
          = rfc$lc_reject_connect_request =
            rc_reject_code: rft$reject_code,
            rc_fill: 0..0ffff(16),
            rc_path_id: rft$path_identifier,
          = rfc$lc_obtain_nad_general_stat =
            os_retry_count: rft$retry_count,
            os_fill: 0..0ffffffff(16),
            os_path_id: rft$path_identifier,
          = rfc$lc_send_data, rfc$lc_receive_data =
            io_retry_count: rft$retry_count,
            io_previous_in_pointer: rft$request_length,
            io_in_pointer_change: rft$request_length,
            io_path_id: rft$path_identifier,
          = rfc$lc_request_connection, rfc$lc_accept_connect_request,
              rfc$lc_status_nad, rfc$lc_send_control_message,
              rfc$lc_disconnect_paths,
              rfc$lc_read_path_status_table, rfc$lc_process_physical_command =
            lc_fill: 0..0ffffffffffff(16),
            lc_path_id: rft$path_identifier,
          CASEND,
        = rfc$ct_physical_command =
          pc_function_code: rft$command_code,
          pc_fill: 0..0ff(16),
          CASE  rft$physical_commands  OF
          = rfc$pc_function_nad =
            fn_fill: 0..0ffffffff(16),
            fn_nad_function_code: rft$nad_function_codes,
          = rfc$pc_microcode_status, rfc$pc_hardware_status =
            st_fill: 0..0ffff(16),
            st_mask: rft$nad_status_flags,
            st_value: rft$nad_status_flags,
          = rfc$pc_output_8_in_8_mode, rfc$pc_input_8_in_8_mode,
              rfc$pc_set_addr_and_length =
            pc_length: rft$transfer_length,
            pc_rma: ost$real_memory_address,
          CASEND,
        = rfc$ct_buffer_pointer =
          bp_more_data: BOOLEAN,
          bp_fill: 0..07fffffffffff(16),
          bp_offset: rft$request_length,
        = rfc$ct_subfunction_header =
          sf_length: rft$request_length,
          sf_buffer_length: rft$transfer_length,
          sf_transfer_length: rft$transfer_length,
          sf_fill: 0..0ffff(16),
        = rfc$ct_rma_entry =
          CASE wired: BOOLEAN OF
          = TRUE =
            re_fill: 0..07fff(16),
            re_length: rft$transfer_length,
            re_address: ost$real_memory_address,
          = FALSE =
            pe_fill1: 0..07fff(16),
            pe_length: rft$transfer_length,
            pe_fill2: 0..0ffff(16),
            pe_pva_index: 0..0ffff(16),
          CASEND,
        = rfc$ct_pva_entry =
          pv_fill: 0..0ffff(16),
          pv_pva: ^CELL,
        = rfc$ct_nad_memory_loc =
          nm_addr: rft$transfer_lgth_addr,
          nm_length: rft$transfer_lgth_addr,
        CASEND,
      RECEND;

  TYPE
      rft$command_types = (rfc$ct_pp_command, rfc$ct_logical_command_1, rfc$ct_logical_command_2,
        rfc$ct_physical_command, rfc$ct_buffer_pointer, rfc$ct_subfunction_header,
        rfc$ct_rma_entry,rfc$ct_pva_entry, rfc$ct_nad_memory_loc);

  TYPE
      rft$path_identifier = 0..0ffff(16);

  TYPE
      rft$reject_code = 0..0ffffffff(16);

  TYPE
      rft$retry_count = 0..0ffff(16);

  TYPE
      rft$transfer_lgth_addr = PACKED RECORD
        fill1: 0..0ff(16),
        upper_8_bits: 0..0ff(16),
        fill2: 0..0ff(16),
        lower_8_bits: 0..0ff(16),
      RECEND;

{    This entry must be exactly 4 bytes.

  TYPE
       rft$physical_from = PACKED RECORD
         address: rft$nad_address,
         unused: BOOLEAN,
         criteria: rft$physical_from_criteria,
         compare_name: BOOLEAN,
         device: rft$destination_device_address,
         char1: STRING(1),
         char2: STRING(1),
       RECEND;

{    This record must be exactly one byte.

  TYPE
       rft$function_flags = PACKED RECORD
         store_response: BOOLEAN,
         indirect_address: BOOLEAN,
         pp_processing: BOOLEAN,
         pp_process_complete: BOOLEAN,
         flush_buffer: BOOLEAN,
         CASE  rft$logical_commands  OF
         = rfc$lc_request_connection =
           maintenance_connection: BOOLEAN,
           fill1: 0..3,
         = rfc$lc_send_data, rfc$lc_receive_data =
           send_intermediate_response: BOOLEAN,
           fill2: 0..3,
         = rfc$lc_status_nad =
           unconditionally_status: BOOLEAN,
           fill3: 0..3,
         = rfc$lc_receive_control_message =
           rejected_control_message: BOOLEAN,
           fill4: 0..3,
         = rfc$lc_disconnect_paths =
           abnormal_termination: BOOLEAN,
           fill5: 0..3,
         = rfc$lc_obtain_nad_general_stat =
           primed: BOOLEAN,
           fill6: 0..3,
         = rfc$lc_obtain_connect_request, rfc$lc_accept_connect_request,
             rfc$lc_reject_connect_request, rfc$lc_read_path_status_table,
             rfc$lc_send_control_message, rfc$lc_process_physical_command =
           fill7: 0..7,
         CASEND,
       RECEND;


  TYPE
      rft$physical_from_criteria = rfc$min_pf_criteria .. rfc$max_pf_criteria;

  TYPE
      rft$logical_commands = rfc$min_logical_command .. rfc$max_logical_command;

  TYPE
      rft$physical_commands = rfc$min_physical_command .. rfc$max_physical_command;

  TYPE
      rft$pp_commands = rfc$min_pp_command .. rfc$max_pp_command;

  TYPE
      rft$nad_status_kinds = (rfc$sk_microcode_status, rfc$sk_hardware_status);

  TYPE
      rft$io_types = (rfc$io_input, rfc$io_output);

{    Both of the following variants must be exactly 16 bits.

  TYPE
      rft$nad_status_flags = PACKED RECORD
        CASE  rft$nad_status_kinds  OF
        = rfc$sk_microcode_status =
          fill1: 0..01f(16),
          hardware_fault: BOOLEAN,
          primed_flag: BOOLEAN,
          function_flag: BOOLEAN,
          selected_path: BOOLEAN,
          input_available: BOOLEAN,
          output_below_threshold: BOOLEAN,
          response: 0..01f(16),
        = rfc$sk_hardware_status =
          fill2: 0..3f(16),
          di_error: BOOLEAN,
          residue_error: BOOLEAN,
          assembly_disassembly_error: BOOLEAN,
          channel_sequence_error: BOOLEAN,
          device_not_enabled: BOOLEAN,
          illegal_function: BOOLEAN,
          memory_parity_error: BOOLEAN,
          nad_processor_abnormal: BOOLEAN,
          nad_processor_not_running: BOOLEAN,
          channel_parity_error: BOOLEAN,
        CASEND,
      RECEND;

  TYPE
      rft$nad_state_flags = PACKED RECORD
        disabled: BOOLEAN,
        down: BOOLEAN,
        fill: 0..3fff(16),
      RECEND;

  TYPE
      rft$pp_interface_error = RECORD
        pp_number: iot$pp_number,
        interface_error_code: iot$interface_error_code,
      RECEND;


?? PUSH (LISTEXT := ON) ??
*copyc rfc$pp_interface_defs
*copyc iot$io_request
*copyc ost$global_task_id
*copyc rft$r1_interface_defs
?? POP ??

