1 /* asmmacro.h: Assembler macros.
3 * Copyright (C) 1996 David S. Miller (davem@caipfs.rutgers.edu)
6 #ifndef _SPARC_ASMMACRO_H
7 #define _SPARC_ASMMACRO_H
9 #include <linux/config.h>
10 #include <asm/btfixup.h>
13 #define GET_PROCESSOR4M_ID(reg) \
18 #define GET_PROCESSOR4D_ID(reg) \
19 lda [%g0] ASI_M_VIKING_TMP1, %reg;
22 #define GET_PROCESSOR_ID(reg) \
23 sethi %hi(___b_smp_processor_id), %reg; \
24 sethi %hi(boot_cpu_id), %reg; \
25 ldub [%reg + %lo(boot_cpu_id)], %reg;
27 #define GET_PROCESSOR_MID(reg, tmp) \
29 sethi %hi(C_LABEL(mid_xlate)), %tmp; \
31 or %tmp, %lo(C_LABEL(mid_xlate)), %tmp; \
33 ldub [%tmp + %reg], %reg;
35 #define GET_PROCESSOR_OFFSET(reg, tmp) \
36 GET_PROCESSOR_ID(reg) \
37 sethi %hi(C_LABEL(cpu_offset)), %tmp; \
39 or %tmp, %lo(C_LABEL(cpu_offset)), %tmp; \
40 ld [%tmp + %reg], %reg;
42 /* All trap entry points _must_ begin with this macro or else you
43 * lose. It makes sure the kernel has a proper window so that
44 * c-code can be called.
46 #define SAVE_ALL_HEAD \
47 sethi %hi(trap_setup), %l4; \
48 jmpl %l4 + %lo(trap_setup), %l6;
53 /* All traps low-level code here must end with this macro. */
54 #define RESTORE_ALL b ret_trap_entry; clr %l6;
56 /* sun4 probably wants half word accesses to ASI_SEGMAP, while sun4c+
57 likes byte accesses. These are to avoid ifdef mania. */
67 #endif /* !(_SPARC_ASMMACRO_H) */