Displaying 10 results from an estimated 10 matches for "get_ldt_desc".
Did you mean:
set_ldt_desc
2007 Apr 18
0
[PATCH 18/21] i386 Ldt cleanups 2
...om_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 *)&ldt[segment & ~7];
+}
+
#define load_TR_desc() __asm__ __volatile__("ltr %w0"::"q" (GDT_ENTRY_TSS*8))
#define load_LDT_desc() __asm__ __volatile__("lldt...
2007 Apr 18
0
[PATCH 18/21] i386 Ldt cleanups 2
...om_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 *)&ldt[segment & ~7];
+}
+
#define load_TR_desc() __asm__ __volatile__("ltr %w0"::"q" (GDT_ENTRY_TSS*8))
#define load_LDT_desc() __asm__ __volatile__("lldt...
2007 Apr 18
1
[PATCH 4/14] i386 / Clean up asm and volatile keywords in desc
...ot; (tr))
+#define store_ldt(ldt) asm ("sldt %0":"=mr" (ldt))
static inline unsigned int get_TR_desc(void)
{
unsigned int tr;
- __asm__ ("str %w0":"=q" (tr));
+ asm ("str %w0":"=q" (tr));
return tr;
}
static inline unsigned int get_LDT_desc(void)
{
unsigned int ldt;
- __asm__ ("sldt %w0":"=q" (ldt));
+ asm ("sldt %w0":"=q" (ldt));
return ldt;
}
2007 Apr 18
1
[PATCH 4/14] i386 / Clean up asm and volatile keywords in desc
...ot; (tr))
+#define store_ldt(ldt) asm ("sldt %0":"=mr" (ldt))
static inline unsigned int get_TR_desc(void)
{
unsigned int tr;
- __asm__ ("str %w0":"=q" (tr));
+ asm ("str %w0":"=q" (tr));
return tr;
}
static inline unsigned int get_LDT_desc(void)
{
unsigned int ldt;
- __asm__ ("sldt %w0":"=q" (ldt));
+ asm ("sldt %w0":"=q" (ldt));
return ldt;
}
2007 Apr 18
0
[PATCH 11/12] subarch-desc
...store_tr(tr) asm ("str %0":"=mr" (tr))
+#define store_ldt(ldt) asm ("sldt %0":"=mr" (ldt))
+
+static inline unsigned int get_TR_desc(void)
+{
+ unsigned int tr;
+ __asm__ ("str %w0":"=q" (tr));
+ return tr;
+}
+
+static inline unsigned int get_LDT_desc(void)
+{
+ unsigned int ldt;
+ __asm__ ("sldt %w0":"=q" (ldt));
+ return ldt;
+}
+
+#define set_base(desc,base) _set_base((desc), (base))
+#define set_limit(desc,limit) _set_limit((desc), ((limit)-1)>>12)
+
+static inline void __set_tss_desc(unsigned int cpu, unsigned int...
2007 Apr 18
0
[PATCH 11/12] subarch-desc
...store_tr(tr) asm ("str %0":"=mr" (tr))
+#define store_ldt(ldt) asm ("sldt %0":"=mr" (ldt))
+
+static inline unsigned int get_TR_desc(void)
+{
+ unsigned int tr;
+ __asm__ ("str %w0":"=q" (tr));
+ return tr;
+}
+
+static inline unsigned int get_LDT_desc(void)
+{
+ unsigned int ldt;
+ __asm__ ("sldt %w0":"=q" (ldt));
+ return ldt;
+}
+
+#define set_base(desc,base) _set_base((desc), (base))
+#define set_limit(desc,limit) _set_limit((desc), ((limit)-1)>>12)
+
+static inline void __set_tss_desc(unsigned int cpu, unsigned int...
2007 Apr 18
2
[PATCH 19/21] i386 Kprobes semaphore fix
...userspace, or this is from ptrace operating
+ * on a child context directly from a system call.
+ * This 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...
2007 Apr 18
2
[PATCH 19/21] i386 Kprobes semaphore fix
...userspace, or this is from ptrace operating
+ * on a child context directly from a system call.
+ * This 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...
2007 Apr 18
3
[PATCH] abstract out bits of ldt.c
Chris Wright wrote:
>* Zachary Amsden (zach@vmware.com) wrote:
>
>
>>Does Xen assume page aligned descriptor tables? I assume from this
>>
>>
>
>Yes.
>
>
>
>>patch and snippets I have gathered from others, that is a yes, and other
>>things here imply that DT pages are not shadowed. If so, Xen itself
>>must have live segments
2007 Apr 18
3
[PATCH] abstract out bits of ldt.c
Chris Wright wrote:
>* Zachary Amsden (zach@vmware.com) wrote:
>
>
>>Does Xen assume page aligned descriptor tables? I assume from this
>>
>>
>
>Yes.
>
>
>
>>patch and snippets I have gathered from others, that is a yes, and other
>>things here imply that DT pages are not shadowed. If so, Xen itself
>>must have live segments