-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
SamulKyull
authored and
SamulKyull
committed
Jan 10, 2025
1 parent
bb0e25e
commit b7ef02a
Showing
9 changed files
with
488 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* SPDX-License-Identifier: GPL-2.0+ */ | ||
|
||
#ifndef _SYS_CLIC_H_ | ||
#define _SYS_CLIC_H_ | ||
|
||
#include <io.h> | ||
#include <stdarg.h> | ||
#include <stdbool.h> | ||
#include <stddef.h> | ||
#include <stdint.h> | ||
#include <types.h> | ||
|
||
#include <common.h> | ||
#include <log.h> | ||
|
||
#include <reg-clic.h> | ||
#include <reg-ncat.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif// __cplusplus | ||
|
||
#define CLIC_IRQ_NUM (186) | ||
|
||
typedef enum irq_trigger_type { | ||
IRQ_TRIGGER_TYPE_LEVEL, | ||
IRQ_TRIGGER_TYPE_EDGE_RISING, | ||
IRQ_TRIGGER_TYPE_EDGE_FALLING, | ||
IRQ_TRIGGER_TYPE_EDGE_BOTH | ||
} irq_trigger_type_t; | ||
|
||
typedef struct irq_controller { | ||
uint16_t id; | ||
uint16_t irq_cnt; | ||
uint16_t parent_id; | ||
uint16_t irq_id; | ||
uint64_t reg_base_addr; | ||
} irq_controller_t; | ||
|
||
/** | ||
* @brief Handles the IRQ | ||
* | ||
*/ | ||
void do_irq(); | ||
|
||
/** | ||
* @brief Initializes the interrupt mechanism | ||
* | ||
* @return 0 on success, or an error code | ||
*/ | ||
int arch_interrupt_init(void); | ||
|
||
/** | ||
* @brief Exits the interrupt mechanism | ||
* | ||
* @return 0 on success, or an error code | ||
*/ | ||
int arch_interrupt_exit(void); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif// __cplusplus | ||
|
||
#endif// _SYS_CLIC_H_ |
Oops, something went wrong.