aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/arch/aarch64/odp_cpu_idling.h
blob: a6cea8c63ce6eacfde35d35a135bce01d437dd50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* Copyright (c) 2017, ARM Limited. All rights reserved.
 *
 * Copyright (c) 2017-2018, Linaro Limited
 * All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#ifndef PLATFORM_LINUXGENERIC_ARCH_ARM_CPU_IDLING_H
#define PLATFORM_LINUXGENERIC_ARCH_ARM_CPU_IDLING_H

#ifndef PLATFORM_LINUXGENERIC_ARCH_ARM_ODP_CPU_H
#error This file should not be included directly, please include odp_cpu.h
#endif

#ifndef CONFIG_WFE

#include "../default/odp_cpu_idling.h"

#else /* CONFIG_WFE */

static inline void sevl(void)
{
	__asm__ volatile("sevl" : : : );
}

static inline int wfe(void)
{
	__asm__ volatile("wfe" : : : "memory");
	return 1;
}

#define monitor128(addr, mo) lld((addr), (mo))
#define monitor64(addr, mo) ll64((addr), (mo))
#define monitor32(addr, mo) ll32((addr), (mo))
#define monitor8(addr, mo) ll8((addr), (mo))
#endif /* CONFIG_WFE */

#endif  /* PLATFORM_LINUXGENERIC_ARCH_ARM_CPU_IDLING_H */