Annotation of kernel/kern/xpr.h, revision 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: 
        !            25: /* 
        !            26:  * Mach Operating System
        !            27:  * Copyright (c) 1989 Carnegie-Mellon University
        !            28:  * Copyright (c) 1988 Carnegie-Mellon University
        !            29:  * Copyright (c) 1987 Carnegie-Mellon University
        !            30:  * All rights reserved.  The CMU software License Agreement specifies
        !            31:  * the terms and conditions for use and redistribution.
        !            32:  */
        !            33: /*
        !            34:  * HISTORY
        !            35:  * Revision 1.1.1.1  1997/09/30 02:44:35  wsanchez
        !            36:  * Import of kernel from umeshv/kernel
        !            37:  *
        !            38:  *
        !            39:  * 21-Jan-92  Doug Mitchell at NeXT
        !            40:  *     Added support for m88k uxpr module.
        !            41:  *
        !            42:  * 22-Jun-89  Mike DeMoney (mike) at NeXT.
        !            43:  *     Put xpr macro in {}'s so it wouldn't steal a following "else" clause.
        !            44:  *
        !            45:  * Revision 2.10  89/05/30  10:38:29  rvb
        !            46:  *     Removed Mips crud.
        !            47:  *     [89/04/20            af]
        !            48:  * 
        !            49:  * Revision 2.9  89/03/09  20:17:45  rpd
        !            50:  *     More cleanup.
        !            51:  * 
        !            52:  * Revision 2.8  89/02/25  18:11:09  gm0w
        !            53:  *     Kernel code cleanup.
        !            54:  *     Made XPR_DEBUG stuff always true outside the kernel
        !            55:  *     [89/02/15            mrt]
        !            56:  * 
        !            57:  * Revision 2.7  89/02/07  01:06:11  mwyoung
        !            58:  * Relocated from sys/xpr.h
        !            59:  * 
        !            60:  * Revision 2.6  89/01/23  22:30:39  af
        !            61:  *     Added more flags, specific to Mips.  Should eventually integrate,
        !            62:  *     but for now there are conflicts.
        !            63:  *     Also made it usable from assembly code.
        !            64:  *     [89/01/05            af]
        !            65:  * 
        !            66:  * Revision 2.5  88/12/19  02:51:59  mwyoung
        !            67:  *     Added VM system tags.
        !            68:  *     [88/11/22            mwyoung]
        !            69:  * 
        !            70:  * Revision 2.4  88/08/24  02:55:54  mwyoung
        !            71:  *     Adjusted include file references.
        !            72:  *     [88/08/17  02:29:56  mwyoung]
        !            73:  *
        !            74:  *  9-Apr-88  Daniel Julin (dpj) at Carnegie-Mellon University
        !            75:  *     Added flags for TCP and MACH_NP debugging.
        !            76:  *
        !            77:  *  6-Jan-88  Michael Young (mwyoung) at Carnegie-Mellon University
        !            78:  *     Make the event structure smaller to make it easier to read from
        !            79:  *     kernel debuggers.
        !            80:  *
        !            81:  * 16-Mar-87  Mike Accetta (mja) at Carnegie-Mellon University
        !            82:  *     MACH:  made XPR_DEBUG definition conditional on MACH
        !            83:  *     since the routines invoked under it won't link without MACH.
        !            84:  *     [ V5.1(F7) ]
        !            85:  */
        !            86: /*
        !            87:  * Include file for xpr circular buffer silent tracing.  
        !            88:  *
        !            89:  */
        !            90: 
        !            91: /*
        !            92:  * If the kernel flag XPRDEBUG is set, the XPR macro is enabled.  The 
        !            93:  * macro should be invoked something like the following:
        !            94:  *     XPR(XPR_SYSCALLS, ("syscall: %d, 0x%x\n", syscallno, arg1));
        !            95:  * which will expand into the following code:
        !            96:  *     if (xprflags & XPR_SYSCALLS)
        !            97:  *             xpr("syscall: %d, 0x%x\n", syscallno, arg1);
        !            98:  * Xpr will log the pointer to the printf string and up to 6 arguments,
        !            99:  * along with a timestamp and cpuinfo (for multi-processor systems), into
        !           100:  * a circular buffer.  The actual printf processing is delayed until after
        !           101:  * the buffer has been collected.  It is assumed that the text/data segments
        !           102:  * of the kernel can easily be reconstructed in a post-processor which
        !           103:  * performs the printf processing.
        !           104:  *
        !           105:  * If the XPRDEBUG compilation switch is not set, the XPR macro expands 
        !           106:  * to nothing.
        !           107:  */
        !           108: 
        !           109: #ifndef        _KERN_XPR_H_
        !           110: #define _KERN_XPR_H_
        !           111: 
        !           112: #ifdef KERNEL_BUILD
        !           113: #import <uxpr.h>
        !           114: #import <xpr_debug.h>
        !           115: #else  /* KERNEL_BUILD */
        !           116: #import <mach/features.h>
        !           117: #endif /* KERNEL_BUILD */
        !           118: 
        !           119: #import <machdep/machine/xpr.h>
        !           120: 
        !           121: #if    XPR_DEBUG
        !           122: 
        !           123: #ifndef        __ASSEMBLER__
        !           124: 
        !           125: #if    UXPR
        !           126: /*
        !           127:  * Use IODevice-style xpr's. Kernel internal xpr's use index 1 into 
        !           128:  * xprMask[].
        !           129:  */
        !           130: #ifndef        DDM_DEBUG
        !           131: #define DDM_DEBUG      XPR_DEBUG
        !           132: #endif /* DDM_DEBUG */
        !           133: #import <driverkit/debugging.h>
        !           134: 
        !           135: #define XPR_KERNEL_INDEX       1
        !           136: 
        !           137: #define XPR(flags, xprargs) {                          \
        !           138:        if(IODDMMasks[XPR_KERNEL_INDEX] & flags) {      \
        !           139:                IOAddDDMEntry xprargs;                  \
        !           140:        }                                               \
        !           141: }
        !           142: 
        !           143: #else  /* UXPR */
        !           144: 
        !           145: /*
        !           146:  * The m68k way. Maybe this will be deleted eventually.
        !           147:  */
        !           148: extern unsigned int xprflags;
        !           149: extern unsigned int xprwrap;
        !           150: #define XPR(flags,xprargs) { if(xprflags&flags) xpr xprargs; }
        !           151: 
        !           152: #endif /* UXPR */
        !           153: 
        !           154: #endif /* __ASSEMBLER__ */
        !           155: 
        !           156: /*
        !           157:  * Mach Kernel flags.
        !           158:  */
        !           159: #define XPR_SYSCALLS           (1 << 0)
        !           160: #define XPR_TRAPS              (1 << 1)
        !           161: #define XPR_SCHED              (1 << 2)
        !           162: #define XPR_NPTCP              (1 << 3)
        !           163: #define XPR_NP                 (1 << 4)
        !           164: #define XPR_TCP                        (1 << 5)
        !           165: 
        !           166: #define XPR_VM_OBJECT          (1 << 8)
        !           167: #define XPR_VM_OBJECT_CACHE    (1 << 9)
        !           168: #define XPR_VM_PAGE            (1 << 10)
        !           169: #define XPR_VM_PAGEOUT         (1 << 11)
        !           170: #define XPR_MEMORY_OBJECT      (1 << 12)
        !           171: #define XPR_VM_FAULT           (1 << 13)
        !           172: #define XPR_VNODE_PAGER                (1 << 14)
        !           173: #define XPR_VNODE_PAGER_DATA   (1 << 15)
        !           174: 
        !           175: /*
        !           176:  * Other machine-independent flags.
        !           177:  */
        !           178: #define        XPR_FS                  (1 << 16)
        !           179: #define XPR_TIMER              (1 << 17)
        !           180: #define        XPR_ALLOC               (1 << 18)
        !           181: #define        XPR_LDD                 (1 << 19)
        !           182: #define        XPR_MEAS                (1 << 20)
        !           183: 
        !           184: #else  /* XPR_DEBUG */
        !           185: 
        !           186: #define XPR(flags,xprargs)
        !           187: 
        !           188: #endif /* XPR_DEBUG */
        !           189: 
        !           190: #ifndef        __ASSEMBLER__
        !           191: struct xprbuf {
        !           192:        char    *msg;
        !           193:        int     arg1,arg2,arg3,arg4,arg5;
        !           194:        int     timestamp;
        !           195:        int     cpuinfo;
        !           196: };
        !           197: #endif /* __ASSEMBLER__ */
        !           198: #endif /* _KERN_XPR_H_ */

unix.superglobalmegacorp.com

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