2 * uClinux flat-format executables
4 * Copyright 2003-2009 Analog Devices Inc.
6 * Licensed under the GPL-2
9 #ifndef __BLACKFIN_FLAT_H__
10 #define __BLACKFIN_FLAT_H__
12 #include <asm/unaligned.h>
14 #define flat_argvp_envp_on_stack() 0
15 #define flat_old_ram_flag(flags) (flags)
17 extern unsigned long bfin_get_addr_from_rp (unsigned long *ptr
,
20 unsigned long *persistent
);
22 extern void bfin_put_addr_at_rp(unsigned long *ptr
, unsigned long addr
,
23 unsigned long relval
);
25 /* The amount by which a relocation can exceed the program image limits
26 without being regarded as an error. */
28 #define flat_reloc_valid(reloc, size) ((reloc) <= (size))
30 #define flat_get_addr_from_rp(rp, relval, flags, persistent) \
31 bfin_get_addr_from_rp(rp, relval, flags, persistent)
32 #define flat_put_addr_at_rp(rp, val, relval) \
33 bfin_put_addr_at_rp(rp, val, relval)
35 /* Convert a relocation entry into an address. */
36 static inline unsigned long
37 flat_get_relocate_addr (unsigned long relval
)
39 return relval
& 0x03ffffff; /* Mask out top 6 bits */
42 static inline int flat_set_persistent(unsigned long relval
,
43 unsigned long *persistent
)
45 int type
= (relval
>> 26) & 7;
47 *persistent
= relval
<< 16;
53 static inline int flat_addr_absolute(unsigned long relval
)
55 return (relval
& (1 << 29)) != 0;
58 #endif /* __BLACKFIN_FLAT_H__ */