Subversion Repositories HelenOS

Rev

Rev 144 | Rev 195 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 144 Rev 167
Line 32... Line 32...
32
#include <typedefs.h>
32
#include <typedefs.h>
33
#include <arch/interrupt.h>
33
#include <arch/interrupt.h>
34
#include <arch/asm.h>
34
#include <arch/asm.h>
35
#include <arch/context.h>
35
#include <arch/context.h>
36
#include <panic.h>
36
#include <panic.h>
-
 
37
#include <arch/mm/page.h>
37
 
38
 
38
/*
39
/*
39
 * Early ia32 configuration functions and data structures.
40
 * Early ia32 configuration functions and data structures.
40
 */
41
 */
41
 
42
 
Line 129... Line 130...
129
 
130
 
130
 
131
 
131
/* Clean IOPL(12,13) and NT(14) flags in EFLAGS register */
132
/* Clean IOPL(12,13) and NT(14) flags in EFLAGS register */
132
static void clean_IOPL_NT_flags(void)
133
static void clean_IOPL_NT_flags(void)
133
{
134
{
134
  asm
135
    asm
135
    (
136
    (
136
    "pushfl;"
137
        "pushfl;"
137
        "pop %%eax;"
138
        "pop %%eax;"
138
        "and $0xffff8fff,%%eax;"
139
        "and $0xffff8fff,%%eax;"
139
        "push %%eax;"
140
        "push %%eax;"
140
        "popfl;"
141
        "popfl;"
141
        :
142
        :
Line 145... Line 146...
145
}
146
}
146
 
147
 
147
/* Clean AM(18) flag in CR0 register */
148
/* Clean AM(18) flag in CR0 register */
148
static void clean_AM_flag(void)
149
static void clean_AM_flag(void)
149
{
150
{
150
  asm
151
    asm
151
    (
152
    (
152
    "mov %%cr0,%%eax;"
153
        "mov %%cr0,%%eax;"
153
        "and $0xFFFBFFFF,%%eax;"
154
        "and $0xFFFBFFFF,%%eax;"
154
        "mov %%eax,%%cr0;"
155
        "mov %%eax,%%cr0;"
155
        :
156
        :
156
        :
157
        :
157
        :"%eax"
158
        :"%eax"
158
    );
159
    );
159
}
160
}
160
 
161
 
161
 
-
 
162
 
-
 
163
 
-
 
164
 
-
 
165
void pm_init(void)
162
void pm_init(void)
166
{
163
{
167
    struct descriptor *gdt_p = (struct descriptor *) PA2KA(gdtr.base);
164
    struct descriptor *gdt_p = (struct descriptor *) PA2KA(gdtr.base);
168
 
165
 
169
    /*
166
    /*