Displaying 8 results from an estimated 8 matches for "ldt_segment".
Did you mean:
get_segment
2007 Apr 18
1
[PATCH 6/14] i386 / Add some segment convenience functions
...--- linux-2.6.13.orig/include/asm-i386/segment.h 2005-08-09 19:36:36.000000000 -0700
+++ linux-2.6.13/include/asm-i386/segment.h 2005-08-09 19:43:47.000000000 -0700
@@ -98,4 +98,14 @@
*/
#define IDT_ENTRIES 256
+/*
+ * This bit is set to indicate segment selectors are in the LDT
+ */
+#define LDT_SEGMENT 4
+
+#ifndef __ASSEMBLY__
+#define segment_index(seg) ((seg) >> 3)
+#define segment_from_ldt(seg) ((seg) & LDT_SEGMENT)
+#endif
+
#endif
Index: linux-2.6.13/arch/i386/kernel/ptrace.c
===================================================================
--- linux-2.6.13.orig/arch/i386/kerne...
2007 Apr 18
1
[PATCH 6/14] i386 / Add some segment convenience functions
...--- linux-2.6.13.orig/include/asm-i386/segment.h 2005-08-09 19:36:36.000000000 -0700
+++ linux-2.6.13/include/asm-i386/segment.h 2005-08-09 19:43:47.000000000 -0700
@@ -98,4 +98,14 @@
*/
#define IDT_ENTRIES 256
+/*
+ * This bit is set to indicate segment selectors are in the LDT
+ */
+#define LDT_SEGMENT 4
+
+#ifndef __ASSEMBLY__
+#define segment_index(seg) ((seg) >> 3)
+#define segment_from_ldt(seg) ((seg) & LDT_SEGMENT)
+#endif
+
#endif
Index: linux-2.6.13/arch/i386/kernel/ptrace.c
===================================================================
--- linux-2.6.13.orig/arch/i386/kerne...
2007 Apr 18
0
[PATCH 17/21] i386 Ldt cleanups 1
...ork/arch/i386/kernel/entry.S 2005-11-04 18:22:07.000000000 -0800
@@ -250,8 +250,8 @@ restore_all:
# See comments in process.c:copy_thread() for details.
movb OLDSS(%esp), %ah
movb CS(%esp), %al
- andl $(VM_MASK | (4 << 8) | 3), %eax
- cmpl $((4 << 8) | 3), %eax
+ andl $(VM_MASK | (LDT_SEGMENT << 8) | 3), %eax
+ cmpl $((LDT_SEGMENT << 8) | 3), %eax
je ldt_ss # returning to user-space with LDT SS
restore_nocheck:
RESTORE_REGS
Index: linux-2.6.14-zach-work/arch/i386/kernel/ptrace.c
===================================================================
--- linux-2.6.14-zach-...
2007 Apr 18
0
[PATCH 17/21] i386 Ldt cleanups 1
...ork/arch/i386/kernel/entry.S 2005-11-04 18:22:07.000000000 -0800
@@ -250,8 +250,8 @@ restore_all:
# See comments in process.c:copy_thread() for details.
movb OLDSS(%esp), %ah
movb CS(%esp), %al
- andl $(VM_MASK | (4 << 8) | 3), %eax
- cmpl $((4 << 8) | 3), %eax
+ andl $(VM_MASK | (LDT_SEGMENT << 8) | 3), %eax
+ cmpl $((LDT_SEGMENT << 8) | 3), %eax
je ldt_ss # returning to user-space with LDT SS
restore_nocheck:
RESTORE_REGS
Index: linux-2.6.14-zach-work/arch/i386/kernel/ptrace.c
===================================================================
--- linux-2.6.14-zach-...
2007 Apr 18
0
[PATCH 18/21] i386 Ldt cleanups 2
...linux-2.6.14-zach-work/include/asm-i386/desc.h 2005-11-05 00:28:03.000000000 -0800
@@ -30,7 +30,24 @@ static inline struct desc_struct *get_cp
{
return ((struct desc_struct *)cpu_gdt_descr[cpu].address);
}
-
+
+static inline int segment_from_ldt(unsigned int segment)
+{
+ return segment & LDT_SEGMENT;
+}
+
+static inline struct desc_struct *get_gdt_desc(int cpu, unsigned int segment)
+{
+ char *gdt = (char *)get_cpu_gdt_table(cpu);
+ return (struct desc_struct *)&gdt[segment & ~7];
+}
+
+static inline struct desc_struct *get_ldt_desc(mm_context_t *ctx, unsigned int segment)
+{
+ char *l...
2007 Apr 18
0
[PATCH 18/21] i386 Ldt cleanups 2
...linux-2.6.14-zach-work/include/asm-i386/desc.h 2005-11-05 00:28:03.000000000 -0800
@@ -30,7 +30,24 @@ static inline struct desc_struct *get_cp
{
return ((struct desc_struct *)cpu_gdt_descr[cpu].address);
}
-
+
+static inline int segment_from_ldt(unsigned int segment)
+{
+ return segment & LDT_SEGMENT;
+}
+
+static inline struct desc_struct *get_gdt_desc(int cpu, unsigned int segment)
+{
+ char *gdt = (char *)get_cpu_gdt_table(cpu);
+ return (struct desc_struct *)&gdt[segment & ~7];
+}
+
+static inline struct desc_struct *get_ldt_desc(mm_context_t *ctx, unsigned int segment)
+{
+ char *l...
2007 Apr 18
2
[PATCH 19/21] i386 Kprobes semaphore fix
...gdt_desc(get_cpu(), seg);
+ flags = 0; /* silence compiler */
}
- /*
- * We'll assume that the code segments in the GDT
- * are all zero-based. That is largely true: the
- * TLS segments are used for data, and the PNPBIOS
- * and APM bios ones we just ignore here.
- */
- if (seg & LDT_SEGMENT) {
- u32 *desc;
- unsigned long base;
-
- down(&child->mm->context.sem);
- desc = child->mm->context.ldt + (seg & ~7);
- base = (desc[0] >> 16) | ((desc[1] & 0xff) << 16) | (desc[1] & 0xff000000);
-
- /* 16-bit code segment? */
- if (!((desc[1] >>...
2007 Apr 18
2
[PATCH 19/21] i386 Kprobes semaphore fix
...gdt_desc(get_cpu(), seg);
+ flags = 0; /* silence compiler */
}
- /*
- * We'll assume that the code segments in the GDT
- * are all zero-based. That is largely true: the
- * TLS segments are used for data, and the PNPBIOS
- * and APM bios ones we just ignore here.
- */
- if (seg & LDT_SEGMENT) {
- u32 *desc;
- unsigned long base;
-
- down(&child->mm->context.sem);
- desc = child->mm->context.ldt + (seg & ~7);
- base = (desc[0] >> 16) | ((desc[1] & 0xff) << 16) | (desc[1] & 0xff000000);
-
- /* 16-bit code segment? */
- if (!((desc[1] >>...