On Mon, Mar 20, 2017 at 01:35:04AM +0100, Mark Kettenis wrote:
> It turns out that pretty much all relevant aarch64 OSes use the same
> layout for transferring registers in their debug interfaces.  Except
> for us.  That doesn't make sense and would mean I'd have to do
> additional work in my lldb porting efforts.
> 
> Diff below revises "struct reg" for amd64 to be compatible with what
> NetBSD provides.  That just matches our naming conventions for struct
> reg better.  The actual names are largely irrelevant as debuggers
> hardcode the layouts anyway to support cross-debugging.
> 
> This struct isn't actually used yet, so these changes don't really
> have any ABI consequences.  But once this is in, I'm planning on
> making core dumps and ptrace actually work on arm64.
> 
> ok?

It looks like NetBSD just has a cross compiled toolchain
nothing that runs on actual hardware.

Given FreeBSD does I'd consider that more relevant, and it
has:

struct reg {
        uint64_t x[30];
        uint64_t lr;
        uint64_t sp;
        uint64_t elr;
        uint32_t spsr;
};

struct fpreg {
        __uint128_t     fp_q[32];
        uint32_t        fp_sr;
        uint32_t        fp_cr;
};

> 
> 
> Index: arch/arm64/include/reg.h
> ===================================================================
> RCS file: /cvs/src/sys/arch/arm64/include/reg.h,v
> retrieving revision 1.1
> diff -u -p -r1.1 reg.h
> --- arch/arm64/include/reg.h  17 Dec 2016 23:38:33 -0000      1.1
> +++ arch/arm64/include/reg.h  20 Mar 2017 00:27:12 -0000
> @@ -19,11 +19,11 @@
>  #define _MACHINE_REG_H_
>  
>  struct reg {
> -     unsigned long x[30];
> -     unsigned long x_sp;
> -     unsigned long x_lr;
> -     unsigned long x_pc;
> -     unsigned long x_cpsr;
> +     unsigned long r_reg[31];
> +     unsigned long r_sp;
> +     unsigned long r_pc;
> +     unsigned long r_spsr;
> +     unsigned long r_tpidr;
>  };
>  
>  struct fpreg {
> 

Reply via email to