Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/aarch64/include Use reg_daif{set,clr}_write directl...



details:   https://anonhg.NetBSD.org/src/rev/3999585cc9f6
branches:  trunk
changeset: 980547:3999585cc9f6
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun Feb 07 21:15:09 2021 +0000

description:
Use reg_daif{set,clr}_write directly instead of daif_{en,dis}able for
ENABLE_INTERRUPT() and DISABLE_INTERRUPT() macros, to avoid an unnecessary
reg_daif_read().

diffstat:

 sys/arch/aarch64/include/locore.h |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (22 lines):

diff -r 8cbe3737ea2c -r 3999585cc9f6 sys/arch/aarch64/include/locore.h
--- a/sys/arch/aarch64/include/locore.h Sun Feb 07 20:48:07 2021 +0000
+++ b/sys/arch/aarch64/include/locore.h Sun Feb 07 21:15:09 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.h,v 1.6 2020/10/30 18:54:35 skrll Exp $ */
+/* $NetBSD: locore.h,v 1.7 2021/02/07 21:15:09 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -59,8 +59,10 @@
 #define cpsid(psw)             daif_disable((psw))
 
 
-#define ENABLE_INTERRUPT()     daif_enable(DAIF_I|DAIF_F)
-#define DISABLE_INTERRUPT()    daif_disable(DAIF_I|DAIF_F)
+#define ENABLE_INTERRUPT()     \
+       reg_daifclr_write((DAIF_I|DAIF_F) >> DAIF_SETCLR_SHIFT)
+#define DISABLE_INTERRUPT()    \
+       reg_daifset_write((DAIF_I|DAIF_F) >> DAIF_SETCLR_SHIFT)
 
 #define DAIF_MASK              (DAIF_D|DAIF_A|DAIF_I|DAIF_F)
 



Home | Main Index | Thread Index | Old Index