Re: task_struct offsets broken in 2.1.77

Regis Duchesne (hpreg@celine.via.ecp.fr)
06 Jan 1998 02:35:18 +0100


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