Mistake on this page?
Report an issue in GitHub or email us
tfm_wait.h
1 /*
2  * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 #ifndef __TFM_WAIT_H__
8 #define __TFM_WAIT_H__
9 
10 #include "cmsis_compiler.h"
11 
12 /* The magic number has two purposes: corruption detection and debug */
13 #define TFM_EVENT_MAGIC 0x65766e74
14 
15 struct tfm_event_t {
16  uint32_t magic; /* 'evnt' */
17  struct tfm_thrd_ctx *owner; /* Event blocked thread */
18 };
19 
20 /*
21  * Initialize an event object.
22  *
23  * Parameters:
24  * pevnt - The pointer of event object allocated by the caller
25  */
26 void __STATIC_INLINE tfm_event_init(struct tfm_event_t *pevnt)
27 {
28  pevnt->magic = TFM_EVENT_MAGIC;
29  pevnt->owner = NULL;
30 }
31 
32 /*
33  * Wait on an event object.
34  *
35  * Parameters:
36  * pevnt - The pointer of event object allocated by the caller
37  *
38  * Notes:
39  * Block caller thread by calling this function.
40  */
41 void tfm_event_wait(struct tfm_event_t *pevnt);
42 
43 /*
44  * Wake up an event object.
45  *
46  * Parameters :
47  * pevnt - The pointer of event object allocated by the caller
48  * retval - Value to be returned to owner
49  *
50  * Notes:
51  * Wake up the blocked thread and set parameter 'retval' as the return value.
52  */
53 void tfm_event_wake(struct tfm_event_t *pevnt, uint32_t retval);
54 
55 #endif
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.