lkml.org 
[lkml]   [1998]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: task_struct offsets broken in 2.1.77
From
Date
Martin Mares <mj@ucw.cz> writes:
> The changes in the task_struct introduced in 2.1.77 caused the offsets
> to task_struct fields used in arch/i386/kernel/entry.S to be shifted one
> longword, the whole thing worked only by some means of magic. The following
> patch corrects these offsets, but wouldn't it be good to switch to
> machine-generated offsets as Sparc people already do?
Perhaps something like this could help to set offsets for all
architectures once for all (this is standard C) :

struct s {
...
foo bar;
...
};

#define offset_to_bar_in_struct_s ((void *)&((struct s *)0)->bar - (void *)0)

In C code, they are determined at compile time.
I'm not (yet!) a GAS guru, but I'm pretty sure somebody will find a
way to use this directly in asm code.

Best regards,

--
Regis "HPReg" Duchesne - Engineering Student at ***** ******** *****
www http://www.via.ecp.fr/~regis/
(O o) I use Linux & 3Com (1135 KB/s over 10Mb/s ethernet)
--.oOO--(_)--OOo.-----------------------------------------------------------

\
 
 \ /
  Last update: 2005-03-22 13:41    [W:0.104 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site