Cordio Stack and Cordio Profiles  r2p3-02rel0
wsf_cs.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file wsf_cs.h
4  *
5  * \brief Critical section macros.
6  *
7  * Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved.
8  * Arm Ltd. confidential and proprietary.
9  *
10  * IMPORTANT. Your use of this file is governed by a Software License Agreement
11  * ("Agreement") that must be accepted in order to download or otherwise receive a
12  * copy of this file. You may not use or copy this file for any purpose other than
13  * as described in the Agreement. If you do not agree to all of the terms of the
14  * Agreement do not use this file and delete all copies in your possession or control;
15  * if you do not have a copy of the Agreement, you must contact Arm Ltd. prior
16  * to any use, copying or further distribution of this software.
17  */
18 /*************************************************************************************************/
19 #ifndef WSF_CS_H
20 #define WSF_CS_H
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 /*! \addtogroup WSF_CS_API
27  * \{ */
28 
29 /**************************************************************************************************
30  Macros
31 **************************************************************************************************/
32 
33 #ifndef WSF_CS_STATS
34 /*! \brief Use CS statistics hooks. */
35 #define WSF_CS_STATS FALSE
36 #endif
37 
38 /*************************************************************************************************/
39 /*!
40  * \def WSF_CS_INIT
41  *
42  * \brief Initialize critical section. This macro may define a variable.
43  *
44  * \param cs Critical section variable to be defined.
45  */
46 /*************************************************************************************************/
47 #define WSF_CS_INIT(cs)
48 
49 /*************************************************************************************************/
50 /*!
51  * \def WSF_CS_ENTER
52  *
53  * \brief Enter a critical section.
54  *
55  * \param cs Critical section variable.
56  */
57 /*************************************************************************************************/
58 #define WSF_CS_ENTER(cs) WsfCsEnter()
59 
60 /*************************************************************************************************/
61 /*!
62  * \def WSF_CS_EXIT
63  *
64  * \brief Exit a critical section.
65  *
66  * \param cs Critical section variable.
67  */
68 /*************************************************************************************************/
69 #define WSF_CS_EXIT(cs) WsfCsExit()
70 
71 /**************************************************************************************************
72  Data Types
73 **************************************************************************************************/
74 
75 /*! \brief Timestamp call signature. */
77 
78 /*! \brief Timestamp delta and time base converter call signature. */
80 
81 /**************************************************************************************************
82  Global Variables
83 **************************************************************************************************/
84 
85 /*! \brief Statistics global for watermark of critical sections. Value is in microseconds. */
87 
88 /**************************************************************************************************
89  Function Declarations
90 **************************************************************************************************/
91 
92 /*************************************************************************************************/
93 /*!
94  * \brief Register critical section statistics hooks.
95  *
96  * \param timestampCback Callback for obtaining the current timestamp.
97  * \param timebaseCback Callback for converting timestamp delta into microseconds.
98  *
99  * \return None.
100  */
101 /*************************************************************************************************/
102 void WsfCsStatsRegister(WsfCsTimestamp_t timestampCback, WsfCsTimebase_t timebaseCback);
103 
104 /*************************************************************************************************/
105 /*!
106  * \brief Enter a critical section.
107  *
108  * \return None.
109  */
110 /*************************************************************************************************/
111 void WsfCsEnter(void);
112 
113 /*************************************************************************************************/
114 /*!
115  * \brief Enter a critical section.
116  *
117  * \return None.
118  */
119 /*************************************************************************************************/
120 void WsfCsExit(void);
121 
122 /*! \} */ /* WSF_CS_API */
123 
124 #ifdef __cplusplus
125 };
126 #endif
127 
128 #endif /* WSF_CS_H */
bool_t(* WsfCsTimestamp_t)(uint32_t *)
Timestamp call signature.
Definition: wsf_cs.h:76
uint16_t wsfCsStatsWatermarkUsec
Statistics global for watermark of critical sections. Value is in microseconds.
uint8_t bool_t
Boolean data type.
Definition: wsf_types.h:78
void WsfCsExit(void)
Enter a critical section.
void WsfCsEnter(void)
Enter a critical section.
unsigned long uint32_t
Unsigned 32-bit value.
Definition: wsf_types.h:71
void WsfCsStatsRegister(WsfCsTimestamp_t timestampCback, WsfCsTimebase_t timebaseCback)
Register critical section statistics hooks.
unsigned short uint16_t
Unsigned 16-bit value.
Definition: wsf_types.h:67
uint32_t(* WsfCsTimebase_t)(uint32_t)
Timestamp delta and time base converter call signature.
Definition: wsf_cs.h:79