Xiaohu.Huang | a2c5a04 | 2022-03-12 22:41:09 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2021-2022 Amlogic, Inc. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: MIT |
| 5 | */ |
| 6 | |
| 7 | #ifndef INTERRUPT_CONTROL_H_ |
| 8 | #define INTERRUPT_CONTROL_H_ |
| 9 | |
| 10 | #include "n200_pic_tmr.h" |
| 11 | #include "interrupt.h" |
xiaohu.huang | 3826210 | 2022-05-06 22:21:48 +0800 | [diff] [blame] | 12 | #include "gcc_compiler_attributes.h" |
| 13 | |
Xiaohu.Huang | a2c5a04 | 2022-03-12 22:41:09 +0800 | [diff] [blame] | 14 | void pic_init(uintptr_t base_addr, uint32_t num_sources, uint32_t num_priorities); |
| 15 | |
| 16 | void pic_set_threshold(uint32_t threshold); |
| 17 | |
| 18 | void pic_enable_interrupt(uint32_t source); |
| 19 | |
| 20 | void pic_disable_interrupt(uint32_t source); |
| 21 | |
| 22 | void pic_set_priority(uint32_t source, uint32_t priority); |
| 23 | |
| 24 | uint32_t pic_claim_interrupt(void); |
| 25 | |
| 26 | void pic_complete_interrupt(uint32_t source); |
| 27 | |
| 28 | uint32_t pic_check_eip(void); |
| 29 | |
| 30 | void DefaultInterruptHandler(void); |
| 31 | |
Xiaohu.Huang | a2c5a04 | 2022-03-12 22:41:09 +0800 | [diff] [blame] | 32 | // The interrupt 0 is empty |
xiaohu.huang | 3826210 | 2022-05-06 22:21:48 +0800 | [diff] [blame] | 33 | __weak function_ptr_t pic_interrupt_handlers[PIC_NUM_INTERRUPTS]; |
Xiaohu.Huang | a2c5a04 | 2022-03-12 22:41:09 +0800 | [diff] [blame] | 34 | |
| 35 | #endif |