4.104.114.84.95
Rev | Line | |
---|
[5e9b32b] | 1 | /* intr.h |
---|
| 2 | * |
---|
| 3 | * XXX: It is unclear if the type "intr_t" should be defined when |
---|
| 4 | * _POSIX_INTERRUPT_CONTROL is not. |
---|
[eb5a7e07] | 5 | * |
---|
| 6 | * $Id$ |
---|
[5e9b32b] | 7 | */ |
---|
| 8 | |
---|
| 9 | #ifndef __POSIX_INTERRUPTS_h |
---|
| 10 | #define __POSIX_INTERRUPTS_h |
---|
| 11 | |
---|
| 12 | #include <rtems/posix/features.h> |
---|
| 13 | #include <sys/types.h> |
---|
| 14 | #include <sys/time.h> |
---|
| 15 | |
---|
| 16 | #if defined(_POSIX_INTERRUPT_CONTROL) |
---|
| 17 | |
---|
| 18 | /* |
---|
| 19 | * 22.2 Concepts, P1003.4b/D8, p. 73 |
---|
| 20 | */ |
---|
| 21 | |
---|
| 22 | typedef int intr_t; |
---|
| 23 | |
---|
| 24 | /* |
---|
| 25 | * 22.3.1 Associate a User-Written ISR with an Interrupt, P1003.4b/D8, p. 74 |
---|
| 26 | */ |
---|
| 27 | |
---|
| 28 | /* |
---|
| 29 | * Return codes from an interrupt handler |
---|
| 30 | */ |
---|
| 31 | |
---|
| 32 | #define INTR_HANDLED_NOTIFY 0 /* ISR handled this interrupt, notify */ |
---|
| 33 | /* the thread that registered the */ |
---|
| 34 | /* ISR that the interrupt occurred. */ |
---|
| 35 | #define INTR_HANDLED_DO_NOT_NOTIFY 1 /* ISR handled this interrupt, but */ |
---|
| 36 | /* do NOT perform notification. */ |
---|
| 37 | #define INTR_NOT_HANDLED 2 /* ISR did not handle this interrupt, */ |
---|
| 38 | /* let the next handler try. */ |
---|
| 39 | |
---|
| 40 | int intr_capture( |
---|
| 41 | intr_t intr, |
---|
| 42 | int (*intr_handler)( void *area ), |
---|
| 43 | volatile void *area, |
---|
| 44 | size_t areasize |
---|
| 45 | ); |
---|
| 46 | |
---|
| 47 | int intr_release( |
---|
| 48 | intr_t intr, |
---|
| 49 | int (*intr_handler)( void *area ) |
---|
| 50 | ); |
---|
| 51 | |
---|
| 52 | int intr_lock( |
---|
| 53 | intr_t intr |
---|
| 54 | ); |
---|
| 55 | |
---|
| 56 | int intr_unlock( |
---|
| 57 | intr_t intr |
---|
| 58 | ); |
---|
| 59 | |
---|
| 60 | /* |
---|
| 61 | * 22.3.2 Await Interrupt Notification, P1003.4b/D8, p. 76 |
---|
| 62 | */ |
---|
| 63 | |
---|
| 64 | int intr_timed_wait( |
---|
| 65 | int flags, |
---|
| 66 | const struct timespec *timeout |
---|
| 67 | ); |
---|
| 68 | |
---|
| 69 | #endif |
---|
| 70 | |
---|
| 71 | #endif |
---|
| 72 | /* end of include file */ |
---|
Note: See
TracBrowser
for help on using the repository browser.