[uClinux-dev] nios2 error: thread_info is now stack
Robert P. J. Day
rpjday at crashcourse.ca
Wed Oct 24 13:41:03 EDT 2007
On Wed, 24 Oct 2007, Atle Nissestad wrote:
...
> /* offsets into the task struct */
> DEFINE(TASK_STATE, offsetof(struct task_struct, state));
> DEFINE(TASK_FLAGS, offsetof(struct task_struct, flags));
> DEFINE(TASK_PTRACE, offsetof(struct task_struct, ptrace));
> DEFINE(TASK_BLOCKED, offsetof(struct task_struct, blocked));
> DEFINE(TASK_THREAD, offsetof(struct task_struct, thread));
> DEFINE(TASK_THREAD_INFO, offsetof(struct task_struct, thread_info)); ... uh oh ...
>
> so the obvious question is, what *should* that DEFINE look like? is
> it actually wanting to refer to thread_info itself? or to the stack?
>
> rday
>
>
> Like this:
>
> DEFINE(TASK_THREAD_INFO, offsetof(struct task_struct, stack));
oh, i know that that's a quick fix, but the larger issue is -- what is
that variable *supposed* to refer to? it's just begging for confusion
to define a variable with a name referring to "thread info" while it's
actually defined as being the offset of the *stack*. i don't have the
code in front of me at the moment, but it would be nice to have a
consistent naming convention for whatever this is supposed to
represent.
> arch/nios2nommu/kernel/process.c also need an update (if you've not already changed it):
>
> --- trunk/linux-2.6/arch/nios2nommu/kernel/process.c 2006/12/15 15:08:37 153
> +++ trunk/linux-2.6/arch/nios2nommu/kernel/process.c 2007/09/19 21:36:44 293
> @@ -319,7 +319,7 @@
> unsigned long stack_offset, *retp;
>
> stack_offset = THREAD_SIZE - sizeof(struct pt_regs);
> - childregs = (struct pt_regs *) ((unsigned long) p->thread_info + stack_offset);
> + childregs = (struct pt_regs *) ((unsigned long) p->stack + stack_offset);
> p->thread.kregs = childregs;
>
> *childregs = *regs;
ok, i'll deal with that as well when i get back to my system, thanks.
rday
--
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA
http://crashcourse.ca
========================================================================
More information about the uClinux-dev
mailing list