Changeset 49a39c2 in mainline for arch/amd64/src/pm.c


Ignore:
Timestamp:
2006-02-06T21:14:29Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8a1da55
Parents:
7febdde5
Message:

Preliminary work on AMD userspace.

File:
1 edited

Legend:

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

    r7febdde5 r49a39c2  
    11/*
    22 * Copyright (C) 2001-2004 Jakub Jermar
     3 * Copyright (C) 2005-2006 Ondrej Palkovsky
    34 * All rights reserved.
    45 *
     
    168169                d->type = AR_INTERRUPT; /* masking interrupt */
    169170
    170                 if (i == VECTOR_SYSCALL) {
    171                         /*
    172                          * The syscall interrupt gate must be calleable from userland.
    173                          */
    174                         d->dpl |= PL_USER;
    175                 }
    176                
    177171                idt_setoffset(d, ((__address) interrupt_handlers) + i*interrupt_handler_size);
    178                 exc_register(i, "undef", null_interrupt);
     172                exc_register(i, "undef", (iroutine)null_interrupt);
    179173        }
    180174        exc_register(13, "gp_fault", gp_fault);
     
    183177}
    184178
    185 
    186 /* Clean IOPL(12,13) and NT(14) flags in EFLAGS register */
    187 static void clean_IOPL_NT_flags(void)
    188 {
    189         asm
    190         (
    191                 "pushfq;"
    192                 "pop %%rax;"
    193                 "and $~(0x7000),%%rax;"
    194                 "pushq %%rax;"
    195                 "popfq;"
    196                 :
    197                 :
    198                 :"%rax"
    199         );
    200 }
    201 
    202 /* Clean AM(18) flag in CR0 register */
    203 static void clean_AM_flag(void)
    204 {
    205         asm
    206         (
    207                 "mov %%cr0,%%rax;"
    208                 "and $~(0x40000),%%rax;"
    209                 "mov %%rax,%%cr0;"
    210                 :
    211                 :
    212                 :"%rax"
    213         );
    214 }
    215 
     179/** Initialize segmentation - code/data/idt tables
     180 *
     181 */
    216182void pm_init(void)
    217183{
     
    255221         */
    256222        __asm__("ltr %0" : : "r" ((__u16) gdtselector(TSS_DES)));
    257        
    258         clean_IOPL_NT_flags();    /* Disable I/O on nonprivileged levels */
    259         clean_AM_flag();          /* Disable alignment check */
    260 }
     223}
Note: See TracChangeset for help on using the changeset viewer.