2001-07-20 00:48:11

by Matthew Gardiner

[permalink] [raw]
Subject: MTD compiling error

In file included from cfi_probe.c:17:
/usr/src/linux-2.4.6/include/linux/mtd/cfi.h: In function `cfi_spin_unlock':
/usr/src/linux-2.4.6/include/linux/mtd/cfi.h:387: `do_softirq' undeclared
(first use in this function)
/usr/src/linux-2.4.6/include/linux/mtd/cfi.h:387: (Each undeclared identifier
is reported only once
/usr/src/linux-2.4.6/include/linux/mtd/cfi.h:387: for each function it
appears in.)
make[3]: *** [cfi_probe.o] Error 1
make[3]: Leaving directory `/usr/src/linux-2.4.6/drivers/mtd/chips'
make[2]: *** [_modsubdir_chips] Error 2
make[2]: Leaving directory `/usr/src/linux-2.4.6/drivers/mtd'
make[1]: *** [_modsubdir_mtd] Error 2
make[1]: Leaving directory `/usr/src/linux-2.4.6/drivers'
make: *** [_mod_drivers] Error 2
[root@kiwiunix linux]#

mtd is buggered. Found out when compiling the modules.

Matthew Gardiner
--
WARNING:

This email was written on an OS using the viral 'GPL' as its license.

Please check with Bill Gates before continuing to read this email/posting.


2001-07-20 04:01:32

by Matthew Gardiner

[permalink] [raw]
Subject: Re: MTD compiling error

gcc -D__KERNEL__ -I/usr/src/linux-2.4.6/include -Wall -Wstrict-prototypes
-Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common
-pipe -mpreferred-stack-boundary=2 -march=i686 -DMODULE -c -o cfi_probe.o
cfi_probe.c
In file included from cfi_probe.c:17:
/usr/src/linux-2.4.6/include/linux/mtd/cfi.h: In function `cfi_spin_unlock':
/usr/src/linux-2.4.6/include/linux/mtd/cfi.h:387: `do_softirq' undeclared
(first use in this function)
/usr/src/linux-2.4.6/include/linux/mtd/cfi.h:387: (Each undeclared identifier
is reported only once
/usr/src/linux-2.4.6/include/linux/mtd/cfi.h:387: for each function it
appears in.)
make[3]: *** [cfi_probe.o] Error 1
make[3]: Leaving directory `/usr/src/linux-2.4.6/drivers/mtd/chips'
make[2]: *** [_modsubdir_chips] Error 2
make[2]: Leaving directory `/usr/src/linux-2.4.6/drivers/mtd'
make[1]: *** [_modsubdir_mtd] Error 2
make[1]: Leaving directory `/usr/src/linux-2.4.6/drivers'
make: *** [_mod_drivers] Error 2
[root@kiwiunix linux]#

After adding #include <spinlock.h> in the CFI.h header file, the result was
that there is a undeclared identifier. Since I don't know C (Only java, BBC
Basic, and COBOL), I don't know how to correct the problem.

Matthew Gardiner

--
WARNING:

This email was written on an OS using the viral 'GPL' as its license.

Please check with Bill Gates before continuing to read this email/posting.

2001-07-20 04:19:45

by Tim Hockin

[permalink] [raw]
Subject: Re: MTD compiling error

> /usr/src/linux-2.4.6/include/linux/mtd/cfi.h: In function `cfi_spin_unlock':
> /usr/src/linux-2.4.6/include/linux/mtd/cfi.h:387: `do_softirq' undeclared
> (first use in this function)
> /usr/src/linux-2.4.6/include/linux/mtd/cfi.h:387: (Each undeclared identifier
> is reported only once
> /usr/src/linux-2.4.6/include/linux/mtd/cfi.h:387: for each function it
> appears in.)
> make[3]: *** [cfi_probe.o] Error 1
> make[3]: Leaving directory `/usr/src/linux-2.4.6/drivers/mtd/chips'
> make[2]: *** [_modsubdir_chips] Error 2
> make[2]: Leaving directory `/usr/src/linux-2.4.6/drivers/mtd'
> make[1]: *** [_modsubdir_mtd] Error 2
> make[1]: Leaving directory `/usr/src/linux-2.4.6/drivers'
> make: *** [_mod_drivers] Error 2
> [root@kiwiunix linux]#
>
> After adding #include <spinlock.h> in the CFI.h header file, the result was
> that there is a undeclared identifier. Since I don't know C (Only java, BBC
> Basic, and COBOL), I don't know how to correct the problem.


include <linux/interrupt.h> I believe. It is fixed in MTD's CVS

2001-07-20 09:57:52

by David Woodhouse

[permalink] [raw]
Subject: [PATCH] Re: MTD compiling error


[email protected] said:
> /usr/src/linux-2.4.6/include/linux/mtd/cfi.h:387: `do_softirq' undeclared (first use in this function)

Linus, please apply:

Index: include/linux/mtd/cfi.h
===================================================================
RCS file: /inst/cvs/linux/include/linux/mtd/cfi.h,v
retrieving revision 1.1.1.1.2.4
diff -u -r1.1.1.1.2.4 cfi.h
--- include/linux/mtd/cfi.h 2001/06/13 06:41:40 1.1.1.1.2.4
+++ include/linux/mtd/cfi.h 2001/07/20 09:56:41
@@ -1,7 +1,7 @@

/* Common Flash Interface structures
* See http://support.intel.com/design/flash/technote/index.htm
- * $Id: cfi.h,v 1.21 2001/06/03 01:32:57 nico Exp $
+ * $Id: cfi.h,v 1.22 2001/07/06 09:29:07 dwmw2 Exp $
*/

#ifndef __MTD_CFI_H__
@@ -10,6 +10,7 @@
#include <linux/config.h>
#include <linux/delay.h>
#include <linux/types.h>
+#include <linux/interrupt.h>
#include <linux/mtd/flashchip.h>
#include <linux/mtd/cfi_endian.h>



--
dwmw2


2001-07-20 18:43:32

by Eric W. Biederman

[permalink] [raw]
Subject: Re: [PATCH] Re: MTD compiling error

David Woodhouse <[email protected]> writes:

> [email protected] said:
> > /usr/src/linux-2.4.6/include/linux/mtd/cfi.h:387: `do_softirq' undeclared
> (first use in this function)

Dave this isn't a sufficient fix. In particular amd_flash.c has problems,
if you only patch cfi.h. The problem is local_bh_enable by way of
do_unlock_bh. Or in particular the changes to asm-i386/softirq.h

The following should fix every case the changes to softirq.h broke. I would
love to include linux/interrupt.h but that isn't currently possible.

Eric

--- linux-2.4.6/include/asm-i386/softirq.h Thu Jul 19 15:33:26 2001
+++ linux-2.4.6.eb1.1/include/asm-i386/softirq.h Thu Jul 19 17:19:04 2001
@@ -4,6 +4,12 @@
#include <asm/atomic.h>
#include <asm/hardirq.h>

+/* FIXME getting the declaraion for do_softirq from interrupt.h is an
+ * include nightmare, this needs to be fixed instead of declaring
+ * do_softirq directly.
+ */
+extern asmlinkage void do_softirq(void);
+
#define __cpu_bh_enable(cpu) \
do { barrier(); local_bh_count(cpu)--; } while (0)
#define cpu_bh_disable(cpu) \