Linux 2.6.12-rc6
[cris-mirror.git] / include / asm-sparc / asmmacro.h
blob0d4b65bd252bb4ee2745889fc05e35f1640eabb5
1 /* asmmacro.h: Assembler macros.
3 * Copyright (C) 1996 David S. Miller (davem@caipfs.rutgers.edu)
4 */
6 #ifndef _SPARC_ASMMACRO_H
7 #define _SPARC_ASMMACRO_H
9 #include <linux/config.h>
10 #include <asm/btfixup.h>
11 #include <asm/asi.h>
13 #define GET_PROCESSOR4M_ID(reg) \
14 rd %tbr, %reg; \
15 srl %reg, 12, %reg; \
16 and %reg, 3, %reg;
18 #define GET_PROCESSOR4D_ID(reg) \
19 lda [%g0] ASI_M_VIKING_TMP1, %reg;
21 /* All trap entry points _must_ begin with this macro or else you
22 * lose. It makes sure the kernel has a proper window so that
23 * c-code can be called.
25 #define SAVE_ALL_HEAD \
26 sethi %hi(trap_setup), %l4; \
27 jmpl %l4 + %lo(trap_setup), %l6;
28 #define SAVE_ALL \
29 SAVE_ALL_HEAD \
30 nop;
32 /* All traps low-level code here must end with this macro. */
33 #define RESTORE_ALL b ret_trap_entry; clr %l6;
35 /* sun4 probably wants half word accesses to ASI_SEGMAP, while sun4c+
36 likes byte accesses. These are to avoid ifdef mania. */
38 #ifdef CONFIG_SUN4
39 #define lduXa lduha
40 #define stXa stha
41 #else
42 #define lduXa lduba
43 #define stXa stba
44 #endif
46 #endif /* !(_SPARC_ASMMACRO_H) */