]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libgcc/config/nds32/isr-library/adj_intr_lvl.inc
Update copyright years.
[thirdparty/gcc.git] / libgcc / config / nds32 / isr-library / adj_intr_lvl.inc
index 8fb24561111ab0cd43a0c84fb817c537f96ab7c6..4fbc4557e4c66049a770173505681f41f486d65e 100644 (file)
@@ -1,5 +1,5 @@
 /* c-isr library stuff of Andes NDS32 cpu for GNU compiler
-   Copyright (C) 2012-2015 Free Software Foundation, Inc.
+   Copyright (C) 2012-2020 Free Software Foundation, Inc.
    Contributed by Andes Technology Corporation.
 
    This file is part of GCC.
 .macro ADJ_INTR_LVL
 #if defined(NDS32_NESTED) /* Nested handler.  */
        mfsr    $r3, $PSW
+       /* By substracting 1 from $PSW, we can lower PSW.INTL
+          and enable GIE simultaneously.  */
        addi    $r3, $r3, #-0x1
+  #if __NDS32_EXT_ZOL__ || __NDS32_EXT_DSP__
+    ori   $r3, $r3, 0x2000  /* Set PSW.AEN(b'13) */
+  #endif
        mtsr    $r3, $PSW
 #elif defined(NDS32_NESTED_READY) /* Nested ready handler.  */
        /* Save ipc and ipsw and lower INT level.  */
        mfsr    $r3, $PSW
        addi    $r3, $r3, #-0x2
+  #if __NDS32_EXT_ZOL__ || __NDS32_EXT_DSP__
+    ori   $r3, $r3, 0x2000  /* Set PSW.AEN(b'13) */
+  #endif
        mtsr    $r3, $PSW
 #else /* Not nested handler.  */
+  #if __NDS32_EXT_ZOL__ || __NDS32_EXT_DSP__
+    mfsr       $r3, $PSW
+    ori   $r3, $r3, 0x2000  /* Set PSW.AEN(b'13) */
+    mtsr       $r3, $PSW
+  #endif
 #endif
 .endm