blob: 12294d0ae7d90cf197947099d6ef6c1c9844cbe7 [file] [log] [blame]
Xiaohu.Huanga2c5a042022-03-12 22:41:09 +08001/*
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"
12///////////////////////////////////////////////////////////////////
13/////// PIC relevant functions
14///////
15void pic_init(uintptr_t base_addr, uint32_t num_sources, uint32_t num_priorities);
16
17void pic_set_threshold(uint32_t threshold);
18
19void pic_enable_interrupt(uint32_t source);
20
21void pic_disable_interrupt(uint32_t source);
22
23void pic_set_priority(uint32_t source, uint32_t priority);
24
25uint32_t pic_claim_interrupt(void);
26
27void pic_complete_interrupt(uint32_t source);
28
29uint32_t pic_check_eip(void);
30
31void DefaultInterruptHandler(void);
32
33// Structures for registering different interrupt handlers
34// for different parts of the application.
35//typedef void (*function_ptr_t) (void);
36
37// The interrupt 0 is empty
38__attribute__((weak)) function_ptr_t pic_interrupt_handlers[PIC_NUM_INTERRUPTS];
39
40#endif