aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2013-08-14 04:45:00 -0400
committerGeert Uytterhoeven <geert@linux-m68k.org>2013-08-23 06:49:01 -0400
commit55490050df0f5d82ce070be11351c65f7696101c (patch)
tree80ffaf29f1e1af88d928d332e18c65957fad1e8e /arch/m68k
parent3c776a07914c9a154902486ac848abc16111d35e (diff)
m68k/atari: ARAnyM - Always use physical addresses in NatFeat calls
Pointers passed to ARAnyM NatFeat calls should be physical addresses, not virtual addresses. This worked before because on Atari, physical and virtual kernel addresses are the same, as long as normal kernel memory is concerned. Correct the few remaining places where virtual addresses were used. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'arch/m68k')
-rw-r--r--arch/m68k/emu/natfeat.c14
-rw-r--r--arch/m68k/emu/nfblock.c4
-rw-r--r--arch/m68k/emu/nfcon.c8
-rw-r--r--arch/m68k/emu/nfeth.c7
4 files changed, 18 insertions, 15 deletions
diff --git a/arch/m68k/emu/natfeat.c b/arch/m68k/emu/natfeat.c
index fa277aecfb78..121a6660ad4e 100644
--- a/arch/m68k/emu/natfeat.c
+++ b/arch/m68k/emu/natfeat.c
@@ -18,11 +18,11 @@
18#include <asm/machdep.h> 18#include <asm/machdep.h>
19#include <asm/natfeat.h> 19#include <asm/natfeat.h>
20 20
21extern long nf_get_id2(const char *feature_name); 21extern long nf_get_id_phys(unsigned long feature_name);
22 22
23asm("\n" 23asm("\n"
24" .global nf_get_id2,nf_call\n" 24" .global nf_get_id_phys,nf_call\n"
25"nf_get_id2:\n" 25"nf_get_id_phys:\n"
26" .short 0x7300\n" 26" .short 0x7300\n"
27" rts\n" 27" rts\n"
28"nf_call:\n" 28"nf_call:\n"
@@ -31,7 +31,7 @@ asm("\n"
31"1: moveq.l #0,%d0\n" 31"1: moveq.l #0,%d0\n"
32" rts\n" 32" rts\n"
33" .section __ex_table,\"a\"\n" 33" .section __ex_table,\"a\"\n"
34" .long nf_get_id2,1b\n" 34" .long nf_get_id_phys,1b\n"
35" .long nf_call,1b\n" 35" .long nf_call,1b\n"
36" .previous"); 36" .previous");
37EXPORT_SYMBOL_GPL(nf_call); 37EXPORT_SYMBOL_GPL(nf_call);
@@ -46,7 +46,7 @@ long nf_get_id(const char *feature_name)
46 if (n >= sizeof(name_copy)) 46 if (n >= sizeof(name_copy))
47 return 0; 47 return 0;
48 48
49 return nf_get_id2(name_copy); 49 return nf_get_id_phys(virt_to_phys(name_copy));
50} 50}
51EXPORT_SYMBOL_GPL(nf_get_id); 51EXPORT_SYMBOL_GPL(nf_get_id);
52 52
@@ -58,7 +58,7 @@ void nfprint(const char *fmt, ...)
58 58
59 va_start(ap, fmt); 59 va_start(ap, fmt);
60 n = vsnprintf(buf, 256, fmt, ap); 60 n = vsnprintf(buf, 256, fmt, ap);
61 nf_call(nf_get_id("NF_STDERR"), buf); 61 nf_call(nf_get_id("NF_STDERR"), virt_to_phys(buf));
62 va_end(ap); 62 va_end(ap);
63} 63}
64 64
@@ -83,7 +83,7 @@ void nf_init(void)
83 id = nf_get_id("NF_NAME"); 83 id = nf_get_id("NF_NAME");
84 if (!id) 84 if (!id)
85 return; 85 return;
86 nf_call(id, buf, 256); 86 nf_call(id, virt_to_phys(buf), 256);
87 buf[255] = 0; 87 buf[255] = 0;
88 88
89 pr_info("NatFeats found (%s, %lu.%lu)\n", buf, version >> 16, 89 pr_info("NatFeats found (%s, %lu.%lu)\n", buf, version >> 16,
diff --git a/arch/m68k/emu/nfblock.c b/arch/m68k/emu/nfblock.c
index e3011338ab40..0721858fbd1e 100644
--- a/arch/m68k/emu/nfblock.c
+++ b/arch/m68k/emu/nfblock.c
@@ -41,8 +41,8 @@ static inline s32 nfhd_read_write(u32 major, u32 minor, u32 rwflag, u32 recno,
41static inline s32 nfhd_get_capacity(u32 major, u32 minor, u32 *blocks, 41static inline s32 nfhd_get_capacity(u32 major, u32 minor, u32 *blocks,
42 u32 *blocksize) 42 u32 *blocksize)
43{ 43{
44 return nf_call(nfhd_id + NFHD_GET_CAPACITY, major, minor, blocks, 44 return nf_call(nfhd_id + NFHD_GET_CAPACITY, major, minor,
45 blocksize); 45 virt_to_phys(blocks), virt_to_phys(blocksize));
46} 46}
47 47
48static LIST_HEAD(nfhd_list); 48static LIST_HEAD(nfhd_list);
diff --git a/arch/m68k/emu/nfcon.c b/arch/m68k/emu/nfcon.c
index 6685bf45c2c3..57e8c8fb5eba 100644
--- a/arch/m68k/emu/nfcon.c
+++ b/arch/m68k/emu/nfcon.c
@@ -15,6 +15,7 @@
15#include <linux/slab.h> 15#include <linux/slab.h>
16#include <linux/err.h> 16#include <linux/err.h>
17#include <linux/uaccess.h> 17#include <linux/uaccess.h>
18#include <linux/io.h>
18 19
19#include <asm/natfeat.h> 20#include <asm/natfeat.h>
20 21
@@ -25,17 +26,18 @@ static struct tty_driver *nfcon_tty_driver;
25static void nfputs(const char *str, unsigned int count) 26static void nfputs(const char *str, unsigned int count)
26{ 27{
27 char buf[68]; 28 char buf[68];
29 unsigned long phys = virt_to_phys(buf);
28 30
29 buf[64] = 0; 31 buf[64] = 0;
30 while (count > 64) { 32 while (count > 64) {
31 memcpy(buf, str, 64); 33 memcpy(buf, str, 64);
32 nf_call(stderr_id, buf); 34 nf_call(stderr_id, phys);
33 str += 64; 35 str += 64;
34 count -= 64; 36 count -= 64;
35 } 37 }
36 memcpy(buf, str, count); 38 memcpy(buf, str, count);
37 buf[count] = 0; 39 buf[count] = 0;
38 nf_call(stderr_id, buf); 40 nf_call(stderr_id, phys);
39} 41}
40 42
41static void nfcon_write(struct console *con, const char *str, 43static void nfcon_write(struct console *con, const char *str,
@@ -79,7 +81,7 @@ static int nfcon_tty_put_char(struct tty_struct *tty, unsigned char ch)
79{ 81{
80 char temp[2] = { ch, 0 }; 82 char temp[2] = { ch, 0 };
81 83
82 nf_call(stderr_id, temp); 84 nf_call(stderr_id, virt_to_phys(temp));
83 return 1; 85 return 1;
84} 86}
85 87
diff --git a/arch/m68k/emu/nfeth.c b/arch/m68k/emu/nfeth.c
index 695cd737a42e..a0985fd088d1 100644
--- a/arch/m68k/emu/nfeth.c
+++ b/arch/m68k/emu/nfeth.c
@@ -195,7 +195,8 @@ static struct net_device * __init nfeth_probe(int unit)
195 char mac[ETH_ALEN], host_ip[32], local_ip[32]; 195 char mac[ETH_ALEN], host_ip[32], local_ip[32];
196 int err; 196 int err;
197 197
198 if (!nf_call(nfEtherID + XIF_GET_MAC, unit, mac, ETH_ALEN)) 198 if (!nf_call(nfEtherID + XIF_GET_MAC, unit, virt_to_phys(mac),
199 ETH_ALEN))
199 return NULL; 200 return NULL;
200 201
201 dev = alloc_etherdev(sizeof(struct nfeth_private)); 202 dev = alloc_etherdev(sizeof(struct nfeth_private));
@@ -217,9 +218,9 @@ static struct net_device * __init nfeth_probe(int unit)
217 } 218 }
218 219
219 nf_call(nfEtherID + XIF_GET_IPHOST, unit, 220 nf_call(nfEtherID + XIF_GET_IPHOST, unit,
220 host_ip, sizeof(host_ip)); 221 virt_to_phys(host_ip), sizeof(host_ip));
221 nf_call(nfEtherID + XIF_GET_IPATARI, unit, 222 nf_call(nfEtherID + XIF_GET_IPATARI, unit,
222 local_ip, sizeof(local_ip)); 223 virt_to_phys(local_ip), sizeof(local_ip));
223 224
224 netdev_info(dev, KBUILD_MODNAME " addr:%s (%s) HWaddr:%pM\n", host_ip, 225 netdev_info(dev, KBUILD_MODNAME " addr:%s (%s) HWaddr:%pM\n", host_ip,
225 local_ip, mac); 226 local_ip, mac);