Browse Source

Merge master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6.23

* master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6.23:
  sh: remove extraneous ; on scif_sercon_putc wait loop
  sh: Add missing dma_sync_single_range_for_*().
  sh: panic on machvec section misalignment.
  sh: Fix PTRACE_PEEKTEXT/PEEKDATA fallout from generic_ptrace_peekdata().
Linus Torvalds 18 years ago
parent
commit
203f339439
4 changed files with 28 additions and 1 deletions
  1. 1 1
      arch/sh/kernel/early_printk.c
  2. 7 0
      arch/sh/kernel/machvec.c
  3. 1 0
      arch/sh/kernel/ptrace.c
  4. 19 0
      include/asm-sh/dma-mapping.h

+ 1 - 1
arch/sh/kernel/early_printk.c

@@ -76,7 +76,7 @@ static void scif_sercon_putc(int c)
 	sci_in(&scif_port, SCxSR);
 	sci_out(&scif_port, SCxSR, 0xf3 & ~(0x20 | 0x40));
 
-	while ((sci_in(&scif_port, SCxSR) & 0x40) == 0);
+	while ((sci_in(&scif_port, SCxSR) & 0x40) == 0)
 		;
 
 	if (c == '\n')

+ 7 - 0
arch/sh/kernel/machvec.c

@@ -90,6 +90,13 @@ void __init sh_mv_setup(void)
 		machvec_size = ((unsigned long)&__machvec_end -
 				(unsigned long)&__machvec_start);
 
+		/*
+		 * Sanity check for machvec section alignment. Ensure
+		 * __initmv hasn't been misused.
+		 */
+		if (machvec_size % sizeof(struct sh_machine_vector))
+			panic("machvec misaligned, invalid __initmv use?");
+
 		/*
 		 * If the machvec hasn't been preselected, use the first
 		 * vector (usually the only one) from .machvec.init.

+ 1 - 0
arch/sh/kernel/ptrace.c

@@ -93,6 +93,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
 	case PTRACE_PEEKTEXT: /* read word at location addr. */
 	case PTRACE_PEEKDATA:
 		ret = generic_ptrace_peekdata(child, addr, data);
+		break;
 
 	/* read the word at location addr in the USER area. */
 	case PTRACE_PEEKUSR: {

+ 19 - 0
include/asm-sh/dma-mapping.h

@@ -160,6 +160,25 @@ static inline void dma_sync_single_for_device(struct device *dev,
 	dma_sync_single(dev, dma_handle, size, dir);
 }
 
+static inline void dma_sync_single_range_for_cpu(struct device *dev,
+						 dma_addr_t dma_handle,
+						 unsigned long offset,
+						 size_t size,
+						 enum dma_data_direction direction)
+{
+	dma_sync_single_for_cpu(dev, dma_handle+offset, size, direction);
+}
+
+static inline void dma_sync_single_range_for_device(struct device *dev,
+						    dma_addr_t dma_handle,
+						    unsigned long offset,
+						    size_t size,
+						    enum dma_data_direction direction)
+{
+	dma_sync_single_for_device(dev, dma_handle+offset, size, direction);
+}
+
+
 static inline void dma_sync_sg_for_cpu(struct device *dev,
 				       struct scatterlist *sg, int nelems,
 				       enum dma_data_direction dir)