MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_hw_interrupt_init

Function rt_hw_interrupt_init

libcpu/mips/gs232/interrupt.c:44–68  ·  view source on GitHub ↗

* This function will initialize hardware interrupt */

Source from the content-addressed store, hash-verified

42 * This function will initialize hardware interrupt
43 */
44void rt_hw_interrupt_init(void)
45{
46 rt_int32_t idx;
47 rt_int32_t i;
48 rt_uint32_t c0_status = 0;
49
50 for (i=0; i < GS232_INTC_CELLS; i++)
51 {
52 /* Disable */
53 (gs232_hw0_icregs+i)->int_en = 0x0;
54 /* Trigger active low */
55 (gs232_hw0_icregs+i)->int_pol = -1; /* Must be done here */
56 /* Make all interrupts level triggered */
57 (gs232_hw0_icregs+i)->int_edge = 0x00000000;
58 /* Mask all interrupts */
59 (gs232_hw0_icregs+i)->int_clr = 0xffffffff;
60 mips_unmask_cpu_irq(i + 2);
61 }
62
63 rt_memset(irq_handle_table, 0x00, sizeof(irq_handle_table));
64 for (idx = 0; idx < MAX_INTR; idx ++)
65 {
66 irq_handle_table[idx].handler = rt_hw_interrupt_handler;
67 }
68}
69
70/**
71 * This function will mask a interrupt.

Callers

nothing calls this directly

Calls 2

mips_unmask_cpu_irqFunction · 0.85
rt_memsetFunction · 0.85

Tested by

no test coverage detected