diff options
author | 2017-12-30 08:39:49 +0000 | |
---|---|---|
committer | 2017-12-30 08:39:49 +0000 | |
commit | a6f9401103082f4c8636d1360d7c04816d9b9d88 (patch) | |
tree | 0aba7153a80ccceebdd6927366bd2c8129229d4f /sys | |
parent | The `F' option no longer disables delayed freeing; from kshe (diff) | |
download | wireguard-openbsd-a6f9401103082f4c8636d1360d7c04816d9b9d88.tar.xz wireguard-openbsd-a6f9401103082f4c8636d1360d7c04816d9b9d88.zip |
Implement CPU_BUSY_CYCLE and intr_disable/restore.
ok patrick@, tom@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/arm64/include/cpu.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/arch/arm64/include/cpu.h b/sys/arch/arm64/include/cpu.h index 2497cb33ccf..5378ce068cd 100644 --- a/sys/arch/arm64/include/cpu.h +++ b/sys/arch/arm64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.1 2016/12/17 23:38:33 patrick Exp $ */ +/* $OpenBSD: cpu.h,v 1.2 2017/12/30 08:39:49 kettenis Exp $ */ /* * Copyright (c) 2016 Dale Rahn <drahn@dalerahn.com> * @@ -144,6 +144,7 @@ extern struct cpu_info *cpu_info[MAXCPUS]; void cpu_boot_secondary_processors(void); #endif /* !MULTIPROCESSOR */ +#define CPU_BUSY_CYCLE() __asm volatile("yield" : : : "memory") #define curpcb curcpu()->ci_curpcb @@ -248,6 +249,18 @@ disable_irq_daif_ret() #define restore_interrupts(old_daif) \ restore_daif(old_daif) +static inline u_long +intr_disable(void) +{ + return disable_irq_daif_ret(); +} + +static inline void +intr_restore(u_long daif) +{ + restore_daif(daif); +} + void delay (unsigned); #define DELAY(x) delay(x) |