qdio.h
来自「linux 内核源代码」· C头文件 代码 · 共 609 行 · 第 1/2 页
H
609 行
return (_ccq >> 32) & 0xff;#else return 0;#endif}static inline intdo_siga_sync(struct subchannel_id schid, unsigned int mask1, unsigned int mask2){ register unsigned long reg0 asm ("0") = 2; register struct subchannel_id reg1 asm ("1") = schid; register unsigned long reg2 asm ("2") = mask1; register unsigned long reg3 asm ("3") = mask2; int cc; asm volatile( " siga 0\n" " ipm %0\n" " srl %0,28\n" : "=d" (cc) : "d" (reg0), "d" (reg1), "d" (reg2), "d" (reg3) : "cc"); return cc;}static inline intdo_siga_input(struct subchannel_id schid, unsigned int mask){ register unsigned long reg0 asm ("0") = 1; register struct subchannel_id reg1 asm ("1") = schid; register unsigned long reg2 asm ("2") = mask; int cc; asm volatile( " siga 0\n" " ipm %0\n" " srl %0,28\n" : "=d" (cc) : "d" (reg0), "d" (reg1), "d" (reg2) : "cc", "memory"); return cc;}static inline intdo_siga_output(unsigned long schid, unsigned long mask, __u32 *bb, unsigned int fc){ register unsigned long __fc asm("0") = fc; register unsigned long __schid asm("1") = schid; register unsigned long __mask asm("2") = mask; int cc; asm volatile( " siga 0\n" "0: ipm %0\n" " srl %0,28\n" "1:\n" EX_TABLE(0b,1b) : "=d" (cc), "+d" (__fc), "+d" (__schid), "+d" (__mask) : "0" (QDIO_SIGA_ERROR_ACCESS_EXCEPTION) : "cc", "memory"); (*bb) = ((unsigned int) __fc) >> 31; return cc;}static inline unsigned longdo_clear_global_summary(void){ register unsigned long __fn asm("1") = 3; register unsigned long __tmp asm("2"); register unsigned long __time asm("3"); asm volatile( " .insn rre,0xb2650000,2,0" : "+d" (__fn), "=d" (__tmp), "=d" (__time)); return __time;} /* * QDIO device commands returned by extended Sense-ID */#define DEFAULT_ESTABLISH_QS_CMD 0x1b#define DEFAULT_ESTABLISH_QS_COUNT 0x1000#define DEFAULT_ACTIVATE_QS_CMD 0x1f#define DEFAULT_ACTIVATE_QS_COUNT 0/* * additional CIWs returned by extended Sense-ID */#define CIW_TYPE_EQUEUE 0x3 /* establish QDIO queues */#define CIW_TYPE_AQUEUE 0x4 /* activate QDIO queues */#define QDIO_CHSC_RESPONSE_CODE_OK 1/* flags for st qdio sch data */#define CHSC_FLAG_QDIO_CAPABILITY 0x80#define CHSC_FLAG_VALIDITY 0x40#define CHSC_FLAG_SIGA_INPUT_NECESSARY 0x40#define CHSC_FLAG_SIGA_OUTPUT_NECESSARY 0x20#define CHSC_FLAG_SIGA_SYNC_NECESSARY 0x10#define CHSC_FLAG_SIGA_SYNC_DONE_ON_THININTS 0x08#define CHSC_FLAG_SIGA_SYNC_DONE_ON_OUTB_PCIS 0x04struct qdio_perf_stats {#ifdef CONFIG_64BIT atomic64_t tl_runs; atomic64_t outbound_tl_runs; atomic64_t outbound_tl_runs_resched; atomic64_t inbound_tl_runs; atomic64_t inbound_tl_runs_resched; atomic64_t inbound_thin_tl_runs; atomic64_t inbound_thin_tl_runs_resched; atomic64_t siga_outs; atomic64_t siga_ins; atomic64_t siga_syncs; atomic64_t pcis; atomic64_t thinints; atomic64_t fast_reqs; atomic64_t outbound_cnt; atomic64_t inbound_cnt;#else /* CONFIG_64BIT */ atomic_t tl_runs; atomic_t outbound_tl_runs; atomic_t outbound_tl_runs_resched; atomic_t inbound_tl_runs; atomic_t inbound_tl_runs_resched; atomic_t inbound_thin_tl_runs; atomic_t inbound_thin_tl_runs_resched; atomic_t siga_outs; atomic_t siga_ins; atomic_t siga_syncs; atomic_t pcis; atomic_t thinints; atomic_t fast_reqs; atomic_t outbound_cnt; atomic_t inbound_cnt;#endif /* CONFIG_64BIT */};/* unlikely as the later the better */#define SYNC_MEMORY if (unlikely(q->siga_sync)) qdio_siga_sync_q(q)#define SYNC_MEMORY_ALL if (unlikely(q->siga_sync)) \ qdio_siga_sync(q,~0U,~0U)#define SYNC_MEMORY_ALL_OUTB if (unlikely(q->siga_sync)) \ qdio_siga_sync(q,~0U,0)#define NOW qdio_get_micros()#define SAVE_TIMESTAMP(q) q->timing.last_transfer_time=NOW#define GET_SAVED_TIMESTAMP(q) (q->timing.last_transfer_time)#define SAVE_FRONTIER(q,val) q->last_move_ftc=val#define GET_SAVED_FRONTIER(q) (q->last_move_ftc)#define MY_MODULE_STRING(x) #x#ifdef CONFIG_64BIT#define QDIO_GET_ADDR(x) ((__u32)(unsigned long)x)#else /* CONFIG_64BIT */#define QDIO_GET_ADDR(x) ((__u32)(long)x)#endif /* CONFIG_64BIT */struct qdio_q { volatile struct slsb slsb; char unused[QDIO_MAX_BUFFERS_PER_Q]; __u32 * dev_st_chg_ind; int is_input_q; struct subchannel_id schid; struct ccw_device *cdev; unsigned int is_iqdio_q; unsigned int is_thinint_q; /* bit 0 means queue 0, bit 1 means queue 1, ... */ unsigned int mask; unsigned int q_no; qdio_handler_t (*handler); /* points to the next buffer to be checked for having * been processed by the card (outbound) * or to the next buffer the program should check for (inbound) */ volatile int first_to_check; /* and the last time it was: */ volatile int last_move_ftc; atomic_t number_of_buffers_used; atomic_t polling; unsigned int siga_in; unsigned int siga_out; unsigned int siga_sync; unsigned int siga_sync_done_on_thinints; unsigned int siga_sync_done_on_outb_tis; unsigned int hydra_gives_outbound_pcis; /* used to save beginning position when calling dd_handlers */ int first_element_to_kick; atomic_t use_count; atomic_t is_in_shutdown; void *irq_ptr; struct timer_list timer;#ifdef QDIO_USE_TIMERS_FOR_POLLING atomic_t timer_already_set; spinlock_t timer_lock;#else /* QDIO_USE_TIMERS_FOR_POLLING */ struct tasklet_struct tasklet;#endif /* QDIO_USE_TIMERS_FOR_POLLING */ enum qdio_irq_states state; /* used to store the error condition during a data transfer */ unsigned int qdio_error; unsigned int siga_error; unsigned int error_status_flags; /* list of interesting queues */ volatile struct qdio_q *list_next; volatile struct qdio_q *list_prev; struct sl *sl; volatile struct sbal *sbal[QDIO_MAX_BUFFERS_PER_Q]; struct qdio_buffer *qdio_buffers[QDIO_MAX_BUFFERS_PER_Q]; unsigned long int_parm; /*struct { int in_bh_check_limit; int threshold; } threshold_classes[QDIO_STATS_CLASSES];*/ struct { /* inbound: the time to stop polling outbound: the time to kick peer */ int threshold; /* the real value */ /* outbound: last time of do_QDIO inbound: last time of noticing incoming data */ /*__u64 last_transfer_times[QDIO_STATS_NUMBER]; int last_transfer_index; */ __u64 last_transfer_time; __u64 busy_start; } timing; atomic_t busy_siga_counter; unsigned int queue_type; unsigned int is_pci_out; /* leave this member at the end. won't be cleared in qdio_fill_qs */ struct slib *slib; /* a page is allocated under this pointer, sl points into this page, offset PAGE_SIZE/2 (after slib) */} __attribute__ ((aligned(256)));struct qdio_irq { __u32 * volatile dev_st_chg_ind; unsigned long int_parm; struct subchannel_id schid; unsigned int is_iqdio_irq; unsigned int is_thinint_irq; unsigned int hydra_gives_outbound_pcis; unsigned int sync_done_on_outb_pcis; /* QEBSM facility */ unsigned int is_qebsm; unsigned long sch_token; enum qdio_irq_states state; unsigned int no_input_qs; unsigned int no_output_qs; unsigned char qdioac; struct ccw1 ccw; struct ciw equeue; struct ciw aqueue; struct qib qib; void (*original_int_handler) (struct ccw_device *, unsigned long, struct irb *); /* leave these four members together at the end. won't be cleared in qdio_fill_irq */ struct qdr *qdr; struct qdio_q *input_qs[QDIO_MAX_QUEUES_PER_IRQ]; struct qdio_q *output_qs[QDIO_MAX_QUEUES_PER_IRQ]; struct semaphore setting_up_sema;};#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?