Changeset 11370
- Timestamp:
- Nov 16, 2008, 10:58:10 AM (12 years ago)
- Location:
- trunk/source/lisp-kernel
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/lisp-kernel/thread_manager.c
r11345 r11370 1103 1103 1104 1104 /* It'd be tempting to use i386_set_fsbase() here, but there doesn't 1105 seem to be any way to free the GDT entry it creates. */ 1105 seem to be any way to free the GDT entry it creates. Actually, 1106 it's not clear that that really sets a GDT entry; let's see */ 1107 1108 #define FREEBSD_USE_SET_FSBASE 1 1106 1109 void 1107 1110 setup_tcr_extra_segment(TCR *tcr) 1108 1111 { 1112 #if !FREEBSD_USE_SET_FSBASE 1109 1113 struct segment_descriptor sd; 1110 1114 uintptr_t addr = (uintptr_t)tcr; … … 1116 1120 sd.sd_lobase = addr & ((1<<24)-1); 1117 1121 sd.sd_hibase = (addr>>24)&0xff; 1122 1123 1124 1118 1125 sd.sd_type = 18; 1119 1126 sd.sd_dpl = SEL_UPL; … … 1130 1137 tcr->ldt_selector = LSEL(i,SEL_UPL); 1131 1138 } 1139 #else 1140 if (i386_set_fsbase((void*)tcr)) { 1141 perror("i386_set_fsbase"); 1142 exit(1); 1143 } 1144 /* Once we've called i386_set_fsbase, we can't write to %fs. */ 1145 tcr->ldt_selector = GSEL(GUFS_SEL, SEL_UPL); 1146 #endif 1132 1147 } 1133 1148 … … 1135 1150 free_tcr_extra_segment(TCR *tcr) 1136 1151 { 1152 #if FREEBSD_USE_SET_FSBASE 1153 /* On a 32-bit kernel, this allocates a GDT entry. It's not clear 1154 what it would mean to deallocate that entry. */ 1155 /* If we're running on a 64-bit kernel, we can't write to %fs */ 1156 #else 1137 1157 int idx = tcr->ldt_selector >> 3; 1138 1158 /* load %fs with null segment selector */ … … 1140 1160 if (i386_set_ldt(idx, NULL, 1) < 0) 1141 1161 perror("i386_set_ldt"); 1162 #endif 1142 1163 tcr->ldt_selector = 0; 1143 1164 } 1144 1165 #endif 1166 1145 1167 #ifdef SOLARIS 1146 1168 #include <sys/sysi86.h> -
trunk/source/lisp-kernel/x86-spentry32.s
r11315 r11370 4263 4263 __(push %ebp) 4264 4264 __(box_fixnum(%eax,%esi)) /* put callback index in arg_y */ 4265 __(ref_global(get_tcr,%eax)) 4266 __(subl $12,%esp) /* alignment */ 4267 __(push $1) /* stack now 16-byte aligned */ 4268 __(call *%eax) 4269 __(addl $16,%esp) /* discard arg, alignment words */ 4270 /* linear TCR addr now in %eax */ 4271 __(movw tcr.ldt_selector(%eax), %rcontext_reg) 4265 __ifndef([FREEBSD]) 4266 __(ref_global(get_tcr,%eax)) 4267 __(subl $12,%esp) /* alignment */ 4268 __(push $1) /* stack now 16-byte aligned */ 4269 __(call *%eax) 4270 __(addl $16,%esp) /* discard arg, alignment words */ 4271 /* linear TCR addr now in %eax */ 4272 __(movw tcr.ldt_selector(%eax), %rcontext_reg) 4273 __endif 4272 4274 4273 4275 /* ebp is 16-byte aligned, and we've pushed 4 words. Make -
trunk/source/lisp-kernel/x86-subprims32.s
r11229 r11370 75 75 __(push %ebx) 76 76 __(mov 8(%ebp), %ebx) /* get tcr */ 77 __(movw tcr.ldt_selector(%ebx), %rcontext_reg) 77 __ifndef([FREEBSD]) 78 __(movw tcr.ldt_selector(%ebx), %rcontext_reg) 79 __endif 78 80 __(movl 8(%ebp),%eax) 79 81 __(cmpl rcontext(tcr.linear),%eax)
Note: See TracChangeset
for help on using the changeset viewer.