aboutsummaryrefslogtreecommitdiffstats
path: root/arch/frv
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.cz>2010-08-04 07:59:13 -0400
committerMichal Marek <mmarek@suse.cz>2010-08-04 07:59:13 -0400
commit772320e84588dcbe1600ffb83e5f328f2209ac2a (patch)
treea7de21b79340aeaa17c58126f6b801b82c77b53a /arch/frv
parent1ce53adf13a54375d2a5c7cdbe341b2558389615 (diff)
parent9fe6206f400646a2322096b56c59891d530e8d51 (diff)
Merge commit 'v2.6.35' into kbuild/kbuild
Conflicts: arch/powerpc/Makefile
Diffstat (limited to 'arch/frv')
-rw-r--r--arch/frv/include/asm/atomic.h2
-rw-r--r--arch/frv/include/asm/dma-mapping.h41
-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/pci.h45
-rw-r--r--arch/frv/include/asm/pgtable.h2
-rw-r--r--arch/frv/include/asm/ptrace.h2
-rw-r--r--arch/frv/include/asm/scatterlist.h40
-rw-r--r--arch/frv/include/asm/segment.h6
-rw-r--r--arch/frv/include/asm/thread_info.h2
-rw-r--r--arch/frv/include/asm/uaccess.h2
-rw-r--r--arch/frv/include/asm/unistd.h1
-rw-r--r--arch/frv/kernel/gdb-io.c4
-rw-r--r--arch/frv/kernel/gdb-stub.c67
-rw-r--r--arch/frv/kernel/irq.c1
-rw-r--r--arch/frv/kernel/ptrace.c20
-rw-r--r--arch/frv/kernel/sys_frv.c89
-rw-r--r--arch/frv/kernel/sysctl.c19
-rw-r--r--arch/frv/kernel/time.c34
-rw-r--r--arch/frv/mb93090-mb00/pci-dma-nommu.c30
-rw-r--r--arch/frv/mb93090-mb00/pci-dma.c31
-rw-r--r--arch/frv/mb93090-mb00/pci-frv.c20
-rw-r--r--arch/frv/mb93090-mb00/pci-irq.c1
-rw-r--r--arch/frv/mb93090-mb00/pci-vdk.c1
-rw-r--r--arch/frv/mm/dma-alloc.c1
-rw-r--r--arch/frv/mm/fault.c8
-rw-r--r--arch/frv/mm/init.c1
-rw-r--r--arch/frv/mm/pgalloc.c2
28 files changed, 123 insertions, 360 deletions
diff --git a/arch/frv/include/asm/atomic.h b/arch/frv/include/asm/atomic.h
index 00a57af79afc..fae32c7fdcb6 100644
--- a/arch/frv/include/asm/atomic.h
+++ b/arch/frv/include/asm/atomic.h
@@ -36,7 +36,7 @@
36#define smp_mb__after_atomic_inc() barrier() 36#define smp_mb__after_atomic_inc() barrier()
37 37
38#define ATOMIC_INIT(i) { (i) } 38#define ATOMIC_INIT(i) { (i) }
39#define atomic_read(v) ((v)->counter) 39#define atomic_read(v) (*(volatile int *)&(v)->counter)
40#define atomic_set(v, i) (((v)->counter) = (i)) 40#define atomic_set(v, i) (((v)->counter) = (i))
41 41
42#ifndef CONFIG_FRV_OUTOFLINE_ATOMIC_OPS 42#ifndef CONFIG_FRV_OUTOFLINE_ATOMIC_OPS
diff --git a/arch/frv/include/asm/dma-mapping.h b/arch/frv/include/asm/dma-mapping.h
index b2898877c07b..6af5d83e2fb2 100644
--- a/arch/frv/include/asm/dma-mapping.h
+++ b/arch/frv/include/asm/dma-mapping.h
@@ -7,6 +7,11 @@
7#include <asm/scatterlist.h> 7#include <asm/scatterlist.h>
8#include <asm/io.h> 8#include <asm/io.h>
9 9
10/*
11 * See Documentation/DMA-API.txt for the description of how the
12 * following DMA API should work.
13 */
14
10#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) 15#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
11#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) 16#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
12 17
@@ -16,24 +21,9 @@ extern unsigned long __nongprelbss dma_coherent_mem_end;
16void *dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t gfp); 21void *dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t gfp);
17void dma_free_coherent(struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle); 22void dma_free_coherent(struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle);
18 23
19/*
20 * Map a single buffer of the indicated size for DMA in streaming mode.
21 * The 32-bit bus address to use is returned.
22 *
23 * Once the device is given the dma address, the device owns this memory
24 * until either pci_unmap_single or pci_dma_sync_single is performed.
25 */
26extern dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size, 24extern dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size,
27 enum dma_data_direction direction); 25 enum dma_data_direction direction);
28 26
29/*
30 * Unmap a single streaming mode DMA translation. The dma_addr and size
31 * must match what was provided for in a previous pci_map_single call. All
32 * other usages are undefined.
33 *
34 * After this call, reads by the cpu to the buffer are guarenteed to see
35 * whatever the device wrote there.
36 */
37static inline 27static inline
38void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, 28void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
39 enum dma_data_direction direction) 29 enum dma_data_direction direction)
@@ -41,30 +31,9 @@ void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
41 BUG_ON(direction == DMA_NONE); 31 BUG_ON(direction == DMA_NONE);
42} 32}
43 33
44/*
45 * Map a set of buffers described by scatterlist in streaming
46 * mode for DMA. This is the scather-gather version of the
47 * above pci_map_single interface. Here the scatter gather list
48 * elements are each tagged with the appropriate dma address
49 * and length. They are obtained via sg_dma_{address,length}(SG).
50 *
51 * NOTE: An implementation may be able to use a smaller number of
52 * DMA address/length pairs than there are SG table elements.
53 * (for example via virtual mapping capabilities)
54 * The routine returns the number of addr/length pairs actually
55 * used, at most nents.
56 *
57 * Device ownership issues as mentioned above for pci_map_single are
58 * the same here.
59 */
60extern int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, 34extern int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
61 enum dma_data_direction direction); 35 enum dma_data_direction direction);
62 36
63/*
64 * Unmap a set of streaming mode DMA translations.
65 * Again, cpu read rules concerning calls here are the same as for
66 * pci_unmap_single() above.
67 */
68static inline 37static inline
69void dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries, 38void dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
70 enum dma_data_direction direction) 39 enum dma_data_direction direction)
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/pci.h b/arch/frv/include/asm/pci.h
index 492b5c4dfed6..0d5997909850 100644
--- a/arch/frv/include/asm/pci.h
+++ b/arch/frv/include/asm/pci.h
@@ -43,14 +43,6 @@ extern void pci_free_consistent(struct pci_dev *hwdev, size_t size,
43/* Return the index of the PCI controller for device PDEV. */ 43/* Return the index of the PCI controller for device PDEV. */
44#define pci_controller_num(PDEV) (0) 44#define pci_controller_num(PDEV) (0)
45 45
46/* pci_unmap_{page,single} is a nop so... */
47#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
48#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
49#define pci_unmap_addr(PTR, ADDR_NAME) (0)
50#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
51#define pci_unmap_len(PTR, LEN_NAME) (0)
52#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
53
54#ifdef CONFIG_PCI 46#ifdef CONFIG_PCI
55static inline void pci_dma_burst_advice(struct pci_dev *pdev, 47static inline void pci_dma_burst_advice(struct pci_dev *pdev,
56 enum pci_dma_burst_strategy *strat, 48 enum pci_dma_burst_strategy *strat,
@@ -68,41 +60,4 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev,
68#define PCIBIOS_MIN_IO 0x100 60#define PCIBIOS_MIN_IO 0x100
69#define PCIBIOS_MIN_MEM 0x00010000 61#define PCIBIOS_MIN_MEM 0x00010000
70 62
71/* Make physical memory consistent for a single
72 * streaming mode DMA translation after a transfer.
73 *
74 * If you perform a pci_map_single() but wish to interrogate the
75 * buffer using the cpu, yet do not wish to teardown the PCI dma
76 * mapping, you must call this function before doing so. At the
77 * next point you give the PCI dma address back to the card, the
78 * device again owns the buffer.
79 */
80static inline void pci_dma_sync_single(struct pci_dev *hwdev,
81 dma_addr_t dma_handle,
82 size_t size, int direction)
83{
84 BUG_ON(direction == PCI_DMA_NONE);
85
86 frv_cache_wback_inv((unsigned long)bus_to_virt(dma_handle),
87 (unsigned long)bus_to_virt(dma_handle) + size);
88}
89
90/* Make physical memory consistent for a set of streaming
91 * mode DMA translations after a transfer.
92 *
93 * The same as pci_dma_sync_single but for a scatter-gather list,
94 * same rules and usage.
95 */
96static inline void pci_dma_sync_sg(struct pci_dev *hwdev,
97 struct scatterlist *sg,
98 int nelems, int direction)
99{
100 int i;
101 BUG_ON(direction == PCI_DMA_NONE);
102
103 for (i = 0; i < nelems; i++)
104 frv_cache_wback_inv(sg_dma_address(&sg[i]),
105 sg_dma_address(&sg[i])+sg_dma_len(&sg[i]));
106}
107
108#endif /* _ASM_FRV_PCI_H */ 63#endif /* _ASM_FRV_PCI_H */
diff --git a/arch/frv/include/asm/pgtable.h b/arch/frv/include/asm/pgtable.h
index 22c60692b551..c18b0d32e636 100644
--- a/arch/frv/include/asm/pgtable.h
+++ b/arch/frv/include/asm/pgtable.h
@@ -505,7 +505,7 @@ static inline int pte_file(pte_t pte)
505/* 505/*
506 * preload information about a newly instantiated PTE into the SCR0/SCR1 PGE cache 506 * preload information about a newly instantiated PTE into the SCR0/SCR1 PGE cache
507 */ 507 */
508static inline void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte) 508static inline void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep)
509{ 509{
510 struct mm_struct *mm; 510 struct mm_struct *mm;
511 unsigned long ampr; 511 unsigned long ampr;
diff --git a/arch/frv/include/asm/ptrace.h b/arch/frv/include/asm/ptrace.h
index a54b535c9e49..6bfad4cf1907 100644
--- a/arch/frv/include/asm/ptrace.h
+++ b/arch/frv/include/asm/ptrace.h
@@ -84,8 +84,6 @@ extern void show_regs(struct pt_regs *);
84#define task_pt_regs(task) ((task)->thread.frame0) 84#define task_pt_regs(task) ((task)->thread.frame0)
85 85
86#define arch_has_single_step() (1) 86#define arch_has_single_step() (1)
87extern void user_enable_single_step(struct task_struct *);
88extern void user_disable_single_step(struct task_struct *);
89 87
90#endif /* !__ASSEMBLY__ */ 88#endif /* !__ASSEMBLY__ */
91#endif /* __KERNEL__ */ 89#endif /* __KERNEL__ */
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/include/asm/segment.h b/arch/frv/include/asm/segment.h
index e3616a6f941d..a2320a4a0042 100644
--- a/arch/frv/include/asm/segment.h
+++ b/arch/frv/include/asm/segment.h
@@ -21,12 +21,12 @@ typedef struct {
21 21
22#define MAKE_MM_SEG(s) ((mm_segment_t) { (s) }) 22#define MAKE_MM_SEG(s) ((mm_segment_t) { (s) })
23 23
24#define KERNEL_DS MAKE_MM_SEG(0xdfffffffUL)
25
26#ifdef CONFIG_MMU 24#ifdef CONFIG_MMU
27#define USER_DS MAKE_MM_SEG(TASK_SIZE - 1) 25#define USER_DS MAKE_MM_SEG(TASK_SIZE - 1)
26#define KERNEL_DS MAKE_MM_SEG(0xdfffffffUL)
28#else 27#else
29#define USER_DS KERNEL_DS 28#define USER_DS MAKE_MM_SEG(memory_end)
29#define KERNEL_DS MAKE_MM_SEG(0xe0000000UL)
30#endif 30#endif
31 31
32#define get_ds() (KERNEL_DS) 32#define get_ds() (KERNEL_DS)
diff --git a/arch/frv/include/asm/thread_info.h b/arch/frv/include/asm/thread_info.h
index e608e056bb53..11f33ead29bf 100644
--- a/arch/frv/include/asm/thread_info.h
+++ b/arch/frv/include/asm/thread_info.h
@@ -113,7 +113,7 @@ register struct thread_info *__current_thread_info asm("gr15");
113#define TIF_SINGLESTEP 4 /* restore singlestep on return to user mode */ 113#define TIF_SINGLESTEP 4 /* restore singlestep on return to user mode */
114#define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */ 114#define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */
115#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ 115#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */
116#define TIF_MEMDIE 17 /* OOM killer killed process */ 116#define TIF_MEMDIE 17 /* is terminating due to OOM killer */
117#define TIF_FREEZE 18 /* freezing for suspend */ 117#define TIF_FREEZE 18 /* freezing for suspend */
118 118
119#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) 119#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
diff --git a/arch/frv/include/asm/uaccess.h b/arch/frv/include/asm/uaccess.h
index 53650c958f41..0b67ec5b4414 100644
--- a/arch/frv/include/asm/uaccess.h
+++ b/arch/frv/include/asm/uaccess.h
@@ -27,8 +27,6 @@
27#define VERIFY_READ 0 27#define VERIFY_READ 0
28#define VERIFY_WRITE 1 28#define VERIFY_WRITE 1
29 29
30#define __addr_ok(addr) ((unsigned long)(addr) < get_addr_limit())
31
32/* 30/*
33 * check that a range of addresses falls within the current address limit 31 * check that a range of addresses falls within the current address limit
34 */ 32 */
diff --git a/arch/frv/include/asm/unistd.h b/arch/frv/include/asm/unistd.h
index be6ef0f5cd42..b28da499e22a 100644
--- a/arch/frv/include/asm/unistd.h
+++ b/arch/frv/include/asm/unistd.h
@@ -354,6 +354,7 @@
354#define __ARCH_WANT_STAT64 354#define __ARCH_WANT_STAT64
355#define __ARCH_WANT_SYS_ALARM 355#define __ARCH_WANT_SYS_ALARM
356/* #define __ARCH_WANT_SYS_GETHOSTNAME */ 356/* #define __ARCH_WANT_SYS_GETHOSTNAME */
357#define __ARCH_WANT_SYS_IPC
357#define __ARCH_WANT_SYS_PAUSE 358#define __ARCH_WANT_SYS_PAUSE
358/* #define __ARCH_WANT_SYS_SGETMASK */ 359/* #define __ARCH_WANT_SYS_SGETMASK */
359/* #define __ARCH_WANT_SYS_SIGNAL */ 360/* #define __ARCH_WANT_SYS_SIGNAL */
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/irq.c b/arch/frv/kernel/irq.c
index 62d1aba615dc..625136625a7f 100644
--- a/arch/frv/kernel/irq.c
+++ b/arch/frv/kernel/irq.c
@@ -16,7 +16,6 @@
16#include <linux/ioport.h> 16#include <linux/ioport.h>
17#include <linux/interrupt.h> 17#include <linux/interrupt.h>
18#include <linux/timex.h> 18#include <linux/timex.h>
19#include <linux/slab.h>
20#include <linux/random.h> 19#include <linux/random.h>
21#include <linux/init.h> 20#include <linux/init.h>
22#include <linux/kernel_stat.h> 21#include <linux/kernel_stat.h>
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/sys_frv.c b/arch/frv/kernel/sys_frv.c
index 1d3d4c9e2521..9c4980825bbb 100644
--- a/arch/frv/kernel/sys_frv.c
+++ b/arch/frv/kernel/sys_frv.c
@@ -42,92 +42,3 @@ asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
42 return sys_mmap_pgoff(addr, len, prot, flags, fd, 42 return sys_mmap_pgoff(addr, len, prot, flags, fd,
43 pgoff >> (PAGE_SHIFT - 12)); 43 pgoff >> (PAGE_SHIFT - 12));
44} 44}
45
46/*
47 * sys_ipc() is the de-multiplexer for the SysV IPC calls..
48 *
49 * This is really horribly ugly.
50 */
51asmlinkage long sys_ipc(unsigned long call,
52 unsigned long first,
53 unsigned long second,
54 unsigned long third,
55 void __user *ptr,
56 unsigned long fifth)
57{
58 int version, ret;
59
60 version = call >> 16; /* hack for backward compatibility */
61 call &= 0xffff;
62
63 switch (call) {
64 case SEMOP:
65 return sys_semtimedop(first, (struct sembuf __user *)ptr, second, NULL);
66 case SEMTIMEDOP:
67 return sys_semtimedop(first, (struct sembuf __user *)ptr, second,
68 (const struct timespec __user *)fifth);
69
70 case SEMGET:
71 return sys_semget (first, second, third);
72 case SEMCTL: {
73 union semun fourth;
74 if (!ptr)
75 return -EINVAL;
76 if (get_user(fourth.__pad, (void * __user *) ptr))
77 return -EFAULT;
78 return sys_semctl (first, second, third, fourth);
79 }
80
81 case MSGSND:
82 return sys_msgsnd (first, (struct msgbuf __user *) ptr,
83 second, third);
84 case MSGRCV:
85 switch (version) {
86 case 0: {
87 struct ipc_kludge tmp;
88 if (!ptr)
89 return -EINVAL;
90
91 if (copy_from_user(&tmp,
92 (struct ipc_kludge __user *) ptr,
93 sizeof (tmp)))
94 return -EFAULT;
95 return sys_msgrcv (first, tmp.msgp, second,
96 tmp.msgtyp, third);
97 }
98 default:
99 return sys_msgrcv (first,
100 (struct msgbuf __user *) ptr,
101 second, fifth, third);
102 }
103 case MSGGET:
104 return sys_msgget ((key_t) first, second);
105 case MSGCTL:
106 return sys_msgctl (first, second, (struct msqid_ds __user *) ptr);
107
108 case SHMAT:
109 switch (version) {
110 default: {
111 ulong raddr;
112 ret = do_shmat (first, (char __user *) ptr, second, &raddr);
113 if (ret)
114 return ret;
115 return put_user (raddr, (ulong __user *) third);
116 }
117 case 1: /* iBCS2 emulator entry point */
118 if (!segment_eq(get_fs(), get_ds()))
119 return -EINVAL;
120 /* The "(ulong *) third" is valid _only_ because of the kernel segment thing */
121 return do_shmat (first, (char __user *) ptr, second, (ulong *) third);
122 }
123 case SHMDT:
124 return sys_shmdt ((char __user *)ptr);
125 case SHMGET:
126 return sys_shmget (first, second, third);
127 case SHMCTL:
128 return sys_shmctl (first, second,
129 (struct shmid_ds __user *) ptr);
130 default:
131 return -ENOSYS;
132 }
133}
diff --git a/arch/frv/kernel/sysctl.c b/arch/frv/kernel/sysctl.c
index 035516cb7a97..6c155d69da29 100644
--- a/arch/frv/kernel/sysctl.c
+++ b/arch/frv/kernel/sysctl.c
@@ -9,7 +9,6 @@
9 * 2 of the License, or (at your option) any later version. 9 * 2 of the License, or (at your option) any later version.
10 */ 10 */
11 11
12#include <linux/slab.h>
13#include <linux/sysctl.h> 12#include <linux/sysctl.h>
14#include <linux/proc_fs.h> 13#include <linux/proc_fs.h>
15#include <linux/init.h> 14#include <linux/init.h>
@@ -47,8 +46,9 @@ static void frv_change_dcache_mode(unsigned long newmode)
47/* 46/*
48 * 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
49 */ 48 */
50static int procctl_frv_cachemode(ctl_table *table, int write, struct file *filp, 49static int procctl_frv_cachemode(ctl_table *table, int write,
51 void __user *buffer, size_t *lenp, loff_t *ppos) 50 void __user *buffer, size_t *lenp,
51 loff_t *ppos)
52{ 52{
53 unsigned long hsr0; 53 unsigned long hsr0;
54 char buff[8]; 54 char buff[8];
@@ -85,7 +85,7 @@ static int procctl_frv_cachemode(ctl_table *table, int write, struct file *filp,
85 } 85 }
86 86
87 /* read the state */ 87 /* read the state */
88 if (filp->f_pos > 0) { 88 if (*ppos > 0) {
89 *lenp = 0; 89 *lenp = 0;
90 return 0; 90 return 0;
91 } 91 }
@@ -111,7 +111,7 @@ static int procctl_frv_cachemode(ctl_table *table, int write, struct file *filp,
111 return -EFAULT; 111 return -EFAULT;
112 112
113 *lenp = len; 113 *lenp = len;
114 filp->f_pos = len; 114 *ppos = len;
115 return 0; 115 return 0;
116 116
117} /* end procctl_frv_cachemode() */ 117} /* end procctl_frv_cachemode() */
@@ -121,8 +121,9 @@ static int procctl_frv_cachemode(ctl_table *table, int write, struct file *filp,
121 * 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
122 */ 122 */
123#ifdef CONFIG_MMU 123#ifdef CONFIG_MMU
124static int procctl_frv_pin_cxnr(ctl_table *table, int write, struct file *filp, 124static int procctl_frv_pin_cxnr(ctl_table *table, int write,
125 void __user *buffer, size_t *lenp, loff_t *ppos) 125 void __user *buffer, size_t *lenp,
126 loff_t *ppos)
126{ 127{
127 pid_t pid; 128 pid_t pid;
128 char buff[16], *p; 129 char buff[16], *p;
@@ -151,7 +152,7 @@ static int procctl_frv_pin_cxnr(ctl_table *table, int write, struct file *filp,
151 } 152 }
152 153
153 /* read the currently pinned CXN */ 154 /* read the currently pinned CXN */
154 if (filp->f_pos > 0) { 155 if (*ppos > 0) {
155 *lenp = 0; 156 *lenp = 0;
156 return 0; 157 return 0;
157 } 158 }
@@ -164,7 +165,7 @@ static int procctl_frv_pin_cxnr(ctl_table *table, int write, struct file *filp,
164 return -EFAULT; 165 return -EFAULT;
165 166
166 *lenp = len; 167 *lenp = len;
167 filp->f_pos = len; 168 *ppos = len;
168 return 0; 169 return 0;
169 170
170} /* end procctl_frv_pin_cxnr() */ 171} /* end procctl_frv_pin_cxnr() */
diff --git a/arch/frv/kernel/time.c b/arch/frv/kernel/time.c
index fb0ce7577225..0ddbbae83cb2 100644
--- a/arch/frv/kernel/time.c
+++ b/arch/frv/kernel/time.c
@@ -48,20 +48,12 @@ static struct irqaction timer_irq = {
48 .name = "timer", 48 .name = "timer",
49}; 49};
50 50
51static inline int set_rtc_mmss(unsigned long nowtime)
52{
53 return -1;
54}
55
56/* 51/*
57 * timer_interrupt() needs to keep up the real-time clock, 52 * timer_interrupt() needs to keep up the real-time clock,
58 * as well as call the "do_timer()" routine every clocktick 53 * as well as call the "do_timer()" routine every clocktick
59 */ 54 */
60static irqreturn_t timer_interrupt(int irq, void *dummy) 55static irqreturn_t timer_interrupt(int irq, void *dummy)
61{ 56{
62 /* last time the cmos clock got updated */
63 static long last_rtc_update = 0;
64
65 profile_tick(CPU_PROFILING); 57 profile_tick(CPU_PROFILING);
66 /* 58 /*
67 * Here we are in the timer irq handler. We just have irqs locally 59 * Here we are in the timer irq handler. We just have irqs locally
@@ -74,22 +66,6 @@ static irqreturn_t timer_interrupt(int irq, void *dummy)
74 66
75 do_timer(1); 67 do_timer(1);
76 68
77 /*
78 * If we have an externally synchronized Linux clock, then update
79 * CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be
80 * called as close as possible to 500 ms before the new second starts.
81 */
82 if (ntp_synced() &&
83 xtime.tv_sec > last_rtc_update + 660 &&
84 (xtime.tv_nsec / 1000) >= 500000 - ((unsigned) TICK_SIZE) / 2 &&
85 (xtime.tv_nsec / 1000) <= 500000 + ((unsigned) TICK_SIZE) / 2
86 ) {
87 if (set_rtc_mmss(xtime.tv_sec) == 0)
88 last_rtc_update = xtime.tv_sec;
89 else
90 last_rtc_update = xtime.tv_sec - 600; /* do it again in 60 s */
91 }
92
93#ifdef CONFIG_HEARTBEAT 69#ifdef CONFIG_HEARTBEAT
94 static unsigned short n; 70 static unsigned short n;
95 n++; 71 n++;
@@ -119,7 +95,8 @@ void time_divisor_init(void)
119 __set_TCSR_DATA(0, base >> 8); 95 __set_TCSR_DATA(0, base >> 8);
120} 96}
121 97
122void time_init(void) 98
99void read_persistent_clock(struct timespec *ts)
123{ 100{
124 unsigned int year, mon, day, hour, min, sec; 101 unsigned int year, mon, day, hour, min, sec;
125 102
@@ -135,9 +112,12 @@ void time_init(void)
135 112
136 if ((year += 1900) < 1970) 113 if ((year += 1900) < 1970)
137 year += 100; 114 year += 100;
138 xtime.tv_sec = mktime(year, mon, day, hour, min, sec); 115 ts->tv_sec = mktime(year, mon, day, hour, min, sec);
139 xtime.tv_nsec = 0; 116 ts->tv_nsec = 0;
117}
140 118
119void time_init(void)
120{
141 /* install scheduling interrupt handler */ 121 /* install scheduling interrupt handler */
142 setup_irq(IRQ_CPU_TIMER0, &timer_irq); 122 setup_irq(IRQ_CPU_TIMER0, &timer_irq);
143 123
diff --git a/arch/frv/mb93090-mb00/pci-dma-nommu.c b/arch/frv/mb93090-mb00/pci-dma-nommu.c
index 4e1ba0b15443..e47857f889b6 100644
--- a/arch/frv/mb93090-mb00/pci-dma-nommu.c
+++ b/arch/frv/mb93090-mb00/pci-dma-nommu.c
@@ -106,13 +106,6 @@ void dma_free_coherent(struct device *hwdev, size_t size, void *vaddr, dma_addr_
106 106
107EXPORT_SYMBOL(dma_free_coherent); 107EXPORT_SYMBOL(dma_free_coherent);
108 108
109/*
110 * Map a single buffer of the indicated size for DMA in streaming mode.
111 * The 32-bit bus address to use is returned.
112 *
113 * Once the device is given the dma address, the device owns this memory
114 * until either dma_unmap_single or pci_dma_sync_single is performed.
115 */
116dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size, 109dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size,
117 enum dma_data_direction direction) 110 enum dma_data_direction direction)
118{ 111{
@@ -125,22 +118,6 @@ dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size,
125 118
126EXPORT_SYMBOL(dma_map_single); 119EXPORT_SYMBOL(dma_map_single);
127 120
128/*
129 * Map a set of buffers described by scatterlist in streaming
130 * mode for DMA. This is the scather-gather version of the
131 * above dma_map_single interface. Here the scatter gather list
132 * elements are each tagged with the appropriate dma address
133 * and length. They are obtained via sg_dma_{address,length}(SG).
134 *
135 * NOTE: An implementation may be able to use a smaller number of
136 * DMA address/length pairs than there are SG table elements.
137 * (for example via virtual mapping capabilities)
138 * The routine returns the number of addr/length pairs actually
139 * used, at most nents.
140 *
141 * Device ownership issues as mentioned above for dma_map_single are
142 * the same here.
143 */
144int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, 121int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
145 enum dma_data_direction direction) 122 enum dma_data_direction direction)
146{ 123{
@@ -157,13 +134,6 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
157 134
158EXPORT_SYMBOL(dma_map_sg); 135EXPORT_SYMBOL(dma_map_sg);
159 136
160/*
161 * Map a single page of the indicated size for DMA in streaming mode.
162 * The 32-bit bus address to use is returned.
163 *
164 * Device ownership issues as mentioned above for dma_map_single are
165 * the same here.
166 */
167dma_addr_t dma_map_page(struct device *dev, struct page *page, unsigned long offset, 137dma_addr_t dma_map_page(struct device *dev, struct page *page, unsigned long offset,
168 size_t size, enum dma_data_direction direction) 138 size_t size, enum dma_data_direction direction)
169{ 139{
diff --git a/arch/frv/mb93090-mb00/pci-dma.c b/arch/frv/mb93090-mb00/pci-dma.c
index 45954f0813dc..85d110b71cf7 100644
--- a/arch/frv/mb93090-mb00/pci-dma.c
+++ b/arch/frv/mb93090-mb00/pci-dma.c
@@ -10,7 +10,6 @@
10 */ 10 */
11 11
12#include <linux/types.h> 12#include <linux/types.h>
13#include <linux/slab.h>
14#include <linux/dma-mapping.h> 13#include <linux/dma-mapping.h>
15#include <linux/list.h> 14#include <linux/list.h>
16#include <linux/pci.h> 15#include <linux/pci.h>
@@ -38,13 +37,6 @@ void dma_free_coherent(struct device *hwdev, size_t size, void *vaddr, dma_addr_
38 37
39EXPORT_SYMBOL(dma_free_coherent); 38EXPORT_SYMBOL(dma_free_coherent);
40 39
41/*
42 * Map a single buffer of the indicated size for DMA in streaming mode.
43 * The 32-bit bus address to use is returned.
44 *
45 * Once the device is given the dma address, the device owns this memory
46 * until either pci_unmap_single or pci_dma_sync_single is performed.
47 */
48dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size, 40dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size,
49 enum dma_data_direction direction) 41 enum dma_data_direction direction)
50{ 42{
@@ -57,22 +49,6 @@ dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size,
57 49
58EXPORT_SYMBOL(dma_map_single); 50EXPORT_SYMBOL(dma_map_single);
59 51
60/*
61 * Map a set of buffers described by scatterlist in streaming
62 * mode for DMA. This is the scather-gather version of the
63 * above dma_map_single interface. Here the scatter gather list
64 * elements are each tagged with the appropriate dma address
65 * and length. They are obtained via sg_dma_{address,length}(SG).
66 *
67 * NOTE: An implementation may be able to use a smaller number of
68 * DMA address/length pairs than there are SG table elements.
69 * (for example via virtual mapping capabilities)
70 * The routine returns the number of addr/length pairs actually
71 * used, at most nents.
72 *
73 * Device ownership issues as mentioned above for dma_map_single are
74 * the same here.
75 */
76int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, 52int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
77 enum dma_data_direction direction) 53 enum dma_data_direction direction)
78{ 54{
@@ -103,13 +79,6 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
103 79
104EXPORT_SYMBOL(dma_map_sg); 80EXPORT_SYMBOL(dma_map_sg);
105 81
106/*
107 * Map a single page of the indicated size for DMA in streaming mode.
108 * The 32-bit bus address to use is returned.
109 *
110 * Device ownership issues as mentioned above for dma_map_single are
111 * the same here.
112 */
113dma_addr_t dma_map_page(struct device *dev, struct page *page, unsigned long offset, 82dma_addr_t dma_map_page(struct device *dev, struct page *page, unsigned long offset,
114 size_t size, enum dma_data_direction direction) 83 size_t size, enum dma_data_direction direction)
115{ 84{
diff --git a/arch/frv/mb93090-mb00/pci-frv.c b/arch/frv/mb93090-mb00/pci-frv.c
index 566bdeb499d1..6b4fb28e9f99 100644
--- a/arch/frv/mb93090-mb00/pci-frv.c
+++ b/arch/frv/mb93090-mb00/pci-frv.c
@@ -32,18 +32,16 @@
32 * but we want to try to avoid allocating at 0x2900-0x2bff 32 * but we want to try to avoid allocating at 0x2900-0x2bff
33 * which might have be mirrored at 0x0100-0x03ff.. 33 * which might have be mirrored at 0x0100-0x03ff..
34 */ 34 */
35void 35resource_size_t
36pcibios_align_resource(void *data, struct resource *res, 36pcibios_align_resource(void *data, const struct resource *res,
37 resource_size_t size, resource_size_t align) 37 resource_size_t size, resource_size_t align)
38{ 38{
39 if (res->flags & IORESOURCE_IO) { 39 resource_size_t start = res->start;
40 resource_size_t start = res->start;
41 40
42 if (start & 0x300) { 41 if ((res->flags & IORESOURCE_IO) && (start & 0x300))
43 start = (start + 0x3ff) & ~0x3ff; 42 start = (start + 0x3ff) & ~0x3ff;
44 res->start = start; 43
45 } 44 return start;
46 }
47} 45}
48 46
49 47
@@ -96,8 +94,7 @@ static void __init pcibios_allocate_bus_resources(struct list_head *bus_list)
96 r = &dev->resource[idx]; 94 r = &dev->resource[idx];
97 if (!r->start) 95 if (!r->start)
98 continue; 96 continue;
99 if (pci_claim_resource(dev, idx) < 0) 97 pci_claim_resource(dev, idx);
100 printk(KERN_ERR "PCI: Cannot allocate resource region %d of bridge %s\n", idx, pci_name(dev));
101 } 98 }
102 } 99 }
103 pcibios_allocate_bus_resources(&bus->children); 100 pcibios_allocate_bus_resources(&bus->children);
@@ -127,7 +124,6 @@ static void __init pcibios_allocate_resources(int pass)
127 DBG("PCI: Resource %08lx-%08lx (f=%lx, d=%d, p=%d)\n", 124 DBG("PCI: Resource %08lx-%08lx (f=%lx, d=%d, p=%d)\n",
128 r->start, r->end, r->flags, disabled, pass); 125 r->start, r->end, r->flags, disabled, pass);
129 if (pci_claim_resource(dev, idx) < 0) { 126 if (pci_claim_resource(dev, idx) < 0) {
130 printk(KERN_ERR "PCI: Cannot allocate resource region %d of device %s\n", idx, pci_name(dev));
131 /* We'll assign a new address later */ 127 /* We'll assign a new address later */
132 r->end -= r->start; 128 r->end -= r->start;
133 r->start = 0; 129 r->start = 0;
diff --git a/arch/frv/mb93090-mb00/pci-irq.c b/arch/frv/mb93090-mb00/pci-irq.c
index ba587523c015..20f6497b2cd5 100644
--- a/arch/frv/mb93090-mb00/pci-irq.c
+++ b/arch/frv/mb93090-mb00/pci-irq.c
@@ -9,7 +9,6 @@
9#include <linux/kernel.h> 9#include <linux/kernel.h>
10#include <linux/pci.h> 10#include <linux/pci.h>
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/slab.h>
13#include <linux/interrupt.h> 12#include <linux/interrupt.h>
14#include <linux/irq.h> 13#include <linux/irq.h>
15 14
diff --git a/arch/frv/mb93090-mb00/pci-vdk.c b/arch/frv/mb93090-mb00/pci-vdk.c
index c0dcec65c6b7..f8dd37e49535 100644
--- a/arch/frv/mb93090-mb00/pci-vdk.c
+++ b/arch/frv/mb93090-mb00/pci-vdk.c
@@ -16,7 +16,6 @@
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/ioport.h> 17#include <linux/ioport.h>
18#include <linux/delay.h> 18#include <linux/delay.h>
19#include <linux/slab.h>
20 19
21#include <asm/segment.h> 20#include <asm/segment.h>
22#include <asm/io.h> 21#include <asm/io.h>
diff --git a/arch/frv/mm/dma-alloc.c b/arch/frv/mm/dma-alloc.c
index 44840e73e907..7a73aaeae3ac 100644
--- a/arch/frv/mm/dma-alloc.c
+++ b/arch/frv/mm/dma-alloc.c
@@ -37,6 +37,7 @@
37#include <linux/init.h> 37#include <linux/init.h>
38#include <linux/pci.h> 38#include <linux/pci.h>
39#include <linux/hardirq.h> 39#include <linux/hardirq.h>
40#include <linux/gfp.h>
40 41
41#include <asm/pgalloc.h> 42#include <asm/pgalloc.h>
42#include <asm/io.h> 43#include <asm/io.h>
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/init.c b/arch/frv/mm/init.c
index 0708284f85fb..ed64588ac3a7 100644
--- a/arch/frv/mm/init.c
+++ b/arch/frv/mm/init.c
@@ -19,6 +19,7 @@
19#include <linux/signal.h> 19#include <linux/signal.h>
20#include <linux/sched.h> 20#include <linux/sched.h>
21#include <linux/pagemap.h> 21#include <linux/pagemap.h>
22#include <linux/gfp.h>
22#include <linux/swap.h> 23#include <linux/swap.h>
23#include <linux/mm.h> 24#include <linux/mm.h>
24#include <linux/kernel.h> 25#include <linux/kernel.h>
diff --git a/arch/frv/mm/pgalloc.c b/arch/frv/mm/pgalloc.c
index 66f616fb4860..c42c83d507bc 100644
--- a/arch/frv/mm/pgalloc.c
+++ b/arch/frv/mm/pgalloc.c
@@ -10,7 +10,7 @@
10 */ 10 */
11 11
12#include <linux/sched.h> 12#include <linux/sched.h>
13#include <linux/slab.h> 13#include <linux/gfp.h>
14#include <linux/mm.h> 14#include <linux/mm.h>
15#include <linux/highmem.h> 15#include <linux/highmem.h>
16#include <linux/quicklist.h> 16#include <linux/quicklist.h>