Changeset 7b0c74ff in rtems for c/src/lib/libbsp/i386


Ignore:
Timestamp:
Jun 9, 2017, 1:42:36 PM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
86c1004
Parents:
cb0d9a0
git-author:
Sebastian Huber <sebastian.huber@…> (06/09/17 13:42:36)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/12/17 06:01:58)
Message:

i386: Support thread-local storage (TLS)

Update #2468.

Location:
c/src/lib/libbsp/i386
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/i386/pc386/include/tblsizes.h

    rcb0d9a0 r7b0c74ff  
    2121
    2222#define IDT_SIZE (256)
    23 #define GDT_SIZE (3 + NUM_APP_DRV_GDT_DESCRIPTORS)
     23#define NUM_SYSTEM_GDT_DESCRIPTORS 4
     24#define GDT_SIZE (NUM_SYSTEM_GDT_DESCRIPTORS + NUM_APP_DRV_GDT_DESCRIPTORS)
  • c/src/lib/libbsp/i386/pc386/startup/ldsegs.S

    rcb0d9a0 r7b0c74ff  
    172172| GDT itself
    173173+--------------------------------------------------------------------------*/
    174 #if GDT_SIZE < 3
    175 #error "GDT_SIZE must be at least 3"
     174#if GDT_SIZE < NUM_SYSTEM_GDT_DESCRIPTORS
     175#error "GDT_SIZE must be at least NUM_SYSTEM_GDT_DESCRIPTORS"
    176176#endif
    177177
     
    194194        .byte 0, 0x92, 0xcf, 0
    195195
     196        /* gs segment */
     197        .word 0xffff, 0
     198        .byte 0, 0x92, 0xcf, 0
     199
    196200        /* allocated space for user segments */
    197         .rept (GDT_SIZE - 3)
     201        .rept (GDT_SIZE - NUM_SYSTEM_GDT_DESCRIPTORS)
    198202        .word 0,0,0,0
    199203        .endr
  • c/src/lib/libbsp/i386/shared/irq/idt.c

    rcb0d9a0 r7b0c74ff  
    1919#include <rtems/score/cpu.h>
    2020#include <bsp/irq.h>
     21#include <bsp/tblsizes.h>
    2122
    2223/*
     
    332333    segment_descriptors*    gdt_entry_tbl;
    333334    /* initial amount of filled descriptors */
    334     static uint16_t         segment_selector_index = 2;
     335    static uint16_t         segment_selector_index = NUM_SYSTEM_GDT_DESCRIPTORS - 1;
    335336
    336337    segment_selector_index += 1;
Note: See TracChangeset for help on using the changeset viewer.