#include <linux/init.h>
#include <linux/ioport.h>
#include <linux/string.h>
+#include <linux/spinlock.h>
#include <asm/page.h>
#include <asm/oplib.h>
#include <asm/smp.h>
#include <asm/spitfire.h>
+/* Used to synchronize acceses to NatSemi SUPER I/O chip configure
+ * operations in asm/ns87303.h
+ */
+spinlock_t ns87303_lock = SPIN_LOCK_UNLOCKED;
+
struct prom_cpuinfo linux_cpus[NR_CPUS] __initdata = { { 0 } };
unsigned prom_cpu_nodes[NR_CPUS];
int linux_num_cpus = 0;
#include <asm/isa.h>
#endif
#include <asm/a.out.h>
+#include <asm/ns87303.h>
struct poll {
int fd;
#ifdef CONFIG_DEBUG_BUGVERBOSE
EXPORT_SYMBOL(do_BUG);
#endif
+
+/* for ns8703 */
+EXPORT_SYMBOL(ns87303_lock);
#ifdef __KERNEL__
+#include <linux/spinlock.h>
+
#include <asm/system.h>
#include <asm/io.h>
+extern spinlock_t ns87303_lock;
+
static __inline__ int ns87303_modify(unsigned long port, unsigned int index,
unsigned char clr, unsigned char set)
{
if (index > 0x0d)
return -EINVAL;
- save_flags(flags); cli();
+ spin_lock_irqsave(&ns87303_lock, flags);
+
outb(index, port);
value = inb(port + 1);
value &= ~(reserved[index] | clr);
value |= set;
outb(value, port + 1);
outb(value, port + 1);
- restore_flags(flags);
+
+ spin_unlock_irqrestore(&ns87303_lock, flags);
return 0;
}