blob: ec4b8b8107ddbcba36b80c6bb03cf7874ef0f79a [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Russell King4baa9922008-08-02 10:55:55 +01002 * arch/arm/include/asm/fiq.h
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 *
4 * Support for FIQ on ARM architectures.
5 * Written by Philip Blundell <philb@gnu.org>, 1998
6 * Re-written by Russell King
Dave Martin2846d842011-05-24 12:11:48 +01007 *
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 Torvalds1da177e2005-04-16 15:20:36 -070014 */
15
16#ifndef __ASM_FIQ_H
17#define __ASM_FIQ_H
18
19#include <asm/ptrace.h>
20
21struct 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 Vaswanieb81fb32012-01-13 15:53:12 -080036#ifdef CONFIG_FIQ
Linus Torvalds1da177e2005-04-16 15:20:36 -070037extern int claim_fiq(struct fiq_handler *f);
38extern void release_fiq(struct fiq_handler *f);
39extern void set_fiq_handler(void *start, unsigned int length);
Linus Torvalds1da177e2005-04-16 15:20:36 -070040extern void enable_fiq(int fiq);
41extern void disable_fiq(int fiq);
Rohit Vaswanieb81fb32012-01-13 15:53:12 -080042#else
43static inline int claim_fiq(struct fiq_handler *f)
44{
45 return 0;
46}
47static inline void release_fiq(struct fiq_handler *f) { }
48static inline void set_fiq_handler(void *start, unsigned int length) { }
49static inline void enable_fiq(int fiq) { }
50static inline void disable_fiq(int fiq) { }
51#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070052
Dave Martindc2eb922011-05-23 12:22:10 +010053/* helpers defined in fiqasm.S: */
54extern void __set_fiq_regs(unsigned long const *regs);
55extern void __get_fiq_regs(unsigned long *regs);
56
57static inline void set_fiq_regs(struct pt_regs const *regs)
58{
59 __set_fiq_regs(&regs->ARM_r8);
60}
61
62static inline void get_fiq_regs(struct pt_regs *regs)
63{
64 __get_fiq_regs(&regs->ARM_r8);
65}
66
Linus Torvalds1da177e2005-04-16 15:20:36 -070067#endif