Daniel Hellstrom | 9d7c6b2 | 2008-03-28 09:47:00 +0100 | [diff] [blame] | 1 | /* Assembler macros for SPARC |
| 2 | * |
| 3 | * (C) Copyright 2007, taken from linux asm-sparc/asmmacro.h |
| 4 | * Daniel Hellstrom, Gaisler Research, daniel@gaisler.com. |
| 5 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 6 | * SPDX-License-Identifier: GPL-2.0+ |
Daniel Hellstrom | 9d7c6b2 | 2008-03-28 09:47:00 +0100 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #ifndef __SPARC_ASMMACRO_H__ |
| 10 | #define __SPARC_ASMMACRO_H__ |
| 11 | |
| 12 | #include <config.h> |
| 13 | |
| 14 | /* All trap entry points _must_ begin with this macro or else you |
| 15 | * lose. It makes sure the kernel has a proper window so that |
| 16 | * c-code can be called. |
| 17 | */ |
| 18 | #define SAVE_ALL_HEAD \ |
Wolfgang Denk | 0708bc6 | 2010-10-07 21:51:12 +0200 | [diff] [blame] | 19 | sethi %hi(trap_setup+(CONFIG_SYS_RELOC_MONITOR_BASE-CONFIG_SYS_TEXT_BASE)), %l4; \ |
| 20 | jmpl %l4 + %lo(trap_setup+(CONFIG_SYS_RELOC_MONITOR_BASE-CONFIG_SYS_TEXT_BASE)), %l6; |
Daniel Hellstrom | 9d7c6b2 | 2008-03-28 09:47:00 +0100 | [diff] [blame] | 21 | #define SAVE_ALL \ |
| 22 | SAVE_ALL_HEAD \ |
| 23 | nop; |
| 24 | |
| 25 | /* All traps low-level code here must end with this macro. */ |
| 26 | #define RESTORE_ALL b ret_trap_entry; clr %l6; |
| 27 | |
| 28 | #endif |