diff options
author | David S. Miller <davem@davemloft.net> | 2008-09-16 17:11:43 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-09-16 17:11:43 -0400 |
commit | 2e57572a50a4de41c6cbc879a4866a312d4cd316 (patch) | |
tree | c4f58ec96c06642c4b415b881d3f0a3b673d5b44 /arch/blackfin/include/asm/flat.h | |
parent | 9b2e43ae4e9609f80034dfe8de895045cac52d77 (diff) | |
parent | f948cc6ab9e61a8e88d70ee9aafc690e6d26f92c (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
Conflicts:
arch/sparc64/kernel/pci_psycho.c
Diffstat (limited to 'arch/blackfin/include/asm/flat.h')
-rw-r--r-- | arch/blackfin/include/asm/flat.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/arch/blackfin/include/asm/flat.h b/arch/blackfin/include/asm/flat.h new file mode 100644 index 000000000000..e70074e05f4e --- /dev/null +++ b/arch/blackfin/include/asm/flat.h | |||
@@ -0,0 +1,58 @@ | |||
1 | /* | ||
2 | * include/asm-blackfin/flat.h -- uClinux flat-format executables | ||
3 | * | ||
4 | * Copyright (C) 2003, | ||
5 | * | ||
6 | */ | ||
7 | |||
8 | #ifndef __BLACKFIN_FLAT_H__ | ||
9 | #define __BLACKFIN_FLAT_H__ | ||
10 | |||
11 | #include <asm/unaligned.h> | ||
12 | |||
13 | #define flat_stack_align(sp) /* nothing needed */ | ||
14 | #define flat_argvp_envp_on_stack() 0 | ||
15 | #define flat_old_ram_flag(flags) (flags) | ||
16 | |||
17 | extern unsigned long bfin_get_addr_from_rp (unsigned long *ptr, | ||
18 | unsigned long relval, | ||
19 | unsigned long flags, | ||
20 | unsigned long *persistent); | ||
21 | |||
22 | extern void bfin_put_addr_at_rp(unsigned long *ptr, unsigned long addr, | ||
23 | unsigned long relval); | ||
24 | |||
25 | /* The amount by which a relocation can exceed the program image limits | ||
26 | without being regarded as an error. */ | ||
27 | |||
28 | #define flat_reloc_valid(reloc, size) ((reloc) <= (size)) | ||
29 | |||
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) | ||
34 | |||
35 | /* Convert a relocation entry into an address. */ | ||
36 | static inline unsigned long | ||
37 | flat_get_relocate_addr (unsigned long relval) | ||
38 | { | ||
39 | return relval & 0x03ffffff; /* Mask out top 6 bits */ | ||
40 | } | ||
41 | |||
42 | static inline int flat_set_persistent(unsigned long relval, | ||
43 | unsigned long *persistent) | ||
44 | { | ||
45 | int type = (relval >> 26) & 7; | ||
46 | if (type == 3) { | ||
47 | *persistent = relval << 16; | ||
48 | return 1; | ||
49 | } | ||
50 | return 0; | ||
51 | } | ||
52 | |||
53 | static inline int flat_addr_absolute(unsigned long relval) | ||
54 | { | ||
55 | return (relval & (1 << 29)) != 0; | ||
56 | } | ||
57 | |||
58 | #endif /* __BLACKFIN_FLAT_H__ */ | ||