lkml.org 
[lkml]   [2006]   [May]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 18/35] Support gdt/idt/ldt handling on Xen.
Hi!

> +static inline void load_TLS(struct thread_struct *t, unsigned int cpu)
> +{
> +#define C(i) get_cpu_gdt_table(cpu)[GDT_ENTRY_TLS_MIN + i] = t->tls_array[i]
> + C(0); C(1); C(2);
> +#undef C
> +}

Why not use for loop here? gcc should be able to optimize it...

> +#define load_TR_desc()

do {} while (0)...

> +#define load_gdt(dtr) do { \
...
> +} while (0)

So you know the trick :-)

> +#define load_idt(dtr) HYPERVISOR_set_trap_table(xen_trap_table)
> +#define load_tr(tr) __asm__ __volatile("ltr %0"::"mr" (tr))
> +#define load_ldt(ldt) __asm__ __volatile("lldt %0"::"mr" (ldt))

__volatile (not __volatile__?). could you just use 'asm volatile'
without __s instead?

Pavel
--
Thanks for all the (sleeping) penguins.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-05-10 22:03    [W:1.176 / U:0.872 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site