linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King <rmk@arm.linux.org.uk>
To: Maksim Krasnyanskiy <maxk@qualcomm.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.4.9-pre[34] changes in drivers/char/vt.c broke Sparc64
Date: Wed, 15 Aug 2001 21:45:04 +0100	[thread overview]
Message-ID: <20010815214504.B27837@flint.arm.linux.org.uk> (raw)
In-Reply-To: <4.3.1.0.20010815133146.034a75c0@mail1>
In-Reply-To: <4.3.1.0.20010815133146.034a75c0@mail1>; from maxk@qualcomm.com on Wed, Aug 15, 2001 at 01:37:17PM -0700

On Wed, Aug 15, 2001 at 01:37:17PM -0700, Maksim Krasnyanskiy wrote:
> Have you guys noticed that new vt.c in 2.4.9-pre[34] doesn't compile on
> Sparc64 (and Sparc32) ?
> 
> sparc64-linux-gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare -Wa,--undeclared-regs    -c -o vt.o vt.c
> In file included from vt.c:27:
> /usr/src/linux/include/linux/irq.h:57: asm/hw_irq.h: No such file or directory
> vt.c: In function `vt_ioctl':
> vt.c:507: `kbd_rate' undeclared (first use in this function)
> vt.c:507: (Each undeclared identifier is reported only once
> vt.c:507: for each function it appears in.)
> vt.c:514: `kbd_rate' used prior to declaration
> vt.c:514: warning: implicit declaration of function `kbd_rate'
> 
> Simple commenting out #include <linux/irq.h> and ioctl code that uses
> kbd_rate works. Whoever changed vt.c please post correct fix.

I came across both of these in 2.4.8-ac.  The best fix is non-obvious,
and the code is very unclear.

Turns out the only reasonable way is to declare kbd_rate as a weak symbol
in your asm/keyboard.h:

extern int kbd_rate(struct kbd_repeat *rate) __attribute__((weak));

Second thing is <linux/irq.h>.  I strongly disagree with this change,
(see the comments in linux/irq.h in this patch) and I've sent the
following patch to Alan to fix this cockup.

diff -urN linux-orig/drivers/char/sysrq.c linux/drivers/char/sysrq.c
--- linux-orig/drivers/char/sysrq.c	Tue Aug 14 20:49:06 2001
+++ linux/drivers/char/sysrq.c	Sun Aug 12 20:24:21 2001
@@ -27,7 +27,6 @@
 #include <linux/quotaops.h>
 #include <linux/smp_lock.h>
 #include <linux/module.h>
-#include <linux/irq.h>
 
 #include <linux/spinlock.h>
 
diff -urN linux-orig/drivers/char/vt.c linux/drivers/char/vt.c
--- linux-orig/drivers/char/vt.c	Tue Aug 14 20:49:06 2001
+++ linux/drivers/char/vt.c	Sun Aug 12 20:08:13 2001
@@ -24,7 +24,6 @@
 #include <linux/major.h>
 #include <linux/fs.h>
 #include <linux/console.h>
-#include <linux/irq.h>
 
 #include <asm/io.h>
 #include <asm/uaccess.h>
diff -urN linux-orig/include/asm-i386/irq.h linux/include/asm-i386/irq.h
--- linux-orig/include/asm-i386/irq.h	Tue Aug 14 20:49:29 2001
+++ linux/include/asm-i386/irq.h	Sun Aug 12 20:02:12 2001
@@ -35,7 +35,7 @@
 extern void enable_irq(unsigned int);
 
 #ifdef CONFIG_X86_LOCAL_APIC
-#define ARCH_HAS_NMI_WATCHDOG		/* See include/linux/irq.h */
+#define ARCH_HAS_NMI_WATCHDOG		/* See include/linux/nmi.h */
 #endif
 
 #endif /* _ASM_IRQ_H */
diff -urN linux-orig/include/linux/irq.h linux/include/linux/irq.h
--- linux-orig/include/linux/irq.h	Tue Aug 14 20:49:32 2001
+++ linux/include/linux/irq.h	Sun Aug 12 20:01:17 2001
@@ -1,6 +1,14 @@
 #ifndef __irq_h
 #define __irq_h
 
+/*
+ * Please do not include this file in generic code.  There is currently
+ * no requirement for any architecture to implement anything held
+ * within this file.
+ *
+ * Thanks. --rmk
+ */
+
 #include <linux/config.h>
 
 #if !defined(CONFIG_ARCH_S390)
@@ -59,19 +67,6 @@
 extern irq_desc_t irq_desc [NR_IRQS];
 
 #include <asm/hw_irq.h> /* the arch dependent stuff */
-
-/**
- * touch_nmi_watchdog - restart NMI watchdog timeout.
- * 
- * If the architecture supports the NMI watchdog, touch_nmi_watchdog()
- * may be used to reset the timeout - for code which intentionally
- * disables interrupts for a long time. This call is stateless.
- */
-#ifdef ARCH_HAS_NMI_WATCHDOG
-extern void touch_nmi_watchdog(void);
-#else
-# define touch_nmi_watchdog() do { } while(0)
-#endif
 
 extern int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
 extern int setup_irq(unsigned int , struct irqaction * );
diff -urN linux-orig/include/linux/nmi.h linux/include/linux/nmi.h
--- linux-orig/include/linux/nmi.h	Thu Jan  1 01:00:00 1970
+++ linux/include/linux/nmi.h	Sun Aug 12 20:02:04 2001
@@ -0,0 +1,22 @@
+/*
+ *  linux/include/linux/nmi.h
+ */
+#ifndef LINUX_NMI_H
+#define LINUX_NMI_H
+
+#include <asm/irq.h>
+
+/**
+ * touch_nmi_watchdog - restart NMI watchdog timeout.
+ * 
+ * If the architecture supports the NMI watchdog, touch_nmi_watchdog()
+ * may be used to reset the timeout - for code which intentionally
+ * disables interrupts for a long time. This call is stateless.
+ */
+#ifdef ARCH_HAS_NMI_WATCHDOG
+extern void touch_nmi_watchdog(void);
+#else
+# define touch_nmi_watchdog() do { } while(0)
+#endif
+
+#endif
diff -urN linux-orig/kernel/sched.c linux/kernel/sched.c
--- linux-orig/kernel/sched.c	Tue Aug 14 20:49:34 2001
+++ linux/kernel/sched.c	Tue Aug 14 21:39:03 2001
@@ -23,7 +23,7 @@
 #include <linux/mm.h>
 #include <linux/init.h>
 #include <linux/smp_lock.h>
-#include <linux/irq.h>
+#include <linux/nmi.h>
 #include <linux/interrupt.h>
 #include <linux/kernel_stat.h>
 #include <linux/completion.h>


--
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


  reply	other threads:[~2001-08-15 20:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-15 20:37 2.4.9-pre[34] changes in drivers/char/vt.c broke Sparc64 Maksim Krasnyanskiy
2001-08-15 20:45 ` Russell King [this message]
     [not found] <no.id>
2001-08-15 21:02 ` Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010815214504.B27837@flint.arm.linux.org.uk \
    --to=rmk@arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxk@qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).