|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. ! 3: * ! 4: * @APPLE_LICENSE_HEADER_START@ ! 5: * ! 6: * The contents of this file constitute Original Code as defined in and ! 7: * are subject to the Apple Public Source License Version 1.1 (the ! 8: * "License"). You may not use this file except in compliance with the ! 9: * License. Please obtain a copy of the License at ! 10: * http://www.apple.com/publicsource and read it before using this file. ! 11: * ! 12: * This Original Code and all software distributed under the License are ! 13: * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER ! 14: * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, ! 15: * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, ! 16: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the ! 17: * License for the specific language governing rights and limitations ! 18: * under the License. ! 19: * ! 20: * @APPLE_LICENSE_HEADER_END@ ! 21: */ ! 22: /* ! 23: * @OSF_COPYRIGHT@ ! 24: */ ! 25: /* ! 26: * HISTORY ! 27: * $Log: diag.h,v $ ! 28: * Revision 1.1.1.1 2000/03/25 21:02:54 wsanchez ! 29: * Import of xnu-68.4 ! 30: * ! 31: * Revision 1.3 2000/01/26 05:56:23 wsanchez ! 32: * Add APSL ! 33: * ! 34: * Revision 1.2 1998/12/01 00:24:42 wsanchez ! 35: * Merged in CDY_DP1 (chris: default pager) ! 36: * ! 37: * Revision 1.1.2.2 1998/11/25 21:32:17 youngwor ! 38: * fix errant comment format ! 39: * ! 40: * Revision 1.1.2.1 1998/11/24 22:39:59 youngwor ! 41: * Check-in of support for the in-kernel default pager ! 42: * ! 43: * Revision 1.1.1.1 1998/03/07 02:26:31 wsanchez ! 44: * Import of OSF Mach kernel (~mburg) ! 45: * ! 46: * Revision 1.1.6.3 1995/04/07 18:51:32 barbou ! 47: * Changed panic messages format. ! 48: * [94/10/10 barbou] ! 49: * [95/03/08 barbou] ! 50: * ! 51: * Revision 1.1.6.2 1995/01/11 19:30:28 devrcs ! 52: * mk6 CR668 - 1.3b26 merge ! 53: * [1994/11/10 15:31:34 bolinger] ! 54: * ! 55: * Insert 1.3 log. ! 56: * ! 57: * BEGIN OSC1_3 HISTORY ! 58: * ! 59: * Revision 1.1.2.2 1994/04/01 18:45:25 jph ! 60: * CR10550 -- Add stats macros for info interfaces. ! 61: * [1994/04/01 18:45:06 jph] ! 62: * ! 63: * Revision 1.1.2.1 1994/02/16 14:22:46 jph ! 64: * CR10554 -- Simple assert and panic macros for diagnostics. ! 65: * [1994/02/16 14:22:02 jph] ! 66: * ! 67: * END OSC1_3 HISTORY ! 68: * [1994/11/10 15:30:44 bolinger] ! 69: * ! 70: * $EndLog$ ! 71: */ ! 72: ! 73: #ifndef MACH_KERNEL ! 74: #ifdef ASSERTIONS ! 75: #define assert(cond) \ ! 76: if (!(cond)) panic("%sassertion: %s", my_name, # cond) ! 77: #endif ! 78: #ifndef ASSERTIONS ! 79: #define assert(cond) ! 80: #endif ! 81: #endif ! 82: ! 83: #ifndef MACH_KERNEL ! 84: #define Panic(aargh) panic("%s[%d]%s: %s", my_name, dp_thread_id(), here, aargh) ! 85: #else ! 86: #define Panic(aargh) panic("%s[KERNEL]%s: %s", my_name, here, aargh) ! 87: #endif ! 88: ! 89: extern char my_name[]; ! 90: ! 91: #define VSTATS_ACTION(l, stmt) \ ! 92: do { VSTATS_LOCK(l); stmt; VSTATS_UNLOCK(l); } while (0) ! 93: ! 94: #if !defined(VAGUE_STATS) || (VAGUE_STATS > 0) ! 95: #define VSTATS_LOCK_DECL(name) ! 96: #define VSTATS_LOCK(l) ! 97: #define VSTATS_UNLOCK(l) ! 98: #define VSTATS_LOCK_INIT(l) ! 99: #else ! 100: #define VSTATS_LOCK_DECL(name) struct mutex name; ! 101: #define VSTATS_LOCK(l) mutex_lock(l) ! 102: #define VSTATS_UNLOCK(l) mutex_unlock(l) ! 103: #define VSTATS_LOCK_INIT(l) mutex_init(l) ! 104: #endif /* VAGUE_STATS */ ! 105:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.