/*
- * 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@
*/
#define _IPC_IPC_OBJECT_H_
#include <mach_rt.h>
-#include <cpus.h>
#include <mach_kdb.h>
#include <mach/kern_return.h>
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
};
/*
#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 */
/*
* 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) \
#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 \