aboutsummaryrefslogtreecommitdiffstats
path: root/arch/frv
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2010-06-16 12:08:13 -0400
committerJiri Kosina <jkosina@suse.cz>2010-06-16 12:08:13 -0400
commitf1bbbb6912662b9f6070c5bfc4ca9eb1f06a9d5b (patch)
treec2c130a74be25b0b2dff992e1a195e2728bdaadd /arch/frv
parentfd0961ff67727482bb20ca7e8ea97b83e9de2ddb (diff)
parent7e27d6e778cd87b6f2415515d7127eba53fe5d02 (diff)
Merge branch 'master' into for-next
Diffstat (limited to 'arch/frv')
-rw-r--r--arch/frv/include/asm/gdb-stub.h7
-rw-r--r--arch/frv/include/asm/mem-layout.h4
-rw-r--r--arch/frv/include/asm/scatterlist.h40
-rw-r--r--arch/frv/kernel/break.S4
-rw-r--r--arch/frv/kernel/entry.S2
-rw-r--r--arch/frv/kernel/gdb-io.c4
-rw-r--r--arch/frv/kernel/gdb-stub.c67
-rw-r--r--arch/frv/kernel/head.S2
-rw-r--r--arch/frv/kernel/ptrace.c20
-rw-r--r--arch/frv/kernel/sysctl.c18
-rw-r--r--arch/frv/kernel/vmlinux.lds.S10
-rw-r--r--arch/frv/mm/fault.c8
-rw-r--r--arch/frv/mm/tlb-miss.S2
13 files changed, 103 insertions, 85 deletions
diff --git a/arch/frv/include/asm/gdb-stub.h b/arch/frv/include/asm/gdb-stub.h
index 2da716407ff2..e6bedd0cd9a5 100644
--- a/arch/frv/include/asm/gdb-stub.h
+++ b/arch/frv/include/asm/gdb-stub.h
@@ -12,6 +12,7 @@
12#ifndef __ASM_GDB_STUB_H 12#ifndef __ASM_GDB_STUB_H
13#define __ASM_GDB_STUB_H 13#define __ASM_GDB_STUB_H
14 14
15#undef GDBSTUB_DEBUG_IO
15#undef GDBSTUB_DEBUG_PROTOCOL 16#undef GDBSTUB_DEBUG_PROTOCOL
16 17
17#include <asm/ptrace.h> 18#include <asm/ptrace.h>
@@ -108,6 +109,12 @@ extern void gdbstub_printk(const char *fmt, ...);
108extern void debug_to_serial(const char *p, int n); 109extern void debug_to_serial(const char *p, int n);
109extern void console_set_baud(unsigned baud); 110extern void console_set_baud(unsigned baud);
110 111
112#ifdef GDBSTUB_DEBUG_IO
113#define gdbstub_io(FMT,...) gdbstub_printk(FMT, ##__VA_ARGS__)
114#else
115#define gdbstub_io(FMT,...) ({ 0; })
116#endif
117
111#ifdef GDBSTUB_DEBUG_PROTOCOL 118#ifdef GDBSTUB_DEBUG_PROTOCOL
112#define gdbstub_proto(FMT,...) gdbstub_printk(FMT,##__VA_ARGS__) 119#define gdbstub_proto(FMT,...) gdbstub_printk(FMT,##__VA_ARGS__)
113#else 120#else
diff --git a/arch/frv/include/asm/mem-layout.h b/arch/frv/include/asm/mem-layout.h
index 2947764fc0e0..ccae981876fa 100644
--- a/arch/frv/include/asm/mem-layout.h
+++ b/arch/frv/include/asm/mem-layout.h
@@ -35,8 +35,8 @@
35 * the slab must be aligned such that load- and store-double instructions don't 35 * the slab must be aligned such that load- and store-double instructions don't
36 * fault if used 36 * fault if used
37 */ 37 */
38#define ARCH_KMALLOC_MINALIGN 8 38#define ARCH_KMALLOC_MINALIGN L1_CACHE_BYTES
39#define ARCH_SLAB_MINALIGN 8 39#define ARCH_SLAB_MINALIGN L1_CACHE_BYTES
40 40
41/*****************************************************************************/ 41/*****************************************************************************/
42/* 42/*
diff --git a/arch/frv/include/asm/scatterlist.h b/arch/frv/include/asm/scatterlist.h
index 4bca8a28546c..1614bfd7e3a4 100644
--- a/arch/frv/include/asm/scatterlist.h
+++ b/arch/frv/include/asm/scatterlist.h
@@ -1,45 +1,7 @@
1#ifndef _ASM_SCATTERLIST_H 1#ifndef _ASM_SCATTERLIST_H
2#define _ASM_SCATTERLIST_H 2#define _ASM_SCATTERLIST_H
3 3
4#include <asm/types.h> 4#include <asm-generic/scatterlist.h>
5
6/*
7 * Drivers must set either ->address or (preferred) page and ->offset
8 * to indicate where data must be transferred to/from.
9 *
10 * Using page is recommended since it handles highmem data as well as
11 * low mem. ->address is restricted to data which has a virtual mapping, and
12 * it will go away in the future. Updating to page can be automated very
13 * easily -- something like
14 *
15 * sg->address = some_ptr;
16 *
17 * can be rewritten as
18 *
19 * sg_set_buf(sg, some_ptr, length);
20 *
21 * and that's it. There's no excuse for not highmem enabling YOUR driver. /jens
22 */
23struct scatterlist {
24#ifdef CONFIG_DEBUG_SG
25 unsigned long sg_magic;
26#endif
27 unsigned long page_link;
28 unsigned int offset; /* for highmem, page offset */
29
30 dma_addr_t dma_address;
31 unsigned int length;
32};
33
34/*
35 * These macros should be used after a pci_map_sg call has been done
36 * to get bus addresses of each of the SG entries and their lengths.
37 * You should only work with the number of sg entries pci_map_sg
38 * returns, or alternatively stop on the first sg_dma_len(sg) which
39 * is 0.
40 */
41#define sg_dma_address(sg) ((sg)->dma_address)
42#define sg_dma_len(sg) ((sg)->length)
43 5
44#define ISA_DMA_THRESHOLD (0xffffffffUL) 6#define ISA_DMA_THRESHOLD (0xffffffffUL)
45 7
diff --git a/arch/frv/kernel/break.S b/arch/frv/kernel/break.S
index bd0bdf908d93..cbb6958a3147 100644
--- a/arch/frv/kernel/break.S
+++ b/arch/frv/kernel/break.S
@@ -21,7 +21,7 @@
21# 21#
22# the break handler has its own stack 22# the break handler has its own stack
23# 23#
24 .section .bss.stack 24 .section .bss..stack
25 .globl __break_user_context 25 .globl __break_user_context
26 .balign THREAD_SIZE 26 .balign THREAD_SIZE
27__break_stack: 27__break_stack:
@@ -63,7 +63,7 @@ __break_trace_through_exceptions:
63# entry point for Break Exceptions/Interrupts 63# entry point for Break Exceptions/Interrupts
64# 64#
65############################################################################### 65###############################################################################
66 .section .text.break 66 .section .text..break
67 .balign 4 67 .balign 4
68 .globl __entry_break 68 .globl __entry_break
69__entry_break: 69__entry_break:
diff --git a/arch/frv/kernel/entry.S b/arch/frv/kernel/entry.S
index 189397ec012a..63d579bf1c29 100644
--- a/arch/frv/kernel/entry.S
+++ b/arch/frv/kernel/entry.S
@@ -38,7 +38,7 @@
38 38
39#define nr_syscalls ((syscall_table_size)/4) 39#define nr_syscalls ((syscall_table_size)/4)
40 40
41 .section .text.entry 41 .section .text..entry
42 .balign 4 42 .balign 4
43 43
44.macro LEDS val 44.macro LEDS val
diff --git a/arch/frv/kernel/gdb-io.c b/arch/frv/kernel/gdb-io.c
index c997bccb9221..2ca641d199f8 100644
--- a/arch/frv/kernel/gdb-io.c
+++ b/arch/frv/kernel/gdb-io.c
@@ -171,11 +171,11 @@ int gdbstub_rx_char(unsigned char *_ch, int nonblock)
171 return -EINTR; 171 return -EINTR;
172 } 172 }
173 else if (st & (UART_LSR_FE|UART_LSR_OE|UART_LSR_PE)) { 173 else if (st & (UART_LSR_FE|UART_LSR_OE|UART_LSR_PE)) {
174 gdbstub_proto("### GDB Rx Error (st=%02x) ###\n",st); 174 gdbstub_io("### GDB Rx Error (st=%02x) ###\n",st);
175 return -EIO; 175 return -EIO;
176 } 176 }
177 else { 177 else {
178 gdbstub_proto("### GDB Rx %02x (st=%02x) ###\n",ch,st); 178 gdbstub_io("### GDB Rx %02x (st=%02x) ###\n",ch,st);
179 *_ch = ch & 0x7f; 179 *_ch = ch & 0x7f;
180 return 0; 180 return 0;
181 } 181 }
diff --git a/arch/frv/kernel/gdb-stub.c b/arch/frv/kernel/gdb-stub.c
index 7ca8a6b19ac9..a4dba6b20bd0 100644
--- a/arch/frv/kernel/gdb-stub.c
+++ b/arch/frv/kernel/gdb-stub.c
@@ -1344,6 +1344,44 @@ void gdbstub_get_mmu_state(void)
1344 1344
1345} /* end gdbstub_get_mmu_state() */ 1345} /* end gdbstub_get_mmu_state() */
1346 1346
1347/*
1348 * handle general query commands of the form 'qXXXXX'
1349 */
1350static void gdbstub_handle_query(void)
1351{
1352 if (strcmp(input_buffer, "qAttached") == 0) {
1353 /* return current thread ID */
1354 sprintf(output_buffer, "1");
1355 return;
1356 }
1357
1358 if (strcmp(input_buffer, "qC") == 0) {
1359 /* return current thread ID */
1360 sprintf(output_buffer, "QC 0");
1361 return;
1362 }
1363
1364 if (strcmp(input_buffer, "qOffsets") == 0) {
1365 /* return relocation offset of text and data segments */
1366 sprintf(output_buffer, "Text=0;Data=0;Bss=0");
1367 return;
1368 }
1369
1370 if (strcmp(input_buffer, "qSymbol::") == 0) {
1371 sprintf(output_buffer, "OK");
1372 return;
1373 }
1374
1375 if (strcmp(input_buffer, "qSupported") == 0) {
1376 /* query of supported features */
1377 sprintf(output_buffer, "PacketSize=%u;ReverseContinue-;ReverseStep-",
1378 sizeof(input_buffer));
1379 return;
1380 }
1381
1382 gdbstub_strcpy(output_buffer,"E01");
1383}
1384
1347/*****************************************************************************/ 1385/*****************************************************************************/
1348/* 1386/*
1349 * handle event interception and GDB remote protocol processing 1387 * handle event interception and GDB remote protocol processing
@@ -1751,6 +1789,12 @@ void gdbstub(int sigval)
1751 flush_cache = 1; 1789 flush_cache = 1;
1752 break; 1790 break;
1753 1791
1792 /* pNN: Read value of reg N and return it */
1793 case 'p':
1794 /* return no value, indicating that we don't support
1795 * this command and that gdb should use 'g' instead */
1796 break;
1797
1754 /* PNN,=RRRRRRRR: Write value R to reg N return OK */ 1798 /* PNN,=RRRRRRRR: Write value R to reg N return OK */
1755 case 'P': 1799 case 'P':
1756 ptr = &input_buffer[1]; 1800 ptr = &input_buffer[1];
@@ -1840,6 +1884,10 @@ void gdbstub(int sigval)
1840 case 'k' : 1884 case 'k' :
1841 goto done; /* just continue */ 1885 goto done; /* just continue */
1842 1886
1887 /* detach */
1888 case 'D':
1889 gdbstub_strcpy(output_buffer, "OK");
1890 break;
1843 1891
1844 /* reset the whole machine (FIXME: system dependent) */ 1892 /* reset the whole machine (FIXME: system dependent) */
1845 case 'r': 1893 case 'r':
@@ -1852,6 +1900,14 @@ void gdbstub(int sigval)
1852 __debug_status.dcr |= DCR_SE; 1900 __debug_status.dcr |= DCR_SE;
1853 goto done; 1901 goto done;
1854 1902
1903 /* extended command */
1904 case 'v':
1905 if (strcmp(input_buffer, "vCont?") == 0) {
1906 output_buffer[0] = 0;
1907 break;
1908 }
1909 goto unsupported_cmd;
1910
1855 /* set baud rate (bBB) */ 1911 /* set baud rate (bBB) */
1856 case 'b': 1912 case 'b':
1857 ptr = &input_buffer[1]; 1913 ptr = &input_buffer[1];
@@ -1923,8 +1979,19 @@ void gdbstub(int sigval)
1923 gdbstub_strcpy(output_buffer,"OK"); 1979 gdbstub_strcpy(output_buffer,"OK");
1924 break; 1980 break;
1925 1981
1982 /* Thread-setting packet */
1983 case 'H':
1984 gdbstub_strcpy(output_buffer, "OK");
1985 break;
1986
1987 case 'q':
1988 gdbstub_handle_query();
1989 break;
1990
1926 default: 1991 default:
1992 unsupported_cmd:
1927 gdbstub_proto("### GDB Unsupported Cmd '%s'\n",input_buffer); 1993 gdbstub_proto("### GDB Unsupported Cmd '%s'\n",input_buffer);
1994 gdbstub_strcpy(output_buffer,"E01");
1928 break; 1995 break;
1929 } 1996 }
1930 1997
diff --git a/arch/frv/kernel/head.S b/arch/frv/kernel/head.S
index b825ef3f2d54..e9a8cc63ac94 100644
--- a/arch/frv/kernel/head.S
+++ b/arch/frv/kernel/head.S
@@ -542,7 +542,7 @@ __head_end:
542 .size _boot, .-_boot 542 .size _boot, .-_boot
543 543
544 # provide a point for GDB to place a break 544 # provide a point for GDB to place a break
545 .section .text.start,"ax" 545 .section .text..start,"ax"
546 .globl _start 546 .globl _start
547 .balign 4 547 .balign 4
548_start: 548_start:
diff --git a/arch/frv/kernel/ptrace.c b/arch/frv/kernel/ptrace.c
index 60eeed3694c0..fac028936a04 100644
--- a/arch/frv/kernel/ptrace.c
+++ b/arch/frv/kernel/ptrace.c
@@ -344,26 +344,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
344 0, sizeof(child->thread.user->f), 344 0, sizeof(child->thread.user->f),
345 (const void __user *)data); 345 (const void __user *)data);
346 346
347 case PTRACE_GETFDPIC:
348 tmp = 0;
349 switch (addr) {
350 case PTRACE_GETFDPIC_EXEC:
351 tmp = child->mm->context.exec_fdpic_loadmap;
352 break;
353 case PTRACE_GETFDPIC_INTERP:
354 tmp = child->mm->context.interp_fdpic_loadmap;
355 break;
356 default:
357 break;
358 }
359
360 ret = 0;
361 if (put_user(tmp, (unsigned long *) data)) {
362 ret = -EFAULT;
363 break;
364 }
365 break;
366
367 default: 347 default:
368 ret = ptrace_request(child, request, addr, data); 348 ret = ptrace_request(child, request, addr, data);
369 break; 349 break;
diff --git a/arch/frv/kernel/sysctl.c b/arch/frv/kernel/sysctl.c
index 71abd1510a59..6c155d69da29 100644
--- a/arch/frv/kernel/sysctl.c
+++ b/arch/frv/kernel/sysctl.c
@@ -46,8 +46,9 @@ static void frv_change_dcache_mode(unsigned long newmode)
46/* 46/*
47 * handle requests to dynamically switch the write caching mode delivered by /proc 47 * handle requests to dynamically switch the write caching mode delivered by /proc
48 */ 48 */
49static int procctl_frv_cachemode(ctl_table *table, int write, struct file *filp, 49static int procctl_frv_cachemode(ctl_table *table, int write,
50 void __user *buffer, size_t *lenp, loff_t *ppos) 50 void __user *buffer, size_t *lenp,
51 loff_t *ppos)
51{ 52{
52 unsigned long hsr0; 53 unsigned long hsr0;
53 char buff[8]; 54 char buff[8];
@@ -84,7 +85,7 @@ static int procctl_frv_cachemode(ctl_table *table, int write, struct file *filp,
84 } 85 }
85 86
86 /* read the state */ 87 /* read the state */
87 if (filp->f_pos > 0) { 88 if (*ppos > 0) {
88 *lenp = 0; 89 *lenp = 0;
89 return 0; 90 return 0;
90 } 91 }
@@ -110,7 +111,7 @@ static int procctl_frv_cachemode(ctl_table *table, int write, struct file *filp,
110 return -EFAULT; 111 return -EFAULT;
111 112
112 *lenp = len; 113 *lenp = len;
113 filp->f_pos = len; 114 *ppos = len;
114 return 0; 115 return 0;
115 116
116} /* end procctl_frv_cachemode() */ 117} /* end procctl_frv_cachemode() */
@@ -120,8 +121,9 @@ static int procctl_frv_cachemode(ctl_table *table, int write, struct file *filp,
120 * permit the mm_struct the nominated process is using have its MMU context ID pinned 121 * permit the mm_struct the nominated process is using have its MMU context ID pinned
121 */ 122 */
122#ifdef CONFIG_MMU 123#ifdef CONFIG_MMU
123static int procctl_frv_pin_cxnr(ctl_table *table, int write, struct file *filp, 124static int procctl_frv_pin_cxnr(ctl_table *table, int write,
124 void __user *buffer, size_t *lenp, loff_t *ppos) 125 void __user *buffer, size_t *lenp,
126 loff_t *ppos)
125{ 127{
126 pid_t pid; 128 pid_t pid;
127 char buff[16], *p; 129 char buff[16], *p;
@@ -150,7 +152,7 @@ static int procctl_frv_pin_cxnr(ctl_table *table, int write, struct file *filp,
150 } 152 }
151 153
152 /* read the currently pinned CXN */ 154 /* read the currently pinned CXN */
153 if (filp->f_pos > 0) { 155 if (*ppos > 0) {
154 *lenp = 0; 156 *lenp = 0;
155 return 0; 157 return 0;
156 } 158 }
@@ -163,7 +165,7 @@ static int procctl_frv_pin_cxnr(ctl_table *table, int write, struct file *filp,
163 return -EFAULT; 165 return -EFAULT;
164 166
165 *lenp = len; 167 *lenp = len;
166 filp->f_pos = len; 168 *ppos = len;
167 return 0; 169 return 0;
168 170
169} /* end procctl_frv_pin_cxnr() */ 171} /* end procctl_frv_pin_cxnr() */
diff --git a/arch/frv/kernel/vmlinux.lds.S b/arch/frv/kernel/vmlinux.lds.S
index cbe811fccfcc..8b973f3cc90e 100644
--- a/arch/frv/kernel/vmlinux.lds.S
+++ b/arch/frv/kernel/vmlinux.lds.S
@@ -57,10 +57,10 @@ SECTIONS
57 _text = .; 57 _text = .;
58 _stext = .; 58 _stext = .;
59 .text : { 59 .text : {
60 *(.text.start) 60 *(.text..start)
61 *(.text.entry) 61 *(.text..entry)
62 *(.text.break) 62 *(.text..break)
63 *(.text.tlbmiss) 63 *(.text..tlbmiss)
64 TEXT_TEXT 64 TEXT_TEXT
65 SCHED_TEXT 65 SCHED_TEXT
66 LOCK_TEXT 66 LOCK_TEXT
@@ -114,7 +114,7 @@ SECTIONS
114 114
115 .sbss : { *(.sbss .sbss.*) } 115 .sbss : { *(.sbss .sbss.*) }
116 .bss : { *(.bss .bss.*) } 116 .bss : { *(.bss .bss.*) }
117 .bss.stack : { *(.bss) } 117 .bss..stack : { *(.bss) }
118 118
119 __bss_stop = .; 119 __bss_stop = .;
120 _end = . ; 120 _end = . ;
diff --git a/arch/frv/mm/fault.c b/arch/frv/mm/fault.c
index 30f5d100a81c..a325d57a83d5 100644
--- a/arch/frv/mm/fault.c
+++ b/arch/frv/mm/fault.c
@@ -257,10 +257,10 @@ asmlinkage void do_page_fault(int datammu, unsigned long esr0, unsigned long ear
257 */ 257 */
258 out_of_memory: 258 out_of_memory:
259 up_read(&mm->mmap_sem); 259 up_read(&mm->mmap_sem);
260 printk("VM: killing process %s\n", current->comm); 260 if (!user_mode(__frame))
261 if (user_mode(__frame)) 261 goto no_context;
262 do_group_exit(SIGKILL); 262 pagefault_out_of_memory();
263 goto no_context; 263 return;
264 264
265 do_sigbus: 265 do_sigbus:
266 up_read(&mm->mmap_sem); 266 up_read(&mm->mmap_sem);
diff --git a/arch/frv/mm/tlb-miss.S b/arch/frv/mm/tlb-miss.S
index 7f392bc651a3..f3ac019bb18b 100644
--- a/arch/frv/mm/tlb-miss.S
+++ b/arch/frv/mm/tlb-miss.S
@@ -15,7 +15,7 @@
15#include <asm/pgtable.h> 15#include <asm/pgtable.h>
16#include <asm/spr-regs.h> 16#include <asm/spr-regs.h>
17 17
18 .section .text.tlbmiss 18 .section .text..tlbmiss
19 .balign 4 19 .balign 4
20 20
21 .globl __entry_insn_mmu_miss 21 .globl __entry_insn_mmu_miss