diff options
Diffstat (limited to 'arch/powerpc/lib')
-rw-r--r-- | arch/powerpc/lib/Makefile | 1 | ||||
-rw-r--r-- | arch/powerpc/lib/e2a.c | 116 | ||||
-rw-r--r-- | arch/powerpc/lib/locks.c | 27 |
3 files changed, 13 insertions, 131 deletions
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile index ff7096458249..336dd191f768 100644 --- a/arch/powerpc/lib/Makefile +++ b/arch/powerpc/lib/Makefile | |||
@@ -14,7 +14,6 @@ endif | |||
14 | obj-$(CONFIG_PPC64) += checksum_64.o copypage_64.o copyuser_64.o \ | 14 | obj-$(CONFIG_PPC64) += checksum_64.o copypage_64.o copyuser_64.o \ |
15 | memcpy_64.o usercopy_64.o mem_64.o string.o \ | 15 | memcpy_64.o usercopy_64.o mem_64.o string.o \ |
16 | strcase.o | 16 | strcase.o |
17 | obj-$(CONFIG_PPC_ISERIES) += e2a.o | ||
18 | obj-$(CONFIG_XMON) += sstep.o | 17 | obj-$(CONFIG_XMON) += sstep.o |
19 | 18 | ||
20 | ifeq ($(CONFIG_PPC64),y) | 19 | ifeq ($(CONFIG_PPC64),y) |
diff --git a/arch/powerpc/lib/e2a.c b/arch/powerpc/lib/e2a.c deleted file mode 100644 index 4b72ed8fd50e..000000000000 --- a/arch/powerpc/lib/e2a.c +++ /dev/null | |||
@@ -1,116 +0,0 @@ | |||
1 | /* | ||
2 | * EBCDIC to ASCII conversion | ||
3 | * | ||
4 | * This function moved here from arch/powerpc/platforms/iseries/viopath.c | ||
5 | * | ||
6 | * (C) Copyright 2000-2004 IBM Corporation | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License as | ||
10 | * published by the Free Software Foundation; either version 2 of the | ||
11 | * License, or (at your option) anyu later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, but | ||
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | * General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software Foundation, | ||
20 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | * | ||
22 | */ | ||
23 | |||
24 | #include <linux/module.h> | ||
25 | |||
26 | unsigned char e2a(unsigned char x) | ||
27 | { | ||
28 | switch (x) { | ||
29 | case 0xF0: | ||
30 | return '0'; | ||
31 | case 0xF1: | ||
32 | return '1'; | ||
33 | case 0xF2: | ||
34 | return '2'; | ||
35 | case 0xF3: | ||
36 | return '3'; | ||
37 | case 0xF4: | ||
38 | return '4'; | ||
39 | case 0xF5: | ||
40 | return '5'; | ||
41 | case 0xF6: | ||
42 | return '6'; | ||
43 | case 0xF7: | ||
44 | return '7'; | ||
45 | case 0xF8: | ||
46 | return '8'; | ||
47 | case 0xF9: | ||
48 | return '9'; | ||
49 | case 0xC1: | ||
50 | return 'A'; | ||
51 | case 0xC2: | ||
52 | return 'B'; | ||
53 | case 0xC3: | ||
54 | return 'C'; | ||
55 | case 0xC4: | ||
56 | return 'D'; | ||
57 | case 0xC5: | ||
58 | return 'E'; | ||
59 | case 0xC6: | ||
60 | return 'F'; | ||
61 | case 0xC7: | ||
62 | return 'G'; | ||
63 | case 0xC8: | ||
64 | return 'H'; | ||
65 | case 0xC9: | ||
66 | return 'I'; | ||
67 | case 0xD1: | ||
68 | return 'J'; | ||
69 | case 0xD2: | ||
70 | return 'K'; | ||
71 | case 0xD3: | ||
72 | return 'L'; | ||
73 | case 0xD4: | ||
74 | return 'M'; | ||
75 | case 0xD5: | ||
76 | return 'N'; | ||
77 | case 0xD6: | ||
78 | return 'O'; | ||
79 | case 0xD7: | ||
80 | return 'P'; | ||
81 | case 0xD8: | ||
82 | return 'Q'; | ||
83 | case 0xD9: | ||
84 | return 'R'; | ||
85 | case 0xE2: | ||
86 | return 'S'; | ||
87 | case 0xE3: | ||
88 | return 'T'; | ||
89 | case 0xE4: | ||
90 | return 'U'; | ||
91 | case 0xE5: | ||
92 | return 'V'; | ||
93 | case 0xE6: | ||
94 | return 'W'; | ||
95 | case 0xE7: | ||
96 | return 'X'; | ||
97 | case 0xE8: | ||
98 | return 'Y'; | ||
99 | case 0xE9: | ||
100 | return 'Z'; | ||
101 | } | ||
102 | return ' '; | ||
103 | } | ||
104 | EXPORT_SYMBOL(e2a); | ||
105 | |||
106 | unsigned char* strne2a(unsigned char *dest, const unsigned char *src, size_t n) | ||
107 | { | ||
108 | int i; | ||
109 | |||
110 | n = strnlen(src, n); | ||
111 | |||
112 | for (i = 0; i < n; i++) | ||
113 | dest[i] = e2a(src[i]); | ||
114 | |||
115 | return dest; | ||
116 | } | ||
diff --git a/arch/powerpc/lib/locks.c b/arch/powerpc/lib/locks.c index 077bed7dc52b..80b482ca30df 100644 --- a/arch/powerpc/lib/locks.c +++ b/arch/powerpc/lib/locks.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <asm/hvcall.h> | 23 | #include <asm/hvcall.h> |
24 | #include <asm/iseries/hv_call.h> | 24 | #include <asm/iseries/hv_call.h> |
25 | #include <asm/smp.h> | 25 | #include <asm/smp.h> |
26 | #include <asm/firmware.h> | ||
26 | 27 | ||
27 | void __spin_yield(raw_spinlock_t *lock) | 28 | void __spin_yield(raw_spinlock_t *lock) |
28 | { | 29 | { |
@@ -39,13 +40,12 @@ void __spin_yield(raw_spinlock_t *lock) | |||
39 | rmb(); | 40 | rmb(); |
40 | if (lock->slock != lock_value) | 41 | if (lock->slock != lock_value) |
41 | return; /* something has changed */ | 42 | return; /* something has changed */ |
42 | #ifdef CONFIG_PPC_ISERIES | 43 | if (firmware_has_feature(FW_FEATURE_ISERIES)) |
43 | HvCall2(HvCallBaseYieldProcessor, HvCall_YieldToProc, | 44 | HvCall2(HvCallBaseYieldProcessor, HvCall_YieldToProc, |
44 | ((u64)holder_cpu << 32) | yield_count); | 45 | ((u64)holder_cpu << 32) | yield_count); |
45 | #else | 46 | else |
46 | plpar_hcall_norets(H_CONFER, get_hard_smp_processor_id(holder_cpu), | 47 | plpar_hcall_norets(H_CONFER, |
47 | yield_count); | 48 | get_hard_smp_processor_id(holder_cpu), yield_count); |
48 | #endif | ||
49 | } | 49 | } |
50 | 50 | ||
51 | /* | 51 | /* |
@@ -69,13 +69,12 @@ void __rw_yield(raw_rwlock_t *rw) | |||
69 | rmb(); | 69 | rmb(); |
70 | if (rw->lock != lock_value) | 70 | if (rw->lock != lock_value) |
71 | return; /* something has changed */ | 71 | return; /* something has changed */ |
72 | #ifdef CONFIG_PPC_ISERIES | 72 | if (firmware_has_feature(FW_FEATURE_ISERIES)) |
73 | HvCall2(HvCallBaseYieldProcessor, HvCall_YieldToProc, | 73 | HvCall2(HvCallBaseYieldProcessor, HvCall_YieldToProc, |
74 | ((u64)holder_cpu << 32) | yield_count); | 74 | ((u64)holder_cpu << 32) | yield_count); |
75 | #else | 75 | else |
76 | plpar_hcall_norets(H_CONFER, get_hard_smp_processor_id(holder_cpu), | 76 | plpar_hcall_norets(H_CONFER, |
77 | yield_count); | 77 | get_hard_smp_processor_id(holder_cpu), yield_count); |
78 | #endif | ||
79 | } | 78 | } |
80 | #endif | 79 | #endif |
81 | 80 | ||