Changeset 49a39c2 in mainline for arch/amd64/src/pm.c
- Timestamp:
- 2006-02-06T21:14:29Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8a1da55
- Parents:
- 7febdde5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/amd64/src/pm.c
r7febdde5 r49a39c2 1 1 /* 2 2 * Copyright (C) 2001-2004 Jakub Jermar 3 * Copyright (C) 2005-2006 Ondrej Palkovsky 3 4 * All rights reserved. 4 5 * … … 168 169 d->type = AR_INTERRUPT; /* masking interrupt */ 169 170 170 if (i == VECTOR_SYSCALL) {171 /*172 * The syscall interrupt gate must be calleable from userland.173 */174 d->dpl |= PL_USER;175 }176 177 171 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); 179 173 } 180 174 exc_register(13, "gp_fault", gp_fault); … … 183 177 } 184 178 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 */ 216 182 void pm_init(void) 217 183 { … … 255 221 */ 256 222 __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.