2 * linux/asm-arm/proc-armo/assembler.h
4 * Copyright (C) 1996 Russell King
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * This file contains arm architecture specific defines
11 * for the different processors
13 #define MODE_USR USR26_MODE
14 #define MODE_FIQ FIQ26_MODE
15 #define MODE_IRQ IRQ26_MODE
16 #define MODE_SVC SVC26_MODE
18 #define DEFAULT_FIQ MODE_FIQ
21 #define LOADREGS(cond, base, reglist...)\
22 ldm##cond base,reglist^
24 #define RETINSTR(instr, regs...)\
27 #define LOADREGS(cond, base, reglist...)\
28 ldm/**/cond base,reglist^
30 #define RETINSTR(instr, regs...)\
37 #define MODE(savereg,tmpreg,mode) \
39 bic tmpreg, savereg, $0x0c000003; \
40 orr tmpreg, tmpreg, $mode; \
43 #define RESTOREMODE(savereg) \
46 #define SAVEIRQS(tmpreg)
48 #define RESTOREIRQS(tmpreg)
50 #define DISABLEIRQS(tmpreg)\
53 #define ENABLEIRQS(tmpreg)\
56 #define USERMODE(tmpreg)\
57 teqp pc, $0x00000000;\
60 #define SVCMODE(tmpreg)\
61 teqp pc, $0x00000003;\
66 * Save the current IRQ state and disable IRQs
67 * Note that this macro assumes FIQs are enabled, and
68 * that the processor is in SVC mode.
70 .macro save_and_disable_irqs, oldcpsr, temp
72 orr \temp, \oldcpsr, #0x08000000
77 * Restore interrupt state previously stored in
79 * ** Actually do nothing on Arc - hope that the caller uses a MOVS PC soon
82 .macro restore_irqs, oldcpsr
83 @ This be restore_irqs
87 * These two are used to save LR/restore PC over a user-based access.
88 * The old 26-bit architecture requires that we do. On 32-bit
89 * architecture, we can safely ignore this requirement.
101 .section __ex_table,"a"; \