Subject: Re: Initial diffs to make arm32 kernel core dumps work with savecore and gdb
To: Chris Gilbert <chris@dokein.co.uk>
From: David Laight <david@l8s.co.uk>
List: port-arm
Date: 12/16/2007 12:50:15
On Sat, Dec 15, 2007 at 01:03:09AM +0000, Chris Gilbert wrote:
> The main item to highlight is the cpu_kcore_hdr structure in 
> sys/arch/arm/include/kcore.h, as it's a new kernel->userland ABI for 
> arm, I'd like to get it right first time if possible.  Currently I've 
> defined it as:
> typedef struct cpu_kcore_hdr {
>    uint32_t    version;        /* structure version */
>    uint32_t    isArm26;        /* indicates arm26 dump */
>    uint32_t    PAKernelL1Table;    /* PA of PMAP_kernel L1 table */
>    uint32_t    nmemsegs;        /* Number of RAM segments */
> #if 0
>    phys_ram_seg_t  memsegs[];        /* RAM segments */
> #endif
> } cpu_kcore_hdr_t;
> 
> This provides all the info I need, however, given I've placed a version 
> field into it, I suspect the isArm26 field can go.  Also to improve 
> forward/backwards compatibility I think I should add an offset to the 
> memsegs, so it ends up as:
> 
> typedef struct cpu_kcore_hdr {
>    uint32_t    version;        /* structure version */
>    uint32_t    PAKernelL1Table;    /* PA of PMAP_kernel L1 table */
>    uint32_t    nmemsegs;        /* Number of RAM segments */
>    uint32_t    omemsegs;      /* offset from start of structure to 
> memsegs []*/
> #if 0
>    phys_ram_seg_t  memsegs[];        /* RAM segments */
> #endif
> } cpu_kcore_hdr_t;

Is it work adding a few 'pad/filler' words which aren't currently
used, but are defined to be set to zero.
Then anything that is forgotten can be added without completely
breaking compatibility (and maybe without having to change the
version).

	David

-- 
David Laight: david@l8s.co.uk