Changeset 99d6fd0 in mainline for kernel/arch/amd64/src/pm.c


Ignore:
Timestamp:
2009-03-13T12:57:15Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
421c833
Parents:
0160b1c8
Message:

cleanup pm.h and related stuff (no change in functionality)

File:
1 edited

Legend:

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

    r0160b1c8 r99d6fd0  
    138138void gdt_tss_setlimit(descriptor_t *d, uint32_t limit)
    139139{
    140         struct tss_descriptor *td = (tss_descriptor_t *) d;
    141 
     140        tss_descriptor_t *td = (tss_descriptor_t *) d;
     141       
    142142        td->limit_0_15 = limit & 0xffff;
    143143        td->limit_16_19 = (limit >> 16) & 0xf;
     
    186186void pm_init(void)
    187187{
    188         descriptor_t *gdt_p = (struct descriptor *) gdtr.base;
     188        descriptor_t *gdt_p = (descriptor_t *) gdtr.base;
    189189        tss_descriptor_t *tss_desc;
    190 
     190       
    191191        /*
    192192         * Each CPU has its private GDT and TSS.
    193193         * All CPUs share one IDT.
    194194         */
    195 
     195       
    196196        if (config.cpu_active == 1) {
    197197                idt_init();
     
    201201                 */
    202202                tss_p = &tss;
    203         }
    204         else {
     203        } else {
    205204                /* We are going to use malloc, which may return
    206205                 * non boot-mapped pointer, initialize the CR3 register
    207206                 * ahead of page_init */
    208207                write_cr3((uintptr_t) AS_KERNEL->genarch.page_table);
    209 
    210                 tss_p = (struct tss *) malloc(sizeof(tss_t), FRAME_ATOMIC);
     208               
     209                tss_p = (tss_t *) malloc(sizeof(tss_t), FRAME_ATOMIC);
    211210                if (!tss_p)
    212211                        panic("Cannot allocate TSS.");
    213212        }
    214 
     213       
    215214        tss_initialize(tss_p);
    216 
     215       
    217216        tss_desc = (tss_descriptor_t *) (&gdt_p[TSS_DES]);
    218217        tss_desc->present = 1;
     
    222221        gdt_tss_setbase(&gdt_p[TSS_DES], (uintptr_t) tss_p);
    223222        gdt_tss_setlimit(&gdt_p[TSS_DES], TSS_BASIC_SIZE - 1);
    224 
     223       
    225224        gdtr_load(&gdtr);
    226225        idtr_load(&idtr);
Note: See TracChangeset for help on using the changeset viewer.