aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2013-04-15 00:39:41 -0400
committerChris Zankel <chris@zankel.net>2013-05-09 04:07:10 -0400
commitf4b93ba93184c23f7a903cc790b573195fb41c37 (patch)
treef117caa1f31310983af9b5d28f323f8faf02ef3b /arch/xtensa
parent0f7f931027da4fd2da7f33b5a074167233d88f1f (diff)
xtensa: don't use a7 in simcalls
To support FRAME_POINTER avoid using a7 in __simc (none of the existing simcalls needs it). Replace calls to __simc with more specific simc_read, simc_write and simc_lseek calls. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Chris Zankel <chris@zankel.net>
Diffstat (limited to 'arch/xtensa')
-rw-r--r--arch/xtensa/platforms/iss/console.c8
-rw-r--r--arch/xtensa/platforms/iss/include/platform/simcall.h24
-rw-r--r--arch/xtensa/platforms/iss/simdisk.c4
3 files changed, 18 insertions, 18 deletions
diff --git a/arch/xtensa/platforms/iss/console.c b/arch/xtensa/platforms/iss/console.c
index da9866f7fecf..e8697218c65e 100644
--- a/arch/xtensa/platforms/iss/console.c
+++ b/arch/xtensa/platforms/iss/console.c
@@ -99,14 +99,13 @@ static int rs_write(struct tty_struct * tty,
99static void rs_poll(unsigned long priv) 99static void rs_poll(unsigned long priv)
100{ 100{
101 struct tty_port *port = (struct tty_port *)priv; 101 struct tty_port *port = (struct tty_port *)priv;
102 struct timeval tv = { .tv_sec = 0, .tv_usec = 0 };
103 int i = 0; 102 int i = 0;
104 unsigned char c; 103 unsigned char c;
105 104
106 spin_lock(&timer_lock); 105 spin_lock(&timer_lock);
107 106
108 while (__simc(SYS_select_one, 0, XTISS_SELECT_ONE_READ, (int)&tv,0,0)){ 107 while (simc_poll(0)) {
109 __simc (SYS_read, 0, (unsigned long)&c, 1, 0, 0); 108 simc_read(0, &c, 1);
110 tty_insert_flip_char(port, c, TTY_NORMAL); 109 tty_insert_flip_char(port, c, TTY_NORMAL);
111 i++; 110 i++;
112 } 111 }
@@ -244,8 +243,7 @@ static void iss_console_write(struct console *co, const char *s, unsigned count)
244 int len = strlen(s); 243 int len = strlen(s);
245 244
246 if (s != 0 && *s != 0) 245 if (s != 0 && *s != 0)
247 __simc (SYS_write, 1, (unsigned long)s, 246 simc_write(1, s, count < len ? count : len);
248 count < len ? count : len,0,0);
249} 247}
250 248
251static struct tty_driver* iss_console_device(struct console *c, int *index) 249static struct tty_driver* iss_console_device(struct console *c, int *index)
diff --git a/arch/xtensa/platforms/iss/include/platform/simcall.h b/arch/xtensa/platforms/iss/include/platform/simcall.h
index b5a4edf02d76..12b15ad1e586 100644
--- a/arch/xtensa/platforms/iss/include/platform/simcall.h
+++ b/arch/xtensa/platforms/iss/include/platform/simcall.h
@@ -59,56 +59,58 @@
59 59
60static int errno; 60static int errno;
61 61
62static inline int __simc(int a, int b, int c, int d, int e, int f) 62static inline int __simc(int a, int b, int c, int d)
63{ 63{
64 int ret; 64 int ret;
65 register int a1 asm("a2") = a; 65 register int a1 asm("a2") = a;
66 register int b1 asm("a3") = b; 66 register int b1 asm("a3") = b;
67 register int c1 asm("a4") = c; 67 register int c1 asm("a4") = c;
68 register int d1 asm("a5") = d; 68 register int d1 asm("a5") = d;
69 register int e1 asm("a6") = e;
70 register int f1 asm("a7") = f;
71 __asm__ __volatile__ ( 69 __asm__ __volatile__ (
72 "simcall\n" 70 "simcall\n"
73 "mov %0, a2\n" 71 "mov %0, a2\n"
74 "mov %1, a3\n" 72 "mov %1, a3\n"
75 : "=a" (ret), "=a" (errno), "+r"(a1), "+r"(b1) 73 : "=a" (ret), "=a" (errno), "+r"(a1), "+r"(b1)
76 : "r"(c1), "r"(d1), "r"(e1), "r"(f1) 74 : "r"(c1), "r"(d1)
77 : "memory"); 75 : "memory");
78 return ret; 76 return ret;
79} 77}
80 78
81static inline int simc_open(const char *file, int flags, int mode) 79static inline int simc_open(const char *file, int flags, int mode)
82{ 80{
83 return __simc(SYS_open, (int) file, flags, mode, 0, 0); 81 return __simc(SYS_open, (int) file, flags, mode);
84} 82}
85 83
86static inline int simc_close(int fd) 84static inline int simc_close(int fd)
87{ 85{
88 return __simc(SYS_close, fd, 0, 0, 0, 0); 86 return __simc(SYS_close, fd, 0, 0);
89} 87}
90 88
91static inline int simc_ioctl(int fd, int request, void *arg) 89static inline int simc_ioctl(int fd, int request, void *arg)
92{ 90{
93 return __simc(SYS_ioctl, fd, request, (int) arg, 0, 0); 91 return __simc(SYS_ioctl, fd, request, (int) arg);
94} 92}
95 93
96static inline int simc_read(int fd, void *buf, size_t count) 94static inline int simc_read(int fd, void *buf, size_t count)
97{ 95{
98 return __simc(SYS_read, fd, (int) buf, count, 0, 0); 96 return __simc(SYS_read, fd, (int) buf, count);
99} 97}
100 98
101static inline int simc_write(int fd, const void *buf, size_t count) 99static inline int simc_write(int fd, const void *buf, size_t count)
102{ 100{
103 return __simc(SYS_write, fd, (int) buf, count, 0, 0); 101 return __simc(SYS_write, fd, (int) buf, count);
104} 102}
105 103
106static inline int simc_poll(int fd) 104static inline int simc_poll(int fd)
107{ 105{
108 struct timeval tv = { .tv_sec = 0, .tv_usec = 0 }; 106 struct timeval tv = { .tv_sec = 0, .tv_usec = 0 };
109 107
110 return __simc(SYS_select_one, fd, XTISS_SELECT_ONE_READ, (int)&tv, 108 return __simc(SYS_select_one, fd, XTISS_SELECT_ONE_READ, (int)&tv);
111 0, 0); 109}
110
111static inline int simc_lseek(int fd, uint32_t off, int whence)
112{
113 return __simc(SYS_lseek, fd, off, whence);
112} 114}
113 115
114#endif /* _XTENSA_PLATFORM_ISS_SIMCALL_H */ 116#endif /* _XTENSA_PLATFORM_ISS_SIMCALL_H */
diff --git a/arch/xtensa/platforms/iss/simdisk.c b/arch/xtensa/platforms/iss/simdisk.c
index f58ffc3b68a8..74f86fbab742 100644
--- a/arch/xtensa/platforms/iss/simdisk.c
+++ b/arch/xtensa/platforms/iss/simdisk.c
@@ -85,7 +85,7 @@ static void simdisk_transfer(struct simdisk *dev, unsigned long sector,
85 while (nbytes > 0) { 85 while (nbytes > 0) {
86 unsigned long io; 86 unsigned long io;
87 87
88 __simc(SYS_lseek, dev->fd, offset, SEEK_SET, 0, 0); 88 simc_lseek(dev->fd, offset, SEEK_SET);
89 if (write) 89 if (write)
90 io = simc_write(dev->fd, buffer, nbytes); 90 io = simc_write(dev->fd, buffer, nbytes);
91 else 91 else
@@ -177,7 +177,7 @@ static int simdisk_attach(struct simdisk *dev, const char *filename)
177 err = -ENODEV; 177 err = -ENODEV;
178 goto out; 178 goto out;
179 } 179 }
180 dev->size = __simc(SYS_lseek, dev->fd, 0, SEEK_END, 0, 0); 180 dev->size = simc_lseek(dev->fd, 0, SEEK_END);
181 set_capacity(dev->gd, dev->size >> SECTOR_SHIFT); 181 set_capacity(dev->gd, dev->size >> SECTOR_SHIFT);
182 dev->filename = filename; 182 dev->filename = filename;
183 pr_info("SIMDISK: %s=%s\n", dev->gd->disk_name, dev->filename); 183 pr_info("SIMDISK: %s=%s\n", dev->gd->disk_name, dev->filename);