Annotation of driverkit/Config/ConfigPrivate.h, revision 1.1.1.1

1.1       root        1: /*
                      2:  * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
                      3:  *
                      4:  * @APPLE_LICENSE_HEADER_START@
                      5:  * 
                      6:  * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
                      7:  * Reserved.  This file contains Original Code and/or Modifications of
                      8:  * Original Code as defined in and that are subject to the Apple Public
                      9:  * Source License Version 1.1 (the "License").  You may not use this file
                     10:  * except in compliance with the License.  Please obtain a copy of the
                     11:  * License at http://www.apple.com/publicsource and read it before using
                     12:  * this file.
                     13:  * 
                     14:  * The Original Code and all software distributed under the License are
                     15:  * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
                     16:  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
                     17:  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
                     18:  * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT.  Please see the
                     19:  * License for the specific language governing rights and limitations
                     20:  * under the License.
                     21:  * 
                     22:  * @APPLE_LICENSE_HEADER_END@
                     23:  */
                     24: /*     Copyright (c) 1991 NeXT Computer, Inc.  All rights reserved. 
                     25:  *
                     26:  * ConfigPrivate.h - private #defines for Config server.
                     27:  *
                     28:  * HISTORY
                     29:  * 11-Apr-91    Doug Mitchell at NeXT
                     30:  *      Created. 
                     31:  */
                     32:  
                     33: #ifndef        _CONFIG_PRIVATE_H_
                     34: #define _CONFIG_PRIVATE_H_
                     35: 
                     36: #import <bsd/sys/types.h> 
                     37: #import <driverkit/debugging.h>
                     38: #import <kernserv/queue.h>
                     39: #import <mach/cthreads.h>
                     40: #import <bsd/sys/dir.h>
                     41: 
                     42: /*
                     43:  * Typedefs for identifying executable driver files.
                     44:  */
                     45: typedef unsigned long file_id_t;               // like fileno
                     46: #define FILENAME_SIZE  (MAXNAMLEN+1)
                     47: typedef char filename_t[FILENAME_SIZE];                // human-readable name
                     48: 
                     49: /*
                     50:  * A list of these is maintained in driver_list. One driver_entry_t per driver.
                     51:  * dev_list contains a list of dev_entry_t's, allowing mapping multiple devices
                     52:  * to one driver.
                     53:  */
                     54: typedef struct {
                     55:        queue_head_t    dev_list;
                     56:        file_id_t       executable_fid; 
                     57:        filename_t      filename;               // name of executable
                     58:        port_t          driver_port;            // created by driver
                     59:        port_t          driver_sig_port;        // created by us
                     60:        port_t          boot_requestor;         // requestor_port for 
                     61:                                                //   bootstrap_subset()
                     62:        boolean_t       running;                // we've exec'd it
                     63:        queue_chain_t   link;
                     64: } driver_entry_t;
                     65: 
                     66: /*
                     67:  * One per dev_port to which driver has rights.
                     68:  */
                     69: typedef struct {       
                     70:        port_t          dev_port;               // created by kernel
                     71:        IODeviceType    dev_type;
                     72:        IOSlotId        slot_id;
                     73:        IODeviceNumber  dev_number;
                     74:        driver_entry_t  *driver_entry;          // in whose dev_list this 
                     75:                                                //   resides
                     76:        queue_chain_t   link;
                     77: } dev_entry_t; 
                     78: 
                     79: 
                     80: /*
                     81:  * XPR control.
                     82:  */
                     83: #define XPR_CONFIG_INDEX       0
                     84: 
                     85: #ifdef DDM_DEBUG
                     86: 
                     87: #define XPR_CONFIG     0x00000001
                     88: #define XPR_SERVER     0x00000002
                     89: #define XPR_COMMON     0x00000004
                     90: #define XPR_ERR                0x00000008
                     91: 
                     92: #define xpr_config(x, a, b, c, d, e) {                                 \
                     93:        if(IODDMMasks[XPR_CONFIG_INDEX] & XPR_CONFIG) {                 \
                     94:                IOAddDDMEntry(x, (int)a, (int)b, (int)c, (int)d, (int)e);       \
                     95:                if(verbose)                                             \
                     96:                        printf(x, a, b, c, d, e);                       \
                     97:        }                                                               \
                     98: }
                     99: #define xpr_server(x, a, b, c, d, e) {                                 \
                    100:        if(IODDMMasks[XPR_CONFIG_INDEX] & XPR_SERVER) {                 \
                    101:                IOAddDDMEntry(x, (int)a, (int)b, (int)c, (int)d, (int)e);       \
                    102:                if(verbose)                                             \
                    103:                        printf(x, a, b, c, d, e);                       \
                    104:        }                                                               \
                    105: }
                    106: #define xpr_common(x, a, b, c, d, e) {                                 \
                    107:        if(IODDMMasks[XPR_CONFIG_INDEX] & XPR_COMMON) {                 \
                    108:                IOAddDDMEntry(x, (int)a, (int)b, (int)c, (int)d, (int)e);       \
                    109:                if(verbose)                                             \
                    110:                        printf(x, a, b, c, d, e);                       \
                    111:        }                                                               \
                    112: }
                    113: #define xpr_err(x, a, b, c, d, e) {                                    \
                    114:        if(IODDMMasks[XPR_CONFIG_INDEX] & XPR_ERR) {                    \
                    115:                IOAddDDMEntry(x, (int)a, (int)b, (int)c, (int)d, (int)e);       \
                    116:        }                                                               \
                    117:        printf(x, a, b, c, d, e);                                       \
                    118: }
                    119: 
                    120: #else  DDM_DEBUG
                    121: 
                    122: #define xpr_config(x, a, b, c, d, e)
                    123: #define xpr_server(x, a, b, c, d, e)
                    124: #define xpr_common(x, a, b, c, d, e)
                    125: #define xpr_err(x, a, b, c, d, e)
                    126: 
                    127: #endif DDM_DEBUG
                    128: 
                    129: /*
                    130:  * Externs.
                    131:  */
                    132: extern queue_head_t driver_list;
                    133: extern mutex_t driver_list_lock;
                    134: extern condition_t driver_list_cond;
                    135: extern boolean_t driver_list_locked;
                    136: extern int verbose;
                    137: extern port_t device_master_port;
                    138: 
                    139: #endif _CONFIG_PRIVATE_H_

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.