RTEMS  5.1
spinlockimpl.h
Go to the documentation of this file.
1 
10 /*
11  * COPYRIGHT (c) 1989-2011.
12  * On-Line Applications Research Corporation (OAR).
13  *
14  * Copyright (c) 2016 embedded brains GmbH
15  *
16  * The license and distribution terms for this file may be
17  * found in the file LICENSE in this distribution or at
18  * http://www.rtems.org/license/LICENSE.
19  */
20 
21 #ifndef _RTEMS_POSIX_SPINLOCKIMPL_H
22 #define _RTEMS_POSIX_SPINLOCKIMPL_H
23 
24 #include <pthread.h>
25 
26 #include <rtems/score/isrlevel.h>
27 
28 #if defined(RTEMS_SMP)
29 #include <rtems/score/percpu.h>
31 #endif
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 typedef struct {
38 #if defined(RTEMS_SMP)
39  SMP_ticket_lock_Control Lock;
40 #else
41  unsigned int reserved[ 2 ];
42 #endif
43  ISR_Level interrupt_state;
45 
46 RTEMS_INLINE_ROUTINE POSIX_Spinlock_Control *_POSIX_Spinlock_Get(
47  pthread_spinlock_t *lock
48 )
49 {
50  return (POSIX_Spinlock_Control *) lock;
51 }
52 
53 #ifdef __cplusplus
54 }
55 #endif
56 
57 #endif
58 /* end of include file */
POSIX Threads Private Support.
ISR Level Type.
Definition: spinlockimpl.h:37
SMP Lock API.
uint32_t ISR_Level
Definition: isrlevel.h:41
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:66