TF-M Reference Manual  1.2.0
TrustedFirmware-M
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
tfm_wait.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 #include "tfm_thread.h"
8 #include "utilities.h"
9 #include "tfm_wait.h"
10 
11 void tfm_event_wait(struct tfm_event_t *pevnt)
12 {
13  TFM_CORE_ASSERT(pevnt && pevnt->magic == TFM_EVENT_MAGIC);
14 
18 }
19 
20 void tfm_event_wake(struct tfm_event_t *pevnt, uint32_t retval)
21 {
22  TFM_CORE_ASSERT(pevnt && pevnt->magic == TFM_EVENT_MAGIC);
23 
24  if (pevnt->owner && pevnt->owner->state == THRD_STATE_BLOCK) {
26  tfm_core_thrd_set_retval(pevnt->owner, retval);
27  pevnt->owner = NULL;
29  }
30 }
void tfm_event_wake(struct tfm_event_t *pevnt, uint32_t retval)
Definition: tfm_wait.c:20
void __STATIC_INLINE tfm_core_thrd_set_retval(struct tfm_core_thread_t *pth, uint32_t retval)
Definition: tfm_thread.h:146
uint32_t magic
Definition: tfm_wait.h:18
void tfm_event_wait(struct tfm_event_t *pevnt)
Definition: tfm_wait.c:11
struct tfm_core_thread_t * owner
Definition: tfm_wait.h:19
#define THRD_STATE_BLOCK
Definition: tfm_thread.h:18
struct tfm_core_thread_t * tfm_core_thrd_get_curr_thread(void)
Definition: tfm_thread.c:46
#define TFM_CORE_ASSERT(cond)
Definition: utilities.h:21
void tfm_core_thrd_set_state(struct tfm_core_thread_t *pth, uint32_t new_state)
Definition: tfm_thread.c:120
void tfm_core_thrd_activate_schedule(void)
Definition: tfm_thread.c:129
#define TFM_EVENT_MAGIC
Definition: tfm_wait.h:15
#define THRD_STATE_RUNNING
Definition: tfm_thread.h:17
uint32_t state
Definition: tfm_thread.h:47