|
|
1.1 ! root 1: /* ! 2: * Mach Operating System ! 3: * Copyright (c) 1993,1991,1990,1989 Carnegie Mellon University ! 4: * All Rights Reserved. ! 5: * ! 6: * Permission to use, copy, modify and distribute this software and its ! 7: * documentation is hereby granted, provided that both the copyright ! 8: * notice and this permission notice appear in all copies of the ! 9: * software, derivative works or modified versions, and any portions ! 10: * thereof, and that both notices appear in supporting documentation. ! 11: * ! 12: * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" ! 13: * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR ! 14: * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. ! 15: * ! 16: * Carnegie Mellon requests users of this software to return to ! 17: * ! 18: * Software Distribution Coordinator or [email protected] ! 19: * School of Computer Science ! 20: * Carnegie Mellon University ! 21: * Pittsburgh PA 15213-3890 ! 22: * ! 23: * any improvements or extensions that they make and grant Carnegie Mellon ! 24: * the rights to redistribute these changes. ! 25: */ ! 26: /* ! 27: * Author: David B. Golub, Carnegie Mellon University ! 28: * Date: 8/88 ! 29: */ ! 30: ! 31: #ifndef _DEVICE_CONF_H_ ! 32: #define _DEVICE_CONF_H_ ! 33: ! 34: #include <mach/machine/vm_types.h> ! 35: ! 36: /* ! 37: * Operations list for major device types. ! 38: */ ! 39: struct dev_ops { ! 40: char * d_name; /* name for major device */ ! 41: int (*d_open)(); /* open device */ ! 42: int (*d_close)(); /* close device */ ! 43: int (*d_read)(); /* read */ ! 44: int (*d_write)(); /* write */ ! 45: int (*d_getstat)(); /* get status/control */ ! 46: int (*d_setstat)(); /* set status/control */ ! 47: vm_offset_t (*d_mmap)(); /* map memory */ ! 48: int (*d_async_in)();/* asynchronous input setup */ ! 49: int (*d_reset)(); /* reset device */ ! 50: int (*d_port_death)(); ! 51: /* clean up reply ports */ ! 52: int d_subdev; /* number of sub-devices per ! 53: unit */ ! 54: int (*d_dev_info)(); /* driver info for kernel */ ! 55: }; ! 56: typedef struct dev_ops *dev_ops_t; ! 57: ! 58: /* ! 59: * Routines for null entries. ! 60: */ ! 61: extern int nulldev(); /* no operation - OK */ ! 62: extern int nodev(); /* no operation - error */ ! 63: extern vm_offset_t nomap(); /* no operation - error */ ! 64: ! 65: /* ! 66: * Flavor constants for d_dev_info routine ! 67: */ ! 68: #define D_INFO_BLOCK_SIZE 1 ! 69: ! 70: /* ! 71: * Head of list of attached devices ! 72: */ ! 73: extern struct dev_ops dev_name_list[]; ! 74: extern int dev_name_count; ! 75: ! 76: /* ! 77: * Macro to search device list ! 78: */ ! 79: #define dev_search(dp) \ ! 80: for (dp = dev_name_list; \ ! 81: dp < &dev_name_list[dev_name_count]; \ ! 82: dp++) ! 83: ! 84: /* ! 85: * Indirection vectors for certain devices. ! 86: */ ! 87: struct dev_indirect { ! 88: char * d_name; /* name for device */ ! 89: dev_ops_t d_ops; /* operations (major device) */ ! 90: int d_unit; /* and unit number */ ! 91: }; ! 92: typedef struct dev_indirect *dev_indirect_t; ! 93: ! 94: /* ! 95: * List of indirect devices. ! 96: */ ! 97: extern struct dev_indirect dev_indirect_list[]; ! 98: extern int dev_indirect_count; ! 99: ! 100: /* ! 101: * Macro to search indirect list ! 102: */ ! 103: #define dev_indirect_search(di) \ ! 104: for (di = dev_indirect_list; \ ! 105: di < &dev_indirect_list[dev_indirect_count]; \ ! 106: di++) ! 107: ! 108: /* ! 109: * Exported routine to set indirection. ! 110: */ ! 111: extern void dev_set_indirect(); ! 112: ! 113: #endif /* _DEVICE_CONF_H_ */ ! 114:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.