mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-07-24 21:51:46 +00:00
.github
.vscode
Architecture
Core
Execute
FileSystem
GUI
Library
Network
Profiling
Recovery
SystemCalls
Tasking
Tests
include
boot
filesystem
net
abi.h
assert.h
atomic.hpp
bitmap.hpp
cargs.h
convert.h
cpu.hpp
crc32.h
cstring
cwalk.h
debug.h
disk.hpp
display.hpp
driver.hpp
dumper.hpp
elf.h
exec.hpp
filesystem.hpp
gui.hpp
hashmap.hpp
interrupts.hpp
io.h
ipc.hpp
kconfig.hpp
limits.h
lock.hpp
md5.h
memory.hpp
msexec.h
pci.hpp
power.hpp
printf.h
rand.hpp
recovery.hpp
smartptr.hpp
smp.hpp
std.hpp
stdint.h
symbols.hpp
sys.h
syscalls.hpp
task.hpp
time.hpp
types.h
uart.hpp
vector.hpp
.gitignore
DAPI.hpp
Doxyfile
Fex.hpp
KConfig.cpp
KThread.cpp
Kernel.cpp
LICENSE
Makefile
README.md
dump.sh
kernel.h
syscalls.h
53 lines
1.3 KiB
C++
53 lines
1.3 KiB
C++
#ifndef __FENNIX_KERNEL_INTERRUPTS_H__
|
|
#define __FENNIX_KERNEL_INTERRUPTS_H__
|
|
|
|
#include <types.h>
|
|
#include <cpu.hpp>
|
|
|
|
namespace Interrupts
|
|
{
|
|
#ifdef DEBUG // For performance reasons
|
|
#define INT_FRAMES_MAX 512
|
|
#else
|
|
#define INT_FRAMES_MAX 8
|
|
#endif
|
|
|
|
#if defined(__amd64__)
|
|
/* APIC::APIC */ extern void *apic[256]; // MAX_CPU
|
|
/* APIC::Timer */ extern void *apicTimer[256]; // MAX_CPU
|
|
#elif defined(__i386__)
|
|
/* APIC::APIC */ extern void *apic[256]; // MAX_CPU
|
|
/* APIC::Timer */ extern void *apicTimer[256]; // MAX_CPU
|
|
#elif defined(__aarch64__)
|
|
#endif
|
|
extern void *InterruptFrames[INT_FRAMES_MAX];
|
|
|
|
void Initialize(int Core);
|
|
void Enable(int Core);
|
|
void InitializeTimer(int Core);
|
|
void RemoveAll();
|
|
|
|
class Handler
|
|
{
|
|
private:
|
|
int InterruptNumber;
|
|
|
|
protected:
|
|
void SetInterruptNumber(int InterruptNumber) { this->InterruptNumber = InterruptNumber; }
|
|
int GetInterruptNumber() { return InterruptNumber; }
|
|
Handler(int InterruptNumber);
|
|
~Handler();
|
|
|
|
public:
|
|
#if defined(__amd64__)
|
|
virtual void OnInterruptReceived(CPU::x64::TrapFrame *Frame);
|
|
#elif defined(__i386__)
|
|
virtual void OnInterruptReceived(void *Frame);
|
|
#elif defined(__aarch64__)
|
|
virtual void OnInterruptReceived(void *Frame);
|
|
#endif
|
|
};
|
|
}
|
|
|
|
#endif // !__FENNIX_KERNEL_INTERRUPTS_H__
|