nrfxlib API 3.3.99
Loading...
Searching...
No Matches
nrf_cc3xx_platform_mutex.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
13#ifndef NRF_CC3XX_PLATFORM_MUTEX_H__
14#define NRF_CC3XX_PLATFORM_MUTEX_H__
15
16#include <stdint.h>
17#include <stddef.h>
18
20
21#ifdef __cplusplus
22extern "C"
23{
24#endif
25
26#define NRF_CC3XX_PLATFORM_MUTEX_MASK_INVALID (0xA95C5F2C)
27#define NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID (0x3A<<0)
28#define NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_ALLOCATED (0x3A<<6)
29#define NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_ATOMIC (0x3A<<12)
30#define NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_HW_MUTEX (0x3A<<18)
31#define NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_INTERNAL_MUTEX (0x3A<<24)
34typedef struct nrf_cc3xx_platform_mutex
35{
36 void * mutex;
37 uint32_t flags;
38
40
52
53
64
65
73
74
82
83
87{
88 /* The platform mutex init function */
90
91 /* The platform mutex free function */
93
94 /* The platform lock function */
96
97 /* The platform unlock function */
100
101
105{
106 /* Mutex for symmetric operations. */
107 void * sym_mutex;
108
109 /* Mutex for asymetric operations. */
111
112 /* Mutex for rng operations. */
113 void * rng_mutex;
114
115 /* Mutex reserved for future use. */
116 void * reserved;
117
118 /* Mutex for power mode changes */
121
122
127
128
131
132
139 nrf_cc3xx_platform_mutex_apis_t const * const apis,
140 nrf_cc3xx_platform_mutexes_t const * const mutexes);
141
142
154
155#ifdef __cplusplus
156}
157#endif
158
159#endif /* NRF_CC3XX_PLATFORM_MUTEX_H__ */
int(* nrf_cc3xx_platform_mutex_unlock_fn_t)(nrf_cc3xx_platform_mutex_t *mutex)
Type definition of function pointer to unlock a mutex.
Definition nrf_cc3xx_platform_mutex.h:81
int(* nrf_cc3xx_platform_mutex_lock_fn_t)(nrf_cc3xx_platform_mutex_t *mutex)
Type definition of function pointer to lock a mutex.
Definition nrf_cc3xx_platform_mutex.h:72
void nrf_cc3xx_platform_mutex_init(void)
Function to initialize RTOS thread-safe mutexes.
nrf_cc3xx_platform_mutex_apis_t platform_mutex_apis
External reference to structure holding the currently set platform mutexe APIs.
nrf_cc3xx_platform_mutexes_t platform_mutexes
External reference to currently set platform hw mutexes.
void nrf_cc3xx_platform_set_mutexes(nrf_cc3xx_platform_mutex_apis_t const *const apis, nrf_cc3xx_platform_mutexes_t const *const mutexes)
Function to set platform mutex APIs and mutexes.
void(* nrf_cc3xx_platform_mutex_free_fn_t)(nrf_cc3xx_platform_mutex_t *mutex)
Type definition of function pointer to free a mutex.
Definition nrf_cc3xx_platform_mutex.h:63
void(* nrf_cc3xx_platform_mutex_init_fn_t)(nrf_cc3xx_platform_mutex_t *mutex)
Type definition of function pointer to initialize a mutex.
Definition nrf_cc3xx_platform_mutex.h:51
nrf_cc3xx_platform_mutex_init_fn_t mutex_init_fn
Definition nrf_cc3xx_platform_mutex.h:89
nrf_cc3xx_platform_mutex_lock_fn_t mutex_lock_fn
Definition nrf_cc3xx_platform_mutex.h:95
nrf_cc3xx_platform_mutex_unlock_fn_t mutex_unlock_fn
Definition nrf_cc3xx_platform_mutex.h:98
nrf_cc3xx_platform_mutex_free_fn_t mutex_free_fn
Definition nrf_cc3xx_platform_mutex.h:92
Type definition of structure holding platform mutex APIs.
Definition nrf_cc3xx_platform_mutex.h:87
uint32_t flags
Definition nrf_cc3xx_platform_mutex.h:37
void * mutex
Definition nrf_cc3xx_platform_mutex.h:36
Type definition of architecture neutral mutex type.
Definition nrf_cc3xx_platform_mutex.h:35
void * asym_mutex
Definition nrf_cc3xx_platform_mutex.h:110
void * sym_mutex
Definition nrf_cc3xx_platform_mutex.h:107
void * rng_mutex
Definition nrf_cc3xx_platform_mutex.h:113
void * reserved
Definition nrf_cc3xx_platform_mutex.h:116
void * power_mutex
Definition nrf_cc3xx_platform_mutex.h:119
Type definition of structure to platform hw mutexes.
Definition nrf_cc3xx_platform_mutex.h:105