X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fuserprog%2Fgdt.c;h=c1228495499c664a00b60092c57003a5c6cef23f;hb=c7172468133f9f739b66d22f351b1934d1b6190e;hp=e3e1ddea4a3e82baa10cbc318230fc6c2d380fac;hpb=c138343c83fdd0ab9feb99f5116f8515d0f5690d;p=pintos-anon diff --git a/src/userprog/gdt.c b/src/userprog/gdt.c index e3e1dde..c122849 100644 --- a/src/userprog/gdt.c +++ b/src/userprog/gdt.c @@ -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) {