Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/src/pm.c

    r44a7ee5 ra35b458  
    130130{
    131131        tss_descriptor_t *td = (tss_descriptor_t *) d;
    132        
     132
    133133        td->base_0_15 = base & 0xffffU;
    134134        td->base_16_23 = ((base) >> 16) & 0xffU;
     
    140140{
    141141        tss_descriptor_t *td = (tss_descriptor_t *) d;
    142        
     142
    143143        td->limit_0_15 = limit & 0xffffU;
    144144        td->limit_16_19 = (limit >> 16) & 0x0fU;
     
    167167        idescriptor_t *d;
    168168        unsigned int i;
    169        
     169
    170170        for (i = 0; i < IDT_ITEMS; i++) {
    171171                d = &idt[i];
    172                
     172
    173173                d->unused = 0;
    174174                d->selector = GDT_SELECTOR(KTEXT_DES);
    175                
     175
    176176                d->present = 1;
    177177                d->type = AR_INTERRUPT;  /* masking interrupt */
    178178        }
    179        
     179
    180180        d = &idt[0];
    181181        idt_setoffset(d++, (uintptr_t) &int_0);
     
    252252        descriptor_t *gdt_p = (descriptor_t *) gdtr.base;
    253253        tss_descriptor_t *tss_desc;
    254        
     254
    255255        /*
    256256         * Each CPU has its private GDT and TSS.
    257257         * All CPUs share one IDT.
    258258         */
    259        
     259
    260260        if (config.cpu_active == 1) {
    261261                idt_init();
     
    270270                 * ahead of page_init */
    271271                write_cr3((uintptr_t) AS_KERNEL->genarch.page_table);
    272                
     272
    273273                tss_p = (tss_t *) malloc(sizeof(tss_t), FRAME_ATOMIC);
    274274                if (!tss_p)
    275275                        panic("Cannot allocate TSS.");
    276276        }
    277        
     277
    278278        tss_initialize(tss_p);
    279        
     279
    280280        tss_desc = (tss_descriptor_t *) (&gdt_p[TSS_DES]);
    281281        tss_desc->present = 1;
    282282        tss_desc->type = AR_TSS;
    283283        tss_desc->dpl = PL_KERNEL;
    284        
     284
    285285        gdt_tss_setbase(&gdt_p[TSS_DES], (uintptr_t) tss_p);
    286286        gdt_tss_setlimit(&gdt_p[TSS_DES], TSS_BASIC_SIZE - 1);
    287        
     287
    288288        gdtr_load(&gdtr);
    289289        idtr_load(&idtr);
Note: See TracChangeset for help on using the changeset viewer.