automotive-dlt
dlt_cdh_cpuinfo.c
Go to the documentation of this file.
1 /*
2  * @licence app begin@
3  * SPDX license identifier: MPL-2.0
4  *
5  * Copyright (C) 2011-2015, BMW AG
6  *
7  * This file is part of GENIVI Project DLT - Diagnostic Log and Trace.
8  *
9  * This Source Code Form is subject to the terms of the
10  * Mozilla Public License (MPL), v. 2.0.
11  * If a copy of the MPL was not distributed with this file,
12  * You can obtain one at http://mozilla.org/MPL/2.0/.
13  *
14  * For further information see http://www.genivi.org/.
15  * @licence end@
16  */
17 
28 #include "../dlt_cdh_cpuinfo.h"
29 
30 void get_registers(prstatus_t* prstatus, cdh_registers_t* registers)
31 {
32  struct user_regs_struct* ptr_reg = (struct user_regs_struct*) prstatus->pr_reg;
33 
34  registers->pc = ptr_reg->rcx; // [REG_PROC_COUNTER];
35  registers->ip = ptr_reg->rip; // [REG_INSTR_POINTER];
36  registers->lr = ptr_reg->rsp; // [REG_LINK_REGISTER];
37 }
uint64_t lr
Definition: dlt_cdh.h:59
uint64_t pc
Definition: dlt_cdh.h:57
void get_registers(prstatus_t *prstatus, cdh_registers_t *registers)
uint64_t ip
Definition: dlt_cdh.h:58