X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/43866e378188c25dd1e2208016ab3cbeb086ae6c..91447636331957f3d9b5ca5b508f07c526b0074d:/osfmk/ipc/ipc_object.h diff --git a/osfmk/ipc/ipc_object.h b/osfmk/ipc/ipc_object.h index 4b89b4611..1eb392c29 100644 --- a/osfmk/ipc/ipc_object.h +++ b/osfmk/ipc/ipc_object.h @@ -1,24 +1,21 @@ /* - * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * - * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * 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 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. 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 + * 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, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. + * 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@ */ @@ -64,7 +61,6 @@ #define _IPC_IPC_OBJECT_H_ #include -#include #include #include @@ -94,12 +90,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; -#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 }; /* @@ -153,7 +145,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 */ /* @@ -162,21 +154,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) \ @@ -184,13 +163,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 \