[444] | 1 | /* |
---|
| 2 | * Copyright (c) 2011 Aeroflex Gaisler |
---|
| 3 | * |
---|
| 4 | * BSD license: |
---|
| 5 | * |
---|
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
---|
| 7 | * of this software and associated documentation files (the "Software"), to deal |
---|
| 8 | * in the Software without restriction, including without limitation the rights |
---|
| 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
---|
| 10 | * copies of the Software, and to permit persons to whom the Software is |
---|
| 11 | * furnished to do so, subject to the following conditions: |
---|
| 12 | * |
---|
| 13 | * The above copyright notice and this permission notice shall be included in |
---|
| 14 | * all copies or substantial portions of the Software. |
---|
| 15 | * |
---|
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
---|
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
---|
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
---|
| 19 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
---|
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
---|
| 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
---|
| 22 | * THE SOFTWARE. |
---|
| 23 | */ |
---|
| 24 | |
---|
| 25 | |
---|
| 26 | #ifndef _INCLUDE_LEON_ASMMACRO_h |
---|
| 27 | #define _INCLUDE_LEON_ASMMACRO_h |
---|
| 28 | |
---|
| 29 | #include <asm-leon/leonstack.h> |
---|
| 30 | |
---|
| 31 | /* All trap entry points _must_ begin with this macro or else you |
---|
| 32 | * lose. It makes sure the kernel has a proper window so that |
---|
| 33 | * c-code can be called. |
---|
| 34 | */ |
---|
| 35 | #define SAVE_ALL_HEAD \ |
---|
| 36 | sethi %hi(leonbare_trapsetup), %l4; \ |
---|
| 37 | jmpl %l4 + %lo(leonbare_trapsetup), %l6; |
---|
| 38 | #define SAVE_ALL \ |
---|
| 39 | SAVE_ALL_HEAD \ |
---|
| 40 | nop; |
---|
| 41 | |
---|
| 42 | #define SAVE_ALL_FAST(l) \ |
---|
| 43 | set l-8, %l6; \ |
---|
| 44 | sethi %hi(leonbare_trapsetup_fast), %l4; \ |
---|
| 45 | jmpl %l4 + %lo(leonbare_trapsetup_fast), %g0; \ |
---|
| 46 | nop; |
---|
| 47 | |
---|
| 48 | /* All traps low-level code here must end with this macro. */ |
---|
| 49 | #define RESTORE_ALL b leonbare_trapreturn; clr %l6; |
---|
| 50 | #define RESTORE_ALL_FAST b leonbare_trapreturn_fast; clr %l6; |
---|
| 51 | |
---|
| 52 | #define WRITE_PAUSE nop; nop; nop; |
---|
| 53 | |
---|
| 54 | #endif /* !_INCLUDE_LEON_STACK_h */ |
---|