iop.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  1. /*
  2. * I/O Processor (IOP) management
  3. * Written and (C) 1999 by Joshua M. Thompson ([email protected])
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions
  7. * are met:
  8. * 1. Redistributions of source code must retain the above copyright
  9. * notice and this list of conditions.
  10. * 2. Redistributions in binary form must reproduce the above copyright
  11. * notice and this list of conditions in the documentation and/or other
  12. * materials provided with the distribution.
  13. */
  14. /*
  15. * The IOP chips are used in the IIfx and some Quadras (900, 950) to manage
  16. * serial and ADB. They are actually a 6502 processor and some glue logic.
  17. *
  18. * 990429 (jmt) - Initial implementation, just enough to knock the SCC IOP
  19. * into compatible mode so nobody has to fiddle with the
  20. * Serial Switch control panel anymore.
  21. * 990603 (jmt) - Added code to grab the correct ISM IOP interrupt for OSS
  22. * and non-OSS machines (at least I hope it's correct on a
  23. * non-OSS machine -- someone with a Q900 or Q950 needs to
  24. * check this.)
  25. * 990605 (jmt) - Rearranged things a bit wrt IOP detection; iop_present is
  26. * gone, IOP base addresses are now in an array and the
  27. * globally-visible functions take an IOP number instead of
  28. * an actual base address.
  29. * 990610 (jmt) - Finished the message passing framework and it seems to work.
  30. * Sending _definitely_ works; my adb-bus.c mods can send
  31. * messages and receive the MSG_COMPLETED status back from the
  32. * IOP. The trick now is figuring out the message formats.
  33. * 990611 (jmt) - More cleanups. Fixed problem where unclaimed messages on a
  34. * receive channel were never properly acknowledged. Bracketed
  35. * the remaining debug printk's with #ifdef's and disabled
  36. * debugging. I can now type on the console.
  37. * 990612 (jmt) - Copyright notice added. Reworked the way replies are handled.
  38. * It turns out that replies are placed back in the send buffer
  39. * for that channel; messages on the receive channels are always
  40. * unsolicited messages from the IOP (and our replies to them
  41. * should go back in the receive channel.) Also added tracking
  42. * of device names to the listener functions ala the interrupt
  43. * handlers.
  44. * 990729 (jmt) - Added passing of pt_regs structure to IOP handlers. This is
  45. * used by the new unified ADB driver.
  46. *
  47. * TODO:
  48. *
  49. * o The SCC IOP has to be placed in bypass mode before the serial console
  50. * gets initialized. iop_init() would be one place to do that. Or the
  51. * bootloader could do that. For now, the Serial Switch control panel
  52. * is needed for that -- contrary to the changelog above.
  53. * o Something should be periodically checking iop_alive() to make sure the
  54. * IOP hasn't died.
  55. * o Some of the IOP manager routines need better error checking and
  56. * return codes. Nothing major, just prettying up.
  57. */
  58. /*
  59. * -----------------------
  60. * IOP Message Passing 101
  61. * -----------------------
  62. *
  63. * The host talks to the IOPs using a rather simple message-passing scheme via
  64. * a shared memory area in the IOP RAM. Each IOP has seven "channels"; each
  65. * channel is connected to a specific software driver on the IOP. For example
  66. * on the SCC IOP there is one channel for each serial port. Each channel has
  67. * an incoming and an outgoing message queue with a depth of one.
  68. *
  69. * A message is 32 bytes plus a state byte for the channel (MSG_IDLE, MSG_NEW,
  70. * MSG_RCVD, MSG_COMPLETE). To send a message you copy the message into the
  71. * buffer, set the state to MSG_NEW and signal the IOP by setting the IRQ flag
  72. * in the IOP control to 1. The IOP will move the state to MSG_RCVD when it
  73. * receives the message and then to MSG_COMPLETE when the message processing
  74. * has completed. It is the host's responsibility at that point to read the
  75. * reply back out of the send channel buffer and reset the channel state back
  76. * to MSG_IDLE.
  77. *
  78. * To receive message from the IOP the same procedure is used except the roles
  79. * are reversed. That is, the IOP puts message in the channel with a state of
  80. * MSG_NEW, and the host receives the message and move its state to MSG_RCVD
  81. * and then to MSG_COMPLETE when processing is completed and the reply (if any)
  82. * has been placed back in the receive channel. The IOP will then reset the
  83. * channel state to MSG_IDLE.
  84. *
  85. * Two sets of host interrupts are provided, INT0 and INT1. Both appear on one
  86. * interrupt level; they are distinguished by a pair of bits in the IOP status
  87. * register. The IOP will raise INT0 when one or more messages in the send
  88. * channels have gone to the MSG_COMPLETE state and it will raise INT1 when one
  89. * or more messages on the receive channels have gone to the MSG_NEW state.
  90. *
  91. * Since each channel handles only one message we have to implement a small
  92. * interrupt-driven queue on our end. Messages to be sent are placed on the
  93. * queue for sending and contain a pointer to an optional callback function.
  94. * The handler for a message is called when the message state goes to
  95. * MSG_COMPLETE.
  96. *
  97. * For receiving message we maintain a list of handler functions to call when
  98. * a message is received on that IOP/channel combination. The handlers are
  99. * called much like an interrupt handler and are passed a copy of the message
  100. * from the IOP. The message state will be in MSG_RCVD while the handler runs;
  101. * it is the handler's responsibility to call iop_complete_message() when
  102. * finished; this function moves the message state to MSG_COMPLETE and signals
  103. * the IOP. This two-step process is provided to allow the handler to defer
  104. * message processing to a bottom-half handler if the processing will take
  105. * a significant amount of time (handlers are called at interrupt time so they
  106. * should execute quickly.)
  107. */
  108. #include <linux/types.h>
  109. #include <linux/kernel.h>
  110. #include <linux/mm.h>
  111. #include <linux/delay.h>
  112. #include <linux/init.h>
  113. #include <linux/interrupt.h>
  114. #include <asm/macintosh.h>
  115. #include <asm/macints.h>
  116. #include <asm/mac_iop.h>
  117. #ifdef DEBUG
  118. #define iop_pr_debug(fmt, ...) \
  119. printk(KERN_DEBUG "%s: " fmt, __func__, ##__VA_ARGS__)
  120. #define iop_pr_cont(fmt, ...) \
  121. printk(KERN_CONT fmt, ##__VA_ARGS__)
  122. #else
  123. #define iop_pr_debug(fmt, ...) \
  124. no_printk(KERN_DEBUG "%s: " fmt, __func__, ##__VA_ARGS__)
  125. #define iop_pr_cont(fmt, ...) \
  126. no_printk(KERN_CONT fmt, ##__VA_ARGS__)
  127. #endif
  128. /* Non-zero if the IOPs are present */
  129. int iop_scc_present, iop_ism_present;
  130. /* structure for tracking channel listeners */
  131. struct listener {
  132. const char *devname;
  133. void (*handler)(struct iop_msg *);
  134. };
  135. /*
  136. * IOP structures for the two IOPs
  137. *
  138. * The SCC IOP controls both serial ports (A and B) as its two functions.
  139. * The ISM IOP controls the SWIM (floppy drive) and ADB.
  140. */
  141. static volatile struct mac_iop *iop_base[NUM_IOPS];
  142. /*
  143. * IOP message queues
  144. */
  145. static struct iop_msg iop_msg_pool[NUM_IOP_MSGS];
  146. static struct iop_msg *iop_send_queue[NUM_IOPS][NUM_IOP_CHAN];
  147. static struct listener iop_listeners[NUM_IOPS][NUM_IOP_CHAN];
  148. irqreturn_t iop_ism_irq(int, void *);
  149. /*
  150. * Private access functions
  151. */
  152. static __inline__ void iop_loadaddr(volatile struct mac_iop *iop, __u16 addr)
  153. {
  154. iop->ram_addr_lo = addr;
  155. iop->ram_addr_hi = addr >> 8;
  156. }
  157. static __inline__ __u8 iop_readb(volatile struct mac_iop *iop, __u16 addr)
  158. {
  159. iop->ram_addr_lo = addr;
  160. iop->ram_addr_hi = addr >> 8;
  161. return iop->ram_data;
  162. }
  163. static __inline__ void iop_writeb(volatile struct mac_iop *iop, __u16 addr, __u8 data)
  164. {
  165. iop->ram_addr_lo = addr;
  166. iop->ram_addr_hi = addr >> 8;
  167. iop->ram_data = data;
  168. }
  169. static __inline__ void iop_stop(volatile struct mac_iop *iop)
  170. {
  171. iop->status_ctrl = IOP_AUTOINC;
  172. }
  173. static __inline__ void iop_start(volatile struct mac_iop *iop)
  174. {
  175. iop->status_ctrl = IOP_RUN | IOP_AUTOINC;
  176. }
  177. static __inline__ void iop_interrupt(volatile struct mac_iop *iop)
  178. {
  179. iop->status_ctrl = IOP_IRQ | IOP_RUN | IOP_AUTOINC;
  180. }
  181. static int iop_alive(volatile struct mac_iop *iop)
  182. {
  183. int retval;
  184. retval = (iop_readb(iop, IOP_ADDR_ALIVE) == 0xFF);
  185. iop_writeb(iop, IOP_ADDR_ALIVE, 0);
  186. return retval;
  187. }
  188. static struct iop_msg *iop_get_unused_msg(void)
  189. {
  190. int i;
  191. unsigned long flags;
  192. local_irq_save(flags);
  193. for (i = 0 ; i < NUM_IOP_MSGS ; i++) {
  194. if (iop_msg_pool[i].status == IOP_MSGSTATUS_UNUSED) {
  195. iop_msg_pool[i].status = IOP_MSGSTATUS_WAITING;
  196. local_irq_restore(flags);
  197. return &iop_msg_pool[i];
  198. }
  199. }
  200. local_irq_restore(flags);
  201. return NULL;
  202. }
  203. /*
  204. * Initialize the IOPs, if present.
  205. */
  206. void __init iop_init(void)
  207. {
  208. int i;
  209. if (macintosh_config->scc_type == MAC_SCC_IOP) {
  210. if (macintosh_config->ident == MAC_MODEL_IIFX)
  211. iop_base[IOP_NUM_SCC] = (struct mac_iop *)SCC_IOP_BASE_IIFX;
  212. else
  213. iop_base[IOP_NUM_SCC] = (struct mac_iop *)SCC_IOP_BASE_QUADRA;
  214. iop_scc_present = 1;
  215. pr_debug("SCC IOP detected at %p\n", iop_base[IOP_NUM_SCC]);
  216. }
  217. if (macintosh_config->adb_type == MAC_ADB_IOP) {
  218. if (macintosh_config->ident == MAC_MODEL_IIFX)
  219. iop_base[IOP_NUM_ISM] = (struct mac_iop *)ISM_IOP_BASE_IIFX;
  220. else
  221. iop_base[IOP_NUM_ISM] = (struct mac_iop *)ISM_IOP_BASE_QUADRA;
  222. iop_ism_present = 1;
  223. pr_debug("ISM IOP detected at %p\n", iop_base[IOP_NUM_ISM]);
  224. iop_stop(iop_base[IOP_NUM_ISM]);
  225. iop_start(iop_base[IOP_NUM_ISM]);
  226. iop_alive(iop_base[IOP_NUM_ISM]); /* clears the alive flag */
  227. }
  228. /* Make the whole pool available and empty the queues */
  229. for (i = 0 ; i < NUM_IOP_MSGS ; i++) {
  230. iop_msg_pool[i].status = IOP_MSGSTATUS_UNUSED;
  231. }
  232. for (i = 0 ; i < NUM_IOP_CHAN ; i++) {
  233. iop_send_queue[IOP_NUM_SCC][i] = NULL;
  234. iop_send_queue[IOP_NUM_ISM][i] = NULL;
  235. iop_listeners[IOP_NUM_SCC][i].devname = NULL;
  236. iop_listeners[IOP_NUM_SCC][i].handler = NULL;
  237. iop_listeners[IOP_NUM_ISM][i].devname = NULL;
  238. iop_listeners[IOP_NUM_ISM][i].handler = NULL;
  239. }
  240. }
  241. /*
  242. * Register the interrupt handler for the IOPs.
  243. */
  244. void __init iop_register_interrupts(void)
  245. {
  246. if (iop_ism_present) {
  247. if (macintosh_config->ident == MAC_MODEL_IIFX) {
  248. if (request_irq(IRQ_MAC_ADB, iop_ism_irq, 0,
  249. "ISM IOP", (void *)IOP_NUM_ISM))
  250. pr_err("Couldn't register ISM IOP interrupt\n");
  251. } else {
  252. if (request_irq(IRQ_VIA2_0, iop_ism_irq, 0, "ISM IOP",
  253. (void *)IOP_NUM_ISM))
  254. pr_err("Couldn't register ISM IOP interrupt\n");
  255. }
  256. if (!iop_alive(iop_base[IOP_NUM_ISM])) {
  257. pr_warn("IOP: oh my god, they killed the ISM IOP!\n");
  258. } else {
  259. pr_warn("IOP: the ISM IOP seems to be alive.\n");
  260. }
  261. }
  262. }
  263. /*
  264. * Register or unregister a listener for a specific IOP and channel
  265. *
  266. * If the handler pointer is NULL the current listener (if any) is
  267. * unregistered. Otherwise the new listener is registered provided
  268. * there is no existing listener registered.
  269. */
  270. int iop_listen(uint iop_num, uint chan,
  271. void (*handler)(struct iop_msg *),
  272. const char *devname)
  273. {
  274. if ((iop_num >= NUM_IOPS) || !iop_base[iop_num]) return -EINVAL;
  275. if (chan >= NUM_IOP_CHAN) return -EINVAL;
  276. if (iop_listeners[iop_num][chan].handler && handler) return -EINVAL;
  277. iop_listeners[iop_num][chan].devname = devname;
  278. iop_listeners[iop_num][chan].handler = handler;
  279. return 0;
  280. }
  281. /*
  282. * Complete reception of a message, which just means copying the reply
  283. * into the buffer, setting the channel state to MSG_COMPLETE and
  284. * notifying the IOP.
  285. */
  286. void iop_complete_message(struct iop_msg *msg)
  287. {
  288. int iop_num = msg->iop_num;
  289. int chan = msg->channel;
  290. int i,offset;
  291. iop_pr_debug("iop_num %d chan %d reply %*ph\n",
  292. msg->iop_num, msg->channel, IOP_MSG_LEN, msg->reply);
  293. offset = IOP_ADDR_RECV_MSG + (msg->channel * IOP_MSG_LEN);
  294. for (i = 0 ; i < IOP_MSG_LEN ; i++, offset++) {
  295. iop_writeb(iop_base[iop_num], offset, msg->reply[i]);
  296. }
  297. iop_writeb(iop_base[iop_num],
  298. IOP_ADDR_RECV_STATE + chan, IOP_MSG_COMPLETE);
  299. iop_interrupt(iop_base[msg->iop_num]);
  300. msg->status = IOP_MSGSTATUS_UNUSED;
  301. }
  302. /*
  303. * Actually put a message into a send channel buffer
  304. */
  305. static void iop_do_send(struct iop_msg *msg)
  306. {
  307. volatile struct mac_iop *iop = iop_base[msg->iop_num];
  308. int i,offset;
  309. iop_pr_debug("iop_num %d chan %d message %*ph\n",
  310. msg->iop_num, msg->channel, IOP_MSG_LEN, msg->message);
  311. offset = IOP_ADDR_SEND_MSG + (msg->channel * IOP_MSG_LEN);
  312. for (i = 0 ; i < IOP_MSG_LEN ; i++, offset++) {
  313. iop_writeb(iop, offset, msg->message[i]);
  314. }
  315. iop_writeb(iop, IOP_ADDR_SEND_STATE + msg->channel, IOP_MSG_NEW);
  316. iop_interrupt(iop);
  317. }
  318. /*
  319. * Handle sending a message on a channel that
  320. * has gone into the IOP_MSG_COMPLETE state.
  321. */
  322. static void iop_handle_send(uint iop_num, uint chan)
  323. {
  324. volatile struct mac_iop *iop = iop_base[iop_num];
  325. struct iop_msg *msg;
  326. int i,offset;
  327. iop_writeb(iop, IOP_ADDR_SEND_STATE + chan, IOP_MSG_IDLE);
  328. if (!(msg = iop_send_queue[iop_num][chan])) return;
  329. msg->status = IOP_MSGSTATUS_COMPLETE;
  330. offset = IOP_ADDR_SEND_MSG + (chan * IOP_MSG_LEN);
  331. for (i = 0 ; i < IOP_MSG_LEN ; i++, offset++) {
  332. msg->reply[i] = iop_readb(iop, offset);
  333. }
  334. iop_pr_debug("iop_num %d chan %d reply %*ph\n",
  335. iop_num, chan, IOP_MSG_LEN, msg->reply);
  336. if (msg->handler) (*msg->handler)(msg);
  337. msg->status = IOP_MSGSTATUS_UNUSED;
  338. msg = msg->next;
  339. iop_send_queue[iop_num][chan] = msg;
  340. if (msg && iop_readb(iop, IOP_ADDR_SEND_STATE + chan) == IOP_MSG_IDLE)
  341. iop_do_send(msg);
  342. }
  343. /*
  344. * Handle reception of a message on a channel that has
  345. * gone into the IOP_MSG_NEW state.
  346. */
  347. static void iop_handle_recv(uint iop_num, uint chan)
  348. {
  349. volatile struct mac_iop *iop = iop_base[iop_num];
  350. int i,offset;
  351. struct iop_msg *msg;
  352. msg = iop_get_unused_msg();
  353. msg->iop_num = iop_num;
  354. msg->channel = chan;
  355. msg->status = IOP_MSGSTATUS_UNSOL;
  356. msg->handler = iop_listeners[iop_num][chan].handler;
  357. offset = IOP_ADDR_RECV_MSG + (chan * IOP_MSG_LEN);
  358. for (i = 0 ; i < IOP_MSG_LEN ; i++, offset++) {
  359. msg->message[i] = iop_readb(iop, offset);
  360. }
  361. iop_pr_debug("iop_num %d chan %d message %*ph\n",
  362. iop_num, chan, IOP_MSG_LEN, msg->message);
  363. iop_writeb(iop, IOP_ADDR_RECV_STATE + chan, IOP_MSG_RCVD);
  364. /* If there is a listener, call it now. Otherwise complete */
  365. /* the message ourselves to avoid possible stalls. */
  366. if (msg->handler) {
  367. (*msg->handler)(msg);
  368. } else {
  369. memset(msg->reply, 0, IOP_MSG_LEN);
  370. iop_complete_message(msg);
  371. }
  372. }
  373. /*
  374. * Send a message
  375. *
  376. * The message is placed at the end of the send queue. Afterwards if the
  377. * channel is idle we force an immediate send of the next message in the
  378. * queue.
  379. */
  380. int iop_send_message(uint iop_num, uint chan, void *privdata,
  381. uint msg_len, __u8 *msg_data,
  382. void (*handler)(struct iop_msg *))
  383. {
  384. struct iop_msg *msg, *q;
  385. if ((iop_num >= NUM_IOPS) || !iop_base[iop_num]) return -EINVAL;
  386. if (chan >= NUM_IOP_CHAN) return -EINVAL;
  387. if (msg_len > IOP_MSG_LEN) return -EINVAL;
  388. msg = iop_get_unused_msg();
  389. if (!msg) return -ENOMEM;
  390. msg->next = NULL;
  391. msg->status = IOP_MSGSTATUS_WAITING;
  392. msg->iop_num = iop_num;
  393. msg->channel = chan;
  394. msg->caller_priv = privdata;
  395. memcpy(msg->message, msg_data, msg_len);
  396. msg->handler = handler;
  397. if (!(q = iop_send_queue[iop_num][chan])) {
  398. iop_send_queue[iop_num][chan] = msg;
  399. iop_do_send(msg);
  400. } else {
  401. while (q->next) q = q->next;
  402. q->next = msg;
  403. }
  404. return 0;
  405. }
  406. /*
  407. * Upload code to the shared RAM of an IOP.
  408. */
  409. void iop_upload_code(uint iop_num, __u8 *code_start,
  410. uint code_len, __u16 shared_ram_start)
  411. {
  412. if ((iop_num >= NUM_IOPS) || !iop_base[iop_num]) return;
  413. iop_loadaddr(iop_base[iop_num], shared_ram_start);
  414. while (code_len--) {
  415. iop_base[iop_num]->ram_data = *code_start++;
  416. }
  417. }
  418. /*
  419. * Download code from the shared RAM of an IOP.
  420. */
  421. void iop_download_code(uint iop_num, __u8 *code_start,
  422. uint code_len, __u16 shared_ram_start)
  423. {
  424. if ((iop_num >= NUM_IOPS) || !iop_base[iop_num]) return;
  425. iop_loadaddr(iop_base[iop_num], shared_ram_start);
  426. while (code_len--) {
  427. *code_start++ = iop_base[iop_num]->ram_data;
  428. }
  429. }
  430. /*
  431. * Compare the code in the shared RAM of an IOP with a copy in system memory
  432. * and return 0 on match or the first nonmatching system memory address on
  433. * failure.
  434. */
  435. __u8 *iop_compare_code(uint iop_num, __u8 *code_start,
  436. uint code_len, __u16 shared_ram_start)
  437. {
  438. if ((iop_num >= NUM_IOPS) || !iop_base[iop_num]) return code_start;
  439. iop_loadaddr(iop_base[iop_num], shared_ram_start);
  440. while (code_len--) {
  441. if (*code_start != iop_base[iop_num]->ram_data) {
  442. return code_start;
  443. }
  444. code_start++;
  445. }
  446. return (__u8 *) 0;
  447. }
  448. /*
  449. * Handle an ISM IOP interrupt
  450. */
  451. irqreturn_t iop_ism_irq(int irq, void *dev_id)
  452. {
  453. uint iop_num = (uint) dev_id;
  454. volatile struct mac_iop *iop = iop_base[iop_num];
  455. int i,state;
  456. u8 events = iop->status_ctrl & (IOP_INT0 | IOP_INT1);
  457. do {
  458. iop_pr_debug("iop_num %d status %02X\n", iop_num,
  459. iop->status_ctrl);
  460. /* INT0 indicates state change on an outgoing message channel */
  461. if (events & IOP_INT0) {
  462. iop->status_ctrl = IOP_INT0 | IOP_RUN | IOP_AUTOINC;
  463. for (i = 0; i < NUM_IOP_CHAN; i++) {
  464. state = iop_readb(iop, IOP_ADDR_SEND_STATE + i);
  465. if (state == IOP_MSG_COMPLETE)
  466. iop_handle_send(iop_num, i);
  467. else if (state != IOP_MSG_IDLE)
  468. iop_pr_debug("chan %d send state %02X\n",
  469. i, state);
  470. }
  471. }
  472. /* INT1 for incoming messages */
  473. if (events & IOP_INT1) {
  474. iop->status_ctrl = IOP_INT1 | IOP_RUN | IOP_AUTOINC;
  475. for (i = 0; i < NUM_IOP_CHAN; i++) {
  476. state = iop_readb(iop, IOP_ADDR_RECV_STATE + i);
  477. if (state == IOP_MSG_NEW)
  478. iop_handle_recv(iop_num, i);
  479. else if (state != IOP_MSG_IDLE)
  480. iop_pr_debug("chan %d recv state %02X\n",
  481. i, state);
  482. }
  483. }
  484. events = iop->status_ctrl & (IOP_INT0 | IOP_INT1);
  485. } while (events);
  486. return IRQ_HANDLED;
  487. }
  488. void iop_ism_irq_poll(uint iop_num)
  489. {
  490. unsigned long flags;
  491. local_irq_save(flags);
  492. iop_ism_irq(0, (void *)iop_num);
  493. local_irq_restore(flags);
  494. }