Displaying 4 results from an estimated 4 matches for "get_gdt_desc".
2007 Apr 18
0
[PATCH 18/21] i386 Ldt cleanups 2
...1-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 *ldt = (char *)ctx->ldt;
+ return (struct desc_struct...
2007 Apr 18
0
[PATCH 18/21] i386 Ldt cleanups 2
...1-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 *ldt = (char *)ctx->ldt;
+ return (struct desc_struct...
2007 Apr 18
2
[PATCH 19/21] i386 Kprobes semaphore fix
...his unfortunate mess is needed to deal with int3
+ * kprobes which enter with IRQs disabled.
+ */
+ local_save_flags(flags);
+ local_irq_enable();
+ down(&context->sem);
+ desc = get_ldt_desc(context, seg);
+ } else {
+ /* Must disable preemption while reading the GDT. */
+ desc = get_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_SEGM...
2007 Apr 18
2
[PATCH 19/21] i386 Kprobes semaphore fix
...his unfortunate mess is needed to deal with int3
+ * kprobes which enter with IRQs disabled.
+ */
+ local_save_flags(flags);
+ local_irq_enable();
+ down(&context->sem);
+ desc = get_ldt_desc(context, seg);
+ } else {
+ /* Must disable preemption while reading the GDT. */
+ desc = get_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_SEGM...