2018-08-27 15:37:08 +08:00
|
|
|
/*
|
2021-04-09 10:52:34 +08:00
|
|
|
* Copyright (c) 2006-2021, RT-Thread Development Team
|
2018-08-27 15:37:08 +08:00
|
|
|
*
|
2021-04-09 10:52:34 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2018-08-27 15:37:08 +08:00
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
|
|
|
* 2015-01-07 Grissiom init commit
|
|
|
|
*/
|
|
|
|
|
2020-11-20 21:44:25 +08:00
|
|
|
#ifndef __VBUS_HW_H__
|
|
|
|
#define __VBUS_HW_H__
|
|
|
|
|
2018-08-27 15:37:08 +08:00
|
|
|
#include <rtthread.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <gic.h>
|
|
|
|
|
|
|
|
rt_inline void rt_vbus_tick(unsigned int target_cpu, unsigned int irqnr)
|
|
|
|
{
|
|
|
|
arm_gic_trigger(0, 1, irqnr);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Read memory barrier. */
|
|
|
|
rt_inline void rt_vbus_smp_rmb(void)
|
|
|
|
{
|
|
|
|
asm volatile ("dsb" : : : "memory");
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Write memory barrier. */
|
|
|
|
rt_inline void rt_vbus_smp_wmb(void)
|
|
|
|
{
|
|
|
|
asm volatile ("dsb" : : : "memory");
|
|
|
|
}
|
|
|
|
|
|
|
|
/* General memory barrier. */
|
|
|
|
rt_inline void rt_vbus_smp_mb(void)
|
|
|
|
{
|
|
|
|
asm volatile ("dsb" : : : "memory");
|
|
|
|
}
|
2020-11-20 21:44:25 +08:00
|
|
|
|
|
|
|
#endif /* __VBUS_HW_H__ */
|