- fix any error/warning
- fix {request,freee}_irq interrupt control fix
- add dump_stack
- fix show_trace_task
- fix typo
--
Yoshinori Sato
<[email protected]>
diff -ru -X .exclude-diff linux-2.6.5/arch/h8300/Kconfig linux-2.6.5-h8300/arch/h8300/Kconfig
--- linux-2.6.5/arch/h8300/Kconfig 2004-04-08 23:26:16.000000000 +0900
+++ linux-2.6.5-h8300/arch/h8300/Kconfig 2004-04-08 23:51:58.000000000 +0900
@@ -67,7 +67,7 @@
config H8300H_H8MAX
bool "H8MAX"
help
- H8MAX Evaluation Board Suooprt
+ H8MAX Evaluation Board Support
More Information. (Japanese Only)
<http://strawberry-linux.com/h8/index.html>
diff -ru -X .exclude-diff linux-2.6.5/arch/h8300/kernel/ints.c linux-2.6.5-h8300/arch/h8300/kernel/ints.c
--- linux-2.6.5/arch/h8300/kernel/ints.c 2004-04-06 17:11:10.000000000 +0900
+++ linux-2.6.5-h8300/arch/h8300/kernel/ints.c 2004-04-08 01:11:05.000000000 +0900
@@ -93,7 +93,7 @@
if (ramvec == NULL)
panic("interrupt vector serup failed.");
else
- printk("virtual vector at 0x%08lx\n",(unsigned long)ramvec);
+ printk(KERN_INFO "virtual vector at 0x%08lx\n",(unsigned long)ramvec);
/* create redirect table */
ramvec_p = ramvec;
@@ -118,11 +118,11 @@
ramvec_p = ramvec;
for (i = 0; i < NR_IRQS; i++) {
if ((i % 8) == 0)
- printk("\n%p: ",ramvec_p);
- printk("%p ",*ramvec_p);
+ printk(KERN_DEBUG "\n%p: ",ramvec_p);
+ printk(KERN_DEBUG "%p ",*ramvec_p);
ramvec_p++;
}
- printk("\n");
+ printk(KERN_DEBUG "\n");
#endif
#endif
}
@@ -133,9 +133,10 @@
{
irq_handler_t *irq_handle;
if (irq < 0 || irq >= NR_IRQS) {
- printk("Incorrect IRQ %d from %s\n", irq, devname);
+ printk(KERN_ERR "Incorrect IRQ %d from %s\n", irq, devname);
return -EINVAL;
}
+
if (irq_list[irq] || (h8300_enable_irq_pin(irq) == -EBUSY))
return -EBUSY;
@@ -156,6 +157,11 @@
irq_handle->dev_id = dev_id;
irq_handle->devname = devname;
irq_list[irq] = irq_handle;
+
+ if (irq_handle->flags & SA_SAMPLE_RANDOM)
+ rand_initialize_irq(irq);
+
+ enable_irq(irq);
return 0;
}
@@ -163,12 +169,13 @@
void free_irq(unsigned int irq, void *dev_id)
{
- if (irq >= NR_IRQS) {
+ if (irq >= NR_IRQS)
return;
- }
+
if (!irq_list[irq] || irq_list[irq]->dev_id != dev_id)
- printk("Removing probably wrong IRQ %d from %s\n",
+ printk(KERN_WARNING "Removing probably wrong IRQ %d from %s\n",
irq, irq_list[irq]->devname);
+ disable_irq(irq);
h8300_disable_irq_pin(irq);
if (((unsigned long)irq_list[irq] & 0x80000000) == 0) {
kfree(irq_list[irq]);
diff -ru -X .exclude-diff linux-2.6.5/arch/h8300/kernel/traps.c linux-2.6.5-h8300/arch/h8300/kernel/traps.c
--- linux-2.6.5/arch/h8300/kernel/traps.c 2004-01-09 15:59:06.000000000 +0900
+++ linux-2.6.5-h8300/arch/h8300/kernel/traps.c 2004-04-08 01:11:05.000000000 +0900
@@ -16,9 +16,10 @@
#include <linux/types.h>
#include <linux/sched.h>
-#include <linux/kernel_stat.h>
+#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/init.h>
+#include <linux/module.h>
#include <asm/system.h>
#include <asm/irq.h>
@@ -41,7 +42,7 @@
asmlinkage void set_esp0 (unsigned long ssp)
{
- current->thread.esp0 = ssp;
+ current->thread.esp0 = ssp;
}
/*
@@ -55,14 +56,6 @@
int i;
printk("\nCURRENT PROCESS:\n\n");
-#if 0
-{
- extern int swt_lastjiffies, swt_reference;
- printk("WATCHDOG: jiffies=%d lastjiffies=%d [%d] reference=%d\n",
- jiffies, swt_lastjiffies, (swt_lastjiffies - jiffies),
- swt_reference);
-}
-#endif
printk("COMM=%s PID=%d\n", current->comm, current->pid);
if (current->mm) {
printk("TEXT=%08x-%08x DATA=%08x-%08x BSS=%08x-%08x\n",
@@ -76,13 +69,8 @@
(int) current->mm->start_stack,
(int) PAGE_SIZE+(unsigned long)current);
}
-
- printk("PC: %08lx\n", (long)fp->pc);
- printk("CCR: %02x SP: %08lx\n", fp->ccr, (long) fp);
- printk("ER0: %08lx ER1: %08lx ER2: %08lx ER3: %08lx\n",
- fp->er0, fp->er1, fp->er2, fp->er3);
- printk("ER4: %08lx ER5: %08lx ER6: %08lx\n",
- fp->er4, fp->er5, fp->er6);
+
+ show_regs(fp);
printk("\nCODE:");
tp = ((unsigned char *) fp->pc) - 0x20;
for (sp = (unsigned long *) tp, i = 0; (i < 0x40); i += 4) {
@@ -106,12 +94,6 @@
printk("\n\n");
}
-void show_trace_task(struct task_struct *tsk)
-{
- /* DAVIDM: we can do better, need a proper stack dump */
- printk("STACK ksp=0x%lx, usp=0x%lx\n", tsk->thread.ksp, tsk->thread.usp);
-}
-
void die_if_kernel (char *str, struct pt_regs *fp, int nr)
{
extern int console_loglevel;
@@ -174,3 +156,14 @@
printk("\n");
}
+void show_trace_task(struct task_struct *tsk)
+{
+ show_stack(tsk,(unsigned long *)tsk->thread.esp0);
+}
+
+void dump_stack(void)
+{
+ show_stack(NULL,NULL);
+}
+
+EXPORT_SYMBOL(dump_stack);
diff -ru -X .exclude-diff linux-2.6.5/arch/h8300/platform/h8s/entry.S linux-2.6.5-h8300/arch/h8300/platform/h8s/entry.S
--- linux-2.6.5/arch/h8300/platform/h8s/entry.S 2004-04-08 23:26:10.000000000 +0900
+++ linux-2.6.5-h8300/arch/h8300/platform/h8s/entry.S 2004-04-08 01:13:51.000000000 +0900
@@ -166,7 +166,7 @@
mov.l sp,er1
subs #4,er1 /* adjust ret_pc */
jsr @SYMBOL_NAME(process_int)
- mov.l @SYMBOL_NAME(irq_stat)+CPU_SOFTIRQ_PENDING,er0
+ mov.l @SYMBOL_NAME(irq_stat)+CPUSTAT_SOFTIRQ_PENDING,er0
beq 1f
jsr @SYMBOL_NAME(do_softirq)
1:
diff -ru -X .exclude-diff linux-2.6.5/arch/h8300/platform/h8s/ints_h8s.c linux-2.6.5-h8300/arch/h8300/platform/h8s/ints_h8s.c
--- linux-2.6.5/arch/h8300/platform/h8s/ints_h8s.c 2004-04-08 23:26:16.000000000 +0900
+++ linux-2.6.5-h8300/arch/h8300/platform/h8s/ints_h8s.c 2004-04-08 01:13:51.000000000 +0900
@@ -9,6 +9,7 @@
#include <linux/config.h>
#include <linux/init.h>
#include <linux/errno.h>
+#include <linux/kernel.h>
#include <asm/ptrace.h>
#include <asm/traps.h>
@@ -80,12 +81,13 @@
if (irq >= EXT_IRQ0 && irq <= EXT_IRQ15) {
unsigned short ptn = 1 << (irq - EXT_IRQ0);
unsigned int port_no,bit_no;
- IRQ_GPIO_MAP(ptn,irq,port_no,bit_no);
+ IRQ_GPIO_MAP(ptn, irq, port_no, bit_no);
if (H8300_GPIO_RESERVE(port_no, bit_no) == 0)
return -EBUSY; /* pin already use */
H8300_GPIO_DDR(port_no, bit_no, H8300_GPIO_INPUT);
*(volatile unsigned short *)ISR &= ~ptn; /* ISR clear */
- }
+ }
+
return 0;
}
@@ -97,7 +99,7 @@
unsigned short port_no,bit_no;
*(volatile unsigned short *)ISR &= ~ptn;
*(volatile unsigned short *)IER &= ~ptn;
- IRQ_GPIO_MAP(ptn,port_no,bit_no);
+ IRQ_GPIO_MAP(ptn, irq, port_no, bit_no);
H8300_GPIO_FREE(port_no, bit_no);
}
}
diff -ru -X .exclude-diff linux-2.6.5/include/asm-h8300/io.h linux-2.6.5-h8300/include/asm-h8300/io.h
--- linux-2.6.5/include/asm-h8300/io.h 2004-04-06 17:10:58.000000000 +0900
+++ linux-2.6.5-h8300/include/asm-h8300/io.h 2004-04-08 01:09:30.000000000 +0900
@@ -9,7 +9,7 @@
#if defined(CONFIG_H83007) || defined(CONFIG_H83068)
#include <asm/regs306x.h>
#elif defined(CONFIG_H8S2678)
-#include <asm/regs2678.h>
+#include <asm/regs267x.h>
#else
#error UNKNOWN CPU TYPE
#endif
@@ -73,7 +73,7 @@
static inline int h8300_buswidth(unsigned int addr)
{
- return (*(volatile unsigned char *)ABWCR & (1 << (addr >> 21) & 7)) == 0;
+ return (*(volatile unsigned char *)ABWCR & (1 << ((addr >> 21) & 7))) == 0;
}
static inline void io_outsb(unsigned int addr, void *buf, int len)
@@ -145,10 +145,10 @@
#define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c))
#define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c))
-#define inb(addr) ((h8300_buswidth(addr))?readb(addr ^ 1) & 0xff:readb(addr))
+#define inb(addr) ((h8300_buswidth(addr))?readb((addr) ^ 1) & 0xff:readb(addr))
#define inw(addr) _swapw(readw(addr))
#define inl(addr) _swapl(readl(addr))
-#define outb(x,addr) ((void)((h8300_buswidth(addr) && (addr & 1))?writew(x,addr):writeb(x,addr)))
+#define outb(x,addr) ((void)((h8300_buswidth(addr) && ((addr) & 1))?writew(x,addr):writeb(x,addr)))
#define outw(x,addr) ((void) writew(_swapw(x),addr))
#define outl(x,addr) ((void) writel(_swapl(x),addr))
diff -ru -X .exclude-diff linux-2.6.5/drivers/serial/sh-sci.c linux-2.6.5-h8300/drivers/serial/sh-sci.c
--- linux-2.6.5/drivers/serial/sh-sci.c 2004-04-08 23:59:50.000000000 +0900
+++ linux-2.6.5-h8300/drivers/serial/sh-sci.c 2004-04-08 01:06:52.000000000 +0900
@@ -297,10 +297,10 @@
#if defined(__H8300S__)
enum { sci_disable, sci_enable };
-static void h8300_sci_enable(struct sci_port* port, unsigned int ctrl)
+static void h8300_sci_enable(struct uart_port* port, unsigned int ctrl)
{
volatile unsigned char *mstpcrl=(volatile unsigned char *)MSTPCRL;
- int ch = (port->base - SMR0) >> 3;
+ int ch = (port->mapbase - SMR0) >> 3;
unsigned char mask = 1 << (ch+1);
if (ctrl == sci_disable) {
@@ -1288,7 +1288,7 @@
.line = 1,
},
.type = PORT_SCI,
- .irqs = H8S_IRQS1,
+ .irqs = H8S_SCI_IRQS1,
.init_pins = sci_init_pins_sci,
},
{
@@ -1302,7 +1302,7 @@
.line = 2,
},
.type = PORT_SCI,
- .irqs = H8S_IRQS2,
+ .irqs = H8S_SCI_IRQS2,
.init_pins = sci_init_pins_sci,
},
#else