Changeset 164


Ignore:
Timestamp:
Jul 7, 2017, 3:22:59 PM (7 years ago)
Author:
max@…
Message:

we're gonna use an array of TSSs

Location:
trunk/hal/x86_64/core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/x86_64/core/hal_init.c

    r162 r164  
    440440 * The gdt bitmap must be per-cluster.
    441441 */
    442 int tss_alloc(struct tss *tss)
     442int tss_alloc(struct tss *tss, size_t lid)
    443443{
    444444        int slot;
    445445
    446446        /* Once we have proper SMP support, we will change that */
    447         slot = GDT_CPU0TSS_SEL;
     447        slot = GDT_CPUTSS_SEL + lid;
    448448
    449449        gdt_set_sysseg(GDT_ADDR_SYS(gdtstore, slot), tss,
     
    466466        tss->tss_ist[2] = (uint64_t)cpu_nmfl_stack[lid] + STKSIZE;
    467467        tss->tss_iobase = IOMAP_INVALOFF << 16;
    468         sel = tss_alloc(tss);
     468        sel = tss_alloc(tss, lid);
    469469
    470470        /* Load it */
  • trunk/hal/x86_64/core/hal_segmentation.h

    r162 r164  
    3131#define NGDT_MEM        6       /* aligned */
    3232
    33 #define GDT_CPU0TSS_SEL 0       /* cpu0's tss */
    34 #define NGDT_DYN        (256 - (NGDT_MEM / 2) * 16)
     33#define GDT_CPUTSS_SEL  0       /* cpu TSS base index */
     34#define NGDT_DYN        CONFIG_MAX_LOCAL_CORES  /* one TSS per core */
    3535
    3636/*
Note: See TracChangeset for help on using the changeset viewer.