Re: [PATCH] struct thread_struct, asm-i386/processor.h: wrong datatype?

From: Ingo Molnar
Date: Mon Jun 06 2005 - 03:19:13 EST



* Herbert Rosmanith <kernel@xxxxxxxxxxxxxxxxx> wrote:

>
> or better:
>
> > - unsigned long fs;
> > - unsigned long gs;
> > + unsigned short fs;
> > + unsigned short gs;
> > /* Hardware debugging registers */
> > unsigned long debugreg[8]; /* %%db0-7 debug registers */
> > /* fault info */
>
> + unsigned short fs, __fsh;
> + unsigned short gs, __gsh;
>
> which is also done this way the structure above, the TSS. I don't know
> why it's done this way, but I guess it's probably better pad with 16
> bits to avoid potential problems with 32bit movl which might overwrite
> portions of the next field.

no. 'struct thread_struct' is the 'soft' thread-state structure. We
store data in the most convenient (and best performing) format - word
size in this case. The 'hard' data structure is 'struct tss_struct' -
where we of course define things in the way the CPU expects it.

Ingo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/