3 static char RCSId[] = "$Id: ldt.c,v 1.2 1993/07/04 04:04:21 root Exp root $";
4 static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
10 #include "prototypes.h"
12 #if defined(__NetBSD__) || defined(__FreeBSD__)
13 #include <machine/segments.h>
16 /**********************************************************************
19 /* XXX These are *real* 386 descriptors !! */
25 unsigned long base_addr
, limit
;
27 #if defined(__NetBSD__) || defined(__FreeBSD__)
28 struct segment_descriptor
*sd
;
31 if (get_ldt(buffer
) < 0)
34 lp
= (unsigned long *) buffer
;
35 #if defined(__NetBSD__) || defined(__FreeBSD__)
36 sd
= (struct segment_descriptor
*) buffer
;
39 for (i
= 0; i
< 32; i
++, lp
++)
41 /* First 32 bits of descriptor */
42 base_addr
= (*lp
>> 16) & 0x0000FFFF;
43 limit
= *lp
& 0x0000FFFF;
46 /* First 32 bits of descriptor */
47 base_addr
|= (*lp
& 0xFF000000) | ((*lp
<< 16) & 0x00FF0000);
48 limit
|= (*lp
& 0x000F0000);
50 type
= (*lp
>> 10) & 5;
51 dpl
= (*lp
>> 13) & 3;
53 #if defined(__NetBSD__) || defined(__FreeBSD__)
60 printf("Entry %2d: Base %08lx, Limit %05lx, DPL %d, Type %d\n",
61 i
, base_addr
, limit
, dpl
, type
);
76 printf("page limit, ");
78 printf("byte limit, ");
80 printf(" %08lx %08lx\n", *(lp
), *(lp
-1));
84 printf("Entry %2d: Base %08lx, Limit %05lx, DPL %d, Type %d\n",
85 i
, base_addr
, limit
, dpl
, type
);
86 printf(" SYSTEM: %08lx %08lx\n", *lp
, *(lp
-1));
91 #endif /* ifndef WINELIB */