36,18 → 36,16 |
#define KERN_IRQ_H_ |
|
typedef enum { |
CMD_MEM_READ_1 = 0, |
CMD_MEM_READ_2, |
CMD_MEM_READ_4, |
CMD_MEM_READ_8, |
CMD_MEM_WRITE_1, |
CMD_MEM_WRITE_2, |
CMD_MEM_WRITE_4, |
CMD_MEM_WRITE_8, |
CMD_PORT_READ_1, |
CMD_PORT_WRITE_1, |
CMD_IA64_GETCHAR, |
CMD_PPC32_GETCHAR, |
CMD_PIO_READ_8 = 1, |
CMD_PIO_READ_16, |
CMD_PIO_READ_32, |
CMD_PIO_WRITE_8, |
CMD_PIO_WRITE_16, |
CMD_PIO_WRITE_32, |
CMD_BTEST, |
CMD_PREDICATE, |
CMD_ACCEPT, |
CMD_DECLINE, |
CMD_LAST |
} irq_cmd_type; |
|
54,8 → 52,9 |
typedef struct { |
irq_cmd_type cmd; |
void *addr; |
unsigned long long value; |
int dstarg; |
unsigned long long value; |
unsigned int srcarg; |
unsigned int dstarg; |
} irq_cmd_t; |
|
typedef struct { |
67,8 → 66,10 |
|
#include <arch/types.h> |
#include <adt/list.h> |
#include <adt/hash_table.h> |
#include <synch/spinlock.h> |
#include <proc/task.h> |
#include <ipc/ipc.h> |
|
typedef enum { |
IRQ_DECLINE, /**< Decline to service. */ |
81,8 → 82,11 |
} irq_trigger_t; |
|
struct irq; |
typedef void (* irq_handler_t)(struct irq *irq, void *arg, ...); |
typedef void (* irq_handler_t)(struct irq *); |
|
/** Type for function used to clear the interrupt. */ |
typedef void (* cir_t)(void *, inr_t); |
|
/** IPC notification config structure. |
* |
* Primarily, this structure is encapsulated in the irq_t structure. |
95,6 → 99,8 |
answerbox_t *answerbox; |
/** Method to be used for the notification. */ |
unative_t method; |
/** Arguments that will be sent if the IRQ is claimed. */ |
unative_t scratch[IPC_CALL_LEN]; |
/** Top-half pseudocode. */ |
irq_code_t *code; |
/** Counter. */ |
138,22 → 144,29 |
/** Trigger level of the IRQ. */ |
irq_trigger_t trigger; |
/** Claim ownership of the IRQ. */ |
irq_ownership_t (* claim)(void); |
irq_ownership_t (* claim)(struct irq *); |
/** Handler for this IRQ and device. */ |
irq_handler_t handler; |
/** Argument for the handler. */ |
void *arg; |
/** Instance argument for the handler and the claim function. */ |
void *instance; |
|
/** Clear interrupt routine. */ |
cir_t cir; |
/** First argument to the clear interrupt routine. */ |
void *cir_arg; |
|
/** Notification configuration structure. */ |
ipc_notif_cfg_t notif_cfg; |
} irq_t; |
|
extern void irq_init(count_t inrs, count_t chains); |
extern void irq_initialize(irq_t *irq); |
extern void irq_register(irq_t *irq); |
extern irq_t *irq_dispatch_and_lock(inr_t inr); |
extern irq_t *irq_find_and_lock(inr_t inr, devno_t devno); |
SPINLOCK_EXTERN(irq_uspace_hash_table_lock); |
extern hash_table_t irq_uspace_hash_table; |
|
extern void irq_init(count_t, count_t); |
extern void irq_initialize(irq_t *); |
extern void irq_register(irq_t *); |
extern irq_t *irq_dispatch_and_lock(inr_t); |
|
#endif |
|
#endif |