X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fuserprog%2Fgdt.c;h=42cad61449265c0e1179dfaf0dbc03b57c3010c0;hb=ff8effb2f514ca54a594074e1cc33b22a1978050;hp=e3e1ddea4a3e82baa10cbc318230fc6c2d380fac;hpb=6c5c6fdfe80bad40c90c19b67f00226610d59a38;p=pintos-anon diff --git a/src/userprog/gdt.c b/src/userprog/gdt.c index e3e1dde..42cad61 100644 --- a/src/userprog/gdt.c +++ b/src/userprog/gdt.c @@ -1,8 +1,8 @@ -#include "gdt.h" -#include "debug.h" -#include "mmu.h" -#include "palloc.h" -#include "tss.h" +#include "userprog/gdt.h" +#include +#include "userprog/tss.h" +#include "threads/mmu.h" +#include "threads/palloc.h" /* The Global Descriptor Table (GDT). @@ -44,7 +44,7 @@ gdt_init (void) gdt[SEL_UDSEG / sizeof *gdt] = make_data_desc (3); gdt[SEL_TSS / sizeof *gdt] = make_tss_desc (tss_get ()); - /* Load GDTR, TR. */ + /* Load GDTR, TR. See [IA32-v3] 2.4.1, 2.4.4, 6.2.3. */ gdtr_operand = make_gdtr_operand (sizeof gdt - 1, gdt); asm volatile ("lgdt %0" :: "m" (gdtr_operand)); asm volatile ("ltr %w0" :: "r" (SEL_TSS)); @@ -125,7 +125,8 @@ make_data_desc (int dpl) /* Returns a descriptor for an "available" 32-bit Task-State Segment with its base at the given linear address, a limit of - 0x67 bytes (the size of a 32-bit TSS), and a DPL of 0. */ + 0x67 bytes (the size of a 32-bit TSS), and a DPL of 0. + See [IA32-v3] 6.2.2. */ static uint64_t make_tss_desc (void *laddr) {