This source file includes following definitions.
- flat_get_addr_from_rp
- flat_put_addr_at_rp
1
2
3
4
5
6 #ifndef __H8300_FLAT_H__
7 #define __H8300_FLAT_H__
8
9 #include <asm/unaligned.h>
10
11
12
13
14
15
16
17
18 #define flat_get_relocate_addr(rel) (rel & ~0x00000001)
19 static inline int flat_get_addr_from_rp(u32 __user *rp, u32 relval, u32 flags,
20 u32 *addr)
21 {
22 u32 val = get_unaligned((__force u32 *)rp);
23 if (!(flags & FLAT_FLAG_GOTPIC))
24 val &= 0x00ffffff;
25 *addr = val;
26 return 0;
27 }
28
29 static inline int flat_put_addr_at_rp(u32 __user *rp, u32 addr, u32 rel)
30 {
31 u32 *p = (__force u32 *)rp;
32 put_unaligned((addr & 0x00ffffff) | (*(char *)p << 24), p);
33 return 0;
34 }
35
36 #endif