# 1 "device.defs"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "device.defs"
# 1 "/usr/local/include/device/device.defs" 1 3
# 39 "/usr/local/include/device/device.defs" 3
subsystem



         device 2800;

# 1 "/usr/local/include/mach/std_types.defs" 1 3
# 33 "/usr/local/include/mach/std_types.defs" 3
type char = MACH_MSG_TYPE_CHAR;
type short = MACH_MSG_TYPE_INTEGER_16;
type int = MACH_MSG_TYPE_INTEGER_32;
type int32 = MACH_MSG_TYPE_INTEGER_32;
type int64 = MACH_MSG_TYPE_INTEGER_64;
type boolean_t = MACH_MSG_TYPE_BOOLEAN;
type unsigned = MACH_MSG_TYPE_INTEGER_32;
type unsigned32 = MACH_MSG_TYPE_INTEGER_32;
type unsigned64 = MACH_MSG_TYPE_INTEGER_64;


# 1 "/usr/local/include/mach/machine/machine_types.defs" 1 3
# 50 "/usr/local/include/mach/machine/machine_types.defs" 3
type natural_t = unsigned32;
# 59 "/usr/local/include/mach/machine/machine_types.defs" 3
type integer_t = int32;
# 45 "/usr/local/include/mach/std_types.defs" 2 3

type kern_return_t = int;

type pointer_t = ^array[] of MACH_MSG_TYPE_BYTE
 ctype: vm_offset_t;


type mach_port_t = MACH_MSG_TYPE_COPY_SEND;
type mach_port_array_t = array[] of mach_port_t;

type mach_port_name_t = MACH_MSG_TYPE_PORT_NAME
 ctype: mach_port_t;
type mach_port_name_array_t = array[] of mach_port_name_t
 ctype: mach_port_array_t;

type mach_port_right_t = natural_t;

type mach_port_type_t = natural_t;
type mach_port_type_array_t = array[] of mach_port_type_t;

type mach_port_urefs_t = natural_t;
type mach_port_delta_t = integer_t;
type mach_port_seqno_t = natural_t;
type mach_port_mscount_t = unsigned;
type mach_port_msgcount_t = unsigned;
type mach_port_rights_t = unsigned;
type mach_msg_id_t = integer_t;
type mach_msg_type_name_t = unsigned;
type mach_msg_type_number_t = natural_t;

type mach_port_move_receive_t = MACH_MSG_TYPE_MOVE_RECEIVE
 ctype: mach_port_t;
type mach_port_copy_send_t = MACH_MSG_TYPE_COPY_SEND
 ctype: mach_port_t;
type mach_port_make_send_t = MACH_MSG_TYPE_MAKE_SEND
 ctype: mach_port_t;
type mach_port_move_send_t = MACH_MSG_TYPE_MOVE_SEND
 ctype: mach_port_t;
type mach_port_make_send_once_t = MACH_MSG_TYPE_MAKE_SEND_ONCE
 ctype: mach_port_t;
type mach_port_move_send_once_t = MACH_MSG_TYPE_MOVE_SEND_ONCE
 ctype: mach_port_t;

type mach_port_receive_t = MACH_MSG_TYPE_PORT_RECEIVE
 ctype: mach_port_t;
type mach_port_send_t = MACH_MSG_TYPE_PORT_SEND
 ctype: mach_port_t;
type mach_port_send_once_t = MACH_MSG_TYPE_PORT_SEND_ONCE
 ctype: mach_port_t;

type mach_port_poly_t = polymorphic
 ctype: mach_port_t;

import <mach/std_types.h>;
# 46 "/usr/local/include/device/device.defs" 2 3
# 1 "/usr/local/include/mach/mach_types.defs" 1 3
# 61 "/usr/local/include/mach/mach_types.defs" 3
type mach_port_status_t = struct[9] of integer_t;

type old_mach_port_status_t = struct[8] of integer_t;

type task_t = mach_port_t
  ctype: mach_port_t





  ;
# 85 "/usr/local/include/mach/mach_types.defs" 3
type thread_t = mach_port_t
  ctype: mach_port_t





  ;

type thread_state_t = array[*:1024] of natural_t;

type task_array_t = ^array[] of task_t;
type thread_array_t = ^array[] of thread_t;

type vm_task_t = mach_port_t
  ctype: mach_port_t




  ;

type ipc_space_t = mach_port_t
  ctype: mach_port_t




  ;

type vm_address_t = natural_t;
type vm_offset_t = natural_t;
type vm_size_t = natural_t;
type vm_prot_t = int;
type vm_inherit_t = int;
type vm_statistics_data_t = struct[13] of integer_t;
type vm_machine_attribute_t = int;
type vm_machine_attribute_val_t = int;

type thread_info_t = array[*:1024] of natural_t;
type thread_basic_info_data_t = struct[11] of integer_t;
type thread_sched_info_data_t = struct[7] of integer_t;

type task_info_t = array[*:1024] of natural_t;
type task_basic_info_data_t = struct[8] of integer_t;
type task_events_info = struct[7] of natural_t;
type task_thread_times_info_data_t = struct[4] of integer_t;


type memory_object_t = mach_port_t
  ctype: mach_port_t



  ;

type memory_object_control_t = mach_port_t
  ctype: mach_port_t



  ;

