Bluetooth: controller: Add cpu_dsb hal interface
Add cpu_dsb() hal interface so that data synchronization barrier be used in ARM Cortex M4 and M33 architecture implementation. Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
parent
c0950dc35d
commit
530c090cba
4 changed files with 42 additions and 13 deletions
7
subsys/bluetooth/controller/hal/cpu.h
Normal file
7
subsys/bluetooth/controller/hal/cpu.h
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2020 Nordic Semiconductor ASA
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "hal/cpu_vendor_hal.h"
|
|
@ -1,13 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016 Nordic Semiconductor ASA
|
|
||||||
* Copyright (c) 2016 Vinayak Kariappa Chettimada
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
static inline void cpu_sleep(void)
|
|
||||||
{
|
|
||||||
__WFE();
|
|
||||||
__SEV();
|
|
||||||
__WFE();
|
|
||||||
}
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2020 Nordic Semiconductor ASA
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "hal/nrf5/cpu.h"
|
28
subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/cpu.h
Normal file
28
subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/cpu.h
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2016-2020 Nordic Semiconductor ASA
|
||||||
|
* Copyright (c) 2016 Vinayak Kariappa Chettimada
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
static inline void cpu_sleep(void)
|
||||||
|
{
|
||||||
|
#if defined(CONFIG_CPU_CORTEX_M0) || \
|
||||||
|
defined(CONFIG_CPU_CORTEX_M4) || \
|
||||||
|
defined(CONFIG_CPU_CORTEX_M33)
|
||||||
|
__WFE();
|
||||||
|
__SEV();
|
||||||
|
__WFE();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void cpu_dsb(void)
|
||||||
|
{
|
||||||
|
#if defined(CONFIG_CPU_CORTEX_M0) || defined(CONFIG_ARCH_POSIX)
|
||||||
|
/* No need of data synchronization barrier */
|
||||||
|
#elif defined(CONFIG_CPU_CORTEX_M4) || defined(CONFIG_CPU_CORTEX_M33)
|
||||||
|
__DSB();
|
||||||
|
#else
|
||||||
|
#error "Unsupported CPU."
|
||||||
|
#endif
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue