-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #113 from georgekang/master
implement userspace IRQ handling framework
- Loading branch information
Showing
28 changed files
with
1,546 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#ifndef INTERRUPT_H_ | ||
#define INTERRUPT_H_ | ||
|
||
#define DEFAULT_PRIORITY 1 | ||
|
||
void user_interrupt_config(tcb_t *from); | ||
void user_interrupt_handler_update(tcb_t *thr); | ||
|
||
/* Platform depended */ | ||
void user_irq_enable(int irq); | ||
void user_irq_disable(int irq); | ||
void user_irq_set_pending(int irq); | ||
void user_irq_clear_pending(int irq); | ||
|
||
#endif |
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,24 @@ | ||
#ifndef INTERRUPT_IPC_H_ | ||
#define INTERRUPT_IPC_H_ | ||
|
||
/* interrupt ipc message */ | ||
enum { | ||
IRQ_IPC_IRQN = 0, | ||
IRQ_IPC_TID = 1, | ||
IRQ_IPC_HANDLER = 2, | ||
IRQ_IPC_ACTION = 3, | ||
IRQ_IPC_PRIORITY = 4 | ||
}; | ||
|
||
#define IRQ_IPC_MSG_NUM IRQ_IPC_PRIORITY | ||
|
||
/* irq actions */ | ||
enum { | ||
USER_IRQ_ENABLE = 0, | ||
USER_IRQ_DISABLE = 1, | ||
USER_IRQ_FREE = 2 | ||
}; | ||
|
||
#define USER_INTERRUPT_LABEL 0x928 | ||
|
||
#endif |
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,28 @@ | ||
#ifndef PLATFORM_STM32F4_EXTI_H_ | ||
#define PLATFORM_STM32F4_EXTI_H_ | ||
|
||
#include <platform/stm32f4/registers.h> | ||
#include <platform/stm32f4/gpio.h> | ||
|
||
/* EXTI mode */ | ||
#define EXTI_INTERRUPT_MODE 0x0 | ||
#define EXTI_EVENT_MODE 0x4 | ||
|
||
/* EXTI trigger type */ | ||
#define EXTI_RISING_TRIGGER 0x8 | ||
#define EXTI_FALLING_TRIGGER 0xc | ||
#define EXTI_RISING_FALLING_TRIGGER 0x10 | ||
|
||
#define EXTI_LINE(x) ((uint32_t)0x1 << x) | ||
|
||
struct exti_regs { | ||
volatile uint32_t IMR; | ||
volatile uint32_t EMR; | ||
volatile uint32_t RTSR; | ||
volatile uint32_t FTSR; | ||
volatile uint32_t SWIER; | ||
volatile uint32_t PR; | ||
}; | ||
|
||
|
||
#endif |
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
Oops, something went wrong.