X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/b226f5e54a60dc81db17b1260381d7dbfea3cdf1..0a7de7458d150b5d4dffc935ba399be265ef0a1a:/osfmk/arm/simple_lock.h diff --git a/osfmk/arm/simple_lock.h b/osfmk/arm/simple_lock.h index f1fac9bee..3f4d5c91a 100644 --- a/osfmk/arm/simple_lock.h +++ b/osfmk/arm/simple_lock.h @@ -28,41 +28,42 @@ /* * @OSF_COPYRIGHT@ */ -/* +/* * Mach Operating System * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ -#ifdef KERNEL_PRIVATE +#ifdef KERNEL_PRIVATE -#ifndef _ARM_SIMPLE_LOCK_TYPES_H_ -#define _ARM_SIMPLE_LOCK_TYPES_H_ +#ifndef _ARM_SIMPLE_LOCK_TYPES_H_ +#define _ARM_SIMPLE_LOCK_TYPES_H_ -#ifdef KERNEL_PRIVATE +#include + +#ifdef KERNEL_PRIVATE #include #include - #include #ifdef MACH_KERNEL_PRIVATE #include @@ -74,50 +75,79 @@ typedef uint32_t hw_lock_bit_t; -extern void hw_lock_bit( - hw_lock_bit_t *, - unsigned int); +#if LOCK_STATS +extern void hw_lock_bit( + hw_lock_bit_t *, + unsigned int, + lck_grp_t*); -extern void hw_lock_bit_nopreempt( - hw_lock_bit_t *, - unsigned int); +extern void hw_lock_bit_nopreempt( + hw_lock_bit_t *, + unsigned int, + lck_grp_t*); -extern void hw_unlock_bit( - hw_lock_bit_t *, - unsigned int); +extern unsigned int hw_lock_bit_try( + hw_lock_bit_t *, + unsigned int, + lck_grp_t*); + +extern unsigned int hw_lock_bit_to( + hw_lock_bit_t *, + unsigned int, + uint32_t, + lck_grp_t*); -extern void hw_unlock_bit_nopreempt( - hw_lock_bit_t *, - unsigned int); +#else +extern void hw_lock_bit( + hw_lock_bit_t *, + unsigned int); +#define hw_lock_bit(lck, bit, grp) hw_lock_bit(lck, bit) + +extern void hw_lock_bit_nopreempt( + hw_lock_bit_t *, + unsigned int); +#define hw_lock_bit_nopreempt(lck, bit, grp) hw_lock_bit_nopreempt(lck, bit) extern unsigned int hw_lock_bit_try( - hw_lock_bit_t *, - unsigned int); + hw_lock_bit_t *, + unsigned int); +#define hw_lock_bit_try(lck, bit, grp) hw_lock_bit_try(lck, bit) extern unsigned int hw_lock_bit_to( - hw_lock_bit_t *, - unsigned int, - uint32_t); + hw_lock_bit_t *, + unsigned int, + uint32_t); +#define hw_lock_bit_to(lck, bit, timeout, grp) hw_lock_bit_to(lck, bit, timeout) + +#endif /* LOCK_STATS */ + +extern void hw_unlock_bit( + hw_lock_bit_t *, + unsigned int); -#define hw_lock_bit_held(l,b) (((*(l))&(1<