[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Mach's interface for modifying the LDT

From: Jeroen Dekkers
Subject: [PATCH] Mach's interface for modifying the LDT
Date: Sun, 23 Dec 2001 13:42:49 +0100
User-agent: Mutt/1.3.24i

I'm hacking pthreads to allow placing stacks anywhere in memory. For the
thread specific data I'm using a segment register as suggest some months
ago on this list. The mach functions i386_get_ldt() and i386_set_ldt()
are used to modify the LDT. Should those i386-specific functions go into
libmachuser or should they go somewhere else?

I'm proposing to change the members of struct descriptor used by
i386_[gs]et_ldt() to allow easy modification of the contents. I got the
member names from paragraph 3.4.3 "Segment Descriptors" of the "IA-32
Architecture Software Developer's Manual Volume 3." The size of the
structure is the same and the members of the structure are nowhere used
so this change shouldn't break anything AFAICS.

2001-12-23  Jeroen Dekkers  <jeroen@dekkers.cx>

        * i386/include/mach/i386/mach_i386_types.h (struct descriptor):
        Change the members to match the contents of the structure.

Index: i386/include/mach/i386/mach_i386_types.h
RCS file: /cvsroot/hurd/gnumach/i386/include/mach/i386/mach_i386_types.h,v
retrieving revision
diff -u -p -r1.1.1.1 mach_i386_types.h
--- i386/include/mach/i386/mach_i386_types.h    25 Feb 1997 21:27:00 -0000
+++ i386/include/mach/i386/mach_i386_types.h    23 Dec 2001 12:25:28 -0000
@@ -39,9 +39,20 @@ typedef      device_t        *device_list_t;
  * i386 segment descriptor.
 struct descriptor {
-       unsigned int    low_word;
-       unsigned int    high_word;
+  unsigned limit_low:16;
+  unsigned base_low:16;
+  unsigned base_med:8;
+  unsigned type:4;
+  unsigned desc_type:1;
+  unsigned dpl:2;
+  unsigned present:1;
+  unsigned limit_high:4;
+  unsigned available:1;
+  unsigned reserved:1;
+  unsigned operationsize:1;
+  unsigned granularity:1;
+  unsigned base_high:8;
+} __attribute__ ((packed));
 typedef struct descriptor descriptor_t;
 typedef        struct descriptor *descriptor_list_t;

Jabber supporter - http://www.jabber.org Jabber ID: jdekkers@jabber.org
Debian GNU supporter - http://www.debian.org http://www.gnu.org
IRC: jeroen@openprojects.net

Attachment: pgpn0jbk5lrvg.pgp
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]