type memory_object_name_t = mach_port_t
  ctype: mach_port_t




  ;

type memory_object_copy_strategy_t = int;
type memory_object_return_t = int;

type machine_info_data_t = struct[5] of integer_t;
type machine_slot_data_t = struct[8] of integer_t;

type host_t = mach_port_t
  ctype: mach_port_t




  ;

type host_priv_t = mach_port_t
  ctype: mach_port_t



  ;

type host_info_t = array[*:1024] of natural_t;
type host_basic_info_data_t = struct[5] of integer_t;
type host_sched_info_data_t = struct[2] of integer_t;
type host_load_info_data_t = struct[6] of integer_t;


type processor_t = mach_port_t
  ctype: mach_port_t




  ;

type processor_array_t = ^array[] of processor_t;
type processor_info_t = array[*:1024] of natural_t;
type processor_basic_info_data_t = struct[5] of integer_t;


type processor_set_t = mach_port_t
  ctype: mach_port_t





  ;

type processor_set_array_t = ^array[] of processor_set_t;

type processor_set_name_t = mach_port_t
  ctype: mach_port_t





  ;

type processor_set_name_array_t = ^array[] of processor_set_name_t;

type processor_set_info_t = array[*:1024] of natural_t;
type processor_set_basic_info_data_t = struct[5] of integer_t;
type processor_set_sched_info_data_t = struct[2] of integer_t;


type kernel_version_t = (MACH_MSG_TYPE_STRING, 512*8);

type kernel_boot_info_t = (MACH_MSG_TYPE_STRING, 4096*8);

type time_value_t = struct[2] of integer_t;

type emulation_vector_t = ^array[] of vm_offset_t;

type xxx_emulation_vector_t = array[*:1024] of vm_offset_t
     ctype: emulation_vector_t;


type rpc_signature_info_t = array[*:1024] of int;
# 250 "/usr/local/include/mach/mach_types.defs" 3
import <mach/mach_types.h>;
# 47 "/usr/local/include/device/device.defs" 2 3
# 1 "/usr/local/include/device/device_types.defs" 1 3
# 42 "/usr/local/include/device/device_types.defs" 3
type recnum_t = unsigned32;
type dev_mode_t = unsigned32;
type dev_flavor_t = unsigned32;
type dev_name_t = (MACH_MSG_TYPE_STRING_C, 8*128);
type dev_status_t = array[*:1024] of int;
type io_buf_ptr_t = ^array[] of MACH_MSG_TYPE_INTEGER_8;
type io_buf_ptr_inband_t= array[*:128] of char;
type filter_t = short;
type filter_array_t = array[*:128] of filter_t;

type device_t = mach_port_t
  ctype: mach_port_t





  ;

import <device/device_types.h>;
import <device/net_status.h>;
# 48 "/usr/local/include/device/device.defs" 2 3

serverprefix ds_;

type reply_port_t = MACH_MSG_TYPE_MAKE_SEND_ONCE | polymorphic
 ctype: mach_port_t;

routine device_open(
  master_port : mach_port_t;
 sreplyport reply_port : reply_port_t;
  mode : dev_mode_t;
  name : dev_name_t;
 out device : mach_port_send_t
 );

routine device_close(
  device : device_t
 );

routine device_write(
  device : device_t;
 sreplyport reply_port : reply_port_t;
 in mode : dev_mode_t;
 in recnum : recnum_t;
 in data : io_buf_ptr_t;
 out bytes_written : int
 );

routine device_write_inband(
  device : device_t;
 sreplyport reply_port : reply_port_t;
 in mode : dev_mode_t;
 in recnum : recnum_t;
 in data : io_buf_ptr_inband_t;
 out bytes_written : int
 );

routine device_read(
  device : device_t;
 sreplyport reply_port : reply_port_t;
 in mode : dev_mode_t;
 in recnum : recnum_t;
 in bytes_wanted : int;
 out data : io_buf_ptr_t
 );

routine device_read_inband(
  device : device_t;
 sreplyport reply_port : reply_port_t;
 in mode : dev_mode_t;
 in recnum : recnum_t;
 in bytes_wanted : int;
 out data : io_buf_ptr_inband_t
 );


routine xxx_device_set_status(
  device : device_t;
 in flavor : dev_flavor_t;
 in status : dev_status_t, IsLong
 );


routine xxx_device_get_status(
  device : device_t;
 in flavor : dev_flavor_t;
 out status : dev_status_t, IsLong
 );


routine xxx_device_set_filter(
  device : device_t;
 in receive_port : mach_port_send_t;
 in priority : int;
 in filter : filter_array_t, IsLong
 );

routine device_map(
  device : device_t;
 in prot : vm_prot_t;
 in offset : vm_offset_t;
 in size : vm_size_t;
 out pager : memory_object_t;
 in unmap : int
 );

routine device_set_status(
  device : device_t;
 in flavor : dev_flavor_t;
 in status : dev_status_t
 );

routine device_get_status(
  device : device_t;
 in flavor : dev_flavor_t;
 out status : dev_status_t, CountInOut
 );

routine device_set_filter(
  device : device_t;
 in receive_port : mach_port_send_t;
 in priority : int;
 in filter : filter_array_t
 );
# 1 "device.defs" 2