summaryrefslogtreecommitdiffstats
path: root/src/sysdeps/x86_64/error.c
blob: bdad198219c48333bcc0e25cc6f01cf1d62dd432 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

#include <strings.h>

#include "config.h"

int lt_error_set_retval(struct lt_config_audit *cfg,
                        unsigned long ret, La_retval *outregs)
{
	bzero(outregs, sizeof(*outregs));

	outregs->lrv_rdx = 0;
	outregs->lrv_rax = (uint32_t) ret;

	return 0;
}

void lt_error_get_retaddr(struct lt_config_audit *cfg,
			  void **ret_addr, const La_regs *inregs)
{
	void **stack = (void**) inregs->lr_rsp;
	*ret_addr = *stack;
}