source: rtems/cpukit/score/include/rtems/score/corespinlock.h @ c499856

4.115
Last change on this file since c499856 was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 1.7 KB
Line 
1/**
2 *  @file  rtems/score/corespinlock.h
3 *
4 *  @brief Constants and Structures Associated with the Spinlock Handler
5 *
6 *  This include file contains all the constants and structures associated
7 *  with the Spinlock Handler.
8 */
9
10/*
11 *  COPYRIGHT (c) 1989-2006.
12 *  On-Line Applications Research Corporation (OAR).
13 *
14 *  The license and distribution terms for this file may be
15 *  found in the file LICENSE in this distribution or at
16 *  http://www.rtems.org/license/LICENSE.
17 */
18
19#ifndef _RTEMS_SCORE_CORESPINLOCK_H
20#define _RTEMS_SCORE_CORESPINLOCK_H
21
22#include <rtems/score/object.h>
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28/**
29 *  @defgroup ScoreSpinlock Spinlock Handler
30 *
31 *  @ingroup Score
32 *
33 *  This handler encapsulates functionality which provides the foundation
34 *  Spinlock services used in all of the APIs supported by RTEMS.
35 */
36/**@{*/
37
38/**
39 *  The following defines the control block used to manage the
40 *  attributes of each spinlock.
41 */
42typedef struct {
43  /** This element indicates XXX
44   */
45  uint32_t                  XXX;
46}   CORE_spinlock_Attributes;
47
48/**
49 *  The following defines the control block used to manage each
50 *  spinlock.
51 */
52typedef struct {
53  /** XXX may not be needed */
54  CORE_spinlock_Attributes  Attributes;
55
56  /** This field is the lock.
57   */
58  volatile uint32_t     lock;
59
60  /** This field is a count of the current number of threads using
61   *  this spinlock.  It includes the thread holding the lock as well
62   *  as those waiting.
63   */
64  volatile uint32_t     users;
65
66  /** This field is the Id of the thread holding the lock.  It may or may
67   *  not be the thread which acquired it.
68   */
69  volatile Objects_Id   holder;
70}   CORE_spinlock_Control;
71
72/**@}*/
73
74#ifdef __cplusplus
75}
76#endif
77
78#endif
79/*  end of include file */
Note: See TracBrowser for help on using the repository browser.