2 * linux/arch/unicore32/include/asm/assembler.h
4 * Code specific to PKUnity SoC and UniCore ISA
6 * Copyright (C) 2001-2010 GUAN Xue-tao
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
12 * Do not include any C declarations in this file - it is included by
16 #error "Only include this from assembly code"
19 #include <asm/ptrace.h>
22 * Little Endian independent macros for shifting bytes within registers.
26 #define get_byte_0 << #0
27 #define get_byte_1 >> #8
28 #define get_byte_2 >> #16
29 #define get_byte_3 >> #24
30 #define put_byte_0 << #0
31 #define put_byte_1 << #8
32 #define put_byte_2 << #16
33 #define put_byte_3 << #24
41 * Enable and disable interrupts
43 .macro disable_irq
, temp
45 andn
\temp
, \temp
, #0xFF
46 or \temp
, \temp
, #PSR_I_BIT | PRIV_MODE
50 .macro enable_irq
, temp
52 andn
\temp
, \temp
, #0xFF
53 or \temp
, \temp
, #PRIV_MODE
59 .pushsection __ex_table, "a"; \
64 .macro notcond
, cond
, nexti
= .+8
93 .else; .ifnc \cond
, al
94 .error
"Unknown cond in notcond macro argument"
95 .endif
; .endif
; .endif
; .endif
; .endif
; .endif
; .endif
96 .endif
; .endif
; .endif
; .endif
; .endif
; .endif
; .endif
100 .macro usracc
, instr
, reg
, ptr
, inc
, cond
, rept
, abort
105 \instr\
()b
.u
\reg
, [\ptr
], #\inc
107 \instr\
()w
.u
\reg
, [\ptr
], #\inc
109 .error
"Unsupported inc macro argument"
112 .pushsection __ex_table
, "a"
119 .macro strusr
, reg
, ptr
, inc
, cond
= al
, rept
= 1, abort
= 9001f
120 usracc st
, \reg
, \ptr
, \inc
, \cond
, \rept
, \abort
123 .macro ldrusr
, reg
, ptr
, inc
, cond
= al
, rept
= 1, abort
= 9001f
124 usracc ld
, \reg
, \ptr
, \inc
, \cond
, \rept
, \abort