⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 irq.h

📁 讲述linux的初始化过程
💻 H
📖 第 1 页 / 共 2 页
字号:
	__u8  state2    :  2;   /* path state value 2 */	__u8  state3    :  1;   /* path state value 3 */	__u8  resvd     :  3;   /* reserved */	} __attribute__ ((packed)) path_state_t;typedef struct {   union {		__u8         fc;   /* SPID function code */		path_state_t ps;   /* SNID path state */	} inf;	__u32 cpu_addr  : 16;   /* CPU address */	__u32 cpu_id    : 24;   /* CPU identification */	__u32 cpu_model : 16;   /* CPU model */	__u32 tod_high;         /* high word TOD clock */	} __attribute__ ((packed)) pgid_t;#define SPID_FUNC_MULTI_PATH       0x80#define SPID_FUNC_ESTABLISH        0x00#define SPID_FUNC_RESIGN           0x40#define SPID_FUNC_DISBAND          0x20#define SNID_STATE1_RESET          0x0#define SNID_STATE1_UNGROUPED      0x8#define SNID_STATE1_GROUPED        0xC#define SNID_STATE2_NOT_RESVD      0x0#define SNID_STATE2_RESVD_ELSE     0x8#define SNID_STATE2_RESVD_SELF     0xC#define SNID_STATE3_MULTI_PATH     1/* * Flags used as input parameters for do_IO() */#define DOIO_EARLY_NOTIFICATION 0x01    /* allow for I/O completion ... */                                        /* ... notification after ... */                                        /* ... primary interrupt status */#define DOIO_RETURN_CHAN_END       DOIO_EARLY_NOTIFICATION#define DOIO_VALID_LPM          0x02    /* LPM input parameter is valid */#define DOIO_WAIT_FOR_INTERRUPT 0x04    /* wait synchronously for interrupt */#define DOIO_REPORT_ALL         0x08    /* report all interrupt conditions */#define DOIO_ALLOW_SUSPEND      0x10    /* allow for channel prog. suspend */#define DOIO_DENY_PREFETCH      0x20    /* don't allow for CCW prefetch */#define DOIO_SUPPRESS_INTER     0x40    /* suppress intermediate inter. */                                        /* ... for suspended CCWs */#define DOIO_TIMEOUT            0x80    /* 3 secs. timeout for sync. I/O *//* * do_IO() * * Start a S/390 channel program. When the interrupt arrives *  handle_IRQ_event() is called, which eventually calls the *  IRQ handler, either immediately, delayed (dev-end missing, *  or sense required) or never (no IRQ handler registered - *  should never occur, as the IRQ (subchannel ID) should be *  disabled if no handler is present. Depending on the action *  taken, do_IO() returns :  0      - Success *                           -EIO    - Status pending *                                        see : action->dev_id->cstat *                                              action->dev_id->dstat *                           -EBUSY  - Device busy *                           -ENODEV - Device not operational */int do_IO( int            irq,          /* IRQ aka. subchannel number */           ccw1_t        *cpa,          /* logical channel program address */           unsigned long  intparm,      /* interruption parameter */           __u8           lpm,          /* logical path mask */           unsigned long  flag);        /* flags : see above */int start_IO( int           irq,       /* IRQ aka. subchannel number */              ccw1_t       *cpa,       /* logical channel program address */              unsigned int  intparm,   /* interruption parameter */              __u8          lpm,       /* logical path mask */              unsigned int  flag);     /* flags : see above */void do_crw_pending( void  );	         /* CRW handler */int resume_IO( int irq);               /* IRQ aka. subchannel number */int halt_IO( int           irq,         /* IRQ aka. subchannel number */             unsigned long intparm,     /* dummy intparm */             unsigned long flag);       /* possible DOIO_WAIT_FOR_INTERRUPT */int clear_IO( int           irq,         /* IRQ aka. subchannel number */              unsigned long intparm,     /* dummy intparm */              unsigned long flag);       /* possible DOIO_WAIT_FOR_INTERRUPT */int process_IRQ( struct pt_regs regs,                 unsigned int   irq,                 unsigned int   intparm);int enable_cpu_sync_isc ( int irq );int disable_cpu_sync_isc( int irq );typedef struct {     int          irq;                  /* irq, aka. subchannel */     __u16        devno;                /* device number */     unsigned int status;               /* device status */     senseid_t    sid_data;             /* senseID data */     } dev_info_t;int get_dev_info( int irq, dev_info_t *);   /* to be eliminated - don't use */int get_dev_info_by_irq  ( int irq, dev_info_t *pdi);int get_dev_info_by_devno( __u16 devno, dev_info_t *pdi);int          get_irq_by_devno( __u16 devno );unsigned int get_devno_by_irq( int irq );int get_irq_first( void );int get_irq_next ( int irq );int read_dev_chars( int irq, void **buffer, int length );int read_conf_data( int irq, void **buffer, int *length );extern int handle_IRQ_event( unsigned int irq, int cpu, struct pt_regs *);extern int set_cons_dev(int irq);extern int reset_cons_dev(int irq);extern int wait_cons_dev(int irq);/* * Some S390 specific IO instructions as inline */extern __inline__ int stsch(int irq, volatile schib_t *addr){        int ccode;        __asm__ __volatile__(                "LR 1,%1\n\t"                "STSCH 0(%2)\n\t"                "IPM %0\n\t"                "SRL %0,28\n\t"                : "=d" (ccode) : "r" (irq | 0x10000L), "a" (addr)                : "cc", "1" );        return ccode;}extern __inline__ int msch(int irq, volatile schib_t *addr){        int ccode;        __asm__ __volatile__(                "LR 1,%1\n\t"                "MSCH 0(%2)\n\t"                "IPM %0\n\t"                "SRL %0,28\n\t"                : "=d" (ccode) : "r" (irq | 0x10000L), "a" (addr)                : "cc", "1" );        return ccode;}extern __inline__ int msch_err(int irq, volatile schib_t *addr){        int ccode;        __asm__ __volatile__(                "    lr   1,%1\n"                "    msch 0(%2)\n"                "0:  ipm  %0\n"                "    srl  %0,28\n"                "1:\n"                ".section .fixup,\"ax\"\n"                "2:  l    %0,%3\n"                "    bras 1,3f\n"                "    .long 1b\n"                "3:  l    1,0(1)\n"                "    br   1\n"                ".previous\n"                ".section __ex_table,\"a\"\n"                "   .align 4\n"                "   .long 0b,2b\n"                ".previous"                : "=d" (ccode)                : "r" (irq | 0x10000L), "a" (addr), "i" (__LC_PGM_ILC)                : "cc", "1" );        return ccode;}extern __inline__ int tsch(int irq, volatile irb_t *addr){        int ccode;        __asm__ __volatile__(                "LR 1,%1\n\t"                "TSCH 0(%2)\n\t"                "IPM %0\n\t"                "SRL %0,28\n\t"                : "=d" (ccode) : "r" (irq | 0x10000L), "a" (addr)                : "cc", "1" );        return ccode;}extern __inline__ int tpi( volatile tpi_info_t *addr){        int ccode;        __asm__ __volatile__(                "TPI 0(%1)\n\t"                "IPM %0\n\t"                "SRL %0,28\n\t"                : "=d" (ccode) : "a" (addr)                : "cc", "1" );        return ccode;}extern __inline__ int ssch(int irq, volatile orb_t *addr){        int ccode;        __asm__ __volatile__(                "LR 1,%1\n\t"                "SSCH 0(%2)\n\t"                "IPM %0\n\t"                "SRL %0,28\n\t"                : "=d" (ccode) : "r" (irq | 0x10000L), "a" (addr)                : "cc", "1" );        return ccode;}extern __inline__ int rsch(int irq){        int ccode;        __asm__ __volatile__(                "LR 1,%1\n\t"                "RSCH\n\t"                "IPM %0\n\t"                "SRL %0,28\n\t"                : "=d" (ccode) : "r" (irq | 0x10000L)                : "cc", "1" );        return ccode;}extern __inline__ int csch(int irq){        int ccode;        __asm__ __volatile__(                "LR 1,%1\n\t"                "CSCH\n\t"                "IPM %0\n\t"                "SRL %0,28\n\t"                : "=d" (ccode) : "r" (irq | 0x10000L)                : "cc", "1" );        return ccode;}extern __inline__ int hsch(int irq){        int ccode;        __asm__ __volatile__(                "LR 1,%1\n\t"                "HSCH\n\t"                "IPM %0\n\t"                "SRL %0,28\n\t"                : "=d" (ccode) : "r" (irq | 0x10000L)                : "cc", "1" );        return ccode;}extern __inline__ int iac( void){        int ccode;        __asm__ __volatile__(                "IAC 1\n\t"                "IPM %0\n\t"                "SRL %0,28\n\t"                : "=d" (ccode) : : "cc", "1" );        return ccode;}typedef struct {     __u16 vrdcdvno : 16;   /* device number (input) */     __u16 vrdclen  : 16;   /* data block length (input) */     __u32 vrdcvcla : 8;    /* virtual device class (output) */     __u32 vrdcvtyp : 8;    /* virtual device type (output) */     __u32 vrdcvsta : 8;    /* virtual device status (output) */     __u32 vrdcvfla : 8;    /* virtual device flags (output) */     __u32 vrdcrccl : 8;    /* real device class (output) */     __u32 vrdccrty : 8;    /* real device type (output) */     __u32 vrdccrmd : 8;    /* real device model (output) */     __u32 vrdccrft : 8;    /* real device feature (output) */     } __attribute__ ((packed,aligned(4))) diag210_t;void VM_virtual_device_info( __u16      devno,   /* device number */                             senseid_t *ps );    /* ptr to senseID data */extern __inline__ int diag210( diag210_t * addr){        int ccode;        __asm__ __volatile__(                "LR 1,%1\n\t"                ".long 0x83110210\n\t"                "IPM %0\n\t"                "SRL %0,28\n\t"                : "=d" (ccode) : "a" (addr)                : "cc", "1" );        return ccode;}/* * Various low-level irq details needed by irq.c, process.c, * time.c, io_apic.c and smp.c * * Interrupt entry/exit code at both C and assembly level */void mask_irq(unsigned int irq);void unmask_irq(unsigned int irq);#define MAX_IRQ_SOURCES 128extern spinlock_t irq_controller_lock;#ifdef CONFIG_SMP#include <asm/atomic.h>static inline void irq_enter(int cpu, unsigned int irq){        hardirq_enter(cpu);        while (test_bit(0,&global_irq_lock)) {                eieio();        }}static inline void irq_exit(int cpu, unsigned int irq){        hardirq_exit(cpu);        release_irqlock(cpu);}#else#define irq_enter(cpu, irq)     (++local_irq_count(cpu))#define irq_exit(cpu, irq)      (--local_irq_count(cpu))#endif#define __STR(x) #x#define STR(x) __STR(x)#ifdef CONFIG_SMP/* *      SMP has a few special interrupts for IPI messages */#endif /* CONFIG_SMP *//* * x86 profiling function, SMP safe. We might want to do this in * assembly totally? */static inline void s390_do_profile (unsigned long addr){#if 0        if (prof_buffer && current->pid) {                addr -= (unsigned long) &_stext;                addr >>= prof_shift;                /*                 * Don't ignore out-of-bounds EIP values silently,                 * put them into the last histogram slot, so if                 * present, they will show up as a sharp peak.                 */                if (addr > prof_len-1)                        addr = prof_len-1;                atomic_inc((atomic_t *)&prof_buffer[addr]);        }#endif}#include <asm/s390io.h>#define s390irq_spin_lock(irq) \        spin_lock(&(ioinfo[irq]->irq_lock))#define s390irq_spin_unlock(irq) \        spin_unlock(&(ioinfo[irq]->irq_lock))#define s390irq_spin_lock_irqsave(irq,flags) \        spin_lock_irqsave(&(ioinfo[irq]->irq_lock), flags)#define s390irq_spin_unlock_irqrestore(irq,flags) \        spin_unlock_irqrestore(&(ioinfo[irq]->irq_lock), flags)#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -