Fork us on GitHub Follow us on Facebook Follow us on Twitter

Ignore:
Timestamp:
2011-08-16T18:53:00Z (10 years ago)
Author:
Petr Koupy <petr.koupy@…>
Branches:
lfn, master
Children:
49160c4
Parents:
e0e922d (diff), 45058baa (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/arch/ppc32/include/elf_linux.h

    re0e922d rdb6e419  
    3030 * @{
    3131 */
    32 /** @file
     32/** @file Definitions needed to write core files in Linux-ELF format.
    3333 */
    3434
     
    3939#include <sys/types.h>
    4040
     41/** Linux kernel struct pt_regs structure.
     42 *
     43 * We need this to save register state to a core file in Linux format
     44 * (readable by GDB configured for Linux target).
     45 */
    4146typedef struct {
    42         /* TODO */
    43         uint32_t pad[16];
     47        uint32_t r0;
     48        uint32_t r1;
     49        uint32_t r2;
     50        uint32_t r3;
     51        uint32_t r4;
     52        uint32_t r5;
     53        uint32_t r6;
     54        uint32_t r7;
     55        uint32_t r8;
     56        uint32_t r9;
     57        uint32_t r10;
     58        uint32_t r11;
     59        uint32_t r12;
     60        uint32_t r13;
     61        uint32_t r14;
     62        uint32_t r15;
     63        uint32_t r16;
     64        uint32_t r17;
     65        uint32_t r18;
     66        uint32_t r19;
     67        uint32_t r20;
     68        uint32_t r21;
     69        uint32_t r22;
     70        uint32_t r23;
     71        uint32_t r24;
     72        uint32_t r25;
     73        uint32_t r26;
     74        uint32_t r27;
     75        uint32_t r28;
     76        uint32_t r29;
     77        uint32_t r30;
     78        uint32_t r31;
     79
     80        uint32_t nip;
     81        uint32_t msr;
     82        uint32_t old_r3;
     83        uint32_t ctr;
     84        uint32_t link;
     85        uint32_t xer;
     86        uint32_t ccr;
     87        uint32_t mq;
     88        uint32_t trap;
     89        uint32_t dar;
     90        uint32_t dsisr;
     91        uint32_t result;
    4492} elf_regs_t;
    4593
     94/** Convert istate_t to elf_regs_t. */
    4695static inline void istate_to_elf_regs(istate_t *istate, elf_regs_t *elf_regs)
    4796{
    48         /* TODO */
    49         (void) istate; (void) elf_regs;
     97        elf_regs->r0 = istate->r0;
     98        elf_regs->r1 = istate->sp;
     99        elf_regs->r2 = istate->r2;
     100        elf_regs->r3 = istate->r3;
     101        elf_regs->r4 = istate->r4;
     102        elf_regs->r5 = istate->r5;
     103        elf_regs->r6 = istate->r6;
     104        elf_regs->r7 = istate->r7;
     105        elf_regs->r8 = istate->r8;
     106        elf_regs->r9 = istate->r9;
     107        elf_regs->r10 = istate->r10;
     108        elf_regs->r11 = istate->r11;
     109        elf_regs->r12 = istate->r12;
     110        elf_regs->r13 = istate->r13;
     111        elf_regs->r14 = istate->r14;
     112        elf_regs->r15 = istate->r15;
     113        elf_regs->r16 = istate->r16;
     114        elf_regs->r17 = istate->r17;
     115        elf_regs->r18 = istate->r18;
     116        elf_regs->r19 = istate->r19;
     117        elf_regs->r20 = istate->r20;
     118        elf_regs->r21 = istate->r21;
     119        elf_regs->r22 = istate->r22;
     120        elf_regs->r23 = istate->r23;
     121        elf_regs->r24 = istate->r24;
     122        elf_regs->r25 = istate->r25;
     123        elf_regs->r26 = istate->r26;
     124        elf_regs->r27 = istate->r27;
     125        elf_regs->r28 = istate->r28;
     126        elf_regs->r29 = istate->r29;
     127        elf_regs->r30 = istate->r30;
     128        elf_regs->r31 = istate->r31;
     129
     130        elf_regs->ctr = istate->ctr;
     131        elf_regs->link = istate->lr;
     132        elf_regs->xer = istate->xer;
     133        elf_regs->ccr = istate->cr;
     134        elf_regs->dar = istate->dar;
    50135}
    51136
Note: See TracChangeset for help on using the changeset viewer.