Draft: lab 3 irq wtf
This commit is contained in:
5
kernel/include/exception.h
Normal file
5
kernel/include/exception.h
Normal file
@@ -0,0 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
void init_exception(void);
|
||||
void not_implemented_handler(void);
|
||||
void synchronous_handler(void);
|
||||
3
kernel/include/exec.h
Normal file
3
kernel/include/exec.h
Normal file
@@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
void user_exec(void *text, void *sp);
|
||||
17
kernel/include/interrupt.h
Normal file
17
kernel/include/interrupt.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#define CORE0_TIMER_IRQ_CTRL ((volatile uint32_t *)0x40000040)
|
||||
#define CORE0_IRQ_SOURCE ((volatile uint32_t *)0x40000060)
|
||||
|
||||
enum :uint32_t {
|
||||
CNTPNSIRQ_INT = ((uint32_t)1 << 1),
|
||||
GPU_INT = ((uint32_t)1 << 8)
|
||||
};
|
||||
|
||||
void init_interrupt(void);
|
||||
void irq_handler(void);
|
||||
|
||||
void enable_interrupt(void);
|
||||
void disable_interrupt(void);
|
||||
@@ -1,15 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <initrd.h>
|
||||
#include <stddef.h>
|
||||
|
||||
void help(void);
|
||||
void hello(void);
|
||||
void hwinfo(void);
|
||||
void memalloc(size_t size);
|
||||
void ls(file_node_t *root);
|
||||
void cat(file_node_t *root, const char *filename);
|
||||
void reboot(void);
|
||||
#include <initrd.h>
|
||||
|
||||
int // is continue
|
||||
shell(file_node_t *);
|
||||
|
||||
@@ -43,8 +43,14 @@ void exit(int);
|
||||
: [a] "=r" (ret) \
|
||||
)
|
||||
|
||||
#define W_SYSREG(val, reg) \
|
||||
#define W_SYSREG(reg, val) \
|
||||
asm volatile( \
|
||||
"msr " #reg ", %[a]" \
|
||||
: [a] "r" (val) \
|
||||
:: [a] "r" (val) \
|
||||
)
|
||||
|
||||
#define R_REG(ret, reg) \
|
||||
asm volatile( \
|
||||
"mov %[a], " #reg \
|
||||
: [a] "=r" (ret) \
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user