Re: current as segment register was Re: Using %cr2 to reference "current"

Keith Owens (kaos@ocs.com.au)
Wed, 07 Nov 2001 14:42:16 +1100


On 06 Nov 2001 20:02:09 +0100,
Andi Kleen <ak@suse.de> wrote:
>One nasty thing is that lea doesn't work on segment registers. It needs
>an quite ugly inline assembly mess similar to get/put_user to implement
>read/write/add_pda functions for the fundamental types. To implement
>that properly without hardcoded offsets it is also needed to have an
>offset.c like many other ports that puts structure offsets at compile
>time into an include file.

Already done in kbuild 2.5, it creates arch/i386/asm-offsets.h.
Currently containing this list, which can easily be expanded.

#ifndef __ASM_OFFSETS_H__
#define __ASM_OFFSETS_H__
/*
* DO NOT MODIFY
*
* This file was generated by arch/i386/Makefile.in.
*
*/

state = 0 /* 0x0 offsetof(struct task_struct, state) */
flags = 4 /* 0x4 offsetof(struct task_struct, flags) */
sigpending = 8 /* 0x8 offsetof(struct task_struct, sigpending) */
addr_limit = 12 /* 0xc offsetof(struct task_struct, addr_limit) */
exec_domain = 16 /* 0x10 offsetof(struct task_struct, exec_domain) */
need_resched = 20 /* 0x14 offsetof(struct task_struct, need_resched) */
tsk_ptrace = 24 /* 0x18 offsetof(struct task_struct, ptrace) */
processor = 52 /* 0x34 offsetof(struct task_struct, processor) */

ENOSYS = 38 /* 0x26 ENOSYS */

#endif

-
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/