via.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  1. /*
  2. * 6522 Versatile Interface Adapter (VIA)
  3. *
  4. * There are two of these on the Mac II. Some IRQ's are vectored
  5. * via them as are assorted bits and bobs - eg RTC, ADB.
  6. *
  7. * CSA: Motorola seems to have removed documentation on the 6522 from
  8. * their web site; try
  9. * http://nerini.drf.com/vectrex/other/text/chips/6522/
  10. * http://www.zymurgy.net/classic/vic20/vicdet1.htm
  11. * and
  12. * http://193.23.168.87/mikro_laborversuche/via_iobaustein/via6522_1.html
  13. * for info. A full-text web search on 6522 AND VIA will probably also
  14. * net some usefulness. <cananian@alumni.princeton.edu> 20apr1999
  15. *
  16. * PRAM/RTC access algorithms are from the NetBSD RTC toolkit version 1.08b
  17. * by Erik Vogan and adapted to Linux by Joshua M. Thompson (funaho@jurai.org)
  18. *
  19. */
  20. #include <linux/types.h>
  21. #include <linux/kernel.h>
  22. #include <linux/mm.h>
  23. #include <linux/delay.h>
  24. #include <linux/init.h>
  25. #include <linux/ide.h>
  26. #include <asm/bootinfo.h>
  27. #include <asm/macintosh.h>
  28. #include <asm/macints.h>
  29. #include <asm/machw.h>
  30. #include <asm/mac_via.h>
  31. #include <asm/mac_psc.h>
  32. volatile __u8 *via1, *via2;
  33. #if 0
  34. /* See note in mac_via.h about how this is possibly not useful */
  35. volatile long *via_memory_bogon=(long *)&via_memory_bogon;
  36. #endif
  37. int rbv_present,via_alt_mapping;
  38. __u8 rbv_clear;
  39. /*
  40. * Globals for accessing the VIA chip registers without having to
  41. * check if we're hitting a real VIA or an RBV. Normally you could
  42. * just hit the combined register (ie, vIER|rIER) but that seems to
  43. * break on AV Macs...probably because they actually decode more than
  44. * eight address bits. Why can't Apple engineers at least be
  45. * _consistently_ lazy? - 1999-05-21 (jmt)
  46. */
  47. static int gIER,gIFR,gBufA,gBufB;
  48. /*
  49. * Timer defs.
  50. */
  51. #define TICK_SIZE 10000
  52. #define MAC_CLOCK_TICK (783300/HZ) /* ticks per HZ */
  53. #define MAC_CLOCK_LOW (MAC_CLOCK_TICK&0xFF)
  54. #define MAC_CLOCK_HIGH (MAC_CLOCK_TICK>>8)
  55. static int nubus_active;
  56. void via_debug_dump(void);
  57. irqreturn_t via1_irq(int, void *);
  58. irqreturn_t via2_irq(int, void *);
  59. irqreturn_t via_nubus_irq(int, void *);
  60. void via_irq_enable(int irq);
  61. void via_irq_disable(int irq);
  62. void via_irq_clear(int irq);
  63. extern irqreturn_t mac_scc_dispatch(int, void *);
  64. extern int oss_present;
  65. /*
  66. * Initialize the VIAs
  67. *
  68. * First we figure out where they actually _are_ as well as what type of
  69. * VIA we have for VIA2 (it could be a real VIA or an RBV or even an OSS.)
  70. * Then we pretty much clear them out and disable all IRQ sources.
  71. *
  72. * Note: the OSS is actually "detected" here and not in oss_init(). It just
  73. * seems more logical to do it here since via_init() needs to know
  74. * these things anyways.
  75. */
  76. void __init via_init(void)
  77. {
  78. switch(macintosh_config->via_type) {
  79. /* IIci, IIsi, IIvx, IIvi (P6xx), LC series */
  80. case MAC_VIA_IIci:
  81. via1 = (void *) VIA1_BASE;
  82. if (macintosh_config->ident == MAC_MODEL_IIFX) {
  83. via2 = NULL;
  84. rbv_present = 0;
  85. oss_present = 1;
  86. } else {
  87. via2 = (void *) RBV_BASE;
  88. rbv_present = 1;
  89. oss_present = 0;
  90. }
  91. if (macintosh_config->ident == MAC_MODEL_LCIII) {
  92. rbv_clear = 0x00;
  93. } else {
  94. /* on most RBVs (& unlike the VIAs), you */
  95. /* need to set bit 7 when you write to IFR */
  96. /* in order for your clear to occur. */
  97. rbv_clear = 0x80;
  98. }
  99. gIER = rIER;
  100. gIFR = rIFR;
  101. gBufA = rSIFR;
  102. gBufB = rBufB;
  103. break;
  104. /* Quadra and early MacIIs agree on the VIA locations */
  105. case MAC_VIA_QUADRA:
  106. case MAC_VIA_II:
  107. via1 = (void *) VIA1_BASE;
  108. via2 = (void *) VIA2_BASE;
  109. rbv_present = 0;
  110. oss_present = 0;
  111. rbv_clear = 0x00;
  112. gIER = vIER;
  113. gIFR = vIFR;
  114. gBufA = vBufA;
  115. gBufB = vBufB;
  116. break;
  117. default:
  118. panic("UNKNOWN VIA TYPE");
  119. }
  120. printk(KERN_INFO "VIA1 at %p is a 6522 or clone\n", via1);
  121. printk(KERN_INFO "VIA2 at %p is ", via2);
  122. if (rbv_present) {
  123. printk(KERN_INFO "an RBV\n");
  124. } else if (oss_present) {
  125. printk(KERN_INFO "an OSS\n");
  126. } else {
  127. printk(KERN_INFO "a 6522 or clone\n");
  128. }
  129. #ifdef DEBUG_VIA
  130. via_debug_dump();
  131. #endif
  132. /*
  133. * Shut down all IRQ sources, reset the timers, and
  134. * kill the timer latch on VIA1.
  135. */
  136. via1[vIER] = 0x7F;
  137. via1[vIFR] = 0x7F;
  138. via1[vT1LL] = 0;
  139. via1[vT1LH] = 0;
  140. via1[vT1CL] = 0;
  141. via1[vT1CH] = 0;
  142. via1[vT2CL] = 0;
  143. via1[vT2CH] = 0;
  144. via1[vACR] &= 0x3F;
  145. /*
  146. * SE/30: disable video IRQ
  147. * XXX: testing for SE/30 VBL
  148. */
  149. if (macintosh_config->ident == MAC_MODEL_SE30) {
  150. via1[vDirB] |= 0x40;
  151. via1[vBufB] |= 0x40;
  152. }
  153. /*
  154. * Set the RTC bits to a known state: all lines to outputs and
  155. * RTC disabled (yes that's 0 to enable and 1 to disable).
  156. */
  157. via1[vDirB] |= (VIA1B_vRTCEnb | VIA1B_vRTCClk | VIA1B_vRTCData);
  158. via1[vBufB] |= (VIA1B_vRTCEnb | VIA1B_vRTCClk);
  159. /* Everything below this point is VIA2/RBV only... */
  160. if (oss_present) return;
  161. #if 1
  162. /* Some machines support an alternate IRQ mapping that spreads */
  163. /* Ethernet and Sound out to their own autolevel IRQs and moves */
  164. /* VIA1 to level 6. A/UX uses this mapping and we do too. Note */
  165. /* that the IIfx emulates this alternate mapping using the OSS. */
  166. switch(macintosh_config->ident) {
  167. case MAC_MODEL_P475:
  168. case MAC_MODEL_P475F:
  169. case MAC_MODEL_P575:
  170. case MAC_MODEL_Q605:
  171. case MAC_MODEL_Q605_ACC:
  172. case MAC_MODEL_C610:
  173. case MAC_MODEL_Q610:
  174. case MAC_MODEL_Q630:
  175. case MAC_MODEL_C650:
  176. case MAC_MODEL_Q650:
  177. case MAC_MODEL_Q700:
  178. case MAC_MODEL_Q800:
  179. case MAC_MODEL_Q900:
  180. case MAC_MODEL_Q950:
  181. via_alt_mapping = 1;
  182. via1[vDirB] |= 0x40;
  183. via1[vBufB] &= ~0x40;
  184. break;
  185. default:
  186. via_alt_mapping = 0;
  187. break;
  188. }
  189. #else
  190. via_alt_mapping = 0;
  191. #endif
  192. /*
  193. * Now initialize VIA2. For RBV we just kill all interrupts;
  194. * for a regular VIA we also reset the timers and stuff.
  195. */
  196. via2[gIER] = 0x7F;
  197. via2[gIFR] = 0x7F | rbv_clear;
  198. if (!rbv_present) {
  199. via2[vT1LL] = 0;
  200. via2[vT1LH] = 0;
  201. via2[vT1CL] = 0;
  202. via2[vT1CH] = 0;
  203. via2[vT2CL] = 0;
  204. via2[vT2CH] = 0;
  205. via2[vACR] &= 0x3F;
  206. }
  207. }
  208. /*
  209. * Start the 100 Hz clock
  210. */
  211. void __init via_init_clock(irq_handler_t func)
  212. {
  213. via1[vACR] |= 0x40;
  214. via1[vT1LL] = MAC_CLOCK_LOW;
  215. via1[vT1LH] = MAC_CLOCK_HIGH;
  216. via1[vT1CL] = MAC_CLOCK_LOW;
  217. via1[vT1CH] = MAC_CLOCK_HIGH;
  218. request_irq(IRQ_MAC_TIMER_1, func, IRQ_FLG_LOCK, "timer", func);
  219. }
  220. /*
  221. * Register the interrupt dispatchers for VIA or RBV machines only.
  222. */
  223. void __init via_register_interrupts(void)
  224. {
  225. if (via_alt_mapping) {
  226. request_irq(IRQ_AUTO_1, via1_irq,
  227. IRQ_FLG_LOCK|IRQ_FLG_FAST, "software",
  228. (void *) via1);
  229. request_irq(IRQ_AUTO_6, via1_irq,
  230. IRQ_FLG_LOCK|IRQ_FLG_FAST, "via1",
  231. (void *) via1);
  232. } else {
  233. request_irq(IRQ_AUTO_1, via1_irq,
  234. IRQ_FLG_LOCK|IRQ_FLG_FAST, "via1",
  235. (void *) via1);
  236. }
  237. request_irq(IRQ_AUTO_2, via2_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST,
  238. "via2", (void *) via2);
  239. if (!psc_present) {
  240. request_irq(IRQ_AUTO_4, mac_scc_dispatch, IRQ_FLG_LOCK,
  241. "scc", mac_scc_dispatch);
  242. }
  243. request_irq(IRQ_MAC_NUBUS, via_nubus_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST,
  244. "nubus", (void *) via2);
  245. }
  246. /*
  247. * Debugging dump, used in various places to see what's going on.
  248. */
  249. void via_debug_dump(void)
  250. {
  251. printk(KERN_DEBUG "VIA1: DDRA = 0x%02X DDRB = 0x%02X ACR = 0x%02X\n",
  252. (uint) via1[vDirA], (uint) via1[vDirB], (uint) via1[vACR]);
  253. printk(KERN_DEBUG " PCR = 0x%02X IFR = 0x%02X IER = 0x%02X\n",
  254. (uint) via1[vPCR], (uint) via1[vIFR], (uint) via1[vIER]);
  255. if (oss_present) {
  256. printk(KERN_DEBUG "VIA2: <OSS>\n");
  257. } else if (rbv_present) {
  258. printk(KERN_DEBUG "VIA2: IFR = 0x%02X IER = 0x%02X\n",
  259. (uint) via2[rIFR], (uint) via2[rIER]);
  260. printk(KERN_DEBUG " SIFR = 0x%02X SIER = 0x%02X\n",
  261. (uint) via2[rSIFR], (uint) via2[rSIER]);
  262. } else {
  263. printk(KERN_DEBUG "VIA2: DDRA = 0x%02X DDRB = 0x%02X ACR = 0x%02X\n",
  264. (uint) via2[vDirA], (uint) via2[vDirB],
  265. (uint) via2[vACR]);
  266. printk(KERN_DEBUG " PCR = 0x%02X IFR = 0x%02X IER = 0x%02X\n",
  267. (uint) via2[vPCR],
  268. (uint) via2[vIFR], (uint) via2[vIER]);
  269. }
  270. }
  271. /*
  272. * This is always executed with interrupts disabled.
  273. *
  274. * TBI: get time offset between scheduling timer ticks
  275. */
  276. unsigned long mac_gettimeoffset (void)
  277. {
  278. unsigned long ticks, offset = 0;
  279. /* read VIA1 timer 2 current value */
  280. ticks = via1[vT1CL] | (via1[vT1CH] << 8);
  281. /* The probability of underflow is less than 2% */
  282. if (ticks > MAC_CLOCK_TICK - MAC_CLOCK_TICK / 50)
  283. /* Check for pending timer interrupt in VIA1 IFR */
  284. if (via1[vIFR] & 0x40) offset = TICK_SIZE;
  285. ticks = MAC_CLOCK_TICK - ticks;
  286. ticks = ticks * 10000L / MAC_CLOCK_TICK;
  287. return ticks + offset;
  288. }
  289. /*
  290. * Flush the L2 cache on Macs that have it by flipping
  291. * the system into 24-bit mode for an instant.
  292. */
  293. void via_flush_cache(void)
  294. {
  295. via2[gBufB] &= ~VIA2B_vMode32;
  296. via2[gBufB] |= VIA2B_vMode32;
  297. }
  298. /*
  299. * Return the status of the L2 cache on a IIci
  300. */
  301. int via_get_cache_disable(void)
  302. {
  303. /* Safeguard against being called accidentally */
  304. if (!via2) {
  305. printk(KERN_ERR "via_get_cache_disable called on a non-VIA machine!\n");
  306. return 1;
  307. }
  308. return (int) via2[gBufB] & VIA2B_vCDis;
  309. }
  310. /*
  311. * Initialize VIA2 for Nubus access
  312. */
  313. void __init via_nubus_init(void)
  314. {
  315. /* don't set nubus_active = 0 here, it kills the Baboon */
  316. /* interrupt that we've already registered. */
  317. /* unlock nubus transactions */
  318. if (!rbv_present) {
  319. /* set the line to be an output on non-RBV machines */
  320. if ((macintosh_config->adb_type != MAC_ADB_PB1) &&
  321. (macintosh_config->adb_type != MAC_ADB_PB2)) {
  322. via2[vDirB] |= 0x02;
  323. }
  324. }
  325. /* this seems to be an ADB bit on PMU machines */
  326. /* according to MkLinux. -- jmt */
  327. if ((macintosh_config->adb_type != MAC_ADB_PB1) &&
  328. (macintosh_config->adb_type != MAC_ADB_PB2)) {
  329. via2[gBufB] |= 0x02;
  330. }
  331. /* disable nubus slot interrupts. */
  332. if (rbv_present) {
  333. via2[rSIER] = 0x7F;
  334. via2[rSIER] = nubus_active | 0x80;
  335. } else {
  336. /* These are ADB bits on PMU */
  337. if ((macintosh_config->adb_type != MAC_ADB_PB1) &&
  338. (macintosh_config->adb_type != MAC_ADB_PB2)) {
  339. switch(macintosh_config->ident)
  340. {
  341. case MAC_MODEL_II:
  342. case MAC_MODEL_IIX:
  343. case MAC_MODEL_IICX:
  344. case MAC_MODEL_SE30:
  345. via2[vBufA] |= 0x3F;
  346. via2[vDirA] = ~nubus_active | 0xc0;
  347. break;
  348. default:
  349. via2[vBufA] = 0xFF;
  350. via2[vDirA] = ~nubus_active;
  351. }
  352. }
  353. }
  354. }
  355. /*
  356. * The generic VIA interrupt routines (shamelessly stolen from Alan Cox's
  357. * via6522.c :-), disable/pending masks added.
  358. *
  359. * The new interrupt architecture in macints.c takes care of a lot of the
  360. * gruntwork for us, including tallying the interrupts and calling the
  361. * handlers on the linked list. All we need to do here is basically generate
  362. * the machspec interrupt number after clearing the interrupt.
  363. */
  364. irqreturn_t via1_irq(int irq, void *dev_id)
  365. {
  366. int irq_bit, i;
  367. unsigned char events, mask;
  368. mask = via1[vIER] & 0x7F;
  369. if (!(events = via1[vIFR] & mask))
  370. return IRQ_NONE;
  371. for (i = 0, irq_bit = 1 ; i < 7 ; i++, irq_bit <<= 1)
  372. if (events & irq_bit) {
  373. via1[vIER] = irq_bit;
  374. via1[vIFR] = irq_bit;
  375. m68k_handle_int(VIA1_SOURCE_BASE + i);
  376. via1[vIER] = irq_bit | 0x80;
  377. }
  378. #if 0 /* freakin' pmu is doing weird stuff */
  379. if (!oss_present) {
  380. /* This (still) seems to be necessary to get IDE
  381. working. However, if you enable VBL interrupts,
  382. you're screwed... */
  383. /* FIXME: should we check the SLOTIRQ bit before
  384. pulling this stunt? */
  385. /* No, it won't be set. that's why we're doing this. */
  386. via_irq_disable(IRQ_MAC_NUBUS);
  387. via_irq_clear(IRQ_MAC_NUBUS);
  388. m68k_handle_int(IRQ_MAC_NUBUS);
  389. via_irq_enable(IRQ_MAC_NUBUS);
  390. }
  391. #endif
  392. return IRQ_HANDLED;
  393. }
  394. irqreturn_t via2_irq(int irq, void *dev_id)
  395. {
  396. int irq_bit, i;
  397. unsigned char events, mask;
  398. mask = via2[gIER] & 0x7F;
  399. if (!(events = via2[gIFR] & mask))
  400. return IRQ_NONE;
  401. for (i = 0, irq_bit = 1 ; i < 7 ; i++, irq_bit <<= 1)
  402. if (events & irq_bit) {
  403. via2[gIER] = irq_bit;
  404. via2[gIFR] = irq_bit | rbv_clear;
  405. m68k_handle_int(VIA2_SOURCE_BASE + i);
  406. via2[gIER] = irq_bit | 0x80;
  407. }
  408. return IRQ_HANDLED;
  409. }
  410. /*
  411. * Dispatch Nubus interrupts. We are called as a secondary dispatch by the
  412. * VIA2 dispatcher as a fast interrupt handler.
  413. */
  414. irqreturn_t via_nubus_irq(int irq, void *dev_id)
  415. {
  416. int irq_bit, i;
  417. unsigned char events;
  418. if (!(events = ~via2[gBufA] & nubus_active))
  419. return IRQ_NONE;
  420. for (i = 0, irq_bit = 1 ; i < 7 ; i++, irq_bit <<= 1) {
  421. if (events & irq_bit) {
  422. via_irq_disable(NUBUS_SOURCE_BASE + i);
  423. m68k_handle_int(NUBUS_SOURCE_BASE + i);
  424. via_irq_enable(NUBUS_SOURCE_BASE + i);
  425. }
  426. }
  427. return IRQ_HANDLED;
  428. }
  429. void via_irq_enable(int irq) {
  430. int irq_src = IRQ_SRC(irq);
  431. int irq_idx = IRQ_IDX(irq);
  432. int irq_bit = 1 << irq_idx;
  433. #ifdef DEBUG_IRQUSE
  434. printk(KERN_DEBUG "via_irq_enable(%d)\n", irq);
  435. #endif
  436. if (irq_src == 1) {
  437. via1[vIER] = irq_bit | 0x80;
  438. } else if (irq_src == 2) {
  439. /*
  440. * Set vPCR for SCSI interrupts (but not on RBV)
  441. */
  442. if ((irq_idx == 0) && !rbv_present) {
  443. if (macintosh_config->scsi_type == MAC_SCSI_OLD) {
  444. /* CB2 (IRQ) indep. input, positive edge */
  445. /* CA2 (DRQ) indep. input, positive edge */
  446. via2[vPCR] = 0x66;
  447. } else {
  448. /* CB2 (IRQ) indep. input, negative edge */
  449. /* CA2 (DRQ) indep. input, negative edge */
  450. via2[vPCR] = 0x22;
  451. }
  452. }
  453. via2[gIER] = irq_bit | 0x80;
  454. } else if (irq_src == 7) {
  455. nubus_active |= irq_bit;
  456. if (rbv_present) {
  457. /* enable the slot interrupt. SIER works like IER. */
  458. via2[rSIER] = IER_SET_BIT(irq_idx);
  459. } else {
  460. /* Make sure the bit is an input, to enable the irq */
  461. /* But not on PowerBooks, that's ADB... */
  462. if ((macintosh_config->adb_type != MAC_ADB_PB1) &&
  463. (macintosh_config->adb_type != MAC_ADB_PB2)) {
  464. switch(macintosh_config->ident)
  465. {
  466. case MAC_MODEL_II:
  467. case MAC_MODEL_IIX:
  468. case MAC_MODEL_IICX:
  469. case MAC_MODEL_SE30:
  470. via2[vDirA] &= (~irq_bit | 0xc0);
  471. break;
  472. default:
  473. via2[vDirA] &= ~irq_bit;
  474. }
  475. }
  476. }
  477. }
  478. }
  479. void via_irq_disable(int irq) {
  480. int irq_src = IRQ_SRC(irq);
  481. int irq_idx = IRQ_IDX(irq);
  482. int irq_bit = 1 << irq_idx;
  483. #ifdef DEBUG_IRQUSE
  484. printk(KERN_DEBUG "via_irq_disable(%d)\n", irq);
  485. #endif
  486. if (irq_src == 1) {
  487. via1[vIER] = irq_bit;
  488. } else if (irq_src == 2) {
  489. via2[gIER] = irq_bit;
  490. } else if (irq_src == 7) {
  491. if (rbv_present) {
  492. /* disable the slot interrupt. SIER works like IER. */
  493. via2[rSIER] = IER_CLR_BIT(irq_idx);
  494. } else {
  495. /* disable the nubus irq by changing dir to output */
  496. /* except on PMU */
  497. if ((macintosh_config->adb_type != MAC_ADB_PB1) &&
  498. (macintosh_config->adb_type != MAC_ADB_PB2)) {
  499. via2[vDirA] |= irq_bit;
  500. }
  501. }
  502. nubus_active &= ~irq_bit;
  503. }
  504. }
  505. void via_irq_clear(int irq) {
  506. int irq_src = IRQ_SRC(irq);
  507. int irq_idx = IRQ_IDX(irq);
  508. int irq_bit = 1 << irq_idx;
  509. if (irq_src == 1) {
  510. via1[vIFR] = irq_bit;
  511. } else if (irq_src == 2) {
  512. via2[gIFR] = irq_bit | rbv_clear;
  513. } else if (irq_src == 7) {
  514. /* FIXME: hmm.. */
  515. }
  516. }
  517. /*
  518. * Returns nonzero if an interrupt is pending on the given
  519. * VIA/IRQ combination.
  520. */
  521. int via_irq_pending(int irq)
  522. {
  523. int irq_src = IRQ_SRC(irq);
  524. int irq_idx = IRQ_IDX(irq);
  525. int irq_bit = 1 << irq_idx;
  526. if (irq_src == 1) {
  527. return via1[vIFR] & irq_bit;
  528. } else if (irq_src == 2) {
  529. return via2[gIFR] & irq_bit;
  530. } else if (irq_src == 7) {
  531. return ~via2[gBufA] & irq_bit;
  532. }
  533. return 0;
  534. }