1
2#ifndef _ASM_IA64_RSE_H
3#define _ASM_IA64_RSE_H
4
5
6
7
8
9
10
11
12
13
14
15static __inline__ unsigned long
16ia64_rse_slot_num (unsigned long *addr)
17{
18 return (((unsigned long) addr) >> 3) & 0x3f;
19}
20
21
22
23
24static __inline__ unsigned long
25ia64_rse_is_rnat_slot (unsigned long *addr)
26{
27 return ia64_rse_slot_num(addr) == 0x3f;
28}
29
30
31
32
33
34static __inline__ unsigned long *
35ia64_rse_rnat_addr (unsigned long *slot_addr)
36{
37 return (unsigned long *) ((unsigned long) slot_addr | (0x3f << 3));
38}
39
40
41
42
43
44
45static __inline__ unsigned long
46ia64_rse_num_regs (unsigned long *bspstore, unsigned long *bsp)
47{
48 unsigned long slots = (bsp - bspstore);
49
50 return slots - (ia64_rse_slot_num(bspstore) + slots)/0x40;
51}
52
53
54
55
56
57static __inline__ unsigned long *
58ia64_rse_skip_regs (unsigned long *addr, long num_regs)
59{
60 long delta = ia64_rse_slot_num(addr) + num_regs;
61
62 if (num_regs < 0)
63 delta -= 0x3e;
64 return addr + num_regs + delta/0x3f;
65}
66
67#endif
68