Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
Russell King | 4baa992 | 2008-08-02 10:55:55 +0100 | [diff] [blame] | 2 | * arch/arm/include/asm/fiq.h |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | * |
| 4 | * Support for FIQ on ARM architectures. |
| 5 | * Written by Philip Blundell <philb@gnu.org>, 1998 |
| 6 | * Re-written by Russell King |
Dave Martin | 2846d84 | 2011-05-24 12:11:48 +0100 | [diff] [blame] | 7 | * |
| 8 | * NOTE: The FIQ mode registers are not magically preserved across |
| 9 | * suspend/resume. |
| 10 | * |
| 11 | * Drivers which require these registers to be preserved across power |
| 12 | * management operations must implement appropriate suspend/resume handlers to |
| 13 | * save and restore them. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | #ifndef __ASM_FIQ_H |
| 17 | #define __ASM_FIQ_H |
| 18 | |
| 19 | #include <asm/ptrace.h> |
| 20 | |
| 21 | struct fiq_handler { |
| 22 | struct fiq_handler *next; |
| 23 | /* Name |
| 24 | */ |
| 25 | const char *name; |
| 26 | /* Called to ask driver to relinquish/ |
| 27 | * reacquire FIQ |
| 28 | * return zero to accept, or -<errno> |
| 29 | */ |
| 30 | int (*fiq_op)(void *, int relinquish); |
| 31 | /* data for the relinquish/reacquire functions |
| 32 | */ |
| 33 | void *dev_id; |
| 34 | }; |
| 35 | |
Rohit Vaswani | eb81fb3 | 2012-01-13 15:53:12 -0800 | [diff] [blame] | 36 | #ifdef CONFIG_FIQ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | extern int claim_fiq(struct fiq_handler *f); |
| 38 | extern void release_fiq(struct fiq_handler *f); |
| 39 | extern void set_fiq_handler(void *start, unsigned int length); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | extern void enable_fiq(int fiq); |
| 41 | extern void disable_fiq(int fiq); |
Taniya Das | 1c01ace | 2012-08-24 20:15:24 +0530 | [diff] [blame] | 42 | extern void fiq_set_type(int fiq, unsigned int type); |
Rohit Vaswani | eb81fb3 | 2012-01-13 15:53:12 -0800 | [diff] [blame] | 43 | #else |
| 44 | static inline int claim_fiq(struct fiq_handler *f) |
| 45 | { |
| 46 | return 0; |
| 47 | } |
| 48 | static inline void release_fiq(struct fiq_handler *f) { } |
| 49 | static inline void set_fiq_handler(void *start, unsigned int length) { } |
| 50 | static inline void enable_fiq(int fiq) { } |
| 51 | static inline void disable_fiq(int fiq) { } |
Taniya Das | 1c01ace | 2012-08-24 20:15:24 +0530 | [diff] [blame] | 52 | static inline void fiq_set_type(int fiq, unsigned int type) { } |
Rohit Vaswani | eb81fb3 | 2012-01-13 15:53:12 -0800 | [diff] [blame] | 53 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 54 | |
Dave Martin | dc2eb92 | 2011-05-23 12:22:10 +0100 | [diff] [blame] | 55 | /* helpers defined in fiqasm.S: */ |
| 56 | extern void __set_fiq_regs(unsigned long const *regs); |
| 57 | extern void __get_fiq_regs(unsigned long *regs); |
| 58 | |
| 59 | static inline void set_fiq_regs(struct pt_regs const *regs) |
| 60 | { |
| 61 | __set_fiq_regs(®s->ARM_r8); |
| 62 | } |
| 63 | |
| 64 | static inline void get_fiq_regs(struct pt_regs *regs) |
| 65 | { |
| 66 | __get_fiq_regs(®s->ARM_r8); |
| 67 | } |
| 68 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 69 | #endif |