X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/1c79356b52d46aa6b508fb032f5ae709b1f2897b..5d5c5d0d5b79ade9a973d55186ffda2638ba2b6e:/osfmk/ipc/ipc_object.h diff --git a/osfmk/ipc/ipc_object.h b/osfmk/ipc/ipc_object.h index 67a0e4910..d7dd33ec2 100644 --- a/osfmk/ipc/ipc_object.h +++ b/osfmk/ipc/ipc_object.h @@ -1,23 +1,31 @@ /* - * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. * - * @APPLE_LICENSE_HEADER_START@ + * @APPLE_LICENSE_OSREFERENCE_HEADER_START@ * - * The contents of this file constitute Original Code as defined in and - * are subject to the Apple Public Source License Version 1.1 (the - * "License"). You may not use this file except in compliance with the - * License. Please obtain a copy of the License at - * http://www.apple.com/publicsource and read it before using this file. - * - * This Original Code and all software distributed under the License are - * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the - * License for the specific language governing rights and limitations - * under the License. - * - * @APPLE_LICENSE_HEADER_END@ + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the + * License may not be used to create, or enable the creation or + * redistribution of, unlawful or unlicensed copies of an Apple operating + * system, or to circumvent, violate, or enable the circumvention or + * violation of, any terms of an Apple operating system software license + * agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_OSREFERENCE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ @@ -61,14 +69,12 @@ #define _IPC_IPC_OBJECT_H_ #include -#include #include #include #include #include #include -#include #include #include @@ -92,13 +98,8 @@ typedef natural_t ipc_object_type_t; struct ipc_object { ipc_object_refs_t io_references; ipc_object_bits_t io_bits; - port_name_t io_receiver_name; - struct thread_pool io_thread_pool; -#if NCPUS == 1 - usimple_lock_data_t io_lock_data; -#else + mach_port_name_t io_receiver_name; decl_mutex_data(, io_lock_data) -#endif }; /* @@ -152,7 +153,7 @@ extern void io_free( #else /* MACH_ASSERT */ #define io_free(otype, io) \ - zfree(ipc_object_zones[(otype)], (vm_offset_t) (io)) + zfree(ipc_object_zones[(otype)], (io)) #endif /* MACH_ASSERT */ /* @@ -161,21 +162,8 @@ extern void io_free( * within any kernel data structure needing to lock an ipc_object * (ipc_port and ipc_pset). */ -#if NCPUS == 1 - #define io_lock_init(io) \ - usimple_lock_init(&(io)-io_lock_data, ETAP_IPC_OBJECT) -#define io_lock(io) \ - usimple_lock(&(io)->io_lock_data) -#define io_lock_try(io) \ - usimple_lock_try(&(io)->io_lock_data) -#define io_unlock(io) \ - usimple_unlock(&(io)->io_lock_data) - -#else /* NCPUS == 1 */ - -#define io_lock_init(io) \ - mutex_init(&(io)->io_lock_data, ETAP_IPC_OBJECT) + mutex_init(&(io)->io_lock_data, 0) #define io_lock(io) \ mutex_lock(&(io)->io_lock_data) #define io_lock_try(io) \ @@ -183,13 +171,7 @@ extern void io_free( #define io_unlock(io) \ mutex_unlock(&(io)->io_lock_data) -#endif /* NCPUS == 1 */ - -#if NCPUS > 1 #define _VOLATILE_ volatile -#else /* NCPUS > 1 */ -#define _VOLATILE_ -#endif /* NCPUS > 1 */ #define io_check_unlock(io) \ MACRO_BEGIN \