forked from Imagelibrary/rtems
@@ -20,4 +20,5 @@
|
||||
#include <bspopts.h>
|
||||
|
||||
#define IDT_SIZE (256)
|
||||
#define GDT_SIZE (3 + NUM_APP_DRV_GDT_DESCRIPTORS)
|
||||
#define NUM_SYSTEM_GDT_DESCRIPTORS 4
|
||||
#define GDT_SIZE (NUM_SYSTEM_GDT_DESCRIPTORS + NUM_APP_DRV_GDT_DESCRIPTORS)
|
||||
|
||||
@@ -171,8 +171,8 @@ next_step:
|
||||
/*---------------------------------------------------------------------------+
|
||||
| GDT itself
|
||||
+--------------------------------------------------------------------------*/
|
||||
#if GDT_SIZE < 3
|
||||
#error "GDT_SIZE must be at least 3"
|
||||
#if GDT_SIZE < NUM_SYSTEM_GDT_DESCRIPTORS
|
||||
#error "GDT_SIZE must be at least NUM_SYSTEM_GDT_DESCRIPTORS"
|
||||
#endif
|
||||
|
||||
BEGIN_DATA
|
||||
@@ -193,8 +193,12 @@ SYM (_Global_descriptor_table):
|
||||
.word 0xffff, 0
|
||||
.byte 0, 0x92, 0xcf, 0
|
||||
|
||||
/* gs segment */
|
||||
.word 0xffff, 0
|
||||
.byte 0, 0x92, 0xcf, 0
|
||||
|
||||
/* allocated space for user segments */
|
||||
.rept (GDT_SIZE - 3)
|
||||
.rept (GDT_SIZE - NUM_SYSTEM_GDT_DESCRIPTORS)
|
||||
.word 0,0,0,0
|
||||
.endr
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
#include <rtems/score/cpu.h>
|
||||
#include <bsp/irq.h>
|
||||
#include <bsp/tblsizes.h>
|
||||
|
||||
/*
|
||||
* This locking is not enough if IDT is changed at runtime
|
||||
@@ -331,7 +332,7 @@ uint16_t i386_next_empty_gdt_entry ()
|
||||
uint16_t gdt_limit;
|
||||
segment_descriptors* gdt_entry_tbl;
|
||||
/* initial amount of filled descriptors */
|
||||
static uint16_t segment_selector_index = 2;
|
||||
static uint16_t segment_selector_index = NUM_SYSTEM_GDT_DESCRIPTORS - 1;
|
||||
|
||||
segment_selector_index += 1;
|
||||
i386_get_info_from_GDTR (&gdt_entry_tbl, &gdt_limit);
|
||||
|
||||
Reference in New Issue
Block a user