Changeset 281b607 in mainline for arch/ia32/src/pm.c
- Timestamp:
- 2006-03-23T10:29:39Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a0bb10ef
- Parents:
- 9aa72b4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia32/src/pm.c
r9aa72b4 r281b607 49 49 * mode, we use, for each privilege level, two segments spanning the 50 50 * whole memory. One is for code and one is for data. 51 * 52 * One is for GS register which holds pointer to the TLS thread 53 * structure in it's base. 51 54 */ 52 55 struct descriptor gdt[GDT_ITEMS] = { … … 62 65 { 0xffff, 0, 0, AR_PRESENT | AR_DATA | AR_WRITABLE | DPL_USER, 0xf, 0, 0, 1, 1, 0 }, 63 66 /* TSS descriptor - set up will be completed later */ 64 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } 67 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, 68 { 0xffff, 0, 0, AR_PRESENT | AR_DATA | AR_WRITABLE | DPL_USER, 0xf, 0, 0, 1, 1, 0 } 65 69 }; 66 70 … … 215 219 clean_AM_flag(); /* Disable alignment check */ 216 220 } 221 222 void set_tls_desc(__address tls) 223 { 224 struct ptr_16_32 cpugdtr; 225 struct descriptor *gdt_p = (struct descriptor *) cpugdtr.base; 226 227 __asm__ volatile ("sgdt %0\n" : : "m" (cpugdtr)); 228 229 gdt_setbase(&gdt_p[TLS_DES], tls); 230 /* Reload gdt register to update GS in CPU */ 231 __asm__ volatile ("lgdt %0\n" : : "m" (cpugdtr)); 232 }
Note:
See TracChangeset
for help on using the changeset viewer.