1 // Copyright (C) 2022 Beken Corporation
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 #include <stdio.h>
15 #include "arch_interrupt.h"
16 #include "platform.h"
17
18
19 #include "BK7256_RegList.h"
20
21 #define INT_NUMBER_MAX (64)
22 #define MACHINE_TIMER_PERIOD ((2 * CPUFREQ)/5000) // 0.002 seconds
23
24 #define INT_PRIORITY_PLIC 0x01
25 #define INT_PRIORITY_MASK 0x07
26
27 #define REG_PLIC_PENDING_STATUS_GROUP1 (0xe4001000) //we can optimize this code with PLIC driver.
28 #define REG_PLIC_PENDING_STATUS_GROUP2 (0xe4001004)
29
30 #define NESTED_VPLIC_COMPLETE_INTERRUPT(irq) \
31 do { \
32 clear_csr(NDS_MIE, MIP_MEIP); \
33 __nds__plic_complete_interrupt(irq); \
34 __asm volatile("fence io, io"); \
35 set_csr(NDS_MIE, MIP_MEIP); \
36 } while(0)
37
38 #define CONFIG_NEST_INT_TEST 0
39
40 interrupt_handle_p p_intn_func_handle[INT_NUMBER_MAX];
41
42 /* The flag to trigger UART output message */
43 static volatile char trigger_mswi_uart_msg_flag = 0;
44
45 /* The flag to trigger UART output message */
46 static volatile char trigger_pit_uart_msg_flag = 0;
47
48 // extern volatile char trigger_mswi_flag ;
49
50 volatile unsigned int g_enter_interrupt_nest = 0;
51
arch_get_interrupt_nest_cnt(void)52 unsigned int arch_get_interrupt_nest_cnt(void) {
53 return g_enter_interrupt_nest;
54 }
55
56 #if (CONFIG_NEST_INT_TEST)
57 #define INT_SRC_UART0 (4)
58 #define SYS_DELAY_TIME_1MS (17000UL)
59
60 volatile unsigned int g_test_nest_count = 1;
61 extern void sys_delay_sync(uint32_t time_count );
62 #endif
63
64 /* At the time of writing, interrupt nesting is not supported, so do not use
65 the default mext_interrupt() implementation as that enables interrupts. A
66 version that does not enable interrupts is provided below. THIS INTERRUPT
67 HANDLER IS SPECIFIC TO FREERTOS WHICH USES PLIC! */
mext_interrupt(void)68 void mext_interrupt(void)
69 {
70 unsigned int irq_source = __nds__plic_claim_interrupt();
71 g_enter_interrupt_nest++;
72
73 #if (CONFIG_NEST_INT_TEST)
74 if (g_enter_interrupt_nest > 1 && g_test_nest_count > 0)
75 {
76 os_printf("mext_interrupt: nest count %d, irq_source = %u.\r\n", g_enter_interrupt_nest, irq_source);
77 g_test_nest_count--;
78 }
79 #endif //#if (CONFIG_NEST_INT_TEST)
80
81 #if (CONFIG_NEST_INT_SUPPORT)
82 /* Disable the timer interrupts before
83 Enable interrupts in general to allow nested
84 */
85 clear_csr(NDS_MIE, MIP_MTIP);
86
87 /* Enable interrupts in general to allow nested */
88 set_csr(NDS_MSTATUS, MSTATUS_MIE);
89 #endif // #if (CONFIG_NEST_INT_SUPPORT)
90
91 if (irq_source != 0 && irq_source < INT_NUMBER_MAX
92 && p_intn_func_handle[irq_source] != NULL) {
93
94 #if( configUSE_ANDES_TRACER == 1 )
95 traceISR_ENTER(irq_source);
96 #endif
97
98 /* Do interrupt handler */
99 p_intn_func_handle[irq_source]();
100
101 #if (CONFIG_NEST_INT_TEST)
102 if (irq_source != INT_SRC_UART0 && g_test_nest_count != 0)
103 {
104 sys_delay_sync(SYS_DELAY_TIME_1MS);
105 }
106 #endif //#if (CONFIG_NEST_INT_TEST)
107
108 #if( configUSE_ANDES_TRACER == 1 )
109 traceISR_EXIT();
110 #endif
111
112 } else {
113 //print irq status
114 os_printf("ERROR: func %s, irq_source = %u.\r\n", __func__, irq_source);
115 if (irq_source < INT_NUMBER_MAX) {
116 os_printf("ERROR: func %s, p_intn_func_handle = %p.\r\n", __func__, p_intn_func_handle[irq_source]);
117 }
118 }
119
120 #if (CONFIG_NEST_INT_SUPPORT)
121 /* Disable interrupt in general to restore context */
122 clear_csr(NDS_MSTATUS, MSTATUS_MIE);
123
124 /* Restore the timer interrupts after
125 interrupts complete handle
126 */
127 if (g_enter_interrupt_nest == 1) {
128 set_csr(NDS_MIE, MIP_MTIP);
129 }
130 #endif // #if (CONFIG_NEST_INT_SUPPORT)
131
132 g_enter_interrupt_nest--;
133 __nds__plic_complete_interrupt(irq_source);
134 }
135
136
arch_interrupt_enable(void)137 void arch_interrupt_enable(void)
138 {
139 volatile unsigned int i = 0;
140 for (i = 1; i < INT_NUMBER_MAX; i++)
141 {
142 HAL_INTERRUPT_SET_LEVEL(i, INT_PRIORITY_PLIC); //set default Priority. Priority level must be set > 0
143 HAL_INTERRUPT_ENABLE(i); // Enable PLIC interrupt source
144 }
145
146 #if (CONFIG_NEST_INT_TEST)
147 arch_interrupt_set_priority(INT_SRC_UART0, 2);
148 #endif //#if (CONFIG_NEST_INT_TEST)
149 }
150
arch_interrupt_set_priority(arch_int_src_t int_number,uint32_t int_priority)151 void arch_interrupt_set_priority(arch_int_src_t int_number, uint32_t int_priority)
152 {
153 if(int_number > 0 && int_number < INT_NUMBER_MAX) {
154 //set Priority for int. Priority level must be set > 0 and <=7
155 HAL_INTERRUPT_SET_LEVEL(int_number, int_priority & INT_PRIORITY_MASK);
156 }
157
158 return;
159 }
160
arch_interrupt_register_int(arch_int_src_t int_number,int_group_isr_t isr_callback)161 void arch_interrupt_register_int(arch_int_src_t int_number, int_group_isr_t isr_callback)
162 {
163 if((int_number > (INT_ID_MAX-1))|| isr_callback == NULL)
164 {
165 return;
166 }
167
168 p_intn_func_handle[int_number] = isr_callback;
169 }
arch_interrupt_unregister_int(arch_int_src_t int_number)170 void arch_interrupt_unregister_int(arch_int_src_t int_number)
171 {
172 if(int_number > (INT_ID_MAX-1))
173 {
174 return;
175 }
176
177 p_intn_func_handle[int_number] = NULL;
178 }
setup_mtimer(void)179 void setup_mtimer(void)
180 {
181 HAL_MTIMER_INITIAL();
182
183 /* Active machine timer */
184 DEV_PLMT->MTIMECMP = DEV_PLMT->MTIME + MACHINE_TIMER_PERIOD;
185
186 HAL_MTIME_ENABLE();
187 }
188
setup_mswi(void)189 void setup_mswi(void)
190 {
191 HAL_MSWI_INITIAL();
192 HAL_MSWI_ENABLE();
193 }
194
195
trigger_mswi(void)196 void trigger_mswi(void)
197 {
198 /* Trigger Machine software interrupt */
199 HAL_MSWI_PENDING();
200 }
201
202 /////////////////////////////msi/////////////////////////////////////////////////////////////
mswi_handler(void)203 void mswi_handler(void)
204 {
205 HAL_MSWI_CLEAR();
206
207 /*
208 * It is triggered by Machine mtime interrupt handler.
209 * Output messgaes to indicate Machine mtime is alive.
210 */
211 if(trigger_mswi_uart_msg_flag) {
212 /* Clear UART output message trigger flag */
213 trigger_mswi_uart_msg_flag = 0;
214
215 //printf("Message triggered from machine time interrupt\n");
216 }
217
218 /*
219 * It is triggered by PIT interrupt handler.
220 * Output messgaes to indicate PLIC PIT is alive.
221 */
222 if(trigger_pit_uart_msg_flag) {
223 /* Clear UART output message trigger flag */
224 trigger_pit_uart_msg_flag = 0;
225
226 //printf("Message triggered from PLIC PIT interrupt\n");
227 }
228 }
229
230 /////////////////////////mti////////////////////////////
mtime_handler(void)231 void mtime_handler(void)
232 {
233 /* Disable the timer interrupt to prevent reentry */
234 HAL_MTIME_DISABLE();
235
236 /* Reset the timer to specified period */
237 DEV_PLMT->MTIMECMP = DEV_PLMT->MTIME + MACHINE_TIMER_PERIOD;
238
239 /* Enable interrupts in general to allow nested */
240 set_csr(NDS_MSTATUS, MSTATUS_MIE);
241
242 /*
243 * Set the flag to trigger Machine software interrupt.
244 * The Machine SWI interrupt handler will output message to indicate
245 * Machine mtime is alive.
246 */
247 // trigger_mswi_flag = 1;
248 trigger_mswi_uart_msg_flag = 1;
249
250 /* Re-enable the timer interrupt. */
251 HAL_MTIME_ENABLE();
252 }
253
254 //specify:low voltage process can't be interrupt or the system can't response external interrupt after wakeup.
mtimer_reset_next_tick(uint32_t minimum_offset)255 void mtimer_reset_next_tick(uint32_t minimum_offset)
256 {
257 if(DEV_PLMT->MTIMECMP < DEV_PLMT->MTIME + minimum_offset)
258 {
259 DEV_PLMT->MTIMECMP = DEV_PLMT->MTIME + minimum_offset;
260 }
261 }
262
mtimer_is_timeout()263 bool mtimer_is_timeout()
264 {
265 return (DEV_PLMT->MTIMECMP <= DEV_PLMT->MTIME);
266 }
267
arch_interrupt_init(void)268 void arch_interrupt_init(void)
269 {
270
271 /* Disable the Machine external, timer and software interrupts until setup is done */
272 clear_csr(NDS_MIE, MIP_MEIP | MIP_MTIP | MIP_MSIP);
273 clear_csr(NDS_MSTATUS, MSTATUS_MIE); /* Disable interrupts in general. */
274
275 /* Setup Machine mtime and software interrupt */
276 setup_mtimer();
277 setup_mswi();
278 arch_interrupt_enable() ; //irq enabler
279
280 /* Disable the Machine external, timer and software interrupts until setup is done */
281 clear_csr(NDS_MIE, MIP_MEIP | MIP_MTIP | MIP_MSIP);
282 clear_csr(NDS_MSTATUS, MSTATUS_MIE); /* Enable interrupts in general. */
283
284 // set_csr(NDS_MIE, MIP_MEIP | MIP_MTIP | MIP_MSIP); /* Enable the Machine External/Timer/Sofware interrupt bit in MIE. */
285 //set_csr(NDS_MSTATUS, MSTATUS_MIE); /* Enable interrupts in general. */
286 }
arch_isr_entry_init(void)287 bk_err_t arch_isr_entry_init(void)
288 {
289 // arch_interrupt_enable();
290 arch_interrupt_init();
291 return BK_OK;
292 }
293
arch_get_plic_pending_status(void)294 uint64_t arch_get_plic_pending_status(void)
295 {
296 uint64_t plic_pend1 = *(volatile uint32 *)(REG_PLIC_PENDING_STATUS_GROUP1);
297 uint64_t plic_pend2 = *(volatile uint32 *)(REG_PLIC_PENDING_STATUS_GROUP2);
298 uint64_t plic_pending_status = (plic_pend2 << 32) | plic_pend1;
299
300 return plic_pending_status;
301 }
302
303 #ifdef INT_VECTOR_EN
entry_irq1(void)304 void __attribute__ ((interrupt)) entry_irq1(void)
305 {
306 NESTED_IRQ_ENTER();
307 if(p_intn_func_handle[1] != NULL)
308 (*(p_intn_func_handle[1]))() ;
309
310 NESTED_VPLIC_COMPLETE_INTERRUPT(1);
311
312 NESTED_IRQ_EXIT();
313 }
314
entry_irq2(void)315 void __attribute__ ((interrupt)) entry_irq2(void)
316 {
317 NESTED_IRQ_ENTER();
318
319 if(p_intn_func_handle[2] != NULL)
320 (*(p_intn_func_handle[2]))() ;
321
322 NESTED_VPLIC_COMPLETE_INTERRUPT(2);
323
324 NESTED_IRQ_EXIT();
325 }
326
entry_irq3(void)327 void __attribute__ ((interrupt)) entry_irq3(void)
328 {
329 NESTED_IRQ_ENTER();
330
331 if(p_intn_func_handle[3] != NULL)
332 (*(p_intn_func_handle[3]))() ;
333
334 NESTED_VPLIC_COMPLETE_INTERRUPT(3);
335
336 NESTED_IRQ_EXIT();
337 }
338
entry_irq4(void)339 void __attribute__ ((interrupt)) entry_irq4(void)
340 {
341 NESTED_IRQ_ENTER();
342
343 if(p_intn_func_handle[4] != NULL)
344 (*(p_intn_func_handle[4]))() ;
345 NESTED_VPLIC_COMPLETE_INTERRUPT(4);
346
347 NESTED_IRQ_EXIT();
348 }
349
entry_irq5(void)350 void __attribute__ ((interrupt)) entry_irq5(void)
351 {
352 NESTED_IRQ_ENTER();
353
354 if(p_intn_func_handle[5] != NULL)
355 (*(p_intn_func_handle[5]))() ;
356
357 NESTED_VPLIC_COMPLETE_INTERRUPT(5);
358
359 NESTED_IRQ_EXIT();
360 }
361
entry_irq6(void)362 void __attribute__ ((interrupt)) entry_irq6(void)
363 {
364 NESTED_IRQ_ENTER();
365
366 if(p_intn_func_handle[6] != NULL)
367 (*(p_intn_func_handle[6]))() ;
368
369 NESTED_VPLIC_COMPLETE_INTERRUPT(6);
370
371 NESTED_IRQ_EXIT();
372 }
373
entry_irq7(void)374 void __attribute__ ((interrupt)) entry_irq7(void)
375 {
376 NESTED_IRQ_ENTER();
377
378 if(p_intn_func_handle[7] != NULL)
379 (*(p_intn_func_handle[7]))() ;
380
381 NESTED_VPLIC_COMPLETE_INTERRUPT(7);
382
383 NESTED_IRQ_EXIT();
384 }
385
entry_irq8(void)386 void __attribute__ ((interrupt)) entry_irq8(void)
387 {
388 NESTED_IRQ_ENTER();
389
390 if(p_intn_func_handle[8] != NULL)
391 (*(p_intn_func_handle[8]))() ;
392
393 NESTED_VPLIC_COMPLETE_INTERRUPT(8);
394 NESTED_IRQ_EXIT();
395 }
396
entry_irq9(void)397 void __attribute__ ((interrupt)) entry_irq9(void)
398 {
399 NESTED_IRQ_ENTER();
400
401 if(p_intn_func_handle[9] != NULL)
402 (*(p_intn_func_handle[9]))() ;
403
404 NESTED_VPLIC_COMPLETE_INTERRUPT(9);
405
406 NESTED_IRQ_EXIT();
407 }
408
entry_irq10(void)409 void __attribute__ ((interrupt)) entry_irq10(void)
410 {
411 NESTED_IRQ_ENTER();
412
413 if(p_intn_func_handle[10] != NULL)
414 (*(p_intn_func_handle[10]))() ;
415
416 NESTED_VPLIC_COMPLETE_INTERRUPT(10);
417
418 NESTED_IRQ_EXIT();
419 }
420
entry_irq11(void)421 void __attribute__ ((interrupt)) entry_irq11(void)
422 {
423 NESTED_IRQ_ENTER();
424
425 if(p_intn_func_handle[11] != NULL)
426 (*(p_intn_func_handle[11]))() ;
427
428 NESTED_VPLIC_COMPLETE_INTERRUPT(11);
429
430 NESTED_IRQ_EXIT();
431 }
432
433
434
entry_irq12(void)435 void __attribute__ ((interrupt)) entry_irq12(void)
436 {
437 NESTED_IRQ_ENTER();
438
439 if(p_intn_func_handle[12] != NULL)
440 (*(p_intn_func_handle[12]))() ;
441
442 NESTED_VPLIC_COMPLETE_INTERRUPT(12);
443
444 NESTED_IRQ_EXIT();
445 }
446
447
entry_irq13(void)448 void __attribute__ ((interrupt)) entry_irq13(void)
449 {
450 NESTED_IRQ_ENTER();
451
452 if(p_intn_func_handle[13] != NULL)
453 (*(p_intn_func_handle[13]))() ;
454
455 NESTED_VPLIC_COMPLETE_INTERRUPT(13);
456
457 NESTED_IRQ_EXIT();
458 }
459
460
entry_irq14(void)461 void __attribute__ ((interrupt)) entry_irq14(void)
462 {
463 NESTED_IRQ_ENTER();
464
465 if(p_intn_func_handle[14] != NULL)
466 (*(p_intn_func_handle[14]))() ;
467
468 NESTED_VPLIC_COMPLETE_INTERRUPT(14);
469
470 NESTED_IRQ_EXIT();
471 }
472
473
entry_irq15(void)474 void __attribute__ ((interrupt)) entry_irq15(void)
475 {
476 NESTED_IRQ_ENTER();
477
478 if(p_intn_func_handle[15] != NULL)
479 (*(p_intn_func_handle[15]))() ;
480
481 NESTED_VPLIC_COMPLETE_INTERRUPT(15);
482
483 NESTED_IRQ_EXIT();
484 }
485
486
entry_irq16(void)487 void __attribute__ ((interrupt)) entry_irq16(void)
488 {
489 NESTED_IRQ_ENTER();
490
491 if(p_intn_func_handle[16] != NULL)
492 (*(p_intn_func_handle[16]))() ;
493
494 NESTED_VPLIC_COMPLETE_INTERRUPT(16);
495
496 NESTED_IRQ_EXIT();
497 }
498
499
entry_irq17(void)500 void __attribute__ ((interrupt)) entry_irq17(void)
501 {
502 NESTED_IRQ_ENTER();
503
504 if(p_intn_func_handle[17] != NULL)
505 (*(p_intn_func_handle[17]))() ;
506
507 NESTED_VPLIC_COMPLETE_INTERRUPT(17);
508
509 NESTED_IRQ_EXIT();
510 }
511
entry_irq18(void)512 void __attribute__ ((interrupt)) entry_irq18(void)
513 {
514 NESTED_IRQ_ENTER();
515
516 if(p_intn_func_handle[18] != NULL)
517 (*(p_intn_func_handle[18]))() ;
518
519 NESTED_VPLIC_COMPLETE_INTERRUPT(18);
520
521 NESTED_IRQ_EXIT();
522 }
523
entry_irq19(void)524 void __attribute__ ((interrupt)) entry_irq19(void)
525 {
526 NESTED_IRQ_ENTER();
527
528 if(p_intn_func_handle[19] != NULL)
529 (*(p_intn_func_handle[19]))() ;
530
531 NESTED_VPLIC_COMPLETE_INTERRUPT(19);
532
533 NESTED_IRQ_EXIT();
534 }
535
entry_irq20(void)536 void __attribute__ ((interrupt)) entry_irq20(void)
537 {
538 NESTED_IRQ_ENTER();
539
540 if(p_intn_func_handle[20] != NULL)
541 (*(p_intn_func_handle[20]))() ;
542
543 NESTED_VPLIC_COMPLETE_INTERRUPT(20);
544
545 NESTED_IRQ_EXIT();
546 }
547
entry_irq21(void)548 void __attribute__ ((interrupt)) entry_irq21(void)
549 {
550 NESTED_IRQ_ENTER();
551
552 if(p_intn_func_handle[21] != NULL)
553 (*(p_intn_func_handle[21]))() ;
554
555 NESTED_VPLIC_COMPLETE_INTERRUPT(21);
556
557 NESTED_IRQ_EXIT();
558 }
559
560
561
562
entry_irq22(void)563 void __attribute__ ((interrupt)) entry_irq22(void)
564 {
565 NESTED_IRQ_ENTER();
566
567 if(p_intn_func_handle[22] != NULL)
568 (*(p_intn_func_handle[22]))() ;
569
570 NESTED_VPLIC_COMPLETE_INTERRUPT(22);
571
572 NESTED_IRQ_EXIT();
573 }
574
575
entry_irq23(void)576 void __attribute__ ((interrupt)) entry_irq23(void)
577 {
578 NESTED_IRQ_ENTER();
579
580 if(p_intn_func_handle[23] != NULL)
581 (*(p_intn_func_handle[23]))() ;
582
583 NESTED_VPLIC_COMPLETE_INTERRUPT(23);
584
585 NESTED_IRQ_EXIT();
586 }
587
588
entry_irq24(void)589 void __attribute__ ((interrupt)) entry_irq24(void)
590 {
591 NESTED_IRQ_ENTER();
592
593 if(p_intn_func_handle[24] != NULL)
594 (*(p_intn_func_handle[24]))() ;
595
596 NESTED_VPLIC_COMPLETE_INTERRUPT(24);
597
598 NESTED_IRQ_EXIT();
599 }
600
601
entry_irq25(void)602 void __attribute__ ((interrupt)) entry_irq25(void)
603 {
604 NESTED_IRQ_ENTER();
605
606 if(p_intn_func_handle[25] != NULL)
607 (*(p_intn_func_handle[25]))() ;
608
609 NESTED_VPLIC_COMPLETE_INTERRUPT(25);
610
611 NESTED_IRQ_EXIT();
612 }
613
entry_irq26(void)614 void __attribute__ ((interrupt)) entry_irq26(void)
615 {
616 NESTED_IRQ_ENTER();
617
618 if(p_intn_func_handle[26] != NULL)
619 (*(p_intn_func_handle[26]))() ;
620
621 NESTED_VPLIC_COMPLETE_INTERRUPT(26);
622
623 NESTED_IRQ_EXIT();
624 }
625
entry_irq27(void)626 void __attribute__ ((interrupt)) entry_irq27(void)
627 {
628 NESTED_IRQ_ENTER();
629
630 if(p_intn_func_handle[27] != NULL)
631 (*(p_intn_func_handle[27]))() ;
632
633 NESTED_VPLIC_COMPLETE_INTERRUPT(27);
634
635 NESTED_IRQ_EXIT();
636 }
637
638
entry_irq28(void)639 void __attribute__ ((interrupt)) entry_irq28(void)
640 {
641 NESTED_IRQ_ENTER();
642
643 if(p_intn_func_handle[28] != NULL)
644 (*(p_intn_func_handle[28]))() ;
645
646 NESTED_VPLIC_COMPLETE_INTERRUPT(28);
647
648 NESTED_IRQ_EXIT();
649 }
650
651
652
entry_irq29(void)653 void __attribute__ ((interrupt)) entry_irq29(void)
654 {
655 NESTED_IRQ_ENTER();
656
657 if(p_intn_func_handle[29] != NULL)
658 (*(p_intn_func_handle[29]))() ;
659
660 NESTED_VPLIC_COMPLETE_INTERRUPT(29);
661
662 NESTED_IRQ_EXIT();
663 }
664
665
entry_irq30(void)666 void __attribute__ ((interrupt)) entry_irq30(void)
667 {
668 NESTED_IRQ_ENTER();
669
670 if(p_intn_func_handle[30] != NULL)
671 (*(p_intn_func_handle[30]))() ;
672
673 NESTED_VPLIC_COMPLETE_INTERRUPT(30);
674
675 NESTED_IRQ_EXIT();
676 }
677
678
entry_irq31(void)679 void __attribute__ ((interrupt)) entry_irq31(void)
680 {
681 NESTED_IRQ_ENTER();
682
683 if(p_intn_func_handle[31] != NULL)
684 (*(p_intn_func_handle[31]))() ;
685
686 NESTED_VPLIC_COMPLETE_INTERRUPT(31);
687
688 NESTED_IRQ_EXIT();
689 }
690
691
entry_irq32(void)692 void __attribute__ ((interrupt)) entry_irq32(void)
693 {
694 NESTED_IRQ_ENTER();
695
696 if(p_intn_func_handle[32] != NULL)
697 (*(p_intn_func_handle[32]))() ;
698
699 NESTED_VPLIC_COMPLETE_INTERRUPT(32);
700
701 NESTED_IRQ_EXIT();
702 }
703
704
705
entry_irq33(void)706 void __attribute__ ((interrupt)) entry_irq33(void)
707 {
708 NESTED_IRQ_ENTER();
709
710 if(p_intn_func_handle[33] != NULL)
711 (*(p_intn_func_handle[33]))() ;
712
713 NESTED_VPLIC_COMPLETE_INTERRUPT(33);
714
715 NESTED_IRQ_EXIT();
716 }
717
718
719
entry_irq34(void)720 void __attribute__ ((interrupt)) entry_irq34(void)
721 {
722 NESTED_IRQ_ENTER();
723
724 if(p_intn_func_handle[34] != NULL)
725 (*(p_intn_func_handle[34]))() ;
726
727 NESTED_VPLIC_COMPLETE_INTERRUPT(34);
728
729 NESTED_IRQ_EXIT();
730 }
731
732
733
entry_irq35(void)734 void __attribute__ ((interrupt)) entry_irq35(void)
735 {
736 NESTED_IRQ_ENTER();
737
738 if(p_intn_func_handle[35] != NULL)
739 (*(p_intn_func_handle[35]))() ;
740
741 NESTED_VPLIC_COMPLETE_INTERRUPT(35);
742
743 NESTED_IRQ_EXIT();
744 }
745
746
747
entry_irq36(void)748 void __attribute__ ((interrupt)) entry_irq36(void)
749 {
750 NESTED_IRQ_ENTER();
751
752 if(p_intn_func_handle[36] != NULL)
753 (*(p_intn_func_handle[36]))() ;
754
755 NESTED_VPLIC_COMPLETE_INTERRUPT(36);
756
757 NESTED_IRQ_EXIT();
758 }
759
760
entry_irq37(void)761 void __attribute__ ((interrupt)) entry_irq37(void)
762 {
763 NESTED_IRQ_ENTER();
764
765 if(p_intn_func_handle[37] != NULL)
766 (*(p_intn_func_handle[37]))() ;
767
768 NESTED_VPLIC_COMPLETE_INTERRUPT(37);
769
770 NESTED_IRQ_EXIT();
771 }
772
773
entry_irq38(void)774 void __attribute__ ((interrupt)) entry_irq38(void)
775 {
776 NESTED_IRQ_ENTER();
777
778 if(p_intn_func_handle[38] != NULL)
779 (*(p_intn_func_handle[38]))() ;
780
781 NESTED_VPLIC_COMPLETE_INTERRUPT(38);
782
783 NESTED_IRQ_EXIT();
784 }
entry_irq39(void)785 void __attribute__ ((interrupt)) entry_irq39(void)
786 {
787 NESTED_IRQ_ENTER();
788
789 if(p_intn_func_handle[39] != NULL)
790 (*(p_intn_func_handle[39]))() ;
791
792 NESTED_VPLIC_COMPLETE_INTERRUPT(39);
793
794 NESTED_IRQ_EXIT();
795 }
796
entry_irq40(void)797 void __attribute__ ((interrupt)) entry_irq40(void)
798 {
799 NESTED_IRQ_ENTER();
800
801 if(p_intn_func_handle[40] != NULL)
802 (*(p_intn_func_handle[40]))() ;
803
804 NESTED_VPLIC_COMPLETE_INTERRUPT(40);
805
806 NESTED_IRQ_EXIT();
807 }
808
entry_irq41(void)809 void __attribute__ ((interrupt)) entry_irq41(void)
810 {
811 NESTED_IRQ_ENTER();
812
813 if(p_intn_func_handle[41] != NULL)
814 (*(p_intn_func_handle[41]))() ;
815
816 NESTED_VPLIC_COMPLETE_INTERRUPT(41);
817
818 NESTED_IRQ_EXIT();
819 }
820
entry_irq42(void)821 void __attribute__ ((interrupt)) entry_irq42(void)
822 {
823 NESTED_IRQ_ENTER();
824
825 if(p_intn_func_handle[42] != NULL)
826 (*(p_intn_func_handle[42]))() ;
827
828 NESTED_VPLIC_COMPLETE_INTERRUPT(42);
829
830 NESTED_IRQ_EXIT();
831 }
832
entry_irq43(void)833 void __attribute__ ((interrupt)) entry_irq43(void)
834 {
835 NESTED_IRQ_ENTER();
836
837 if(p_intn_func_handle[43] != NULL)
838 (*(p_intn_func_handle[43]))() ;
839
840 NESTED_VPLIC_COMPLETE_INTERRUPT(43);
841
842 NESTED_IRQ_EXIT();
843 }
844
845
entry_irq44(void)846 void __attribute__ ((interrupt)) entry_irq44(void)
847 {
848 NESTED_IRQ_ENTER();
849
850 if(p_intn_func_handle[44] != NULL)
851 (*(p_intn_func_handle[44]))() ;
852
853 NESTED_VPLIC_COMPLETE_INTERRUPT(44);
854
855 NESTED_IRQ_EXIT();
856 }
857
entry_irq45(void)858 void __attribute__ ((interrupt)) entry_irq45(void)
859 {
860 NESTED_IRQ_ENTER();
861
862 if(p_intn_func_handle[45] != NULL)
863 (*(p_intn_func_handle[45]))() ;
864
865 NESTED_VPLIC_COMPLETE_INTERRUPT(45);
866
867 NESTED_IRQ_EXIT();
868 }
869
entry_irq46(void)870 void __attribute__ ((interrupt)) entry_irq46(void)
871 {
872 NESTED_IRQ_ENTER();
873
874 if(p_intn_func_handle[46] != NULL)
875 (*(p_intn_func_handle[46]))() ;
876
877 NESTED_VPLIC_COMPLETE_INTERRUPT(46);
878
879 NESTED_IRQ_EXIT();
880 }
881
entry_irq47(void)882 void __attribute__ ((interrupt)) entry_irq47(void)
883 {
884 NESTED_IRQ_ENTER();
885
886 if(p_intn_func_handle[47] != NULL)
887 (*(p_intn_func_handle[47]))() ;
888 NESTED_VPLIC_COMPLETE_INTERRUPT(47);
889
890 NESTED_IRQ_EXIT();
891 }
892
entry_irq48(void)893 void __attribute__ ((interrupt)) entry_irq48(void)
894 {
895 NESTED_IRQ_ENTER();
896
897 if(p_intn_func_handle[48] != NULL)
898 (*(p_intn_func_handle[48]))() ;
899
900 NESTED_VPLIC_COMPLETE_INTERRUPT(48);
901
902 NESTED_IRQ_EXIT();
903 }
904
entry_irq49(void)905 void __attribute__ ((interrupt)) entry_irq49(void)
906 {
907 NESTED_IRQ_ENTER();
908
909 if(p_intn_func_handle[49] != NULL)
910 (*(p_intn_func_handle[49]))() ;
911
912 NESTED_VPLIC_COMPLETE_INTERRUPT(49);
913
914 NESTED_IRQ_EXIT();
915 }
916
entry_irq50(void)917 void __attribute__ ((interrupt)) entry_irq50(void)
918 {
919 NESTED_IRQ_ENTER();
920
921 if(p_intn_func_handle[50] != NULL)
922 (*(p_intn_func_handle[50]))() ;
923
924 NESTED_VPLIC_COMPLETE_INTERRUPT(50);
925
926 NESTED_IRQ_EXIT();
927 }
928
entry_irq51(void)929 void __attribute__ ((interrupt)) entry_irq51(void)
930 {
931 NESTED_IRQ_ENTER();
932
933 if(p_intn_func_handle[51] != NULL)
934 (*(p_intn_func_handle[51]))() ;
935
936 NESTED_VPLIC_COMPLETE_INTERRUPT(51);
937
938 NESTED_IRQ_EXIT();
939 }
940
entry_irq52(void)941 void __attribute__ ((interrupt)) entry_irq52(void)
942 {
943 NESTED_IRQ_ENTER();
944
945 if(p_intn_func_handle[52] != NULL)
946 (*(p_intn_func_handle[52]))() ;
947
948 NESTED_VPLIC_COMPLETE_INTERRUPT(52);
949
950 NESTED_IRQ_EXIT();
951 }
952
entry_irq53(void)953 void __attribute__ ((interrupt)) entry_irq53(void)
954 {
955 NESTED_IRQ_ENTER();
956
957 if(p_intn_func_handle[53] != NULL)
958 (*(p_intn_func_handle[53]))() ;
959
960 NESTED_VPLIC_COMPLETE_INTERRUPT(53);
961
962 NESTED_IRQ_EXIT();
963 }
964
entry_irq54(void)965 void __attribute__ ((interrupt)) entry_irq54(void)
966 {
967 NESTED_IRQ_ENTER();
968
969 if(p_intn_func_handle[54] != NULL)
970 (*(p_intn_func_handle[54]))() ;
971
972 NESTED_VPLIC_COMPLETE_INTERRUPT(54);
973
974 NESTED_IRQ_EXIT();
975 }
976
977
entry_irq55(void)978 void __attribute__ ((interrupt)) entry_irq55(void)
979 {
980 NESTED_IRQ_ENTER();
981
982 if(p_intn_func_handle[55] != NULL)
983 (*(p_intn_func_handle[55]))() ;
984 NESTED_VPLIC_COMPLETE_INTERRUPT(55);
985
986 NESTED_IRQ_EXIT();
987 }
988
entry_irq56(void)989 void __attribute__ ((interrupt)) entry_irq56(void)
990 {
991 NESTED_IRQ_ENTER();
992
993 if(p_intn_func_handle[56] != NULL)
994 (*(p_intn_func_handle[56]))() ;
995
996 NESTED_VPLIC_COMPLETE_INTERRUPT(56);
997
998 NESTED_IRQ_EXIT();
999 }
1000
entry_irq57(void)1001 void __attribute__ ((interrupt)) entry_irq57(void)
1002 {
1003 NESTED_IRQ_ENTER();
1004
1005 if(p_intn_func_handle[57] != NULL)
1006 (*(p_intn_func_handle[57]))() ;
1007
1008 NESTED_VPLIC_COMPLETE_INTERRUPT(57);
1009
1010 NESTED_IRQ_EXIT();
1011 }
1012
1013
entry_irq58(void)1014 void __attribute__ ((interrupt)) entry_irq58(void)
1015 {
1016 NESTED_IRQ_ENTER();
1017
1018 if(p_intn_func_handle[58] != NULL)
1019 (*(p_intn_func_handle[58]))() ;
1020
1021 NESTED_VPLIC_COMPLETE_INTERRUPT(58);
1022
1023 NESTED_IRQ_EXIT();
1024 }
1025
entry_irq59(void)1026 void __attribute__ ((interrupt)) entry_irq59(void)
1027 {
1028 NESTED_IRQ_ENTER();
1029
1030 if(p_intn_func_handle[59] != NULL)
1031 (*(p_intn_func_handle[59]))() ;
1032 NESTED_VPLIC_COMPLETE_INTERRUPT(59);
1033
1034 NESTED_IRQ_EXIT();
1035 }
1036
entry_irq60(void)1037 void __attribute__ ((interrupt)) entry_irq60(void)
1038 {
1039 NESTED_IRQ_ENTER();
1040
1041 if(p_intn_func_handle[60] != NULL)
1042 (*(p_intn_func_handle[60]))() ;
1043 NESTED_VPLIC_COMPLETE_INTERRUPT(60);
1044
1045 NESTED_IRQ_EXIT();
1046 }
1047
1048
entry_irq61(void)1049 void __attribute__ ((interrupt)) entry_irq61(void)
1050 {
1051 NESTED_IRQ_ENTER();
1052
1053 if(p_intn_func_handle[61] != NULL)
1054 (*(p_intn_func_handle[61]))() ;
1055
1056 NESTED_VPLIC_COMPLETE_INTERRUPT(61);
1057
1058 NESTED_IRQ_EXIT();
1059 }
1060
entry_irq62(void)1061 void __attribute__ ((interrupt)) entry_irq62(void)
1062 {
1063 NESTED_IRQ_ENTER();
1064
1065 if(p_intn_func_handle[62] != NULL)
1066 (*(p_intn_func_handle[62]))() ;
1067
1068 NESTED_VPLIC_COMPLETE_INTERRUPT(62);
1069
1070 NESTED_IRQ_EXIT();
1071 }
1072
entry_irq63(void)1073 void __attribute__ ((interrupt)) entry_irq63(void)
1074 {
1075 NESTED_IRQ_ENTER();
1076
1077 if(p_intn_func_handle[63] != NULL)
1078 (*(p_intn_func_handle[63]))() ;
1079
1080 NESTED_VPLIC_COMPLETE_INTERRUPT(63);
1081
1082 NESTED_IRQ_EXIT();
1083 }
1084 #endif
1085
1086