of: MSI: Simplify irqdomain lookup
[linux/fpc-iii.git] / arch / avr32 / include / asm / switch_to.h
blob6f00581c3d4ff288a07c28a8b8f4ccd148244398
1 /*
2 * Copyright (C) 2004-2006 Atmel Corporation
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8 #ifndef __ASM_AVR32_SWITCH_TO_H
9 #define __ASM_AVR32_SWITCH_TO_H
12 * Help PathFinder and other Nexus-compliant debuggers keep track of
13 * the current PID by emitting an Ownership Trace Message each time we
14 * switch task.
16 #ifdef CONFIG_OWNERSHIP_TRACE
17 #include <asm/ocd.h>
18 #define ocd_switch(prev, next) \
19 do { \
20 ocd_write(PID, prev->pid); \
21 ocd_write(PID, next->pid); \
22 } while(0)
23 #else
24 #define ocd_switch(prev, next)
25 #endif
28 * switch_to(prev, next, last) should switch from task `prev' to task
29 * `next'. `prev' will never be the same as `next'.
31 * We just delegate everything to the __switch_to assembly function,
32 * which is implemented in arch/avr32/kernel/switch_to.S
34 * mb() tells GCC not to cache `current' across this call.
36 struct cpu_context;
37 struct task_struct;
38 extern struct task_struct *__switch_to(struct task_struct *,
39 struct cpu_context *,
40 struct cpu_context *);
41 #define switch_to(prev, next, last) \
42 do { \
43 ocd_switch(prev, next); \
44 last = __switch_to(prev, &prev->thread.cpu_context + 1, \
45 &next->thread.cpu_context); \
46 } while (0)
49 #endif /* __ASM_AVR32_SWITCH_TO_H */