Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Jul 2006 11:02:14 GMT
From:      Roman Divacky <rdivacky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 100717 for review
Message-ID:  <200607061102.k66B2EfU063881@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=100717

Change 100717 by rdivacky@rdivacky_witten on 2006/07/06 11:01:59

	BSDL version of the segment translation macros.

Affected files ...

.. //depot/projects/soc2006/rdivacky_linuxolator/i386/linux/linux.h#5 edit

Differences ...

==== //depot/projects/soc2006/rdivacky_linuxolator/i386/linux/linux.h#5 (text+ko) ====

@@ -718,4 +718,55 @@
 	l_uint		useable:1;
 };
 
+#define LINUX_LOWERWORD	0x0000ffff
+
+/* macros which does the same thing as those in linux include/asm-um/ldt-i386.h 
+ * these convert linux user-space descriptor to machine one
+ */
+#define LDT_entry_a(info) \
+        ((((info)->base_addr & LINUX_LOWERWORD) << 16) | ((info)->limit & LINUX_LOWERWORD))
+
+#define ENTRY_B_READ_EXEC_ONLY	9
+#define ENTRY_B_CONTENTS	10
+#define ENTRY_B_SEG_NOT_PRESENT	15
+#define ENTRY_B_BASE_ADDR	16
+#define ENTRY_B_USEABLE		20
+#define ENTRY_B_SEG32BIT	22
+#define ENTRY_B_LIMIT		23
+
+#define LDT_entry_b(info) \
+        (((info)->base_addr & 0xff000000) | \
+        ((info)->limit & 0xf0000) | \
+        ((info)->contents << ENTRY_B_CONTENTS) | \
+        (((info)->seg_not_present == 0) << ENTRY_B_SEG_NOT_PRESENT) | \
+        (((info)->base_addr & 0x00ff0000) >> ENTRY_B_BASE_ADDR) | \
+        (((info)->read_exec_only == 0) << ENTRY_B_READ_EXEC_ONLY) | \
+        ((info)->seg_32bit << ENTRY_B_SEG32BIT) | \
+        ((info)->useable << ENTRY_B_USEABLE) | \
+        ((info)->limit_in_pages << ENTRY_B_LIMIT) | 0x7000)
+
+#define LDT_empty(info) (\
+        (info)->base_addr       == 0    && \
+        (info)->limit           == 0    && \
+        (info)->contents        == 0    && \
+        (info)->seg_not_present == 1    && \
+        (info)->read_exec_only  == 1    && \
+        (info)->seg_32bit       == 0    && \
+        (info)->limit_in_pages  == 0    && \
+        (info)->useable         == 0    )
+
+/* modeled after similar structure in NetBSD 
+ * this will be extended as we need more functionality
+ */
+struct linux_emuldata {
+   	pid_t	pid;
+
+	int *child_set_tid;     /* in clone(): Child's TID to set on clone */
+	int *child_clear_tid;   /* in clone(): Child's TID to clear on exit */
+	int *set_tid;           /* in clone(): Own TID to set on clone */
+	int *clear_tid;         /* Own TID to clear on exit */
+
+	SLIST_ENTRY(linux_emuldata) emuldatas;
+};
+
 #endif /* !_I386_LINUX_LINUX_H_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607061102.k66B2EfU063881>