port.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591
  1. /*
  2. * FreeRTOS Kernel V10.4.6
  3. * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  4. *
  5. * SPDX-License-Identifier: MIT
  6. *
  7. * Permission is hereby granted, free of charge, to any person obtaining a copy of
  8. * this software and associated documentation files (the "Software"), to deal in
  9. * the Software without restriction, including without limitation the rights to
  10. * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  11. * the Software, and to permit persons to whom the Software is furnished to do so,
  12. * subject to the following conditions:
  13. *
  14. * The above copyright notice and this permission notice shall be included in all
  15. * copies or substantial portions of the Software.
  16. *
  17. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  19. * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  20. * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  21. * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  22. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  23. *
  24. * https://www.FreeRTOS.org
  25. * https://github.com/FreeRTOS
  26. *
  27. */
  28. /*-----------------------------------------------------------
  29. * Implementation of functions defined in portable.h for the RXv3 DPFPU port.
  30. *----------------------------------------------------------*/
  31. #warning Testing for DFPU support in this port is not yet complete
  32. /* Scheduler includes. */
  33. #include "FreeRTOS.h"
  34. #include "task.h"
  35. /* Library includes. */
  36. #include "string.h"
  37. /* Hardware specifics. */
  38. #if ( configINCLUDE_PLATFORM_H_INSTEAD_OF_IODEFINE_H == 1 )
  39. #include "platform.h"
  40. #else /* configINCLUDE_PLATFORM_H_INSTEAD_OF_IODEFINE_H */
  41. #include "iodefine.h"
  42. #endif /* configINCLUDE_PLATFORM_H_INSTEAD_OF_IODEFINE_H */
  43. /*-----------------------------------------------------------*/
  44. /* Tasks should start with interrupts enabled and in Supervisor mode, therefore
  45. * PSW is set with U and I set, and PM and IPL clear. */
  46. #define portINITIAL_PSW ( ( StackType_t ) 0x00030000 )
  47. #define portINITIAL_FPSW ( ( StackType_t ) 0x00000100 )
  48. #define portINITIAL_DPSW ( ( StackType_t ) 0x00000100 )
  49. #define portINITIAL_DCMR ( ( StackType_t ) 0x00000000 )
  50. #define portINITIAL_DECNT ( ( StackType_t ) 0x00000001 )
  51. /* Tasks are not created with a DPFPU context, but can be given a DPFPU context
  52. * after they have been created. A variable is stored as part of the tasks context
  53. * that holds portNO_DPFPU_CONTEXT if the task does not have a DPFPU context, or
  54. * any other value if the task does have a DPFPU context. */
  55. #define portNO_DPFPU_CONTEXT ( ( StackType_t ) 0 )
  56. #define portHAS_DPFPU_CONTEXT ( ( StackType_t ) 1 )
  57. /* The space on the stack required to hold the DPFPU data registers. This is 16
  58. * 64-bit registers. */
  59. #define portDPFPU_DATA_REGISTER_WORDS ( 16 * 2 )
  60. /*-----------------------------------------------------------*/
  61. /* The following lines are to ensure vSoftwareInterruptEntry can be referenced,
  62. * and therefore installed in the vector table, when the FreeRTOS code is built
  63. * as a library. */
  64. extern BaseType_t vSoftwareInterruptEntry;
  65. const BaseType_t * p_vSoftwareInterruptEntry = &vSoftwareInterruptEntry;
  66. /*-----------------------------------------------------------*/
  67. /*
  68. * Function to start the first task executing - written in asm code as direct
  69. * access to registers is required.
  70. */
  71. static void prvStartFirstTask( void );
  72. /*
  73. * Software interrupt handler. Performs the actual context switch (saving and
  74. * restoring of registers). Written in asm code as direct register access is
  75. * required.
  76. */
  77. static void prvYieldHandler( void );
  78. /*
  79. * The entry point for the software interrupt handler. This is the function
  80. * that calls the inline asm function prvYieldHandler(). It is installed in
  81. * the vector table, but the code that installs it is in prvYieldHandler rather
  82. * than using a #pragma.
  83. */
  84. void vSoftwareInterruptISR( void );
  85. /*
  86. * The tick ISR handler. The peripheral used is configured by the application
  87. * via a hook/callback function.
  88. */
  89. void vTickISR( void );
  90. /*-----------------------------------------------------------*/
  91. /* Saved as part of the task context. If ulPortTaskHasDPFPUContext is non-zero
  92. * then a DPFPU context must be saved and restored for the task. */
  93. #if ( configUSE_TASK_DPFPU_SUPPORT == 1 )
  94. StackType_t ulPortTaskHasDPFPUContext = portNO_DPFPU_CONTEXT;
  95. #endif /* configUSE_TASK_DPFPU_SUPPORT */
  96. /* This is accessed by the inline assembler functions so is file scope for
  97. * convenience. */
  98. extern void * pxCurrentTCB;
  99. extern void vTaskSwitchContext( void );
  100. /*-----------------------------------------------------------*/
  101. /*
  102. * See header file for description.
  103. */
  104. StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
  105. TaskFunction_t pxCode,
  106. void * pvParameters )
  107. {
  108. /* R0 is not included as it is the stack pointer. */
  109. *pxTopOfStack = 0x00;
  110. pxTopOfStack--;
  111. *pxTopOfStack = portINITIAL_PSW;
  112. pxTopOfStack--;
  113. *pxTopOfStack = ( StackType_t ) pxCode;
  114. /* When debugging it can be useful if every register is set to a known
  115. * value. Otherwise code space can be saved by just setting the registers
  116. * that need to be set. */
  117. #ifdef USE_FULL_REGISTER_INITIALISATION
  118. {
  119. pxTopOfStack--;
  120. *pxTopOfStack = 0xffffffff; /* r15. */
  121. pxTopOfStack--;
  122. *pxTopOfStack = 0xeeeeeeee;
  123. pxTopOfStack--;
  124. *pxTopOfStack = 0xdddddddd;
  125. pxTopOfStack--;
  126. *pxTopOfStack = 0xcccccccc;
  127. pxTopOfStack--;
  128. *pxTopOfStack = 0xbbbbbbbb;
  129. pxTopOfStack--;
  130. *pxTopOfStack = 0xaaaaaaaa;
  131. pxTopOfStack--;
  132. *pxTopOfStack = 0x99999999;
  133. pxTopOfStack--;
  134. *pxTopOfStack = 0x88888888;
  135. pxTopOfStack--;
  136. *pxTopOfStack = 0x77777777;
  137. pxTopOfStack--;
  138. *pxTopOfStack = 0x66666666;
  139. pxTopOfStack--;
  140. *pxTopOfStack = 0x55555555;
  141. pxTopOfStack--;
  142. *pxTopOfStack = 0x44444444;
  143. pxTopOfStack--;
  144. *pxTopOfStack = 0x33333333;
  145. pxTopOfStack--;
  146. *pxTopOfStack = 0x22222222;
  147. pxTopOfStack--;
  148. }
  149. #else /* ifdef USE_FULL_REGISTER_INITIALISATION */
  150. {
  151. pxTopOfStack -= 15;
  152. }
  153. #endif /* ifdef USE_FULL_REGISTER_INITIALISATION */
  154. *pxTopOfStack = ( StackType_t ) pvParameters; /* R1 */
  155. pxTopOfStack--;
  156. *pxTopOfStack = portINITIAL_FPSW;
  157. pxTopOfStack--;
  158. *pxTopOfStack = 0x11111111; /* Accumulator 1. */
  159. pxTopOfStack--;
  160. *pxTopOfStack = 0x22222222; /* Accumulator 1. */
  161. pxTopOfStack--;
  162. *pxTopOfStack = 0x33333333; /* Accumulator 1. */
  163. pxTopOfStack--;
  164. *pxTopOfStack = 0x44444444; /* Accumulator 0. */
  165. pxTopOfStack--;
  166. *pxTopOfStack = 0x55555555; /* Accumulator 0. */
  167. pxTopOfStack--;
  168. *pxTopOfStack = 0x66666666; /* Accumulator 0. */
  169. #if ( configUSE_TASK_DPFPU_SUPPORT == 1 )
  170. {
  171. /* The task will start without a DPFPU context. A task that
  172. * uses the DPFPU hardware must call vPortTaskUsesDPFPU() before
  173. * executing any floating point instructions. */
  174. pxTopOfStack--;
  175. *pxTopOfStack = portNO_DPFPU_CONTEXT;
  176. }
  177. #elif ( configUSE_TASK_DPFPU_SUPPORT == 2 )
  178. {
  179. /* The task will start with a DPFPU context. Leave enough
  180. * space for the registers - and ensure they are initialised if desired. */
  181. #ifdef USE_FULL_REGISTER_INITIALISATION
  182. {
  183. pxTopOfStack -= 2;
  184. *(double *)pxTopOfStack = 1515.1515; /* DR15. */
  185. pxTopOfStack -= 2;
  186. *(double *)pxTopOfStack = 1414.1414; /* DR14. */
  187. pxTopOfStack -= 2;
  188. *(double *)pxTopOfStack = 1313.1313; /* DR13. */
  189. pxTopOfStack -= 2;
  190. *(double *)pxTopOfStack = 1212.1212; /* DR12. */
  191. pxTopOfStack -= 2;
  192. *(double *)pxTopOfStack = 1111.1111; /* DR11. */
  193. pxTopOfStack -= 2;
  194. *(double *)pxTopOfStack = 1010.1010; /* DR10. */
  195. pxTopOfStack -= 2;
  196. *(double *)pxTopOfStack = 909.0909; /* DR9. */
  197. pxTopOfStack -= 2;
  198. *(double *)pxTopOfStack = 808.0808; /* DR8. */
  199. pxTopOfStack -= 2;
  200. *(double *)pxTopOfStack = 707.0707; /* DR7. */
  201. pxTopOfStack -= 2;
  202. *(double *)pxTopOfStack = 606.0606; /* DR6. */
  203. pxTopOfStack -= 2;
  204. *(double *)pxTopOfStack = 505.0505; /* DR5. */
  205. pxTopOfStack -= 2;
  206. *(double *)pxTopOfStack = 404.0404; /* DR4. */
  207. pxTopOfStack -= 2;
  208. *(double *)pxTopOfStack = 303.0303; /* DR3. */
  209. pxTopOfStack -= 2;
  210. *(double *)pxTopOfStack = 202.0202; /* DR2. */
  211. pxTopOfStack -= 2;
  212. *(double *)pxTopOfStack = 101.0101; /* DR1. */
  213. pxTopOfStack -= 2;
  214. *(double *)pxTopOfStack = 9876.54321;/* DR0. */
  215. }
  216. #else /* ifdef USE_FULL_REGISTER_INITIALISATION */
  217. {
  218. pxTopOfStack -= portDPFPU_DATA_REGISTER_WORDS;
  219. memset( pxTopOfStack, 0x00, portDPFPU_DATA_REGISTER_WORDS * sizeof( StackType_t ) );
  220. }
  221. #endif /* ifdef USE_FULL_REGISTER_INITIALISATION */
  222. pxTopOfStack--;
  223. *pxTopOfStack = portINITIAL_DECNT; /* DECNT. */
  224. pxTopOfStack--;
  225. *pxTopOfStack = portINITIAL_DCMR; /* DCMR. */
  226. pxTopOfStack--;
  227. *pxTopOfStack = portINITIAL_DPSW; /* DPSW. */
  228. }
  229. #elif ( configUSE_TASK_DPFPU_SUPPORT == 0 )
  230. {
  231. /* Omit DPFPU support. */
  232. }
  233. #else /* if ( configUSE_TASK_DPFPU_SUPPORT == 1 ) */
  234. {
  235. #error Invalid configUSE_TASK_DPFPU_SUPPORT setting - configUSE_TASK_DPFPU_SUPPORT must be set to 0, 1, 2, or left undefined.
  236. }
  237. #endif /* if ( configUSE_TASK_DPFPU_SUPPORT == 1 ) */
  238. return pxTopOfStack;
  239. }
  240. /*-----------------------------------------------------------*/
  241. #if ( configUSE_TASK_DPFPU_SUPPORT == 1 )
  242. void vPortTaskUsesDPFPU( void )
  243. {
  244. /* A task is registering the fact that it needs a DPFPU context. Set the
  245. * DPFPU flag (which is saved as part of the task context). */
  246. ulPortTaskHasDPFPUContext = portHAS_DPFPU_CONTEXT;
  247. }
  248. #endif /* configUSE_TASK_DPFPU_SUPPORT */
  249. /*-----------------------------------------------------------*/
  250. BaseType_t xPortStartScheduler( void )
  251. {
  252. extern void vApplicationSetupTimerInterrupt( void );
  253. /* Use pxCurrentTCB just so it does not get optimised away. */
  254. if( pxCurrentTCB != NULL )
  255. {
  256. /* Call an application function to set up the timer that will generate the
  257. * tick interrupt. This way the application can decide which peripheral to
  258. * use. A demo application is provided to show a suitable example. */
  259. vApplicationSetupTimerInterrupt();
  260. /* Enable the software interrupt. */
  261. _IEN( _ICU_SWINT ) = 1;
  262. /* Ensure the software interrupt is clear. */
  263. _IR( _ICU_SWINT ) = 0;
  264. /* Ensure the software interrupt is set to the kernel priority. */
  265. _IPR( _ICU_SWINT ) = configKERNEL_INTERRUPT_PRIORITY;
  266. /* Start the first task. */
  267. prvStartFirstTask();
  268. }
  269. /* Just to make sure the function is not optimised away. */
  270. ( void ) vSoftwareInterruptISR();
  271. /* Should not get here. */
  272. return pdFAIL;
  273. }
  274. /*-----------------------------------------------------------*/
  275. void vPortEndScheduler( void )
  276. {
  277. /* Not implemented in ports where there is nothing to return to.
  278. * Artificially force an assert. */
  279. configASSERT( pxCurrentTCB == NULL );
  280. /* The following line is just to prevent the symbol getting optimised away. */
  281. ( void ) vTaskSwitchContext();
  282. }
  283. /*-----------------------------------------------------------*/
  284. #pragma inline_asm prvStartFirstTask
  285. static void prvStartFirstTask( void )
  286. {
  287. #ifndef __CDT_PARSER__
  288. /* When starting the scheduler there is nothing that needs moving to the
  289. * interrupt stack because the function is not called from an interrupt.
  290. * Just ensure the current stack is the user stack. */
  291. SETPSW U
  292. /* Obtain the location of the stack associated with which ever task
  293. * pxCurrentTCB is currently pointing to. */
  294. MOV.L # _pxCurrentTCB, R15
  295. MOV.L [ R15 ], R15
  296. MOV.L [ R15 ], R0
  297. /* Restore the registers from the stack of the task pointed to by
  298. * pxCurrentTCB. */
  299. #if ( configUSE_TASK_DPFPU_SUPPORT == 1 )
  300. /* The restored ulPortTaskHasDPFPUContext is to be zero here.
  301. * So, it is never necessary to restore the DPFPU context here. */
  302. POP R15
  303. MOV.L # _ulPortTaskHasDPFPUContext, R14
  304. MOV.L R15, [ R14 ]
  305. #elif ( configUSE_TASK_DPFPU_SUPPORT == 2 )
  306. /* Restore the DPFPU context. */
  307. DPOPM.L DPSW-DECNT
  308. DPOPM.D DR0-DR15
  309. #endif /* if ( configUSE_TASK_DPFPU_SUPPORT == 1 ) */
  310. POP R15
  311. /* Accumulator low 32 bits. */
  312. MVTACLO R15, A0
  313. POP R15
  314. /* Accumulator high 32 bits. */
  315. MVTACHI R15, A0
  316. POP R15
  317. /* Accumulator guard. */
  318. MVTACGU R15, A0
  319. POP R15
  320. /* Accumulator low 32 bits. */
  321. MVTACLO R15, A1
  322. POP R15
  323. /* Accumulator high 32 bits. */
  324. MVTACHI R15, A1
  325. POP R15
  326. /* Accumulator guard. */
  327. MVTACGU R15, A1
  328. POP R15
  329. /* Floating point status word. */
  330. MVTC R15, FPSW
  331. /* R1 to R15 - R0 is not included as it is the SP. */
  332. POPM R1-R15
  333. /* This pops the remaining registers. */
  334. RTE
  335. NOP
  336. NOP
  337. #endif /* ifndef __CDT_PARSER__ */
  338. }
  339. /*-----------------------------------------------------------*/
  340. void vSoftwareInterruptISR( void )
  341. {
  342. prvYieldHandler();
  343. }
  344. /*-----------------------------------------------------------*/
  345. #pragma inline_asm prvYieldHandler
  346. static void prvYieldHandler( void )
  347. {
  348. #ifndef __CDT_PARSER__
  349. /* Re-enable interrupts. */
  350. SETPSW I
  351. /* Move the data that was automatically pushed onto the interrupt stack when
  352. * the interrupt occurred from the interrupt stack to the user stack.
  353. *
  354. * R15 is saved before it is clobbered. */
  355. PUSH.L R15
  356. /* Read the user stack pointer. */
  357. MVFC USP, R15
  358. /* Move the address down to the data being moved. */
  359. SUB # 12, R15
  360. MVTC R15, USP
  361. /* Copy the data across, R15, then PC, then PSW. */
  362. MOV.L [ R0 ], [ R15 ]
  363. MOV.L 4[ R0 ], 4[ R15 ]
  364. MOV.L 8[ R0 ], 8[ R15 ]
  365. /* Move the interrupt stack pointer to its new correct position. */
  366. ADD # 12, R0
  367. /* All the rest of the registers are saved directly to the user stack. */
  368. SETPSW U
  369. /* Save the rest of the general registers (R15 has been saved already). */
  370. PUSHM R1-R14
  371. /* Save the FPSW and accumulators. */
  372. MVFC FPSW, R15
  373. PUSH.L R15
  374. MVFACGU # 0, A1, R15
  375. PUSH.L R15
  376. MVFACHI # 0, A1, R15
  377. PUSH.L R15
  378. MVFACLO # 0, A1, R15 /* Low order word. */
  379. PUSH.L R15
  380. MVFACGU # 0, A0, R15
  381. PUSH.L R15
  382. MVFACHI # 0, A0, R15
  383. PUSH.L R15
  384. MVFACLO # 0, A0, R15 /* Low order word. */
  385. PUSH.L R15
  386. #if ( configUSE_TASK_DPFPU_SUPPORT == 1 )
  387. /* Does the task have a DPFPU context that needs saving? If
  388. * ulPortTaskHasDPFPUContext is 0 then no. */
  389. MOV.L # _ulPortTaskHasDPFPUContext, R15
  390. MOV.L [ R15 ], R15
  391. CMP # 0, R15
  392. /* Save the DPFPU context, if any. */
  393. BEQ.B ?+
  394. DPUSHM.D DR0-DR15
  395. DPUSHM.L DPSW-DECNT
  396. ?:
  397. /* Save ulPortTaskHasDPFPUContext itself. */
  398. PUSH.L R15
  399. #elif ( configUSE_TASK_DPFPU_SUPPORT == 2 )
  400. /* Save the DPFPU context, always. */
  401. DPUSHM.D DR0-DR15
  402. DPUSHM.L DPSW-DECNT
  403. #endif /* if ( configUSE_TASK_DPFPU_SUPPORT == 1 ) */
  404. /* Save the stack pointer to the TCB. */
  405. MOV.L # _pxCurrentTCB, R15
  406. MOV.L [ R15 ], R15
  407. MOV.L R0, [ R15 ]
  408. /* Ensure the interrupt mask is set to the syscall priority while the kernel
  409. * structures are being accessed. */
  410. MVTIPL # configMAX_SYSCALL_INTERRUPT_PRIORITY
  411. /* Select the next task to run. */
  412. BSR.A _vTaskSwitchContext
  413. /* Reset the interrupt mask as no more data structure access is required. */
  414. MVTIPL # configKERNEL_INTERRUPT_PRIORITY
  415. /* Load the stack pointer of the task that is now selected as the Running
  416. * state task from its TCB. */
  417. MOV.L # _pxCurrentTCB, R15
  418. MOV.L [ R15 ], R15
  419. MOV.L [ R15 ], R0
  420. /* Restore the context of the new task. The PSW (Program Status Word) and
  421. * PC will be popped by the RTE instruction. */
  422. #if ( configUSE_TASK_DPFPU_SUPPORT == 1 )
  423. /* Is there a DPFPU context to restore? If the restored
  424. * ulPortTaskHasDPFPUContext is zero then no. */
  425. POP R15
  426. MOV.L # _ulPortTaskHasDPFPUContext, R14
  427. MOV.L R15, [ R14 ]
  428. CMP # 0, R15
  429. /* Restore the DPFPU context, if any. */
  430. BEQ.B ?+
  431. DPOPM.L DPSW-DECNT
  432. DPOPM.D DR0-DR15
  433. ?:
  434. #elif ( configUSE_TASK_DPFPU_SUPPORT == 2 )
  435. /* Restore the DPFPU context, always. */
  436. DPOPM.L DPSW-DECNT
  437. DPOPM.D DR0-DR15
  438. #endif /* if ( configUSE_TASK_DPFPU_SUPPORT == 1 ) */
  439. POP R15
  440. /* Accumulator low 32 bits. */
  441. MVTACLO R15, A0
  442. POP R15
  443. /* Accumulator high 32 bits. */
  444. MVTACHI R15, A0
  445. POP R15
  446. /* Accumulator guard. */
  447. MVTACGU R15, A0
  448. POP R15
  449. /* Accumulator low 32 bits. */
  450. MVTACLO R15, A1
  451. POP R15
  452. /* Accumulator high 32 bits. */
  453. MVTACHI R15, A1
  454. POP R15
  455. /* Accumulator guard. */
  456. MVTACGU R15, A1
  457. POP R15
  458. MVTC R15, FPSW
  459. POPM R1-R15
  460. RTE
  461. NOP
  462. NOP
  463. #endif /* ifndef __CDT_PARSER__ */
  464. }
  465. /*-----------------------------------------------------------*/
  466. #pragma interrupt ( vTickISR( vect = _VECT( configTICK_VECTOR ), enable ) )
  467. void vTickISR( void )
  468. {
  469. /* Increment the tick, and perform any processing the new tick value
  470. * necessitates. Ensure IPL is at the max syscall value first. */
  471. set_ipl( configMAX_SYSCALL_INTERRUPT_PRIORITY );
  472. {
  473. if( xTaskIncrementTick() != pdFALSE )
  474. {
  475. taskYIELD();
  476. }
  477. }
  478. set_ipl( configKERNEL_INTERRUPT_PRIORITY );
  479. }
  480. /*-----------------------------------------------------------*/