Print this page
5042 stop using deprecated atomic functions


  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  24  * Use is subject to license terms.
  25  */
  26 
  27 #ifndef _SYS_SYNCH32_H
  28 #define _SYS_SYNCH32_H
  29 
  30 #pragma ident   "%Z%%M% %I%     %E% SMI"
  31 
  32 #ifdef  __cplusplus
  33 extern "C" {
  34 #endif
  35 
  36 /* special defines for LWP mutexes */
  37 #define mutex_flag              flags.flag1
  38 #define mutex_ceiling           flags.ceiling
  39 #define mutex_type              flags.mbcp_type_un.mtype_rcount.count_type2
  40 #define mutex_rcount            flags.mbcp_type_un.mtype_rcount.count_type1
  41 #define mutex_magic             flags.magic
  42 #define mutex_owner             data
  43 /* used to atomically operate on whole word via cas or swap instruction */
  44 #define mutex_lockword          lock.lock32.lockword
  45 /* this requires cas64 */
  46 #define mutex_lockword64        lock.owner64
  47 /* these are bytes */
  48 #define mutex_lockw             lock.lock64.pad[4]
  49 #define mutex_waiters           lock.lock64.pad[7]
  50 #define mutex_spinners          lock.lock64.pad[5]
  51 
  52 /* process-shared lock owner pid */
  53 #define mutex_ownerpid          lock.lock32.ownerpid
  54 
  55 /* Max. recusrion count for recursive mutexes */
  56 #define RECURSION_MAX           255
  57 
  58 /* special defines for LWP condition variables */
  59 #define cond_type               flags.type
  60 #define cond_magic              flags.magic
  61 #define cond_clockid            flags.flag[1]
  62 #define cond_waiters_user       flags.flag[2]
  63 #define cond_waiters_kernel     flags.flag[3]
  64 
  65 /* special defines for LWP semaphores */


  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  24  * Use is subject to license terms.
  25  */
  26 
  27 #ifndef _SYS_SYNCH32_H
  28 #define _SYS_SYNCH32_H
  29 


  30 #ifdef  __cplusplus
  31 extern "C" {
  32 #endif
  33 
  34 /* special defines for LWP mutexes */
  35 #define mutex_flag              flags.flag1
  36 #define mutex_ceiling           flags.ceiling
  37 #define mutex_type              flags.mbcp_type_un.mtype_rcount.count_type2
  38 #define mutex_rcount            flags.mbcp_type_un.mtype_rcount.count_type1
  39 #define mutex_magic             flags.magic
  40 #define mutex_owner             data
  41 /* used to atomically operate on whole word via cas or swap instruction */
  42 #define mutex_lockword          lock.lock32.lockword
  43 /* this requires atomic_cas_64 */
  44 #define mutex_lockword64        lock.owner64
  45 /* these are bytes */
  46 #define mutex_lockw             lock.lock64.pad[4]
  47 #define mutex_waiters           lock.lock64.pad[7]
  48 #define mutex_spinners          lock.lock64.pad[5]
  49 
  50 /* process-shared lock owner pid */
  51 #define mutex_ownerpid          lock.lock32.ownerpid
  52 
  53 /* Max. recusrion count for recursive mutexes */
  54 #define RECURSION_MAX           255
  55 
  56 /* special defines for LWP condition variables */
  57 #define cond_type               flags.type
  58 #define cond_magic              flags.magic
  59 #define cond_clockid            flags.flag[1]
  60 #define cond_waiters_user       flags.flag[2]
  61 #define cond_waiters_kernel     flags.flag[3]
  62 
  63 /* special defines for LWP semaphores */