From 8cf8d7f4f5dd8bf08e6911a1d04522d824ffe007 Mon Sep 17 00:00:00 2001 From: Ali Mashtizadeh Date: Sun, 6 Jul 2014 14:30:09 -0700 Subject: [PATCH] Create and improve headers for various modules --- sys/amd64/ioapic.h | 13 +++++++++++++ sys/amd64/lapic.h | 14 ++++++++++++++ sys/amd64/machine.c | 3 +++ sys/amd64/pmap.c | 2 ++ sys/amd64/trap.c | 1 + sys/include/kmem.h | 2 ++ sys/kern/debug.c | 2 ++ sys/kern/palloc.c | 1 + 8 files changed, 38 insertions(+) create mode 100644 sys/amd64/ioapic.h create mode 100644 sys/amd64/lapic.h diff --git a/sys/amd64/ioapic.h b/sys/amd64/ioapic.h new file mode 100644 index 0000000..d519988 --- /dev/null +++ b/sys/amd64/ioapic.h @@ -0,0 +1,13 @@ +/* + * IOAPIC Header + */ + +#ifndef __IOAPIC_H__ +#define __IOAPIC_H__ + +void IOAPIC_Init(); +void IOAPIC_Enable(int irq); +void IOAPIC_Disable(int irq); + +#endif /* __IOAPIC_H__ */ + diff --git a/sys/amd64/lapic.h b/sys/amd64/lapic.h new file mode 100644 index 0000000..31d96e3 --- /dev/null +++ b/sys/amd64/lapic.h @@ -0,0 +1,14 @@ +/* + * LAPIC Header + */ + +#ifndef __LAPIC_H__ +#define __LAPIC_H__ + +void LAPIC_Init(); +uint32_t LAPIC_CPU(); +void LAPIC_SendEOI(); +void LAPIC_Periodic(uint64_t rate); + +#endif /* __LAPIC_H__ */ + diff --git a/sys/amd64/machine.c b/sys/amd64/machine.c index 1c05357..33eaba4 100644 --- a/sys/amd64/machine.c +++ b/sys/amd64/machine.c @@ -3,8 +3,11 @@ #include #include +#include #include "amd64.h" +#include "ioapic.h" +#include "lapic.h" extern void Trap_Init(); diff --git a/sys/amd64/pmap.c b/sys/amd64/pmap.c index 3880911..edc67d8 100644 --- a/sys/amd64/pmap.c +++ b/sys/amd64/pmap.c @@ -4,10 +4,12 @@ #include #include +#include #include "amd64.h" #include "amd64op.h" #include "mp.h" +#include "pmap.h" typedef struct AS { diff --git a/sys/amd64/trap.c b/sys/amd64/trap.c index b6ce098..1804b05 100644 --- a/sys/amd64/trap.c +++ b/sys/amd64/trap.c @@ -5,6 +5,7 @@ #include #include "amd64.h" +#include "lapic.h" #include "trap.h" extern uint64_t trap_table[T_MAX]; diff --git a/sys/include/kmem.h b/sys/include/kmem.h index 9c6b957..f86e436 100644 --- a/sys/include/kmem.h +++ b/sys/include/kmem.h @@ -2,6 +2,8 @@ #ifndef __KMEM_H__ #define __KMEM_H__ +void PAlloc_Init(); +void PAlloc_AddRegion(uintptr_t start, uintptr_t len); void *PAlloc_AllocPage(); void PAlloc_FreePage(void *pg); diff --git a/sys/kern/debug.c b/sys/kern/debug.c index 56edc9d..fadd76e 100644 --- a/sys/kern/debug.c +++ b/sys/kern/debug.c @@ -17,6 +17,8 @@ #include #include +#include + void Debug_PrintHex(const char *data, size_t length, off_t off, size_t limit) { diff --git a/sys/kern/palloc.c b/sys/kern/palloc.c index 391d0bf..cea91c2 100644 --- a/sys/kern/palloc.c +++ b/sys/kern/palloc.c @@ -8,6 +8,7 @@ #include #include +#include #include #include "../amd64/amd64.h"