2 * linux/include/asm-arm/assembler.h
4 * Copyright (C) 1996-2000 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 * Do not include any C declarations in this file - it is included by
17 #error "Only include this from assembly code"
20 #include <asm/ptrace.h>
24 #define get_byte_0 lsr #24
25 #define get_byte_1 lsr #16
26 #define get_byte_2 lsr #8
27 #define get_byte_3 lsl #0
28 #define put_byte_0 lsl #24
29 #define put_byte_1 lsl #16
30 #define put_byte_2 lsl #8
31 #define put_byte_3 lsl #0
35 #define MODE_USR USR_MODE
36 #define MODE_FIQ FIQ_MODE
37 #define MODE_IRQ IRQ_MODE
38 #define MODE_SVC SVC_MODE
40 #define DEFAULT_FIQ MODE_FIQ
43 * LOADREGS - ldm with PC in register list (eg, ldmfd sp!, {pc})
46 #define LOADREGS(cond, base, reglist...)\
47 ldm##cond base,reglist
49 #define LOADREGS(cond, base, reglist...)\
50 ldm/**/cond base,reglist
54 * Build a return instruction for this processor type.
56 #define RETINSTR(instr, regs...)\
60 * Enable and disable interrupts
63 msr cpsr_c
, #PSR_I_BIT | SVC_MODE
71 * Save the current IRQ state and disable IRQs. Note that this macro
72 * assumes FIQs are enabled, and that the processor is in SVC mode.
74 .macro save_and_disable_irqs
, oldcpsr
80 * Restore interrupt state previously stored in a register. We don't
81 * guarantee that this will preserve the flags.
83 .macro restore_irqs
, oldcpsr
88 * These two are used to save LR/restore PC over a user-based access.
89 * The old 26-bit architecture requires that we do. On 32-bit
90 * architecture, we can safely ignore this requirement.