Subversion Repositories HelenOS

Rev

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

Rev 3982 Rev 4017
Line 70... Line 70...
70
 *
70
 *
71
 * Clean IOPL(12,13) and NT(14) flags in EFLAGS register
71
 * Clean IOPL(12,13) and NT(14) flags in EFLAGS register
72
 */
72
 */
73
static void clean_IOPL_NT_flags(void)
73
static void clean_IOPL_NT_flags(void)
74
{
74
{
75
    asm (
75
    asm volatile (
76
        "pushfq\n"
76
        "pushfq\n"
77
        "pop %%rax\n"
77
        "pop %%rax\n"
78
        "and $~(0x7000), %%rax\n"
78
        "and $~(0x7000), %%rax\n"
79
        "pushq %%rax\n"
79
        "pushq %%rax\n"
80
        "popfq\n"
80
        "popfq\n"
81
        :
-
 
82
        :
-
 
83
        : "%rax"
81
        ::: "%rax"
84
    );
82
    );
85
}
83
}
86
 
84
 
87
/** Disable alignment check
85
/** Disable alignment check
88
 *
86
 *
89
 * Clean AM(18) flag in CR0 register
87
 * Clean AM(18) flag in CR0 register
90
 */
88
 */
91
static void clean_AM_flag(void)
89
static void clean_AM_flag(void)
92
{
90
{
93
    asm (
91
    asm volatile (
94
        "mov %%cr0, %%rax\n"
92
        "mov %%cr0, %%rax\n"
95
        "and $~(0x40000), %%rax\n"
93
        "and $~(0x40000), %%rax\n"
96
        "mov %%rax, %%cr0\n"
94
        "mov %%rax, %%cr0\n"
97
        :
-
 
98
        :
-
 
99
        : "%rax"
95
        ::: "%rax"
100
    );
96
    );
101
}
97
}
102
 
98
 
103
void arch_pre_mm_init(void)
99
void arch_pre_mm_init(void)
104
{
100
{