comparison loader/ldt_keeper.c @ 15566:3758536dcef3

DragonFly BSD support patch by Joerg Sonnenberger <joerg - at - britannica - dot - bec - dot - de>
author diego
date Wed, 25 May 2005 08:48:32 +0000
parents f5537cc95b02
children dcc1be050037
comparison
equal deleted inserted replaced
15565:1c1c7cd29707 15566:3758536dcef3
48 #endif 48 #endif
49 #ifdef __cplusplus 49 #ifdef __cplusplus
50 } 50 }
51 #endif 51 #endif
52 #else 52 #else
53 #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) 53 #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
54 #include <machine/segments.h> 54 #include <machine/segments.h>
55 #include <machine/sysarch.h> 55 #include <machine/sysarch.h>
56 #endif 56 #endif
57 57
58 #ifdef __svr4__ 58 #ifdef __svr4__
163 return -1; 163 return -1;
164 } 164 }
165 #endif 165 #endif
166 #endif 166 #endif
167 167
168 #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) 168 #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
169 static void LDT_EntryToBytes( unsigned long *buffer, const struct modify_ldt_ldt_s *content ) 169 static void LDT_EntryToBytes( unsigned long *buffer, const struct modify_ldt_ldt_s *content )
170 { 170 {
171 *buffer++ = ((content->base_addr & 0x0000ffff) << 16) | 171 *buffer++ = ((content->base_addr & 0x0000ffff) << 16) |
172 (content->limit & 0x0ffff); 172 (content->limit & 0x0ffff);
173 *buffer = (content->base_addr & 0xff000000) | 173 *buffer = (content->base_addr & 0xff000000) |
225 perror("install_fs"); 225 perror("install_fs");
226 printf("Couldn't install fs segment, expect segfault\n"); 226 printf("Couldn't install fs segment, expect segfault\n");
227 } 227 }
228 #endif /*linux*/ 228 #endif /*linux*/
229 229
230 #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) 230 #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
231 { 231 {
232 unsigned long d[2]; 232 unsigned long d[2];
233 233
234 LDT_EntryToBytes( d, &array ); 234 LDT_EntryToBytes( d, &array );
235 #if defined(__FreeBSD__) && defined(LDT_AUTO_ALLOC) 235 #if defined(__FreeBSD__) && defined(LDT_AUTO_ALLOC)
244 perror("install_fs"); 244 perror("install_fs");
245 printf("Couldn't install fs segment, expect segfault\n"); 245 printf("Couldn't install fs segment, expect segfault\n");
246 printf("Did you reconfigure the kernel with \"options USER_LDT\"?\n"); 246 printf("Did you reconfigure the kernel with \"options USER_LDT\"?\n");
247 } 247 }
248 } 248 }
249 #endif /* __NetBSD__ || __FreeBSD__ || __OpenBSD__ */ 249 #endif /* __NetBSD__ || __FreeBSD__ || __OpenBSD__ || __DragonFly__ */
250 250
251 #if defined(__svr4__) 251 #if defined(__svr4__)
252 { 252 {
253 struct ssd ssd; 253 struct ssd ssd;
254 ssd.sel = LDT_SEL(TEB_SEL_IDX); 254 ssd.sel = LDT_SEL(TEB_SEL_IDX);