/* * Mach Operating System * Copyright (c) 1991,1990,1989 Carnegie Mellon University * All Rights Reserved. * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. * * Carnegie Mellon requests users of this software to return to * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ /* * File: device/device.defs * Author: Douglas Orr * Feb 10, 1988 * Abstract: * Mach device support. Mach devices are accessed through * block and character device interfaces to the kernel. */ subsystem #if KERNEL_SERVER KernelServer #endif device 2800; #include #include #include serverprefix ds_; type reply_port_t = MACH_MSG_TYPE_MAKE_SEND_ONCE | polymorphic ctype: mach_port_t #ifndef KERNEL_SERVER #ifdef MACH_PAYLOAD_TO_PORT intranpayload: mach_port_t MACH_PAYLOAD_TO_PORT #endif /* MACH_PAYLOAD_TO_PORT */ #endif /* KERNEL_SERVER */ ; routine device_open( master_port : mach_port_t; sreplyport reply_port : reply_port_t; mode : dev_mode_t; name : dev_name_t; out device : device_t = MACH_MSG_TYPE_PORT_SEND ctype: mach_port_t #if KERNEL_SERVER outtran: mach_port_t convert_device_to_port(device_t) #else #ifdef DEVICE_OUTTRAN outtran: DEVICE_OUTTRAN #endif #endif /* KERNEL_SERVER */ ); 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, dealloc ); 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 ); skip; /* old xxx_device_set_status */ skip; /* old xxx_device_get_status */ skip; /* old xxx_device_set_filter*/ 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 ); routine device_intr_register( device : device_t; in id : int; in flags : int; in receive_port : mach_port_send_t ); /* * Acknowledge the specified interrupt notification. */ /* * When an IRQ happens and an intr notification is thus sent, the IRQ line * is kept disabled until the notification is acknowledged with this RPC */ routine device_intr_ack( device : device_t; in receive_port : mach_port_send_t);