Re: [PATCH RFC 3/6] Use %gs as the PDA base-segment in the kernel.

Keith Owens
2006-08-27T09:49:31Z

Jeremy Fitzhardinge (on Sun, 27 Aug 2006 01:44:20 -0700) wrote:
>2: entry.S constructs the stack in the shape of struct pt_regs, and this
> is passed around the kernel so that the process's saved register
> state can be accessed.
>--- a/arch/i386/kernel/entry.S
>+++ b/arch/i386/kernel/entry.S
>@@ -30,12 +30,14 @@
> * 18(%esp) - %eax
> * 1C(%esp) - %ds
> * 20(%esp) - %es
>+ * 24(%esp) - %fs (not saved/restored)
>+ * 28(%esp) - %gs
>+ * 2C(%esp) - orig_eax
>+ * 30(%esp) - %eip
>+ * 34(%esp) - %cs
>+ * 38(%esp) - %eflags
>+ * 3C(%esp) - %oldesp
>+ * 40(%esp) - %oldss
...
>+FS = 0x24
>+GS = 0x28
>+ORIG_EAX = 0x2C
>+EIP = 0x30
>+CS = 0x34
>+EFLAGS = 0x38
>+OLDESP = 0x3C
>+OLDSS = 0x40

Now would be a good time to get rid of those hard coded numbers and use
asm-offsets instead.