summaryrefslogtreecommitdiffstats
path: root/runtime/regs.h
blob: e634581c88651e66b19b773948d7694860a8d738 (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
#ifndef _REGS_H_ /* -*- linux-c -*- */
#define _REGS_H_

/* common register includes used in multiple modules */

#ifdef __x86_64__

#define REG_IP(regs) regs->rip
#define REG_SP(regs) regs->rsp

#elif defined (__i386__)

#define REG_IP(regs) regs->eip
#define REG_SP(regs) regs->esp

#elif defined (__powerpc64__)

#define REG_IP(regs) regs->nip
#define REG_SP(regs) regs->gpr[1]
#define REG_LINK(regs) regs->link

#else
#error "Unimplemented architecture"
#endif

#endif /* _REGS_H_ */