4 #include <linux/config.h>
6 #include <asm/hardirq.h>
9 * How many IRQ's for S390 ?!?
11 #define __MAX_SUBCHANNELS 65536
12 #define NR_IRQS __MAX_SUBCHANNELS
15 #define LPM_ANYPATH 0xff /* doesn't really belong here, Ingo? */
17 #define INVALID_STORAGE_AREA ((void *)(-1 - 0x3FFF ))
20 * path management control word
23 __u32 intparm; /* interruption parameter */
24 __u32 qf : 1; /* qdio facility */
25 __u32 res0 : 1; /* reserved zeros */
26 __u32 isc : 3; /* interruption sublass */
27 __u32 res5 : 3; /* reserved zeros */
28 __u32 ena : 1; /* enabled */
29 __u32 lm : 2; /* limit mode */
30 __u32 mme : 2; /* measurement-mode enable */
31 __u32 mp : 1; /* multipath mode */
32 __u32 tf : 1; /* timing facility */
33 __u32 dnv : 1; /* device number valid */
34 __u32 dev : 16; /* device number */
35 __u8 lpm; /* logical path mask */
36 __u8 pnom; /* path not operational mask */
37 __u8 lpum; /* last path used mask */
38 __u8 pim; /* path installed mask */
39 __u16 mbi; /* measurement-block index */
40 __u8 pom; /* path operational mask */
41 __u8 pam; /* path available mask */
42 __u8 chpid[8]; /* CHPID 0-7 (if available) */
43 __u32 unused1 : 8; /* reserved zeros */
44 __u32 st : 3; /* subchannel type */
45 __u32 unused2 : 20; /* reserved zeros */
46 __u32 csense : 1; /* concurrent sense; can be enabled ...*/
47 /* ... per MSCH, however, if facility */
48 /* ... is not installed, this results */
49 /* ... in an operand exception. */
50 } __attribute__ ((packed)) pmcw_t;
52 #endif /* __KERNEL__ */
54 * subchannel status word
57 __u32 key : 4; /* subchannel key */
58 __u32 sctl : 1; /* suspend control */
59 __u32 eswf : 1; /* ESW format */
60 __u32 cc : 2; /* deferred condition code */
61 __u32 fmt : 1; /* format */
62 __u32 pfch : 1; /* prefetch */
63 __u32 isic : 1; /* initial-status interruption control */
64 __u32 alcc : 1; /* address-limit checking control */
65 __u32 ssi : 1; /* supress-suspended interruption */
66 __u32 zcc : 1; /* zero condition code */
67 __u32 ectl : 1; /* extended control */
68 __u32 pno : 1; /* path not operational */
69 __u32 res : 1; /* reserved */
70 __u32 fctl : 3; /* function control */
71 __u32 actl : 7; /* activity control */
72 __u32 stctl : 5; /* status control */
73 __u32 cpa; /* channel program address */
74 __u32 dstat : 8; /* device status */
75 __u32 cstat : 8; /* subchannel status */
76 __u32 count : 16; /* residual count */
77 } __attribute__ ((packed)) scsw_t;
79 #define SCSW_FCTL_CLEAR_FUNC 0x1
80 #define SCSW_FCTL_HALT_FUNC 0x2
81 #define SCSW_FCTL_START_FUNC 0x4
83 #define SCSW_ACTL_SUSPENDED 0x1
84 #define SCSW_ACTL_DEVACT 0x2
85 #define SCSW_ACTL_SCHACT 0x4
86 #define SCSW_ACTL_CLEAR_PEND 0x8
87 #define SCSW_ACTL_HALT_PEND 0x10
88 #define SCSW_ACTL_START_PEND 0x20
89 #define SCSW_ACTL_RESUME_PEND 0x40
91 #define SCSW_STCTL_STATUS_PEND 0x1
92 #define SCSW_STCTL_SEC_STATUS 0x2
93 #define SCSW_STCTL_PRIM_STATUS 0x4
94 #define SCSW_STCTL_INTER_STATUS 0x8
95 #define SCSW_STCTL_ALERT_STATUS 0x10
97 #define DEV_STAT_ATTENTION 0x80
98 #define DEV_STAT_STAT_MOD 0x40
99 #define DEV_STAT_CU_END 0x20
100 #define DEV_STAT_BUSY 0x10
101 #define DEV_STAT_CHN_END 0x08
102 #define DEV_STAT_DEV_END 0x04
103 #define DEV_STAT_UNIT_CHECK 0x02
104 #define DEV_STAT_UNIT_EXCEP 0x01
106 #define SCHN_STAT_PCI 0x80
107 #define SCHN_STAT_INCORR_LEN 0x40
108 #define SCHN_STAT_PROG_CHECK 0x20
109 #define SCHN_STAT_PROT_CHECK 0x10
110 #define SCHN_STAT_CHN_DATA_CHK 0x08
111 #define SCHN_STAT_CHN_CTRL_CHK 0x04
112 #define SCHN_STAT_INTF_CTRL_CHK 0x02
113 #define SCHN_STAT_CHAIN_CHECK 0x01
116 * architectured values for first sense byte
118 #define SNS0_CMD_REJECT 0x80
119 #define SNS_CMD_REJECT SNS0_CMD_REJECT
120 #define SNS0_INTERVENTION_REQ 0x40
121 #define SNS0_BUS_OUT_CHECK 0x20
122 #define SNS0_EQUIPMENT_CHECK 0x10
123 #define SNS0_DATA_CHECK 0x08
124 #define SNS0_OVERRUN 0x04
126 #define SNS0_INCOMPL_DOMAIN 0x01
129 * architectured values for second sense byte
131 #define SNS1_PERM_ERR 0x80
132 #define SNS1_INV_TRACK_FORMAT 0x40
133 #define SNS1_EOC 0x20
134 #define SNS1_MESSAGE_TO_OPER 0x10
135 #define SNS1_NO_REC_FOUND 0x08
136 #define SNS1_FILE_PROTECTED 0x04
137 #define SNS1_WRITE_INHIBITED 0x02
138 #define SNS1_INPRECISE_END 0x01
141 * architectured values for third sense byte
143 #define SNS2_REQ_INH_WRITE 0x80
144 #define SNS2_CORRECTABLE 0x40
145 #define SNS2_FIRST_LOG_ERR 0x20
146 #define SNS2_ENV_DATA_PRESENT 0x10
148 #define SNS2_INPRECISE_END 0x04
154 * subchannel information block
157 pmcw_t pmcw; /* path management control word */
158 scsw_t scsw; /* subchannel status word */
159 __u8 mda[12]; /* model dependent area */
160 } __attribute__ ((packed,aligned(4))) schib_t;
161 #endif /* __KERNEL__ */
164 __u8 cmd_code;/* command code */
165 __u8 flags; /* flags, like IDA adressing, etc. */
166 __u16 count; /* byte count */
167 __u32 cda; /* data address */
168 } __attribute__ ((packed,aligned(8))) ccw1_t;
170 #define CCW_FLAG_DC 0x80
171 #define CCW_FLAG_CC 0x40
172 #define CCW_FLAG_SLI 0x20
173 #define CCW_FLAG_SKIP 0x10
174 #define CCW_FLAG_PCI 0x08
175 #define CCW_FLAG_IDA 0x04
176 #define CCW_FLAG_SUSPEND 0x02
178 #define CCW_CMD_READ_IPL 0x02
179 #define CCW_CMD_NOOP 0x03
180 #define CCW_CMD_BASIC_SENSE 0x04
181 #define CCW_CMD_TIC 0x08
182 #define CCW_CMD_SENSE_PGID 0x34
183 #define CCW_CMD_SUSPEND_RECONN 0x5B
184 #define CCW_CMD_RDC 0x64
185 #define CCW_CMD_SET_PGID 0xAF
186 #define CCW_CMD_SENSE_ID 0xE4
187 #define CCW_CMD_DCTL 0xF3
190 #define SENSE_MAX_COUNT 0x20
193 * architectured values for first sense byte
195 #define SNS0_CMD_REJECT 0x80
196 #define SNS_CMD_REJECT SNS0_CMD_REJECT
197 #define SNS0_INTERVENTION_REQ 0x40
198 #define SNS0_BUS_OUT_CHECK 0x20
199 #define SNS0_EQUIPMENT_CHECK 0x10
200 #define SNS0_DATA_CHECK 0x08
201 #define SNS0_OVERRUN 0x04
204 * operation request block
207 __u32 intparm; /* interruption parameter */
208 __u32 key : 4; /* flags, like key, suspend control, etc. */
209 __u32 spnd : 1; /* suspend control */
210 __u32 res1 : 1; /* reserved */
211 __u32 mod : 1; /* modification control */
212 __u32 sync : 1; /* synchronize control */
213 __u32 fmt : 1; /* format control */
214 __u32 pfch : 1; /* prefetch control */
215 __u32 isic : 1; /* initial-status-interruption control */
216 __u32 alcc : 1; /* address-limit-checking control */
217 __u32 ssic : 1; /* suppress-suspended-interr. control */
218 __u32 res2 : 1; /* reserved */
219 __u32 c64 : 1; /* IDAW/QDIO 64 bit control */
220 __u32 i2k : 1; /* IDAW 2/4kB block size control */
221 __u32 lpm : 8; /* logical path mask */
222 __u32 ils : 1; /* incorrect length */
223 __u32 zero : 6; /* reserved zeros */
224 __u32 orbx : 1; /* ORB extension control */
225 __u32 cpa; /* channel program address */
226 } __attribute__ ((packed,aligned(4))) orb_t;
228 #endif /* __KERNEL__ */
230 __u32 res0 : 4; /* reserved */
231 __u32 pvrf : 1; /* path-verification-required flag */
232 __u32 cpt : 1; /* channel-path timeout */
233 __u32 fsavf : 1; /* Failing storage address validity flag */
234 __u32 cons : 1; /* concurrent-sense */
235 __u32 res8 : 2; /* reserved */
236 __u32 scnt : 6; /* sense count if cons == 1 */
237 __u32 res16 : 16; /* reserved */
238 } __attribute__ ((packed)) erw_t;
241 * subchannel logout area
244 __u32 res0 : 1; /* reserved */
245 __u32 esf : 7; /* extended status flags */
246 __u32 lpum : 8; /* last path used mask */
247 __u32 res16 : 1; /* reserved */
248 __u32 fvf : 5; /* field-validity flags */
249 __u32 sacc : 2; /* storage access code */
250 __u32 termc : 2; /* termination code */
251 __u32 devsc : 1; /* device-status check */
252 __u32 serr : 1; /* secondary error */
253 __u32 ioerr : 1; /* i/o-error alert */
254 __u32 seqc : 3; /* sequence code */
255 } __attribute__ ((packed)) sublog_t ;
258 * Format 0 Extended Status Word (ESW)
261 sublog_t sublog; /* subchannel logout */
262 erw_t erw; /* extended report word */
263 __u32 faddr; /* failing address */
264 __u32 zeros[2]; /* 2 fullwords of zeros */
265 } __attribute__ ((packed)) esw0_t;
268 * Format 1 Extended Status Word (ESW)
271 __u8 zero0; /* reserved zeros */
272 __u8 lpum; /* last path used mask */
273 __u16 zero16; /* reserved zeros */
274 erw_t erw; /* extended report word */
275 __u32 zeros[3]; /* 2 fullwords of zeros */
276 } __attribute__ ((packed)) esw1_t;
279 * Format 2 Extended Status Word (ESW)
282 __u8 zero0; /* reserved zeros */
283 __u8 lpum; /* last path used mask */
284 __u16 dcti; /* device-connect-time interval */
285 erw_t erw; /* extended report word */
286 __u32 zeros[3]; /* 2 fullwords of zeros */
287 } __attribute__ ((packed)) esw2_t;
290 * Format 3 Extended Status Word (ESW)
293 __u8 zero0; /* reserved zeros */
294 __u8 lpum; /* last path used mask */
295 __u16 res; /* reserved */
296 erw_t erw; /* extended report word */
297 __u32 zeros[3]; /* 2 fullwords of zeros */
298 } __attribute__ ((packed)) esw3_t;
305 } __attribute__ ((packed)) esw_t;
308 * interruption response block
311 scsw_t scsw; /* subchannel status word */
312 esw_t esw; /* extended status word */
313 __u8 ecw[32]; /* extended control word */
314 } __attribute__ ((packed,aligned(4))) irb_t;
321 __u32 reserved1 : 16; /* reserved 0x00000001 */
322 __u32 irq : 16; /* aka. subchannel number */
323 __u32 intparm; /* interruption parameter */
324 __u32 adapter_IO : 1;
327 __u32 reserved3 : 12;
329 __u32 reserved4 : 12;
330 } __attribute__ ((packed)) tpi_info_t;
334 // command information word (CIW) layout
336 typedef struct _ciw {
337 __u32 et : 2; // entry type
338 __u32 reserved : 2; // reserved
339 __u32 ct : 4; // command type
340 __u32 cmd : 8; // command
341 __u32 count : 16; // count
342 } __attribute__ ((packed)) ciw_t;
344 #define CIW_TYPE_RCD 0x0 // read configuration data
345 #define CIW_TYPE_SII 0x1 // set interface identifier
346 #define CIW_TYPE_RNI 0x2 // read node identifier
350 // sense-id response buffer layout
354 __u8 reserved; /* always 0x'FF' */
355 __u16 cu_type; /* control unit type */
356 __u8 cu_model; /* control unit model */
357 __u16 dev_type; /* device type */
358 __u8 dev_model; /* device model */
359 __u8 unused; /* padding byte */
361 ciw_t ciw[MAX_CIWS]; /* variable # of CIWs */
362 } __attribute__ ((packed,aligned(4))) senseid_t;
365 * where we put the ssd info
367 typedef struct _ssd_info {
369 __u8 type:7; /* subchannel type */
370 __u8 chpid[8]; /* chpids */
371 __u16 fla[8]; /* full link addresses */
372 } __attribute__ ((packed)) ssd_info_t;
375 * area for store event information
377 typedef struct chsc_area_t {
388 } __attribute__ ((packed,aligned(8))) sei_req;
392 __u16 f_sch; /* first subchannel */
395 __u16 l_sch; /* last subchannel */
396 } __attribute__ ((packed,aligned(8))) ssd_req;
397 } request_block_data;
400 } __attribute__ ((packed,aligned(8))) request_block;
411 __u8 vf; /* validity flags */
412 __u8 rs; /* reporting source */
413 __u8 cc; /* content code */
415 __u16 fla; /* full link address */
416 __u16 rsid; /* reporting source id */
422 __u32 ccdf[96]; /* content-code dependent field */
423 } __attribute__ ((packed,aligned(8))) sei_res;
428 __u8 st : 3; /* subchannel type */
430 __u8 unit_addr; /* unit address */
431 __u16 devno; /* device number */
435 __u16 sch; /* subchannel */
437 __u8 chpid[8]; /* chpids 0-7 */
439 __u16 fla[8]; /* full link addresses 0-7 */
442 } __attribute__ ((packed,aligned(8))) ssd_res;
443 } response_block_data;
444 } __attribute__ ((packed,aligned(8))) response_block;
445 } __attribute__ ((packed,aligned(PAGE_SIZE))) chsc_area_t;
447 #endif /* __KERNEL__ */
452 __u8 res[32]; /* reserved */
453 __u8 data[32]; /* sense data */
454 } __attribute__ ((packed)) sense_t;
457 * device status area, to be provided by the device driver
458 * when calling request_irq() as parameter "dev_id", later
459 * tied to the "action" control block.
461 * Note : No data area must be added after union ii or the
462 * effective devstat size calculation will fail !
465 __u16 devno; /* device number, aka. "cuu" from irb */
466 unsigned long intparm; /* interrupt parameter */
467 __u8 cstat; /* channel status - accumulated */
468 __u8 dstat; /* device status - accumulated */
469 __u8 lpum; /* last path used mask from irb */
470 __u8 unused; /* not used - reserved */
471 unsigned int flag; /* flag : see below */
472 __u32 cpa; /* CCW address from irb at primary status */
473 __u32 rescnt; /* res. count from irb at primary status */
474 __u32 scnt; /* sense count, if DEVSTAT_FLAG_SENSE_AVAIL */
476 irb_t irb; /* interruption response block */
477 sense_t sense; /* sense information */
478 } ii; /* interrupt information */
481 #define DEVSTAT_FLAG_SENSE_AVAIL 0x00000001
482 #define DEVSTAT_NOT_OPER 0x00000002
483 #define DEVSTAT_START_FUNCTION 0x00000004
484 #define DEVSTAT_HALT_FUNCTION 0x00000008
485 #define DEVSTAT_STATUS_PENDING 0x00000010
486 #define DEVSTAT_REVALIDATE 0x00000020
487 #define DEVSTAT_DEVICE_GONE 0x00000040
488 #define DEVSTAT_DEVICE_OWNED 0x00000080
489 #define DEVSTAT_CLEAR_FUNCTION 0x00000100
490 #define DEVSTAT_PCI 0x00000200
491 #define DEVSTAT_SUSPENDED 0x00000400
492 #define DEVSTAT_UNKNOWN_DEV 0x00000800
493 #define DEVSTAT_UNFRIENDLY_DEV 0x00001000
494 #define DEVSTAT_NOT_ACC 0x00002000
495 #define DEVSTAT_NOT_ACC_ERR 0x00004000
496 #define DEVSTAT_FINAL_STATUS 0x80000000
498 #define DEVINFO_NOT_OPER DEVSTAT_NOT_OPER
499 #define DEVINFO_UNKNOWN_DEV DEVSTAT_UNKNOWN_DEV
500 #define DEVINFO_DEVICE_OWNED DEVSTAT_DEVICE_OWNED
501 #define DEVINFO_QDIO_CAPABLE 0x40000000
502 #define DEVINFO_UNFRIENDLY_DEV DEVSTAT_UNFRIENDLY_DEV
504 #define INTPARM_STATUS_PENDING 0xFFFFFFFF
507 #define IO_INTERRUPT_TYPE 0 /* I/O interrupt type */
509 typedef void (* io_handler_func1_t) ( int irq,
511 struct pt_regs *rgs);
513 typedef void (* io_handler_func_t) ( int irq,
515 struct pt_regs *rgs);
517 typedef void ( * not_oper_handler_func_t)( int irq,
520 typedef int (* adapter_int_handler_t)( __u32 intparm );
523 io_handler_func_t handler; /* interrupt handler routine */
524 const char *name; /* device name */
525 devstat_t *dev_id; /* device status block */
529 __u8 state1 : 2; /* path state value 1 */
530 __u8 state2 : 2; /* path state value 2 */
531 __u8 state3 : 1; /* path state value 3 */
532 __u8 resvd : 3; /* reserved */
533 } __attribute__ ((packed)) path_state_t;
537 __u8 fc; /* SPID function code */
538 path_state_t ps; /* SNID path state */
540 __u32 cpu_addr : 16; /* CPU address */
541 __u32 cpu_id : 24; /* CPU identification */
542 __u32 cpu_model : 16; /* CPU model */
543 __u32 tod_high; /* high word TOD clock */
544 } __attribute__ ((packed)) pgid_t;
546 #define SPID_FUNC_SINGLE_PATH 0x00
547 #define SPID_FUNC_MULTI_PATH 0x80
548 #define SPID_FUNC_ESTABLISH 0x00
549 #define SPID_FUNC_RESIGN 0x40
550 #define SPID_FUNC_DISBAND 0x20
552 #define SNID_STATE1_RESET 0
553 #define SNID_STATE1_UNGROUPED 2
554 #define SNID_STATE1_GROUPED 3
556 #define SNID_STATE2_NOT_RESVD 0
557 #define SNID_STATE2_RESVD_ELSE 2
558 #define SNID_STATE2_RESVD_SELF 3
560 #define SNID_STATE3_MULTI_PATH 1
561 #define SNID_STATE3_SINGLE_PATH 0
564 * Flags used as input parameters for do_IO()
566 #define DOIO_EARLY_NOTIFICATION 0x0001 /* allow for I/O completion ... */
567 /* ... notification after ... */
568 /* ... primary interrupt status */
569 #define DOIO_RETURN_CHAN_END DOIO_EARLY_NOTIFICATION
570 #define DOIO_VALID_LPM 0x0002 /* LPM input parameter is valid */
571 #define DOIO_WAIT_FOR_INTERRUPT 0x0004 /* wait synchronously for interrupt */
572 #define DOIO_REPORT_ALL 0x0008 /* report all interrupt conditions */
573 #define DOIO_ALLOW_SUSPEND 0x0010 /* allow for channel prog. suspend */
574 #define DOIO_DENY_PREFETCH 0x0020 /* don't allow for CCW prefetch */
575 #define DOIO_SUPPRESS_INTER 0x0040 /* suppress intermediate inter. */
576 /* ... for suspended CCWs */
577 #define DOIO_TIMEOUT 0x0080 /* 3 secs. timeout for sync. I/O */
578 #define DOIO_DONT_CALL_INTHDLR 0x0100 /* don't call interrupt handler */
579 #define DOIO_USE_DIAG98 0x0400 /* use DIAG98 instead of SSCH */
584 * Start a S/390 channel program. When the interrupt arrives, the
585 * IRQ handler is called, either immediately, delayed (dev-end missing,
586 * or sense required) or never (no IRQ handler registered -
587 * should never occur, as the IRQ (subchannel ID) should be
588 * disabled if no handler is present. Depending on the action
589 * taken, do_IO() returns : 0 - Success
590 * -EIO - Status pending
591 * see : action->dev_id->cstat
592 * action->dev_id->dstat
593 * -EBUSY - Device busy
594 * -ENODEV - Device not operational
596 int do_IO( int irq, /* IRQ aka. subchannel number */
597 ccw1_t *cpa, /* logical channel program address */
598 unsigned long intparm, /* interruption parameter */
599 __u8 lpm, /* logical path mask */
600 unsigned long flag); /* flags : see above */
602 int start_IO( int irq, /* IRQ aka. subchannel number */
603 ccw1_t *cpa, /* logical channel program address */
604 unsigned long intparm, /* interruption parameter */
605 __u8 lpm, /* logical path mask */
606 unsigned int flag); /* flags : see above */
608 void do_crw_pending( void ); /* CRW handler */
610 int resume_IO( int irq); /* IRQ aka. subchannel number */
612 int halt_IO( int irq, /* IRQ aka. subchannel number */
613 unsigned long intparm, /* dummy intparm */
614 unsigned long flag); /* possible DOIO_WAIT_FOR_INTERRUPT */
616 int clear_IO( int irq, /* IRQ aka. subchannel number */
617 unsigned long intparm, /* dummy intparm */
618 unsigned long flag); /* possible DOIO_WAIT_FOR_INTERRUPT */
620 int process_IRQ( struct pt_regs regs,
622 unsigned int intparm);
625 int enable_cpu_sync_isc ( int irq );
626 int disable_cpu_sync_isc( int irq );
629 int irq; /* irq, aka. subchannel */
630 __u16 devno; /* device number */
631 unsigned int status; /* device status */
632 senseid_t sid_data; /* senseID data */
635 int get_dev_info( int irq, s390_dev_info_t *); /* to be eliminated - don't use */
637 int get_dev_info_by_irq ( int irq, s390_dev_info_t *pdi);
638 int get_dev_info_by_devno( __u16 devno, s390_dev_info_t *pdi);
640 int get_irq_by_devno( __u16 devno );
641 unsigned int get_devno_by_irq( int irq );
643 int get_irq_first( void );
644 int get_irq_next ( int irq );
646 int read_dev_chars( int irq, void **buffer, int length );
647 int read_conf_data( int irq, void **buffer, int *length, __u8 lpm );
649 int s390_DevicePathVerification( int irq, __u8 domask );
651 int s390_trigger_resense(int irq);
653 int s390_request_irq_special( int irq,
654 io_handler_func_t io_handler,
655 not_oper_handler_func_t not_oper_handler,
656 unsigned long irqflags,
660 extern int set_cons_dev(int irq);
661 extern int wait_cons_dev(int irq);
662 extern schib_t *s390_get_schib( int irq );
664 extern int s390_register_adapter_interrupt(adapter_int_handler_t handler);
665 extern int s390_unregister_adapter_interrupt(adapter_int_handler_t handler);
668 * Some S390 specific IO instructions as inline
671 extern __inline__ int stsch(int irq, volatile schib_t *addr)
675 __asm__ __volatile__(
681 : "d" (irq | 0x10000), "a" (addr)
686 extern __inline__ int msch(int irq, volatile schib_t *addr)
690 __asm__ __volatile__(
696 : "d" (irq | 0x10000L), "a" (addr)
701 extern __inline__ int msch_err(int irq, volatile schib_t *addr)
705 __asm__ __volatile__(
711 #ifdef CONFIG_ARCH_S390X
712 ".section .fixup,\"ax\"\n"
716 ".section __ex_table,\"a\"\n"
721 ".section .fixup,\"ax\"\n"
728 ".section __ex_table,\"a\"\n"
734 : "d" (irq | 0x10000L), "a" (addr), "i" (__LC_PGM_ILC)
739 extern __inline__ int tsch(int irq, volatile irb_t *addr)
743 __asm__ __volatile__(
749 : "d" (irq | 0x10000L), "a" (addr)
754 extern __inline__ int tpi( volatile tpi_info_t *addr)
758 __asm__ __volatile__(
768 extern __inline__ int ssch(int irq, volatile orb_t *addr)
772 __asm__ __volatile__(
778 : "d" (irq | 0x10000L), "a" (addr)
783 extern __inline__ int diag98(int irq, volatile orb_t *addr)
787 __asm__ __volatile__(
789 " lgr 0,%2\n" /* orb in 0 */
790 " lghi 2,12\n" /* function code 0x0c */
791 " diag 2,0,152\n" /* diag98 instead of ssch,
793 " ipm %0\n" /* usual cc evaluation. cc=3 will be
794 reported as not operational */
797 : "d" (irq | 0x10000L), "a" (addr)
798 : "cc", "0", "1", "2");
802 extern __inline__ int rsch(int irq)
806 __asm__ __volatile__(
812 : "d" (irq | 0x10000L)
817 extern __inline__ int csch(int irq)
821 __asm__ __volatile__(
827 : "d" (irq | 0x10000L)
832 extern __inline__ int hsch(int irq)
836 __asm__ __volatile__(
842 : "d" (irq | 0x10000L)
847 extern __inline__ int xsch(int irq)
851 __asm__ __volatile__(
853 " .insn rre,0xb2760000,%1,0\n"
857 : "d" (irq | 0x10000L)
862 extern __inline__ int iac( void)
866 __asm__ __volatile__(
870 : "=d" (ccode) : : "cc", "1" );
874 extern __inline__ int rchp(int chpid)
878 __asm__ __volatile__(
890 __u16 vrdcdvno : 16; /* device number (input) */
891 __u16 vrdclen : 16; /* data block length (input) */
892 __u32 vrdcvcla : 8; /* virtual device class (output) */
893 __u32 vrdcvtyp : 8; /* virtual device type (output) */
894 __u32 vrdcvsta : 8; /* virtual device status (output) */
895 __u32 vrdcvfla : 8; /* virtual device flags (output) */
896 __u32 vrdcrccl : 8; /* real device class (output) */
897 __u32 vrdccrty : 8; /* real device type (output) */
898 __u32 vrdccrmd : 8; /* real device model (output) */
899 __u32 vrdccrft : 8; /* real device feature (output) */
900 } __attribute__ ((packed,aligned(4))) diag210_t;
902 void VM_virtual_device_info( __u16 devno, /* device number */
903 senseid_t *ps ); /* ptr to senseID data */
905 extern int diag210( diag210_t * addr);
907 extern __inline__ int chsc( chsc_area_t * chsc_area)
911 __asm__ __volatile__ (
912 ".insn rre,0xb25f0000,%1,0 \n\t"
923 * Various low-level irq details needed by irq.c, process.c,
924 * time.c, io_apic.c and smp.c
926 * Interrupt entry/exit code at both C and assembly level
929 void mask_irq(unsigned int irq);
930 void unmask_irq(unsigned int irq);
932 #define MAX_IRQ_SOURCES 128
934 extern spinlock_t irq_controller_lock;
938 #include <asm/atomic.h>
940 static inline void irq_enter(int cpu, unsigned int irq)
943 while (atomic_read(&global_irq_lock) != 0) {
948 static inline void irq_exit(int cpu, unsigned int irq)
951 release_irqlock(cpu);
957 #define irq_enter(cpu, irq) (++local_irq_count(cpu))
958 #define irq_exit(cpu, irq) (--local_irq_count(cpu))
963 #define STR(x) __STR(x)
968 * SMP has a few special interrupts for IPI messages
971 #endif /* CONFIG_SMP */
974 * x86 profiling function, SMP safe. We might want to do this in
978 static inline void s390_do_profile (unsigned long addr)
980 if (prof_buffer && current->pid) {
981 #ifndef CONFIG_ARCH_S390X
984 addr -= (unsigned long) &_stext;
987 * Don't ignore out-of-bounds EIP values silently,
988 * put them into the last histogram slot, so if
989 * present, they will show up as a sharp peak.
991 if (addr > prof_len-1)
993 atomic_inc((atomic_t *)&prof_buffer[addr]);
997 #include <asm/s390io.h>
999 #define get_irq_lock(irq) &ioinfo[irq]->irq_lock
1001 #define s390irq_spin_lock(irq) \
1002 spin_lock(&(ioinfo[irq]->irq_lock))
1004 #define s390irq_spin_unlock(irq) \
1005 spin_unlock(&(ioinfo[irq]->irq_lock))
1007 #define s390irq_spin_lock_irqsave(irq,flags) \
1008 spin_lock_irqsave(&(ioinfo[irq]->irq_lock), flags)
1009 #define s390irq_spin_unlock_irqrestore(irq,flags) \
1010 spin_unlock_irqrestore(&(ioinfo[irq]->irq_lock), flags)
1012 #define touch_nmi_watchdog() do { } while(0)
1014 #endif /* __KERNEL__ */