[haiku-commits] Re: BRANCH xyzzy-github.x86_64 - src/system/kernel/arch/x86 src/system/kernel/arch/x86/32 src/system/kernel/arch/x86/64 headers/private/kernel/arch/x86

  • From: pulkomandy <pulkomandy@xxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 9 Jul 2012 18:17:32 +0200

On Mon, Jul 09, 2012 at 05:49:12PM +0200, xyzzy-github.x86_64 wrote:
>   * I've made some changes to struct iframe: I've removed the e/r prefixes
>     from the member names for both 32/64, so now they're just named ip, ax,
>     bp, etc. This makes it easier to write code that works with both 32/64
>     without having to deal with different iframe member names.

> diff --git a/headers/private/kernel/arch/x86/32/iframe.h 
> b/headers/private/kernel/arch/x86/32/iframe.h
> index 6da6c1f..1aa51ed 100644
> --- a/headers/private/kernel/arch/x86/32/iframe.h
> +++ b/headers/private/kernel/arch/x86/32/iframe.h
> @@ -15,25 +15,25 @@ struct iframe {
>       uint32 fs;
>       uint32 es;
>       uint32 ds;
> -     uint32 edi;
> -     uint32 esi;
> -     uint32 ebp;
> -     uint32 esp;
> -     uint32 ebx;
> -     uint32 edx;
> -     uint32 ecx;
> -     uint32 eax;
> +     uint32 di;
> +     uint32 si;
> +     uint32 bp;
> +     uint32 sp;
> +     uint32 bx;
> +     uint32 dx;
> +     uint32 cx;
> +     uint32 ax;
>       uint32 orig_eax;
>       uint32 orig_edx;
>       uint32 vector;
>       uint32 error_code;
> -     uint32 eip;
> +     uint32 ip;
>       uint32 cs;
>       uint32 flags;
>  
> -     // user_esp and user_ss are only present when the iframe is a userland
> +     // user_sp and user_ss are only present when the iframe is a userland
>       // iframe (IFRAME_IS_USER()). A kernel iframe is shorter.
> -     uint32 user_esp;
> +     uint32 user_sp;
>       uint32 user_ss;
>  };
>  
> diff --git a/headers/private/kernel/arch/x86/64/descriptors.h 
> b/headers/private/kernel/arch/x86/64/descriptors.h
> index 8e70cba..3f05196 100644
> --- a/headers/private/kernel/arch/x86/64/descriptors.h
> +++ b/headers/private/kernel/arch/x86/64/descriptors.h
> @@ -76,9 +76,9 @@ struct gdt_idt_descr {
>  
>  struct tss {
>       uint32 _reserved1;
> -     uint64 rsp0;
> -     uint64 rsp1;
> -     uint64 rsp2;
> +     uint64 sp0;
> +     uint64 sp1;
> +     uint64 sp2;
>       uint64 _reserved2;
>       uint64 ist1;
>       uint64 ist2;
> diff --git a/headers/private/kernel/arch/x86/64/iframe.h 
> b/headers/private/kernel/arch/x86/64/iframe.h
> index a0ca48f..cd257ef 100644
> --- a/headers/private/kernel/arch/x86/64/iframe.h
> +++ b/headers/private/kernel/arch/x86/64/iframe.h
> @@ -16,21 +16,21 @@ struct iframe {
>       uint64 r10;
>       uint64 r9;
>       uint64 r8;
> -     uint64 rbp;
> -     uint64 rsi;
> -     uint64 rdi;
> -     uint64 rdx;
> -     uint64 rcx;
> -     uint64 rbx;
> -     uint64 rax;
> +     uint64 bp;
> +     uint64 si;
> +     uint64 di;
> +     uint64 dx;
> +     uint64 cx;
> +     uint64 bx;
> +     uint64 ax;
>       uint64 vector;
>       uint64 error_code;
> -     uint64 rip;
> +     uint64 ip;
>       uint64 cs;
>       uint64 flags;
>  
>       // Only present when the iframe is a userland iframe (IFRAME_IS_USER()).
> -     uint64 user_rsp;
> +     uint64 user_sp;
>       uint64 user_ss;
>  } _PACKED;

This is a bit confusing because AX BX ... are the names of the 16-bit
version of these registers. I'd go for RAX everywhere (but maybe others
don't agree on that).

-- 
Adrien.

Other related posts: