Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/ddi/irq.h

    rda1bafb rd99c1d2  
    3636#define KERN_IRQ_H_
    3737
    38 #ifdef KERNEL
    39 
    40 #include <typedefs.h>
    41 #include <adt/list.h>
    42 #include <adt/hash_table.h>
    43 #include <synch/spinlock.h>
    44 #include <proc/task.h>
    45 #include <ipc/ipc.h>
    46 
    47 #endif /* KERNEL */
    48 
    4938typedef enum {
    5039        /** Read 1 byte from the I/O space. */
     
    6049        /** Write 4 bytes to the I/O space. */
    6150        CMD_PIO_WRITE_32,
    62        
    6351        /**
    6452         * Perform a bit test on the source argument and store the result into
     
    6654         */
    6755        CMD_BTEST,
    68        
    6956        /**
    7057         * Predicate the execution of the following N commands by the boolean
     
    7259         */
    7360        CMD_PREDICATE,
    74        
    7561        /** Accept the interrupt. */
    7662        CMD_ACCEPT,
     
    8369        irq_cmd_type cmd;
    8470        void *addr;
    85         uint32_t value;
    86         uintptr_t srcarg;
    87         uintptr_t dstarg;
     71        unsigned long long value;
     72        unsigned int srcarg;
     73        unsigned int dstarg;
    8874} irq_cmd_t;
    8975
    9076typedef struct {
    91         size_t cmdcount;
     77        unsigned int cmdcount;
    9278        irq_cmd_t *cmds;
    9379} irq_code_t;
     
    9581#ifdef KERNEL
    9682
     83#include <typedefs.h>
     84#include <adt/list.h>
     85#include <adt/hash_table.h>
     86#include <synch/spinlock.h>
     87#include <proc/task.h>
     88#include <ipc/ipc.h>
     89
    9790typedef enum {
    98         IRQ_DECLINE,  /**< Decline to service. */
    99         IRQ_ACCEPT    /**< Accept to service. */
     91        IRQ_DECLINE,            /**< Decline to service. */
     92        IRQ_ACCEPT              /**< Accept to service. */
    10093} irq_ownership_t;
    10194
     
    115108 * Primarily, this structure is encapsulated in the irq_t structure.
    116109 * It is protected by irq_t::lock.
    117  *
    118110 */
    119111typedef struct {
     
    125117        unative_t method;
    126118        /** Arguments that will be sent if the IRQ is claimed. */
    127         uint32_t scratch[IPC_CALL_LEN];
     119        unative_t scratch[IPC_CALL_LEN];
    128120        /** Top-half pseudocode. */
    129121        irq_code_t *code;
    130122        /** Counter. */
    131123        size_t counter;
    132        
    133124        /**
    134125         * Link between IRQs that are notifying the same answerbox. The list is
     
    142133 * If one device has multiple interrupts, there will be multiple irq_t
    143134 * instantions with the same devno.
    144  *
    145135 */
    146136typedef struct irq {
    147137        /** Hash table link. */
    148138        link_t link;
    149        
     139
    150140        /** Lock protecting everything in this structure
    151141         *  except the link member. When both the IRQ
     
    153143         *  this lock must not be taken first.
    154144         */
    155         IRQ_SPINLOCK_DECLARE(lock);
     145        SPINLOCK_DECLARE(lock);
    156146       
    157147        /** Send EOI before processing the interrupt.
     
    162152         */
    163153        bool preack;
    164        
     154
    165155        /** Unique device number. -1 if not yet assigned. */
    166156        devno_t devno;
    167        
     157
    168158        /** Actual IRQ number. -1 if not yet assigned. */
    169159        inr_t inr;
     
    176166        /** Instance argument for the handler and the claim function. */
    177167        void *instance;
    178        
     168
    179169        /** Clear interrupt routine. */
    180170        cir_t cir;
    181171        /** First argument to the clear interrupt routine. */
    182172        void *cir_arg;
    183        
     173
    184174        /** Notification configuration structure. */
    185175        ipc_notif_cfg_t notif_cfg;
    186176} irq_t;
    187177
    188 IRQ_SPINLOCK_EXTERN(irq_uspace_hash_table_lock);
     178SPINLOCK_EXTERN(irq_uspace_hash_table_lock);
    189179extern hash_table_t irq_uspace_hash_table;
    190180
     
    194184extern irq_t *irq_dispatch_and_lock(inr_t);
    195185
    196 #endif /* KERNEL */
     186#endif
    197187
    198188#endif
Note: See TracChangeset for help on using the changeset viewer.