summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/i386/pc386/startup
diff options
context:
space:
mode:
authorJan Dolezal <dolezj21@fel.cvut.cz>2014-11-20 15:00:26 +0100
committerGedare Bloom <gedare@rtems.org>2014-11-20 09:52:38 -0500
commitec494ffbfc88b2085d8d4824883333b782c50b5c (patch)
tree534dd0f5348e7d2301947f9f2ad3bae3cc340ab5 /c/src/lib/libbsp/i386/pc386/startup
parentdl01,dl02: Avoid non-runnable $(EXEEXT) files (diff)
downloadrtems-ec494ffbfc88b2085d8d4824883333b782c50b5c.tar.bz2
i386/pc386: configurable size of descriptor tables
Diffstat (limited to 'c/src/lib/libbsp/i386/pc386/startup')
-rw-r--r--c/src/lib/libbsp/i386/pc386/startup/ldsegs.S18
1 files changed, 14 insertions, 4 deletions
diff --git a/c/src/lib/libbsp/i386/pc386/startup/ldsegs.S b/c/src/lib/libbsp/i386/pc386/startup/ldsegs.S
index 495d68ae9d..14cbb9599b 100644
--- a/c/src/lib/libbsp/i386/pc386/startup/ldsegs.S
+++ b/c/src/lib/libbsp/i386/pc386/startup/ldsegs.S
@@ -34,6 +34,7 @@
+--------------------------------------------------------------------------*/
#include <rtems/asm.h>
+#include <bsp/tblsizes.h> /* contains sizes of GDT and IDT */
/*----------------------------------------------------------------------------+
| CODE section
@@ -167,6 +168,9 @@ next_step:
/*---------------------------------------------------------------------------+
| GDT itself
+--------------------------------------------------------------------------*/
+#if GDT_SIZE < 3
+#error "GDT_SIZE must be at least 3"
+#endif
BEGIN_DATA
.p2align 4
@@ -186,11 +190,17 @@ SYM (_Global_descriptor_table):
.word 0xffff, 0
.byte 0, 0x92, 0xcf, 0
+ /* allocated space for user segments */
+ .rept (GDT_SIZE - 3)
+ .word 0,0,0,0
+ .endr
+
/*---------------------------------------------------------------------------+
| Descriptor of GDT
+--------------------------------------------------------------------------*/
-SYM (gdtdesc):
- .word (3*8 - 1)
+ PUBLIC(gdtdesc)
+SYM(gdtdesc):
+ .word (GDT_SIZE*8 - 1)
.long SYM (_Global_descriptor_table)
/*---------------------------------------------------------------------------+
@@ -200,7 +210,7 @@ SYM (gdtdesc):
PUBLIC(Interrupt_descriptor_table)
SYM(Interrupt_descriptor_table):
- .rept 256
+ .rept IDT_SIZE
.word 0,0,0,0
.endr
@@ -211,7 +221,7 @@ SYM(Interrupt_descriptor_table):
.p2align 4
PUBLIC(IDT_Descriptor)
SYM(IDT_Descriptor):
- .word (256*8 - 1)
+ .word (IDT_SIZE*8 - 1)
.long SYM (Interrupt_descriptor_table)
END_DATA