|
|
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: * portFuncs.h ! 26: * ! 27: * Copyright (c) 1991, NeXT Computer, Inc. All rights reserved. ! 28: * ! 29: * Audio driver deamon main thread. ! 30: * ! 31: * HISTORY ! 32: * 06/26/92/mtm Original coding. ! 33: */ ! 34: #import <mach/mach_user_internal.h> ! 35: #import <mach/mach_interface.h> ! 36: ! 37: #import <kernserv/prototypes.h> // task_self ! 38: #import <driverkit/generalFuncs.h> ! 39: ! 40: /* ! 41: * Allocate a port. ! 42: */ ! 43: static inline port_t allocatePort(void) ! 44: { ! 45: kern_return_t krtn; ! 46: port_t aPort; ! 47: ! 48: krtn = port_allocate(task_self(), &aPort); ! 49: if (krtn) { ! 50: IOLog("Audio: port_allocate"); ! 51: //IOPanic("allocatePort"); ! 52: } ! 53: return aPort; ! 54: } ! 55: ! 56: /* ! 57: * Deallocate a port. ! 58: */ ! 59: static inline void deallocatePort(port_t aPort) ! 60: { ! 61: kern_return_t krtn; ! 62: ! 63: krtn = port_deallocate(task_self(), aPort); ! 64: if (krtn) { ! 65: IOLog("Audio: port_deallocate\n" ); ! 66: //IOPanic("deallocatePort"); ! 67: } ! 68: } ! 69: ! 70: /* ! 71: * Add a port to a port set. ! 72: */ ! 73: static inline void addPort(port_t aPortSet, port_t aPort) ! 74: { ! 75: kern_return_t krtn; ! 76: ! 77: krtn = port_set_add(task_self(), aPortSet, aPort); ! 78: if (krtn) { ! 79: IOLog("Audio: port_set_add\n" ); ! 80: //IOPanic("addPort"); ! 81: } ! 82: } ! 83: ! 84: /* ! 85: * Allocate a port set. ! 86: */ ! 87: static inline port_t allocatePortSet(void) ! 88: { ! 89: kern_return_t krtn; ! 90: port_set_name_t aPortSet; ! 91: ! 92: krtn = port_set_allocate(task_self(), &aPortSet); ! 93: if (krtn) { ! 94: IOLog("Audio: port_set_allocate: %d\n", krtn); ! 95: //IOPanic("allocatePortSet"); ! 96: } ! 97: return aPortSet; ! 98: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.