diff options
Diffstat (limited to 'arch/powerpc/include')
-rw-r--r-- | arch/powerpc/include/asm/code-patching.h | 11 | ||||
-rw-r--r-- | arch/powerpc/include/asm/opal.h | 29 | ||||
-rw-r--r-- | arch/powerpc/include/asm/swab.h | 43 |
3 files changed, 11 insertions, 72 deletions
diff --git a/arch/powerpc/include/asm/code-patching.h b/arch/powerpc/include/asm/code-patching.h index 37991e154ef8..840a5509b3f1 100644 --- a/arch/powerpc/include/asm/code-patching.h +++ b/arch/powerpc/include/asm/code-patching.h | |||
@@ -88,4 +88,15 @@ static inline unsigned long ppc_function_entry(void *func) | |||
88 | #endif | 88 | #endif |
89 | } | 89 | } |
90 | 90 | ||
91 | static inline unsigned long ppc_global_function_entry(void *func) | ||
92 | { | ||
93 | #if defined(CONFIG_PPC64) && defined(_CALL_ELF) && _CALL_ELF == 2 | ||
94 | /* PPC64 ABIv2 the global entry point is at the address */ | ||
95 | return (unsigned long)func; | ||
96 | #else | ||
97 | /* All other cases there is no change vs ppc_function_entry() */ | ||
98 | return ppc_function_entry(func); | ||
99 | #endif | ||
100 | } | ||
101 | |||
91 | #endif /* _ASM_POWERPC_CODE_PATCHING_H */ | 102 | #endif /* _ASM_POWERPC_CODE_PATCHING_H */ |
diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h index 460018889ba9..0da1dbd42e02 100644 --- a/arch/powerpc/include/asm/opal.h +++ b/arch/powerpc/include/asm/opal.h | |||
@@ -12,27 +12,7 @@ | |||
12 | #ifndef __OPAL_H | 12 | #ifndef __OPAL_H |
13 | #define __OPAL_H | 13 | #define __OPAL_H |
14 | 14 | ||
15 | /****** Takeover interface ********/ | ||
16 | |||
17 | /* PAPR H-Call used to querty the HAL existence and/or instanciate | ||
18 | * it from within pHyp (tech preview only). | ||
19 | * | ||
20 | * This is exclusively used in prom_init.c | ||
21 | */ | ||
22 | |||
23 | #ifndef __ASSEMBLY__ | 15 | #ifndef __ASSEMBLY__ |
24 | |||
25 | struct opal_takeover_args { | ||
26 | u64 k_image; /* r4 */ | ||
27 | u64 k_size; /* r5 */ | ||
28 | u64 k_entry; /* r6 */ | ||
29 | u64 k_entry2; /* r7 */ | ||
30 | u64 hal_addr; /* r8 */ | ||
31 | u64 rd_image; /* r9 */ | ||
32 | u64 rd_size; /* r10 */ | ||
33 | u64 rd_loc; /* r11 */ | ||
34 | }; | ||
35 | |||
36 | /* | 16 | /* |
37 | * SG entry | 17 | * SG entry |
38 | * | 18 | * |
@@ -55,15 +35,6 @@ struct opal_sg_list { | |||
55 | /* We calculate number of sg entries based on PAGE_SIZE */ | 35 | /* We calculate number of sg entries based on PAGE_SIZE */ |
56 | #define SG_ENTRIES_PER_NODE ((PAGE_SIZE - 16) / sizeof(struct opal_sg_entry)) | 36 | #define SG_ENTRIES_PER_NODE ((PAGE_SIZE - 16) / sizeof(struct opal_sg_entry)) |
57 | 37 | ||
58 | extern long opal_query_takeover(u64 *hal_size, u64 *hal_align); | ||
59 | |||
60 | extern long opal_do_takeover(struct opal_takeover_args *args); | ||
61 | |||
62 | struct rtas_args; | ||
63 | extern int opal_enter_rtas(struct rtas_args *args, | ||
64 | unsigned long data, | ||
65 | unsigned long entry); | ||
66 | |||
67 | #endif /* __ASSEMBLY__ */ | 38 | #endif /* __ASSEMBLY__ */ |
68 | 39 | ||
69 | /****** OPAL APIs ******/ | 40 | /****** OPAL APIs ******/ |
diff --git a/arch/powerpc/include/asm/swab.h b/arch/powerpc/include/asm/swab.h index b9bd1ca944d0..96f59de61855 100644 --- a/arch/powerpc/include/asm/swab.h +++ b/arch/powerpc/include/asm/swab.h | |||
@@ -9,10 +9,6 @@ | |||
9 | 9 | ||
10 | #include <uapi/asm/swab.h> | 10 | #include <uapi/asm/swab.h> |
11 | 11 | ||
12 | #ifdef __GNUC__ | ||
13 | #ifndef __powerpc64__ | ||
14 | #endif /* __powerpc64__ */ | ||
15 | |||
16 | static __inline__ __u16 ld_le16(const volatile __u16 *addr) | 12 | static __inline__ __u16 ld_le16(const volatile __u16 *addr) |
17 | { | 13 | { |
18 | __u16 val; | 14 | __u16 val; |
@@ -20,19 +16,12 @@ static __inline__ __u16 ld_le16(const volatile __u16 *addr) | |||
20 | __asm__ __volatile__ ("lhbrx %0,0,%1" : "=r" (val) : "r" (addr), "m" (*addr)); | 16 | __asm__ __volatile__ ("lhbrx %0,0,%1" : "=r" (val) : "r" (addr), "m" (*addr)); |
21 | return val; | 17 | return val; |
22 | } | 18 | } |
23 | #define __arch_swab16p ld_le16 | ||
24 | 19 | ||
25 | static __inline__ void st_le16(volatile __u16 *addr, const __u16 val) | 20 | static __inline__ void st_le16(volatile __u16 *addr, const __u16 val) |
26 | { | 21 | { |
27 | __asm__ __volatile__ ("sthbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr)); | 22 | __asm__ __volatile__ ("sthbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr)); |
28 | } | 23 | } |
29 | 24 | ||
30 | static inline void __arch_swab16s(__u16 *addr) | ||
31 | { | ||
32 | st_le16(addr, *addr); | ||
33 | } | ||
34 | #define __arch_swab16s __arch_swab16s | ||
35 | |||
36 | static __inline__ __u32 ld_le32(const volatile __u32 *addr) | 25 | static __inline__ __u32 ld_le32(const volatile __u32 *addr) |
37 | { | 26 | { |
38 | __u32 val; | 27 | __u32 val; |
@@ -40,42 +29,10 @@ static __inline__ __u32 ld_le32(const volatile __u32 *addr) | |||
40 | __asm__ __volatile__ ("lwbrx %0,0,%1" : "=r" (val) : "r" (addr), "m" (*addr)); | 29 | __asm__ __volatile__ ("lwbrx %0,0,%1" : "=r" (val) : "r" (addr), "m" (*addr)); |
41 | return val; | 30 | return val; |
42 | } | 31 | } |
43 | #define __arch_swab32p ld_le32 | ||
44 | 32 | ||
45 | static __inline__ void st_le32(volatile __u32 *addr, const __u32 val) | 33 | static __inline__ void st_le32(volatile __u32 *addr, const __u32 val) |
46 | { | 34 | { |
47 | __asm__ __volatile__ ("stwbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr)); | 35 | __asm__ __volatile__ ("stwbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr)); |
48 | } | 36 | } |
49 | 37 | ||
50 | static inline void __arch_swab32s(__u32 *addr) | ||
51 | { | ||
52 | st_le32(addr, *addr); | ||
53 | } | ||
54 | #define __arch_swab32s __arch_swab32s | ||
55 | |||
56 | static inline __attribute_const__ __u16 __arch_swab16(__u16 value) | ||
57 | { | ||
58 | __u16 result; | ||
59 | |||
60 | __asm__("rlwimi %0,%1,8,16,23" | ||
61 | : "=r" (result) | ||
62 | : "r" (value), "0" (value >> 8)); | ||
63 | return result; | ||
64 | } | ||
65 | #define __arch_swab16 __arch_swab16 | ||
66 | |||
67 | static inline __attribute_const__ __u32 __arch_swab32(__u32 value) | ||
68 | { | ||
69 | __u32 result; | ||
70 | |||
71 | __asm__("rlwimi %0,%1,24,16,23\n\t" | ||
72 | "rlwimi %0,%1,8,8,15\n\t" | ||
73 | "rlwimi %0,%1,24,0,7" | ||
74 | : "=r" (result) | ||
75 | : "r" (value), "0" (value >> 24)); | ||
76 | return result; | ||
77 | } | ||
78 | #define __arch_swab32 __arch_swab32 | ||
79 | |||
80 | #endif /* __GNUC__ */ | ||
81 | #endif /* _ASM_POWERPC_SWAB_H */ | 38 | #endif /* _ASM_POWERPC_SWAB_H */ |