]> git.corax.cc Git - corax/commitdiff
Move several definitions from kernel/arch/defs.h to kernel/include/arch.h to make...
authorMatthias Kruk <m@m10k.eu>
Tue, 14 Jan 2020 12:03:03 +0000 (21:03 +0900)
committerMatthias Kruk <m@m10k.eu>
Tue, 14 Jan 2020 12:03:03 +0000 (21:03 +0900)
kernel/arch/apic.S
kernel/arch/defs.h
kernel/arch/entry.S
kernel/arch/heap.c
kernel/arch/i8259.S
kernel/arch/init.S
kernel/arch/paging.c
kernel/include/arch.h

index 986199b8e29fad749c0579b4c20e686d54c5afba..303912832331a8073ffcc3968c8e60dae3564ff6 100644 (file)
@@ -16,7 +16,9 @@
  * along with Corax.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#define __ASSEMBLY_SOURCE
 #include <config.h>
+#include <arch.h>
 #include "defs.h"
 #include "apic.h"
 
@@ -146,7 +148,7 @@ _apic_init:
        cmp             $INT(2), %al
        jnz             2f
        orl             $0x00010000, %eax
-2:     
+2:
 /* *** Previous comment block is required for this to work properly ***
     movl    %eax, 16(%esp)
     movl    %edx, 12(%esp)
index b8825b91e396a40de2557f9ab41c134a8ee224a3..e52643815ed22cdd64681f16de19276fd0c864e1 100644 (file)
 
 #endif /* CONFIG_APIC */
 
-#define EXC_VECTOR0         0x00
-#define INT_VECTOR0         0x40
-#define SYS_VECTOR0         SYS_VECTOR_CORAX
-
-#define SYS_VECTOR_CORAX    0xCC
-#define SYS_VECTOR_CXNET    0xCD
-#define SYS_VECTOR_CXIPC    0xCE
-
-#if FEATURE(POSIX)
-#define SYS_VECTOR_POSIX    0x80
-#endif /* FEATURE(POSIX) */
-
-#define NUM_EXC_VECTORS     21
-#if CONFIG_APIC == 1
-#define NUM_INT_VECTORS     24
-#else
-#define NUM_INT_VECTORS     16
-#endif /* CONFIG_APIC */
-#define NUM_SYS_VECTORS     1
-
 /* i8259 definitions */
 #define PIC1_BASE           0x20
 #define PIC1_COMM           PIC1_BASE
 #define EXC_VIRTUALIZATION  EXC(20)
 #define EXC_MAX             EXC(21)
 
-/* Interrupt vectors */
-
-#define INT(n)              (INT_VECTOR0 + (n))
-#define INT_TIMER           INT(0)
-#define INT_KEYBOARD        INT(1)
-
-#if CONFIG_APIC == 1
-
-#define INT_APICERR         INT(-2)
-#define INT_SPURIOUS        INT(-1)
-/* what do we use INT 2 on APIC systems for? */
-#else
-/* on non-APIC systems, INT 2 is the cascaded i8259 PIC */
-#define INT_I8259           INT(2)
-#endif /* CONFIG_APIC */
-
-#define INT_FLOPPY          INT(3)
-#define INT_HARDDRIVE       INT(4)
-#define INT_RTC             INT(5)
-#define INT_HPET            INT(6) /* is it really? */
-#define INT_NETWORK         INT(7)
-#define INT_MAX             INT(8)
+/* Interrupt vectors have been moved to kernel/include/arch.h */
 
 /* definitions for tasks and task switching */
 
index 99481bdb3dc72ca5c315ef986d28d46e847ecaa9..51a3f3f92db4ef65c5d2429bca906d71d8fb90c6 100644 (file)
@@ -19,6 +19,7 @@
 #define __ASSEMBLY_SOURCE
 
 #include <config.h>
+#include <arch.h>
 #include "defs.h"
 
 .section .text
index 8a248ae03377cea82577726f53388ebfdc8ede64..4c38f2b7f27472fa07d5a951bf2a8cce72c84caa 100644 (file)
@@ -16,6 +16,7 @@
  * along with Corax.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <config.h>
 #include <corax/errno.h>
 #include <debug.h>
 #include <string.h>
index b0e1201de0fc14055416068208850a869ebb7915..dc7560f77fcf74746117b6939ca0b577a8b79f9a 100644 (file)
@@ -16,6 +16,9 @@
  * along with Corax.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#define __ASSEMBLY_SOURCE
+#include <config.h>
+#include <arch.h>
 #include "defs.h"
 
 #define I8259_EOI   0x20
index 8860d4e27261802d94f9bd7f243788f93d3cb327..101c67946f4ed637214ab083776d7ffa6e228dd9 100644 (file)
  * along with Corax.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#define __ASSEMBLY_SOURCE
+
 #include <config.h>
+#include <arch.h>
 #include "defs.h"
 
 .global arch_init
index bf944a73e51865e7fdf186c1807b0a62b2c1d500..8e7d16e0a61530b54a91d1721c5987e0ed397383 100644 (file)
@@ -16,6 +16,7 @@
  * along with Corax.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <config.h>
 #include <corax/types.h>
 #include <corax/errno.h>
 #include <corax/heap.h>
index 9917ea41a27ac0e5db92763fa9b1d16188191f71..19f40a9dfeb8c3b91cd55ce97a8c7cfe7bdf50e6 100644 (file)
 #define TASK_STATE_EXIT    5
 #define TASK_STATE_FORKED  6
 
+#define EXC_VECTOR0         0x00
+#define INT_VECTOR0         0x40
+#define SYS_VECTOR0         SYS_VECTOR_CORAX
+
+#define SYS_VECTOR_CORAX    0xCC
+#define SYS_VECTOR_CXNET    0xCD
+#define SYS_VECTOR_CXIPC    0xCE
+
+#if FEATURE(POSIX)
+#define SYS_VECTOR_POSIX    0x80
+#endif /* FEATURE(POSIX) */
+
+#define NUM_EXC_VECTORS     21
+#if CONFIG_APIC == 1
+#define NUM_INT_VECTORS     24
+#else
+#define NUM_INT_VECTORS     16
+#endif /* CONFIG_APIC */
+#define NUM_SYS_VECTORS     1
+
+#define INT(n)              (INT_VECTOR0 + (n))
+#define INT_TIMER           INT(0)
+#define INT_KEYBOARD        INT(1)
+
+#if CONFIG_APIC == 1
+
+#define INT_APICERR         INT(-2)
+#define INT_SPURIOUS        INT(-1)
+/* what do we use INT 2 on APIC systems for? */
+#else
+/* on non-APIC systems, INT 2 is the cascaded i8259 PIC */
+#define INT_I8259           INT(2)
+#endif /* CONFIG_APIC */
+
+#define INT_FLOPPY          INT(3)
+#define INT_HARDDRIVE       INT(4)
+#define INT_RTC             INT(5)
+#define INT_HPET            INT(6) /* is it really? */
+#define INT_NETWORK         INT(7)
+#define INT_MAX             INT(8)
+
 #ifndef __ASSEMBLY_SOURCE
 
 #include <corax/types.h>