2 * entry.h - routines for context saving and restoring (for interrupts/exceptions)
4 * Copyright (c) 2005-2007 Analog Devices Inc.
6 * See file CREDITS for list of people who contributed to this
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of
12 * the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
25 #ifndef __BLACKFIN_ENTRY_H
26 #define __BLACKFIN_ENTRY_H
29 #define SAVE_ALL_INT save_context_no_interrupts
30 #define SAVE_ALL_SYS save_context_no_interrupts
31 #define SAVE_CONTEXT save_context_with_interrupts
33 #define RESTORE_ALL restore_context_no_interrupts
34 #define RESTORE_ALL_SYS restore_context_no_interrupts
35 #define RESTORE_CONTEXT restore_context_with_interrupts
38 * Code to save processor context.
39 * We even save the register which are preserved by a function call
40 * - r4, r5, r6, r7, p3, p4, p5
42 .macro save_context_with_interrupts
44 [--sp] = ( R7:0, P5:0 );
81 [--sp] = r0; /* Skip reserved */
89 [--sp] = r0; /* Skip IPEND as well. */
92 .macro save_context_no_interrupts
94 [--sp] = ( R7:0, P5:0 );
131 [--sp] = r0; /* Skip reserved */
140 [--sp] = r0; /* Skip IPEND as well. */
143 .macro restore_context_no_interrupts
192 ( R7 : 0, P5 : 0) = [ SP ++ ];
196 .macro restore_context_with_interrupts
244 ( R7 : 0, P5 : 0) = [ SP ++ ];