aboutsummaryrefslogtreecommitdiff
blob: 9a3f590b7babae2779adff83420a26761d039493 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#define trace_sysnum_puser (4 * ORIG_EAX)

static long trace_raw_ret(void *vregs)
{
	trace_regs *regs = vregs;
	return regs->eax;
}

static void trace_set_ret(void *vregs, int err)
{
	do_pokeuser(EAX, -err);
}

static unsigned long trace_arg(void *vregs, int num)
{
	trace_regs *regs = vregs;
	switch (num) {
		case 1: return regs->ebx;
		case 2: return regs->ecx;
		case 3: return regs->edx;
		case 4: return regs->esi;
		case 5: return regs->edi;
		case 6: return regs->ebp;
		default: return -1;
	}
}