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/amd64/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         uint64_t pad[16];
     47        uint64_t r15;
     48        uint64_t r14;
     49        uint64_t r13;
     50        uint64_t r12;
     51        uint64_t rbp;
     52        uint64_t rbx;
     53        uint64_t r11;
     54        uint64_t r10;
     55        uint64_t r9;
     56        uint64_t r8;
     57        uint64_t rax;
     58        uint64_t rcx;
     59        uint64_t rdx;
     60        uint64_t rsi;
     61        uint64_t rdi;
     62        uint64_t old_rax;
     63        uint64_t rip;
     64        uint64_t cs;
     65        uint64_t rflags;
     66        uint64_t rsp;
     67        uint64_t ss;
    4468} elf_regs_t;
    4569
     70/** Convert istate_t to elf_regs_t. */
    4671static inline void istate_to_elf_regs(istate_t *istate, elf_regs_t *elf_regs)
    4772{
    48         /* TODO */
    49         (void) istate; (void) elf_regs;
     73        elf_regs->r15 = istate->r15;
     74        elf_regs->r14 = istate->r14;
     75        elf_regs->r13 = istate->r13;
     76        elf_regs->r12 = istate->r12;
     77        elf_regs->rbp = istate->rbp;
     78        elf_regs->rbx = istate->rbx;
     79        elf_regs->r11 = istate->r11;
     80        elf_regs->r10 = istate->r10;
     81        elf_regs->r9 = istate->r9;
     82        elf_regs->r8 = istate->r8;
     83        elf_regs->rax = istate->rax;
     84        elf_regs->rcx = istate->rcx;
     85        elf_regs->rdx = istate->rdx;
     86        elf_regs->rsi = istate->rsi;
     87        elf_regs->rdi = istate->rdi;
     88        elf_regs->rip = istate->rip;
     89        elf_regs->cs = istate->cs;
     90        elf_regs->rflags = istate->rflags;
     91        elf_regs->rsp = istate->rsp;
     92        elf_regs->ss = istate->ss;
    5093}
    5194
Note: See TracChangeset for help on using the changeset viewer.