Subversion Repositories HelenOS

Rev

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

Rev 125 Rev 141
Line 126... Line 126...
126
    trap_register( 7, nm_fault);
126
    trap_register( 7, nm_fault);
127
    trap_register(12, ss_fault);
127
    trap_register(12, ss_fault);
128
}
128
}
129
 
129
 
130
 
130
 
-
 
131
 
-
 
132
static void clean_IOPL_NT_flags(void)
-
 
133
{
-
 
134
  asm
-
 
135
    (
-
 
136
    "pushfl;"
-
 
137
        "pop %%eax;"
-
 
138
        "and $0xffff8fff,%%eax;"
-
 
139
        "push %%eax;"
-
 
140
        "popfl;"
-
 
141
        :
-
 
142
        :
-
 
143
        :"%eax"
-
 
144
    );
-
 
145
}
-
 
146
 
-
 
147
 
-
 
148
 
-
 
149
 
131
void pm_init(void)
150
void pm_init(void)
132
{
151
{
133
    struct descriptor *gdt_p = (struct descriptor *) PA2KA(gdtr.base);
152
    struct descriptor *gdt_p = (struct descriptor *) PA2KA(gdtr.base);
134
 
153
 
135
    /*
154
    /*
Line 163... Line 182...
163
    /*
182
    /*
164
     * As of this moment, the current CPU has its own GDT pointing
183
     * As of this moment, the current CPU has its own GDT pointing
165
     * to its own TSS. We just need to load the TR register.
184
     * to its own TSS. We just need to load the TR register.
166
     */
185
     */
167
    __asm__("ltr %0" : : "r" ((__u16) selector(TSS_DES)));
186
    __asm__("ltr %0" : : "r" ((__u16) selector(TSS_DES)));
-
 
187
   
-
 
188
    clean_IOPL_NT_flags();
168
}
189
}