summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-alpha/bitops.h10
-rw-r--r--include/asm-alpha/ide.h88
-rw-r--r--include/asm-alpha/init.h2
-rw-r--r--include/asm-alpha/io.h6
-rw-r--r--include/asm-alpha/irq.h4
-rw-r--r--include/asm-alpha/processor.h8
-rw-r--r--include/asm-alpha/semaphore.h80
-rw-r--r--include/asm-alpha/smp.h15
-rw-r--r--include/asm-alpha/softirq.h10
-rw-r--r--include/asm-alpha/spinlock.h66
-rw-r--r--include/asm-alpha/string.h1
-rw-r--r--include/asm-alpha/system.h12
-rw-r--r--include/asm-arm/arch-arc/ide.h15
-rw-r--r--include/asm-arm/arch-ebsa285/ide.h19
-rw-r--r--include/asm-arm/arch-rpc/ide.h15
-rw-r--r--include/asm-arm/arch-rpc/io.h51
-rw-r--r--include/asm-arm/ide.h2
-rw-r--r--include/asm-arm/io.h13
-rw-r--r--include/asm-arm/proc-fns.h2
-rw-r--r--include/asm-arm/processor.h6
-rw-r--r--include/asm-arm/semaphore.h3
-rw-r--r--include/asm-i386/bugs.h14
-rw-r--r--include/asm-i386/ide.h86
-rw-r--r--include/asm-i386/io.h6
-rw-r--r--include/asm-i386/locks.h2
-rw-r--r--include/asm-i386/page.h5
-rw-r--r--include/asm-i386/processor.h8
-rw-r--r--include/asm-i386/semaphore.h77
-rw-r--r--include/asm-i386/softirq.h30
-rw-r--r--include/asm-i386/spinlock.h87
-rw-r--r--include/asm-i386/system.h5
-rw-r--r--include/asm-m68k/adb_mouse.h2
-rw-r--r--include/asm-m68k/atari_joystick.h2
-rw-r--r--include/asm-m68k/ide.h39
-rw-r--r--include/asm-m68k/io.h6
-rw-r--r--include/asm-m68k/mac_mouse.h2
-rw-r--r--include/asm-m68k/page.h2
-rw-r--r--include/asm-m68k/processor.h6
-rw-r--r--include/asm-m68k/q40_keyboard.h4
-rw-r--r--include/asm-m68k/semaphore-helper.h2
-rw-r--r--include/asm-m68k/semaphore.h3
-rw-r--r--include/asm-mips/ide.h58
-rw-r--r--include/asm-mips/io.h9
-rw-r--r--include/asm-mips/namei.h4
-rw-r--r--include/asm-mips/offset.h48
-rw-r--r--include/asm-mips/processor.h11
-rw-r--r--include/asm-mips/semaphore-helper.h4
-rw-r--r--include/asm-mips/semaphore.h70
-rw-r--r--include/asm-mips/softirq.h19
-rw-r--r--include/asm-mips/spinlock.h51
-rw-r--r--include/asm-mips/system.h8
-rw-r--r--include/asm-ppc/adb_mouse.h2
-rw-r--r--include/asm-ppc/ide.h66
-rw-r--r--include/asm-ppc/io.h7
-rw-r--r--include/asm-ppc/mmu.h19
-rw-r--r--include/asm-ppc/pgtable.h5
-rw-r--r--include/asm-ppc/processor.h10
-rw-r--r--include/asm-ppc/ptrace.h35
-rw-r--r--include/asm-ppc/semaphore.h65
-rw-r--r--include/asm-ppc/system.h6
-rw-r--r--include/asm-sparc/asm_offsets.h296
-rw-r--r--include/asm-sparc/audioio.h6
-rw-r--r--include/asm-sparc/io.h17
-rw-r--r--include/asm-sparc/namei.h2
-rw-r--r--include/asm-sparc/pcic.h18
-rw-r--r--include/asm-sparc/pgtable.h2
-rw-r--r--include/asm-sparc/processor.h8
-rw-r--r--include/asm-sparc/semaphore.h65
-rw-r--r--include/asm-sparc/softirq.h9
-rw-r--r--include/asm-sparc/spinlock.h21
-rw-r--r--include/asm-sparc64/asm_offsets.h816
-rw-r--r--include/asm-sparc64/audioio.h6
-rw-r--r--include/asm-sparc64/checksum.h15
-rw-r--r--include/asm-sparc64/fpumacro.h40
-rw-r--r--include/asm-sparc64/ide.h61
-rw-r--r--include/asm-sparc64/io.h8
-rw-r--r--include/asm-sparc64/md.h4
-rw-r--r--include/asm-sparc64/mmu_context.h32
-rw-r--r--include/asm-sparc64/namei.h2
-rw-r--r--include/asm-sparc64/pgtable.h2
-rw-r--r--include/asm-sparc64/processor.h44
-rw-r--r--include/asm-sparc64/sab82532.h8
-rw-r--r--include/asm-sparc64/semaphore.h60
-rw-r--r--include/asm-sparc64/softirq.h6
-rw-r--r--include/asm-sparc64/spinlock.h53
-rw-r--r--include/asm-sparc64/uaccess.h47
-rw-r--r--include/linux/b1lli.h75
-rw-r--r--include/linux/binfmts.h14
-rw-r--r--include/linux/blk.h6
-rw-r--r--include/linux/blkdev.h2
-rw-r--r--include/linux/busmouse.h2
-rw-r--r--include/linux/coda_psdev.h4
-rw-r--r--include/linux/cyclades.h9
-rw-r--r--include/linux/dcache.h17
-rw-r--r--include/linux/efs_fs.h2
-rw-r--r--include/linux/efs_fs_i.h3
-rw-r--r--include/linux/efs_fs_sb.h1
-rw-r--r--include/linux/epca.h4
-rw-r--r--include/linux/ext2_fs.h2
-rw-r--r--include/linux/ext2_fs_i.h2
-rw-r--r--include/linux/file.h8
-rw-r--r--include/linux/fs.h151
-rw-r--r--include/linux/genhd.h18
-rw-r--r--include/linux/hayesesp.h8
-rw-r--r--include/linux/hdreg.h36
-rw-r--r--include/linux/hfmodem.h2
-rw-r--r--include/linux/hfs_fs.h92
-rw-r--r--include/linux/hfs_fs_sb.h3
-rw-r--r--include/linux/hfs_sysdep.h4
-rw-r--r--include/linux/hpfs_fs_i.h26
-rw-r--r--include/linux/hpfs_fs_sb.h39
-rw-r--r--include/linux/i2c.h3
-rw-r--r--include/linux/if_arp.h1
-rw-r--r--include/linux/if_ether.h2
-rw-r--r--include/linux/if_fddi.h2
-rw-r--r--include/linux/if_hippi.h2
-rw-r--r--include/linux/if_pppvar.h2
-rw-r--r--include/linux/if_shaper.h2
-rw-r--r--include/linux/igmp.h14
-rw-r--r--include/linux/inet.h1
-rw-r--r--include/linux/inetdevice.h2
-rw-r--r--include/linux/interrupt.h1
-rw-r--r--include/linux/isdn.h374
-rw-r--r--include/linux/isdn_ppp.h221
-rw-r--r--include/linux/isdnif.h50
-rw-r--r--include/linux/isicom.h4
-rw-r--r--include/linux/istallion.h6
-rw-r--r--include/linux/joystick.h2
-rw-r--r--include/linux/keyboard.h4
-rw-r--r--include/linux/lockd/lockd.h2
-rw-r--r--include/linux/lp.h18
-rw-r--r--include/linux/lp_m68k.h2
-rw-r--r--include/linux/major.h8
-rw-r--r--include/linux/md.h2
-rw-r--r--include/linux/mm.h5
-rw-r--r--include/linux/msdos_fs.h46
-rw-r--r--include/linux/msdos_fs_i.h3
-rw-r--r--include/linux/msdos_fs_sb.h6
-rw-r--r--include/linux/msg.h4
-rw-r--r--include/linux/ncp.h3
-rw-r--r--include/linux/ncp_fs.h6
-rw-r--r--include/linux/ncp_fs_sb.h3
-rw-r--r--include/linux/net.h3
-rw-r--r--include/linux/netdevice.h16
-rw-r--r--include/linux/nfs.h17
-rw-r--r--include/linux/nfs_fs.h13
-rw-r--r--include/linux/nfs_fs_i.h4
-rw-r--r--include/linux/nfsd/nfsfh.h2
-rw-r--r--include/linux/nfsiod.h2
-rw-r--r--include/linux/pagemap.h3
-rw-r--r--include/linux/parport.h43
-rw-r--r--include/linux/parport_pc.h48
-rw-r--r--include/linux/pc_keyb.h2
-rw-r--r--include/linux/pci.h27
-rw-r--r--include/linux/pipe_fs_i.h2
-rw-r--r--include/linux/pkt_sched.h3
-rw-r--r--include/linux/poll.h8
-rw-r--r--include/linux/proc_fs.h21
-rw-r--r--include/linux/quota.h2
-rw-r--r--include/linux/raid5.h4
-rw-r--r--include/linux/rpcsock.h6
-rw-r--r--include/linux/rtnetlink.h136
-rw-r--r--include/linux/sched.h128
-rw-r--r--include/linux/sem.h2
-rw-r--r--include/linux/serial167.h4
-rw-r--r--include/linux/serialP.h6
-rw-r--r--include/linux/skbuff.h80
-rw-r--r--include/linux/smb_fs_sb.h2
-rw-r--r--include/linux/smp.h2
-rw-r--r--include/linux/stallion.h4
-rw-r--r--include/linux/sunrpc/sched.h3
-rw-r--r--include/linux/sunrpc/svc.h2
-rw-r--r--include/linux/swap.h1
-rw-r--r--include/linux/sysctl.h74
-rw-r--r--include/linux/tty.h4
-rw-r--r--include/linux/umsdos_fs_i.h2
-rw-r--r--include/linux/videodev.h1
-rw-r--r--include/linux/vt_kern.h2
-rw-r--r--include/linux/wait.h185
-rw-r--r--include/linux/wanrouter.h11
-rw-r--r--include/net/addrconf.h3
-rw-r--r--include/net/dst.h6
-rw-r--r--include/net/if_inet6.h2
-rw-r--r--include/net/ip.h7
-rw-r--r--include/net/ip_masq.h18
-rw-r--r--include/net/irda/crc.h15
-rw-r--r--include/net/irda/dongle.h14
-rw-r--r--include/net/irda/ircomm_common.h23
-rw-r--r--include/net/irda/irda.h12
-rw-r--r--include/net/irda/irda_device.h62
-rw-r--r--include/net/irda/iriap.h8
-rw-r--r--include/net/irda/irlan_common.h46
-rw-r--r--include/net/irda/irlan_eth.h5
-rw-r--r--include/net/irda/irlan_provider.h10
-rw-r--r--include/net/irda/irlap.h18
-rw-r--r--include/net/irda/irlmp.h6
-rw-r--r--include/net/irda/irlpt_common.h11
-rw-r--r--include/net/irda/irmod.h2
-rw-r--r--include/net/irda/irport.h15
-rw-r--r--include/net/irda/irqueue.h4
-rw-r--r--include/net/irda/irttp.h14
-rw-r--r--include/net/irda/irtty.h27
-rw-r--r--include/net/irda/irvtd.h13
-rw-r--r--include/net/irda/w83977af_ir.h27
-rw-r--r--include/net/irda/wrapper.h18
-rw-r--r--include/net/neighbour.h39
-rw-r--r--include/net/pkt_cls.h9
-rw-r--r--include/net/pkt_sched.h95
-rw-r--r--include/net/route.h10
-rw-r--r--include/net/sock.h127
-rw-r--r--include/net/tcp.h19
-rw-r--r--include/net/udp.h8
-rw-r--r--include/scsi/scsicam.h2
-rw-r--r--include/scsi/sg.h179
214 files changed, 3755 insertions, 2286 deletions
diff --git a/include/asm-alpha/bitops.h b/include/asm-alpha/bitops.h
index b7c805511..adaf2fac2 100644
--- a/include/asm-alpha/bitops.h
+++ b/include/asm-alpha/bitops.h
@@ -172,7 +172,10 @@ extern inline unsigned long ffz_b(unsigned long x)
extern inline unsigned long ffz(unsigned long word)
{
-#ifdef __alpha_cix__
+#if 0 && defined(__alpha_cix__)
+ /* Swine architects -- a year after they publish v3 of the
+ handbook, in the 21264 data sheet they quietly change CIX
+ to FIX and remove the spiffy counting instructions. */
/* Whee. EV6 can calculate it directly. */
unsigned long result;
__asm__("ctlz %1,%0" : "=r"(result) : "r"(~word));
@@ -208,7 +211,10 @@ extern inline int ffs(int word)
* of bits set) of a N-bit word
*/
-#ifdef __alpha_cix__
+#if 0 && defined(__alpha_cix__)
+/* Swine architects -- a year after they publish v3 of the handbook, in
+ the 21264 data sheet they quietly change CIX to FIX and remove the
+ spiffy counting instructions. */
/* Whee. EV6 can calculate it directly. */
extern __inline__ unsigned long hweight64(unsigned long w)
{
diff --git a/include/asm-alpha/ide.h b/include/asm-alpha/ide.h
index e8de11f12..2ef5de935 100644
--- a/include/asm-alpha/ide.h
+++ b/include/asm-alpha/ide.h
@@ -13,8 +13,6 @@
#ifdef __KERNEL__
-typedef unsigned short ide_ioreg_t;
-
#ifndef MAX_HWIFS
#define MAX_HWIFS 4
#endif
@@ -45,18 +43,42 @@ static __inline__ ide_ioreg_t ide_default_io_base(int index)
}
}
-static __inline__ void ide_init_hwif_ports (ide_ioreg_t *p, ide_ioreg_t base, int *irq)
+static __inline__ void ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port, ide_ioreg_t ctrl_port, int *irq)
{
- ide_ioreg_t port = base;
- int i = 8;
+ ide_ioreg_t reg = data_port;
+ int i;
- while (i--)
- *p++ = port++;
- *p++ = base + 0x206;
+ for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
+ hw->io_ports[i] = reg;
+ reg += 1;
+ }
+ if (ctrl_port) {
+ hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port;
+ } else {
+ hw->io_ports[IDE_CONTROL_OFFSET] = hw->io_ports[IDE_DATA_OFFSET] + 0x206;
+ }
if (irq != NULL)
*irq = 0;
}
+/*
+ * This registers the standard ports for this architecture with the IDE
+ * driver.
+ */
+static __inline__ void ide_init_default_hwifs(void)
+{
+#ifdef __DO_I_NEED_THIS
+ hw_regs_t hw;
+ int index;
+
+ for (index = 0; index < MAX_HWIFS; index++) {
+ ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, 0);
+ hw.irq = ide_default_irq(ide_default_io_base(index));
+ ide_register_hw(&hw, NULL);
+ }
+#endif /* __DO_I_NEED_THIS */
+}
+
typedef union {
unsigned all : 8; /* all of the bits together */
struct {
@@ -68,51 +90,19 @@ typedef union {
} b;
} select_t;
-static __inline__ int ide_request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
- unsigned long flags, const char *device, void *dev_id)
-{
- return request_irq(irq, handler, flags, device, dev_id);
-}
-
-static __inline__ void ide_free_irq(unsigned int irq, void *dev_id)
-{
- free_irq(irq, dev_id);
-}
-
-static __inline__ int ide_check_region (ide_ioreg_t from, unsigned int extent)
-{
- return check_region(from, extent);
-}
-
-static __inline__ void ide_request_region (ide_ioreg_t from, unsigned int extent, const char *name)
-{
- request_region(from, extent, name);
-}
-
-static __inline__ void ide_release_region (ide_ioreg_t from, unsigned int extent)
-{
- release_region(from, extent);
-}
+#define ide_request_irq(irq,hand,flg,dev,id) request_irq((irq),(hand),(flg),(dev),(id))
+#define ide_free_irq(irq,dev_id) free_irq((irq), (dev_id))
+#define ide_check_region(from,extent) check_region((from), (extent))
+#define ide_request_region(from,extent,name) request_region((from), (extent), (name))
+#define ide_release_region(from,extent) release_region((from), (extent))
/*
* The following are not needed for the non-m68k ports
*/
-static __inline__ int ide_ack_intr (ide_ioreg_t status_port, ide_ioreg_t irq_port)
-{
- return(1);
-}
-
-static __inline__ void ide_fix_driveid(struct hd_driveid *id)
-{
-}
-
-static __inline__ void ide_release_lock (int *ide_lock)
-{
-}
-
-static __inline__ void ide_get_lock (int *ide_lock, void (*handler)(int, void *, struct pt_regs *), void *data)
-{
-}
+#define ide_ack_intr(hwif) (1)
+#define ide_fix_driveid(id) do {} while (0)
+#define ide_release_lock(lock) do {} while (0)
+#define ide_get_lock(lock, hdlr, data) do {} while (0)
#endif /* __KERNEL__ */
diff --git a/include/asm-alpha/init.h b/include/asm-alpha/init.h
index f4a08c9f2..a85501cbb 100644
--- a/include/asm-alpha/init.h
+++ b/include/asm-alpha/init.h
@@ -12,6 +12,6 @@
#define __FINIT .previous
#define __INITDATA .section .data.init,"a"
-#define __cacheline_aligned __attribute__((__aligned__(L1_CACHE_BYTES)))
+#define __cacheline_aligned __attribute__((__aligned__(32)))
#endif
diff --git a/include/asm-alpha/io.h b/include/asm-alpha/io.h
index dc976cb5f..f908f7464 100644
--- a/include/asm-alpha/io.h
+++ b/include/asm-alpha/io.h
@@ -356,6 +356,12 @@ out:
#endif
#define RTC_ALWAYS_BCD 0
+/* Nothing to do */
+
+#define dma_cache_inv(_start,_size) do { } while (0)
+#define dma_cache_wback(_start,_size) do { } while (0)
+#define dma_cache_wback_inv(_start,_size) do { } while (0)
+
#endif /* __KERNEL__ */
#endif /* __ALPHA_IO_H */
diff --git a/include/asm-alpha/irq.h b/include/asm-alpha/irq.h
index fc9e8019a..ad1c917a3 100644
--- a/include/asm-alpha/irq.h
+++ b/include/asm-alpha/irq.h
@@ -92,8 +92,12 @@ static __inline__ int irq_cannonicalize(int irq)
}
extern void disable_irq(unsigned int);
+extern void disable_irq_nosync(unsigned int);
extern void enable_irq(unsigned int);
+extern void irq_enter(int cpu, int irq);
+extern void irq_exit(int cpu, int irq);
+
struct pt_regs;
extern void (*perf_irq)(unsigned long, struct pt_regs *);
diff --git a/include/asm-alpha/processor.h b/include/asm-alpha/processor.h
index 2af7a8806..f6097cf7c 100644
--- a/include/asm-alpha/processor.h
+++ b/include/asm-alpha/processor.h
@@ -8,6 +8,12 @@
#define __ASM_ALPHA_PROCESSOR_H
/*
+ * Default implementation of macro that returns current
+ * instruction pointer ("program counter").
+ */
+#define current_text_addr() ({ __label__ _l; _l: &&_l;})
+
+/*
* We have a 42-bit user address space: 4TB user VM...
*/
#define TASK_SIZE (0x40000000000UL)
@@ -85,7 +91,7 @@ struct thread_struct {
* is the frame pointer in schedule() and $15 is saved at offset 48 by
* entry.S:do_switch_stack).
*
- * Under heavy swap load I've seen this loose in an ugly way. So do
+ * Under heavy swap load I've seen this lose in an ugly way. So do
* some extra sanity checking on the ranges we expect these pointers
* to be in so that we can fail gracefully. This is just for ps after
* all. -- r~
diff --git a/include/asm-alpha/semaphore.h b/include/asm-alpha/semaphore.h
index 698ce1821..255888e8a 100644
--- a/include/asm-alpha/semaphore.h
+++ b/include/asm-alpha/semaphore.h
@@ -16,15 +16,58 @@ struct semaphore {
/* Careful, inline assembly knows about the position of these two. */
atomic_t count;
atomic_t waking; /* biased by -1 */
- struct wait_queue *wait;
+ wait_queue_head_t wait;
+#if WAITQUEUE_DEBUG
+ long __magic;
+#endif
};
-#define MUTEX ((struct semaphore) \
- { ATOMIC_INIT(1), ATOMIC_INIT(-1), NULL })
-#define MUTEX_LOCKED ((struct semaphore) \
- { ATOMIC_INIT(0), ATOMIC_INIT(-1), NULL })
+#if WAITQUEUE_DEBUG
+# define __SEM_DEBUG_INIT(name) , (long)&(name).__magic
+#else
+# define __SEM_DEBUG_INIT(name)
+#endif
+
+#define __SEMAPHORE_INITIALIZER(name,count) \
+ { ATOMIC_INIT(count), ATOMIC_INIT(-1), \
+ __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \
+ __SEM_DEBUG_INIT(name) }
+
+#define __MUTEX_INITIALIZER(name) \
+ __SEMAPHORE_INITIALIZER(name,1)
+
+#define __DECLARE_SEMAPHORE_GENERIC(name,count) \
+ struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
+
+#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
+#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
+
+extern inline void sema_init (struct semaphore *sem, int val)
+{
+ /*
+ * Logically,
+ * *sem = (struct semaphore)__SEMAPHORE_INITIALIZER((*sem),val);
+ * except that gcc produces better initializing by parts yet.
+ */
+
+ atomic_set(&sem->count, val);
+ atomic_set(&sem->waking, -1);
+ init_waitqueue_head(&sem->wait);
+#if WAITQUEUE_DEBUG
+ sem->__magic = (long)&sem->__magic;
+#endif
+}
+
+static inline void init_MUTEX (struct semaphore *sem)
+{
+ sema_init(sem, 1);
+}
+
+static inline void init_MUTEX_LOCKED (struct semaphore *sem)
+{
+ sema_init(sem, 0);
+}
-#define sema_init(sem, val) atomic_set(&((sem)->count), val)
extern void __down(struct semaphore * sem);
extern int __down_interruptible(struct semaphore * sem);
@@ -57,8 +100,13 @@ extern inline void down(struct semaphore * sem)
a function that ordinarily wouldn't. Otherwise we could
have it done by the macro directly, which can be optimized
the linker. */
- register void *pv __asm__("$27") = __down_failed;
+ register void *pv __asm__("$27");
+
+#if WAITQUEUE_DEBUG
+ CHECK_MAGIC(sem->__magic);
+#endif
+ pv = __down_failed;
__asm__ __volatile__ (
"/* semaphore down operation */\n"
"1: ldl_l $24,%1\n"
@@ -88,8 +136,13 @@ extern inline int down_interruptible(struct semaphore * sem)
value is in $24. */
register int ret __asm__("$24");
- register void *pv __asm__("$27") = __down_failed_interruptible;
+ register void *pv __asm__("$27");
+#if WAITQUEUE_DEBUG
+ CHECK_MAGIC(sem->__magic);
+#endif
+
+ pv = __down_failed_interruptible;
__asm__ __volatile__ (
"/* semaphore down interruptible operation */\n"
"1: ldl_l $24,%2\n"
@@ -144,6 +197,10 @@ extern inline int down_trylock(struct semaphore * sem)
} while (tmp == 0);
*/
+#if WAITQUEUE_DEBUG
+ CHECK_MAGIC(sem->__magic);
+#endif
+
__asm__ __volatile__(
"1: ldq_l %1,%4\n"
" lda %3,1\n"
@@ -179,8 +236,13 @@ extern inline void up(struct semaphore * sem)
it's return address in $28. The pv is loaded as usual.
The gp is clobbered (in the module case) as usual. */
- register void *pv __asm__("$27") = __up_wakeup;
+ register void *pv __asm__("$27");
+#if WAITQUEUE_DEBUG
+ CHECK_MAGIC(sem->__magic);
+#endif
+
+ pv = __up_wakeup;
__asm__ __volatile__ (
"/* semaphore up operation */\n"
" mb\n"
diff --git a/include/asm-alpha/smp.h b/include/asm-alpha/smp.h
index 04be8487d..d53142bb1 100644
--- a/include/asm-alpha/smp.h
+++ b/include/asm-alpha/smp.h
@@ -4,22 +4,30 @@
#ifdef __SMP__
#include <linux/tasks.h>
+#include <asm/init.h>
#include <asm/pal.h>
struct cpuinfo_alpha {
unsigned long loops_per_sec;
- unsigned int next;
unsigned long *pgd_cache;
unsigned long *pte_cache;
unsigned long pgtable_cache_sz;
unsigned long ipi_count;
-} __attribute__((aligned(32)));
+ unsigned long prof_multiplier;
+ unsigned long prof_counter;
+} __cacheline_aligned;
extern struct cpuinfo_alpha cpu_data[NR_CPUS];
#define PROC_CHANGE_PENALTY 20
-extern __volatile__ int cpu_number_map[NR_CPUS];
+/* Map from cpu id to sequential logical cpu number. This will only
+ not be idempotent when cpus failed to come on-line. */
+extern int cpu_number_map[NR_CPUS];
+
+/* The reverse map from sequential logical cpu number to cpu id. */
+extern int __cpu_logical_map[NR_CPUS];
+#define cpu_logical_map(cpu) __cpu_logical_map[cpu]
/* HACK: Cabrio WHAMI return value is bogus if more than 8 bits used.. :-( */
@@ -35,7 +43,6 @@ static __inline__ unsigned char hard_smp_processor_id(void)
}
#define smp_processor_id() (current->processor)
-#define cpu_logical_map(cpu) (cpu)
#endif /* __SMP__ */
diff --git a/include/asm-alpha/softirq.h b/include/asm-alpha/softirq.h
index 41ccc29c9..cb89c5328 100644
--- a/include/asm-alpha/softirq.h
+++ b/include/asm-alpha/softirq.h
@@ -5,6 +5,16 @@
#include <asm/atomic.h>
#include <asm/hardirq.h>
+/*
+ * This works but is wrong - on SMP it should disable only on the
+ * current CPU and shouldn't synchronize like the heavy global
+ * disable does. Oh, well.
+ *
+ * See the x86 version for an example.
+ */
+#define local_bh_enable() start_bh_atomic()
+#define local_bh_disable() end_bh_atomic()
+
extern unsigned int local_bh_count[NR_CPUS];
#define get_active_bhs() (bh_mask & bh_active)
diff --git a/include/asm-alpha/spinlock.h b/include/asm-alpha/spinlock.h
index b5fe62ddf..bbc8de52b 100644
--- a/include/asm-alpha/spinlock.h
+++ b/include/asm-alpha/spinlock.h
@@ -3,6 +3,35 @@
#include <asm/system.h>
+/*
+ * These are the generic versions of the spinlocks
+ * and read-write locks.. We should actually do a
+ * <linux/spinlock.h> with all of this. Oh, well.
+ */
+#define spin_lock_irqsave(lock, flags) do { local_irq_save(flags); spin_lock(lock); } while (0)
+#define spin_lock_irq(lock) do { local_irq_disable(); spin_lock(lock); } while (0)
+#define spin_lock_bh(lock) do { local_bh_disable(); spin_lock(lock); } while (0)
+
+#define read_lock_irqsave(lock, flags) do { local_irq_save(flags); read_lock(lock); } while (0)
+#define read_lock_irq(lock) do { local_irq_disable(); read_lock(lock); } while (0)
+#define read_lock_bh(lock) do { local_bh_disable(); read_lock(lock); } while (0)
+
+#define write_lock_irqsave(lock, flags) do { local_irq_save(flags); write_lock(lock); } while (0)
+#define write_lock_irq(lock) do { local_irq_disable(); write_lock(lock); } while (0)
+#define write_lock_bh(lock) do { local_bh_disable(); write_lock(lock); } while (0)
+
+#define spin_unlock_irqrestore(lock, flags) do { spin_unlock(lock); local_irq_restore(flags); } while (0)
+#define spin_unlock_irq(lock) do { spin_unlock(lock); local_irq_enable(); } while (0)
+#define spin_unlock_bh(lock) do { spin_unlock(lock); local_bh_enable(); } while (0)
+
+#define read_unlock_irqrestore(lock, flags) do { read_unlock(lock); local_irq_restore(flags); } while (0)
+#define read_unlock_irq(lock) do { read_unlock(lock); local_irq_enable(); } while (0)
+#define read_unlock_bh(lock) do { read_unlock(lock); local_bh_enable(); } while (0)
+
+#define write_unlock_irqrestore(lock, flags) do { write_unlock(lock); local_irq_restore(flags); } while (0)
+#define write_unlock_irq(lock) do { write_unlock(lock); local_irq_enable(); } while (0)
+#define write_unlock_bh(lock) do { write_unlock(lock); local_bh_enable(); } while (0)
+
#ifndef __SMP__
/*
@@ -23,11 +52,6 @@
#define spin_trylock(lock) ((void) 0)
#define spin_unlock_wait(lock) ((void) 0)
#define spin_unlock(lock) ((void) 0)
-#define spin_lock_irq(lock) cli()
-#define spin_unlock_irq(lock) sti()
-
-#define spin_lock_irqsave(lock, flags) save_and_cli(flags)
-#define spin_unlock_irqrestore(lock, flags) restore_flags(flags)
/*
* Read-write spinlocks, allowing multiple readers
@@ -53,15 +77,6 @@
#define read_unlock(lock) ((void) 0)
#define write_lock(lock) ((void) 0)
#define write_unlock(lock) ((void) 0)
-#define read_lock_irq(lock) cli()
-#define read_unlock_irq(lock) sti()
-#define write_lock_irq(lock) cli()
-#define write_unlock_irq(lock) sti()
-
-#define read_lock_irqsave(lock, flags) save_and_cli(flags)
-#define read_unlock_irqrestore(lock, flags) restore_flags(flags)
-#define write_lock_irqsave(lock, flags) save_and_cli(flags)
-#define write_unlock_irqrestore(lock, flags) restore_flags(flags)
#else /* __SMP__ */
@@ -150,15 +165,6 @@ static inline void spin_lock(spinlock_t * lock)
#define spin_lock_own(LOCK, LOCATION) ((void)0)
#endif /* DEBUG_SPINLOCK */
-#define spin_lock_irq(lock) \
- (__cli(), spin_lock(lock))
-#define spin_unlock_irq(lock) \
- (spin_unlock(lock), __sti())
-#define spin_lock_irqsave(lock, flags) \
- (__save_and_cli(flags), spin_lock(lock))
-#define spin_unlock_irqrestore(lock, flags) \
- (spin_unlock(lock), __restore_flags(flags))
-
/***********************************************************/
typedef struct { volatile int write_lock:1, read_counter:31; } rwlock_t;
@@ -233,19 +239,5 @@ static inline void read_unlock(rwlock_t * lock)
: "m" (__dummy_lock(lock)));
}
-#define read_lock_irq(lock) (__cli(), read_lock(lock))
-#define read_unlock_irq(lock) (read_unlock(lock), __sti())
-#define write_lock_irq(lock) (__cli(), write_lock(lock))
-#define write_unlock_irq(lock) (write_unlock(lock), __sti())
-
-#define read_lock_irqsave(lock, flags) \
- (__save_and_cli(flags), read_lock(lock))
-#define read_unlock_irqrestore(lock, flags) \
- (read_unlock(lock), __restore_flags(flags))
-#define write_lock_irqsave(lock, flags) \
- (__save_and_cli(flags), write_lock(lock))
-#define write_unlock_irqrestore(lock, flags) \
- (write_unlock(lock), __restore_flags(flags))
-
#endif /* SMP */
#endif /* _ALPHA_SPINLOCK_H */
diff --git a/include/asm-alpha/string.h b/include/asm-alpha/string.h
index 11495a0b6..f53d2ff74 100644
--- a/include/asm-alpha/string.h
+++ b/include/asm-alpha/string.h
@@ -11,6 +11,7 @@
*/
#define __HAVE_ARCH_MEMCPY
+#define __HAVE_ARCH_MEMMOVE
/* For backward compatibility with modules. Unused otherwise. */
extern void * __memcpy(void *, const void *, size_t);
diff --git a/include/asm-alpha/system.h b/include/asm-alpha/system.h
index b37be73b2..2be0ced69 100644
--- a/include/asm-alpha/system.h
+++ b/include/asm-alpha/system.h
@@ -147,6 +147,13 @@ enum implver_enum {
#endif
#endif
+enum amask_enum {
+ AMASK_BWX = (1UL << 0),
+ AMASK_FIX = (1UL << 1),
+ AMASK_MAX = (1UL << 8),
+ AMASK_PRECISE_TRAP = (1UL << 9),
+};
+
#define amask(mask) \
({ unsigned long __amask, __input = (mask); \
__asm__ ("amask %1,%0" : "=r"(__amask) : "rI"(__input)); \
@@ -220,6 +227,11 @@ wrperfmon(unsigned long perf_fun, unsigned long arg)
#define __save_and_cli(flags) ((flags) = swpipl(7))
#define __restore_flags(flags) setipl(flags)
+#define local_irq_save(flags) __save_and_cli(flags)
+#define local_irq_restore(flags) __restore_flags(flags)
+#define local_irq_disable() __cli()
+#define local_irq_enable() __sti()
+
#ifdef __SMP__
extern int global_irq_holder;
diff --git a/include/asm-arm/arch-arc/ide.h b/include/asm-arm/arch-arc/ide.h
index 2fc6ce282..031225380 100644
--- a/include/asm-arm/arch-arc/ide.h
+++ b/include/asm-arm/arch-arc/ide.h
@@ -19,33 +19,32 @@
* Set up a hw structure for a specified data port, control port and IRQ.
* This should follow whatever the default interface uses.
*/
-static __inline__ void
-ide_init_hwif_ports(hw_regs_t *hw, int data_port, int ctrl_port, int irq)
+static __inline__ void ide_init_hwif_ports(hw_regs_t *hw, int data_port, int ctrl_port, int *irq)
{
ide_ioreg_t reg = (ide_ioreg_t) data_port;
int i;
- memset(hw, 0, sizeof(*hw));
-
for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
hw->io_ports[i] = reg;
reg += 1;
}
hw->io_ports[IDE_CONTROL_OFFSET] = (ide_ioreg_t) ctrl_port;
- hw->irq = irq;
+ hw->irq = *irq;
}
/*
* This registers the standard ports for this architecture with the IDE
* driver.
*/
-static __inline__ void
-ide_init_default_hwifs(void)
+static __inline__ void ide_init_default_hwifs(void)
{
#ifdef CONFIG_ARCH_A5K
hw_regs_t hw;
- ide_init_hwif_ports(&hw, 0x1f0, 0x3f6, IRQ_HARDDISK);
+ memset(hw, 0, sizeof(*hw));
+
+ ide_init_hwif_ports(&hw, 0x1f0, 0x3f6, NULL);
+ hw.irq = IRQ_HARDDISK;
ide_register_hw(&hw, NULL);
#endif
}
diff --git a/include/asm-arm/arch-ebsa285/ide.h b/include/asm-arm/arch-ebsa285/ide.h
index b0071a45b..d86a6f98a 100644
--- a/include/asm-arm/arch-ebsa285/ide.h
+++ b/include/asm-arm/arch-ebsa285/ide.h
@@ -12,27 +12,32 @@
* Set up a hw structure for a specified data port, control port and IRQ.
* This should follow whatever the default interface uses.
*/
-static __inline__ void
-ide_init_hwif_ports(hw_regs_t *hw, int data_port, int ctrl_port, int irq)
+static __inline__ void ide_init_hwif_ports(hw_regs_t *hw, int data_port, int ctrl_port, int *irq)
{
ide_ioreg_t reg = (ide_ioreg_t) data_port;
int i;
- memset(hw, 0, sizeof(*hw));
-
for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
hw->io_ports[i] = reg;
reg += 1;
}
hw->io_ports[IDE_CONTROL_OFFSET] = (ide_ioreg_t) ctrl_port;
- hw->irq = irq;
+ hw->irq = *irq;
}
/*
* This registers the standard ports for this architecture with the IDE
* driver.
*/
-static __inline__ void
-ide_init_default_hwifs(void)
+static __inline__ void ide_init_default_hwifs(void)
{
+#if 0
+ hw_regs_t hw;
+
+ memset(hw, 0, sizeof(*hw));
+
+ ide_init_hwif_ports(&hw, 0x1f0, 0x3f6, NULL);
+ hw.irq = IRQ_HARDDISK;
+ ide_register_hw(&hw, NULL);
+#endif
}
diff --git a/include/asm-arm/arch-rpc/ide.h b/include/asm-arm/arch-rpc/ide.h
index ccbc7cf76..9826f15f5 100644
--- a/include/asm-arm/arch-rpc/ide.h
+++ b/include/asm-arm/arch-rpc/ide.h
@@ -12,31 +12,30 @@
* Set up a hw structure for a specified data port, control port and IRQ.
* This should follow whatever the default interface uses.
*/
-static __inline__ void
-ide_init_hwif_ports(hw_regs_t *hw, int data_port, int ctrl_port, int irq)
+static __inline__ void ide_init_hwif_ports(hw_regs_t *hw, int data_port, int ctrl_port, int *irq)
{
ide_ioreg_t reg = (ide_ioreg_t) data_port;
int i;
- memset(hw, 0, sizeof(*hw));
-
for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
hw->io_ports[i] = reg;
reg += 1;
}
hw->io_ports[IDE_CONTROL_OFFSET] = (ide_ioreg_t) ctrl_port;
- hw->irq = irq;
+ hw->irq = *irq;
}
/*
* This registers the standard ports for this architecture with the IDE
* driver.
*/
-static __inline__ void
-ide_init_default_hwifs(void)
+static __inline__ void ide_init_default_hwifs(void)
{
hw_regs_t hw;
- ide_init_hwif_ports(&hw, 0x1f0, 0x3f6, IRQ_HARDDISK);
+ memset(hw, 0, sizeof(*hw));
+
+ ide_init_hwif_ports(&hw, 0x1f0, 0x3f6, NULL);
+ hw.irq = IRQ_HARDDISK;
ide_register_hw(&hw, NULL);
}
diff --git a/include/asm-arm/arch-rpc/io.h b/include/asm-arm/arch-rpc/io.h
index ecf07c17c..740fa30c0 100644
--- a/include/asm-arm/arch-rpc/io.h
+++ b/include/asm-arm/arch-rpc/io.h
@@ -28,18 +28,43 @@
* Dynamic IO functions - let the compiler
* optimize the expressions
*/
-#define DECLARE_DYN_OUT(fnsuffix,instr) \
-extern __inline__ void __out##fnsuffix (unsigned int value, unsigned int port) \
-{ \
- unsigned long temp; \
- __asm__ __volatile__( \
- "tst %2, #0x80000000\n\t" \
- "mov %0, %4\n\t" \
- "addeq %0, %0, %3\n\t" \
- "str" ##instr## " %1, [%0, %2, lsl #2] @ out"###fnsuffix \
- : "=&r" (temp) \
- : "r" (value), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE) \
- : "cc"); \
+extern __inline__ void __outb (unsigned int value, unsigned int port)
+{
+ unsigned long temp;
+ __asm__ __volatile__(
+ "tst %2, #0x80000000\n\t"
+ "mov %0, %4\n\t"
+ "addeq %0, %0, %3\n\t"
+ "strb %1, [%0, %2, lsl #2] @ outb"
+ : "=&r" (temp)
+ : "r" (value), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE)
+ : "cc");
+}
+
+extern __inline__ void __outw (unsigned int value, unsigned int port)
+{
+ unsigned long temp;
+ __asm__ __volatile__(
+ "tst %2, #0x80000000\n\t"
+ "mov %0, %4\n\t"
+ "addeq %0, %0, %3\n\t"
+ "str %1, [%0, %2, lsl #2] @ outw"
+ : "=&r" (temp)
+ : "r" (value|value<<16), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE)
+ : "cc");
+}
+
+extern __inline__ void __outl (unsigned int value, unsigned int port)
+{
+ unsigned long temp;
+ __asm__ __volatile__(
+ "tst %2, #0x80000000\n\t"
+ "mov %0, %4\n\t"
+ "addeq %0, %0, %3\n\t"
+ "str %1, [%0, %2, lsl #2] @ outl"
+ : "=&r" (temp)
+ : "r" (value), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE)
+ : "cc");
}
#define DECLARE_DYN_IN(sz,fnsuffix,instr) \
@@ -66,7 +91,6 @@ extern __inline__ unsigned int __ioaddr (unsigned int port) \
}
#define DECLARE_IO(sz,fnsuffix,instr) \
- DECLARE_DYN_OUT(fnsuffix,instr) \
DECLARE_DYN_IN(sz,fnsuffix,instr)
DECLARE_IO(char,b,"b")
@@ -74,7 +98,6 @@ DECLARE_IO(short,w,"")
DECLARE_IO(long,l,"")
#undef DECLARE_IO
-#undef DECLARE_DYN_OUT
#undef DECLARE_DYN_IN
/*
diff --git a/include/asm-arm/ide.h b/include/asm-arm/ide.h
index 76da8806b..6bd9d3c02 100644
--- a/include/asm-arm/ide.h
+++ b/include/asm-arm/ide.h
@@ -48,4 +48,4 @@ typedef union {
#endif /* __KERNEL__ */
-#endif /* __ASMi386_IDE_H */
+#endif /* __ASMARM_IDE_H */
diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h
index 35db8e667..cfa021bcd 100644
--- a/include/asm-arm/io.h
+++ b/include/asm-arm/io.h
@@ -189,10 +189,21 @@ __IO(l,"",long)
#define inl_p(port) __inl_p((port))
#endif
-#endif
+/* Nothing to do */
+#ifndef dma_cache_inv
+#define dma_cache_inv(_start,_size) do { } while (0)
+#endif
+#ifndef dma_cache_wback
+#define dma_cache_wback(_start,_size) do { } while (0)
#ifndef ARCH_READWRITE
+#ifndef dma_cache_wback_inv
+#define dma_cache_wback_inv(_start,_size) do { } while (0)
+#endif
+
+#endif /* __KERNEL__ */
+#endif /* __ASM_ARM_IO_H */
/* for panic */
#include <linux/kernel.h>
diff --git a/include/asm-arm/proc-fns.h b/include/asm-arm/proc-fns.h
index 81873a58c..75e976244 100644
--- a/include/asm-arm/proc-fns.h
+++ b/include/asm-arm/proc-fns.h
@@ -10,7 +10,7 @@
#ifdef __KERNEL__
-/* forward-decare task_struct */
+/* forward-declare task_struct */
struct task_struct;
/*
diff --git a/include/asm-arm/processor.h b/include/asm-arm/processor.h
index a59e441a1..f308d67b1 100644
--- a/include/asm-arm/processor.h
+++ b/include/asm-arm/processor.h
@@ -7,6 +7,12 @@
#ifndef __ASM_ARM_PROCESSOR_H
#define __ASM_ARM_PROCESSOR_H
+/*
+ * Default implementation of macro that returns current
+ * instruction pointer ("program counter").
+ */
+#define current_text_addr() ({ __label__ _l; _l: &&_l;})
+
#define FP_SIZE 35
struct fp_hard_struct {
diff --git a/include/asm-arm/semaphore.h b/include/asm-arm/semaphore.h
index a51b6f96e..05456d7de 100644
--- a/include/asm-arm/semaphore.h
+++ b/include/asm-arm/semaphore.h
@@ -5,13 +5,12 @@
#define __ASM_ARM_SEMAPHORE_H
#include <linux/linkage.h>
-#include <asm/system.h>
#include <asm/atomic.h>
struct semaphore {
atomic_t count;
int waking;
- struct wait_queue * wait;
+ wait_queue_head_t wait;
};
#define MUTEX ((struct semaphore) { ATOMIC_INIT(1), 0, NULL })
diff --git a/include/asm-i386/bugs.h b/include/asm-i386/bugs.h
index ebd9a4f1a..2ceaa977d 100644
--- a/include/asm-i386/bugs.h
+++ b/include/asm-i386/bugs.h
@@ -357,10 +357,18 @@ __initfunc(static void check_cyrix_cpu(void))
__initfunc(static void check_cyrix_coma(void))
{
if (boot_cpu_data.coma_bug) {
- unsigned char ccr1;
+ unsigned char ccr3, tmp;
cli();
- ccr1 = getCx86 (CX86_CCR1);
- setCx86 (CX86_CCR1, ccr1 | 0x10);
+ ccr3 = getCx86(CX86_CCR3);
+ setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */
+ tmp = getCx86(0x31);
+ setCx86(0x31, tmp | 0xf8);
+ tmp = getCx86(0x32);
+ setCx86(0x32, tmp | 0x7f);
+ setCx86(0x33, 0);
+ tmp = getCx86(0x3c);
+ setCx86(0x3c, tmp | 0x87);
+ setCx86(CX86_CCR3, ccr3); /* disable MAPEN */
sti();
printk("Cyrix processor with \"coma bug\" found, workaround enabled\n");
}
diff --git a/include/asm-i386/ide.h b/include/asm-i386/ide.h
index a6d1fc868..6876f9f60 100644
--- a/include/asm-i386/ide.h
+++ b/include/asm-i386/ide.h
@@ -13,10 +13,8 @@
#ifdef __KERNEL__
-typedef unsigned short ide_ioreg_t;
-
#ifndef MAX_HWIFS
-#define MAX_HWIFS 6
+#define MAX_HWIFS 8
#endif
#define ide__sti() __sti()
@@ -49,18 +47,38 @@ static __inline__ ide_ioreg_t ide_default_io_base(int index)
}
}
-static __inline__ void ide_init_hwif_ports (ide_ioreg_t *p, ide_ioreg_t base, int *irq)
+static __inline__ void ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port, ide_ioreg_t ctrl_port, int *irq)
{
- ide_ioreg_t port = base;
- int i = 8;
+ ide_ioreg_t reg = data_port;
+ int i;
- while (i--)
- *p++ = port++;
- *p++ = base + 0x206;
+ for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
+ hw->io_ports[i] = reg;
+ reg += 1;
+ }
+ if (ctrl_port) {
+ hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port;
+ } else {
+ hw->io_ports[IDE_CONTROL_OFFSET] = hw->io_ports[IDE_DATA_OFFSET] + 0x206;
+ }
if (irq != NULL)
*irq = 0;
}
+static __inline__ void ide_init_default_hwifs(void)
+{
+#ifdef __DO_I_NEED_THIS
+ hw_regs_t hw;
+ int index;
+
+ for(index = 0; index < MAX_HWIFS; index++) {
+ ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, NULL);
+ hw.irq = ide_default_irq(ide_default_io_base(index));
+ ide_register_hw(&hw, NULL);
+ }
+#endif /* __DO_I_NEED_THIS */
+}
+
typedef union {
unsigned all : 8; /* all of the bits together */
struct {
@@ -72,51 +90,19 @@ typedef union {
} b;
} select_t;
-static __inline__ int ide_request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
- unsigned long flags, const char *device, void *dev_id)
-{
- return request_irq(irq, handler, flags, device, dev_id);
-}
-
-static __inline__ void ide_free_irq(unsigned int irq, void *dev_id)
-{
- free_irq(irq, dev_id);
-}
-
-static __inline__ int ide_check_region (ide_ioreg_t from, unsigned int extent)
-{
- return check_region(from, extent);
-}
-
-static __inline__ void ide_request_region (ide_ioreg_t from, unsigned int extent, const char *name)
-{
- request_region(from, extent, name);
-}
-
-static __inline__ void ide_release_region (ide_ioreg_t from, unsigned int extent)
-{
- release_region(from, extent);
-}
+#define ide_request_irq(irq,hand,flg,dev,id) request_irq((irq),(hand),(flg),(dev),(id))
+#define ide_free_irq(irq,dev_id) free_irq((irq), (dev_id))
+#define ide_check_region(from,extent) check_region((from), (extent))
+#define ide_request_region(from,extent,name) request_region((from), (extent), (name))
+#define ide_release_region(from,extent) release_region((from), (extent))
/*
* The following are not needed for the non-m68k ports
*/
-static __inline__ int ide_ack_intr (ide_ioreg_t status_port, ide_ioreg_t irq_port)
-{
- return(1);
-}
-
-static __inline__ void ide_fix_driveid(struct hd_driveid *id)
-{
-}
-
-static __inline__ void ide_release_lock (int *ide_lock)
-{
-}
-
-static __inline__ void ide_get_lock (int *ide_lock, void (*handler)(int, void *, struct pt_regs *), void *data)
-{
-}
+#define ide_ack_intr(hwif) (1)
+#define ide_fix_driveid(id) do {} while (0)
+#define ide_release_lock(lock) do {} while (0)
+#define ide_get_lock(lock, hdlr, data) do {} while (0)
#endif /* __KERNEL__ */
diff --git a/include/asm-i386/io.h b/include/asm-i386/io.h
index 155ff1419..93fd0c1b5 100644
--- a/include/asm-i386/io.h
+++ b/include/asm-i386/io.h
@@ -183,6 +183,12 @@ out:
return retval;
}
+/* Nothing to do */
+
+#define dma_cache_inv(_start,_size) do { } while (0)
+#define dma_cache_wback(_start,_size) do { } while (0)
+#define dma_cache_wback_inv(_start,_size) do { } while (0)
+
#endif /* __KERNEL__ */
#endif
diff --git a/include/asm-i386/locks.h b/include/asm-i386/locks.h
index a46015d21..1cc171f9b 100644
--- a/include/asm-i386/locks.h
+++ b/include/asm-i386/locks.h
@@ -2,7 +2,7 @@
* SMP locks primitives for building ix86 locks
* (not yet used).
*
- * Alan Cox, alan@cymru.net, 1995
+ * Alan Cox, alan@redhat.com, 1995
*/
/*
diff --git a/include/asm-i386/page.h b/include/asm-i386/page.h
index 1694ed16b..0490404b7 100644
--- a/include/asm-i386/page.h
+++ b/include/asm-i386/page.h
@@ -79,7 +79,10 @@ typedef unsigned long pgprot_t;
*
* which has the same constant encoded..
*/
-#define __PAGE_OFFSET (0xC0000000)
+
+#include <asm/page_offset.h>
+
+#define __PAGE_OFFSET (PAGE_OFFSET_RAW)
#define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET)
#define __pa(x) ((unsigned long)(x)-PAGE_OFFSET)
diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h
index 25ef571e3..dde35a87c 100644
--- a/include/asm-i386/processor.h
+++ b/include/asm-i386/processor.h
@@ -11,6 +11,13 @@
#include <asm/math_emu.h>
#include <asm/segment.h>
#include <asm/page.h>
+#include <asm/types.h>
+
+/*
+ * Default implementation of macro that returns current
+ * instruction pointer ("program counter").
+ */
+#define current_text_addr() ({ void *pc; __asm__("movl $1f,%0\n1:":"=g" (pc)); pc; })
/*
* CPU type and hardware bug flags. Kept separately for each CPU.
@@ -279,6 +286,7 @@ struct thread_struct {
} while (0)
/* Forward declaration, a strange C thing */
+struct task_struct;
struct mm_struct;
/* Free all resources held by a thread. */
diff --git a/include/asm-i386/semaphore.h b/include/asm-i386/semaphore.h
index ccf69385c..3298aeb13 100644
--- a/include/asm-i386/semaphore.h
+++ b/include/asm-i386/semaphore.h
@@ -27,15 +27,69 @@
#include <asm/system.h>
#include <asm/atomic.h>
#include <asm/spinlock.h>
+#include <linux/wait.h>
struct semaphore {
atomic_t count;
int waking;
- struct wait_queue * wait;
+ wait_queue_head_t wait;
+#if WAITQUEUE_DEBUG
+ long __magic;
+#endif
};
-#define MUTEX ((struct semaphore) { ATOMIC_INIT(1), 0, NULL })
-#define MUTEX_LOCKED ((struct semaphore) { ATOMIC_INIT(0), 0, NULL })
+#if WAITQUEUE_DEBUG
+# define __SEM_DEBUG_INIT(name) \
+ , (int)&(name).__magic
+#else
+# define __SEM_DEBUG_INIT(name)
+#endif
+
+#define __SEMAPHORE_INITIALIZER(name,count) \
+{ ATOMIC_INIT(count), 0, __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \
+ __SEM_DEBUG_INIT(name) }
+
+#define __MUTEX_INITIALIZER(name) \
+ __SEMAPHORE_INITIALIZER(name,1)
+
+#define __DECLARE_SEMAPHORE_GENERIC(name,count) \
+ struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
+
+#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
+#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
+
+extern inline void __sema_init (struct semaphore *sem, int val)
+{
+/*
+ * *sem = (struct semaphore)__SEMAPHORE_INITIALIZER((*sem),val);
+ *
+ * i'd rather use the more flexible initialization above, but sadly
+ * GCC 2.7.2.3 emits a bogus warning. EGCS doesnt. Oh well.
+ */
+ atomic_set(&sem->count, val);
+ sem->waking = 0;
+ init_waitqueue_head(&sem->wait);
+#if WAITQUEUE_DEBUG
+ sem->__magic = (int)&sem->__magic;
+#endif
+}
+#define sema_init(sem,val) \
+ do { \
+ struct semaphore *__sem = (sem); \
+ printk("sema_init called at %s, %d for semaphore 0x%08lx\n", \
+ __FILE__, __LINE__, (unsigned long) __sem); \
+ __sema_init(__sem, (val)); \
+ while(1);
+
+static inline void init_MUTEX (struct semaphore *sem)
+{
+ sema_init(sem, 1);
+}
+
+static inline void init_MUTEX_LOCKED (struct semaphore *sem)
+{
+ sema_init(sem, 0);
+}
asmlinkage void __down_failed(void /* special register calling convention */);
asmlinkage int __down_failed_interruptible(void /* params in registers */);
@@ -49,8 +103,6 @@ asmlinkage void __up(struct semaphore * sem);
extern spinlock_t semaphore_wake_lock;
-#define sema_init(sem, val) atomic_set(&((sem)->count), (val))
-
/*
* This is ugly, but we want the default case to fall through.
* "down_failed" is a special asm handler that calls the C
@@ -58,6 +110,10 @@ extern spinlock_t semaphore_wake_lock;
*/
extern inline void down(struct semaphore * sem)
{
+#if WAITQUEUE_DEBUG
+ CHECK_MAGIC(sem->__magic);
+#endif
+
__asm__ __volatile__(
"# atomic down operation\n\t"
#ifdef __SMP__
@@ -79,6 +135,10 @@ extern inline int down_interruptible(struct semaphore * sem)
{
int result;
+#if WAITQUEUE_DEBUG
+ CHECK_MAGIC(sem->__magic);
+#endif
+
__asm__ __volatile__(
"# atomic interruptible down operation\n\t"
#ifdef __SMP__
@@ -102,6 +162,10 @@ extern inline int down_trylock(struct semaphore * sem)
{
int result;
+#if WAITQUEUE_DEBUG
+ CHECK_MAGIC(sem->__magic);
+#endif
+
__asm__ __volatile__(
"# atomic interruptible down operation\n\t"
#ifdef __SMP__
@@ -129,6 +193,9 @@ extern inline int down_trylock(struct semaphore * sem)
*/
extern inline void up(struct semaphore * sem)
{
+#if WAITQUEUE_DEBUG
+ CHECK_MAGIC(sem->__magic);
+#endif
__asm__ __volatile__(
"# atomic up operation\n\t"
#ifdef __SMP__
diff --git a/include/asm-i386/softirq.h b/include/asm-i386/softirq.h
index a0e4d76b6..b8f33d7af 100644
--- a/include/asm-i386/softirq.h
+++ b/include/asm-i386/softirq.h
@@ -6,6 +6,15 @@
extern unsigned int local_bh_count[NR_CPUS];
+#define cpu_bh_disable(cpu) do { local_bh_count[(cpu)]++; barrier(); } while (0)
+#define cpu_bh_enable(cpu) do { barrier(); local_bh_count[(cpu)]--; } while (0)
+
+#define cpu_bh_trylock(cpu) (local_bh_count[(cpu)] ? 0 : (local_bh_count[(cpu)] = 1))
+#define cpu_bh_endlock(cpu) (local_bh_count[(cpu)] = 0)
+
+#define local_bh_disable() cpu_bh_disable(smp_processor_id())
+#define local_bh_enable() cpu_bh_enable(smp_processor_id())
+
#define get_active_bhs() (bh_mask & bh_active)
#define clear_active_bhs(x) atomic_clear_mask((x),&bh_active)
@@ -54,19 +63,20 @@ static inline void end_bh_atomic(void)
/* These are for the IRQs testing the lock */
static inline int softirq_trylock(int cpu)
{
- if (!test_and_set_bit(0,&global_bh_count)) {
- if (atomic_read(&global_bh_lock) == 0) {
- ++local_bh_count[cpu];
- return 1;
+ if (cpu_bh_trylock(cpu)) {
+ if (!test_and_set_bit(0,&global_bh_count)) {
+ if (atomic_read(&global_bh_lock) == 0)
+ return 1;
+ clear_bit(0,&global_bh_count);
}
- clear_bit(0,&global_bh_count);
+ cpu_bh_endlock(cpu);
}
return 0;
}
static inline void softirq_endlock(int cpu)
{
- local_bh_count[cpu]--;
+ cpu_bh_enable(cpu);
clear_bit(0,&global_bh_count);
}
@@ -74,19 +84,19 @@ static inline void softirq_endlock(int cpu)
extern inline void start_bh_atomic(void)
{
- local_bh_count[smp_processor_id()]++;
+ local_bh_disable();
barrier();
}
extern inline void end_bh_atomic(void)
{
barrier();
- local_bh_count[smp_processor_id()]--;
+ local_bh_enable();
}
/* These are for the irq's testing the lock */
-#define softirq_trylock(cpu) (local_bh_count[cpu] ? 0 : (local_bh_count[cpu]=1))
-#define softirq_endlock(cpu) (local_bh_count[cpu] = 0)
+#define softirq_trylock(cpu) (cpu_bh_trylock(cpu))
+#define softirq_endlock(cpu) (cpu_bh_endlock(cpu))
#define synchronize_bh() barrier()
#endif /* SMP */
diff --git a/include/asm-i386/spinlock.h b/include/asm-i386/spinlock.h
index 00e238407..b447a402f 100644
--- a/include/asm-i386/spinlock.h
+++ b/include/asm-i386/spinlock.h
@@ -1,6 +1,35 @@
#ifndef __ASM_SPINLOCK_H
#define __ASM_SPINLOCK_H
+/*
+ * These are the generic versions of the spinlocks
+ * and read-write locks.. We should actually do a
+ * <linux/spinlock.h> with all of this. Oh, well.
+ */
+#define spin_lock_irqsave(lock, flags) do { local_irq_save(flags); spin_lock(lock); } while (0)
+#define spin_lock_irq(lock) do { local_irq_disable(); spin_lock(lock); } while (0)
+#define spin_lock_bh(lock) do { local_bh_disable(); spin_lock(lock); } while (0)
+
+#define read_lock_irqsave(lock, flags) do { local_irq_save(flags); read_lock(lock); } while (0)
+#define read_lock_irq(lock) do { local_irq_disable(); read_lock(lock); } while (0)
+#define read_lock_bh(lock) do { local_bh_disable(); read_lock(lock); } while (0)
+
+#define write_lock_irqsave(lock, flags) do { local_irq_save(flags); write_lock(lock); } while (0)
+#define write_lock_irq(lock) do { local_irq_disable(); write_lock(lock); } while (0)
+#define write_lock_bh(lock) do { local_bh_disable(); write_lock(lock); } while (0)
+
+#define spin_unlock_irqrestore(lock, flags) do { spin_unlock(lock); local_irq_restore(flags); } while (0)
+#define spin_unlock_irq(lock) do { spin_unlock(lock); local_irq_enable(); } while (0)
+#define spin_unlock_bh(lock) do { spin_unlock(lock); local_bh_enable(); } while (0)
+
+#define read_unlock_irqrestore(lock, flags) do { read_unlock(lock); local_irq_restore(flags); } while (0)
+#define read_unlock_irq(lock) do { read_unlock(lock); local_irq_enable(); } while (0)
+#define read_unlock_bh(lock) do { read_unlock(lock); local_bh_enable(); } while (0)
+
+#define write_unlock_irqrestore(lock, flags) do { write_unlock(lock); local_irq_restore(flags); } while (0)
+#define write_unlock_irq(lock) do { write_unlock(lock); local_irq_enable(); } while (0)
+#define write_unlock_bh(lock) do { write_unlock(lock); local_bh_enable(); } while (0)
+
#ifndef __SMP__
#define DEBUG_SPINLOCKS 0 /* 0 == no debugging, 1 == maintain lock state, 2 == full debug */
@@ -25,13 +54,6 @@
#define spin_trylock(lock) (1)
#define spin_unlock_wait(lock) do { } while(0)
#define spin_unlock(lock) do { } while(0)
-#define spin_lock_irq(lock) cli()
-#define spin_unlock_irq(lock) sti()
-
-#define spin_lock_irqsave(lock, flags) \
- do { save_flags(flags); cli(); } while (0)
-#define spin_unlock_irqrestore(lock, flags) \
- restore_flags(flags)
#elif (DEBUG_SPINLOCKS < 2)
@@ -46,13 +68,6 @@ typedef struct {
#define spin_lock(x) do { (x)->lock = 1; } while (0)
#define spin_unlock_wait(x) do { } while (0)
#define spin_unlock(x) do { (x)->lock = 0; } while (0)
-#define spin_lock_irq(x) do { cli(); spin_lock(x); } while (0)
-#define spin_unlock_irq(x) do { spin_unlock(x); sti(); } while (0)
-
-#define spin_lock_irqsave(x, flags) \
- do { save_flags(flags); spin_lock_irq(x); } while (0)
-#define spin_unlock_irqrestore(x, flags) \
- do { spin_unlock(x); restore_flags(flags); } while (0)
#else /* (DEBUG_SPINLOCKS >= 2) */
@@ -71,11 +86,6 @@ typedef struct {
#define spin_lock(x) do {unsigned long __spinflags; save_flags(__spinflags); cli(); if ((x)->lock&&(x)->babble) {printk("%s:%d: spin_lock(%s:%p) already locked\n", __BASE_FILE__,__LINE__, (x)->module, (x));(x)->babble--;} (x)->lock = 1; restore_flags(__spinflags);} while (0)
#define spin_unlock_wait(x) do {unsigned long __spinflags; save_flags(__spinflags); cli(); if ((x)->lock&&(x)->babble) {printk("%s:%d: spin_unlock_wait(%s:%p) deadlock\n", __BASE_FILE__,__LINE__, (x)->module, (x));(x)->babble--;} restore_flags(__spinflags);} while (0)
#define spin_unlock(x) do {unsigned long __spinflags; save_flags(__spinflags); cli(); if (!(x)->lock&&(x)->babble) {printk("%s:%d: spin_unlock(%s:%p) not locked\n", __BASE_FILE__,__LINE__, (x)->module, (x));(x)->babble--;} (x)->lock = 0; restore_flags(__spinflags);} while (0)
-#define spin_lock_irq(x) do {cli(); if ((x)->lock&&(x)->babble) {printk("%s:%d: spin_lock_irq(%s:%p) already locked\n", __BASE_FILE__,__LINE__, (x)->module, (x));(x)->babble--;} (x)->lock = 1;} while (0)
-#define spin_unlock_irq(x) do {cli(); if (!(x)->lock&&(x)->babble) {printk("%s:%d: spin_lock(%s:%p) not locked\n", __BASE_FILE__,__LINE__, (x)->module, (x));(x)->babble--;} (x)->lock = 0; sti();} while (0)
-
-#define spin_lock_irqsave(x,flags) do {save_flags(flags); cli(); if ((x)->lock&&(x)->babble) {printk("%s:%d: spin_lock_irqsave(%s:%p) already locked\n", __BASE_FILE__,__LINE__, (x)->module, (x));(x)->babble--;} (x)->lock = 1;} while (0)
-#define spin_unlock_irqrestore(x,flags) do {cli(); if (!(x)->lock&&(x)->babble) {printk("%s:%d: spin_unlock_irqrestore(%s:%p) not locked\n", __BASE_FILE__,__LINE__, (x)->module, (x));(x)->babble--;} (x)->lock = 0; restore_flags(flags);} while (0)
#endif /* DEBUG_SPINLOCKS */
@@ -103,19 +113,6 @@ typedef struct {
#define read_unlock(lock) do { } while(0)
#define write_lock(lock) do { } while(0)
#define write_unlock(lock) do { } while(0)
-#define read_lock_irq(lock) cli()
-#define read_unlock_irq(lock) sti()
-#define write_lock_irq(lock) cli()
-#define write_unlock_irq(lock) sti()
-
-#define read_lock_irqsave(lock, flags) \
- do { save_flags(flags); cli(); } while (0)
-#define read_unlock_irqrestore(lock, flags) \
- restore_flags(flags)
-#define write_lock_irqsave(lock, flags) \
- do { save_flags(flags); cli(); } while (0)
-#define write_unlock_irqrestore(lock, flags) \
- restore_flags(flags)
#else /* __SMP__ */
@@ -168,18 +165,6 @@ __asm__ __volatile__( \
#define spin_trylock(lock) (!test_and_set_bit(0,(lock)))
-#define spin_lock_irq(lock) \
- do { __cli(); spin_lock(lock); } while (0)
-
-#define spin_unlock_irq(lock) \
- do { spin_unlock(lock); __sti(); } while (0)
-
-#define spin_lock_irqsave(lock, flags) \
- do { __save_flags(flags); __cli(); spin_lock(lock); } while (0)
-
-#define spin_unlock_irqrestore(lock, flags) \
- do { spin_unlock(lock); __restore_flags(flags); } while (0)
-
/*
* Read-write spinlocks, allowing multiple readers
* but only one writer.
@@ -236,19 +221,5 @@ typedef struct {
#define write_unlock(rw) \
asm volatile("lock ; btrl $31,%0":"=m" (__dummy_lock(&(rw)->lock)))
-#define read_lock_irq(lock) do { __cli(); read_lock(lock); } while (0)
-#define read_unlock_irq(lock) do { read_unlock(lock); __sti(); } while (0)
-#define write_lock_irq(lock) do { __cli(); write_lock(lock); } while (0)
-#define write_unlock_irq(lock) do { write_unlock(lock); __sti(); } while (0)
-
-#define read_lock_irqsave(lock, flags) \
- do { __save_flags(flags); __cli(); read_lock(lock); } while (0)
-#define read_unlock_irqrestore(lock, flags) \
- do { read_unlock(lock); __restore_flags(flags); } while (0)
-#define write_lock_irqsave(lock, flags) \
- do { __save_flags(flags); __cli(); write_lock(lock); } while (0)
-#define write_unlock_irqrestore(lock, flags) \
- do { write_unlock(lock); __restore_flags(flags); } while (0)
-
#endif /* __SMP__ */
#endif /* __ASM_SPINLOCK_H */
diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h
index ebdb8b790..147ad6da4 100644
--- a/include/asm-i386/system.h
+++ b/include/asm-i386/system.h
@@ -181,6 +181,11 @@ __asm__ __volatile__("pushfl ; popl %0":"=g" (x): /* no input */ :"memory")
#define __restore_flags(x) \
__asm__ __volatile__("pushl %0 ; popfl": /* no output */ :"g" (x):"memory")
+/* For spinlocks etc */
+#define local_irq_save(x) __asm__ __volatile__("pushfl ; popl %0 ; cli":"=g" (x): /* no input */ :"memory")
+#define local_irq_restore(x) __asm__ __volatile__("pushl %0 ; popfl": /* no output */ :"g" (x):"memory")
+#define local_irq_disable() __asm__ __volatile__("cli": : :"memory")
+#define local_irq_enable() __asm__ __volatile__("sti": : :"memory")
#ifdef __SMP__
diff --git a/include/asm-m68k/adb_mouse.h b/include/asm-m68k/adb_mouse.h
index 824113662..6918c8302 100644
--- a/include/asm-m68k/adb_mouse.h
+++ b/include/asm-m68k/adb_mouse.h
@@ -16,7 +16,7 @@ struct mouse_status {
short dy;
int ready;
int active;
- struct wait_queue *wait;
+ wait_queue_head_t wait;
struct fasync_struct *fasyncptr;
};
diff --git a/include/asm-m68k/atari_joystick.h b/include/asm-m68k/atari_joystick.h
index bdea2f486..93be7da9f 100644
--- a/include/asm-m68k/atari_joystick.h
+++ b/include/asm-m68k/atari_joystick.h
@@ -16,7 +16,7 @@ struct joystick_status {
char dir;
int ready;
int active;
- struct wait_queue *wait;
+ wait_queue_head_t wait;
};
#endif
diff --git a/include/asm-m68k/ide.h b/include/asm-m68k/ide.h
index da5753ee7..e4a83371d 100644
--- a/include/asm-m68k/ide.h
+++ b/include/asm-m68k/ide.h
@@ -45,13 +45,6 @@
#include <asm/macints.h>
#endif
-
-typedef unsigned int q40ide_ioreg_t;
-
-
-typedef unsigned char * ide_ioreg_t;
-
-
#ifndef MAX_HWIFS
#define MAX_HWIFS 4 /* same as the other archs */
#endif
@@ -65,19 +58,39 @@ static __inline__ int ide_default_irq(ide_ioreg_t base)
else return 0;
}
+int q40ide_default_io_base(int);
+
+static __inline__ ide_ioreg_t ide_default_io_base(int index)
+{
+ if (MACH_IS_Q40)
+ return q40ide_default_io_base(index);
+ else return 0;
+}
/*
* Can we do this in a generic manner??
*/
-void q40_ide_init_hwif_ports (q40ide_ioreg_t *p, q40ide_ioreg_t base, int *irq);
+void q40_ide_init_hwif_ports (hw_regs_t *hw, q40ide_ioreg_t data_port, q40ide_ioreg_t ctrl_port, int *irq);
-static __inline__ void ide_init_hwif_ports (ide_ioreg_t *p, ide_ioreg_t base, int *irq)
+/*
+ * Set up a hw structure for a specified data port, control port and IRQ.
+ * This should follow whatever the default interface uses.
+ */
+static __inline__ void ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port, ide_ioreg_t ctrl_port, int *irq)
{
#ifdef CONFIG_Q40
- if (MACH_IS_Q40)
- return q40_ide_init_hwif_ports((q40ide_ioreg_t *)p,(q40ide_ioreg_t)base,irq);
+ if (MACH_IS_Q40)
+ return q40_ide_init_hwif_ports(hw, (q40ide_ioreg_t) data_port, (q40ide_ioreg_t) ctrl_port, irq);
#endif
- printk("ide_init_hwif_ports: must not be called\n");
+ printk("ide_init_hwif_ports: must not be called\n");
+}
+
+/*
+ * This registers the standard ports for this architecture with the IDE
+ * driver.
+ */
+static __inline__ void ide_init_default_hwifs(void)
+{
}
typedef union {
@@ -487,7 +500,7 @@ static __inline__ void ide_get_lock (int *ide_lock, void (*handler)(int, void *,
#endif /* CONFIG_ATARI */
}
-#define ide_ack_intr(hwif) ((hwif)->ack_intr ? (hwif)->ack_intr(hwif) : 1)
+#define ide_ack_intr(hwif) ((hwif)->hw.ack_intr ? (hwif)->hw.ack_intr(hwif) : 1)
/*
* On the Atari, we sometimes can't enable interrupts:
diff --git a/include/asm-m68k/io.h b/include/asm-m68k/io.h
index 168077b26..7843b8f09 100644
--- a/include/asm-m68k/io.h
+++ b/include/asm-m68k/io.h
@@ -72,6 +72,12 @@ extern inline void *ioremap_fullcache(unsigned long physaddr, unsigned long size
extern void iounmap(void *addr);
+/* Nothing to do */
+
+#define dma_cache_inv(_start,_size) do { } while (0)
+#define dma_cache_wback(_start,_size) do { } while (0)
+#define dma_cache_wback_inv(_start,_size) do { } while (0)
+
#endif /* __KERNEL__ */
#endif /* _M68K_IO_H */
diff --git a/include/asm-m68k/mac_mouse.h b/include/asm-m68k/mac_mouse.h
index 228c14d0d..39a5c292e 100644
--- a/include/asm-m68k/mac_mouse.h
+++ b/include/asm-m68k/mac_mouse.h
@@ -16,7 +16,7 @@ struct mouse_status {
short dy;
int ready;
int active;
- struct wait_queue *wait;
+ wait_queue_head_t wait;
struct fasync_struct *fasyncptr;
};
diff --git a/include/asm-m68k/page.h b/include/asm-m68k/page.h
index 87384b8ae..8cc546aac 100644
--- a/include/asm-m68k/page.h
+++ b/include/asm-m68k/page.h
@@ -1,6 +1,8 @@
#ifndef _M68K_PAGE_H
#define _M68K_PAGE_H
+#include <linux/config.h>
+
/* PAGE_SHIFT determines the page size */
#define PAGE_SHIFT 12
#define PAGE_SIZE (1UL << PAGE_SHIFT)
diff --git a/include/asm-m68k/processor.h b/include/asm-m68k/processor.h
index 3fcf0670b..b399e9703 100644
--- a/include/asm-m68k/processor.h
+++ b/include/asm-m68k/processor.h
@@ -7,6 +7,12 @@
#ifndef __ASM_M68K_PROCESSOR_H
#define __ASM_M68K_PROCESSOR_H
+/*
+ * Default implementation of macro that returns current
+ * instruction pointer ("program counter").
+ */
+#define current_text_addr() ({ __label__ _l; _l: &&_l;})
+
#include <asm/segment.h>
#include <asm/fpu.h>
diff --git a/include/asm-m68k/q40_keyboard.h b/include/asm-m68k/q40_keyboard.h
index e3712d2e1..9083bc1ec 100644
--- a/include/asm-m68k/q40_keyboard.h
+++ b/include/asm-m68k/q40_keyboard.h
@@ -9,10 +9,6 @@
*/
-#include <linux/config.h> /* CONFIG_MAGIC_SYSRQ */
-
-
-
#ifdef __KERNEL__
diff --git a/include/asm-m68k/semaphore-helper.h b/include/asm-m68k/semaphore-helper.h
index 5e3abe0b5..0ae0b9705 100644
--- a/include/asm-m68k/semaphore-helper.h
+++ b/include/asm-m68k/semaphore-helper.h
@@ -9,6 +9,8 @@
* m68k version by Andreas Schwab
*/
+#include <linux/config.h>
+
/*
* These two _must_ execute atomically wrt each other.
*/
diff --git a/include/asm-m68k/semaphore.h b/include/asm-m68k/semaphore.h
index 271169bbc..e1bdb10f4 100644
--- a/include/asm-m68k/semaphore.h
+++ b/include/asm-m68k/semaphore.h
@@ -1,7 +1,6 @@
#ifndef _M68K_SEMAPHORE_H
#define _M68K_SEMAPHORE_H
-#include <linux/config.h>
#include <linux/linkage.h>
#include <asm/system.h>
@@ -19,7 +18,7 @@
struct semaphore {
atomic_t count;
atomic_t waking;
- struct wait_queue * wait;
+ wait_queue_head_t wait;
};
#define MUTEX ((struct semaphore) { ATOMIC_INIT(1), ATOMIC_INIT(0), NULL })
diff --git a/include/asm-mips/ide.h b/include/asm-mips/ide.h
index bc2732311..f81529537 100644
--- a/include/asm-mips/ide.h
+++ b/include/asm-mips/ide.h
@@ -1,4 +1,4 @@
-/* $Id: ide.h,v 1.3 1998/05/07 03:02:49 ralf Exp $
+/* $Id: ide.h,v 1.4 1998/06/30 00:23:09 ralf Exp $
*
* linux/include/asm-mips/ide.h
*
@@ -14,8 +14,6 @@
#ifdef __KERNEL__
-typedef unsigned short ide_ioreg_t;
-
#ifndef MAX_HWIFS
#define MAX_HWIFS 6
#endif
@@ -25,7 +23,8 @@ typedef unsigned short ide_ioreg_t;
struct ide_ops {
int (*ide_default_irq)(ide_ioreg_t base);
ide_ioreg_t (*ide_default_io_base)(int index);
- void (*ide_init_hwif_ports)(ide_ioreg_t *p, ide_ioreg_t base, int *irq);
+ void (*ide_init_hwif_ports)(hw_regs_t *hw, ide_ioreg_t data_port,
+ ide_ioreg_t ctrl_port, int *irq);
int (*ide_request_irq)(unsigned int irq, void (*handler)(int, void *,
struct pt_regs *), unsigned long flags,
const char *device, void *dev_id);
@@ -48,10 +47,31 @@ static __inline__ ide_ioreg_t ide_default_io_base(int index)
return ide_ops->ide_default_io_base(index);
}
-static __inline__ void ide_init_hwif_ports(ide_ioreg_t *p, ide_ioreg_t base,
- int *irq)
+static __inline__ void ide_init_hwif_ports(hw_regs_t *hw,
+ ide_ioreg_t data_port,
+ ide_ioreg_t ctrl_port, int *irq)
{
- ide_ops->ide_init_hwif_ports(p, base, irq);
+ ide_ops->ide_init_hwif_ports(hw, data_port, ctrl_port, &hw->irq);
+
+ hw->irq = ide_ops->ide_default_irq(data_port);
+}
+
+/*
+ * This registers the standard ports for this architecture with the IDE
+ * driver.
+ */
+static __inline__ void ide_init_default_hwifs(void)
+{
+#ifdef __DO_I_NEED_THIS
+ hw_regs_t hw;
+ int index;
+
+ for (index = 0; index < MAX_HWIFS; index++) {
+ ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, 0);
+ hw.irq = ide_default_irq(ide_default_io_base(index));
+ ide_register_hw(&hw, NULL);
+ }
+#endif /* __DO_I_NEED_THIS */
}
typedef union {
@@ -96,26 +116,10 @@ static __inline__ void ide_release_region(ide_ioreg_t from,
/*
* The following are not needed for the non-m68k ports
*/
-static __inline__ int ide_ack_intr (ide_ioreg_t status_port,
- ide_ioreg_t irq_port)
-{
- return 1;
-}
-
-static __inline__ void ide_fix_driveid(struct hd_driveid *id)
-{
-}
-
-static __inline__ void ide_release_lock (int *ide_lock)
-{
-}
-
-static __inline__ void ide_get_lock (int *ide_lock,
- void (*handler)(int, void *,
- struct pt_regs *),
- void *data)
-{
-}
+#define ide_ack_intr(hwif) (1)
+#define ide_fix_driveid(id) do {} while (0)
+#define ide_release_lock(lock) do {} while (0)
+#define ide_get_lock(lock, hdlr, data) do {} while (0)
#endif /* __KERNEL__ */
diff --git a/include/asm-mips/io.h b/include/asm-mips/io.h
index bc9390c2a..7d97af3f6 100644
--- a/include/asm-mips/io.h
+++ b/include/asm-mips/io.h
@@ -6,6 +6,8 @@
*/
#undef CONF_SLOWDOWN_IO
+#include <linux/config.h>
+
#include <asm/mipsconfig.h>
#include <asm/addrspace.h>
@@ -377,19 +379,24 @@ __OUTS(w,l,4)
/*
* The caches on some architectures aren't dma-coherent and have need to
- * handle this in software. There are two types of operations that
+ * handle this in software. There are three types of operations that
* can be applied to dma buffers.
*
* - dma_cache_wback_inv(start, size) makes caches and coherent by
* writing the content of the caches back to memory, if necessary.
* The function also invalidates the affected part of the caches as
* necessary before DMA transfers from outside to memory.
+ * - dma_cache_wback(start, size) makes caches and coherent by
+ * writing the content of the caches back to memory, if necessary.
+ * The function also invalidates the affected part of the caches as
+ * necessary before DMA transfers from outside to memory.
* - dma_cache_inv(start, size) invalidates the affected parts of the
* caches. Dirty lines of the caches may be written back or simply
* be discarded. This operation is necessary before dma operations
* to the memory.
*/
extern void (*dma_cache_wback_inv)(unsigned long start, unsigned long size);
+extern void (*dma_cache_wback)(unsigned long start, unsigned long size);
extern void (*dma_cache_inv)(unsigned long start, unsigned long size);
#endif /* __ASM_MIPS_IO_H */
diff --git a/include/asm-mips/namei.h b/include/asm-mips/namei.h
index d61b3cd82..64acd52ff 100644
--- a/include/asm-mips/namei.h
+++ b/include/asm-mips/namei.h
@@ -3,7 +3,7 @@
*
* Included from linux/fs/namei.c
*
- * $Id: namei.h,v 1.5 1997/12/01 18:00:40 ralf Exp $
+ * $Id: namei.h,v 1.6 1999/01/04 16:09:23 ralf Exp $
*/
#ifndef __ASM_MIPS_NAMEI_H
#define __ASM_MIPS_NAMEI_H
@@ -23,7 +23,7 @@ __mips_lookup_dentry(const char *name, int lookup_flags)
base = lookup_dentry (IRIX32_EMUL,
dget (current->fs->root),
- (LOOKUP_FOLLOW | LOOKUP_DIRECTORY | LOOKUP_SLASHOK));
+ (LOOKUP_FOLLOW | LOOKUP_DIRECTORY));
if (IS_ERR (base)) return base;
diff --git a/include/asm-mips/offset.h b/include/asm-mips/offset.h
index a6d698336..de9a40a2a 100644
--- a/include/asm-mips/offset.h
+++ b/include/asm-mips/offset.h
@@ -51,36 +51,36 @@
#define TASK_NEED_RESCHED 20
#define TASK_COUNTER 24
#define TASK_PRIORITY 28
-#define TASK_MM 920
+#define TASK_MM 928
/* MIPS specific thread_struct offsets. */
-#define THREAD_REG16 560
-#define THREAD_REG17 564
-#define THREAD_REG18 568
-#define THREAD_REG19 572
-#define THREAD_REG20 576
-#define THREAD_REG21 580
-#define THREAD_REG22 584
-#define THREAD_REG23 588
-#define THREAD_REG29 592
-#define THREAD_REG30 596
-#define THREAD_REG31 600
-#define THREAD_STATUS 604
-#define THREAD_FPU 608
-#define THREAD_BVADDR 872
-#define THREAD_BUADDR 876
-#define THREAD_ECODE 880
-#define THREAD_TRAPNO 884
-#define THREAD_PGDIR 888
-#define THREAD_MFLAGS 892
-#define THREAD_CURDS 896
-#define THREAD_TRAMP 900
-#define THREAD_OLDCTX 904
+#define THREAD_REG16 568
+#define THREAD_REG17 572
+#define THREAD_REG18 576
+#define THREAD_REG19 580
+#define THREAD_REG20 584
+#define THREAD_REG21 588
+#define THREAD_REG22 592
+#define THREAD_REG23 596
+#define THREAD_REG29 600
+#define THREAD_REG30 604
+#define THREAD_REG31 608
+#define THREAD_STATUS 612
+#define THREAD_FPU 616
+#define THREAD_BVADDR 880
+#define THREAD_BUADDR 884
+#define THREAD_ECODE 888
+#define THREAD_TRAPNO 892
+#define THREAD_PGDIR 896
+#define THREAD_MFLAGS 900
+#define THREAD_CURDS 904
+#define THREAD_TRAMP 908
+#define THREAD_OLDCTX 912
/* Linux mm_struct offsets. */
#define MM_COUNT 16
#define MM_PGD 12
-#define MM_CONTEXT 36
+#define MM_CONTEXT 52
/* Linux sigcontext offsets. */
#define SC_REGMASK 0
diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h
index 96dd34c91..8c587afa5 100644
--- a/include/asm-mips/processor.h
+++ b/include/asm-mips/processor.h
@@ -1,4 +1,4 @@
-/* $Id: processor.h,v 1.14 1999/01/04 16:09:25 ralf Exp $
+/* $Id: processor.h,v 1.15 1999/02/15 02:22:12 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
@@ -11,6 +11,12 @@
#ifndef __ASM_MIPS_PROCESSOR_H
#define __ASM_MIPS_PROCESSOR_H
+/*
+ * Default implementation of macro that returns current
+ * instruction pointer ("program counter").
+ */
+#define current_text_addr() ({ __label__ _l; _l: &&_l;})
+
#if !defined (_LANGUAGE_ASSEMBLY)
#include <asm/cachectl.h>
#include <asm/mipsregs.h>
@@ -174,7 +180,7 @@ struct thread_struct {
/* Free all resources held by a thread. */
extern void release_thread(struct task_struct *);
-extern pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
+extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
/* Copy and release all segment info associated with a VM */
#define copy_segments(nr, p, mm) do { } while(0)
@@ -195,6 +201,7 @@ extern inline unsigned long thread_saved_pc(struct thread_struct *t)
return ((unsigned long*)t->reg29)[17];
}
+struct pt_regs;
extern int (*user_mode)(struct pt_regs *);
/*
diff --git a/include/asm-mips/semaphore-helper.h b/include/asm-mips/semaphore-helper.h
index 63103c514..59337b898 100644
--- a/include/asm-mips/semaphore-helper.h
+++ b/include/asm-mips/semaphore-helper.h
@@ -1,4 +1,4 @@
-/* $Id: semaphore-helper.h,v 1.2 1999/06/10 08:02:41 ralf Exp $
+/* $Id: semaphore-helper.h,v 1.3 1999/06/11 14:30:15 ralf Exp $
*
* SMP- and interrupt-safe semaphores helper functions.
*
@@ -57,7 +57,7 @@ waking_non_zero_interruptible(struct semaphore *sem, struct task_struct *tsk)
{
long ret, tmp;
-#ifdef __MIPSEL__
+#ifdef __MIPSEB__
__asm__ __volatile__("
.set mips3
.set push
diff --git a/include/asm-mips/semaphore.h b/include/asm-mips/semaphore.h
index 88c726546..302f4ff7d 100644
--- a/include/asm-mips/semaphore.h
+++ b/include/asm-mips/semaphore.h
@@ -1,11 +1,13 @@
-/*
+/* $Id: semaphore.h,v 1.7 1999/06/11 14:30:15 ralf Exp $
+ *
* SMP- and interrupt-safe semaphores..
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
- * (C) Copyright 1996 Linus Torvalds, Ralf Baechle
+ * (C) Copyright 1996 Linus Torvalds
+ * (C) Copyright 1998, 1999 Ralf Baechle
*/
#ifndef __ASM_MIPS_SEMAPHORE_H
#define __ASM_MIPS_SEMAPHORE_H
@@ -13,27 +15,67 @@
#include <asm/system.h>
#include <asm/atomic.h>
#include <asm/spinlock.h>
+#include <linux/wait.h>
struct semaphore {
atomic_t count;
atomic_t waking;
- struct wait_queue * wait;
+ wait_queue_head_t wait;
+#if WAITQUEUE_DEBUG
+ long __magic;
+#endif
};
-#define MUTEX ((struct semaphore) { ATOMIC_INIT(1), ATOMIC_INIT(0), NULL })
-#define MUTEX_LOCKED ((struct semaphore) { ATOMIC_INIT(0), ATOMIC_INIT(0), NULL })
+#if WAITQUEUE_DEBUG
+# define __SEM_DEBUG_INIT(name) \
+ , (long)&(name).__magic
+#else
+# define __SEM_DEBUG_INIT(name)
+#endif
+
+#define __SEMAPHORE_INITIALIZER(name,count) \
+{ ATOMIC_INIT(count), ATOMIC_INIT(0), __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \
+ __SEM_DEBUG_INIT(name) }
+
+#define __MUTEX_INITIALIZER(name) \
+ __SEMAPHORE_INITIALIZER(name,1)
+
+#define __DECLARE_SEMAPHORE_GENERIC(name,count) \
+ struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
+
+#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
+#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
+
+extern inline void sema_init (struct semaphore *sem, int val)
+{
+ atomic_set(&sem->count, val);
+ atomic_set(&sem->waking, 0);
+ init_waitqueue_head(&sem->wait);
+#if WAITQUEUE_DEBUG
+ sem->__magic = (long)&sem->__magic;
+#endif
+}
+
+static inline void init_MUTEX (struct semaphore *sem)
+{
+ sema_init(sem, 1);
+}
+
+static inline void init_MUTEX_LOCKED (struct semaphore *sem)
+{
+ sema_init(sem, 0);
+}
asmlinkage void __down(struct semaphore * sem);
asmlinkage int __down_interruptible(struct semaphore * sem);
asmlinkage int __down_trylock(struct semaphore * sem);
asmlinkage void __up(struct semaphore * sem);
-extern spinlock_t semaphore_wake_lock;
-
-#define sema_init(sem, val) atomic_set(&((sem)->count), val)
-
extern inline void down(struct semaphore * sem)
{
+#if WAITQUEUE_DEBUG
+ CHECK_MAGIC(sem->__magic);
+#endif
if (atomic_dec_return(&sem->count) < 0)
__down(sem);
}
@@ -41,6 +83,10 @@ extern inline void down(struct semaphore * sem)
extern inline int down_interruptible(struct semaphore * sem)
{
int ret = 0;
+
+#if WAITQUEUE_DEBUG
+ CHECK_MAGIC(sem->__magic);
+#endif
if (atomic_dec_return(&sem->count) < 0)
ret = __down_interruptible(sem);
return ret;
@@ -56,6 +102,9 @@ extern inline int down_trylock(struct semaphore * sem)
{
long ret, tmp, tmp2, sub;
+#if WAITQUEUE_DEBUG
+ CHECK_MAGIC(sem->__magic);
+#endif
#ifdef __MIPSEB__
__asm__ __volatile__("
.set mips3
@@ -96,6 +145,9 @@ extern inline int down_trylock(struct semaphore * sem)
*/
extern inline void up(struct semaphore * sem)
{
+#if WAITQUEUE_DEBUG
+ CHECK_MAGIC(sem->__magic);
+#endif
if (atomic_inc_return(&sem->count) <= 0)
__up(sem);
}
diff --git a/include/asm-mips/softirq.h b/include/asm-mips/softirq.h
index 3c38ecf7b..7a6e4ff5c 100644
--- a/include/asm-mips/softirq.h
+++ b/include/asm-mips/softirq.h
@@ -1,4 +1,4 @@
-/* $Id: softirq.h,v 1.4 1998/09/19 19:19:39 ralf Exp $
+/* $Id: softirq.h,v 1.5 1999/02/15 02:22:12 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
@@ -17,6 +17,15 @@ extern atomic_t __mips_bh_counter;
extern unsigned int local_bh_count[NR_CPUS];
+#define cpu_bh_disable(cpu) do { local_bh_count[(cpu)]++; barrier(); } while (0)
+#define cpu_bh_enable(cpu) do { barrier(); local_bh_count[(cpu)]--; } while (0)
+
+#define cpu_bh_trylock(cpu) (local_bh_count[(cpu)] ? 0 : (local_bh_count[(cpu)] = 1))
+#define cpu_bh_endlock(cpu) (local_bh_count[(cpu)] = 0)
+
+#define local_bh_disable() cpu_bh_disable(smp_processor_id())
+#define local_bh_enable() cpu_bh_enable(smp_processor_id())
+
#define get_active_bhs() (bh_mask & bh_active)
static inline void clear_active_bhs(unsigned long x)
@@ -71,19 +80,19 @@ extern inline void enable_bh(int nr)
extern inline void start_bh_atomic(void)
{
- local_bh_count[smp_processor_id()]++;
+ local_bh_disable();
barrier();
}
extern inline void end_bh_atomic(void)
{
barrier();
- local_bh_count[smp_processor_id()]--;
+ local_bh_enable();
}
/* These are for the irq's testing the lock */
-#define softirq_trylock(cpu) (local_bh_count[cpu] ? 0 : (local_bh_count[cpu] = 1))
-#define softirq_endlock(cpu) (local_bh_count[cpu] = 0)
+#define softirq_trylock(cpu) (cpu_bh_trylock(cpu))
+#define softirq_endlock(cpu) (cpu_bh_endlock(cpu))
#define synchronize_bh() barrier()
#endif /* __ASM_MIPS_SOFTIRQ_H */
diff --git a/include/asm-mips/spinlock.h b/include/asm-mips/spinlock.h
index 581641827..6a7b067b2 100644
--- a/include/asm-mips/spinlock.h
+++ b/include/asm-mips/spinlock.h
@@ -1,8 +1,37 @@
-/* $Id: spinlock.h,v 1.3 1998/08/25 16:20:59 tsbogend Exp $
+/* $Id: spinlock.h,v 1.4 1998/08/25 16:45:46 tsbogend Exp $
*/
#ifndef __ASM_MIPS_SPINLOCK_H
#define __ASM_MIPS_SPINLOCK_H
+/*
+ * These are the generic versions of the spinlocks
+ * and read-write locks.. We should actually do a
+ * <linux/spinlock.h> with all of this. Oh, well.
+ */
+#define spin_lock_irqsave(lock, flags) do { local_irq_save(flags); spin_lock(lock); } while (0)
+#define spin_lock_irq(lock) do { local_irq_disable(); spin_lock(lock); } while (0)
+#define spin_lock_bh(lock) do { local_bh_disable(); spin_lock(lock); } while (0)
+
+#define read_lock_irqsave(lock, flags) do { local_irq_save(flags); read_lock(lock); } while (0)
+#define read_lock_irq(lock) do { local_irq_disable(); read_lock(lock); } while (0)
+#define read_lock_bh(lock) do { local_bh_disable(); read_lock(lock); } while (0)
+
+#define write_lock_irqsave(lock, flags) do { local_irq_save(flags); write_lock(lock); } while (0)
+#define write_lock_irq(lock) do { local_irq_disable(); write_lock(lock); } while (0)
+#define write_lock_bh(lock) do { local_bh_disable(); write_lock(lock); } while (0)
+
+#define spin_unlock_irqrestore(lock, flags) do { spin_unlock(lock); local_irq_restore(flags); } while (0)
+#define spin_unlock_irq(lock) do { spin_unlock(lock); local_irq_enable(); } while (0)
+#define spin_unlock_bh(lock) do { spin_unlock(lock); local_bh_enable(); } while (0)
+
+#define read_unlock_irqrestore(lock, flags) do { read_unlock(lock); local_irq_restore(flags); } while (0)
+#define read_unlock_irq(lock) do { read_unlock(lock); local_irq_enable(); } while (0)
+#define read_unlock_bh(lock) do { read_unlock(lock); local_bh_enable(); } while (0)
+
+#define write_unlock_irqrestore(lock, flags) do { write_unlock(lock); local_irq_restore(flags); } while (0)
+#define write_unlock_irq(lock) do { write_unlock(lock); local_irq_enable(); } while (0)
+#define write_unlock_bh(lock) do { write_unlock(lock); local_bh_enable(); } while (0)
+
#ifndef __SMP__
/*
@@ -10,10 +39,10 @@
*/
#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)
typedef struct { } spinlock_t;
- #define SPIN_LOCK_UNLOCKED { }
+ #define SPIN_LOCK_UNLOCKED (spinlock_t) { }
#else
typedef struct { int gcc_is_buggy; } spinlock_t;
- #define SPIN_LOCK_UNLOCKED { 0 }
+ #define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 }
#endif
#define spin_lock_init(lock) do { } while(0)
@@ -21,11 +50,6 @@
#define spin_trylock(lock) (1)
#define spin_unlock_wait(lock) do { } while(0)
#define spin_unlock(lock) do { } while(0)
-#define spin_lock_irq(lock) cli()
-#define spin_unlock_irq(lock) sti()
-
-#define spin_lock_irqsave(lock, flags) save_and_cli(flags)
-#define spin_unlock_irqrestore(lock, flags) restore_flags(flags)
/*
* Read-write spinlocks, allowing multiple readers
@@ -38,21 +62,12 @@
* read-locks.
*/
typedef struct { } rwlock_t;
-#define RW_LOCK_UNLOCKED { }
+#define RW_LOCK_UNLOCKED (rwlock_t) { }
#define read_lock(lock) do { } while(0)
#define read_unlock(lock) do { } while(0)
#define write_lock(lock) do { } while(0)
#define write_unlock(lock) do { } while(0)
-#define read_lock_irq(lock) cli()
-#define read_unlock_irq(lock) sti()
-#define write_lock_irq(lock) cli()
-#define write_unlock_irq(lock) sti()
-
-#define read_lock_irqsave(lock, flags) save_and_cli(flags)
-#define read_unlock_irqrestore(lock, flags) restore_flags(flags)
-#define write_lock_irqsave(lock, flags) save_and_cli(flags)
-#define write_unlock_irqrestore(lock, flags) restore_flags(flags)
#else
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h
index d47580a11..852254828 100644
--- a/include/asm-mips/system.h
+++ b/include/asm-mips/system.h
@@ -1,4 +1,4 @@
-/* $Id: system.h,v 1.9 1999/05/01 10:08:19 harald Exp $
+/* $Id: system.h,v 1.10 1999/06/13 16:35:55 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
@@ -113,6 +113,12 @@ __restore_flags(int flags)
#define save_and_cli(x) __save_and_cli(x)
#define restore_flags(x) __restore_flags(x)
+/* For spinlocks etc */
+#define local_irq_save(x) __save_flags(x);
+#define local_irq_restore(x) __restore_flags(x);
+#define local_irq_disable() __cli();
+#define local_irq_enable() __sti();
+
/*
* These are probably defined overly paranoid ...
*/
diff --git a/include/asm-ppc/adb_mouse.h b/include/asm-ppc/adb_mouse.h
index 879178043..3da07c813 100644
--- a/include/asm-ppc/adb_mouse.h
+++ b/include/asm-ppc/adb_mouse.h
@@ -16,7 +16,7 @@ struct mouse_status {
short dy;
int ready;
int active;
- struct wait_queue *wait;
+ wait_queue_head_t wait;
struct fasync_struct *fasyncptr;
};
diff --git a/include/asm-ppc/ide.h b/include/asm-ppc/ide.h
index c53267b77..39d48b6d1 100644
--- a/include/asm-ppc/ide.h
+++ b/include/asm-ppc/ide.h
@@ -18,7 +18,7 @@
#define MAX_HWIFS 4
#endif
-typedef unsigned int ide_ioreg_t;
+#include <asm/hdreg.h>
#ifdef __KERNEL__
@@ -49,16 +49,17 @@ struct ide_machdep_calls {
void (*release_region)(ide_ioreg_t from,
unsigned int extent);
void (*fix_driveid)(struct hd_driveid *id);
- void (*ide_init_hwif)(ide_ioreg_t *p,
- ide_ioreg_t base,
- int *irq);
+ void (*ide_init_hwif)(hw_regs_t *hw,
+ ide_ioreg_t data_port,
+ ide_ioreg_t ctrl_port,
+ int *irq);
int io_base;
};
extern struct ide_machdep_calls ppc_ide_md;
-void ide_init_hwif_ports(ide_ioreg_t *p, ide_ioreg_t base, int *irq);
+void ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port, ide_ioreg_t ctrl_port, int *irq);
void ide_insw(ide_ioreg_t port, void *buf, int ns);
void ide_outsw(ide_ioreg_t port, void *buf, int ns);
void ppc_generic_ide_fix_driveid(struct hd_driveid *id);
@@ -82,31 +83,58 @@ void ppc_generic_ide_fix_driveid(struct hd_driveid *id);
static __inline__ int ide_default_irq(ide_ioreg_t base)
{
- return ppc_ide_md.default_irq(base);
+ if ( ppc_ide_md.default_irq )
+ return ppc_ide_md.default_irq(base);
+ else
+ return -1;
}
static __inline__ ide_ioreg_t ide_default_io_base(int index)
{
- return ppc_ide_md.default_io_base(index);
+ if ( ppc_ide_md.default_io_base )
+ return ppc_ide_md.default_io_base(index);
+ else
+ return -1;
+}
+
+static __inline__ void ide_init_default_hwifs(void)
+{
+#ifdef __DO_I_NEED_THIS
+ hw_regs_t hw;
+ int index;
+
+ for(index = 0; index < MAX_HWIFS; index++) {
+ ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, NULL);
+ hw.irq = ide_default_irq(ide_default_io_base(index));
+ ide_register_hw(&hw, NULL);
+ }
+#endif /* __DO_I_NEED_THIS */
}
static __inline__ int ide_check_region (ide_ioreg_t from, unsigned int extent)
{
- return ppc_ide_md.check_region(from, extent);
+ if ( ppc_ide_md.check_region )
+ return ppc_ide_md.check_region(from, extent);
+ else
+ return -1;
}
static __inline__ void ide_request_region (ide_ioreg_t from, unsigned int extent, const char *name)
{
- ppc_ide_md.request_region(from, extent, name);
+ if ( ppc_ide_md.request_region )
+ ppc_ide_md.request_region(from, extent, name);
}
static __inline__ void ide_release_region (ide_ioreg_t from, unsigned int extent)
{
- ppc_ide_md.release_region(from, extent);
+ if ( ppc_ide_md.release_region )
+ ppc_ide_md.release_region(from, extent);
}
-static __inline__ void ide_fix_driveid (struct hd_driveid *id) {
- ppc_ide_md.fix_driveid(id);
+static __inline__ void ide_fix_driveid (struct hd_driveid *id)
+{
+ if ( ppc_ide_md.fix_driveid )
+ ppc_ide_md.fix_driveid(id);
}
#undef inb
@@ -131,21 +159,13 @@ typedef union {
} b;
} select_t;
-static __inline__ int ide_request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
- unsigned long flags, const char *device, void *dev_id)
-{
- return request_irq(irq, handler, flags, device, dev_id);
-}
-
-static __inline__ void ide_free_irq(unsigned int irq, void *dev_id)
-{
- free_irq(irq, dev_id);
-}
+#define ide_request_irq(irq,hand,flg,dev,id) request_irq((irq),(hand),(flg),(dev),(id))
+#define ide_free_irq(irq,dev_id) free_irq((irq), (dev_id))
/*
* The following are not needed for the non-m68k ports
*/
-#define ide_ack_intr(base, irq) (1)
+#define ide_ack_intr(hwif) (1)
#define ide_release_lock(lock) do {} while (0)
#define ide_get_lock(lock, hdlr, data) do {} while (0)
diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h
index 92ac97729..bd8a7d16c 100644
--- a/include/asm-ppc/io.h
+++ b/include/asm-ppc/io.h
@@ -277,6 +277,13 @@ static inline int check_signature(unsigned long io_addr,
out:
return retval;
}
+
+/* Nothing to do */
+
+#define dma_cache_inv(_start,_size) do { } while (0)
+#define dma_cache_wback(_start,_size) do { } while (0)
+#define dma_cache_wback_inv(_start,_size) do { } while (0)
+
#endif /* __KERNEL__ */
#endif
diff --git a/include/asm-ppc/mmu.h b/include/asm-ppc/mmu.h
index f77ef3df4..81dadd22a 100644
--- a/include/asm-ppc/mmu.h
+++ b/include/asm-ppc/mmu.h
@@ -5,14 +5,25 @@
#ifndef _PPC_MMU_H_
#define _PPC_MMU_H_
+#include <linux/config.h>
+
#ifndef __ASSEMBLY__
/* Hardware Page Table Entry */
typedef struct _PTE {
+#ifdef CONFIG_PPC64
+ unsigned long long vsid:52;
+ unsigned long api:5;
+ unsigned long :5;
+ unsigned long h:1;
+ unsigned long v:1;
+ unsigned long long rpn:52;
+#else /* CONFIG_PPC64 */
unsigned long v:1; /* Entry is valid */
unsigned long vsid:24; /* Virtual segment identifier */
unsigned long h:1; /* Hash algorithm indicator */
unsigned long api:6; /* Abbreviated page index */
unsigned long rpn:20; /* Real (physical) page number */
+#endif /* CONFIG_PPC64 */
unsigned long :3; /* Unused */
unsigned long r:1; /* Referenced */
unsigned long c:1; /* Changed */
@@ -53,7 +64,11 @@ typedef struct _P601_BATU { /* Upper part of BAT for 601 processor */
} P601_BATU;
typedef struct _BATU { /* Upper part of BAT (all except 601) */
+#ifdef CONFIG_PPC64
+ unsigned long long bepi:47;
+#else /* CONFIG_PPC64 */
unsigned long bepi:15; /* Effective page index (virtual address) */
+#endif /* CONFIG_PPC64 */
unsigned long :4; /* Unused */
unsigned long bl:11; /* Block size mask */
unsigned long vs:1; /* Supervisor valid */
@@ -68,7 +83,11 @@ typedef struct _P601_BATL { /* Lower part of BAT for 601 processor */
} P601_BATL;
typedef struct _BATL { /* Lower part of BAT (all except 601) */
+#ifdef CONFIG_PPC64
+ unsigned long long brpn:47;
+#else /* CONFIG_PPC64 */
unsigned long brpn:15; /* Real page index (physical address) */
+#endif /* CONFIG_PPC64 */
unsigned long :10; /* Unused */
unsigned long w:1; /* Write-thru cache */
unsigned long i:1; /* Cache inhibit */
diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h
index 2c481490e..10f1f0efc 100644
--- a/include/asm-ppc/pgtable.h
+++ b/include/asm-ppc/pgtable.h
@@ -20,6 +20,11 @@ extern void local_flush_tlb_range(struct mm_struct *mm, unsigned long start,
#define flush_tlb_page local_flush_tlb_page
#define flush_tlb_range local_flush_tlb_range
+extern __inline__ void flush_tlb_pgtables(struct mm_struct *mm, unsigned long start, unsigned long end)
+{
+ /* PPC has hw page tables. */
+}
+
/*
* No cache flushing is required when address mappings are
* changed, because the caches on PowerPCs are physically
diff --git a/include/asm-ppc/processor.h b/include/asm-ppc/processor.h
index d3cca8a28..d46d46c3f 100644
--- a/include/asm-ppc/processor.h
+++ b/include/asm-ppc/processor.h
@@ -1,12 +1,22 @@
#ifndef __ASM_PPC_PROCESSOR_H
#define __ASM_PPC_PROCESSOR_H
+/*
+ * Default implementation of macro that returns current
+ * instruction pointer ("program counter").
+ */
+#define current_text_addr() ({ __label__ _l; _l: &&_l;})
+
#include <linux/config.h>
#include <asm/ptrace.h>
#include <asm/residual.h>
/* Bit encodings for Machine State Register (MSR) */
+#ifdef CONFIG_PPC64
+#define MSR_SF (1<<63)
+#define MSR_ISF (1<<61)
+#endif /* CONFIG_PPC64 */
#define MSR_POW (1<<18) /* Enable Power Management */
#define MSR_TGPR (1<<17) /* TLB Update registers in use */
#define MSR_ILE (1<<16) /* Interrupt Little-Endian enable */
diff --git a/include/asm-ppc/ptrace.h b/include/asm-ppc/ptrace.h
index 6909d7c3a..7ec33806a 100644
--- a/include/asm-ppc/ptrace.h
+++ b/include/asm-ppc/ptrace.h
@@ -17,22 +17,29 @@
* the PT_* values below. This simplifies arch/ppc/kernel/ptrace.c.
*/
+#include <linux/config.h>
+
#ifndef __ASSEMBLY__
+#ifdef CONFIG_PPC64
+#define REG unsigned long /*long*/
+#else
+#define REG unsigned long
+#endif
struct pt_regs {
- unsigned long gpr[32];
- unsigned long nip;
- unsigned long msr;
- unsigned long orig_gpr3; /* Used for restarting system calls */
- unsigned long ctr;
- unsigned long link;
- unsigned long xer;
- unsigned long ccr;
- unsigned long mq; /* 601 only (not used at present) */
- /* Used on APUS to hold IPL value. */
- unsigned long trap; /* Reason for being here */
- unsigned long dar; /* Fault registers */
- unsigned long dsisr;
- unsigned long result; /* Result of a system call */
+ REG gpr[32];
+ REG nip;
+ REG msr;
+ REG orig_gpr3; /* Used for restarting system calls */
+ REG ctr;
+ REG link;
+ REG xer;
+ REG ccr;
+ REG mq; /* 601 only (not used at present) */
+ /* Used on APUS to hold IPL value. */
+ REG trap; /* Reason for being here */
+ REG dar; /* Fault registers */
+ REG dsisr;
+ REG result; /* Result of a system call */
};
#endif
diff --git a/include/asm-ppc/semaphore.h b/include/asm-ppc/semaphore.h
index ab21c33a6..f7b87ff0d 100644
--- a/include/asm-ppc/semaphore.h
+++ b/include/asm-ppc/semaphore.h
@@ -1,27 +1,64 @@
-#ifndef _PPC_SEMAPHORE_H
-#define _PPC_SEMAPHORE_H
+#ifndef _SPARC_SEMAPHORE_H
+#define _SPARC_SEMAPHORE_H
/*
- * SMP- and interrupt-safe semaphores..
- *
- * (C) Copyright 1996 Linus Torvalds
- * Adapted for PowerPC by Gary Thomas and Paul Mackerras
+ * Swiped from asm-sparc/semaphore.h and modified
+ * -- Cort (cort@cs.nmt.edu)
*/
+#ifdef __KERNEL__
+
#include <asm/atomic.h>
+#include <linux/wait.h>
struct semaphore {
atomic_t count;
atomic_t waking;
- struct wait_queue *wait;
+ wait_queue_head_t wait;
+#if WAITQUEUE_DEBUG
+ long __magic;
+#endif
};
-#define sema_init(sem, val) atomic_set(&((sem)->count), (val))
+#if WAITQUEUE_DEBUG
+# define __SEM_DEBUG_INIT(name) \
+ , (long)&(name).__magic
+#else
+# define __SEM_DEBUG_INIT(name)
+#endif
+
+#define __SEMAPHORE_INITIALIZER(name,count) \
+{ ATOMIC_INIT(count), ATOMIC_INIT(0), __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \
+ __SEM_DEBUG_INIT(name) }
+
+#define __MUTEX_INITIALIZER(name) \
+ __SEMAPHORE_INITIALIZER(name,1)
+
+#define __DECLARE_SEMAPHORE_GENERIC(name,count) \
+ struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
+
+#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
+#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
+
+extern inline void sema_init (struct semaphore *sem, int val)
+{
+ atomic_set(&sem->count, val);
+ atomic_set(&sem->waking, 0);
+ init_waitqueue_head(&sem->wait);
+#if WAITQUEUE_DEBUG
+ sem->__magic = (long)&sem->__magic;
+#endif
+}
+
+static inline void init_MUTEX (struct semaphore *sem)
+{
+ sema_init(sem, 1);
+}
-#define MUTEX ((struct semaphore) \
- { ATOMIC_INIT(1), ATOMIC_INIT(0), NULL })
-#define MUTEX_LOCKED ((struct semaphore) \
- { ATOMIC_INIT(0), ATOMIC_INIT(0), NULL })
+static inline void init_MUTEX_LOCKED (struct semaphore *sem)
+{
+ sema_init(sem, 0);
+}
extern void __down(struct semaphore * sem);
extern int __down_interruptible(struct semaphore * sem);
@@ -65,4 +102,6 @@ extern inline void up(struct semaphore * sem)
__up(sem);
}
-#endif /* !(_PPC_SEMAPHORE_H) */
+#endif /* __KERNEL__ */
+
+#endif /* !(_SPARC_SEMAPHORE_H) */
diff --git a/include/asm-ppc/system.h b/include/asm-ppc/system.h
index 427bb5ddd..09790d0cd 100644
--- a/include/asm-ppc/system.h
+++ b/include/asm-ppc/system.h
@@ -58,7 +58,6 @@ extern void __cli(void);
extern int _disable_interrupts(void);
extern void _enable_interrupts(int);
-extern void instruction_dump(unsigned long *);
extern void print_backtrace(unsigned long *);
extern void show_regs(struct pt_regs * regs);
extern void flush_instruction_cache(void);
@@ -75,6 +74,9 @@ extern void giveup_fpu(struct task_struct *);
extern void enable_kernel_fp(void);
extern void cvt_fd(float *from, double *to, unsigned long *fpscr);
extern void cvt_df(double *from, float *to, unsigned long *fpscr);
+extern int call_rtas(const char *, int, int, unsigned long *, ...);
+extern void chrp_progress(char *);
+void chrp_event_scan(void);
struct device_node;
extern void note_scsi_host(struct device_node *, void *);
@@ -89,6 +91,8 @@ extern struct task_struct *_switch(struct thread_struct *prev,
struct thread_struct *next,
unsigned long context);
+extern unsigned int rtas_data;
+
struct pt_regs;
extern void dump_regs(struct pt_regs *);
diff --git a/include/asm-sparc/asm_offsets.h b/include/asm-sparc/asm_offsets.h
index c45a7b4a7..f8ffd64a2 100644
--- a/include/asm-sparc/asm_offsets.h
+++ b/include/asm-sparc/asm_offsets.h
@@ -77,110 +77,110 @@
#define AOFF_task_tarray_ptr 0x0000008c
#define ASIZ_task_tarray_ptr 0x00000004
#define AOFF_task_wait_chldexit 0x00000090
-#define ASIZ_task_wait_chldexit 0x00000004
-#define AOFF_task_vfork_sem 0x00000094
+#define ASIZ_task_wait_chldexit 0x00000014
+#define AOFF_task_vfork_sem 0x000000a4
#define ASIZ_task_vfork_sem 0x00000004
-#define AOFF_task_policy 0x00000098
+#define AOFF_task_policy 0x000000a8
#define ASIZ_task_policy 0x00000004
-#define AOFF_task_rt_priority 0x0000009c
+#define AOFF_task_rt_priority 0x000000ac
#define ASIZ_task_rt_priority 0x00000004
-#define AOFF_task_it_real_value 0x000000a0
+#define AOFF_task_it_real_value 0x000000b0
#define ASIZ_task_it_real_value 0x00000004
-#define AOFF_task_it_prof_value 0x000000a4
+#define AOFF_task_it_prof_value 0x000000b4
#define ASIZ_task_it_prof_value 0x00000004
-#define AOFF_task_it_virt_value 0x000000a8
+#define AOFF_task_it_virt_value 0x000000b8
#define ASIZ_task_it_virt_value 0x00000004
-#define AOFF_task_it_real_incr 0x000000ac
+#define AOFF_task_it_real_incr 0x000000bc
#define ASIZ_task_it_real_incr 0x00000004
-#define AOFF_task_it_prof_incr 0x000000b0
+#define AOFF_task_it_prof_incr 0x000000c0
#define ASIZ_task_it_prof_incr 0x00000004
-#define AOFF_task_it_virt_incr 0x000000b4
+#define AOFF_task_it_virt_incr 0x000000c4
#define ASIZ_task_it_virt_incr 0x00000004
-#define AOFF_task_real_timer 0x000000b8
+#define AOFF_task_real_timer 0x000000c8
#define ASIZ_task_real_timer 0x00000014
-#define AOFF_task_times 0x000000cc
+#define AOFF_task_times 0x000000dc
#define ASIZ_task_times 0x00000010
-#define AOFF_task_start_time 0x000000dc
+#define AOFF_task_start_time 0x000000ec
#define ASIZ_task_start_time 0x00000004
-#define AOFF_task_per_cpu_utime 0x000000e0
+#define AOFF_task_per_cpu_utime 0x000000f0
#define ASIZ_task_per_cpu_utime 0x00000004
-#define AOFF_task_min_flt 0x000000e8
+#define AOFF_task_min_flt 0x000000f8
#define ASIZ_task_min_flt 0x00000004
-#define AOFF_task_maj_flt 0x000000ec
+#define AOFF_task_maj_flt 0x000000fc
#define ASIZ_task_maj_flt 0x00000004
-#define AOFF_task_nswap 0x000000f0
+#define AOFF_task_nswap 0x00000100
#define ASIZ_task_nswap 0x00000004
-#define AOFF_task_cmin_flt 0x000000f4
+#define AOFF_task_cmin_flt 0x00000104
#define ASIZ_task_cmin_flt 0x00000004
-#define AOFF_task_cmaj_flt 0x000000f8
+#define AOFF_task_cmaj_flt 0x00000108
#define ASIZ_task_cmaj_flt 0x00000004
-#define AOFF_task_cnswap 0x000000fc
+#define AOFF_task_cnswap 0x0000010c
#define ASIZ_task_cnswap 0x00000004
-#define AOFF_task_uid 0x00000102
+#define AOFF_task_uid 0x00000112
#define ASIZ_task_uid 0x00000002
-#define AOFF_task_euid 0x00000104
+#define AOFF_task_euid 0x00000114
#define ASIZ_task_euid 0x00000002
-#define AOFF_task_suid 0x00000106
+#define AOFF_task_suid 0x00000116
#define ASIZ_task_suid 0x00000002
-#define AOFF_task_fsuid 0x00000108
+#define AOFF_task_fsuid 0x00000118
#define ASIZ_task_fsuid 0x00000002
-#define AOFF_task_gid 0x0000010a
+#define AOFF_task_gid 0x0000011a
#define ASIZ_task_gid 0x00000002
-#define AOFF_task_egid 0x0000010c
+#define AOFF_task_egid 0x0000011c
#define ASIZ_task_egid 0x00000002
-#define AOFF_task_sgid 0x0000010e
+#define AOFF_task_sgid 0x0000011e
#define ASIZ_task_sgid 0x00000002
-#define AOFF_task_fsgid 0x00000110
+#define AOFF_task_fsgid 0x00000120
#define ASIZ_task_fsgid 0x00000002
-#define AOFF_task_ngroups 0x00000114
+#define AOFF_task_ngroups 0x00000124
#define ASIZ_task_ngroups 0x00000004
-#define AOFF_task_groups 0x00000118
+#define AOFF_task_groups 0x00000128
#define ASIZ_task_groups 0x00000040
-#define AOFF_task_cap_effective 0x00000158
+#define AOFF_task_cap_effective 0x00000168
#define ASIZ_task_cap_effective 0x00000004
-#define AOFF_task_cap_inheritable 0x0000015c
+#define AOFF_task_cap_inheritable 0x0000016c
#define ASIZ_task_cap_inheritable 0x00000004
-#define AOFF_task_cap_permitted 0x00000160
+#define AOFF_task_cap_permitted 0x00000170
#define ASIZ_task_cap_permitted 0x00000004
-#define AOFF_task_user 0x00000164
+#define AOFF_task_user 0x00000174
#define ASIZ_task_user 0x00000004
-#define AOFF_task_rlim 0x00000168
+#define AOFF_task_rlim 0x00000178
#define ASIZ_task_rlim 0x00000050
-#define AOFF_task_used_math 0x000001b8
+#define AOFF_task_used_math 0x000001c8
#define ASIZ_task_used_math 0x00000002
-#define AOFF_task_comm 0x000001ba
+#define AOFF_task_comm 0x000001ca
#define ASIZ_task_comm 0x00000010
-#define AOFF_task_link_count 0x000001cc
+#define AOFF_task_link_count 0x000001dc
#define ASIZ_task_link_count 0x00000004
-#define AOFF_task_tty 0x000001d0
+#define AOFF_task_tty 0x000001e0
#define ASIZ_task_tty 0x00000004
-#define AOFF_task_semundo 0x000001d4
+#define AOFF_task_semundo 0x000001e4
#define ASIZ_task_semundo 0x00000004
-#define AOFF_task_semsleeping 0x000001d8
+#define AOFF_task_semsleeping 0x000001e8
#define ASIZ_task_semsleeping 0x00000004
-#define AOFF_task_tss 0x000001e0
+#define AOFF_task_tss 0x000001f0
#define ASIZ_task_tss 0x00000388
-#define AOFF_task_fs 0x00000568
+#define AOFF_task_fs 0x00000578
#define ASIZ_task_fs 0x00000004
-#define AOFF_task_files 0x0000056c
+#define AOFF_task_files 0x0000057c
#define ASIZ_task_files 0x00000004
-#define AOFF_task_mm 0x00000570
+#define AOFF_task_mm 0x00000580
#define ASIZ_task_mm 0x00000004
-#define AOFF_task_sigmask_lock 0x00000574
+#define AOFF_task_sigmask_lock 0x00000584
#define ASIZ_task_sigmask_lock 0x00000001
-#define AOFF_task_sig 0x00000578
+#define AOFF_task_sig 0x00000588
#define ASIZ_task_sig 0x00000004
-#define AOFF_task_signal 0x0000057c
+#define AOFF_task_signal 0x0000058c
#define ASIZ_task_signal 0x00000008
-#define AOFF_task_blocked 0x00000584
+#define AOFF_task_blocked 0x00000594
#define ASIZ_task_blocked 0x00000008
-#define AOFF_task_sigqueue 0x0000058c
+#define AOFF_task_sigqueue 0x0000059c
#define ASIZ_task_sigqueue 0x00000004
-#define AOFF_task_sigqueue_tail 0x00000590
+#define AOFF_task_sigqueue_tail 0x000005a0
#define ASIZ_task_sigqueue_tail 0x00000004
-#define AOFF_task_sas_ss_sp 0x00000594
+#define AOFF_task_sas_ss_sp 0x000005a4
#define ASIZ_task_sas_ss_sp 0x00000004
-#define AOFF_task_sas_ss_size 0x00000598
+#define AOFF_task_sas_ss_size 0x000005a8
#define ASIZ_task_sas_ss_size 0x00000004
#define AOFF_mm_mmap 0x00000000
#define ASIZ_mm_mmap 0x00000004
@@ -195,46 +195,46 @@
#define AOFF_mm_map_count 0x00000014
#define ASIZ_mm_map_count 0x00000004
#define AOFF_mm_mmap_sem 0x00000018
-#define ASIZ_mm_mmap_sem 0x0000000c
-#define AOFF_mm_context 0x00000024
+#define ASIZ_mm_mmap_sem 0x00000020
+#define AOFF_mm_context 0x00000038
#define ASIZ_mm_context 0x00000004
-#define AOFF_mm_start_code 0x00000028
+#define AOFF_mm_start_code 0x0000003c
#define ASIZ_mm_start_code 0x00000004
-#define AOFF_mm_end_code 0x0000002c
+#define AOFF_mm_end_code 0x00000040
#define ASIZ_mm_end_code 0x00000004
-#define AOFF_mm_start_data 0x00000030
+#define AOFF_mm_start_data 0x00000044
#define ASIZ_mm_start_data 0x00000004
-#define AOFF_mm_end_data 0x00000034
+#define AOFF_mm_end_data 0x00000048
#define ASIZ_mm_end_data 0x00000004
-#define AOFF_mm_start_brk 0x00000038
+#define AOFF_mm_start_brk 0x0000004c
#define ASIZ_mm_start_brk 0x00000004
-#define AOFF_mm_brk 0x0000003c
+#define AOFF_mm_brk 0x00000050
#define ASIZ_mm_brk 0x00000004
-#define AOFF_mm_start_stack 0x00000040
+#define AOFF_mm_start_stack 0x00000054
#define ASIZ_mm_start_stack 0x00000004
-#define AOFF_mm_arg_start 0x00000044
+#define AOFF_mm_arg_start 0x00000058
#define ASIZ_mm_arg_start 0x00000004
-#define AOFF_mm_arg_end 0x00000048
+#define AOFF_mm_arg_end 0x0000005c
#define ASIZ_mm_arg_end 0x00000004
-#define AOFF_mm_env_start 0x0000004c
+#define AOFF_mm_env_start 0x00000060
#define ASIZ_mm_env_start 0x00000004
-#define AOFF_mm_env_end 0x00000050
+#define AOFF_mm_env_end 0x00000064
#define ASIZ_mm_env_end 0x00000004
-#define AOFF_mm_rss 0x00000054
+#define AOFF_mm_rss 0x00000068
#define ASIZ_mm_rss 0x00000004
-#define AOFF_mm_total_vm 0x00000058
+#define AOFF_mm_total_vm 0x0000006c
#define ASIZ_mm_total_vm 0x00000004
-#define AOFF_mm_locked_vm 0x0000005c
+#define AOFF_mm_locked_vm 0x00000070
#define ASIZ_mm_locked_vm 0x00000004
-#define AOFF_mm_def_flags 0x00000060
+#define AOFF_mm_def_flags 0x00000074
#define ASIZ_mm_def_flags 0x00000004
-#define AOFF_mm_cpu_vm_mask 0x00000064
+#define AOFF_mm_cpu_vm_mask 0x00000078
#define ASIZ_mm_cpu_vm_mask 0x00000004
-#define AOFF_mm_swap_cnt 0x00000068
+#define AOFF_mm_swap_cnt 0x0000007c
#define ASIZ_mm_swap_cnt 0x00000004
-#define AOFF_mm_swap_address 0x0000006c
+#define AOFF_mm_swap_address 0x00000080
#define ASIZ_mm_swap_address 0x00000004
-#define AOFF_mm_segments 0x00000070
+#define AOFF_mm_segments 0x00000084
#define ASIZ_mm_segments 0x00000004
#define AOFF_thread_uwinmask 0x00000000
#define ASIZ_thread_uwinmask 0x00000004
@@ -352,110 +352,110 @@
#define AOFF_task_tarray_ptr 0x0000008c
#define ASIZ_task_tarray_ptr 0x00000004
#define AOFF_task_wait_chldexit 0x00000090
-#define ASIZ_task_wait_chldexit 0x00000004
-#define AOFF_task_vfork_sem 0x00000094
+#define ASIZ_task_wait_chldexit 0x00000018
+#define AOFF_task_vfork_sem 0x000000a8
#define ASIZ_task_vfork_sem 0x00000004
-#define AOFF_task_policy 0x00000098
+#define AOFF_task_policy 0x000000ac
#define ASIZ_task_policy 0x00000004
-#define AOFF_task_rt_priority 0x0000009c
+#define AOFF_task_rt_priority 0x000000b0
#define ASIZ_task_rt_priority 0x00000004
-#define AOFF_task_it_real_value 0x000000a0
+#define AOFF_task_it_real_value 0x000000b4
#define ASIZ_task_it_real_value 0x00000004
-#define AOFF_task_it_prof_value 0x000000a4
+#define AOFF_task_it_prof_value 0x000000b8
#define ASIZ_task_it_prof_value 0x00000004
-#define AOFF_task_it_virt_value 0x000000a8
+#define AOFF_task_it_virt_value 0x000000bc
#define ASIZ_task_it_virt_value 0x00000004
-#define AOFF_task_it_real_incr 0x000000ac
+#define AOFF_task_it_real_incr 0x000000c0
#define ASIZ_task_it_real_incr 0x00000004
-#define AOFF_task_it_prof_incr 0x000000b0
+#define AOFF_task_it_prof_incr 0x000000c4
#define ASIZ_task_it_prof_incr 0x00000004
-#define AOFF_task_it_virt_incr 0x000000b4
+#define AOFF_task_it_virt_incr 0x000000c8
#define ASIZ_task_it_virt_incr 0x00000004
-#define AOFF_task_real_timer 0x000000b8
+#define AOFF_task_real_timer 0x000000cc
#define ASIZ_task_real_timer 0x00000014
-#define AOFF_task_times 0x000000cc
+#define AOFF_task_times 0x000000e0
#define ASIZ_task_times 0x00000010
-#define AOFF_task_start_time 0x000000dc
+#define AOFF_task_start_time 0x000000f0
#define ASIZ_task_start_time 0x00000004
-#define AOFF_task_per_cpu_utime 0x000000e0
+#define AOFF_task_per_cpu_utime 0x000000f4
#define ASIZ_task_per_cpu_utime 0x00000080
-#define AOFF_task_min_flt 0x000001e0
+#define AOFF_task_min_flt 0x000001f4
#define ASIZ_task_min_flt 0x00000004
-#define AOFF_task_maj_flt 0x000001e4
+#define AOFF_task_maj_flt 0x000001f8
#define ASIZ_task_maj_flt 0x00000004
-#define AOFF_task_nswap 0x000001e8
+#define AOFF_task_nswap 0x000001fc
#define ASIZ_task_nswap 0x00000004
-#define AOFF_task_cmin_flt 0x000001ec
+#define AOFF_task_cmin_flt 0x00000200
#define ASIZ_task_cmin_flt 0x00000004
-#define AOFF_task_cmaj_flt 0x000001f0
+#define AOFF_task_cmaj_flt 0x00000204
#define ASIZ_task_cmaj_flt 0x00000004
-#define AOFF_task_cnswap 0x000001f4
+#define AOFF_task_cnswap 0x00000208
#define ASIZ_task_cnswap 0x00000004
-#define AOFF_task_uid 0x000001fa
+#define AOFF_task_uid 0x0000020e
#define ASIZ_task_uid 0x00000002
-#define AOFF_task_euid 0x000001fc
+#define AOFF_task_euid 0x00000210
#define ASIZ_task_euid 0x00000002
-#define AOFF_task_suid 0x000001fe
+#define AOFF_task_suid 0x00000212
#define ASIZ_task_suid 0x00000002
-#define AOFF_task_fsuid 0x00000200
+#define AOFF_task_fsuid 0x00000214
#define ASIZ_task_fsuid 0x00000002
-#define AOFF_task_gid 0x00000202
+#define AOFF_task_gid 0x00000216
#define ASIZ_task_gid 0x00000002
-#define AOFF_task_egid 0x00000204
+#define AOFF_task_egid 0x00000218
#define ASIZ_task_egid 0x00000002
-#define AOFF_task_sgid 0x00000206
+#define AOFF_task_sgid 0x0000021a
#define ASIZ_task_sgid 0x00000002
-#define AOFF_task_fsgid 0x00000208
+#define AOFF_task_fsgid 0x0000021c
#define ASIZ_task_fsgid 0x00000002
-#define AOFF_task_ngroups 0x0000020c
+#define AOFF_task_ngroups 0x00000220
#define ASIZ_task_ngroups 0x00000004
-#define AOFF_task_groups 0x00000210
+#define AOFF_task_groups 0x00000224
#define ASIZ_task_groups 0x00000040
-#define AOFF_task_cap_effective 0x00000250
+#define AOFF_task_cap_effective 0x00000264
#define ASIZ_task_cap_effective 0x00000004
-#define AOFF_task_cap_inheritable 0x00000254
+#define AOFF_task_cap_inheritable 0x00000268
#define ASIZ_task_cap_inheritable 0x00000004
-#define AOFF_task_cap_permitted 0x00000258
+#define AOFF_task_cap_permitted 0x0000026c
#define ASIZ_task_cap_permitted 0x00000004
-#define AOFF_task_user 0x0000025c
+#define AOFF_task_user 0x00000270
#define ASIZ_task_user 0x00000004
-#define AOFF_task_rlim 0x00000260
+#define AOFF_task_rlim 0x00000274
#define ASIZ_task_rlim 0x00000050
-#define AOFF_task_used_math 0x000002b0
+#define AOFF_task_used_math 0x000002c4
#define ASIZ_task_used_math 0x00000002
-#define AOFF_task_comm 0x000002b2
+#define AOFF_task_comm 0x000002c6
#define ASIZ_task_comm 0x00000010
-#define AOFF_task_link_count 0x000002c4
+#define AOFF_task_link_count 0x000002d8
#define ASIZ_task_link_count 0x00000004
-#define AOFF_task_tty 0x000002c8
+#define AOFF_task_tty 0x000002dc
#define ASIZ_task_tty 0x00000004
-#define AOFF_task_semundo 0x000002cc
+#define AOFF_task_semundo 0x000002e0
#define ASIZ_task_semundo 0x00000004
-#define AOFF_task_semsleeping 0x000002d0
+#define AOFF_task_semsleeping 0x000002e4
#define ASIZ_task_semsleeping 0x00000004
-#define AOFF_task_tss 0x000002d8
+#define AOFF_task_tss 0x000002e8
#define ASIZ_task_tss 0x00000388
-#define AOFF_task_fs 0x00000660
+#define AOFF_task_fs 0x00000670
#define ASIZ_task_fs 0x00000004
-#define AOFF_task_files 0x00000664
+#define AOFF_task_files 0x00000674
#define ASIZ_task_files 0x00000004
-#define AOFF_task_mm 0x00000668
+#define AOFF_task_mm 0x00000678
#define ASIZ_task_mm 0x00000004
-#define AOFF_task_sigmask_lock 0x0000066c
+#define AOFF_task_sigmask_lock 0x0000067c
#define ASIZ_task_sigmask_lock 0x00000008
-#define AOFF_task_sig 0x00000674
+#define AOFF_task_sig 0x00000684
#define ASIZ_task_sig 0x00000004
-#define AOFF_task_signal 0x00000678
+#define AOFF_task_signal 0x00000688
#define ASIZ_task_signal 0x00000008
-#define AOFF_task_blocked 0x00000680
+#define AOFF_task_blocked 0x00000690
#define ASIZ_task_blocked 0x00000008
-#define AOFF_task_sigqueue 0x00000688
+#define AOFF_task_sigqueue 0x00000698
#define ASIZ_task_sigqueue 0x00000004
-#define AOFF_task_sigqueue_tail 0x0000068c
+#define AOFF_task_sigqueue_tail 0x0000069c
#define ASIZ_task_sigqueue_tail 0x00000004
-#define AOFF_task_sas_ss_sp 0x00000690
+#define AOFF_task_sas_ss_sp 0x000006a0
#define ASIZ_task_sas_ss_sp 0x00000004
-#define AOFF_task_sas_ss_size 0x00000694
+#define AOFF_task_sas_ss_size 0x000006a4
#define ASIZ_task_sas_ss_size 0x00000004
#define AOFF_mm_mmap 0x00000000
#define ASIZ_mm_mmap 0x00000004
@@ -470,46 +470,46 @@
#define AOFF_mm_map_count 0x00000014
#define ASIZ_mm_map_count 0x00000004
#define AOFF_mm_mmap_sem 0x00000018
-#define ASIZ_mm_mmap_sem 0x0000000c
-#define AOFF_mm_context 0x00000024
+#define ASIZ_mm_mmap_sem 0x00000024
+#define AOFF_mm_context 0x0000003c
#define ASIZ_mm_context 0x00000004
-#define AOFF_mm_start_code 0x00000028
+#define AOFF_mm_start_code 0x00000040
#define ASIZ_mm_start_code 0x00000004
-#define AOFF_mm_end_code 0x0000002c
+#define AOFF_mm_end_code 0x00000044
#define ASIZ_mm_end_code 0x00000004
-#define AOFF_mm_start_data 0x00000030
+#define AOFF_mm_start_data 0x00000048
#define ASIZ_mm_start_data 0x00000004
-#define AOFF_mm_end_data 0x00000034
+#define AOFF_mm_end_data 0x0000004c
#define ASIZ_mm_end_data 0x00000004
-#define AOFF_mm_start_brk 0x00000038
+#define AOFF_mm_start_brk 0x00000050
#define ASIZ_mm_start_brk 0x00000004
-#define AOFF_mm_brk 0x0000003c
+#define AOFF_mm_brk 0x00000054
#define ASIZ_mm_brk 0x00000004
-#define AOFF_mm_start_stack 0x00000040
+#define AOFF_mm_start_stack 0x00000058
#define ASIZ_mm_start_stack 0x00000004
-#define AOFF_mm_arg_start 0x00000044
+#define AOFF_mm_arg_start 0x0000005c
#define ASIZ_mm_arg_start 0x00000004
-#define AOFF_mm_arg_end 0x00000048
+#define AOFF_mm_arg_end 0x00000060
#define ASIZ_mm_arg_end 0x00000004
-#define AOFF_mm_env_start 0x0000004c
+#define AOFF_mm_env_start 0x00000064
#define ASIZ_mm_env_start 0x00000004
-#define AOFF_mm_env_end 0x00000050
+#define AOFF_mm_env_end 0x00000068
#define ASIZ_mm_env_end 0x00000004
-#define AOFF_mm_rss 0x00000054
+#define AOFF_mm_rss 0x0000006c
#define ASIZ_mm_rss 0x00000004
-#define AOFF_mm_total_vm 0x00000058
+#define AOFF_mm_total_vm 0x00000070
#define ASIZ_mm_total_vm 0x00000004
-#define AOFF_mm_locked_vm 0x0000005c
+#define AOFF_mm_locked_vm 0x00000074
#define ASIZ_mm_locked_vm 0x00000004
-#define AOFF_mm_def_flags 0x00000060
+#define AOFF_mm_def_flags 0x00000078
#define ASIZ_mm_def_flags 0x00000004
-#define AOFF_mm_cpu_vm_mask 0x00000064
+#define AOFF_mm_cpu_vm_mask 0x0000007c
#define ASIZ_mm_cpu_vm_mask 0x00000004
-#define AOFF_mm_swap_cnt 0x00000068
+#define AOFF_mm_swap_cnt 0x00000080
#define ASIZ_mm_swap_cnt 0x00000004
-#define AOFF_mm_swap_address 0x0000006c
+#define AOFF_mm_swap_address 0x00000084
#define ASIZ_mm_swap_address 0x00000004
-#define AOFF_mm_segments 0x00000070
+#define AOFF_mm_segments 0x00000088
#define ASIZ_mm_segments 0x00000004
#define AOFF_thread_uwinmask 0x00000000
#define ASIZ_thread_uwinmask 0x00000004
diff --git a/include/asm-sparc/audioio.h b/include/asm-sparc/audioio.h
index ca5e06538..27543806b 100644
--- a/include/asm-sparc/audioio.h
+++ b/include/asm-sparc/audioio.h
@@ -275,7 +275,7 @@ struct sparcaudio_driver
struct linux_sbus_device *dev;
/* Processes blocked on open() sit here. */
- struct wait_queue *open_wait;
+ wait_queue_head_t open_wait;
/* Task queue for this driver's bottom half. */
struct tq_struct tqueue;
@@ -288,7 +288,7 @@ struct sparcaudio_driver
size_t *output_sizes, output_size, output_buffer_size;
int num_output_buffers, output_front, output_rear, output_offset;
int output_count, output_active, playing_count, output_eof;
- struct wait_queue *output_write_wait, *output_drain_wait;
+ wait_queue_head_t output_write_wait, output_drain_wait;
char *output_notify;
/* Support for a circular queue of input buffers. */
@@ -296,7 +296,7 @@ struct sparcaudio_driver
size_t *input_sizes, input_size, input_buffer_size;
int num_input_buffers, input_front, input_rear, input_offset;
int input_count, input_active, recording_count;
- struct wait_queue *input_read_wait;
+ wait_queue_head_t input_read_wait;
/* Hack to make it look like we support variable size buffers. */
int buffer_size;
diff --git a/include/asm-sparc/io.h b/include/asm-sparc/io.h
index a26453b2f..da901ab88 100644
--- a/include/asm-sparc/io.h
+++ b/include/asm-sparc/io.h
@@ -1,4 +1,4 @@
-/* $Id: io.h,v 1.18 1998/09/21 05:07:17 jj Exp $ */
+/* $Id: io.h,v 1.20 1999/06/03 15:02:50 davem Exp $ */
#ifndef __SPARC_IO_H
#define __SPARC_IO_H
@@ -162,4 +162,19 @@ static __inline__ void *sparc_dvma_malloc(int size, char *name, __u32 *dvmaaddr_
#define virt_to_phys(x) __pa((unsigned long)(x))
#define phys_to_virt(x) __va((unsigned long)(x))
+/*
+ * At the moment, we do not use CMOS_READ anywhere outside of rtc.c,
+ * so rtc_port is static in it. This should not change unless a new
+ * hardware pops up.
+ */
+
+#define RTC_PORT(x) (rtc_port + (x))
+#define RTC_ALWAYS_BCD 0
+
+/* Nothing to do */
+
+#define dma_cache_inv(_start,_size) do { } while (0)
+#define dma_cache_wback(_start,_size) do { } while (0)
+#define dma_cache_wback_inv(_start,_size) do { } while (0)
+
#endif /* !(__SPARC_IO_H) */
diff --git a/include/asm-sparc/namei.h b/include/asm-sparc/namei.h
index 8d6b911fc..e03f86c75 100644
--- a/include/asm-sparc/namei.h
+++ b/include/asm-sparc/namei.h
@@ -28,7 +28,7 @@ __sparc_lookup_dentry(const char *name, int lookup_flags)
base = lookup_dentry (emul,
dget (current->fs->root),
- (LOOKUP_FOLLOW | LOOKUP_DIRECTORY | LOOKUP_SLASHOK));
+ (LOOKUP_FOLLOW | LOOKUP_DIRECTORY));
if (IS_ERR (base)) return NULL;
diff --git a/include/asm-sparc/pcic.h b/include/asm-sparc/pcic.h
index c0d4dbbf8..bad175c72 100644
--- a/include/asm-sparc/pcic.h
+++ b/include/asm-sparc/pcic.h
@@ -1,4 +1,4 @@
-/* $Id: pcic.h,v 1.1 1998/09/22 05:54:39 jj Exp $
+/* $Id: pcic.h,v 1.2 1999/06/03 15:02:51 davem Exp $
* pcic.h: JavaEngine 1 specific PCI definitions.
*
* Copyright (C) 1998 V. Roganov and G. Raiko
@@ -7,6 +7,8 @@
#ifndef __SPARC_PCIC_H
#define __SPARC_PCIC_H
+#ifndef __ASSEMBLY__
+
#include <linux/types.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
@@ -21,13 +23,17 @@ struct linux_pcic {
unsigned long pcic_config_space_addr;
unsigned long pcic_config_space_data;
struct linux_pbm_info pbm;
+ struct pcic_ca2irq *pcic_imap;
+ int pcic_imdim;
};
extern unsigned long pcic_alloc_io(unsigned long* addr);
extern void pcic_probe(void);
extern void sun4m_pci_init_IRQ(void);
-/* Size of PCI Space */
+#endif
+
+/* Size of PCI I/O space which we relocate. */
#define PCI_SPACE_SIZE 0x1000000 /* 16 MB */
/* PCIC Register Set. */
@@ -50,10 +56,18 @@ extern void sun4m_pci_init_IRQ(void);
#define PCI_SOFTWARE_INT_CLEAR 0x6a /* 16 bits */
#define PCI_SOFTWARE_INT_SET 0x6e /* 16 bits */
#define PCI_SYS_INT_PENDING 0x70 /* 32 bits */
+#define PCI_SYS_INT_PENDING_PIO 0x40000000
+#define PCI_SYS_INT_PENDING_DMA 0x20000000
+#define PCI_SYS_INT_PENDING_PCI 0x10000000
+#define PCI_SYS_INT_PENDING_APSR 0x08000000
#define PCI_SYS_INT_TARGET_MASK 0x74 /* 32 bits */
#define PCI_SYS_INT_TARGET_MASK_CLEAR 0x78 /* 32 bits */
#define PCI_SYS_INT_TARGET_MASK_SET 0x7c /* 32 bits */
#define PCI_SYS_INT_PENDING_CLEAR 0x83 /* 8 bits */
+#define PCI_SYS_INT_PENDING_CLEAR_ALL 0x80
+#define PCI_SYS_INT_PENDING_CLEAR_PIO 0x40
+#define PCI_SYS_INT_PENDING_CLEAR_DMA 0x20
+#define PCI_SYS_INT_PENDING_CLEAR_PCI 0x10
#define PCI_IOTLB_CONTROL 0x84 /* 8 bits */
#define PCI_INT_SELECT_LO 0x88 /* 16 bits */
#define PCI_ARBITRATION_SELECT 0x8a /* 16 bits */
diff --git a/include/asm-sparc/pgtable.h b/include/asm-sparc/pgtable.h
index 76f7fc6bc..8e9e67cc2 100644
--- a/include/asm-sparc/pgtable.h
+++ b/include/asm-sparc/pgtable.h
@@ -1,4 +1,4 @@
-/* $Id: pgtable.h,v 1.78 1999/01/07 14:14:05 jj Exp $ */
+/* $Id: pgtable.h,v 1.80 1999/05/27 04:52:40 davem Exp $ */
#ifndef _SPARC_PGTABLE_H
#define _SPARC_PGTABLE_H
diff --git a/include/asm-sparc/processor.h b/include/asm-sparc/processor.h
index f2ab4d947..2cec2f103 100644
--- a/include/asm-sparc/processor.h
+++ b/include/asm-sparc/processor.h
@@ -1,4 +1,4 @@
-/* $Id: processor.h,v 1.70 1999/03/24 11:42:44 davem Exp $
+/* $Id: processor.h,v 1.71 1999/05/27 04:52:43 davem Exp $
* include/asm-sparc/processor.h
*
* Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu)
@@ -7,6 +7,12 @@
#ifndef __ASM_SPARC_PROCESSOR_H
#define __ASM_SPARC_PROCESSOR_H
+/*
+ * Sparc32 implementation of macro that returns current
+ * instruction pointer ("program counter").
+ */
+#define current_text_addr() ({ void *pc; __asm__("sethi %%hi(1f), %0; or %0, %%lo(1f), %0;\n1:" : "=r" (pc)); pc; })
+
#include <linux/a.out.h>
#include <asm/psr.h>
diff --git a/include/asm-sparc/semaphore.h b/include/asm-sparc/semaphore.h
index 1123c966e..9c647a571 100644
--- a/include/asm-sparc/semaphore.h
+++ b/include/asm-sparc/semaphore.h
@@ -6,28 +6,71 @@
#ifdef __KERNEL__
#include <asm/atomic.h>
+#include <linux/wait.h>
struct semaphore {
atomic_t count;
atomic_t waking;
- struct wait_queue * wait;
+ wait_queue_head_t wait;
+#if WAITQUEUE_DEBUG
+ long __magic;
+#endif
};
-#define MUTEX ((struct semaphore) { ATOMIC_INIT(1), ATOMIC_INIT(0), NULL })
-#define MUTEX_LOCKED ((struct semaphore) { ATOMIC_INIT(0), ATOMIC_INIT(0), NULL })
+#if WAITQUEUE_DEBUG
+# define __SEM_DEBUG_INIT(name) \
+ , (long)&(name).__magic
+#else
+# define __SEM_DEBUG_INIT(name)
+#endif
+
+#define __SEMAPHORE_INITIALIZER(name,count) \
+{ ATOMIC_INIT(count), ATOMIC_INIT(0), __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \
+ __SEM_DEBUG_INIT(name) }
+
+#define __MUTEX_INITIALIZER(name) \
+ __SEMAPHORE_INITIALIZER(name,1)
+
+#define __DECLARE_SEMAPHORE_GENERIC(name,count) \
+ struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
+
+#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
+#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
+
+extern inline void sema_init (struct semaphore *sem, int val)
+{
+ atomic_set(&sem->count, val);
+ atomic_set(&sem->waking, 0);
+ init_waitqueue_head(&sem->wait);
+#if WAITQUEUE_DEBUG
+ sem->__magic = (long)&sem->__magic;
+#endif
+}
+
+static inline void init_MUTEX (struct semaphore *sem)
+{
+ sema_init(sem, 1);
+}
+
+static inline void init_MUTEX_LOCKED (struct semaphore *sem)
+{
+ sema_init(sem, 0);
+}
extern void __down(struct semaphore * sem);
extern int __down_interruptible(struct semaphore * sem);
extern int __down_trylock(struct semaphore * sem);
extern void __up(struct semaphore * sem);
-#define sema_init(sem, val) atomic_set(&((sem)->count), val)
-
extern inline void down(struct semaphore * sem)
{
register atomic_t *ptr asm("g1");
register int increment asm("g2");
+#if WAITQUEUE_DEBUG
+ CHECK_MAGIC(sem->__magic);
+#endif
+
ptr = (atomic_t *) __atomic_fool_gcc(sem);
increment = 1;
@@ -59,6 +102,10 @@ extern inline int down_interruptible(struct semaphore * sem)
register atomic_t *ptr asm("g1");
register int increment asm("g2");
+#if WAITQUEUE_DEBUG
+ CHECK_MAGIC(sem->__magic);
+#endif
+
ptr = (atomic_t *) __atomic_fool_gcc(sem);
increment = 1;
@@ -93,6 +140,10 @@ extern inline int down_trylock(struct semaphore * sem)
register atomic_t *ptr asm("g1");
register int increment asm("g2");
+#if WAITQUEUE_DEBUG
+ CHECK_MAGIC(sem->__magic);
+#endif
+
ptr = (atomic_t *) __atomic_fool_gcc(sem);
increment = 1;
@@ -127,6 +178,10 @@ extern inline void up(struct semaphore * sem)
register atomic_t *ptr asm("g1");
register int increment asm("g2");
+#if WAITQUEUE_DEBUG
+ CHECK_MAGIC(sem->__magic);
+#endif
+
ptr = (atomic_t *) __atomic_fool_gcc(sem);
increment = 1;
diff --git a/include/asm-sparc/softirq.h b/include/asm-sparc/softirq.h
index 4920aa865..e72d714cb 100644
--- a/include/asm-sparc/softirq.h
+++ b/include/asm-sparc/softirq.h
@@ -103,7 +103,8 @@ static inline void end_bh_atomic(void)
static inline int softirq_trylock(int cpu)
{
if (spin_trylock(&global_bh_count)) {
- if (atomic_read(&global_bh_lock) == 0) {
+ if (atomic_read(&global_bh_lock) == 0 &&
+ local_bh_count[cpu] == 0) {
++local_bh_count[cpu];
return 1;
}
@@ -118,6 +119,9 @@ static inline void softirq_endlock(int cpu)
spin_unlock(&global_bh_count);
}
+#define local_bh_disable() (local_bh_count[smp_processor_id()]++)
+#define local_bh_enable() (local_bh_count[smp_processor_id()]--)
+
#else
extern unsigned int local_bh_count;
@@ -129,6 +133,9 @@ extern unsigned int local_bh_count;
#define softirq_endlock(cpu) (local_bh_count = 0)
#define synchronize_bh() barrier()
+#define local_bh_disable() (local_bh_count++)
+#define local_bh_enable() (local_bh_count--)
+
/*
* These use a mask count to correctly handle
* nested disable/enable calls
diff --git a/include/asm-sparc/spinlock.h b/include/asm-sparc/spinlock.h
index c676dcc4c..57e74b4d3 100644
--- a/include/asm-sparc/spinlock.h
+++ b/include/asm-sparc/spinlock.h
@@ -22,6 +22,8 @@ typedef unsigned char spinlock_t;
#define spin_unlock(lock) do { } while(0)
#define spin_lock_irq(lock) cli()
#define spin_unlock_irq(lock) sti()
+#define spin_lock_bh(lock) local_bh_disable()
+#define spin_unlock_bh(lock) local_bh_enable()
#define spin_lock_irqsave(lock, flags) save_and_cli(flags)
#define spin_unlock_irqrestore(lock, flags) restore_flags(flags)
@@ -47,6 +49,10 @@ typedef struct { volatile unsigned int lock; } rwlock_t;
#define read_unlock_irq(lock) sti()
#define write_lock_irq(lock) cli()
#define write_unlock_irq(lock) sti()
+#define read_lock_bh(lock) local_bh_disable()
+#define read_unlock_bh(lock) local_bh_enable()
+#define write_lock_bh(lock) local_bh_disable()
+#define write_unlock_bh(lock) local_bh_enable()
#define read_lock_irqsave(lock, flags) save_and_cli(flags)
#define read_unlock_irqrestore(lock, flags) restore_flags(flags)
@@ -80,10 +86,12 @@ extern void _do_spin_unlock(spinlock_t *lock);
#define spin_lock(lock) _do_spin_lock(lock, "spin_lock")
#define spin_lock_irq(lock) do { __cli(); _do_spin_lock(lock, "spin_lock_irq"); } while(0)
+#define spin_lock_bh(lock) do { local_bh_disable(); _do_spin_lock(lock, "spin_lock_irq"); } while(0)
#define spin_lock_irqsave(lock, flags) do { __save_and_cli(flags); _do_spin_lock(lock, "spin_lock_irqsave"); } while(0)
#define spin_unlock(lock) _do_spin_unlock(lock)
#define spin_unlock_irq(lock) do { _do_spin_unlock(lock); __sti(); } while(0)
+#define spin_unlock_bh(lock) do { _do_spin_unlock(lock); local_bh_enable(); } while(0)
#define spin_unlock_irqrestore(lock, flags) do { _do_spin_unlock(lock); __restore_flags(flags); } while(0)
struct _rwlock_debug {
@@ -107,6 +115,7 @@ do { unsigned long flags; \
__restore_flags(flags); \
} while(0)
#define read_lock_irq(lock) do { __cli(); _do_read_lock(lock, "read_lock_irq"); } while(0)
+#define read_lock_bh(lock) do { local_bh_disable(); _do_read_lock(lock, "read_lock_irq"); } while(0)
#define read_lock_irqsave(lock, flags) do { __save_and_cli(flags); _do_read_lock(lock, "read_lock_irqsave"); } while(0)
#define read_unlock(lock) \
@@ -116,6 +125,7 @@ do { unsigned long flags; \
__restore_flags(flags); \
} while(0)
#define read_unlock_irq(lock) do { _do_read_unlock(lock, "read_unlock_irq"); __sti(); } while(0)
+#define read_unlock_bh(lock) do { _do_read_unlock(lock, "read_unlock_irq"); local_bh_enable(); } while(0)
#define read_unlock_irqrestore(lock, flags) do { _do_read_unlock(lock, "read_unlock_irqrestore"); __restore_flags(flags); } while(0)
#define write_lock(lock) \
@@ -125,6 +135,7 @@ do { unsigned long flags; \
__restore_flags(flags); \
} while(0)
#define write_lock_irq(lock) do { __cli(); _do_write_lock(lock, "write_lock_irq"); } while(0)
+#define write_lock_bh(lock) do { local_bh_disable(); _do_write_lock(lock, "write_lock_irq"); } while(0)
#define write_lock_irqsave(lock, flags) do { __save_and_cli(flags); _do_write_lock(lock, "write_lock_irqsave"); } while(0)
#define write_unlock(lock) \
@@ -134,6 +145,7 @@ do { unsigned long flags; \
__restore_flags(flags); \
} while(0)
#define write_unlock_irq(lock) do { _do_write_unlock(lock); __sti(); } while(0)
+#define write_unlock_bh(lock) do { _do_write_unlock(lock); local_bh_enable(); } while(0)
#define write_unlock_irqrestore(lock, flags) do { _do_write_unlock(lock); __restore_flags(flags); } while(0)
#else /* !SPIN_LOCK_DEBUG */
@@ -200,6 +212,8 @@ extern __inline__ void spin_lock_irq(spinlock_t *lock)
: "g2", "memory", "cc");
}
+#define spin_lock_bh(___lk) do { local_bh_disable(); spin_lock(___lk); } while(0)
+
extern __inline__ void spin_unlock_irq(spinlock_t *lock)
{
__asm__ __volatile__("
@@ -213,6 +227,8 @@ extern __inline__ void spin_unlock_irq(spinlock_t *lock)
: "g2", "memory");
}
+#define spin_unlock_bh(___lk) do { spin_unlock(___lk); local_bh_enable(); } while(0)
+
#define spin_lock_irqsave(__lock, flags) \
do { \
register spinlock_t *__lp asm("g1"); \
@@ -339,6 +355,11 @@ extern __inline__ void write_lock(rwlock_t *rw)
#define write_lock_irq(lock) do { __cli(); write_lock(lock); } while (0)
#define write_unlock_irq(lock) do { write_unlock(lock); __sti(); } while (0)
+#define read_lock_bh(lock) do { local_bh_disable(); _read_lock(lock); } while (0)
+#define read_unlock_bh(lock) do { _read_unlock(lock); local_bh_enable(); } while (0)
+#define write_lock_bh(lock) do { local_bh_disable(); write_lock(lock); } while (0)
+#define write_unlock_bh(lock) do { write_unlock(lock); local_bh_enable(); } while (0)
+
#define read_lock_irqsave(lock, flags) \
do { __save_and_cli(flags); _read_lock(lock); } while (0)
#define read_unlock_irqrestore(lock, flags) \
diff --git a/include/asm-sparc64/asm_offsets.h b/include/asm-sparc64/asm_offsets.h
index 3301515c5..6f5cb96d9 100644
--- a/include/asm-sparc64/asm_offsets.h
+++ b/include/asm-sparc64/asm_offsets.h
@@ -12,177 +12,177 @@
#define ASIZ_task_flags 0x00000008
#define AOFF_task_sigpending 0x00000010
#define ASIZ_task_sigpending 0x00000004
-#define AOFF_task_addr_limit 0x00000018
-#define ASIZ_task_addr_limit 0x00000008
-#define AOFF_task_exec_domain 0x00000020
+#define AOFF_task_addr_limit 0x00000014
+#define ASIZ_task_addr_limit 0x00000001
+#define AOFF_task_exec_domain 0x00000018
#define ASIZ_task_exec_domain 0x00000008
-#define AOFF_task_need_resched 0x00000028
+#define AOFF_task_need_resched 0x00000020
#define ASIZ_task_need_resched 0x00000008
-#define AOFF_task_counter 0x00000030
+#define AOFF_task_counter 0x00000028
#define ASIZ_task_counter 0x00000008
-#define AOFF_task_priority 0x00000038
+#define AOFF_task_priority 0x00000030
#define ASIZ_task_priority 0x00000008
-#define AOFF_task_avg_slice 0x00000040
+#define AOFF_task_avg_slice 0x00000038
#define ASIZ_task_avg_slice 0x00000008
-#define AOFF_task_has_cpu 0x00000048
+#define AOFF_task_has_cpu 0x00000040
#define ASIZ_task_has_cpu 0x00000004
-#define AOFF_task_processor 0x0000004c
+#define AOFF_task_processor 0x00000044
#define ASIZ_task_processor 0x00000004
-#define AOFF_task_last_processor 0x00000050
+#define AOFF_task_last_processor 0x00000048
#define ASIZ_task_last_processor 0x00000004
-#define AOFF_task_lock_depth 0x00000054
+#define AOFF_task_lock_depth 0x0000004c
#define ASIZ_task_lock_depth 0x00000004
-#define AOFF_task_next_task 0x00000058
+#define AOFF_task_next_task 0x00000050
#define ASIZ_task_next_task 0x00000008
-#define AOFF_task_prev_task 0x00000060
+#define AOFF_task_prev_task 0x00000058
#define ASIZ_task_prev_task 0x00000008
-#define AOFF_task_next_run 0x00000068
+#define AOFF_task_next_run 0x00000060
#define ASIZ_task_next_run 0x00000008
-#define AOFF_task_prev_run 0x00000070
+#define AOFF_task_prev_run 0x00000068
#define ASIZ_task_prev_run 0x00000008
-#define AOFF_task_binfmt 0x00000078
+#define AOFF_task_binfmt 0x00000070
#define ASIZ_task_binfmt 0x00000008
-#define AOFF_task_exit_code 0x00000080
+#define AOFF_task_exit_code 0x00000078
#define ASIZ_task_exit_code 0x00000004
-#define AOFF_task_exit_signal 0x00000084
+#define AOFF_task_exit_signal 0x0000007c
#define ASIZ_task_exit_signal 0x00000004
-#define AOFF_task_pdeath_signal 0x00000088
+#define AOFF_task_pdeath_signal 0x00000080
#define ASIZ_task_pdeath_signal 0x00000004
-#define AOFF_task_personality 0x00000090
+#define AOFF_task_personality 0x00000088
#define ASIZ_task_personality 0x00000008
-#define AOFF_task_pid 0x0000009c
+#define AOFF_task_pid 0x00000094
#define ASIZ_task_pid 0x00000004
-#define AOFF_task_pgrp 0x000000a0
+#define AOFF_task_pgrp 0x00000098
#define ASIZ_task_pgrp 0x00000004
-#define AOFF_task_tty_old_pgrp 0x000000a4
+#define AOFF_task_tty_old_pgrp 0x0000009c
#define ASIZ_task_tty_old_pgrp 0x00000004
-#define AOFF_task_session 0x000000a8
+#define AOFF_task_session 0x000000a0
#define ASIZ_task_session 0x00000004
-#define AOFF_task_leader 0x000000ac
+#define AOFF_task_leader 0x000000a4
#define ASIZ_task_leader 0x00000004
-#define AOFF_task_p_opptr 0x000000b0
+#define AOFF_task_p_opptr 0x000000a8
#define ASIZ_task_p_opptr 0x00000008
-#define AOFF_task_p_pptr 0x000000b8
+#define AOFF_task_p_pptr 0x000000b0
#define ASIZ_task_p_pptr 0x00000008
-#define AOFF_task_p_cptr 0x000000c0
+#define AOFF_task_p_cptr 0x000000b8
#define ASIZ_task_p_cptr 0x00000008
-#define AOFF_task_p_ysptr 0x000000c8
+#define AOFF_task_p_ysptr 0x000000c0
#define ASIZ_task_p_ysptr 0x00000008
-#define AOFF_task_p_osptr 0x000000d0
+#define AOFF_task_p_osptr 0x000000c8
#define ASIZ_task_p_osptr 0x00000008
-#define AOFF_task_pidhash_next 0x000000d8
+#define AOFF_task_pidhash_next 0x000000d0
#define ASIZ_task_pidhash_next 0x00000008
-#define AOFF_task_pidhash_pprev 0x000000e0
+#define AOFF_task_pidhash_pprev 0x000000d8
#define ASIZ_task_pidhash_pprev 0x00000008
-#define AOFF_task_tarray_ptr 0x000000e8
+#define AOFF_task_tarray_ptr 0x000000e0
#define ASIZ_task_tarray_ptr 0x00000008
-#define AOFF_task_wait_chldexit 0x000000f0
-#define ASIZ_task_wait_chldexit 0x00000008
-#define AOFF_task_vfork_sem 0x000000f8
+#define AOFF_task_wait_chldexit 0x000000e8
+#define ASIZ_task_wait_chldexit 0x00000028
+#define AOFF_task_vfork_sem 0x00000110
#define ASIZ_task_vfork_sem 0x00000008
-#define AOFF_task_policy 0x00000100
+#define AOFF_task_policy 0x00000118
#define ASIZ_task_policy 0x00000008
-#define AOFF_task_rt_priority 0x00000108
+#define AOFF_task_rt_priority 0x00000120
#define ASIZ_task_rt_priority 0x00000008
-#define AOFF_task_it_real_value 0x00000110
+#define AOFF_task_it_real_value 0x00000128
#define ASIZ_task_it_real_value 0x00000008
-#define AOFF_task_it_prof_value 0x00000118
+#define AOFF_task_it_prof_value 0x00000130
#define ASIZ_task_it_prof_value 0x00000008
-#define AOFF_task_it_virt_value 0x00000120
+#define AOFF_task_it_virt_value 0x00000138
#define ASIZ_task_it_virt_value 0x00000008
-#define AOFF_task_it_real_incr 0x00000128
+#define AOFF_task_it_real_incr 0x00000140
#define ASIZ_task_it_real_incr 0x00000008
-#define AOFF_task_it_prof_incr 0x00000130
+#define AOFF_task_it_prof_incr 0x00000148
#define ASIZ_task_it_prof_incr 0x00000008
-#define AOFF_task_it_virt_incr 0x00000138
+#define AOFF_task_it_virt_incr 0x00000150
#define ASIZ_task_it_virt_incr 0x00000008
-#define AOFF_task_real_timer 0x00000140
+#define AOFF_task_real_timer 0x00000158
#define ASIZ_task_real_timer 0x00000028
-#define AOFF_task_times 0x00000168
+#define AOFF_task_times 0x00000180
#define ASIZ_task_times 0x00000020
-#define AOFF_task_start_time 0x00000188
+#define AOFF_task_start_time 0x000001a0
#define ASIZ_task_start_time 0x00000008
-#define AOFF_task_per_cpu_utime 0x00000190
+#define AOFF_task_per_cpu_utime 0x000001a8
#define ASIZ_task_per_cpu_utime 0x00000008
-#define AOFF_task_min_flt 0x000001a0
+#define AOFF_task_min_flt 0x000001b8
#define ASIZ_task_min_flt 0x00000008
-#define AOFF_task_maj_flt 0x000001a8
+#define AOFF_task_maj_flt 0x000001c0
#define ASIZ_task_maj_flt 0x00000008
-#define AOFF_task_nswap 0x000001b0
+#define AOFF_task_nswap 0x000001c8
#define ASIZ_task_nswap 0x00000008
-#define AOFF_task_cmin_flt 0x000001b8
+#define AOFF_task_cmin_flt 0x000001d0
#define ASIZ_task_cmin_flt 0x00000008
-#define AOFF_task_cmaj_flt 0x000001c0
+#define AOFF_task_cmaj_flt 0x000001d8
#define ASIZ_task_cmaj_flt 0x00000008
-#define AOFF_task_cnswap 0x000001c8
+#define AOFF_task_cnswap 0x000001e0
#define ASIZ_task_cnswap 0x00000008
-#define AOFF_task_uid 0x000001d4
+#define AOFF_task_uid 0x000001ec
#define ASIZ_task_uid 0x00000004
-#define AOFF_task_euid 0x000001d8
+#define AOFF_task_euid 0x000001f0
#define ASIZ_task_euid 0x00000004
-#define AOFF_task_suid 0x000001dc
+#define AOFF_task_suid 0x000001f4
#define ASIZ_task_suid 0x00000004
-#define AOFF_task_fsuid 0x000001e0
+#define AOFF_task_fsuid 0x000001f8
#define ASIZ_task_fsuid 0x00000004
-#define AOFF_task_gid 0x000001e4
+#define AOFF_task_gid 0x000001fc
#define ASIZ_task_gid 0x00000004
-#define AOFF_task_egid 0x000001e8
+#define AOFF_task_egid 0x00000200
#define ASIZ_task_egid 0x00000004
-#define AOFF_task_sgid 0x000001ec
+#define AOFF_task_sgid 0x00000204
#define ASIZ_task_sgid 0x00000004
-#define AOFF_task_fsgid 0x000001f0
+#define AOFF_task_fsgid 0x00000208
#define ASIZ_task_fsgid 0x00000004
-#define AOFF_task_ngroups 0x000001f4
+#define AOFF_task_ngroups 0x0000020c
#define ASIZ_task_ngroups 0x00000004
-#define AOFF_task_groups 0x000001f8
+#define AOFF_task_groups 0x00000210
#define ASIZ_task_groups 0x00000080
-#define AOFF_task_cap_effective 0x00000278
+#define AOFF_task_cap_effective 0x00000290
#define ASIZ_task_cap_effective 0x00000004
-#define AOFF_task_cap_inheritable 0x0000027c
+#define AOFF_task_cap_inheritable 0x00000294
#define ASIZ_task_cap_inheritable 0x00000004
-#define AOFF_task_cap_permitted 0x00000280
+#define AOFF_task_cap_permitted 0x00000298
#define ASIZ_task_cap_permitted 0x00000004
-#define AOFF_task_user 0x00000288
+#define AOFF_task_user 0x000002a0
#define ASIZ_task_user 0x00000008
-#define AOFF_task_rlim 0x00000290
+#define AOFF_task_rlim 0x000002a8
#define ASIZ_task_rlim 0x000000a0
-#define AOFF_task_used_math 0x00000330
+#define AOFF_task_used_math 0x00000348
#define ASIZ_task_used_math 0x00000002
-#define AOFF_task_comm 0x00000332
+#define AOFF_task_comm 0x0000034a
#define ASIZ_task_comm 0x00000010
-#define AOFF_task_link_count 0x00000344
+#define AOFF_task_link_count 0x0000035c
#define ASIZ_task_link_count 0x00000004
-#define AOFF_task_tty 0x00000348
+#define AOFF_task_tty 0x00000360
#define ASIZ_task_tty 0x00000008
-#define AOFF_task_semundo 0x00000350
+#define AOFF_task_semundo 0x00000368
#define ASIZ_task_semundo 0x00000008
-#define AOFF_task_semsleeping 0x00000358
+#define AOFF_task_semsleeping 0x00000370
#define ASIZ_task_semsleeping 0x00000008
-#define AOFF_task_tss 0x00000360
-#define ASIZ_task_tss 0x00000470
-#define AOFF_task_fs 0x000007d0
+#define AOFF_task_tss 0x00000380
+#define ASIZ_task_tss 0x00000460
+#define AOFF_task_fs 0x000007e0
#define ASIZ_task_fs 0x00000008
-#define AOFF_task_files 0x000007d8
+#define AOFF_task_files 0x000007e8
#define ASIZ_task_files 0x00000008
-#define AOFF_task_mm 0x000007e0
+#define AOFF_task_mm 0x000007f0
#define ASIZ_task_mm 0x00000008
-#define AOFF_task_sigmask_lock 0x000007e8
+#define AOFF_task_sigmask_lock 0x000007f8
#define ASIZ_task_sigmask_lock 0x00000001
-#define AOFF_task_sig 0x000007f0
+#define AOFF_task_sig 0x00000800
#define ASIZ_task_sig 0x00000008
-#define AOFF_task_signal 0x000007f8
+#define AOFF_task_signal 0x00000808
#define ASIZ_task_signal 0x00000008
-#define AOFF_task_blocked 0x00000800
+#define AOFF_task_blocked 0x00000810
#define ASIZ_task_blocked 0x00000008
-#define AOFF_task_sigqueue 0x00000808
+#define AOFF_task_sigqueue 0x00000818
#define ASIZ_task_sigqueue 0x00000008
-#define AOFF_task_sigqueue_tail 0x00000810
+#define AOFF_task_sigqueue_tail 0x00000820
#define ASIZ_task_sigqueue_tail 0x00000008
-#define AOFF_task_sas_ss_sp 0x00000818
+#define AOFF_task_sas_ss_sp 0x00000828
#define ASIZ_task_sas_ss_sp 0x00000008
-#define AOFF_task_sas_ss_size 0x00000820
+#define AOFF_task_sas_ss_size 0x00000830
#define ASIZ_task_sas_ss_size 0x00000008
-#define ASIZ_task 0x00000830
+#define ASIZ_task 0x00000840
#define AOFF_mm_mmap 0x00000000
#define ASIZ_mm_mmap 0x00000008
#define AOFF_mm_mmap_avl 0x00000008
@@ -196,48 +196,48 @@
#define AOFF_mm_map_count 0x00000024
#define ASIZ_mm_map_count 0x00000004
#define AOFF_mm_mmap_sem 0x00000028
-#define ASIZ_mm_mmap_sem 0x00000010
-#define AOFF_mm_context 0x00000038
+#define ASIZ_mm_mmap_sem 0x00000038
+#define AOFF_mm_context 0x00000060
#define ASIZ_mm_context 0x00000008
-#define AOFF_mm_start_code 0x00000040
+#define AOFF_mm_start_code 0x00000068
#define ASIZ_mm_start_code 0x00000008
-#define AOFF_mm_end_code 0x00000048
+#define AOFF_mm_end_code 0x00000070
#define ASIZ_mm_end_code 0x00000008
-#define AOFF_mm_start_data 0x00000050
+#define AOFF_mm_start_data 0x00000078
#define ASIZ_mm_start_data 0x00000008
-#define AOFF_mm_end_data 0x00000058
+#define AOFF_mm_end_data 0x00000080
#define ASIZ_mm_end_data 0x00000008
-#define AOFF_mm_start_brk 0x00000060
+#define AOFF_mm_start_brk 0x00000088
#define ASIZ_mm_start_brk 0x00000008
-#define AOFF_mm_brk 0x00000068
+#define AOFF_mm_brk 0x00000090
#define ASIZ_mm_brk 0x00000008
-#define AOFF_mm_start_stack 0x00000070
+#define AOFF_mm_start_stack 0x00000098
#define ASIZ_mm_start_stack 0x00000008
-#define AOFF_mm_arg_start 0x00000078
+#define AOFF_mm_arg_start 0x000000a0
#define ASIZ_mm_arg_start 0x00000008
-#define AOFF_mm_arg_end 0x00000080
+#define AOFF_mm_arg_end 0x000000a8
#define ASIZ_mm_arg_end 0x00000008
-#define AOFF_mm_env_start 0x00000088
+#define AOFF_mm_env_start 0x000000b0
#define ASIZ_mm_env_start 0x00000008
-#define AOFF_mm_env_end 0x00000090
+#define AOFF_mm_env_end 0x000000b8
#define ASIZ_mm_env_end 0x00000008
-#define AOFF_mm_rss 0x00000098
+#define AOFF_mm_rss 0x000000c0
#define ASIZ_mm_rss 0x00000008
-#define AOFF_mm_total_vm 0x000000a0
+#define AOFF_mm_total_vm 0x000000c8
#define ASIZ_mm_total_vm 0x00000008
-#define AOFF_mm_locked_vm 0x000000a8
+#define AOFF_mm_locked_vm 0x000000d0
#define ASIZ_mm_locked_vm 0x00000008
-#define AOFF_mm_def_flags 0x000000b0
+#define AOFF_mm_def_flags 0x000000d8
#define ASIZ_mm_def_flags 0x00000008
-#define AOFF_mm_cpu_vm_mask 0x000000b8
+#define AOFF_mm_cpu_vm_mask 0x000000e0
#define ASIZ_mm_cpu_vm_mask 0x00000008
-#define AOFF_mm_swap_cnt 0x000000c0
+#define AOFF_mm_swap_cnt 0x000000e8
#define ASIZ_mm_swap_cnt 0x00000008
-#define AOFF_mm_swap_address 0x000000c8
+#define AOFF_mm_swap_address 0x000000f0
#define ASIZ_mm_swap_address 0x00000008
-#define AOFF_mm_segments 0x000000d0
+#define AOFF_mm_segments 0x000000f8
#define ASIZ_mm_segments 0x00000008
-#define ASIZ_mm 0x000000d8
+#define ASIZ_mm 0x00000100
#define AOFF_thread_ksp 0x00000000
#define ASIZ_thread_ksp 0x00000008
#define AOFF_thread_wstate 0x00000008
@@ -246,47 +246,45 @@
#define ASIZ_thread_cwp 0x00000002
#define AOFF_thread_flags 0x0000000c
#define ASIZ_thread_flags 0x00000002
-#define AOFF_thread_ctx 0x0000000e
-#define ASIZ_thread_ctx 0x00000002
+#define AOFF_thread_current_ds 0x0000000e
+#define ASIZ_thread_current_ds 0x00000001
#define AOFF_thread_w_saved 0x00000010
#define ASIZ_thread_w_saved 0x00000002
#define AOFF_thread_new_signal 0x00000012
#define ASIZ_thread_new_signal 0x00000002
-#define AOFF_thread____pad 0x00000014
-#define ASIZ_thread____pad 0x00000004
-#define AOFF_thread_current_ds 0x00000018
-#define ASIZ_thread_current_ds 0x00000008
-#define AOFF_thread_kregs 0x00000020
+#define AOFF_thread_ctx 0x00000014
+#define ASIZ_thread_ctx 0x00000002
+#define AOFF_thread_kregs 0x00000018
#define ASIZ_thread_kregs 0x00000008
-#define AOFF_thread_utraps 0x00000028
+#define AOFF_thread_utraps 0x00000020
#define ASIZ_thread_utraps 0x00000008
-#define AOFF_thread_reg_window 0x00000030
+#define AOFF_thread_fpdepth 0x00000028
+#define ASIZ_thread_fpdepth 0x00000001
+#define AOFF_thread_fpsaved 0x00000029
+#define ASIZ_thread_fpsaved 0x00000007
+#define AOFF_thread_gsr 0x00000030
+#define ASIZ_thread_gsr 0x00000007
+#define AOFF_thread_xfsr 0x00000038
+#define ASIZ_thread_xfsr 0x00000038
+#define AOFF_thread_reg_window 0x00000070
#define ASIZ_thread_reg_window 0x00000380
-#define AOFF_thread_rwbuf_stkptrs 0x000003b0
+#define AOFF_thread_rwbuf_stkptrs 0x000003f0
#define ASIZ_thread_rwbuf_stkptrs 0x00000038
-#define AOFF_thread_sig_address 0x000003e8
+#define AOFF_thread_sig_address 0x00000428
#define ASIZ_thread_sig_address 0x00000008
-#define AOFF_thread_sig_desc 0x000003f0
+#define AOFF_thread_sig_desc 0x00000430
#define ASIZ_thread_sig_desc 0x00000008
-#define AOFF_thread_user_cntd0 0x000003f8
+#define AOFF_thread_user_cntd0 0x00000438
#define ASIZ_thread_user_cntd0 0x00000008
-#define AOFF_thread_user_cntd1 0x00000400
+#define AOFF_thread_user_cntd1 0x00000440
#define ASIZ_thread_user_cntd1 0x00000008
-#define AOFF_thread_kernel_cntd0 0x00000408
+#define AOFF_thread_kernel_cntd0 0x00000448
#define ASIZ_thread_kernel_cntd0 0x00000008
-#define AOFF_thread_kernel_cntd1 0x00000410
+#define AOFF_thread_kernel_cntd1 0x00000450
#define ASIZ_thread_kernel_cntd1 0x00000008
-#define AOFF_thread_pcr_reg 0x00000418
+#define AOFF_thread_pcr_reg 0x00000458
#define ASIZ_thread_pcr_reg 0x00000008
-#define AOFF_thread_fpdepth 0x00000420
-#define ASIZ_thread_fpdepth 0x00000001
-#define AOFF_thread_fpsaved 0x00000421
-#define ASIZ_thread_fpsaved 0x00000007
-#define AOFF_thread_gsr 0x00000428
-#define ASIZ_thread_gsr 0x00000007
-#define AOFF_thread_xfsr 0x00000430
-#define ASIZ_thread_xfsr 0x00000038
-#define ASIZ_thread 0x00000470
+#define ASIZ_thread 0x00000460
#else /* CONFIG_SMP */
@@ -298,177 +296,177 @@
#define ASIZ_task_flags 0x00000008
#define AOFF_task_sigpending 0x00000010
#define ASIZ_task_sigpending 0x00000004
-#define AOFF_task_addr_limit 0x00000018
-#define ASIZ_task_addr_limit 0x00000008
-#define AOFF_task_exec_domain 0x00000020
+#define AOFF_task_addr_limit 0x00000014
+#define ASIZ_task_addr_limit 0x00000001
+#define AOFF_task_exec_domain 0x00000018
#define ASIZ_task_exec_domain 0x00000008
-#define AOFF_task_need_resched 0x00000028
+#define AOFF_task_need_resched 0x00000020
#define ASIZ_task_need_resched 0x00000008
-#define AOFF_task_counter 0x00000030
+#define AOFF_task_counter 0x00000028
#define ASIZ_task_counter 0x00000008
-#define AOFF_task_priority 0x00000038
+#define AOFF_task_priority 0x00000030
#define ASIZ_task_priority 0x00000008
-#define AOFF_task_avg_slice 0x00000040
+#define AOFF_task_avg_slice 0x00000038
#define ASIZ_task_avg_slice 0x00000008
-#define AOFF_task_has_cpu 0x00000048
+#define AOFF_task_has_cpu 0x00000040
#define ASIZ_task_has_cpu 0x00000004
-#define AOFF_task_processor 0x0000004c
+#define AOFF_task_processor 0x00000044
#define ASIZ_task_processor 0x00000004
-#define AOFF_task_last_processor 0x00000050
+#define AOFF_task_last_processor 0x00000048
#define ASIZ_task_last_processor 0x00000004
-#define AOFF_task_lock_depth 0x00000054
+#define AOFF_task_lock_depth 0x0000004c
#define ASIZ_task_lock_depth 0x00000004
-#define AOFF_task_next_task 0x00000058
+#define AOFF_task_next_task 0x00000050
#define ASIZ_task_next_task 0x00000008
-#define AOFF_task_prev_task 0x00000060
+#define AOFF_task_prev_task 0x00000058
#define ASIZ_task_prev_task 0x00000008
-#define AOFF_task_next_run 0x00000068
+#define AOFF_task_next_run 0x00000060
#define ASIZ_task_next_run 0x00000008
-#define AOFF_task_prev_run 0x00000070
+#define AOFF_task_prev_run 0x00000068
#define ASIZ_task_prev_run 0x00000008
-#define AOFF_task_binfmt 0x00000078
+#define AOFF_task_binfmt 0x00000070
#define ASIZ_task_binfmt 0x00000008
-#define AOFF_task_exit_code 0x00000080
+#define AOFF_task_exit_code 0x00000078
#define ASIZ_task_exit_code 0x00000004
-#define AOFF_task_exit_signal 0x00000084
+#define AOFF_task_exit_signal 0x0000007c
#define ASIZ_task_exit_signal 0x00000004
-#define AOFF_task_pdeath_signal 0x00000088
+#define AOFF_task_pdeath_signal 0x00000080
#define ASIZ_task_pdeath_signal 0x00000004
-#define AOFF_task_personality 0x00000090
+#define AOFF_task_personality 0x00000088
#define ASIZ_task_personality 0x00000008
-#define AOFF_task_pid 0x0000009c
+#define AOFF_task_pid 0x00000094
#define ASIZ_task_pid 0x00000004
-#define AOFF_task_pgrp 0x000000a0
+#define AOFF_task_pgrp 0x00000098
#define ASIZ_task_pgrp 0x00000004
-#define AOFF_task_tty_old_pgrp 0x000000a4
+#define AOFF_task_tty_old_pgrp 0x0000009c
#define ASIZ_task_tty_old_pgrp 0x00000004
-#define AOFF_task_session 0x000000a8
+#define AOFF_task_session 0x000000a0
#define ASIZ_task_session 0x00000004
-#define AOFF_task_leader 0x000000ac
+#define AOFF_task_leader 0x000000a4
#define ASIZ_task_leader 0x00000004
-#define AOFF_task_p_opptr 0x000000b0
+#define AOFF_task_p_opptr 0x000000a8
#define ASIZ_task_p_opptr 0x00000008
-#define AOFF_task_p_pptr 0x000000b8
+#define AOFF_task_p_pptr 0x000000b0
#define ASIZ_task_p_pptr 0x00000008
-#define AOFF_task_p_cptr 0x000000c0
+#define AOFF_task_p_cptr 0x000000b8
#define ASIZ_task_p_cptr 0x00000008
-#define AOFF_task_p_ysptr 0x000000c8
+#define AOFF_task_p_ysptr 0x000000c0
#define ASIZ_task_p_ysptr 0x00000008
-#define AOFF_task_p_osptr 0x000000d0
+#define AOFF_task_p_osptr 0x000000c8
#define ASIZ_task_p_osptr 0x00000008
-#define AOFF_task_pidhash_next 0x000000d8
+#define AOFF_task_pidhash_next 0x000000d0
#define ASIZ_task_pidhash_next 0x00000008
-#define AOFF_task_pidhash_pprev 0x000000e0
+#define AOFF_task_pidhash_pprev 0x000000d8
#define ASIZ_task_pidhash_pprev 0x00000008
-#define AOFF_task_tarray_ptr 0x000000e8
+#define AOFF_task_tarray_ptr 0x000000e0
#define ASIZ_task_tarray_ptr 0x00000008
-#define AOFF_task_wait_chldexit 0x000000f0
-#define ASIZ_task_wait_chldexit 0x00000008
-#define AOFF_task_vfork_sem 0x000000f8
+#define AOFF_task_wait_chldexit 0x000000e8
+#define ASIZ_task_wait_chldexit 0x00000028
+#define AOFF_task_vfork_sem 0x00000110
#define ASIZ_task_vfork_sem 0x00000008
-#define AOFF_task_policy 0x00000100
+#define AOFF_task_policy 0x00000118
#define ASIZ_task_policy 0x00000008
-#define AOFF_task_rt_priority 0x00000108
+#define AOFF_task_rt_priority 0x00000120
#define ASIZ_task_rt_priority 0x00000008
-#define AOFF_task_it_real_value 0x00000110
+#define AOFF_task_it_real_value 0x00000128
#define ASIZ_task_it_real_value 0x00000008
-#define AOFF_task_it_prof_value 0x00000118
+#define AOFF_task_it_prof_value 0x00000130
#define ASIZ_task_it_prof_value 0x00000008
-#define AOFF_task_it_virt_value 0x00000120
+#define AOFF_task_it_virt_value 0x00000138
#define ASIZ_task_it_virt_value 0x00000008
-#define AOFF_task_it_real_incr 0x00000128
+#define AOFF_task_it_real_incr 0x00000140
#define ASIZ_task_it_real_incr 0x00000008
-#define AOFF_task_it_prof_incr 0x00000130
+#define AOFF_task_it_prof_incr 0x00000148
#define ASIZ_task_it_prof_incr 0x00000008
-#define AOFF_task_it_virt_incr 0x00000138
+#define AOFF_task_it_virt_incr 0x00000150
#define ASIZ_task_it_virt_incr 0x00000008
-#define AOFF_task_real_timer 0x00000140
+#define AOFF_task_real_timer 0x00000158
#define ASIZ_task_real_timer 0x00000028
-#define AOFF_task_times 0x00000168
+#define AOFF_task_times 0x00000180
#define ASIZ_task_times 0x00000020
-#define AOFF_task_start_time 0x00000188
+#define AOFF_task_start_time 0x000001a0
#define ASIZ_task_start_time 0x00000008
-#define AOFF_task_per_cpu_utime 0x00000190
+#define AOFF_task_per_cpu_utime 0x000001a8
#define ASIZ_task_per_cpu_utime 0x00000100
-#define AOFF_task_min_flt 0x00000390
+#define AOFF_task_min_flt 0x000003a8
#define ASIZ_task_min_flt 0x00000008
-#define AOFF_task_maj_flt 0x00000398
+#define AOFF_task_maj_flt 0x000003b0
#define ASIZ_task_maj_flt 0x00000008
-#define AOFF_task_nswap 0x000003a0
+#define AOFF_task_nswap 0x000003b8
#define ASIZ_task_nswap 0x00000008
-#define AOFF_task_cmin_flt 0x000003a8
+#define AOFF_task_cmin_flt 0x000003c0
#define ASIZ_task_cmin_flt 0x00000008
-#define AOFF_task_cmaj_flt 0x000003b0
+#define AOFF_task_cmaj_flt 0x000003c8
#define ASIZ_task_cmaj_flt 0x00000008
-#define AOFF_task_cnswap 0x000003b8
+#define AOFF_task_cnswap 0x000003d0
#define ASIZ_task_cnswap 0x00000008
-#define AOFF_task_uid 0x000003c4
+#define AOFF_task_uid 0x000003dc
#define ASIZ_task_uid 0x00000004
-#define AOFF_task_euid 0x000003c8
+#define AOFF_task_euid 0x000003e0
#define ASIZ_task_euid 0x00000004
-#define AOFF_task_suid 0x000003cc
+#define AOFF_task_suid 0x000003e4
#define ASIZ_task_suid 0x00000004
-#define AOFF_task_fsuid 0x000003d0
+#define AOFF_task_fsuid 0x000003e8
#define ASIZ_task_fsuid 0x00000004
-#define AOFF_task_gid 0x000003d4
+#define AOFF_task_gid 0x000003ec
#define ASIZ_task_gid 0x00000004
-#define AOFF_task_egid 0x000003d8
+#define AOFF_task_egid 0x000003f0
#define ASIZ_task_egid 0x00000004
-#define AOFF_task_sgid 0x000003dc
+#define AOFF_task_sgid 0x000003f4
#define ASIZ_task_sgid 0x00000004
-#define AOFF_task_fsgid 0x000003e0
+#define AOFF_task_fsgid 0x000003f8
#define ASIZ_task_fsgid 0x00000004
-#define AOFF_task_ngroups 0x000003e4
+#define AOFF_task_ngroups 0x000003fc
#define ASIZ_task_ngroups 0x00000004
-#define AOFF_task_groups 0x000003e8
+#define AOFF_task_groups 0x00000400
#define ASIZ_task_groups 0x00000080
-#define AOFF_task_cap_effective 0x00000468
+#define AOFF_task_cap_effective 0x00000480
#define ASIZ_task_cap_effective 0x00000004
-#define AOFF_task_cap_inheritable 0x0000046c
+#define AOFF_task_cap_inheritable 0x00000484
#define ASIZ_task_cap_inheritable 0x00000004
-#define AOFF_task_cap_permitted 0x00000470
+#define AOFF_task_cap_permitted 0x00000488
#define ASIZ_task_cap_permitted 0x00000004
-#define AOFF_task_user 0x00000478
+#define AOFF_task_user 0x00000490
#define ASIZ_task_user 0x00000008
-#define AOFF_task_rlim 0x00000480
+#define AOFF_task_rlim 0x00000498
#define ASIZ_task_rlim 0x000000a0
-#define AOFF_task_used_math 0x00000520
+#define AOFF_task_used_math 0x00000538
#define ASIZ_task_used_math 0x00000002
-#define AOFF_task_comm 0x00000522
+#define AOFF_task_comm 0x0000053a
#define ASIZ_task_comm 0x00000010
-#define AOFF_task_link_count 0x00000534
+#define AOFF_task_link_count 0x0000054c
#define ASIZ_task_link_count 0x00000004
-#define AOFF_task_tty 0x00000538
+#define AOFF_task_tty 0x00000550
#define ASIZ_task_tty 0x00000008
-#define AOFF_task_semundo 0x00000540
+#define AOFF_task_semundo 0x00000558
#define ASIZ_task_semundo 0x00000008
-#define AOFF_task_semsleeping 0x00000548
+#define AOFF_task_semsleeping 0x00000560
#define ASIZ_task_semsleeping 0x00000008
-#define AOFF_task_tss 0x00000550
-#define ASIZ_task_tss 0x00000470
-#define AOFF_task_fs 0x000009c0
+#define AOFF_task_tss 0x00000570
+#define ASIZ_task_tss 0x00000460
+#define AOFF_task_fs 0x000009d0
#define ASIZ_task_fs 0x00000008
-#define AOFF_task_files 0x000009c8
+#define AOFF_task_files 0x000009d8
#define ASIZ_task_files 0x00000008
-#define AOFF_task_mm 0x000009d0
+#define AOFF_task_mm 0x000009e0
#define ASIZ_task_mm 0x00000008
-#define AOFF_task_sigmask_lock 0x000009d8
+#define AOFF_task_sigmask_lock 0x000009e8
#define ASIZ_task_sigmask_lock 0x00000001
-#define AOFF_task_sig 0x000009e0
+#define AOFF_task_sig 0x000009f0
#define ASIZ_task_sig 0x00000008
-#define AOFF_task_signal 0x000009e8
+#define AOFF_task_signal 0x000009f8
#define ASIZ_task_signal 0x00000008
-#define AOFF_task_blocked 0x000009f0
+#define AOFF_task_blocked 0x00000a00
#define ASIZ_task_blocked 0x00000008
-#define AOFF_task_sigqueue 0x000009f8
+#define AOFF_task_sigqueue 0x00000a08
#define ASIZ_task_sigqueue 0x00000008
-#define AOFF_task_sigqueue_tail 0x00000a00
+#define AOFF_task_sigqueue_tail 0x00000a10
#define ASIZ_task_sigqueue_tail 0x00000008
-#define AOFF_task_sas_ss_sp 0x00000a08
+#define AOFF_task_sas_ss_sp 0x00000a18
#define ASIZ_task_sas_ss_sp 0x00000008
-#define AOFF_task_sas_ss_size 0x00000a10
+#define AOFF_task_sas_ss_size 0x00000a20
#define ASIZ_task_sas_ss_size 0x00000008
-#define ASIZ_task 0x00000a20
+#define ASIZ_task 0x00000a30
#define AOFF_mm_mmap 0x00000000
#define ASIZ_mm_mmap 0x00000008
#define AOFF_mm_mmap_avl 0x00000008
@@ -482,48 +480,48 @@
#define AOFF_mm_map_count 0x00000024
#define ASIZ_mm_map_count 0x00000004
#define AOFF_mm_mmap_sem 0x00000028
-#define ASIZ_mm_mmap_sem 0x00000010
-#define AOFF_mm_context 0x00000038
+#define ASIZ_mm_mmap_sem 0x00000038
+#define AOFF_mm_context 0x00000060
#define ASIZ_mm_context 0x00000008
-#define AOFF_mm_start_code 0x00000040
+#define AOFF_mm_start_code 0x00000068
#define ASIZ_mm_start_code 0x00000008
-#define AOFF_mm_end_code 0x00000048
+#define AOFF_mm_end_code 0x00000070
#define ASIZ_mm_end_code 0x00000008
-#define AOFF_mm_start_data 0x00000050
+#define AOFF_mm_start_data 0x00000078
#define ASIZ_mm_start_data 0x00000008
-#define AOFF_mm_end_data 0x00000058
+#define AOFF_mm_end_data 0x00000080
#define ASIZ_mm_end_data 0x00000008
-#define AOFF_mm_start_brk 0x00000060
+#define AOFF_mm_start_brk 0x00000088
#define ASIZ_mm_start_brk 0x00000008
-#define AOFF_mm_brk 0x00000068
+#define AOFF_mm_brk 0x00000090
#define ASIZ_mm_brk 0x00000008
-#define AOFF_mm_start_stack 0x00000070
+#define AOFF_mm_start_stack 0x00000098
#define ASIZ_mm_start_stack 0x00000008
-#define AOFF_mm_arg_start 0x00000078
+#define AOFF_mm_arg_start 0x000000a0
#define ASIZ_mm_arg_start 0x00000008
-#define AOFF_mm_arg_end 0x00000080
+#define AOFF_mm_arg_end 0x000000a8
#define ASIZ_mm_arg_end 0x00000008
-#define AOFF_mm_env_start 0x00000088
+#define AOFF_mm_env_start 0x000000b0
#define ASIZ_mm_env_start 0x00000008
-#define AOFF_mm_env_end 0x00000090
+#define AOFF_mm_env_end 0x000000b8
#define ASIZ_mm_env_end 0x00000008
-#define AOFF_mm_rss 0x00000098
+#define AOFF_mm_rss 0x000000c0
#define ASIZ_mm_rss 0x00000008
-#define AOFF_mm_total_vm 0x000000a0
+#define AOFF_mm_total_vm 0x000000c8
#define ASIZ_mm_total_vm 0x00000008
-#define AOFF_mm_locked_vm 0x000000a8
+#define AOFF_mm_locked_vm 0x000000d0
#define ASIZ_mm_locked_vm 0x00000008
-#define AOFF_mm_def_flags 0x000000b0
+#define AOFF_mm_def_flags 0x000000d8
#define ASIZ_mm_def_flags 0x00000008
-#define AOFF_mm_cpu_vm_mask 0x000000b8
+#define AOFF_mm_cpu_vm_mask 0x000000e0
#define ASIZ_mm_cpu_vm_mask 0x00000008
-#define AOFF_mm_swap_cnt 0x000000c0
+#define AOFF_mm_swap_cnt 0x000000e8
#define ASIZ_mm_swap_cnt 0x00000008
-#define AOFF_mm_swap_address 0x000000c8
+#define AOFF_mm_swap_address 0x000000f0
#define ASIZ_mm_swap_address 0x00000008
-#define AOFF_mm_segments 0x000000d0
+#define AOFF_mm_segments 0x000000f8
#define ASIZ_mm_segments 0x00000008
-#define ASIZ_mm 0x000000d8
+#define ASIZ_mm 0x00000100
#define AOFF_thread_ksp 0x00000000
#define ASIZ_thread_ksp 0x00000008
#define AOFF_thread_wstate 0x00000008
@@ -532,47 +530,45 @@
#define ASIZ_thread_cwp 0x00000002
#define AOFF_thread_flags 0x0000000c
#define ASIZ_thread_flags 0x00000002
-#define AOFF_thread_ctx 0x0000000e
-#define ASIZ_thread_ctx 0x00000002
+#define AOFF_thread_current_ds 0x0000000e
+#define ASIZ_thread_current_ds 0x00000001
#define AOFF_thread_w_saved 0x00000010
#define ASIZ_thread_w_saved 0x00000002
#define AOFF_thread_new_signal 0x00000012
#define ASIZ_thread_new_signal 0x00000002
-#define AOFF_thread____pad 0x00000014
-#define ASIZ_thread____pad 0x00000004
-#define AOFF_thread_current_ds 0x00000018
-#define ASIZ_thread_current_ds 0x00000008
-#define AOFF_thread_kregs 0x00000020
+#define AOFF_thread_ctx 0x00000014
+#define ASIZ_thread_ctx 0x00000002
+#define AOFF_thread_kregs 0x00000018
#define ASIZ_thread_kregs 0x00000008
-#define AOFF_thread_utraps 0x00000028
+#define AOFF_thread_utraps 0x00000020
#define ASIZ_thread_utraps 0x00000008
-#define AOFF_thread_reg_window 0x00000030
+#define AOFF_thread_fpdepth 0x00000028
+#define ASIZ_thread_fpdepth 0x00000001
+#define AOFF_thread_fpsaved 0x00000029
+#define ASIZ_thread_fpsaved 0x00000007
+#define AOFF_thread_gsr 0x00000030
+#define ASIZ_thread_gsr 0x00000007
+#define AOFF_thread_xfsr 0x00000038
+#define ASIZ_thread_xfsr 0x00000038
+#define AOFF_thread_reg_window 0x00000070
#define ASIZ_thread_reg_window 0x00000380
-#define AOFF_thread_rwbuf_stkptrs 0x000003b0
+#define AOFF_thread_rwbuf_stkptrs 0x000003f0
#define ASIZ_thread_rwbuf_stkptrs 0x00000038
-#define AOFF_thread_sig_address 0x000003e8
+#define AOFF_thread_sig_address 0x00000428
#define ASIZ_thread_sig_address 0x00000008
-#define AOFF_thread_sig_desc 0x000003f0
+#define AOFF_thread_sig_desc 0x00000430
#define ASIZ_thread_sig_desc 0x00000008
-#define AOFF_thread_user_cntd0 0x000003f8
+#define AOFF_thread_user_cntd0 0x00000438
#define ASIZ_thread_user_cntd0 0x00000008
-#define AOFF_thread_user_cntd1 0x00000400
+#define AOFF_thread_user_cntd1 0x00000440
#define ASIZ_thread_user_cntd1 0x00000008
-#define AOFF_thread_kernel_cntd0 0x00000408
+#define AOFF_thread_kernel_cntd0 0x00000448
#define ASIZ_thread_kernel_cntd0 0x00000008
-#define AOFF_thread_kernel_cntd1 0x00000410
+#define AOFF_thread_kernel_cntd1 0x00000450
#define ASIZ_thread_kernel_cntd1 0x00000008
-#define AOFF_thread_pcr_reg 0x00000418
+#define AOFF_thread_pcr_reg 0x00000458
#define ASIZ_thread_pcr_reg 0x00000008
-#define AOFF_thread_fpdepth 0x00000420
-#define ASIZ_thread_fpdepth 0x00000001
-#define AOFF_thread_fpsaved 0x00000421
-#define ASIZ_thread_fpsaved 0x00000007
-#define AOFF_thread_gsr 0x00000428
-#define ASIZ_thread_gsr 0x00000007
-#define AOFF_thread_xfsr 0x00000430
-#define ASIZ_thread_xfsr 0x00000038
-#define ASIZ_thread 0x00000470
+#define ASIZ_thread 0x00000460
#else /* SPIN_LOCK_DEBUG */
@@ -582,177 +578,177 @@
#define ASIZ_task_flags 0x00000008
#define AOFF_task_sigpending 0x00000010
#define ASIZ_task_sigpending 0x00000004
-#define AOFF_task_addr_limit 0x00000018
-#define ASIZ_task_addr_limit 0x00000008
-#define AOFF_task_exec_domain 0x00000020
+#define AOFF_task_addr_limit 0x00000014
+#define ASIZ_task_addr_limit 0x00000001
+#define AOFF_task_exec_domain 0x00000018
#define ASIZ_task_exec_domain 0x00000008
-#define AOFF_task_need_resched 0x00000028
+#define AOFF_task_need_resched 0x00000020
#define ASIZ_task_need_resched 0x00000008
-#define AOFF_task_counter 0x00000030
+#define AOFF_task_counter 0x00000028
#define ASIZ_task_counter 0x00000008
-#define AOFF_task_priority 0x00000038
+#define AOFF_task_priority 0x00000030
#define ASIZ_task_priority 0x00000008
-#define AOFF_task_avg_slice 0x00000040
+#define AOFF_task_avg_slice 0x00000038
#define ASIZ_task_avg_slice 0x00000008
-#define AOFF_task_has_cpu 0x00000048
+#define AOFF_task_has_cpu 0x00000040
#define ASIZ_task_has_cpu 0x00000004
-#define AOFF_task_processor 0x0000004c
+#define AOFF_task_processor 0x00000044
#define ASIZ_task_processor 0x00000004
-#define AOFF_task_last_processor 0x00000050
+#define AOFF_task_last_processor 0x00000048
#define ASIZ_task_last_processor 0x00000004
-#define AOFF_task_lock_depth 0x00000054
+#define AOFF_task_lock_depth 0x0000004c
#define ASIZ_task_lock_depth 0x00000004
-#define AOFF_task_next_task 0x00000058
+#define AOFF_task_next_task 0x00000050
#define ASIZ_task_next_task 0x00000008
-#define AOFF_task_prev_task 0x00000060
+#define AOFF_task_prev_task 0x00000058
#define ASIZ_task_prev_task 0x00000008
-#define AOFF_task_next_run 0x00000068
+#define AOFF_task_next_run 0x00000060
#define ASIZ_task_next_run 0x00000008
-#define AOFF_task_prev_run 0x00000070
+#define AOFF_task_prev_run 0x00000068
#define ASIZ_task_prev_run 0x00000008
-#define AOFF_task_binfmt 0x00000078
+#define AOFF_task_binfmt 0x00000070
#define ASIZ_task_binfmt 0x00000008
-#define AOFF_task_exit_code 0x00000080
+#define AOFF_task_exit_code 0x00000078
#define ASIZ_task_exit_code 0x00000004
-#define AOFF_task_exit_signal 0x00000084
+#define AOFF_task_exit_signal 0x0000007c
#define ASIZ_task_exit_signal 0x00000004
-#define AOFF_task_pdeath_signal 0x00000088
+#define AOFF_task_pdeath_signal 0x00000080
#define ASIZ_task_pdeath_signal 0x00000004
-#define AOFF_task_personality 0x00000090
+#define AOFF_task_personality 0x00000088
#define ASIZ_task_personality 0x00000008
-#define AOFF_task_pid 0x0000009c
+#define AOFF_task_pid 0x00000094
#define ASIZ_task_pid 0x00000004
-#define AOFF_task_pgrp 0x000000a0
+#define AOFF_task_pgrp 0x00000098
#define ASIZ_task_pgrp 0x00000004
-#define AOFF_task_tty_old_pgrp 0x000000a4
+#define AOFF_task_tty_old_pgrp 0x0000009c
#define ASIZ_task_tty_old_pgrp 0x00000004
-#define AOFF_task_session 0x000000a8
+#define AOFF_task_session 0x000000a0
#define ASIZ_task_session 0x00000004
-#define AOFF_task_leader 0x000000ac
+#define AOFF_task_leader 0x000000a4
#define ASIZ_task_leader 0x00000004
-#define AOFF_task_p_opptr 0x000000b0
+#define AOFF_task_p_opptr 0x000000a8
#define ASIZ_task_p_opptr 0x00000008
-#define AOFF_task_p_pptr 0x000000b8
+#define AOFF_task_p_pptr 0x000000b0
#define ASIZ_task_p_pptr 0x00000008
-#define AOFF_task_p_cptr 0x000000c0
+#define AOFF_task_p_cptr 0x000000b8
#define ASIZ_task_p_cptr 0x00000008
-#define AOFF_task_p_ysptr 0x000000c8
+#define AOFF_task_p_ysptr 0x000000c0
#define ASIZ_task_p_ysptr 0x00000008
-#define AOFF_task_p_osptr 0x000000d0
+#define AOFF_task_p_osptr 0x000000c8
#define ASIZ_task_p_osptr 0x00000008
-#define AOFF_task_pidhash_next 0x000000d8
+#define AOFF_task_pidhash_next 0x000000d0
#define ASIZ_task_pidhash_next 0x00000008
-#define AOFF_task_pidhash_pprev 0x000000e0
+#define AOFF_task_pidhash_pprev 0x000000d8
#define ASIZ_task_pidhash_pprev 0x00000008
-#define AOFF_task_tarray_ptr 0x000000e8
+#define AOFF_task_tarray_ptr 0x000000e0
#define ASIZ_task_tarray_ptr 0x00000008
-#define AOFF_task_wait_chldexit 0x000000f0
-#define ASIZ_task_wait_chldexit 0x00000008
-#define AOFF_task_vfork_sem 0x000000f8
+#define AOFF_task_wait_chldexit 0x000000e8
+#define ASIZ_task_wait_chldexit 0x00000030
+#define AOFF_task_vfork_sem 0x00000118
#define ASIZ_task_vfork_sem 0x00000008
-#define AOFF_task_policy 0x00000100
+#define AOFF_task_policy 0x00000120
#define ASIZ_task_policy 0x00000008
-#define AOFF_task_rt_priority 0x00000108
+#define AOFF_task_rt_priority 0x00000128
#define ASIZ_task_rt_priority 0x00000008
-#define AOFF_task_it_real_value 0x00000110
+#define AOFF_task_it_real_value 0x00000130
#define ASIZ_task_it_real_value 0x00000008
-#define AOFF_task_it_prof_value 0x00000118
+#define AOFF_task_it_prof_value 0x00000138
#define ASIZ_task_it_prof_value 0x00000008
-#define AOFF_task_it_virt_value 0x00000120
+#define AOFF_task_it_virt_value 0x00000140
#define ASIZ_task_it_virt_value 0x00000008
-#define AOFF_task_it_real_incr 0x00000128
+#define AOFF_task_it_real_incr 0x00000148
#define ASIZ_task_it_real_incr 0x00000008
-#define AOFF_task_it_prof_incr 0x00000130
+#define AOFF_task_it_prof_incr 0x00000150
#define ASIZ_task_it_prof_incr 0x00000008
-#define AOFF_task_it_virt_incr 0x00000138
+#define AOFF_task_it_virt_incr 0x00000158
#define ASIZ_task_it_virt_incr 0x00000008
-#define AOFF_task_real_timer 0x00000140
+#define AOFF_task_real_timer 0x00000160
#define ASIZ_task_real_timer 0x00000028
-#define AOFF_task_times 0x00000168
+#define AOFF_task_times 0x00000188
#define ASIZ_task_times 0x00000020
-#define AOFF_task_start_time 0x00000188
+#define AOFF_task_start_time 0x000001a8
#define ASIZ_task_start_time 0x00000008
-#define AOFF_task_per_cpu_utime 0x00000190
+#define AOFF_task_per_cpu_utime 0x000001b0
#define ASIZ_task_per_cpu_utime 0x00000100
-#define AOFF_task_min_flt 0x00000390
+#define AOFF_task_min_flt 0x000003b0
#define ASIZ_task_min_flt 0x00000008
-#define AOFF_task_maj_flt 0x00000398
+#define AOFF_task_maj_flt 0x000003b8
#define ASIZ_task_maj_flt 0x00000008
-#define AOFF_task_nswap 0x000003a0
+#define AOFF_task_nswap 0x000003c0
#define ASIZ_task_nswap 0x00000008
-#define AOFF_task_cmin_flt 0x000003a8
+#define AOFF_task_cmin_flt 0x000003c8
#define ASIZ_task_cmin_flt 0x00000008
-#define AOFF_task_cmaj_flt 0x000003b0
+#define AOFF_task_cmaj_flt 0x000003d0
#define ASIZ_task_cmaj_flt 0x00000008
-#define AOFF_task_cnswap 0x000003b8
+#define AOFF_task_cnswap 0x000003d8
#define ASIZ_task_cnswap 0x00000008
-#define AOFF_task_uid 0x000003c4
+#define AOFF_task_uid 0x000003e4
#define ASIZ_task_uid 0x00000004
-#define AOFF_task_euid 0x000003c8
+#define AOFF_task_euid 0x000003e8
#define ASIZ_task_euid 0x00000004
-#define AOFF_task_suid 0x000003cc
+#define AOFF_task_suid 0x000003ec
#define ASIZ_task_suid 0x00000004
-#define AOFF_task_fsuid 0x000003d0
+#define AOFF_task_fsuid 0x000003f0
#define ASIZ_task_fsuid 0x00000004
-#define AOFF_task_gid 0x000003d4
+#define AOFF_task_gid 0x000003f4
#define ASIZ_task_gid 0x00000004
-#define AOFF_task_egid 0x000003d8
+#define AOFF_task_egid 0x000003f8
#define ASIZ_task_egid 0x00000004
-#define AOFF_task_sgid 0x000003dc
+#define AOFF_task_sgid 0x000003fc
#define ASIZ_task_sgid 0x00000004
-#define AOFF_task_fsgid 0x000003e0
+#define AOFF_task_fsgid 0x00000400
#define ASIZ_task_fsgid 0x00000004
-#define AOFF_task_ngroups 0x000003e4
+#define AOFF_task_ngroups 0x00000404
#define ASIZ_task_ngroups 0x00000004
-#define AOFF_task_groups 0x000003e8
+#define AOFF_task_groups 0x00000408
#define ASIZ_task_groups 0x00000080
-#define AOFF_task_cap_effective 0x00000468
+#define AOFF_task_cap_effective 0x00000488
#define ASIZ_task_cap_effective 0x00000004
-#define AOFF_task_cap_inheritable 0x0000046c
+#define AOFF_task_cap_inheritable 0x0000048c
#define ASIZ_task_cap_inheritable 0x00000004
-#define AOFF_task_cap_permitted 0x00000470
+#define AOFF_task_cap_permitted 0x00000490
#define ASIZ_task_cap_permitted 0x00000004
-#define AOFF_task_user 0x00000478
+#define AOFF_task_user 0x00000498
#define ASIZ_task_user 0x00000008
-#define AOFF_task_rlim 0x00000480
+#define AOFF_task_rlim 0x000004a0
#define ASIZ_task_rlim 0x000000a0
-#define AOFF_task_used_math 0x00000520
+#define AOFF_task_used_math 0x00000540
#define ASIZ_task_used_math 0x00000002
-#define AOFF_task_comm 0x00000522
+#define AOFF_task_comm 0x00000542
#define ASIZ_task_comm 0x00000010
-#define AOFF_task_link_count 0x00000534
+#define AOFF_task_link_count 0x00000554
#define ASIZ_task_link_count 0x00000004
-#define AOFF_task_tty 0x00000538
+#define AOFF_task_tty 0x00000558
#define ASIZ_task_tty 0x00000008
-#define AOFF_task_semundo 0x00000540
+#define AOFF_task_semundo 0x00000560
#define ASIZ_task_semundo 0x00000008
-#define AOFF_task_semsleeping 0x00000548
+#define AOFF_task_semsleeping 0x00000568
#define ASIZ_task_semsleeping 0x00000008
-#define AOFF_task_tss 0x00000550
-#define ASIZ_task_tss 0x00000470
-#define AOFF_task_fs 0x000009c0
+#define AOFF_task_tss 0x00000570
+#define ASIZ_task_tss 0x00000460
+#define AOFF_task_fs 0x000009d0
#define ASIZ_task_fs 0x00000008
-#define AOFF_task_files 0x000009c8
+#define AOFF_task_files 0x000009d8
#define ASIZ_task_files 0x00000008
-#define AOFF_task_mm 0x000009d0
+#define AOFF_task_mm 0x000009e0
#define ASIZ_task_mm 0x00000008
-#define AOFF_task_sigmask_lock 0x000009d8
+#define AOFF_task_sigmask_lock 0x000009e8
#define ASIZ_task_sigmask_lock 0x0000000c
-#define AOFF_task_sig 0x000009e8
+#define AOFF_task_sig 0x000009f8
#define ASIZ_task_sig 0x00000008
-#define AOFF_task_signal 0x000009f0
+#define AOFF_task_signal 0x00000a00
#define ASIZ_task_signal 0x00000008
-#define AOFF_task_blocked 0x000009f8
+#define AOFF_task_blocked 0x00000a08
#define ASIZ_task_blocked 0x00000008
-#define AOFF_task_sigqueue 0x00000a00
+#define AOFF_task_sigqueue 0x00000a10
#define ASIZ_task_sigqueue 0x00000008
-#define AOFF_task_sigqueue_tail 0x00000a08
+#define AOFF_task_sigqueue_tail 0x00000a18
#define ASIZ_task_sigqueue_tail 0x00000008
-#define AOFF_task_sas_ss_sp 0x00000a10
+#define AOFF_task_sas_ss_sp 0x00000a20
#define ASIZ_task_sas_ss_sp 0x00000008
-#define AOFF_task_sas_ss_size 0x00000a18
+#define AOFF_task_sas_ss_size 0x00000a28
#define ASIZ_task_sas_ss_size 0x00000008
-#define ASIZ_task 0x00000a20
+#define ASIZ_task 0x00000a30
#define AOFF_mm_mmap 0x00000000
#define ASIZ_mm_mmap 0x00000008
#define AOFF_mm_mmap_avl 0x00000008
@@ -766,48 +762,48 @@
#define AOFF_mm_map_count 0x00000024
#define ASIZ_mm_map_count 0x00000004
#define AOFF_mm_mmap_sem 0x00000028
-#define ASIZ_mm_mmap_sem 0x00000010
-#define AOFF_mm_context 0x00000038
+#define ASIZ_mm_mmap_sem 0x00000040
+#define AOFF_mm_context 0x00000068
#define ASIZ_mm_context 0x00000008
-#define AOFF_mm_start_code 0x00000040
+#define AOFF_mm_start_code 0x00000070
#define ASIZ_mm_start_code 0x00000008
-#define AOFF_mm_end_code 0x00000048
+#define AOFF_mm_end_code 0x00000078
#define ASIZ_mm_end_code 0x00000008
-#define AOFF_mm_start_data 0x00000050
+#define AOFF_mm_start_data 0x00000080
#define ASIZ_mm_start_data 0x00000008
-#define AOFF_mm_end_data 0x00000058
+#define AOFF_mm_end_data 0x00000088
#define ASIZ_mm_end_data 0x00000008
-#define AOFF_mm_start_brk 0x00000060
+#define AOFF_mm_start_brk 0x00000090
#define ASIZ_mm_start_brk 0x00000008
-#define AOFF_mm_brk 0x00000068
+#define AOFF_mm_brk 0x00000098
#define ASIZ_mm_brk 0x00000008
-#define AOFF_mm_start_stack 0x00000070
+#define AOFF_mm_start_stack 0x000000a0
#define ASIZ_mm_start_stack 0x00000008
-#define AOFF_mm_arg_start 0x00000078
+#define AOFF_mm_arg_start 0x000000a8
#define ASIZ_mm_arg_start 0x00000008
-#define AOFF_mm_arg_end 0x00000080
+#define AOFF_mm_arg_end 0x000000b0
#define ASIZ_mm_arg_end 0x00000008
-#define AOFF_mm_env_start 0x00000088
+#define AOFF_mm_env_start 0x000000b8
#define ASIZ_mm_env_start 0x00000008
-#define AOFF_mm_env_end 0x00000090
+#define AOFF_mm_env_end 0x000000c0
#define ASIZ_mm_env_end 0x00000008
-#define AOFF_mm_rss 0x00000098
+#define AOFF_mm_rss 0x000000c8
#define ASIZ_mm_rss 0x00000008
-#define AOFF_mm_total_vm 0x000000a0
+#define AOFF_mm_total_vm 0x000000d0
#define ASIZ_mm_total_vm 0x00000008
-#define AOFF_mm_locked_vm 0x000000a8
+#define AOFF_mm_locked_vm 0x000000d8
#define ASIZ_mm_locked_vm 0x00000008
-#define AOFF_mm_def_flags 0x000000b0
+#define AOFF_mm_def_flags 0x000000e0
#define ASIZ_mm_def_flags 0x00000008
-#define AOFF_mm_cpu_vm_mask 0x000000b8
+#define AOFF_mm_cpu_vm_mask 0x000000e8
#define ASIZ_mm_cpu_vm_mask 0x00000008
-#define AOFF_mm_swap_cnt 0x000000c0
+#define AOFF_mm_swap_cnt 0x000000f0
#define ASIZ_mm_swap_cnt 0x00000008
-#define AOFF_mm_swap_address 0x000000c8
+#define AOFF_mm_swap_address 0x000000f8
#define ASIZ_mm_swap_address 0x00000008
-#define AOFF_mm_segments 0x000000d0
+#define AOFF_mm_segments 0x00000100
#define ASIZ_mm_segments 0x00000008
-#define ASIZ_mm 0x000000d8
+#define ASIZ_mm 0x00000108
#define AOFF_thread_ksp 0x00000000
#define ASIZ_thread_ksp 0x00000008
#define AOFF_thread_wstate 0x00000008
@@ -816,47 +812,45 @@
#define ASIZ_thread_cwp 0x00000002
#define AOFF_thread_flags 0x0000000c
#define ASIZ_thread_flags 0x00000002
-#define AOFF_thread_ctx 0x0000000e
-#define ASIZ_thread_ctx 0x00000002
+#define AOFF_thread_current_ds 0x0000000e
+#define ASIZ_thread_current_ds 0x00000001
#define AOFF_thread_w_saved 0x00000010
#define ASIZ_thread_w_saved 0x00000002
#define AOFF_thread_new_signal 0x00000012
#define ASIZ_thread_new_signal 0x00000002
-#define AOFF_thread____pad 0x00000014
-#define ASIZ_thread____pad 0x00000004
-#define AOFF_thread_current_ds 0x00000018
-#define ASIZ_thread_current_ds 0x00000008
-#define AOFF_thread_kregs 0x00000020
+#define AOFF_thread_ctx 0x00000014
+#define ASIZ_thread_ctx 0x00000002
+#define AOFF_thread_kregs 0x00000018
#define ASIZ_thread_kregs 0x00000008
-#define AOFF_thread_utraps 0x00000028
+#define AOFF_thread_utraps 0x00000020
#define ASIZ_thread_utraps 0x00000008
-#define AOFF_thread_reg_window 0x00000030
+#define AOFF_thread_fpdepth 0x00000028
+#define ASIZ_thread_fpdepth 0x00000001
+#define AOFF_thread_fpsaved 0x00000029
+#define ASIZ_thread_fpsaved 0x00000007
+#define AOFF_thread_gsr 0x00000030
+#define ASIZ_thread_gsr 0x00000007
+#define AOFF_thread_xfsr 0x00000038
+#define ASIZ_thread_xfsr 0x00000038
+#define AOFF_thread_reg_window 0x00000070
#define ASIZ_thread_reg_window 0x00000380
-#define AOFF_thread_rwbuf_stkptrs 0x000003b0
+#define AOFF_thread_rwbuf_stkptrs 0x000003f0
#define ASIZ_thread_rwbuf_stkptrs 0x00000038
-#define AOFF_thread_sig_address 0x000003e8
+#define AOFF_thread_sig_address 0x00000428
#define ASIZ_thread_sig_address 0x00000008
-#define AOFF_thread_sig_desc 0x000003f0
+#define AOFF_thread_sig_desc 0x00000430
#define ASIZ_thread_sig_desc 0x00000008
-#define AOFF_thread_user_cntd0 0x000003f8
+#define AOFF_thread_user_cntd0 0x00000438
#define ASIZ_thread_user_cntd0 0x00000008
-#define AOFF_thread_user_cntd1 0x00000400
+#define AOFF_thread_user_cntd1 0x00000440
#define ASIZ_thread_user_cntd1 0x00000008
-#define AOFF_thread_kernel_cntd0 0x00000408
+#define AOFF_thread_kernel_cntd0 0x00000448
#define ASIZ_thread_kernel_cntd0 0x00000008
-#define AOFF_thread_kernel_cntd1 0x00000410
+#define AOFF_thread_kernel_cntd1 0x00000450
#define ASIZ_thread_kernel_cntd1 0x00000008
-#define AOFF_thread_pcr_reg 0x00000418
+#define AOFF_thread_pcr_reg 0x00000458
#define ASIZ_thread_pcr_reg 0x00000008
-#define AOFF_thread_fpdepth 0x00000420
-#define ASIZ_thread_fpdepth 0x00000001
-#define AOFF_thread_fpsaved 0x00000421
-#define ASIZ_thread_fpsaved 0x00000007
-#define AOFF_thread_gsr 0x00000428
-#define ASIZ_thread_gsr 0x00000007
-#define AOFF_thread_xfsr 0x00000430
-#define ASIZ_thread_xfsr 0x00000038
-#define ASIZ_thread 0x00000470
+#define ASIZ_thread 0x00000460
#endif /* SPIN_LOCK_DEBUG */
#endif /* CONFIG_SMP */
diff --git a/include/asm-sparc64/audioio.h b/include/asm-sparc64/audioio.h
index ca5e06538..27543806b 100644
--- a/include/asm-sparc64/audioio.h
+++ b/include/asm-sparc64/audioio.h
@@ -275,7 +275,7 @@ struct sparcaudio_driver
struct linux_sbus_device *dev;
/* Processes blocked on open() sit here. */
- struct wait_queue *open_wait;
+ wait_queue_head_t open_wait;
/* Task queue for this driver's bottom half. */
struct tq_struct tqueue;
@@ -288,7 +288,7 @@ struct sparcaudio_driver
size_t *output_sizes, output_size, output_buffer_size;
int num_output_buffers, output_front, output_rear, output_offset;
int output_count, output_active, playing_count, output_eof;
- struct wait_queue *output_write_wait, *output_drain_wait;
+ wait_queue_head_t output_write_wait, output_drain_wait;
char *output_notify;
/* Support for a circular queue of input buffers. */
@@ -296,7 +296,7 @@ struct sparcaudio_driver
size_t *input_sizes, input_size, input_buffer_size;
int num_input_buffers, input_front, input_rear, input_offset;
int input_count, input_active, recording_count;
- struct wait_queue *input_read_wait;
+ wait_queue_head_t input_read_wait;
/* Hack to make it look like we support variable size buffers. */
int buffer_size;
diff --git a/include/asm-sparc64/checksum.h b/include/asm-sparc64/checksum.h
index e3da2651a..5308186e7 100644
--- a/include/asm-sparc64/checksum.h
+++ b/include/asm-sparc64/checksum.h
@@ -1,4 +1,4 @@
-/* $Id: checksum.h,v 1.11 1998/04/17 02:37:22 davem Exp $ */
+/* $Id: checksum.h,v 1.12 1999/05/25 16:53:36 jj Exp $ */
#ifndef __SPARC64_CHECKSUM_H
#define __SPARC64_CHECKSUM_H
@@ -49,17 +49,20 @@ extern __inline__ unsigned int
csum_partial_copy_nocheck (const char *src, char *dst, int len,
unsigned int sum)
{
- __asm__ __volatile__ ("wr %%g0, %0, %%asi" : : "i" (ASI_P));
- return csum_partial_copy_sparc64(src, dst, len, sum);
+ int ret;
+ unsigned char cur_ds = current->tss.current_ds.seg;
+ __asm__ __volatile__ ("wr %%g0, %0, %%asi" : : "i" (ASI_P));
+ ret = csum_partial_copy_sparc64(src, dst, len, sum);
+ __asm__ __volatile__ ("wr %%g0, %0, %%asi" : : "r" (cur_ds));
+ return ret;
}
extern __inline__ unsigned int
csum_partial_copy_from_user(const char *src, char *dst, int len,
unsigned int sum, int *err)
{
- __asm__ __volatile__ ("wr %%g0, %0, %%asi
- stx %1, [%%sp + 0x7ff + 128]
- " : : "i" (ASI_S), "r" (err));
+ __asm__ __volatile__ ("stx %0, [%%sp + 0x7ff + 128]"
+ : : "r" (err));
return csum_partial_copy_sparc64(src, dst, len, sum);
}
diff --git a/include/asm-sparc64/fpumacro.h b/include/asm-sparc64/fpumacro.h
index 9fd631670..3fd5cab0c 100644
--- a/include/asm-sparc64/fpumacro.h
+++ b/include/asm-sparc64/fpumacro.h
@@ -30,44 +30,4 @@ extern __inline__ void fprs_write(unsigned long val)
__asm__ __volatile__("wr %0, 0x0, %%fprs" : : "r" (val));
}
-extern __inline__ void fpsave(unsigned long *fpregs,
- unsigned long *fsr,
- unsigned long *gsr)
-{
- __asm__ __volatile__ ("
- wr %%g0, %3, %%asi
- rd %%gsr, %%g1
- membar #LoadStore | #StoreStore
- stx %%fsr, [%1]
- stx %%g1, [%2]
- stda %%f0, [%0] %%asi
- stda %%f16, [%0 + 64] %%asi
- stda %%f32, [%0 + 128] %%asi
- stda %%f48, [%0 + 192] %%asi
- membar #Sync
-" : /* No outputs */
- : "r" (fpregs), "r" (fsr), "r" (gsr), "i" (ASI_BLK_P)
- : "g1");
-}
-
-extern __inline__ void fpload(unsigned long *fpregs,
- unsigned long *fsr,
- unsigned long *gsr)
-{
- __asm__ __volatile__ ("
- wr %%g0, %3, %%asi
- membar #StoreLoad | #LoadLoad
- ldda [%0] %%asi, %%f0
- ldda [%0 + 64] %%asi, %%f16
- ldda [%0 + 128] %%asi, %%f32
- ldda [%0 + 192] %%asi, %%f48
- ldx [%1], %%fsr
- ldx [%2], %%g1
- wr %%g1, 0, %%gsr
- membar #Sync
-" : /* No outputs */
- : "r" (fpregs), "r" (fsr), "r" (gsr), "i" (ASI_BLK_P)
- : "g1");
-}
-
#endif /* !(_SPARC64_FPUMACRO_H) */
diff --git a/include/asm-sparc64/ide.h b/include/asm-sparc64/ide.h
index 191b95cb2..c8db43d59 100644
--- a/include/asm-sparc64/ide.h
+++ b/include/asm-sparc64/ide.h
@@ -1,4 +1,4 @@
-/* $Id: ide.h,v 1.12 1999/04/17 14:25:29 davem Exp $
+/* $Id: ide.h,v 1.14 1999/05/15 05:02:35 davem Exp $
* ide.h: Ultra/PCI specific IDE glue.
*
* Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
@@ -11,8 +11,8 @@
#ifdef __KERNEL__
#include <asm/pgtable.h>
-
-typedef unsigned long ide_ioreg_t;
+#include <asm/io.h>
+#include <asm/hdreg.h>
#undef MAX_HWIFS
#define MAX_HWIFS 2
@@ -29,21 +29,42 @@ static __inline__ ide_ioreg_t ide_default_io_base(int index)
return 0;
}
-static __inline__ void ide_init_hwif_ports(ide_ioreg_t *p, ide_ioreg_t base, int *irq)
+static __inline__ void ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port, ide_ioreg_t ctrl_port, int *irq)
{
+ ide_ioreg_t reg = data_port;
int i;
- /* These are simply offsets from base. */
- for (i = 0; i < 8; i++)
- *p++ = base++;
- /* PCI code needs to figure out these. */
- for ( ; i < 10; i++)
- *p++ = 0;
- /* PCI code needs to figure out this. */
+ for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
+ hw->io_ports[i] = reg;
+ reg += 1;
+ }
+ if (ctrl_port) {
+ hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port;
+ } else {
+ hw->io_ports[IDE_CONTROL_OFFSET] = 0;
+ }
if (irq != NULL)
*irq = 0;
}
+/*
+ * This registers the standard ports for this architecture with the IDE
+ * driver.
+ */
+static __inline__ void ide_init_default_hwifs(void)
+{
+#ifdef __DO_I_NEED_THIS
+ hw_regs_t hw;
+ int index;
+
+ for (index = 0; index < MAX_HWIFS; index++) {
+ ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, 0);
+ hw.irq = ide_default_irq(ide_default_io_base(index));
+ ide_register_hw(&hw, NULL);
+ }
+#endif /* __DO_I_NEED_THIS */
+}
+
typedef union {
unsigned int all : 8; /* all of the bits together */
struct {
@@ -92,11 +113,6 @@ static __inline__ void ide_release_region(ide_ioreg_t base, unsigned int size)
#undef HD_DATA
#define HD_DATA ((ide_ioreg_t)0)
-static __inline__ int ide_ack_intr(ide_ioreg_t status_port, ide_ioreg_t irq_port)
-{
- return 1;
-}
-
/* From m68k code... */
#ifdef insl
@@ -255,13 +271,12 @@ static __inline__ void ide_fix_driveid(struct hd_driveid *id)
}
}
-static __inline__ void ide_release_lock (int *ide_lock)
-{
-}
-
-static __inline__ void ide_get_lock (int *ide_lock, void (*handler)(int, void *, struct pt_regs *), void *data)
-{
-}
+/*
+ * The following are not needed for the non-m68k ports
+ */
+#define ide_ack_intr(hwif) (1)
+#define ide_release_lock(lock) do {} while (0)
+#define ide_get_lock(lock, hdlr, data) do {} while (0)
#endif /* __KERNEL__ */
diff --git a/include/asm-sparc64/io.h b/include/asm-sparc64/io.h
index c9e3c8460..c80345840 100644
--- a/include/asm-sparc64/io.h
+++ b/include/asm-sparc64/io.h
@@ -1,4 +1,4 @@
-/* $Id: io.h,v 1.19 1998/08/23 05:41:46 ecd Exp $ */
+/* $Id: io.h,v 1.20 1999/05/14 07:23:18 davem Exp $ */
#ifndef __SPARC64_IO_H
#define __SPARC64_IO_H
@@ -226,4 +226,10 @@ extern void *sparc_alloc_io(u32 pa, void *va, int sz, char *name,
extern void sparc_free_io (void *va, int sz);
extern void *sparc_dvma_malloc (int sz, char *name, __u32 *dvma_addr);
+/* Nothing to do */
+
+#define dma_cache_inv(_start,_size) do { } while (0)
+#define dma_cache_wback(_start,_size) do { } while (0)
+#define dma_cache_wback_inv(_start,_size) do { } while (0)
+
#endif /* !(__SPARC64_IO_H) */
diff --git a/include/asm-sparc64/md.h b/include/asm-sparc64/md.h
index 03879934e..373c76744 100644
--- a/include/asm-sparc64/md.h
+++ b/include/asm-sparc64/md.h
@@ -1,4 +1,4 @@
-/* $Id: md.h,v 1.2 1997/12/27 16:28:38 jj Exp $
+/* $Id: md.h,v 1.3 1999/05/25 16:53:28 jj Exp $
* md.h: High speed xor_block operation for RAID4/5
* utilizing the UltraSparc Visual Instruction Set.
*
@@ -11,7 +11,7 @@
#include <asm/head.h>
#include <asm/asi.h>
-#define HAVE_ARCH_XORBLOCK
+#undef HAVE_ARCH_XORBLOCK
#define MD_XORBLOCK_ALIGNMENT 64
diff --git a/include/asm-sparc64/mmu_context.h b/include/asm-sparc64/mmu_context.h
index d29cb2a35..c9f984418 100644
--- a/include/asm-sparc64/mmu_context.h
+++ b/include/asm-sparc64/mmu_context.h
@@ -1,4 +1,4 @@
-/* $Id: mmu_context.h,v 1.35 1999/05/08 03:03:20 davem Exp $ */
+/* $Id: mmu_context.h,v 1.36 1999/05/25 16:53:34 jj Exp $ */
#ifndef __SPARC64_MMU_CONTEXT_H
#define __SPARC64_MMU_CONTEXT_H
@@ -27,7 +27,7 @@ extern void get_new_mmu_context(struct mm_struct *mm);
#define init_new_context(__mm) ((__mm)->context = NO_CONTEXT)
/* Kernel threads like rpciod and nfsd drop their mm, and then use
- * init_mm, when this happens we must make sure the tsk->tss.ctx is
+ * init_mm, when this happens we must make sure the secondary context is
* updated as well. Otherwise we have disasters relating to
* set_fs/get_fs usage later on.
*
@@ -49,12 +49,7 @@ extern void get_new_mmu_context(struct mm_struct *mm);
} \
} while (0)
-/* This routine must called with interrupts off,
- * this is necessary to guarentee that the current->tss.ctx
- * to CPU secontary context register relationship is maintained
- * when traps can happen.
- *
- * Also the caller must flush the current set of user windows
+/* The caller must flush the current set of user windows
* to the stack (if necessary) before we get here.
*/
extern __inline__ void __get_mmu_context(struct task_struct *tsk)
@@ -62,27 +57,30 @@ extern __inline__ void __get_mmu_context(struct task_struct *tsk)
register unsigned long paddr asm("o5");
register unsigned long pgd_cache asm("o4");
struct mm_struct *mm = tsk->mm;
+ unsigned long asi;
if(!(tsk->tss.flags & SPARC_FLAG_KTHREAD) &&
!(tsk->flags & PF_EXITING)) {
unsigned long ctx = tlb_context_cache;
if((mm->context ^ ctx) & CTX_VERSION_MASK)
get_new_mmu_context(mm);
+ tsk->tss.ctx = mm->context & 0x3ff;
+ spitfire_set_secondary_context(mm->context & 0x3ff);
+ __asm__ __volatile__("flush %g6");
if(!(mm->cpu_vm_mask & (1UL<<smp_processor_id()))) {
- spitfire_set_secondary_context(mm->context & 0x3ff);
- __asm__ __volatile__("flush %g6");
spitfire_flush_dtlb_secondary_context();
spitfire_flush_itlb_secondary_context();
__asm__ __volatile__("flush %g6");
}
- /* Don't worry, set_fs() will restore it... */
- /* Sigh, damned include loops... just poke seg directly. */
- tsk->tss.ctx = (tsk->tss.current_ds.seg ?
- (mm->context & 0x3ff) : 0);
- } else
+ asi = tsk->tss.current_ds.seg;
+ } else {
tsk->tss.ctx = 0;
- spitfire_set_secondary_context(tsk->tss.ctx);
- __asm__ __volatile__("flush %g6");
+ spitfire_set_secondary_context(0);
+ __asm__ __volatile__("flush %g6");
+ asi = ASI_P;
+ }
+ /* Sigh, damned include loops... just poke seg directly. */
+ __asm__ __volatile__ ("wr %%g0, %0, %%asi" : : "r" (asi));
paddr = __pa(mm->pgd);
if((tsk->tss.flags & (SPARC_FLAG_32BIT|SPARC_FLAG_KTHREAD)) ==
(SPARC_FLAG_32BIT))
diff --git a/include/asm-sparc64/namei.h b/include/asm-sparc64/namei.h
index cd24e96cf..2dbcdedf3 100644
--- a/include/asm-sparc64/namei.h
+++ b/include/asm-sparc64/namei.h
@@ -28,7 +28,7 @@ __sparc64_lookup_dentry(const char *name, int lookup_flags)
base = lookup_dentry (emul,
dget (current->fs->root),
- (LOOKUP_FOLLOW | LOOKUP_DIRECTORY | LOOKUP_SLASHOK));
+ (LOOKUP_FOLLOW | LOOKUP_DIRECTORY));
if (IS_ERR (base)) return NULL;
diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h
index b4782e72f..90aa49e77 100644
--- a/include/asm-sparc64/pgtable.h
+++ b/include/asm-sparc64/pgtable.h
@@ -1,4 +1,4 @@
-/* $Id: pgtable.h,v 1.103 1999/03/28 08:40:04 davem Exp $
+/* $Id: pgtable.h,v 1.105 1999/05/27 04:52:51 davem Exp $
* pgtable.h: SpitFire page table operations.
*
* Copyright 1996,1997 David S. Miller (davem@caip.rutgers.edu)
diff --git a/include/asm-sparc64/processor.h b/include/asm-sparc64/processor.h
index 0facbaf4f..855be2e88 100644
--- a/include/asm-sparc64/processor.h
+++ b/include/asm-sparc64/processor.h
@@ -1,4 +1,4 @@
-/* $Id: processor.h,v 1.53 1999/01/19 07:57:51 davem Exp $
+/* $Id: processor.h,v 1.55 1999/05/27 04:52:54 davem Exp $
* include/asm-sparc64/processor.h
*
* Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
@@ -7,6 +7,12 @@
#ifndef __ASM_SPARC64_PROCESSOR_H
#define __ASM_SPARC64_PROCESSOR_H
+/*
+ * Sparc64 implementation of macro that returns current
+ * instruction pointer ("program counter").
+ */
+#define current_text_addr() ({ void *pc; __asm__("rd %%pc, %0" : "=r" (pc)); pc; })
+
#include <asm/asi.h>
#include <asm/a.out.h>
#include <asm/pstate.h>
@@ -36,7 +42,7 @@
#define NSWINS 7
typedef struct {
- unsigned long seg;
+ unsigned char seg;
} mm_segment_t;
/* The Sparc processor specific thread struct. */
@@ -45,15 +51,19 @@ struct thread_struct {
unsigned short wstate;
unsigned short cwp;
unsigned short flags;
- unsigned short ctx;
+ mm_segment_t current_ds;
/*DC2*/ unsigned short w_saved;
unsigned short new_signal;
- unsigned int ___pad;
- mm_segment_t current_ds;
+ unsigned short ctx;
+ struct pt_regs *kregs;
-/*DC3*/ struct pt_regs *kregs;
- unsigned long *utraps;
+/*DC3*/ unsigned long *utraps;
+ unsigned char fpdepth;
+ unsigned char fpsaved[7];
+
+/*DC4*/ unsigned char gsr[7];
+ unsigned long xfsr[7];
struct reg_window reg_window[NSWINS] __attribute__ ((aligned (16)));
unsigned long rwbuf_stkptrs[NSWINS] __attribute__ ((aligned (8)));
@@ -66,10 +76,6 @@ struct thread_struct {
u64 kernel_cntd0, kernel_cntd1;
u64 pcr_reg;
- unsigned char fpdepth;
- unsigned char fpsaved[7];
- unsigned char gsr[7];
- unsigned long xfsr[7];
};
#endif /* !(__ASSEMBLY__) */
@@ -85,12 +91,14 @@ struct thread_struct {
NULL, PAGE_SHARED , VM_READ | VM_WRITE | VM_EXEC, 1, NULL, NULL }
#define INIT_TSS { \
-/* ksp, wstate, cwp, flags, ctx, */ \
- 0, 0, 0, SPARC_FLAG_KTHREAD, 0, \
-/* w_saved, new_signal, padding, current_ds, */ \
- 0, 0, 0, KERNEL_DS, \
-/* kregs, utraps, */ \
- 0, 0, \
+/* ksp, wstate, cwp, flags, current_ds, */ \
+ 0, 0, 0, SPARC_FLAG_KTHREAD, KERNEL_DS, \
+/* w_saved, new_signal, ctx, kregs, */ \
+ 0, 0, 0, 0, \
+/* utraps, */ \
+ 0, \
+/* fpdepth, fpsaved, gsr, xfsr */ \
+ 0, { 0 }, { 0 }, { 0 }, \
/* reg_window */ \
{ { { 0, }, { 0, } }, }, \
/* rwbuf_stkptrs */ \
@@ -99,8 +107,6 @@ struct thread_struct {
0, 0, \
/* user_cntd0, user_cndd1, kernel_cntd0, kernel_cntd0, pcr_reg */ \
0, 0, 0, 0, 0, \
-/* fpdepth, fpsaved, gsr, xfsr */ \
- 0, { 0 }, { 0 }, { 0 }, \
}
#ifndef __ASSEMBLY__
diff --git a/include/asm-sparc64/sab82532.h b/include/asm-sparc64/sab82532.h
index 169e88d02..8cb99a22f 100644
--- a/include/asm-sparc64/sab82532.h
+++ b/include/asm-sparc64/sab82532.h
@@ -1,4 +1,4 @@
-/* $Id: sab82532.h,v 1.4 1998/10/25 23:04:29 ecd Exp $
+/* $Id: sab82532.h,v 1.5 1999/05/12 11:21:22 davem Exp $
* sab82532.h: Register Definitions for the Siemens SAB82532 DUSCC
*
* Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be)
@@ -173,9 +173,9 @@ struct sab82532 {
struct async_icount icount;
struct termios normal_termios;
struct termios callout_termios;
- struct wait_queue *open_wait;
- struct wait_queue *close_wait;
- struct wait_queue *delta_msr_wait;
+ wait_queue_head_t open_wait;
+ wait_queue_head_t close_wait;
+ wait_queue_head_t delta_msr_wait;
struct sab82532 *next;
struct sab82532 *prev;
};
diff --git a/include/asm-sparc64/semaphore.h b/include/asm-sparc64/semaphore.h
index e35a66513..e119514c4 100644
--- a/include/asm-sparc64/semaphore.h
+++ b/include/asm-sparc64/semaphore.h
@@ -10,21 +10,62 @@
struct semaphore {
atomic_t count;
atomic_t waking;
- struct wait_queue * wait;
+ wait_queue_head_t wait;
+#if WAITQUEUE_DEBUG
+ long __magic;
+#endif
};
-#define MUTEX ((struct semaphore) { ATOMIC_INIT(1), ATOMIC_INIT(0), NULL })
-#define MUTEX_LOCKED ((struct semaphore) { ATOMIC_INIT(0), ATOMIC_INIT(0), NULL })
+#if WAITQUEUE_DEBUG
+# define __SEM_DEBUG_INIT(name) \
+ , (long)&(name).__magic
+#else
+# define __SEM_DEBUG_INIT(name)
+#endif
+
+#define __SEMAPHORE_INITIALIZER(name,count) \
+{ ATOMIC_INIT(count), ATOMIC_INIT(0), __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \
+ __SEM_DEBUG_INIT(name) }
+
+#define __MUTEX_INITIALIZER(name) \
+ __SEMAPHORE_INITIALIZER(name,1)
+
+#define __DECLARE_SEMAPHORE_GENERIC(name,count) \
+ struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
+
+#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
+#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
+
+extern inline void sema_init (struct semaphore *sem, int val)
+{
+ atomic_set(&sem->count, val);
+ atomic_set(&sem->waking, 0);
+ init_waitqueue_head(&sem->wait);
+#if WAITQUEUE_DEBUG
+ sem->__magic = (long)&sem->__magic;
+#endif
+}
+
+static inline void init_MUTEX (struct semaphore *sem)
+{
+ sema_init(sem, 1);
+}
+
+static inline void init_MUTEX_LOCKED (struct semaphore *sem)
+{
+ sema_init(sem, 0);
+}
extern void __down(struct semaphore * sem);
extern int __down_interruptible(struct semaphore * sem);
extern int __down_trylock(struct semaphore * sem);
extern void __up(struct semaphore * sem);
-#define sema_init(sem, val) atomic_set(&((sem)->count), val)
-
extern __inline__ void down(struct semaphore * sem)
{
+#if WAITQUEUE_DEBUG
+ CHECK_MAGIC(sem->__magic);
+#endif
__asm__ __volatile__("
1: lduw [%0], %%g5
sub %%g5, 1, %%g7
@@ -56,6 +97,9 @@ extern __inline__ int down_interruptible(struct semaphore *sem)
{
int ret = 0;
+#if WAITQUEUE_DEBUG
+ CHECK_MAGIC(sem->__magic);
+#endif
__asm__ __volatile__("
1: lduw [%2], %%g5
sub %%g5, 1, %%g7
@@ -89,6 +133,9 @@ extern __inline__ int down_interruptible(struct semaphore *sem)
extern inline int down_trylock(struct semaphore *sem)
{
int ret = 0;
+#if WAITQUEUE_DEBUG
+ CHECK_MAGIC(sem->__magic);
+#endif
__asm__ __volatile__("
1: lduw [%2], %%g5
sub %%g5, 1, %%g7
@@ -121,6 +168,9 @@ extern inline int down_trylock(struct semaphore *sem)
extern __inline__ void up(struct semaphore * sem)
{
+#if WAITQUEUE_DEBUG
+ CHECK_MAGIC(sem->__magic);
+#endif
__asm__ __volatile__("
membar #StoreLoad | #LoadLoad
1: lduw [%0], %%g5
diff --git a/include/asm-sparc64/softirq.h b/include/asm-sparc64/softirq.h
index f249cd698..b8e017d79 100644
--- a/include/asm-sparc64/softirq.h
+++ b/include/asm-sparc64/softirq.h
@@ -16,6 +16,9 @@ extern unsigned int local_bh_count;
#define local_bh_count (cpu_data[smp_processor_id()].bh_count)
#endif
+#define local_bh_disable() (local_bh_count++)
+#define local_bh_enable() (local_bh_count--)
+
/* The locking mechanism for base handlers, to prevent re-entrancy,
* is entirely private to an implementation, it should not be
* referenced at all outside of this file.
@@ -94,7 +97,8 @@ static inline void end_bh_atomic(void)
static inline int softirq_trylock(int cpu)
{
if (spin_trylock(&global_bh_count)) {
- if (atomic_read(&global_bh_lock) == 0) {
+ if (atomic_read(&global_bh_lock) == 0 &&
+ cpu_data[cpu].bh_count == 0) {
++(cpu_data[cpu].bh_count);
return 1;
}
diff --git a/include/asm-sparc64/spinlock.h b/include/asm-sparc64/spinlock.h
index 1d3b35020..d0c25a965 100644
--- a/include/asm-sparc64/spinlock.h
+++ b/include/asm-sparc64/spinlock.h
@@ -20,6 +20,14 @@ typedef unsigned char spinlock_t;
#define spin_unlock(lock) do { } while(0)
#define spin_lock_irq(lock) cli()
#define spin_unlock_irq(lock) sti()
+#define spin_lock_bh(lock) \
+do { local_bh_count++; \
+ barrier(); \
+} while(0)
+#define spin_unlock_bh(lock) \
+do { barrier(); \
+ local_bh_count--; \
+} while(0)
#define spin_lock_irqsave(lock, flags) save_and_cli(flags)
#define spin_unlock_irqrestore(lock, flags) restore_flags(flags)
@@ -43,9 +51,28 @@ typedef unsigned long rwlock_t;
#define write_unlock(lock) do { } while(0)
#define read_lock_irq(lock) cli()
#define read_unlock_irq(lock) sti()
+#define read_lock_bh(lock) \
+do { local_bh_count++; \
+ barrier(); \
+} while(0)
+#define read_unlock_bh(lock) \
+do { barrier(); \
+ local_bh_count--; \
+} while(0)
+
#define write_lock_irq(lock) cli()
#define write_unlock_irq(lock) sti()
+#define write_lock_bh(lock) \
+do { local_bh_count++; \
+ barrier(); \
+} while(0)
+
+#define write_unlock_bh(lock) \
+do { barrier(); \
+ local_bh_count--; \
+} while(0)
+
#define read_lock_irqsave(lock, flags) save_and_cli(flags)
#define read_unlock_irqrestore(lock, flags) restore_flags(flags)
#define write_lock_irqsave(lock, flags) save_and_cli(flags)
@@ -149,6 +176,16 @@ extern __inline__ void spin_unlock_irq(spinlock_t *lock)
: "memory");
}
+#define spin_lock_bh(__lock) \
+do { local_bh_count++; \
+ spin_lock(__lock); \
+} while(0)
+
+#define spin_unlock_bh(__lock) \
+do { spin_unlock(__lock); \
+ local_bh_count--; \
+} while(0)
+
#define spin_lock_irqsave(__lock, flags) \
do { register spinlock_t *__lp asm("g1"); \
__lp = (__lock); \
@@ -186,11 +223,11 @@ typedef struct {
unsigned char lock;
unsigned int owner_pc, owner_cpu;
} spinlock_t;
-#define SPIN_LOCK_UNLOCKED (spinlock_t) { 0, 0, NO_PROC_ID }
+#define SPIN_LOCK_UNLOCKED (spinlock_t) { 0, 0, 0xff }
#define spin_lock_init(__lock) \
do { (__lock)->lock = 0; \
(__lock)->owner_pc = 0; \
- (__lock)->owner_cpu = NO_PROC_ID; \
+ (__lock)->owner_cpu = 0xff; \
} while(0)
#define spin_is_locked(__lock) (*((volatile unsigned char *)(&((__lock)->lock))) != 0)
#define spin_unlock_wait(__lock) \
@@ -205,9 +242,11 @@ extern int _spin_trylock (spinlock_t *lock);
#define spin_trylock(lp) _spin_trylock(lp)
#define spin_lock(lock) _do_spin_lock(lock, "spin_lock")
#define spin_lock_irq(lock) do { __cli(); _do_spin_lock(lock, "spin_lock_irq"); } while(0)
+#define spin_lock_bh(lock) do { local_bh_count++; _do_spin_lock(lock, "spin_lock_bh"); } while(0)
#define spin_lock_irqsave(lock, flags) do { __save_and_cli(flags); _do_spin_lock(lock, "spin_lock_irqsave"); } while(0)
#define spin_unlock(lock) _do_spin_unlock(lock)
#define spin_unlock_irq(lock) do { _do_spin_unlock(lock); __sti(); } while(0)
+#define spin_unlock_bh(lock) do { _do_spin_unlock(lock); local_bh_count--; } while(0)
#define spin_unlock_irqrestore(lock, flags) do { _do_spin_unlock(lock); __restore_flags(flags); } while(0)
#endif /* SPIN_LOCK_DEBUG */
@@ -303,8 +342,12 @@ extern __inline__ void write_unlock(rwlock_t *rw)
#define read_lock_irq(lock) do { __cli(); read_lock(lock); } while (0)
#define read_unlock_irq(lock) do { read_unlock(lock); __sti(); } while (0)
+#define read_lock_bh(lock) do { local_bh_count++; read_lock(lock); } while (0)
+#define read_unlock_bh(lock) do { read_unlock(lock); local_bh_count--; } while (0)
#define write_lock_irq(lock) do { __cli(); write_lock(lock); } while (0)
#define write_unlock_irq(lock) do { write_unlock(lock); __sti(); } while (0)
+#define write_lock_bh(lock) do { local_bh_count++; write_lock(lock); } while (0)
+#define write_unlock_bh(lock) do { write_unlock(lock); local_bh_count--; } while (0)
#define read_lock_irqsave(lock, flags) \
do { __save_and_cli(flags); read_lock(lock); } while (0)
@@ -322,7 +365,7 @@ typedef struct {
unsigned int writer_pc, writer_cpu;
unsigned int reader_pc[4];
} rwlock_t;
-#define RW_LOCK_UNLOCKED (rwlock_t) { 0, 0, NO_PROC_ID, { 0, 0, 0, 0 } }
+#define RW_LOCK_UNLOCKED (rwlock_t) { 0, 0, 0xff, { 0, 0, 0, 0 } }
extern void _do_read_lock(rwlock_t *rw, char *str);
extern void _do_read_unlock(rwlock_t *rw, char *str);
@@ -336,6 +379,7 @@ do { unsigned long flags; \
__restore_flags(flags); \
} while(0)
#define read_lock_irq(lock) do { __cli(); _do_read_lock(lock, "read_lock_irq"); } while(0)
+#define read_lock_bh(lock) do { local_bh_count++; _do_read_lock(lock, "read_lock_bh"); } while(0)
#define read_lock_irqsave(lock, flags) do { __save_and_cli(flags); _do_read_lock(lock, "read_lock_irqsave"); } while(0)
#define read_unlock(lock) \
@@ -345,6 +389,7 @@ do { unsigned long flags; \
__restore_flags(flags); \
} while(0)
#define read_unlock_irq(lock) do { _do_read_unlock(lock, "read_unlock_irq"); __sti() } while(0)
+#define read_unlock_bh(lock) do { _do_read_unlock(lock, "read_unlock_bh"); local_bh_count--; } while(0)
#define read_unlock_irqrestore(lock, flags) do { _do_read_unlock(lock, "read_unlock_irqrestore"); __restore_flags(flags); } while(0)
#define write_lock(lock) \
@@ -354,6 +399,7 @@ do { unsigned long flags; \
__restore_flags(flags); \
} while(0)
#define write_lock_irq(lock) do { __cli(); _do_write_lock(lock, "write_lock_irq"); } while(0)
+#define write_lock_bh(lock) do { local_bh_count++; _do_write_lock(lock, "write_lock_bh"); } while(0)
#define write_lock_irqsave(lock, flags) do { __save_and_cli(flags); _do_write_lock(lock, "write_lock_irqsave"); } while(0)
#define write_unlock(lock) \
@@ -363,6 +409,7 @@ do { unsigned long flags; \
__restore_flags(flags); \
} while(0)
#define write_unlock_irq(lock) do { _do_write_unlock(lock); __sti(); } while(0)
+#define write_unlock_bh(lock) do { _do_write_unlock(lock); local_bh_count--; } while(0)
#define write_unlock_irqrestore(lock, flags) do { _do_write_unlock(lock); __restore_flags(flags); } while(0)
#endif /* SPIN_LOCK_DEBUG */
diff --git a/include/asm-sparc64/uaccess.h b/include/asm-sparc64/uaccess.h
index 0643d0487..a6f5c9a44 100644
--- a/include/asm-sparc64/uaccess.h
+++ b/include/asm-sparc64/uaccess.h
@@ -1,4 +1,4 @@
-/* $Id: uaccess.h,v 1.29 1999/05/08 03:03:25 davem Exp $ */
+/* $Id: uaccess.h,v 1.30 1999/05/25 16:53:32 jj Exp $ */
#ifndef _ASM_UACCESS_H
#define _ASM_UACCESS_H
@@ -30,8 +30,8 @@
* "For historical reasons, these macros are grossly misnamed." -Linus
*/
-#define KERNEL_DS ((mm_segment_t) { 0x00 })
-#define USER_DS ((mm_segment_t) { 0x2B }) /* har har har */
+#define KERNEL_DS ((mm_segment_t) { ASI_P })
+#define USER_DS ((mm_segment_t) { ASI_AIUS }) /* har har har */
#define VERIFY_READ 0
#define VERIFY_WRITE 1
@@ -43,17 +43,8 @@
#define set_fs(val) \
do { \
- if (current->tss.current_ds.seg != val.seg) { \
- current->tss.current_ds = (val); \
- if (segment_eq((val), KERNEL_DS)) { \
- flushw_user (); \
- current->tss.ctx = 0; \
- } else { \
- current->tss.ctx = (current->mm->context & 0x3ff); \
- } \
- spitfire_set_secondary_context(current->tss.ctx); \
- __asm__ __volatile__("flush %g6"); \
- } \
+ current->tss.current_ds = (val); \
+ __asm__ __volatile__ ("wr %%g0, %0, %%asi" : : "r" ((val).seg)); \
} while(0)
#define __user_ok(addr,size) 1
@@ -154,7 +145,7 @@ default: if (__put_user_bad()) return retval; break; \
#define __put_user_asm(x,size,addr,ret) \
__asm__ __volatile__( \
"/* Put user asm, inline. */\n" \
-"1:\t" "st"#size "a %1, [%2] %4\n\t" \
+"1:\t" "st"#size "a %1, [%2] %%asi\n\t" \
"clr %0\n" \
"2:\n\n\t" \
".section .fixup,#alloc,#execinstr\n\t" \
@@ -168,22 +159,22 @@ __asm__ __volatile__( \
".word 1b, 3b\n\t" \
".previous\n\n\t" \
: "=r" (ret) : "r" (x), "r" (__m(addr)), \
- "i" (-EFAULT), "i" (ASI_S))
+ "i" (-EFAULT))
#define __put_user_asm_ret(x,size,addr,ret,foo) \
if (__builtin_constant_p(ret) && ret == -EFAULT) \
__asm__ __volatile__( \
"/* Put user asm ret, inline. */\n" \
-"1:\t" "st"#size "a %1, [%2] %3\n\n\t" \
+"1:\t" "st"#size "a %1, [%2] %%asi\n\n\t" \
".section __ex_table,#alloc\n\t" \
".align 4\n\t" \
".word 1b, __ret_efault\n\n\t" \
".previous\n\n\t" \
- : "=r" (foo) : "r" (x), "r" (__m(addr)), "i" (ASI_S)); \
+ : "=r" (foo) : "r" (x), "r" (__m(addr))); \
else \
__asm__ __volatile( \
"/* Put user asm ret, inline. */\n" \
-"1:\t" "st"#size "a %1, [%2] %4\n\n\t" \
+"1:\t" "st"#size "a %1, [%2] %%asi\n\n\t" \
".section .fixup,#alloc,#execinstr\n\t" \
".align 4\n" \
"3:\n\t" \
@@ -195,7 +186,7 @@ __asm__ __volatile( \
".word 1b, 3b\n\n\t" \
".previous\n\n\t" \
: "=r" (foo) : "r" (x), "r" (__m(addr)), \
- "i" (ret), "i" (ASI_S))
+ "i" (ret))
extern int __put_user_bad(void);
@@ -223,7 +214,7 @@ default: if (__get_user_bad()) return retval; \
#define __get_user_asm(x,size,addr,ret) \
__asm__ __volatile__( \
"/* Get user asm, inline. */\n" \
-"1:\t" "ld"#size "a [%2] %4, %1\n\t" \
+"1:\t" "ld"#size "a [%2] %%asi, %1\n\t" \
"clr %0\n" \
"2:\n\n\t" \
".section .fixup,#alloc,#execinstr\n\t" \
@@ -238,33 +229,33 @@ __asm__ __volatile__( \
".word 1b, 3b\n\n\t" \
".previous\n\t" \
: "=r" (ret), "=r" (x) : "r" (__m(addr)), \
- "i" (-EFAULT), "i" (ASI_S))
+ "i" (-EFAULT))
#define __get_user_asm_ret(x,size,addr,retval) \
if (__builtin_constant_p(retval) && retval == -EFAULT) \
__asm__ __volatile__( \
"/* Get user asm ret, inline. */\n" \
-"1:\t" "ld"#size "a [%1] %2, %0\n\n\t" \
+"1:\t" "ld"#size "a [%1] %%asi, %0\n\n\t" \
".section __ex_table,#alloc\n\t" \
".align 4\n\t" \
".word 1b,__ret_efault\n\n\t" \
".previous\n\t" \
- : "=r" (x) : "r" (__m(addr)), "i" (ASI_S)); \
+ : "=r" (x) : "r" (__m(addr))); \
else \
__asm__ __volatile__( \
"/* Get user asm ret, inline. */\n" \
-"1:\t" "ld"#size "a [%1] %2, %0\n\n\t" \
+"1:\t" "ld"#size "a [%1] %%asi, %0\n\n\t" \
".section .fixup,#alloc,#execinstr\n\t" \
".align 4\n" \
"3:\n\t" \
"ret\n\t" \
- " restore %%g0, %3, %%o0\n\n\t" \
+ " restore %%g0, %2, %%o0\n\n\t" \
".previous\n\t" \
".section __ex_table,#alloc\n\t" \
".align 4\n\t" \
".word 1b, 3b\n\n\t" \
".previous\n\t" \
- : "=r" (x) : "r" (__m(addr)), "i" (retval), "i" (ASI_S))
+ : "=r" (x) : "r" (__m(addr)), "i" (retval))
extern int __get_user_bad(void);
@@ -339,8 +330,6 @@ extern __inline__ __kernel_size_t __clear_user(void *addr, __kernel_size_t size)
{
extern __kernel_size_t __bzero_noasi(void *addr, __kernel_size_t size);
-
- __asm__ __volatile__ ("wr %%g0, %0, %%asi" : : "i" (ASI_S));
return __bzero_noasi(addr, size);
}
diff --git a/include/linux/b1lli.h b/include/linux/b1lli.h
index f564ae898..71ad74f6e 100644
--- a/include/linux/b1lli.h
+++ b/include/linux/b1lli.h
@@ -1,11 +1,33 @@
/*
- * $Id: b1lli.h,v 1.3 1998/01/31 10:54:37 calle Exp $
+ * $Id: b1lli.h,v 1.6 1999/04/15 19:49:36 calle Exp $
*
* ISDN lowlevel-module for AVM B1-card.
*
* Copyright 1996 by Carsten Paeth (calle@calle.in-berlin.de)
*
* $Log: b1lli.h,v $
+ * Revision 1.6 1999/04/15 19:49:36 calle
+ * fix fuer die B1-PCI. Jetzt geht z.B. auch IRQ 17 ...
+ *
+ * Revision 1.5 1998/10/25 14:50:28 fritz
+ * Backported from MIPS (Cobalt).
+ *
+ * Revision 1.4 1998/03/29 16:05:02 calle
+ * changes from 2.0 tree merged.
+ *
+ * Revision 1.1.2.9 1998/03/20 14:30:02 calle
+ * added cardnr to detect if you try to add same T1 to different io address.
+ * change number of nccis depending on number of channels.
+ *
+ * Revision 1.1.2.8 1998/03/04 17:32:33 calle
+ * Changes for T1.
+ *
+ * Revision 1.1.2.7 1998/02/27 15:38:29 calle
+ * T1 running with slow link.
+ *
+ * Revision 1.1.2.6 1998/02/24 17:57:36 calle
+ * changes for T1.
+ *
* Revision 1.3 1998/01/31 10:54:37 calle
* include changes for PCMCIA cards from 2.0 version
*
@@ -70,15 +92,17 @@ typedef struct avmb1_carddef {
int irq;
} avmb1_carddef;
-#define AVM_CARDTYPE_B1 0
-#define AVM_CARDTYPE_T1 1
-#define AVM_CARDTYPE_M1 2
-#define AVM_CARDTYPE_M2 3
+#define AVM_CARDTYPE_B1 0
+#define AVM_CARDTYPE_T1 1
+#define AVM_CARDTYPE_M1 2
+#define AVM_CARDTYPE_M2 3
+#define AVM_CARDTYPE_B1PCI 4
typedef struct avmb1_extcarddef {
int port;
int irq;
int cardtype;
+ int cardnr; /* for HEMA/T1 */
} avmb1_extcarddef;
#define AVMB1_LOAD 0 /* load image to card */
@@ -87,6 +111,7 @@ typedef struct avmb1_extcarddef {
#define AVMB1_LOAD_AND_CONFIG 3 /* load image and config to card */
#define AVMB1_ADDCARD_WITH_TYPE 4 /* add a new card, with cardtype */
#define AVMB1_GET_CARDINFO 5 /* get cardtype */
+#define AVMB1_REMOVECARD 6 /* remove a card (usefull for T1) */
@@ -103,14 +128,12 @@ typedef struct avmb1_extcarddef {
#ifdef __KERNEL__
-#define AVMB1_PORTLEN 0x1f
+#define AVMB1_PORTLEN 0x1f
-#define AVM_MAXVERSION 8
-#define AVM_NBCHAN 2
+#define AVM_MAXVERSION 8
-#define AVM_NAPPS 30
-#define AVM_NPLCI 5
-#define AVM_NNCCI 6
+#define AVM_NAPPS 30
+#define AVM_NNCCI_PER_CHANNEL 4
/*
* Main driver data
@@ -119,9 +142,10 @@ typedef struct avmb1_extcarddef {
typedef struct avmb1_card {
struct avmb1_card *next;
int cnr;
- unsigned short port;
+ unsigned int port;
unsigned irq;
int cardtype;
+ int cardnr; /* for T1-HEMA */
volatile unsigned short cardstate;
int interrupt;
int blocked;
@@ -149,23 +173,26 @@ typedef struct avmb1_card {
/* b1lli.c */
-int B1_detect(unsigned short base, int cardtype);
-void B1_reset(unsigned short base);
-int B1_load_t4file(unsigned short base, avmb1_t4file * t4file);
-int B1_load_config(unsigned short base, avmb1_t4file * config);
-int B1_loaded(unsigned short base);
-unsigned char B1_assign_irq(unsigned short base, unsigned irq, int cardtype);
-unsigned char B1_enable_irq(unsigned short base);
-unsigned char B1_disable_irq(unsigned short base);
+int B1_detect(unsigned int base, int cardtype);
+int T1_detectandinit(unsigned int base, unsigned irq, int cardnr);
+void B1_reset(unsigned int base);
+void T1_reset(unsigned int base);
+int B1_load_t4file(unsigned int base, avmb1_t4file * t4file);
+int B1_load_config(unsigned int base, avmb1_t4file * config);
+int B1_loaded(unsigned int base);
+void B1_setinterrupt(unsigned int base, unsigned irq, int cardtype);
+unsigned char B1_disable_irq(unsigned int base);
+void T1_disable_irq(unsigned int base);
int B1_valid_irq(unsigned irq, int cardtype);
+int B1_valid_port(unsigned port, int cardtype);
void B1_handle_interrupt(avmb1_card * card);
-void B1_send_init(unsigned short port,
+void B1_send_init(unsigned int port,
unsigned int napps, unsigned int nncci, unsigned int cardnr);
-void B1_send_register(unsigned short port,
+void B1_send_register(unsigned int port,
__u16 appid, __u32 nmsg,
__u32 nb3conn, __u32 nb3blocks, __u32 b3bsize);
-void B1_send_release(unsigned short port, __u16 appid);
-void B1_send_message(unsigned short port, struct sk_buff *skb);
+void B1_send_release(unsigned int port, __u16 appid);
+void B1_send_message(unsigned int port, struct sk_buff *skb);
/* b1capi.c */
void avmb1_handle_new_ncci(avmb1_card * card,
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
index 0d34d35ba..dd4ef3603 100644
--- a/include/linux/binfmts.h
+++ b/include/linux/binfmts.h
@@ -19,7 +19,7 @@
struct linux_binprm{
char buf[128];
unsigned long page[MAX_ARG_PAGES];
- unsigned long p;
+ unsigned long p; /* current top of mem */
int sh_bang;
int java; /* Java binary, prevent recursive invocation */
struct dentry * dentry;
@@ -64,14 +64,16 @@ extern int prepare_binprm(struct linux_binprm *);
extern void remove_arg_zero(struct linux_binprm *);
extern int search_binary_handler(struct linux_binprm *,struct pt_regs *);
extern int flush_old_exec(struct linux_binprm * bprm);
-extern unsigned long setup_arg_pages(unsigned long p, struct linux_binprm * bprm);
-extern unsigned long copy_strings(int argc,char ** argv,unsigned long *page,
- unsigned long p, int from_kmem);
-
+extern int setup_arg_pages(struct linux_binprm * bprm);
+extern int copy_strings(int argc,char ** argv,struct linux_binprm *bprm);
+extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm);
extern void compute_creds(struct linux_binprm *binprm);
-/* this eventually goes away */
+
+#if 0
+/* this went away now */
#define change_ldt(a,b) setup_arg_pages(a,b)
+#endif
#endif /* __KERNEL__ */
#endif /* _LINUX_BINFMTS_H */
diff --git a/include/linux/blk.h b/include/linux/blk.h
index e0d904fc1..3974bc23b 100644
--- a/include/linux/blk.h
+++ b/include/linux/blk.h
@@ -85,12 +85,6 @@ void initrd_init(void);
#endif
-#define RO_IOCTLS(dev,where) \
- case BLKROSET: { int __val; if (!capable(CAP_SYS_ADMIN)) return -EACCES; \
- if (get_user(__val, (int *)(where))) return -EFAULT; \
- set_device_ro((dev),__val); return 0; } \
- case BLKROGET: { int __val = (is_read_only(dev) != 0) ; \
- return put_user(__val,(int *) (where)); }
#if defined(MAJOR_NR) || defined(IDE_DRIVER)
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index f2d143359..03ce66426 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -55,7 +55,7 @@ struct sec_size {
extern struct sec_size * blk_sec[MAX_BLKDEV];
extern struct blk_dev_struct blk_dev[MAX_BLKDEV];
-extern struct wait_queue * wait_for_request;
+extern wait_queue_head_t wait_for_request;
extern void resetup_one_dev(struct gendisk *dev, int drive);
extern void unplug_device(void * data);
extern void make_request(int major,int rw, struct buffer_head * bh);
diff --git a/include/linux/busmouse.h b/include/linux/busmouse.h
index eb71550d3..ccbf0f8b6 100644
--- a/include/linux/busmouse.h
+++ b/include/linux/busmouse.h
@@ -94,7 +94,7 @@ struct mouse_status {
int present;
int ready;
int active;
- struct wait_queue *wait;
+ wait_queue_head_t wait;
struct fasync_struct *fasyncptr;
};
diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h
index 2de8ff1ff..77d2c4ebe 100644
--- a/include/linux/coda_psdev.h
+++ b/include/linux/coda_psdev.h
@@ -23,7 +23,7 @@ struct coda_sb_info
/* communication pending/processing queues */
struct venus_comm {
u_long vc_seq;
- struct wait_queue *vc_waitq; /* Venus wait queue */
+ wait_queue_head_t vc_waitq; /* Venus wait queue */
struct list_head vc_pending;
struct list_head vc_processing;
int vc_inuse;
@@ -93,7 +93,7 @@ struct upc_req {
u_short uc_outSize;
u_short uc_opcode; /* copied from data to save lookup */
int uc_unique;
- struct wait_queue *uc_sleep; /* process' wait queue */
+ wait_queue_head_t uc_sleep; /* process' wait queue */
unsigned long uc_posttime;
};
diff --git a/include/linux/cyclades.h b/include/linux/cyclades.h
index 0f373ff5b..2c127526c 100644
--- a/include/linux/cyclades.h
+++ b/include/linux/cyclades.h
@@ -557,7 +557,8 @@ struct cyclades_port {
unsigned long event;
unsigned long last_active;
int count; /* # of fd on device */
- int x_break;
+ int breakon;
+ int breakoff;
int blocked_open; /* # of blocked opens */
long session; /* Session of opening process */
long pgrp; /* pgrp of opening process */
@@ -570,9 +571,9 @@ struct cyclades_port {
struct tq_struct tqueue;
struct termios normal_termios;
struct termios callout_termios;
- struct wait_queue *open_wait;
- struct wait_queue *close_wait;
- struct wait_queue *shutdown_wait;
+ wait_queue_head_t open_wait;
+ wait_queue_head_t close_wait;
+ wait_queue_head_t shutdown_wait;
struct cyclades_monitor mon;
unsigned long jiffies[3];
unsigned long rflush_count;
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 84e1376b3..825dfd28d 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -12,8 +12,6 @@
* with heavy changes by Linus Torvalds
*/
-#define D_MAXLEN 1024
-
#define IS_ROOT(x) ((x) == (x)->d_parent)
/*
@@ -132,7 +130,7 @@ extern void d_instantiate(struct dentry *, struct inode *);
extern void d_delete(struct dentry *);
/* allocate/de-allocate */
-extern struct dentry * d_alloc(struct dentry * parent, const struct qstr *name);
+extern struct dentry * d_alloc(struct dentry *, const struct qstr *);
extern void prune_dcache(int);
extern void shrink_dcache_sb(struct super_block *);
extern void shrink_dcache_parent(struct dentry *);
@@ -147,7 +145,7 @@ extern void check_dcache_memory(void);
extern void free_inode_memory(int); /* defined in fs/inode.c */
/* only used at mount-time */
-extern struct dentry * d_alloc_root(struct inode * root_inode, struct dentry * old_root);
+extern struct dentry * d_alloc_root(struct inode *);
/* test whether root is busy without destroying dcache */
extern int is_root_busy(struct dentry *);
@@ -155,7 +153,7 @@ extern int is_root_busy(struct dentry *);
/*
* This adds the entry to the hash queues.
*/
-extern void d_rehash(struct dentry * entry);
+extern void d_rehash(struct dentry *);
/*
* This adds the entry to the hash queues and initializes "d_inode".
* The entry was actually filled in earlier during "d_alloc()"
@@ -167,17 +165,16 @@ static __inline__ void d_add(struct dentry * entry, struct inode * inode)
}
/* used for rename() and baskets */
-extern void d_move(struct dentry * entry, struct dentry * newdentry);
+extern void d_move(struct dentry *, struct dentry *);
/* appendix may either be NULL or be used for transname suffixes */
-extern struct dentry * d_lookup(struct dentry * dir, struct qstr * name);
+extern struct dentry * d_lookup(struct dentry *, struct qstr *);
/* validate "insecure" dentry pointer */
-extern int d_validate(struct dentry *dentry, struct dentry *dparent,
- unsigned int hash, unsigned int len);
+extern int d_validate(struct dentry *, struct dentry *, unsigned int, unsigned int);
/* write full pathname into buffer and return start of pathname */
-extern char * d_path(struct dentry * entry, char * buf, int buflen);
+extern char * d_path(struct dentry *, char *, int);
/* Allocation counts.. */
static __inline__ struct dentry * dget(struct dentry *dentry)
diff --git a/include/linux/efs_fs.h b/include/linux/efs_fs.h
index 1e5fd23cd..a36f9d6fd 100644
--- a/include/linux/efs_fs.h
+++ b/include/linux/efs_fs.h
@@ -9,7 +9,7 @@
#ifndef __EFS_FS_H__
#define __EFS_FS_H__
-#define EFS_VERSION "1.0b"
+#define EFS_VERSION "1.0a"
static const char cprt[] = "EFS: "EFS_VERSION" - (c) 1999 Al Smith <Al.Smith@aeschi.ch.eu.org>";
diff --git a/include/linux/efs_fs_i.h b/include/linux/efs_fs_i.h
index 453d706ca..de55021ad 100644
--- a/include/linux/efs_fs_i.h
+++ b/include/linux/efs_fs_i.h
@@ -29,8 +29,7 @@ typedef union extent_u {
typedef struct edevs {
short odev;
- short dev_filler; /* force ndev to start */
- unsigned int ndev; /* on a 32-bit boundary */
+ unsigned int ndev;
} efs_devs;
/*
diff --git a/include/linux/efs_fs_sb.h b/include/linux/efs_fs_sb.h
index 95476663c..21d01d0d4 100644
--- a/include/linux/efs_fs_sb.h
+++ b/include/linux/efs_fs_sb.h
@@ -31,7 +31,6 @@ struct efs_super {
short fs_heads; /* heads per cylinder */
short fs_ncg; /* # of cylinder groups in filesystem */
short fs_dirty; /* fs needs to be fsck'd */
- short fs_filler; /* force fs_time to start 2bytes later*/
int32_t fs_time; /* last super-block update */
int32_t fs_magic; /* magic number */
char fs_fname[6]; /* file system name */
diff --git a/include/linux/epca.h b/include/linux/epca.h
index 504948149..18cedf37c 100644
--- a/include/linux/epca.h
+++ b/include/linux/epca.h
@@ -140,8 +140,8 @@ struct channel
struct tty_struct *tty;
struct termios normal_termios;
struct termios callout_termios;
- struct wait_queue *open_wait;
- struct wait_queue *close_wait;
+ wait_queue_head_t open_wait;
+ wait_queue_head_t close_wait;
struct tq_struct tqueue;
volatile struct global_data *mailbox;
};
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h
index b1352dc02..dcd36e63c 100644
--- a/include/linux/ext2_fs.h
+++ b/include/linux/ext2_fs.h
@@ -238,7 +238,7 @@ struct ext2_inode {
} masix1;
} osd1; /* OS dependent 1 */
__u32 i_block[EXT2_N_BLOCKS];/* Pointers to blocks */
- __u32 i_version; /* File version (for NFS) */
+ __u32 i_generation; /* File version (for NFS) */
__u32 i_file_acl; /* File ACL */
__u32 i_dir_acl; /* Directory ACL */
__u32 i_faddr; /* Fragment address */
diff --git a/include/linux/ext2_fs_i.h b/include/linux/ext2_fs_i.h
index 8f01f8ad9..72bcd5c06 100644
--- a/include/linux/ext2_fs_i.h
+++ b/include/linux/ext2_fs_i.h
@@ -29,7 +29,7 @@ struct ext2_inode_info {
__u32 i_file_acl;
__u32 i_dir_acl;
__u32 i_dtime;
- __u32 i_version;
+ __u32 not_used_1; /* FIX: not used/ 2.2 placeholder */
__u32 i_block_group;
__u32 i_next_alloc_block;
__u32 i_next_alloc_goal;
diff --git a/include/linux/file.h b/include/linux/file.h
index 05f388f08..0125f9087 100644
--- a/include/linux/file.h
+++ b/include/linux/file.h
@@ -44,7 +44,7 @@ extern inline struct file * fget(unsigned int fd)
/*
* Install a file pointer in the fd array.
*/
-extern inline void fd_install(unsigned int fd, struct file *file)
+extern inline void fd_install(unsigned int fd, struct file * file)
{
current->files->fd[fd] = file;
}
@@ -65,7 +65,7 @@ extern inline void fd_install(unsigned int fd, struct file *file)
* I suspect there are many other similar "optimizations" across the
* kernel...
*/
-extern void fput(struct file *file);
-extern void put_filp(struct file *file);
+extern void fput(struct file *);
+extern void put_filp(struct file *);
-#endif
+#endif /* __LINUX_FILE_H */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index e4ea5197f..c7a67e9fd 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -103,7 +103,8 @@ extern int max_super_blocks, nr_super_blocks;
/*
* Flags that can be altered by MS_REMOUNT
*/
-#define MS_RMT_MASK (MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME|MS_NODIRATIME)
+#define MS_RMT_MASK (MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|\
+ MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME|MS_NODIRATIME)
/*
* Magic mount flag number. Has to be or-ed to the flag values.
@@ -112,7 +113,7 @@ extern int max_super_blocks, nr_super_blocks;
#define MS_MGC_MSK 0xffff0000 /* magic flag number mask */
/*
- * Note that read-only etc flags are inode-specific: setting some file-system
+ * Note that nosuid etc flags are inode-specific: setting some file-system
* flags just means all the inodes inherit those flags by default. It might be
* possible to override it selectively if you really wanted to with some
* ioctl() that is not currently implemented.
@@ -140,6 +141,7 @@ extern int max_super_blocks, nr_super_blocks;
#define IS_NOATIME(inode) __IS_FLG(inode, MS_NOATIME)
#define IS_NODIRATIME(inode) __IS_FLG(inode, MS_NODIRATIME)
+
/* the read-only stuff doesn't really belong here, but any other place is
probably as bad and I don't want to create yet another include file. */
@@ -154,7 +156,13 @@ extern int max_super_blocks, nr_super_blocks;
#define BLKFRAGET _IO(0x12,101)/* get filesystem (mm/filemap.c) read-ahead */
#define BLKSECTSET _IO(0x12,102)/* set max sectors per request (ll_rw_blk.c) */
#define BLKSECTGET _IO(0x12,103)/* get max sectors per request (ll_rw_blk.c) */
-#define BLKSSZGET _IO(0x12,104)/* get block device sector size (reserved for) */
+#define BLKSSZGET _IO(0x12,104)/* get block device sector size */
+#if 0
+#define BLKPG _IO(0x12,105)/* See blkpg.h */
+/* This was here just to show that the number is taken -
+ probably all these _IO(0x12,*) ioctls should be moved to blkpg.h. */
+#endif
+
#define BMAP_IOCTL 1 /* obsolete - kept for compatibility */
#define FIBMAP _IO(0x00,1) /* bmap access */
@@ -164,9 +172,8 @@ extern int max_super_blocks, nr_super_blocks;
#include <asm/semaphore.h>
#include <asm/byteorder.h>
-#include <asm/bitops.h>
-extern void update_atime (struct inode *inode);
+extern void update_atime (struct inode *);
#define UPDATE_ATIME(inode) update_atime (inode)
extern void buffer_init(unsigned long);
@@ -213,7 +220,7 @@ struct buffer_head {
unsigned int b_list; /* List that this buffer appears */
unsigned long b_flushtime; /* Time when this (dirty) buffer
* should be written */
- struct wait_queue * b_wait;
+ wait_queue_head_t b_wait;
struct buffer_head ** b_pprev; /* doubly linked list of hash-queue */
struct buffer_head * b_prev_free; /* doubly linked list of buffers */
struct buffer_head * b_reqnext; /* request queue */
@@ -226,8 +233,7 @@ struct buffer_head {
};
typedef void (bh_end_io_t)(struct buffer_head *bh, int uptodate);
-void init_buffer(struct buffer_head *bh, kdev_t dev, int block,
- bh_end_io_t *handler, void *dev_id);
+void init_buffer(struct buffer_head *, kdev_t, int, bh_end_io_t *, void *);
static inline int buffer_uptodate(struct buffer_head * bh)
{
@@ -354,7 +360,7 @@ struct inode {
struct semaphore i_atomic_write;
struct inode_operations *i_op;
struct super_block *i_sb;
- struct wait_queue *i_wait;
+ wait_queue_head_t i_wait;
struct file_lock *i_flock;
struct vm_area_struct *i_mmap;
struct page *i_pages;
@@ -382,7 +388,7 @@ struct inode {
struct sysv_inode_info sysv_i;
struct affs_inode_info affs_i;
struct ufs_inode_info ufs_i;
- struct efs_inode_info efs_i;
+ struct efs_inode_info efs_i;
struct romfs_inode_info romfs_i;
struct coda_inode_info coda_i;
struct smb_inode_info smbfs_i;
@@ -455,7 +461,7 @@ struct file_lock {
struct file_lock *fl_prevblock;
fl_owner_t fl_owner;
unsigned int fl_pid;
- struct wait_queue *fl_wait;
+ wait_queue_head_t fl_wait;
struct file *fl_file;
unsigned char fl_flags;
unsigned char fl_type;
@@ -473,19 +479,17 @@ extern struct file_lock *file_lock_table;
#include <linux/fcntl.h>
-extern int fcntl_getlk(unsigned int fd, struct flock *l);
-extern int fcntl_setlk(unsigned int fd, unsigned int cmd, struct flock *l);
+extern int fcntl_getlk(unsigned int, struct flock *);
+extern int fcntl_setlk(unsigned int, unsigned int, struct flock *);
/* fs/locks.c */
-extern void locks_remove_posix(struct file *, fl_owner_t id);
+extern void locks_remove_posix(struct file *, fl_owner_t);
extern void locks_remove_flock(struct file *);
extern struct file_lock *posix_test_lock(struct file *, struct file_lock *);
extern int posix_lock_file(struct file *, struct file_lock *, unsigned int);
extern void posix_block_lock(struct file_lock *, struct file_lock *);
extern void posix_unblock_lock(struct file_lock *);
-#include <linux/stat.h>
-
struct fasync_struct {
int magic;
int fa_fd;
@@ -532,7 +536,7 @@ struct super_block {
unsigned long s_magic;
unsigned long s_time;
struct dentry *s_root;
- struct wait_queue *s_wait;
+ wait_queue_head_t s_wait;
struct inode *s_ibasket;
short int s_ibasket_count;
@@ -550,7 +554,7 @@ struct super_block {
struct sysv_sb_info sysv_sb;
struct affs_sb_info affs_sb;
struct ufs_sb_info ufs_sb;
- struct efs_sb_info efs_sb;
+ struct efs_sb_info efs_sb;
struct romfs_sb_info romfs_sb;
struct smb_sb_info smbfs_sb;
struct hfs_sb_info hfs_sb;
@@ -618,7 +622,7 @@ struct inode_operations {
void (*truncate) (struct inode *);
int (*permission) (struct inode *, int);
int (*smap) (struct inode *,int);
- int (*updatepage) (struct file *, struct page *, unsigned long, unsigned int, int);
+ int (*updatepage) (struct file *, struct page *, unsigned long, unsigned int);
int (*revalidate) (struct dentry *);
};
@@ -660,10 +664,8 @@ extern int unregister_filesystem(struct file_system_type *);
#define FLOCK_VERIFY_READ 1
#define FLOCK_VERIFY_WRITE 2
-extern int locks_mandatory_locked(struct inode *inode);
-extern int locks_mandatory_area(int read_write, struct inode *inode,
- struct file *filp, loff_t offset,
- size_t count);
+extern int locks_mandatory_locked(struct inode *);
+extern int locks_mandatory_area(int, struct inode *, struct file *, loff_t, size_t);
extern inline int locks_verify_locked(struct inode *inode)
{
@@ -702,35 +704,35 @@ extern void put_unused_fd(unsigned int);
extern struct file *filp_open(const char *, int, int);
extern int filp_close(struct file *, fl_owner_t id);
-extern char * getname(const char * filename);
+extern char * getname(const char *);
#define __getname() ((char *) __get_free_page(GFP_KERNEL))
#define putname(name) free_page((unsigned long)(name))
-extern void kill_fasync(struct fasync_struct *fa, int sig);
+extern void kill_fasync(struct fasync_struct *, int);
extern int register_blkdev(unsigned int, const char *, struct file_operations *);
-extern int unregister_blkdev(unsigned int major, const char * name);
-extern int blkdev_open(struct inode * inode, struct file * filp);
-extern int blkdev_release (struct inode * inode);
+extern int unregister_blkdev(unsigned int, const char *);
+extern int blkdev_open(struct inode *, struct file *);
+extern int blkdev_release (struct inode *);
extern struct file_operations def_blk_fops;
extern struct inode_operations blkdev_inode_operations;
/* fs/devices.c */
extern int register_chrdev(unsigned int, const char *, struct file_operations *);
-extern int unregister_chrdev(unsigned int major, const char * name);
-extern int chrdev_open(struct inode * inode, struct file * filp);
+extern int unregister_chrdev(unsigned int, const char *);
+extern int chrdev_open(struct inode *, struct file *);
extern struct file_operations def_chr_fops;
extern struct inode_operations chrdev_inode_operations;
-extern char * bdevname(kdev_t dev);
-extern char * cdevname(kdev_t dev);
-extern char * kdevname(kdev_t dev);
-
+extern char * bdevname(kdev_t);
+extern char * cdevname(kdev_t);
+extern char * kdevname(kdev_t);
+extern void init_special_inode(struct inode *, umode_t, int);
-extern void init_fifo(struct inode * inode);
+extern void init_fifo(struct inode *);
extern struct inode_operations fifo_inode_operations;
/* Invalid inode operations -- fs/bad_inode.c */
-extern void make_bad_inode(struct inode * inode);
-extern int is_bad_inode(struct inode * inode);
+extern void make_bad_inode(struct inode *);
+extern int is_bad_inode(struct inode *);
extern struct file_operations connecting_fifo_fops;
extern struct file_operations read_fifo_fops;
@@ -740,15 +742,15 @@ extern struct file_operations read_pipe_fops;
extern struct file_operations write_pipe_fops;
extern struct file_operations rdwr_pipe_fops;
-extern struct file_system_type *get_fs_type(const char *name);
+extern struct file_system_type *get_fs_type(const char *);
extern int fs_may_remount_ro(struct super_block *);
-extern int fs_may_mount(kdev_t dev);
+extern int fs_may_mount(kdev_t);
extern struct file *inuse_filps;
-extern void refile_buffer(struct buffer_head * buf);
-extern void set_writetime(struct buffer_head * buf, int flag);
+extern void refile_buffer(struct buffer_head *);
+extern void set_writetime(struct buffer_head *, int);
extern int try_to_free_buffers(struct page *);
extern int nr_buffers;
@@ -760,7 +762,7 @@ extern int nr_buffer_heads;
#define BUF_DIRTY 2 /* Dirty buffers, not yet scheduled for write */
#define NR_LIST 3
-void mark_buffer_uptodate(struct buffer_head * bh, int on);
+void mark_buffer_uptodate(struct buffer_head *, int);
extern inline void mark_buffer_clean(struct buffer_head * bh)
{
@@ -779,23 +781,23 @@ extern inline void mark_buffer_dirty(struct buffer_head * bh, int flag)
}
}
-extern int check_disk_change(kdev_t dev);
-extern int invalidate_inodes(struct super_block * sb);
+extern int check_disk_change(kdev_t);
+extern int invalidate_inodes(struct super_block *);
extern void invalidate_inode_pages(struct inode *);
-extern void invalidate_buffers(kdev_t dev);
-extern int floppy_is_wp(int minor);
-extern void sync_inodes(kdev_t dev);
-extern void write_inode_now(struct inode *inode);
-extern void sync_dev(kdev_t dev);
-extern int fsync_dev(kdev_t dev);
-extern void sync_supers(kdev_t dev);
-extern int bmap(struct inode * inode,int block);
+extern void invalidate_buffers(kdev_t);
+extern int floppy_is_wp(int);
+extern void sync_inodes(kdev_t);
+extern void write_inode_now(struct inode *);
+extern void sync_dev(kdev_t);
+extern int fsync_dev(kdev_t);
+extern void sync_supers(kdev_t);
+extern int bmap(struct inode *, int);
extern int notify_change(struct dentry *, struct iattr *);
-extern int permission(struct inode * inode,int mask);
-extern int get_write_access(struct inode *inode);
-extern void put_write_access(struct inode *inode);
-extern struct dentry * open_namei(const char * pathname, int flag, int mode);
-extern struct dentry * do_mknod(const char * filename, int mode, dev_t dev);
+extern int permission(struct inode *, int);
+extern int get_write_access(struct inode *);
+extern void put_write_access(struct inode *);
+extern struct dentry * open_namei(const char *, int, int);
+extern struct dentry * do_mknod(const char *, int, dev_t);
extern int do_pipe(int *);
/* fs/dcache.c -- generic fs support functions */
@@ -833,6 +835,8 @@ extern struct dentry * __namei(const char *, unsigned int);
#define lnamei(pathname) __namei(pathname, 0)
extern void iput(struct inode *);
+extern struct inode * igrab(struct inode *);
+extern ino_t iunique(struct super_block *, ino_t);
extern struct inode * iget(struct super_block *, unsigned long);
extern void clear_inode(struct inode *);
extern struct inode * get_empty_inode(void);
@@ -842,7 +846,7 @@ extern void remove_inode_hash(struct inode *);
extern struct file * get_empty_filp(void);
extern struct buffer_head * get_hash_table(kdev_t, int, int);
extern struct buffer_head * getblk(kdev_t, int, int);
-extern struct buffer_head * find_buffer(kdev_t dev, int block, int size);
+extern struct buffer_head * find_buffer(kdev_t, int, int);
extern void ll_rw_block(int, int, struct buffer_head * bh[]);
extern int is_read_only(kdev_t);
extern void __brelse(struct buffer_head *);
@@ -851,29 +855,30 @@ extern inline void brelse(struct buffer_head *buf)
if (buf)
__brelse(buf);
}
-extern void __bforget(struct buffer_head *buf);
+extern void __bforget(struct buffer_head *);
extern inline void bforget(struct buffer_head *buf)
{
if (buf)
__bforget(buf);
}
-extern void set_blocksize(kdev_t dev, int size);
-extern unsigned int get_hardblocksize(kdev_t dev);
-extern struct buffer_head * bread(kdev_t dev, int block, int size);
-extern struct buffer_head * breada(kdev_t dev,int block, int size,
- unsigned int pos, unsigned int filesize);
+extern void set_blocksize(kdev_t, int);
+extern unsigned int get_hardblocksize(kdev_t);
+extern struct buffer_head * bread(kdev_t, int, int);
+extern struct buffer_head * breada(kdev_t, int, int, unsigned int, unsigned int);
extern int brw_page(int, struct page *, kdev_t, int [], int, int);
+typedef long (*writepage_t)(struct file *, struct page *, unsigned long, unsigned long, const char *);
+
extern int generic_readpage(struct file *, struct page *);
extern int generic_file_mmap(struct file *, struct vm_area_struct *);
extern ssize_t generic_file_read(struct file *, char *, size_t, loff_t *);
-extern ssize_t generic_file_write(struct file *, const char*, size_t, loff_t*);
+extern ssize_t generic_file_write(struct file *, const char *, size_t, loff_t *, writepage_t);
-extern struct super_block *get_super(kdev_t dev);
-extern void put_super(kdev_t dev);
-unsigned long generate_cluster(kdev_t dev, int b[], int size);
-unsigned long generate_cluster_swab32(kdev_t dev, int b[], int size);
+extern struct super_block *get_super(kdev_t);
+extern void put_super(kdev_t);
+unsigned long generate_cluster(kdev_t, int b[], int);
+unsigned long generate_cluster_swab32(kdev_t, int b[], int);
extern kdev_t ROOT_DEV;
extern void show_buffers(void);
@@ -881,7 +886,7 @@ extern void mount_root(void);
#ifdef CONFIG_BLK_DEV_INITRD
extern kdev_t real_root_dev;
-extern int change_root(kdev_t new_root_dev,const char *put_old);
+extern int change_root(kdev_t, const char *);
#endif
extern ssize_t char_read(struct file *, char *, size_t, loff_t *);
@@ -891,8 +896,8 @@ extern int read_ahead[];
extern ssize_t char_write(struct file *, const char *, size_t, loff_t *);
extern ssize_t block_write(struct file *, const char *, size_t, loff_t *);
-extern int block_fsync(struct file *, struct dentry *dir);
-extern int file_fsync(struct file *, struct dentry *dir);
+extern int block_fsync(struct file *, struct dentry *);
+extern int file_fsync(struct file *, struct dentry *);
extern int inode_change_ok(struct inode *, struct iattr *);
extern void inode_setattr(struct inode *, struct iattr *);
@@ -903,4 +908,4 @@ extern void inode_setattr(struct inode *, struct iattr *);
#endif /* __KERNEL__ */
-#endif
+#endif /* _LINUX_FS_H */
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index fdd93a0b4..85bbf3422 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -22,7 +22,7 @@
#define CONFIG_SUN_PARTITION 1
#endif
-#if defined(CONFIG_SGI)
+#if defined(CONFIG_SGI) || defined(CONFIG_SGI_DISKLABEL)
#define CONFIG_SGI_PARTITION 1
#endif
@@ -39,7 +39,7 @@
#endif
#define DM6_PARTITION 0x54 /* has DDO: use xlated geom & offset */
-#define EZD_PARTITION 0x55 /* EZ-DRIVE: same as DM6 (we think) */
+#define EZD_PARTITION 0x55 /* EZ-DRIVE */
#define DM6_AUX1PARTITION 0x51 /* no DDO: use xlated geom */
#define DM6_AUX3PARTITION 0x53 /* no DDO: use xlated geom */
@@ -70,8 +70,8 @@ struct gendisk {
int max_nr; /* maximum number of real devices */
void (*init)(struct gendisk *); /* Initialization called before we do our thing */
- struct hd_struct *part; /* partition table */
- int *sizes; /* device size in blocks, copied to blk_size[] */
+ struct hd_struct *part; /* [indexed by minor] */
+ int *sizes; /* [idem], device size in blocks */
int nr_real; /* number of real devices */
void *real_devices; /* internal use */
@@ -226,14 +226,12 @@ struct unixware_disklabel {
#endif /* CONFIG_UNIXWARE_DISKLABEL */
+#ifdef __KERNEL__
extern struct gendisk *gendisk_head; /* linked list of disks */
-/*
- * disk_name() is used by genhd.c and md.c.
- * It formats the devicename of the indicated disk
- * into the supplied buffer, and returns a pointer
- * to that same buffer (for convenience).
- */
char *disk_name (struct gendisk *hd, int minor, char *buf);
+int get_hardsect_size(kdev_t dev);
+#endif
+
#endif
diff --git a/include/linux/hayesesp.h b/include/linux/hayesesp.h
index 2ed3903af..7efc5e31d 100644
--- a/include/linux/hayesesp.h
+++ b/include/linux/hayesesp.h
@@ -106,10 +106,10 @@ struct esp_struct {
struct tq_struct tqueue_hangup;
struct termios normal_termios;
struct termios callout_termios;
- struct wait_queue *open_wait;
- struct wait_queue *close_wait;
- struct wait_queue *delta_msr_wait;
- struct wait_queue *break_wait;
+ wait_queue_head_t open_wait;
+ wait_queue_head_t close_wait;
+ wait_queue_head_t delta_msr_wait;
+ wait_queue_head_t break_wait;
struct async_icount icount; /* kernel counters for the 4 input interrupts */
struct hayes_esp_config config; /* port configuration */
struct esp_struct *next_port; /* For the linked list */
diff --git a/include/linux/hdreg.h b/include/linux/hdreg.h
index e467ae9b6..2fee75fec 100644
--- a/include/linux/hdreg.h
+++ b/include/linux/hdreg.h
@@ -93,7 +93,43 @@
#define SMART_STATUS 0xda
#define SMART_AUTO_OFFLINE 0xdb
+/* WIN_SETFEATURES sub-commands */
+
+#define SETFEATURES_EN_WCACHE 0x02 /* Enable write cache */
+#define SETFEATURES_XFER 0x03 /* Set transfer mode */
+# define XFER_UDMA_4 0x44 /* 0100|0100 */
+# define XFER_UDMA_3 0x43 /* 0100|0011 */
+# define XFER_UDMA_2 0x42 /* 0100|0010 */
+# define XFER_UDMA_1 0x41 /* 0100|0001 */
+# define XFER_UDMA_0 0x40 /* 0100|0000 */
+# define XFER_MW_DMA_2 0x22 /* 0010|0010 */
+# define XFER_MW_DMA_1 0x21 /* 0010|0001 */
+# define XFER_MW_DMA_0 0x20 /* 0010|0000 */
+# define XFER_SW_DMA_2 0x12 /* 0001|0010 */
+# define XFER_SW_DMA_1 0x11 /* 0001|0001 */
+# define XFER_SW_DMA_0 0x10 /* 0001|0000 */
+# define XFER_PIO_4 0x0C /* 0000|1100 */
+# define XFER_PIO_3 0x0B /* 0000|1011 */
+# define XFER_PIO_2 0x0A /* 0000|1010 */
+# define XFER_PIO_1 0x09 /* 0000|1001 */
+# define XFER_PIO_0 0x08 /* 0000|1000 */
+# define XFER_PIO_SLOW 0x00 /* 0000|0000 */
+#define SETFEATURES_EN_APM 0x05 /* Enable advanced power management */
+#define SETFEATURES_DIS_MSN 0x31 /* Disable Media Status Notification */
+#define SETFEATURES_DIS_RLA 0x55 /* Disable read look-ahead feature */
+#define SETFEATURES_EN_RI 0x5D /* Enable release interrupt */
+#define SETFEATURES_EN_SI 0x5E /* Enable SERVICE interrupt */
+#define SETFEATURES_DIS_RPOD 0x66 /* Disable reverting to power on defaults */
+#define SETFEATURES_DIS_WCACHE 0x82 /* Disable write cache */
+#define SETFEATURES_DIS_APM 0x85 /* Disable advanced power management */
+#define SETFEATURES_EN_MSN 0x95 /* Enable Media Status Notification */
+#define SETFEATURES_EN_RLA 0xAA /* Enable read look-ahead feature */
+#define SETFEATURES_EN_RPOD 0xCC /* Enable reverting to power on defaults */
+#define SETFEATURES_DIS_RI 0xDD /* Disable release interrupt */
+#define SETFEATURES_DIS_SI 0xDE /* Disable SERVICE interrupt */
+
/* WIN_SECURITY sub-commands */
+
#define SECURITY_SET_PASSWORD 0xBA /* 0xF1 */
#define SECURITY_UNLOCK 0xBB /* 0xF2 */
#define SECURITY_ERASE_PREPARE 0xBC /* 0xF3 */
diff --git a/include/linux/hfmodem.h b/include/linux/hfmodem.h
index 7b35f1169..d23108ee9 100644
--- a/include/linux/hfmodem.h
+++ b/include/linux/hfmodem.h
@@ -155,7 +155,7 @@ struct hfmodem_state {
} clk;
int active;
- struct wait_queue *wait;
+ wait_queue_head_t wait;
struct {
__s16 *kbuf;
diff --git a/include/linux/hfs_fs.h b/include/linux/hfs_fs.h
index eaae0ecc5..ef2bc4105 100644
--- a/include/linux/hfs_fs.h
+++ b/include/linux/hfs_fs.h
@@ -82,17 +82,22 @@
#define HFS_SGL_DINF HFS_ITYPE_1 /* %DirInfo for directory */
/* IDs for elements of an AppleDouble or AppleSingle header */
-#define HFS_HDR_DATA 1
-#define HFS_HDR_RSRC 2
-#define HFS_HDR_FNAME 3
-#define HFS_HDR_COMNT 4
-#define HFS_HDR_BWICN 5
-#define HFS_HDR_CICON 6
-#define HFS_HDR_OLDI 7
-#define HFS_HDR_DATES 8
-#define HFS_HDR_FINFO 9
-#define HFS_HDR_MACI 10
-#define HFS_HDR_MAX 10
+#define HFS_HDR_DATA 1 /* data fork */
+#define HFS_HDR_RSRC 2 /* resource fork */
+#define HFS_HDR_FNAME 3 /* full (31-character) name */
+#define HFS_HDR_COMNT 4 /* comment */
+#define HFS_HDR_BWICN 5 /* b/w icon */
+#define HFS_HDR_CICON 6 /* color icon info */
+#define HFS_HDR_OLDI 7 /* old file info */
+#define HFS_HDR_DATES 8 /* file dates info */
+#define HFS_HDR_FINFO 9 /* Finder info */
+#define HFS_HDR_MACI 10 /* Macintosh info */
+#define HFS_HDR_PRODOSI 11 /* ProDOS info */
+#define HFS_HDR_MSDOSI 12 /* MSDOS info */
+#define HFS_HDR_SNAME 13 /* short name */
+#define HFS_HDR_AFPI 14 /* AFP file info */
+#define HFS_HDR_DID 15 /* directory id */
+#define HFS_HDR_MAX 16
/*
* There are three time systems. All three are based on seconds since
@@ -136,26 +141,7 @@ struct hfs_hdr_layout {
};
/*
- * Default header layout for Netatalk
- */
-struct hfs_nat_hdr {
- hfs_lword_t magic;
- hfs_lword_t version;
- hfs_byte_t homefs[16];
- hfs_word_t entries;
- hfs_byte_t descrs[60];
- hfs_byte_t real_name[255]; /* id=3 */
- hfs_byte_t comment[200]; /* id=4 XXX: not yet implemented */
- hfs_lword_t create_time; /* \ */
- hfs_lword_t modify_time; /* | */
- hfs_lword_t backup_time; /* | id=7 */
- hfs_word_t filler; /* | */
- hfs_word_t attr; /* / */
- hfs_byte_t finderinfo[32]; /* id=9 */
-};
-
-/*
- * Default header layout for AppleDouble
+ * Default header layout for Netatalk and AppleDouble
*/
struct hfs_dbl_hdr {
hfs_lword_t magic;
@@ -163,23 +149,37 @@ struct hfs_dbl_hdr {
hfs_byte_t filler[16];
hfs_word_t entries;
hfs_byte_t descrs[12*HFS_HDR_MAX];
- hfs_u32 create_time; /* \ */
- hfs_u32 modify_time; /* | id=8 */
- hfs_u32 backup_time; /* | */
- hfs_u32 access_time; /* / */
+ hfs_byte_t real_name[255]; /* id=3 */
+ hfs_byte_t comment[200]; /* id=4 XXX: not yet implemented */
+ hfs_u32 create_time; /* \ */
+ hfs_u32 modify_time; /* | id=8 (or 7) */
+ hfs_u32 backup_time; /* | */
+ hfs_u32 access_time; /* / (attributes with id=7) */
hfs_u8 finderinfo[32]; /* id=9 */
hfs_u32 fileinfo; /* id=10 */
- hfs_u8 real_name[32]; /* id=3 */
- hfs_u8 comment[200]; /* id=4 XXX: not yet implemented */
+ hfs_u32 cnid; /* id=15 */
+ hfs_u8 short_name[12]; /* id=13 */
+ hfs_u8 prodosi[8]; /* id=11 */
};
+
/* finder metadata for CAP */
struct hfs_cap_info {
hfs_byte_t fi_fndr[32]; /* Finder's info */
- hfs_word_t fi_attr; /* AFP attributes */
-#define HFS_AFP_WRI 0x020 /* Write inhibit bit */
-#define HFS_AFP_RNI 0x080 /* Rename inhibit bit (AFP >= 2.0) */
-#define HFS_AFP_DEI 0x100 /* Delete inhibit bit (AFP >= 2.0) */
+ hfs_word_t fi_attr; /* AFP attributes (f=file/d=dir) */
+#define HFS_AFP_INV 0x001 /* Invisible bit (f/d) */
+#define HFS_AFP_EXPFOLDER 0x002 /* exported folder (d) */
+#define HFS_AFP_MULTI 0x002 /* Multiuser bit (f) */
+#define HFS_AFP_SYS 0x004 /* System bit (f/d) */
+#define HFS_AFP_DOPEN 0x008 /* data fork already open (f) */
+#define HFS_AFP_MOUNTED 0x008 /* mounted folder (d) */
+#define HFS_AFP_ROPEN 0x010 /* resource fork already open (f) */
+#define HFS_AFP_INEXPFOLDER 0x010 /* folder in shared area (d) */
+#define HFS_AFP_WRI 0x020 /* Write inhibit bit (readonly) (f) */
+#define HFS_AFP_BACKUP 0x040 /* backup needed bit (f/d) */
+#define HFS_AFP_RNI 0x080 /* Rename inhibit bit (f/d) */
+#define HFS_AFP_DEI 0x100 /* Delete inhibit bit (f/d) */
+#define HFS_AFP_NOCOPY 0x400 /* Copy protect bit (f) */
#define HFS_AFP_RDONLY ( HFS_AFP_WRI|HFS_AFP_RNI|HFS_AFP_DEI)
hfs_byte_t fi_magic1; /* Magic number: */
#define HFS_CAP_MAGIC1 0xFF
@@ -225,7 +225,6 @@ extern hfs_rwret_t hfs_dir_read(struct file *, char *, hfs_rwarg_t,
loff_t *);
extern int hfs_create(struct inode *, struct dentry *, int);
extern int hfs_mkdir(struct inode *, struct dentry *, int);
-extern int hfs_mknod(struct inode *, struct dentry *, int, int);
extern int hfs_unlink(struct inode *, struct dentry *);
extern int hfs_rmdir(struct inode *, struct dentry *);
extern int hfs_rename(struct inode *, struct dentry *,
@@ -273,6 +272,7 @@ extern struct inode_operations hfs_hdr_inode_operations;
extern const struct hfs_hdr_layout hfs_dbl_fil_hdr_layout;
extern const struct hfs_hdr_layout hfs_dbl_dir_hdr_layout;
extern const struct hfs_hdr_layout hfs_nat_hdr_layout;
+extern const struct hfs_hdr_layout hfs_nat2_hdr_layout;
extern const struct hfs_hdr_layout hfs_sngl_hdr_layout;
/* inode.c */
@@ -280,10 +280,10 @@ extern void hfs_put_inode(struct inode *);
extern int hfs_notify_change(struct dentry *, struct iattr *);
extern struct inode *hfs_iget(struct hfs_cat_entry *, ino_t, struct dentry *);
-extern void hfs_cap_ifill(struct inode *, ino_t);
-extern void hfs_dbl_ifill(struct inode *, ino_t);
-extern void hfs_nat_ifill(struct inode *, ino_t);
-extern void hfs_sngl_ifill(struct inode *, ino_t);
+extern void hfs_cap_ifill(struct inode *, ino_t, const int);
+extern void hfs_dbl_ifill(struct inode *, ino_t, const int);
+extern void hfs_nat_ifill(struct inode *, ino_t, const int);
+extern void hfs_sngl_ifill(struct inode *, ino_t, const int);
/* super.c */
extern struct super_block *hfs_read_super(struct super_block *,void *,int);
diff --git a/include/linux/hfs_fs_sb.h b/include/linux/hfs_fs_sb.h
index c5279b201..826f388c5 100644
--- a/include/linux/hfs_fs_sb.h
+++ b/include/linux/hfs_fs_sb.h
@@ -16,7 +16,7 @@ struct hfs_name;
typedef int (*hfs_namein_fn) (char *, const struct hfs_name *);
typedef void (*hfs_nameout_fn) (struct hfs_name *, const char *, int);
-typedef void (*hfs_ifill_fn) (struct inode *, ino_t);
+typedef void (*hfs_ifill_fn) (struct inode *, ino_t, const int);
/*
* struct hfs_sb_info
@@ -30,6 +30,7 @@ struct hfs_sb_info {
changing owner or mode? */
int s_lowercase; /* Map names to lowercase? */
int s_afpd; /* AFPD compatible mode? */
+ int s_version; /* version info */
hfs_namein_fn s_namein; /* The function used to
map Mac filenames to
Linux filenames */
diff --git a/include/linux/hfs_sysdep.h b/include/linux/hfs_sysdep.h
index 00cc64008..c3b866f25 100644
--- a/include/linux/hfs_sysdep.h
+++ b/include/linux/hfs_sysdep.h
@@ -93,10 +93,10 @@ extern inline hfs_u32 hfs_time(void) {
/*
* hfs_wait_queue
*/
-typedef struct wait_queue *hfs_wait_queue;
+typedef wait_queue_head_t hfs_wait_queue;
extern inline void hfs_init_waitqueue(hfs_wait_queue *queue) {
- init_waitqueue(queue);
+ init_waitqueue_head(queue);
}
extern inline void hfs_sleep_on(hfs_wait_queue *queue) {
diff --git a/include/linux/hpfs_fs_i.h b/include/linux/hpfs_fs_i.h
index d9aa8f34d..7dea10b41 100644
--- a/include/linux/hpfs_fs_i.h
+++ b/include/linux/hpfs_fs_i.h
@@ -1,7 +1,17 @@
#ifndef _HPFS_FS_I
#define _HPFS_FS_I
+#if ANALWARNINGS
+#warning Fix the FIFO stuff!
+#warning Fix the FIFO stuff!
+#warning Fix the FIFO stuff!
+#endif
+
struct hpfs_inode_info {
+ union { /* Linux sometimes destroys this structure */
+ struct pipe_inode_info bla; /* due to a bug. Linus doesn't want to fix */
+ struct socket ble; /* it so I had to write this workaround :-) */
+ } dummy;
ino_t i_parent_dir; /* (directories) gives fnode of parent dir */
unsigned i_dno; /* (directories) root dnode */
unsigned i_dpos; /* (directories) temp for readdir */
@@ -9,7 +19,14 @@ struct hpfs_inode_info {
unsigned i_file_sec; /* (files) minimalist cache of alloc info */
unsigned i_disk_sec; /* (files) minimalist cache of alloc info */
unsigned i_n_secs; /* (files) minimalist cache of alloc info */
+ unsigned i_ea_size; /* size of extended attributes */
unsigned i_conv : 2; /* (files) crlf->newline hackery */
+ unsigned i_ea_mode : 1; /* file's permission is stored in ea */
+ unsigned i_ea_uid : 1; /* file's uid is stored in ea */
+ unsigned i_ea_gid : 1; /* file's gid is stored in ea */
+ unsigned i_dirty : 1;
+ struct semaphore i_sem; /* semaphore */
+ loff_t **i_rddir_off;
};
#define i_hpfs_dno u.hpfs_i.i_dno
@@ -19,6 +36,15 @@ struct hpfs_inode_info {
#define i_hpfs_disk_sec u.hpfs_i.i_disk_sec
#define i_hpfs_dpos u.hpfs_i.i_dpos
#define i_hpfs_dsubdno u.hpfs_i.i_dsubdno
+#define i_hpfs_ea_size u.hpfs_i.i_ea_size
#define i_hpfs_conv u.hpfs_i.i_conv
+#define i_hpfs_ea_mode u.hpfs_i.i_ea_mode
+#define i_hpfs_ea_uid u.hpfs_i.i_ea_uid
+#define i_hpfs_ea_gid u.hpfs_i.i_ea_gid
+/*#define i_hpfs_lock u.hpfs_i.i_lock*/
+/*#define i_hpfs_queue u.hpfs_i.i_queue*/
+#define i_hpfs_sem u.hpfs_i.i_sem
+#define i_hpfs_rddir_off u.hpfs_i.i_rddir_off
+#define i_hpfs_dirty u.hpfs_i.i_dirty
#endif
diff --git a/include/linux/hpfs_fs_sb.h b/include/linux/hpfs_fs_sb.h
index a383e16ba..9059054cf 100644
--- a/include/linux/hpfs_fs_sb.h
+++ b/include/linux/hpfs_fs_sb.h
@@ -5,6 +5,7 @@ struct hpfs_sb_info {
ino_t sb_root; /* inode number of root dir */
unsigned sb_fs_size; /* file system size, sectors */
unsigned sb_bitmaps; /* sector number of bitmap list */
+ unsigned sb_dirband_start; /* directory band start sector */
unsigned sb_dirband_size; /* directory band size, dnodes */
unsigned sb_dmap; /* sector number of dnode bit map */
unsigned sb_n_free; /* free blocks for statfs, or -1 */
@@ -12,13 +13,34 @@ struct hpfs_sb_info {
uid_t sb_uid; /* uid from mount options */
gid_t sb_gid; /* gid from mount options */
umode_t sb_mode; /* mode from mount options */
- unsigned sb_lowercase : 1; /* downcase filenames hackery */
unsigned sb_conv : 2; /* crlf->newline hackery */
+ unsigned sb_eas : 2; /* eas: 0-ignore, 1-ro, 2-rw */
+ unsigned sb_err : 2; /* on errs: 0-cont, 1-ro, 2-panic */
+ unsigned sb_chk : 2; /* checks: 0-no, 1-normal, 2-strict */
+ unsigned sb_lowercase : 1; /* downcase filenames hackery */
+ unsigned sb_was_error : 1; /* there was an error, set dirty flag */
+ unsigned sb_chkdsk : 2; /* chkdsk: 0-no, 1-on errs, 2-allways */
+ unsigned sb_rd_fnode : 2; /* read fnode 0-no 1-dirs 2-all */
+ unsigned sb_rd_inode : 2; /* lookup tells read_inode: 1-read fnode
+ 2-don't read fnode, file
+ 3-don't read fnode, direcotry */
+ wait_queue_head_t sb_iget_q;
+ unsigned char *sb_cp_table; /* code page tables: */
+ /* 128 bytes uppercasing table & */
+ /* 128 bytes lowercasing table */
+ unsigned *sb_bmp_dir; /* main bitmap directory */
+ unsigned sb_c_bitmap; /* current bitmap */
+ wait_queue_head_t sb_creation_de;/* when creating dirents, nobody else
+ can alloc blocks */
+ unsigned sb_creation_de_lock : 1;
+ /*unsigned sb_mounting : 1;*/
+ int sb_timeshift;
};
#define s_hpfs_root u.hpfs_sb.sb_root
#define s_hpfs_fs_size u.hpfs_sb.sb_fs_size
#define s_hpfs_bitmaps u.hpfs_sb.sb_bitmaps
+#define s_hpfs_dirband_start u.hpfs_sb.sb_dirband_start
#define s_hpfs_dirband_size u.hpfs_sb.sb_dirband_size
#define s_hpfs_dmap u.hpfs_sb.sb_dmap
#define s_hpfs_uid u.hpfs_sb.sb_uid
@@ -28,5 +50,20 @@ struct hpfs_sb_info {
#define s_hpfs_n_free_dnodes u.hpfs_sb.sb_n_free_dnodes
#define s_hpfs_lowercase u.hpfs_sb.sb_lowercase
#define s_hpfs_conv u.hpfs_sb.sb_conv
+#define s_hpfs_eas u.hpfs_sb.sb_eas
+#define s_hpfs_err u.hpfs_sb.sb_err
+#define s_hpfs_chk u.hpfs_sb.sb_chk
+#define s_hpfs_was_error u.hpfs_sb.sb_was_error
+#define s_hpfs_chkdsk u.hpfs_sb.sb_chkdsk
+/*#define s_hpfs_rd_fnode u.hpfs_sb.sb_rd_fnode*/
+#define s_hpfs_rd_inode u.hpfs_sb.sb_rd_inode
+#define s_hpfs_cp_table u.hpfs_sb.sb_cp_table
+#define s_hpfs_bmp_dir u.hpfs_sb.sb_bmp_dir
+#define s_hpfs_c_bitmap u.hpfs_sb.sb_c_bitmap
+#define s_hpfs_creation_de u.hpfs_sb.sb_creation_de
+#define s_hpfs_creation_de_lock u.hpfs_sb.sb_creation_de_lock
+#define s_hpfs_iget_q u.hpfs_sb.sb_iget_q
+/*#define s_hpfs_mounting u.hpfs_sb.sb_mounting*/
+#define s_hpfs_timeshift u.hpfs_sb.sb_timeshift
#endif
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 129e1ed58..29e9766ea 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -22,6 +22,8 @@
*
*/
+#include <linux/version.h>
+
#define I2C_BUS_MAX 4 /* max # of bus drivers */
#define I2C_DRIVER_MAX 8 /* max # of chip drivers */
#define I2C_DEVICE_MAX 8 /* max # if devices per bus/driver */
@@ -35,6 +37,7 @@ struct i2c_device;
#define I2C_DRIVERID_VIDEOTEXT 3
#define I2C_BUSID_BT848 1 /* I2C bus on a BT848 */
+#define I2C_BUSID_PARPORT 2 /* Bit banging on a parallel port */
/*
* struct for a driver for a i2c chip (tuner, soundprocessor,
diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h
index 39007c8bf..867320549 100644
--- a/include/linux/if_arp.h
+++ b/include/linux/if_arp.h
@@ -49,6 +49,7 @@
#define ARPHRD_PPP 512
#define ARPHRD_HDLC 513 /* (Cisco) HDLC */
#define ARPHRD_LAPB 516 /* LAPB */
+#define ARPHRD_DDCMP 517 /* Digital's DDCMP protocol */
#define ARPHRD_TUNNEL 768 /* IPIP tunnel */
#define ARPHRD_TUNNEL6 769 /* IPIP6 tunnel */
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h
index 3fae9a9de..99bb97fa2 100644
--- a/include/linux/if_ether.h
+++ b/include/linux/if_ether.h
@@ -9,7 +9,7 @@
*
* Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
* Donald Becker, <becker@super.org>
- * Alan Cox, <alan@cymru.net>
+ * Alan Cox, <alan@redhat.com>
* Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk>
*
* This program is free software; you can redistribute it and/or
diff --git a/include/linux/if_fddi.h b/include/linux/if_fddi.h
index 30bde75d9..221796362 100644
--- a/include/linux/if_fddi.h
+++ b/include/linux/if_fddi.h
@@ -12,7 +12,7 @@
* if_fddi.h is based on previous if_ether.h and if_tr.h work by
* Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
* Donald Becker, <becker@super.org>
- * Alan Cox, <alan@cymru.net>
+ * Alan Cox, <alan@redhat.com>
* Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk>
* Peter De Schrijver, <stud11@cc4.kuleuven.ac.be>
*
diff --git a/include/linux/if_hippi.h b/include/linux/if_hippi.h
index 4ed065939..52c4a80ba 100644
--- a/include/linux/if_hippi.h
+++ b/include/linux/if_hippi.h
@@ -9,7 +9,7 @@
*
* Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
* Donald Becker, <becker@super.org>
- * Alan Cox, <alan@cymru.net>
+ * Alan Cox, <alan@redhat.com>
* Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk>
* Jes Sorensen, <Jes.Sorensen@cern.ch>
*
diff --git a/include/linux/if_pppvar.h b/include/linux/if_pppvar.h
index d6cd0c25b..e01e4d23f 100644
--- a/include/linux/if_pppvar.h
+++ b/include/linux/if_pppvar.h
@@ -109,7 +109,7 @@ struct ppp {
__u16 rfcs; /* FCS so far of rpkt */
/* Queues for select() functionality */
- struct wait_queue *read_wait; /* queue for reading processes */
+ wait_queue_head_t read_wait; /* queue for reading processes */
/* info for detecting idle channels */
unsigned long last_xmit; /* time of last transmission */
diff --git a/include/linux/if_shaper.h b/include/linux/if_shaper.h
index 8a3cbce1b..da449f7e4 100644
--- a/include/linux/if_shaper.h
+++ b/include/linux/if_shaper.h
@@ -37,7 +37,7 @@ struct shaper
int (*hard_header_cache)(struct neighbour *neigh, struct hh_cache *hh);
void (*header_cache_update)(struct hh_cache *hh, struct device *dev, unsigned char * haddr);
struct net_device_stats* (*get_stats)(struct device *dev);
- struct wait_queue *wait_queue;
+ wait_queue_head_t wait_queue;
struct timer_list timer;
};
diff --git a/include/linux/igmp.h b/include/linux/igmp.h
index c13afde28..f3f6c2363 100644
--- a/include/linux/igmp.h
+++ b/include/linux/igmp.h
@@ -101,19 +101,7 @@ struct ip_mc_list
char loaded;
};
-extern __inline__ int ip_check_mc(struct device *dev, u32 mc_addr)
-{
- struct in_device *in_dev = dev->ip_ptr;
- struct ip_mc_list *im;
-
- if (in_dev) {
- for (im=in_dev->mc_list; im; im=im->next)
- if (im->multiaddr == mc_addr)
- return 1;
- }
- return 0;
-}
-
+extern int ip_check_mc(struct device *dev, u32 mc_addr);
extern int igmp_rcv(struct sk_buff *, unsigned short);
extern int ip_mc_join_group(struct sock *sk, struct ip_mreqn *imr);
extern int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr);
diff --git a/include/linux/inet.h b/include/linux/inet.h
index acb93765f..6a8e27bcd 100644
--- a/include/linux/inet.h
+++ b/include/linux/inet.h
@@ -46,6 +46,7 @@
extern void inet_proto_init(struct net_proto *pro);
extern char *in_ntoa(__u32 in);
+extern char *in_ntoa2(__u32 in, char *buf);
extern __u32 in_aton(const char *str);
#endif
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index 25c449598..d4de5b918 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -74,7 +74,7 @@ extern int devinet_ioctl(unsigned int cmd, void *);
extern void devinet_init(void);
extern struct in_device *inetdev_init(struct device *dev);
extern struct in_device *inetdev_by_index(int);
-extern u32 inet_select_addr(struct device *dev, u32 dst, int scope);
+extern u32 inet_select_addr(const struct device *dev, u32 dst, int scope);
extern struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, u32 prefix, u32 mask);
extern void inet_forward_change(void);
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index aa157d4a5..3e3edd8b1 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -35,6 +35,7 @@ enum {
SERIAL_BH,
RISCOM8_BH,
SPECIALIX_BH,
+ AURORA_BH,
ESP_BH,
NET_BH,
SCSI_BH,
diff --git a/include/linux/isdn.h b/include/linux/isdn.h
index 0b61899c0..c0a3ba309 100644
--- a/include/linux/isdn.h
+++ b/include/linux/isdn.h
@@ -1,4 +1,4 @@
-/* $Id: isdn.h,v 1.37 1998/02/22 19:45:24 fritz Exp $
+/* $Id: isdn.h,v 1.64 1999/04/18 14:57:14 fritz Exp $
*
* Main header for the Linux ISDN subsystem (linklevel).
*
@@ -20,11 +20,102 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * Note: This file differs from the corresponding revision as present in the
- * isdn4linux CVS repository because some later bug fixes have been extracted
- * from the repository and merged into this file. -- Henner Eisen
- *
* $Log: isdn.h,v $
+ * Revision 1.64 1999/04/18 14:57:14 fritz
+ * Removed TIMRU stuff
+ *
+ * Revision 1.63 1999/04/18 14:07:18 fritz
+ * Removed TIMRU stuff.
+ *
+ * Revision 1.62 1999/04/12 13:16:54 fritz
+ * Changes from 2.0 tree.
+ *
+ * Revision 1.61 1999/03/02 11:43:21 armin
+ * Added variable to store connect-message of Modem.
+ * Added Timer-define for RegS7 (Wait for Carrier).
+ *
+ * Revision 1.60 1998/10/25 14:50:29 fritz
+ * Backported from MIPS (Cobalt).
+ *
+ * Revision 1.59 1998/10/23 10:18:55 paul
+ * Implementation of "dialmode" (successor of "status")
+ * You also need current isdnctrl for this!
+ *
+ * Revision 1.58 1998/10/23 10:10:06 fritz
+ * Test-Checkin
+ *
+ * Revision 1.57 1998/08/31 21:10:01 he
+ * new ioctl IIOCNETGPN for /dev/isdninfo (get network interface'
+ * peer phone number)
+ *
+ * Revision 1.56 1998/07/26 18:46:52 armin
+ * Added silence detection in voice receive mode.
+ *
+ * Revision 1.55 1998/06/26 15:13:17 fritz
+ * Added handling of STAT_ICALL with incomplete CPN.
+ * Added AT&L for ttyI emulator.
+ * Added more locking stuff in tty_write.
+ *
+ * Revision 1.54 1998/06/18 23:32:01 fritz
+ * Replaced cli()/restore_flags() in isdn_tty_write() by locking.
+ * Removed direct-senddown feature in isdn_tty_write because it will
+ * never succeed with locking and is useless anyway.
+ *
+ * Revision 1.53 1998/06/17 19:51:51 he
+ * merged with 2.1.10[34] (cosmetics and udelay() -> mdelay())
+ * brute force fix to avoid Ugh's in isdn_tty_write()
+ * cleaned up some dead code
+ *
+ * Revision 1.52 1998/06/12 11:42:18 detabc
+ * cleanup abc
+ *
+ * Revision 1.51 1998/06/02 12:10:30 detabc
+ * wegen einer einstweiliger verfuegung gegen DW ist zur zeit
+ * die abc-extension bis zur klaerung der rechtslage nicht verfuegbar
+ *
+ * Revision 1.50 1998/05/05 23:11:51 detabc
+ * add Item to stop icmp-unreach (max. 6 times of dialwait delay)
+ *
+ * Revision 1.49 1998/05/03 17:45:00 detabc
+ * Add Item to send icmp-host-unreach to all packets
+ *
+ * Revision 1.48 1998/04/26 19:58:14 detabc
+ * include the new abc-extension-items from 2.0.xx kernels
+ * remove some unused code
+ *
+ * Revision 1.47 1998/04/21 18:00:25 detabc
+ * Add items for secure-callback (abc-extension only)
+ *
+ * Revision 1.46 1998/04/14 16:28:59 he
+ * Fixed user space access with interrupts off and remaining
+ * copy_{to,from}_user() -> -EFAULT return codes
+ *
+ * Revision 1.45 1998/03/24 16:33:12 hipp
+ * More CCP changes. BSD compression now "works" on a local loopback link.
+ * Moved some isdn_ppp stuff from isdn.h to isdn_ppp.h
+ *
+ * Revision 1.44 1998/03/22 18:50:56 hipp
+ * Added BSD Compression for syncPPP .. UNTESTED at the moment
+ *
+ * Revision 1.43 1998/03/09 17:46:44 he
+ * merged in 2.1.89 changes
+ *
+ * Revision 1.42 1998/03/08 13:53:46 detabc
+ * add ABC-variables in structur isdn_devt
+ *
+ * Revision 1.41 1998/03/08 13:14:37 detabc
+ * abc-extension support for kernels > 2.1.x
+ * first try (sorry experimental)
+ *
+ * Revision 1.40 1998/03/08 01:08:29 fritz
+ * Increased NET_DV because of TIMRU
+ *
+ * Revision 1.39 1998/03/07 22:42:49 fritz
+ * Starting generic module support (Nothing usable yet).
+ *
+ * Revision 1.38 1998/03/07 18:21:29 cal
+ * Dynamic Timeout-Rule-Handling vs. 971110 included
+ *
* Revision 1.37 1998/02/22 19:45:24 fritz
* Some changes regarding V.110
*
@@ -163,6 +254,7 @@
#ifndef isdn_h
#define isdn_h
+#include <linux/config.h>
#include <linux/ioctl.h>
#define ISDN_TTY_MAJOR 43
@@ -174,14 +266,20 @@
* the correspondent code in isdn.c
*/
+#ifdef CONFIG_COBALT_MICRO_SERVER
+/* Save memory */
+#define ISDN_MAX_DRIVERS 2
+#define ISDN_MAX_CHANNELS 8
+#else
#define ISDN_MAX_DRIVERS 32
#define ISDN_MAX_CHANNELS 64
+#endif
#define ISDN_MINOR_B 0
#define ISDN_MINOR_BMAX (ISDN_MAX_CHANNELS-1)
-#define ISDN_MINOR_CTRL ISDN_MAX_CHANNELS
-#define ISDN_MINOR_CTRLMAX (2*ISDN_MAX_CHANNELS-1)
-#define ISDN_MINOR_PPP (2*ISDN_MAX_CHANNELS)
-#define ISDN_MINOR_PPPMAX (3*ISDN_MAX_CHANNELS-1)
+#define ISDN_MINOR_CTRL 64
+#define ISDN_MINOR_CTRLMAX (64 + (ISDN_MAX_CHANNELS-1))
+#define ISDN_MINOR_PPP 128
+#define ISDN_MINOR_PPPMAX (128 + (ISDN_MAX_CHANNELS-1))
#define ISDN_MINOR_STATUS 255
/* New ioctl-codes */
@@ -192,8 +290,8 @@
#define IIOCNETANM _IO('I',5)
#define IIOCNETDNM _IO('I',6)
#define IIOCNETGNM _IO('I',7)
-#define IIOCGETSET _IO('I',8)
-#define IIOCSETSET _IO('I',9)
+#define IIOCGETSET _IO('I',8) /* no longer supported */
+#define IIOCSETSET _IO('I',9) /* no longer supported */
#define IIOCSETVER _IO('I',10)
#define IIOCNETHUP _IO('I',11)
#define IIOCSETGST _IO('I',12)
@@ -211,6 +309,8 @@
#define IIOCNETALN _IO('I',32)
#define IIOCNETDLN _IO('I',33)
+#define IIOCNETGPN _IO('I',34)
+
#define IIOCDBGVAR _IO('I',127)
#define IIOCDRVCTL _IO('I',128)
@@ -238,6 +338,8 @@
#define ISDN_MODEM_ANZREG 23 /* Number of Modem-Registers */
#define ISDN_MSNLEN 20
+#define ISDN_LMSNLEN 255 /* Length of tty's Listen-MSN string */
+#define ISDN_CMSGLEN 50 /* Length of CONNECT-Message to add for Modem */
typedef struct {
char drvid[25];
@@ -256,8 +358,9 @@ typedef struct {
int outgoing;
} isdn_net_ioctl_phone;
-#define NET_DV 0x04 /* Data version for net_cfg */
-#define TTY_DV 0x04 /* Data version for iprofd etc. */
+#define NET_DV 0x05 /* Data version for net_cfg */
+#define TTY_DV 0x05 /* Data version for iprofd etc. */
+#define INF_DV 0x01 /* Data version for /dev/isdninfo */
typedef struct {
char name[10]; /* Name of interface */
@@ -282,8 +385,17 @@ typedef struct {
int pppbind; /* ippp device for bindings */
int chargeint; /* Use fixed charge interval length */
int triggercps; /* BogoCPS needed for triggering slave */
+ int dialtimeout; /* Dial-Timeout */
+ int dialwait; /* Time to wait after failed dial */
+ int dialmode; /* Flag: off / on / auto */
} isdn_net_ioctl_cfg;
+#define ISDN_NET_DIALMODE_MASK 0xC0 /* bits for status */
+#define ISDN_NET_DM_OFF 0x00 /* this interface is stopped */
+#define ISDN_NET_DM_MANUAL 0x40 /* this interface is on (manual) */
+#define ISDN_NET_DM_AUTO 0x80 /* this interface is autodial */
+#define ISDN_NET_DIALMODE(x) ((&(x))->flags & ISDN_NET_DIALMODE_MASK)
+
#ifdef __KERNEL__
#ifndef STANDALONE
@@ -331,6 +443,7 @@ typedef struct {
#include <linux/isdnif.h>
+
#define ISDN_DRVIOCTL_MASK 0x7f /* Mask for Device-ioctl */
/* Until now unused */
@@ -372,14 +485,17 @@ typedef struct {
#define ISDN_TIMER_NETHANGUP 32
#define ISDN_TIMER_IPPP 64
#define ISDN_TIMER_KEEPALIVE 128 /* Cisco-Keepalive */
+#define ISDN_TIMER_CARRIER 256 /* Wait for Carrier */
#define ISDN_TIMER_FAST (ISDN_TIMER_MODEMREAD | ISDN_TIMER_MODEMPLUS | \
ISDN_TIMER_MODEMXMIT)
#define ISDN_TIMER_SLOW (ISDN_TIMER_MODEMRING | ISDN_TIMER_NETHANGUP | \
- ISDN_TIMER_NETDIAL | ISDN_TIMER_KEEPALIVE)
+ ISDN_TIMER_NETDIAL | ISDN_TIMER_KEEPALIVE | \
+ ISDN_TIMER_CARRIER)
/* Timeout-Values for isdn_net_dial() */
#define ISDN_TIMER_DTIMEOUT10 (10*HZ/(ISDN_TIMER_02SEC*(ISDN_TIMER_RES+1)))
#define ISDN_TIMER_DTIMEOUT15 (15*HZ/(ISDN_TIMER_02SEC*(ISDN_TIMER_RES+1)))
+#define ISDN_TIMER_DTIMEOUT60 (60*HZ/(ISDN_TIMER_02SEC*(ISDN_TIMER_RES+1)))
/* GLOBAL_FLAGS */
#define ISDN_GLOBAL_STOPPED 1
@@ -398,6 +514,7 @@ typedef struct {
#define ISDN_NET_TMP 0x10 /* tmp interface until getting an IP */
#define ISDN_NET_DYNAMIC 0x20 /* this link is dynamically allocated */
#endif
+
#define ISDN_NET_MAGIC 0x49344C02 /* for paranoia-checking */
/* Phone-list-element */
@@ -488,6 +605,11 @@ typedef struct isdn_net_local_s {
struct device *,
unsigned char *);
int pppbind; /* ippp device for bindings */
+ int dialtimeout; /* How long shall we try on dialing? (jiffies) */
+ int dialwait; /* How long shall we wait after failed attempt? (jiffies) */
+ ulong dialstarted; /* jiffies of first dialing-attempt */
+ ulong dialwait_timer; /* jiffies of earliest next dialing-attempt */
+ int huptimeout; /* How long will the connection be up? (seconds) */
#ifdef CONFIG_ISDN_X25
struct concap_device_ops *dops; /* callbacks used by encapsulator */
#endif
@@ -496,18 +618,6 @@ typedef struct isdn_net_local_s {
ulong cisco_yourseq; /* Remote keepalive seq. for Cisco */
} isdn_net_local;
-#ifdef CONFIG_ISDN_PPP
-struct ippp_bundle {
- int mp_mrru; /* unused */
- struct mpqueue *last; /* currently defined in isdn_net_dev */
- int min; /* currently calculated 'on the fly' */
- long next_num; /* we wanna see this seq.-number next */
- struct sqqueue *sq;
- int modify:1; /* set to 1 while modifying sqqueue */
- int bundled:1; /* bundle active ? */
-};
-#endif
-
/* the interface itself */
typedef struct isdn_net_dev_s {
isdn_net_local *local;
@@ -567,6 +677,10 @@ typedef struct atemu {
u_char mdmreg[ISDN_MODEM_ANZREG]; /* Modem-Registers */
char pmsn[ISDN_MSNLEN]; /* EAZ/MSNs Profile 0 */
char msn[ISDN_MSNLEN]; /* EAZ/MSN */
+ char plmsn[ISDN_LMSNLEN]; /* Listening MSNs Profile 0 */
+ char lmsn[ISDN_LMSNLEN]; /* Listening MSNs */
+ char cpn[ISDN_MSNLEN]; /* CalledPartyNumber on incoming call */
+ char connmsg[ISDN_CMSGLEN]; /* CONNECT-Msg from HL-Driver */
#ifdef CONFIG_ISDN_AUDIO
u_char vpar[10]; /* Voice-parameters */
int lastDLE; /* Flag for voice-coding: DLE seen */
@@ -574,6 +688,7 @@ typedef struct atemu {
int mdmcmdl; /* Length of Modem-Commandbuffer */
int pluscount; /* Counter for +++ sequence */
int lastplus; /* Timestamp of last + */
+ int carrierwait; /* Seconds of carrier waiting */
char mdmcmd[255]; /* Modem-Commandbuffer */
unsigned int charge; /* Charge units of current connection */
} atemu;
@@ -593,7 +708,7 @@ typedef struct modem_info {
long pgrp; /* pgrp of opening process */
int online; /* 1 = B-Channel is up, drop data */
/* 2 = B-Channel is up, deliver d.*/
- int dialing; /* Dial in progress */
+ int dialing; /* Dial in progress or ATA */
int rcvsched; /* Receive needs schedule */
int isdn_driver; /* Index to isdn-driver */
int isdn_channel; /* Index to isdn-channel */
@@ -612,6 +727,7 @@ typedef struct modem_info {
int xmit_count; /* # of chars in xmit_buf */
unsigned char *xmit_buf; /* transmit buffer */
struct sk_buff_head xmit_queue; /* transmit queue */
+ atomic_t xmit_lock; /* Semaphore for isdn_tty_write */
#ifdef CONFIG_ISDN_AUDIO
int vonline; /* Voice-channel status */
/* Bit 0 = recording */
@@ -621,13 +737,19 @@ typedef struct modem_info {
void *adpcms; /* state for adpcm decompression */
void *adpcmr; /* state for adpcm compression */
void *dtmf_state; /* state for dtmf decoder */
+ void *silence_state; /* state for silence detection */
#endif
struct tty_struct *tty; /* Pointer to corresponding tty */
atemu emu; /* AT-emulator data */
struct termios normal_termios; /* For saving termios structs */
struct termios callout_termios;
+#if LINUX_VERSION_CODE < 131841
struct wait_queue *open_wait;
struct wait_queue *close_wait;
+#else
+ wait_queue_head_t open_wait, close_wait;
+#endif
+ struct semaphore write_sem;
} modem_info;
#define ISDN_MODEM_WINSIZE 8
@@ -645,72 +767,6 @@ typedef struct {
/*======================= End of ISDN-tty stuff ============================*/
-/*======================= Start of sync-ppp stuff ==========================*/
-
-
-#define NUM_RCV_BUFFS 64
-#define PPP_HARD_HDR_LEN 4
-
-#ifdef CONFIG_ISDN_PPP
-
-struct sqqueue {
- struct sqqueue *next;
- long sqno_start;
- long sqno_end;
- struct sk_buff *skb;
- long timer;
-};
-
-struct mpqueue {
- struct mpqueue *next;
- struct mpqueue *last;
- long sqno;
- struct sk_buff *skb;
- int BEbyte;
- unsigned long time;
-};
-
-struct ippp_buf_queue {
- struct ippp_buf_queue *next;
- struct ippp_buf_queue *last;
- char *buf; /* NULL here indicates end of queue */
- int len;
-};
-
-struct ippp_struct {
- struct ippp_struct *next_link;
- int state;
- struct ippp_buf_queue rq[NUM_RCV_BUFFS]; /* packet queue for isdn_ppp_read() */
- struct ippp_buf_queue *first; /* pointer to (current) first packet */
- struct ippp_buf_queue *last; /* pointer to (current) last used packet in queue */
- struct wait_queue *wq;
- struct wait_queue *wq1;
- struct task_struct *tk;
- unsigned int mpppcfg;
- unsigned int pppcfg;
- unsigned int mru;
- unsigned int mpmru;
- unsigned int mpmtu;
- unsigned int maxcid;
- isdn_net_local *lp;
- int unit;
- int minor;
- long last_link_seqno;
- long mp_seqno;
- long range;
-#ifdef CONFIG_ISDN_PPP_VJ
- unsigned char *cbuf;
- struct slcompress *slcomp;
-#endif
- unsigned long debug;
- struct isdn_ppp_compressor *compressor,*link_compressor;
- void *decomp_stat,*comp_stat,*link_decomp_stat,*link_comp_stat;
-};
-
-#endif
-
-/*======================== End of sync-ppp stuff ===========================*/
-
/*======================== Start of V.110 stuff ============================*/
#define V110_BUFSIZE 1024
@@ -743,69 +799,103 @@ typedef struct {
char *private;
} infostruct;
+typedef struct isdn_module {
+ struct isdn_module *prev;
+ struct isdn_module *next;
+ char *name;
+ int (*get_free_channel)(int, int, int, int, int);
+ int (*free_channel)(int, int, int);
+ int (*status_callback)(isdn_ctrl *);
+ int (*command)(isdn_ctrl *);
+ int (*receive_callback)(int, int, struct sk_buff *);
+ int (*writebuf_skb)(int, int, int, struct sk_buff *);
+ int (*net_start_xmit)(struct sk_buff *, struct device *);
+ int (*net_receive)(struct device *, struct sk_buff *);
+ int (*net_open)(struct device *);
+ int (*net_close)(struct device *);
+ int priority;
+} isdn_module;
+
+#define DRV_FLAG_RUNNING 1
+#define DRV_FLAG_REJBUS 2
+#define DRV_FLAG_LOADED 4
+
/* Description of hardware-level-driver */
typedef struct {
- ulong flags; /* Flags */
- int channels; /* Number of channels */
- int reject_bus; /* Flag: Reject rejected call on bus*/
- struct wait_queue *st_waitq; /* Wait-Queue for status-read's */
- int maxbufsize; /* Maximum Buffersize supported */
- unsigned long pktcount; /* Until now: unused */
- int running; /* Flag: Protocolcode running */
- int loaded; /* Flag: Driver loaded */
- int stavail; /* Chars avail on Status-device */
- isdn_if *interface; /* Interface to driver */
- int *rcverr; /* Error-counters for B-Ch.-receive */
- int *rcvcount; /* Byte-counters for B-Ch.-receive */
+ ulong online; /* Channel-Online flags */
+ ulong flags; /* Misc driver Flags */
+ int locks; /* Number of locks for this driver */
+ int channels; /* Number of channels */
+#if LINUX_VERSION_CODE < 131841
+ struct wait_queue *st_waitq; /* Wait-Queue for status-read's */
+#else
+ wait_queue_head_t st_waitq; /* Wait-Queue for status-read's */
+#endif
+ int maxbufsize; /* Maximum Buffersize supported */
+ unsigned long pktcount; /* Until now: unused */
+ int stavail; /* Chars avail on Status-device */
+ isdn_if *interface; /* Interface to driver */
+ int *rcverr; /* Error-counters for B-Ch.-receive */
+ int *rcvcount; /* Byte-counters for B-Ch.-receive */
#ifdef CONFIG_ISDN_AUDIO
- unsigned long DLEflag; /* Flags: Insert DLE at next read */
+ unsigned long DLEflag; /* Flags: Insert DLE at next read */
+#endif
+ struct sk_buff_head *rpqueue; /* Pointers to start of Rcv-Queue */
+#if LINUX_VERSION_CODE < 131841
+ struct wait_queue **rcv_waitq; /* Wait-Queues for B-Channel-Reads */
+ struct wait_queue **snd_waitq; /* Wait-Queue for B-Channel-Send's */
+#else
+ wait_queue_head_t *rcv_waitq; /* Wait-Queues for B-Channel-Reads */
+ wait_queue_head_t *snd_waitq; /* Wait-Queue for B-Channel-Send's */
#endif
- struct sk_buff_head *rpqueue; /* Pointers to start of Rcv-Queue */
- struct wait_queue **rcv_waitq; /* Wait-Queues for B-Channel-Reads */
- struct wait_queue **snd_waitq; /* Wait-Queue for B-Channel-Send's */
- char msn2eaz[10][ISDN_MSNLEN]; /* Mapping-Table MSN->EAZ */
+ char msn2eaz[10][ISDN_MSNLEN]; /* Mapping-Table MSN->EAZ */
} driver;
/* Main driver-data */
typedef struct isdn_devt {
- unsigned short flags; /* Bitmapped Flags: */
- /* */
- int drivers; /* Current number of drivers */
- int channels; /* Current number of channels */
- int net_verbose; /* Verbose-Flag */
- int modempoll; /* Flag: tty-read active */
- int tflags; /* Timer-Flags: */
- /* see ISDN_TIMER_..defines */
- int global_flags;
- infostruct *infochain; /* List of open info-devs. */
- struct wait_queue *info_waitq; /* Wait-Queue for isdninfo */
- struct timer_list timer; /* Misc.-function Timer */
- int chanmap[ISDN_MAX_CHANNELS];/* Map minor->device-channel */
- int drvmap[ISDN_MAX_CHANNELS]; /* Map minor->driver-index */
- int usage[ISDN_MAX_CHANNELS]; /* Used by tty/ip/voice */
- char num[ISDN_MAX_CHANNELS][ISDN_MSNLEN];
- /* Remote number of active ch.*/
- int m_idx[ISDN_MAX_CHANNELS]; /* Index for mdm.... */
- driver *drv[ISDN_MAX_DRIVERS]; /* Array of drivers */
- isdn_net_dev *netdev; /* Linked list of net-if's */
- char drvid[ISDN_MAX_DRIVERS][20];/* Driver-ID */
- struct task_struct *profd; /* For iprofd */
- modem mdm; /* tty-driver-data */
- isdn_net_dev *rx_netdev[ISDN_MAX_CHANNELS]; /* rx netdev-pointers */
- isdn_net_dev *st_netdev[ISDN_MAX_CHANNELS]; /* stat netdev-pointers */
- ulong ibytes[ISDN_MAX_CHANNELS]; /* Statistics incoming bytes */
- ulong obytes[ISDN_MAX_CHANNELS]; /* Statistics outgoing bytes */
- int v110emu[ISDN_MAX_CHANNELS];/* V.110 emulator-mode 0=none */
- atomic_t v110use[ISDN_MAX_CHANNELS];/* Usage-Semaphore for stream */
- isdn_v110_stream *v110[ISDN_MAX_CHANNELS]; /* V.110 private data */
- struct semaphore sem; /* serialize list access*/
+ unsigned short flags; /* Bitmapped Flags: */
+ /* */
+ int drivers; /* Current number of drivers */
+ int channels; /* Current number of channels */
+ int net_verbose; /* Verbose-Flag */
+ int modempoll; /* Flag: tty-read active */
+ int tflags; /* Timer-Flags: */
+ /* see ISDN_TIMER_..defines */
+ int global_flags;
+ infostruct *infochain; /* List of open info-devs. */
+#if LINUX_VERSION_CODE < 131841
+ struct wait_queue *info_waitq; /* Wait-Queue for isdninfo */
+#else
+ wait_queue_head_t info_waitq; /* Wait-Queue for isdninfo */
+#endif
+ struct timer_list timer; /* Misc.-function Timer */
+ int chanmap[ISDN_MAX_CHANNELS];/* Map minor->device-channel */
+ int drvmap[ISDN_MAX_CHANNELS]; /* Map minor->driver-index */
+ int usage[ISDN_MAX_CHANNELS]; /* Used by tty/ip/voice */
+ char num[ISDN_MAX_CHANNELS][ISDN_MSNLEN];
+ /* Remote number of active ch.*/
+ int m_idx[ISDN_MAX_CHANNELS]; /* Index for mdm.... */
+ driver *drv[ISDN_MAX_DRIVERS]; /* Array of drivers */
+ isdn_net_dev *netdev; /* Linked list of net-if's */
+ char drvid[ISDN_MAX_DRIVERS][20];/* Driver-ID */
+ struct task_struct *profd; /* For iprofd */
+ modem mdm; /* tty-driver-data */
+ isdn_net_dev *rx_netdev[ISDN_MAX_CHANNELS]; /* rx netdev-pointers */
+ isdn_net_dev *st_netdev[ISDN_MAX_CHANNELS]; /* stat netdev-pointers */
+ ulong ibytes[ISDN_MAX_CHANNELS]; /* Statistics incoming bytes */
+ ulong obytes[ISDN_MAX_CHANNELS]; /* Statistics outgoing bytes */
+ int v110emu[ISDN_MAX_CHANNELS];/* V.110 emulator-mode 0=none */
+ atomic_t v110use[ISDN_MAX_CHANNELS];/* Usage-Semaphore for stream */
+ isdn_v110_stream *v110[ISDN_MAX_CHANNELS]; /* V.110 private data */
+ struct semaphore sem; /* serialize list access*/
+ isdn_module *modules;
} isdn_dev;
extern isdn_dev *dev;
+
/* Utility-Macros */
#define MIN(a,b) ((a<b)?a:b)
#define MAX(a,b) ((a>b)?a:b)
-
#endif /* __KERNEL__ */
#endif /* isdn_h */
diff --git a/include/linux/isdn_ppp.h b/include/linux/isdn_ppp.h
index 177646520..39c63d5cb 100644
--- a/include/linux/isdn_ppp.h
+++ b/include/linux/isdn_ppp.h
@@ -1,19 +1,22 @@
+/* -*- mode: c; c-basic-offset: 2 -*- */
+
#ifndef _LINUX_ISDN_PPP_H
#define _LINUX_ISDN_PPP_H
-extern int isdn_ppp_dial_slave(char *);
-extern int isdn_ppp_hangup_slave(char *);
+#include <linux/config.h>
#define CALLTYPE_INCOMING 0x1
#define CALLTYPE_OUTGOING 0x2
#define CALLTYPE_CALLBACK 0x4
+#define IPPP_VERSION "2.2.0"
+
struct pppcallinfo
{
- int calltype;
- unsigned char local_num[64];
- unsigned char remote_num[64];
- int charge_units;
+ int calltype;
+ unsigned char local_num[64];
+ unsigned char remote_num[64];
+ int charge_units;
};
#define PPPIOCGCALLINFO _IOWR('t',128,struct pppcallinfo)
@@ -22,48 +25,216 @@ struct pppcallinfo
#define PPPIOCSMPFLAGS _IOW('t',131,int)
#define PPPIOCSMPMTU _IOW('t',132,int)
#define PPPIOCSMPMRU _IOW('t',133,int)
-#define PPPIOCGCOMPRESSORS _IOR('t',134,unsigned long)
+#define PPPIOCGCOMPRESSORS _IOR('t',134,unsigned long [8])
#define PPPIOCSCOMPRESSOR _IOW('t',135,int)
+#define PPPIOCGIFNAME _IOR('t',136, char [IFNAMSIZ] )
#define PPP_MP 0x003d
#define PPP_LINK_COMP 0x00fb
+#define PPP_LINK_CCP 0x80fb
#define SC_MP_PROT 0x00000200
#define SC_REJ_MP_PROT 0x00000400
#define SC_OUT_SHORT_SEQ 0x00000800
#define SC_IN_SHORT_SEQ 0x00004000
+#define SC_DECOMP_ON 0x01
+#define SC_COMP_ON 0x02
+#define SC_DECOMP_DISCARD 0x04
+#define SC_COMP_DISCARD 0x08
+#define SC_LINK_DECOMP_ON 0x10
+#define SC_LINK_COMP_ON 0x20
+#define SC_LINK_DECOMP_DISCARD 0x40
+#define SC_LINK_COMP_DISCARD 0x80
+
+#define DECOMP_ERR_NOMEM (-10)
+
#define MP_END_FRAG 0x40
#define MP_BEGIN_FRAG 0x80
+#define ISDN_PPP_COMP_MAX_OPTIONS 16
+
+#define IPPP_COMP_FLAG_XMIT 0x1
+#define IPPP_COMP_FLAG_LINK 0x2
+
+struct isdn_ppp_comp_data {
+ int num;
+ unsigned char options[ISDN_PPP_COMP_MAX_OPTIONS];
+ int optlen;
+ int flags;
+};
+
#ifdef __KERNEL__
+
+/*
+ * We need a way for the decompressor to influence the generation of CCP
+ * Reset-Requests in a variety of ways. The decompressor is already returning
+ * a lot of information (generated skb length, error conditions) so we use
+ * another parameter. This parameter is a pointer to a structure which is
+ * to be marked valid by the decompressor and only in this case is ever used.
+ * Furthermore, the only case where this data is used is when the decom-
+ * pressor returns DECOMP_ERROR.
+ *
+ * We use this same struct for the reset entry of the compressor to commu-
+ * nicate to its caller how to deal with sending of a Reset Ack. In this
+ * case, expra is not used, but other options still apply (supressing
+ * sending with rsend, appending arbitrary data, etc).
+ */
+
+#define IPPP_RESET_MAXDATABYTES 32
+
+struct isdn_ppp_resetparams {
+ unsigned char valid:1; /* rw Is this structure filled at all ? */
+ unsigned char rsend:1; /* rw Should we send one at all ? */
+ unsigned char idval:1; /* rw Is the id field valid ? */
+ unsigned char dtval:1; /* rw Is the data field valid ? */
+ unsigned char expra:1; /* rw Is an Ack expected for this Req ? */
+ unsigned char id; /* wo Send CCP ResetReq with this id */
+ unsigned short maxdlen; /* ro Max bytes to be stored in data field */
+ unsigned short dlen; /* rw Bytes stored in data field */
+ unsigned char *data; /* wo Data for ResetReq info field */
+};
+
/*
* this is an 'old friend' from ppp-comp.h under a new name
* check the original include for more information
*/
struct isdn_ppp_compressor {
- struct isdn_ppp_compressor *next,*prev;
- int num; /* CCP compression protocol number */
- void *(*comp_alloc) (unsigned char *options, int opt_len);
- void (*comp_free) (void *state);
- int (*comp_init) (void *state, unsigned char *options, int opt_len,
- int unit, int opthdr, int debug);
- void (*comp_reset) (void *state);
- int (*compress) (void *state,struct sk_buff *in, struct sk_buff *skb_out,
- int proto);
- void (*comp_stat) (void *state, struct compstat *stats);
- void *(*decomp_alloc) (unsigned char *options, int opt_len);
- void (*decomp_free) (void *state);
- int (*decomp_init) (void *state, unsigned char *options,
- int opt_len, int unit, int opthdr, int mru, int debug);
- void (*decomp_reset) (void *state);
- int (*decompress) (void *state, unsigned char *ibuf, int isize, unsigned char *obuf, int osize);
- void (*incomp) (void *state, unsigned char *ibuf, int icnt);
- void (*decomp_stat) (void *state, struct compstat *stats);
+ struct isdn_ppp_compressor *next, *prev;
+ int num; /* CCP compression protocol number */
+
+ void *(*alloc) (struct isdn_ppp_comp_data *);
+ void (*free) (void *state);
+ int (*init) (void *state, struct isdn_ppp_comp_data *,
+ int unit,int debug);
+
+ /* The reset entry needs to get more exact information about the
+ ResetReq or ResetAck it was called with. The parameters are
+ obvious. If reset is called without a Req or Ack frame which
+ could be handed into it, code MUST be set to 0. Using rsparm,
+ the reset entry can control if and how a ResetAck is returned. */
+
+ void (*reset) (void *state, unsigned char code, unsigned char id,
+ unsigned char *data, unsigned len,
+ struct isdn_ppp_resetparams *rsparm);
+
+ int (*compress) (void *state, struct sk_buff *in,
+ struct sk_buff *skb_out, int proto);
+
+ int (*decompress) (void *state,struct sk_buff *in,
+ struct sk_buff *skb_out,
+ struct isdn_ppp_resetparams *rsparm);
+
+ void (*incomp) (void *state, struct sk_buff *in,int proto);
+ void (*stat) (void *state, struct compstat *stats);
};
extern int isdn_ppp_register_compressor(struct isdn_ppp_compressor *);
extern int isdn_ppp_unregister_compressor(struct isdn_ppp_compressor *);
+extern int isdn_ppp_dial_slave(char *);
+extern int isdn_ppp_hangup_slave(char *);
+
+struct ippp_bundle {
+ int mp_mrru; /* unused */
+ struct mpqueue *last; /* currently defined in isdn_net_dev */
+ int min; /* currently calculated 'on the fly' */
+ long next_num; /* we wanna see this seq.-number next */
+ struct sqqueue *sq;
+ int modify:1; /* set to 1 while modifying sqqueue */
+ int bundled:1; /* bundle active ? */
+};
+
+#define NUM_RCV_BUFFS 64
+
+struct sqqueue {
+ struct sqqueue *next;
+ long sqno_start;
+ long sqno_end;
+ struct sk_buff *skb;
+ long timer;
+};
+
+struct mpqueue {
+ struct mpqueue *next;
+ struct mpqueue *last;
+ long sqno;
+ struct sk_buff *skb;
+ int BEbyte;
+ unsigned long time;
+};
+
+struct ippp_buf_queue {
+ struct ippp_buf_queue *next;
+ struct ippp_buf_queue *last;
+ char *buf; /* NULL here indicates end of queue */
+ int len;
+};
+
+/* The data structure for one CCP reset transaction */
+enum ippp_ccp_reset_states {
+ CCPResetIdle,
+ CCPResetSentReq,
+ CCPResetRcvdReq,
+ CCPResetSentAck,
+ CCPResetRcvdAck
+};
+
+struct ippp_ccp_reset_state {
+ enum ippp_ccp_reset_states state; /* State of this transaction */
+ struct ippp_struct *is; /* Backlink to device stuff */
+ unsigned char id; /* Backlink id index */
+ unsigned char ta:1; /* The timer is active (flag) */
+ unsigned char expra:1; /* We expect a ResetAck at all */
+ int dlen; /* Databytes stored in data */
+ struct timer_list timer; /* For timeouts/retries */
+ /* This is a hack but seems sufficient for the moment. We do not want
+ to have this be yet another allocation for some bytes, it is more
+ memory management overhead than the whole mess is worth. */
+ unsigned char data[IPPP_RESET_MAXDATABYTES];
+};
+
+/* The data structure keeping track of the currently outstanding CCP Reset
+ transactions. */
+struct ippp_ccp_reset {
+ struct ippp_ccp_reset_state *rs[256]; /* One per possible id */
+ unsigned char lastid; /* Last id allocated by the engine */
+};
+
+struct ippp_struct {
+ struct ippp_struct *next_link;
+ int state;
+ struct ippp_buf_queue rq[NUM_RCV_BUFFS]; /* packet queue for isdn_ppp_read() */
+ struct ippp_buf_queue *first; /* pointer to (current) first packet */
+ struct ippp_buf_queue *last; /* pointer to (current) last used packet in queue */
+#if LINUX_VERSION_CODE < 131841
+ struct wait_queue *wq;
+#else
+ wait_queue_head_t wq;
+#endif
+ struct task_struct *tk;
+ unsigned int mpppcfg;
+ unsigned int pppcfg;
+ unsigned int mru;
+ unsigned int mpmru;
+ unsigned int mpmtu;
+ unsigned int maxcid;
+ struct isdn_net_local_s *lp;
+ int unit;
+ int minor;
+ long last_link_seqno;
+ long mp_seqno;
+ long range;
+#ifdef CONFIG_ISDN_PPP_VJ
+ unsigned char *cbuf;
+ struct slcompress *slcomp;
+#endif
+ unsigned long debug;
+ struct isdn_ppp_compressor *compressor,*decompressor;
+ struct isdn_ppp_compressor *link_compressor,*link_decompressor;
+ void *decomp_stat,*comp_stat,*link_decomp_stat,*link_comp_stat;
+ struct ippp_ccp_reset *reset; /* Allocated on demand, may never be needed */
+ unsigned long compflags;
+};
#endif /* __KERNEL__ */
diff --git a/include/linux/isdnif.h b/include/linux/isdnif.h
index e7a7f247c..5f1fcacaa 100644
--- a/include/linux/isdnif.h
+++ b/include/linux/isdnif.h
@@ -1,8 +1,4 @@
-/* X25 changes:
- Added constants ISDN_PROTO_L2_X25DTE/DCE and corresponding ISDN_FEATURE_..
- */
-
-/* $Id: isdnif.h,v 1.23 1998/02/20 17:36:52 fritz Exp $
+/* $Id: isdnif.h,v 1.25 1998/06/17 19:51:55 he Exp $
*
* Linux ISDN subsystem
*
@@ -26,6 +22,15 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log: isdnif.h,v $
+ * Revision 1.25 1998/06/17 19:51:55 he
+ * merged with 2.1.10[34] (cosmetics and udelay() -> mdelay())
+ * brute force fix to avoid Ugh's in isdn_tty_write()
+ * cleaned up some dead code
+ *
+ * Revision 1.24 1998/03/19 13:18:57 keil
+ * Start of a CAPI like interface for supplementary Service
+ * first service: SUSPEND
+ *
* Revision 1.23 1998/02/20 17:36:52 fritz
* Added L2-protocols for V.110, changed FEATURE-Flag-constants.
*
@@ -139,6 +144,7 @@
#define ISDN_PROTO_L2_V11096 7 /* V.110 bitrate adaption 9600 Baud */
#define ISDN_PROTO_L2_V11019 8 /* V.110 bitrate adaption 19200 Baud */
#define ISDN_PROTO_L2_V11038 9 /* V.110 bitrate adaption 38400 Baud */
+#define ISDN_PROTO_L2_MODEM 10 /* Analog Modem on Board */
#define ISDN_PROTO_L2_MAX 15 /* Max. 16 Protocols */
/*
@@ -173,6 +179,7 @@
#define ISDN_CMD_UNLOCK 15 /* Release usage-lock */
#define ISDN_CMD_SUSPEND 16 /* Suspend connection */
#define ISDN_CMD_RESUME 17 /* Resume connection */
+#define CAPI_PUT_MESSAGE 18 /* CAPI message send down or up */
/*
* Status-Values delivered from lowlevel to linklevel via
@@ -216,6 +223,7 @@
#define ISDN_FEATURE_L2_V11096 (0x0001 << ISDN_PROTO_L2_V11096)
#define ISDN_FEATURE_L2_V11019 (0x0001 << ISDN_PROTO_L2_V11019)
#define ISDN_FEATURE_L2_V11038 (0x0001 << ISDN_PROTO_L2_V11038)
+#define ISDN_FEATURE_L2_MODEM (0x0001 << ISDN_PROTO_L2_MODEM)
#define ISDN_FEATURE_L2_MASK (0x0FFFF) /* Max. 16 protocols */
#define ISDN_FEATURE_L2_SHIFT (0)
@@ -236,14 +244,37 @@
#define ISDN_FEATURE_P_SHIFT (24)
typedef struct setup_parm {
- char phone[32]; /* Remote Phone-Number */
- char eazmsn[32]; /* Local EAZ or MSN */
+ unsigned char phone[32]; /* Remote Phone-Number */
+ unsigned char eazmsn[32]; /* Local EAZ or MSN */
unsigned char si1; /* Service Indicator 1 */
unsigned char si2; /* Service Indicator 2 */
unsigned char plan; /* Numbering plan */
unsigned char screen; /* Screening info */
} setup_parm;
+/* CAPI structs */
+
+/* this is compatible to the old union size */
+#define MAX_CAPI_PARA_LEN 50
+
+typedef struct {
+ /* Header */
+ __u16 Length;
+ __u16 ApplId;
+ __u8 Command;
+ __u8 Subcommand;
+ __u16 Messagenumber;
+
+ /* Parameter */
+ union {
+ __u32 Controller;
+ __u32 PLCI;
+ __u32 NCCI;
+ } adr;
+ __u8 para[MAX_CAPI_PARA_LEN];
+} capi_msg;
+
+
/*
* Structure for exchanging above infos
*
@@ -255,8 +286,9 @@ typedef struct {
union {
ulong errcode; /* Type of error with STAT_L1ERR */
int length; /* Amount of bytes sent with STAT_BSENT */
- char num[50]; /* Additional Data */
- setup_parm setup;
+ u_char num[50]; /* Additional Data */
+ setup_parm setup; /* For SETUP msg */
+ capi_msg cmsg; /* For CAPI like messages */
} parm;
} isdn_ctrl;
diff --git a/include/linux/isicom.h b/include/linux/isicom.h
index 82325a9b8..7f929b895 100644
--- a/include/linux/isicom.h
+++ b/include/linux/isicom.h
@@ -144,8 +144,8 @@ struct isi_port {
long pgrp;
struct isi_board * card;
struct tty_struct * tty;
- struct wait_queue * close_wait;
- struct wait_queue * open_wait;
+ wait_queue_head_t close_wait;
+ wait_queue_head_t open_wait;
struct tq_struct hangup_tq;
struct tq_struct bh_tqueue;
unsigned char * xmit_buf;
diff --git a/include/linux/istallion.h b/include/linux/istallion.h
index 269ef88ba..cc9831b44 100644
--- a/include/linux/istallion.h
+++ b/include/linux/istallion.h
@@ -70,9 +70,9 @@ typedef struct {
long pgrp;
unsigned int rxmarkmsk;
struct tty_struct *tty;
- struct wait_queue *open_wait;
- struct wait_queue *close_wait;
- struct wait_queue *raw_wait;
+ wait_queue_head_t open_wait;
+ wait_queue_head_t close_wait;
+ wait_queue_head_t raw_wait;
struct tq_struct tqhangup;
struct termios normaltermios;
struct termios callouttermios;
diff --git a/include/linux/joystick.h b/include/linux/joystick.h
index c1794ca29..996babd51 100644
--- a/include/linux/joystick.h
+++ b/include/linux/joystick.h
@@ -217,7 +217,7 @@ struct js_dev {
struct js_dev *next;
struct js_list *list;
struct js_port *port;
- struct wait_queue *wait;
+ wait_queue_head_t wait;
struct js_data cur;
struct js_data new;
struct js_corr *corr;
diff --git a/include/linux/keyboard.h b/include/linux/keyboard.h
index 6829c6536..37cf120ae 100644
--- a/include/linux/keyboard.h
+++ b/include/linux/keyboard.h
@@ -1,6 +1,8 @@
#ifndef __LINUX_KEYBOARD_H
#define __LINUX_KEYBOARD_H
+#include <linux/wait.h>
+
#define KG_SHIFT 0
#define KG_CTRL 2
#define KG_ALT 3
@@ -24,7 +26,7 @@ extern const int NR_TYPES;
extern const int max_vals[];
extern unsigned short *key_maps[MAX_NR_KEYMAPS];
extern unsigned short plain_map[NR_KEYS];
-extern struct wait_queue * keypress_wait;
+extern wait_queue_head_t keypress_wait;
extern unsigned char keyboard_type;
#endif
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index 384e14689..fbc861f24 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -44,7 +44,7 @@ struct nlm_host {
unsigned short h_reclaiming : 1,
h_inuse : 1,
h_monitored : 1;
- struct wait_queue * h_gracewait; /* wait while reclaiming */
+ wait_queue_head_t h_gracewait; /* wait while reclaiming */
u32 h_state; /* pseudo-state counter */
u32 h_nsmstate; /* true remote NSM state */
unsigned int h_count; /* reference count */
diff --git a/include/linux/lp.h b/include/linux/lp.h
index a60d29860..83e4d7739 100644
--- a/include/linux/lp.h
+++ b/include/linux/lp.h
@@ -7,12 +7,6 @@
* Interrupt support added 1993 Nigel Gamble
*/
-/* Magic numbers for defining port-device mappings */
-#define LP_PARPORT_UNSPEC -4
-#define LP_PARPORT_AUTO -3
-#define LP_PARPORT_OFF -2
-#define LP_PARPORT_NONE -1
-
/*
* Per POSIX guidelines, this module reserves the LP and lp prefixes
* These are the lp_table[minor].flags flags...
@@ -87,6 +81,14 @@
#define LP_TIMEOUT_INTERRUPT (60 * HZ)
#define LP_TIMEOUT_POLLED (10 * HZ)
+#ifdef __KERNEL__
+
+/* Magic numbers for defining port-device mappings */
+#define LP_PARPORT_UNSPEC -4
+#define LP_PARPORT_AUTO -3
+#define LP_PARPORT_OFF -2
+#define LP_PARPORT_NONE -1
+
#define LP_F(minor) lp_table[(minor)].flags /* flags for busy, etc. */
#define LP_CHAR(minor) lp_table[(minor)].chars /* busy timeout */
#define LP_TIME(minor) lp_table[(minor)].time /* wait time */
@@ -123,7 +125,7 @@ struct lp_struct {
unsigned int runchars;
struct lp_stats stats;
#endif
- struct wait_queue *wait_q;
+ wait_queue_head_t wait_q;
unsigned int last_error;
volatile unsigned int irq_detected:1;
volatile unsigned int irq_missed:1;
@@ -182,3 +184,5 @@ struct lp_struct {
extern int lp_init(void);
#endif
+
+#endif
diff --git a/include/linux/lp_m68k.h b/include/linux/lp_m68k.h
index cddecc98d..22bdc5ce2 100644
--- a/include/linux/lp_m68k.h
+++ b/include/linux/lp_m68k.h
@@ -116,7 +116,7 @@ struct lp_struct {
unsigned int chars; /*busy timeout */
unsigned int time; /*wait time */
unsigned int wait;
- struct wait_queue *lp_wait_q; /*strobe wait */
+ struct wait_queue_head_t lp_wait_q; /*strobe wait */
void *base; /* hardware drivers internal use*/
enum lp_type type;
char lp_buffer[LP_BUFFER_SIZE];
diff --git a/include/linux/major.h b/include/linux/major.h
index cdff8ea74..cfefdf0ac 100644
--- a/include/linux/major.h
+++ b/include/linux/major.h
@@ -91,9 +91,17 @@
#define SCSI_DISK6_MAJOR 70
#define SCSI_DISK7_MAJOR 71
+
#define SPECIALIX_NORMAL_MAJOR 75
#define SPECIALIX_CALLOUT_MAJOR 76
+#define I2O_MAJOR 80 /* 80->87 */
+
+#define IDE6_MAJOR 88
+#define IDE7_MAJOR 89
+
+#define AURORA_MAJOR 79
+
#define UNIX98_PTY_MASTER_MAJOR 128
#define UNIX98_PTY_MAJOR_COUNT 8
#define UNIX98_PTY_SLAVE_MAJOR (UNIX98_PTY_MASTER_MAJOR+UNIX98_PTY_MAJOR_COUNT)
diff --git a/include/linux/md.h b/include/linux/md.h
index f4f4f5486..654b67717 100644
--- a/include/linux/md.h
+++ b/include/linux/md.h
@@ -274,7 +274,7 @@ struct md_dev
struct md_thread {
void (*run) (void *data);
void *data;
- struct wait_queue *wqueue;
+ wait_queue_head_t wqueue;
unsigned long flags;
struct semaphore *sem;
struct task_struct *tsk;
diff --git a/include/linux/mm.h b/include/linux/mm.h
index ed4eeca0c..3a1963887 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -126,7 +126,7 @@ typedef struct page {
struct page *next_hash;
atomic_t count;
unsigned long flags; /* atomic flags, some possibly updated asynchronously */
- struct wait_queue *wait;
+ wait_queue_head_t wait;
struct page **pprev_hash;
struct buffer_head * buffers;
} mem_map_t;
@@ -314,6 +314,7 @@ extern unsigned long get_unmapped_area(unsigned long, unsigned long);
extern unsigned long do_mmap(struct file *, unsigned long, unsigned long,
unsigned long, unsigned long, unsigned long);
extern int do_munmap(unsigned long, size_t);
+extern unsigned long do_brk(unsigned long, unsigned long);
/* filemap.c */
extern void remove_inode_page(struct page *);
@@ -393,6 +394,8 @@ static inline struct vm_area_struct * find_vma_intersection(struct mm_struct * m
return vma;
}
+extern struct vm_area_struct *find_extend_vma(struct task_struct *tsk, unsigned long addr);
+
#define buffer_under_min() ((buffermem >> PAGE_SHIFT) * 100 < \
buffer_mem.min_percent * num_physpages)
#define pgcache_under_min() (page_cache_size * 100 < \
diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h
index 7e27f1ac6..f9ef19e8c 100644
--- a/include/linux/msdos_fs.h
+++ b/include/linux/msdos_fs.h
@@ -183,12 +183,9 @@ struct vfat_slot_info {
#ifdef __KERNEL__
-typedef int (*fat_filldir_t)(filldir_t filldir, void *, const char *,
- int, int, off_t, off_t, int, ino_t);
-
struct fat_cache {
kdev_t device; /* device number. 0 means unused. */
- int ino; /* inode number. */
+ int start_cluster; /* first cluster of the chain. */
int file_cluster; /* cluster number in the file. */
int disk_cluster; /* cluster number on disk. */
struct fat_cache *next; /* next cache entry */
@@ -199,15 +196,29 @@ extern int fat_is_binary(char conversion,char *extension);
extern void lock_fat(struct super_block *sb);
extern void unlock_fat(struct super_block *sb);
extern int fat_add_cluster(struct inode *inode);
+extern struct buffer_head *fat_add_cluster1(struct inode *inode);
extern int date_dos2unix(__u16 time, __u16 date);
extern void fat_fs_panic(struct super_block *s,const char *msg);
extern void fat_lock_creation(void);
extern void fat_unlock_creation(void);
extern void fat_date_unix2dos(int unix_date,__u16 *time, __u16 *date);
-extern int fat_get_entry(struct inode *dir,loff_t *pos,struct buffer_head **bh,
- struct msdos_dir_entry **de);
+extern int fat__get_entry(struct inode *dir,loff_t *pos,struct buffer_head **bh,
+ struct msdos_dir_entry **de,int *ino);
+static __inline__ int fat_get_entry(struct inode *dir,loff_t *pos,
+ struct buffer_head **bh,struct msdos_dir_entry **de,int *ino)
+{
+ /* Fast stuff first */
+ if (*bh && *de &&
+ (*de - (struct msdos_dir_entry *)(*bh)->b_data) < MSDOS_DPB-1) {
+ *pos += sizeof(struct msdos_dir_entry);
+ (*de)++;
+ (*ino)++;
+ return 0;
+ }
+ return fat__get_entry(dir,pos,bh,de,ino);
+}
extern int fat_scan(struct inode *dir,const char *name,struct buffer_head **res_bh,
- struct msdos_dir_entry **res_de,int *ino,char scantype);
+ struct msdos_dir_entry **res_de,int *ino);
extern int fat_parent_ino(struct inode *dir,int locked);
extern int fat_subdirs(struct inode *dir);
void fat_clusters_flush(struct super_block *sb);
@@ -224,26 +235,32 @@ void fat_cache_add(struct inode *inode,int f_clu,int d_clu);
int fat_get_cluster(struct inode *inode,int cluster);
/* inode.c */
+extern void fat_hash_init(void);
extern int fat_bmap(struct inode *inode,int block);
extern int fat_notify_change(struct dentry *, struct iattr *);
-extern void fat_put_inode(struct inode *inode);
+extern void fat_clear_inode(struct inode *inode);
extern void fat_delete_inode(struct inode *inode);
extern void fat_put_super(struct super_block *sb);
-extern void fat_read_inode(struct inode *inode, struct inode_operations *dir_ops);
-extern struct super_block *fat_read_super(struct super_block *s, void *data, int silent);
+extern void fat_attach(struct inode *inode, int ino);
+extern void fat_detach(struct inode *inode);
+extern struct inode *fat_iget(struct super_block*,int);
+extern struct inode *fat_build_inode(struct super_block*,struct msdos_dir_entry*,int,int*);
+extern struct super_block *fat_read_super(struct super_block *s, void *data, int silent, struct inode_operations *dir_ops);
extern void msdos_put_super(struct super_block *sb);
extern int fat_statfs(struct super_block *sb,struct statfs *buf, int);
extern void fat_write_inode(struct inode *inode);
/* dir.c */
extern struct file_operations fat_dir_operations;
-extern int fat_readdirx(struct inode *inode, struct file *filp, void *dirent,
- fat_filldir_t fat_filldir, filldir_t filldir,
- int shortnames, int longnames, int both);
+extern int fat_search_long(struct inode *dir, const char *name, int len,
+ int anycase, loff_t *spos, loff_t *lpos);
extern int fat_readdir(struct file *filp,
void *dirent, filldir_t);
extern int fat_dir_ioctl(struct inode * inode, struct file * filp,
unsigned int cmd, unsigned long arg);
+int fat_add_entries(struct inode *dir,int slots, struct buffer_head **bh,
+ struct msdos_dir_entry **de, int *ino);
+int fat_dir_empty(struct inode *dir);
/* file.c */
extern struct inode_operations fat_file_inode_operations;
@@ -276,7 +293,6 @@ extern int msdos_create(struct inode *dir,struct dentry *dentry,int mode);
extern int msdos_rmdir(struct inode *dir,struct dentry *dentry);
extern int msdos_mkdir(struct inode *dir,struct dentry *dentry,int mode);
extern int msdos_unlink(struct inode *dir,struct dentry *dentry);
-extern int msdos_unlink_umsdos(struct inode *dir,struct dentry *dentry);
extern int msdos_rename(struct inode *old_dir,struct dentry *old_dentry,
struct inode *new_dir,struct dentry *new_dentry);
@@ -303,12 +319,10 @@ extern int init_fat_nls(void);
/* vfat/namei.c - these are for dmsdos */
extern int vfat_create(struct inode *dir,struct dentry *dentry,int mode);
extern int vfat_unlink(struct inode *dir,struct dentry *dentry);
-extern int vfat_unlink_uvfat(struct inode *dir,struct dentry *dentry);
extern int vfat_mkdir(struct inode *dir,struct dentry *dentry,int mode);
extern int vfat_rmdir(struct inode *dir,struct dentry *dentry);
extern int vfat_rename(struct inode *old_dir,struct dentry *old_dentry,
struct inode *new_dir,struct dentry *new_dentry);
-extern void vfat_put_super(struct super_block *sb);
extern struct super_block *vfat_read_super(struct super_block *sb,void *data,
int silent);
extern void vfat_read_inode(struct inode *inode);
diff --git a/include/linux/msdos_fs_i.h b/include/linux/msdos_fs_i.h
index 1e677d5c7..fcb746552 100644
--- a/include/linux/msdos_fs_i.h
+++ b/include/linux/msdos_fs_i.h
@@ -32,6 +32,9 @@ struct msdos_inode_info {
int i_busy; /* file is either deleted but still open, or
inconsistent (mkdir) */
int i_binary; /* file contains non-text data */
+ int i_location; /* on-disk position of directory entry or 0 */
+ struct inode *i_fat_inode; /* struct inode of this one */
+ struct list_head i_fat_hash; /* hash by i_location */
};
#endif
diff --git a/include/linux/msdos_fs_sb.h b/include/linux/msdos_fs_sb.h
index 4497eeedb..a44bd960b 100644
--- a/include/linux/msdos_fs_sb.h
+++ b/include/linux/msdos_fs_sb.h
@@ -43,7 +43,7 @@ struct msdos_sb_info {
unsigned long clusters; /* number of clusters */
unsigned long root_cluster; /* first cluster of the root directory */
unsigned long fsinfo_offset; /* FAT32 fsinfo offset from start of disk */
- struct wait_queue *fat_wait;
+ wait_queue_head_t fat_wait;
int fat_lock;
int prev_free; /* previously returned free cluster number */
int free_clusters; /* -1 if undefined */
@@ -51,7 +51,9 @@ struct msdos_sb_info {
struct nls_table *nls_disk; /* Codepage used on disk */
struct nls_table *nls_io; /* Charset used for input and display */
struct cvf_format* cvf_format;
- void* private_data;
+ void *dir_ops; /* Opaque; default directory operations */
+ void (*put_super_callback)(struct super_block *);
+ void *private_data;
};
#endif
diff --git a/include/linux/msg.h b/include/linux/msg.h
index 2be627198..48c33aca7 100644
--- a/include/linux/msg.h
+++ b/include/linux/msg.h
@@ -19,8 +19,8 @@ struct msqid_ds {
__kernel_time_t msg_stime; /* last msgsnd time */
__kernel_time_t msg_rtime; /* last msgrcv time */
__kernel_time_t msg_ctime; /* last change time */
- struct wait_queue *wwait;
- struct wait_queue *rwait;
+ wait_queue_head_t wwait;
+ wait_queue_head_t rwait;
unsigned short msg_cbytes; /* current number of bytes on queue */
unsigned short msg_qnum; /* number of messages in queue */
unsigned short msg_qbytes; /* max number of bytes on queue */
diff --git a/include/linux/ncp.h b/include/linux/ncp.h
index 666ffff0f..229618db0 100644
--- a/include/linux/ncp.h
+++ b/include/linux/ncp.h
@@ -72,9 +72,6 @@ struct ncp_volume_info {
#define aDELETEINHIBIT (ntohl(1L<<(18-8)))
#define aDONTCOMPRESS (nothl(1L<<(27-24)))
-#define NCP_MIN_SYMLINK_SIZE 8
-#define NCP_MAX_SYMLINK_SIZE 512
-
#define AR_READ (ntohs(0x0100))
#define AR_WRITE (ntohs(0x0200))
#define AR_EXCLUSIVE (ntohs(0x2000))
diff --git a/include/linux/ncp_fs.h b/include/linux/ncp_fs.h
index b30fd0610..9c5df5342 100644
--- a/include/linux/ncp_fs.h
+++ b/include/linux/ncp_fs.h
@@ -248,7 +248,11 @@ void ncp_date_unix2dos(int unix_date, __u16 * time, __u16 * date);
int ncp_ioctl(struct inode *, struct file *, unsigned int, unsigned long);
/* linux/fs/ncpfs/sock.c */
-int ncp_request(struct ncp_server *server, int function);
+int ncp_request2(struct ncp_server *server, int function,
+ void* reply, int max_reply_size);
+static int inline ncp_request(struct ncp_server *server, int function) {
+ return ncp_request2(server, function, server->packet, server->packet_size);
+}
int ncp_connect(struct ncp_server *server);
int ncp_disconnect(struct ncp_server *server);
void ncp_lock_server(struct ncp_server *server);
diff --git a/include/linux/ncp_fs_sb.h b/include/linux/ncp_fs_sb.h
index adf1eef66..43f902bed 100644
--- a/include/linux/ncp_fs_sb.h
+++ b/include/linux/ncp_fs_sb.h
@@ -8,6 +8,7 @@
#ifndef _NCP_FS_SB
#define _NCP_FS_SB
+#include <asm/semaphore.h>
#include <linux/ncp_mount.h>
#include <linux/types.h>
@@ -44,7 +45,7 @@ struct ncp_server {
receive replies */
int lock; /* To prevent mismatch in protocols. */
- struct wait_queue *wait;
+ struct semaphore sem;
int current_size; /* for packet preparation */
int has_subfunction;
diff --git a/include/linux/net.h b/include/linux/net.h
index 63e996f9d..906c83dce 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -19,6 +19,7 @@
#define _LINUX_NET_H
#include <linux/socket.h>
+#include <linux/wait.h>
struct poll_table_struct;
@@ -68,7 +69,7 @@ struct socket
struct fasync_struct *fasync_list; /* Asynchronous wake up list */
struct file *file; /* File back pointer for gc */
struct sock *sk;
- struct wait_queue *wait;
+ wait_queue_head_t wait;
short type;
unsigned char passcred;
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 18e7fde28..5fbcbad86 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -152,6 +152,7 @@ struct hh_cache
struct hh_cache *hh_next; /* Next entry */
atomic_t hh_refcnt; /* number of users */
unsigned short hh_type; /* protocol identifier, f.e ETH_P_IP */
+ int hh_len; /* length of header */
int (*hh_output)(struct sk_buff *skb);
rwlock_t hh_lock;
/* cached hardware header; allow for machine alignment needs. */
@@ -260,12 +261,23 @@ struct device
void *atalk_ptr; /* AppleTalk link */
void *ip_ptr; /* IPv4 specific data */
void *dn_ptr; /* DECnet specific data */
+ void *ip6_ptr; /* IPv6 specific data */
struct Qdisc *qdisc;
struct Qdisc *qdisc_sleeping;
struct Qdisc *qdisc_list;
unsigned long tx_queue_len; /* Max frames per queue allowed */
+ /* hard_start_xmit synchronizer */
+ spinlock_t xmit_lock;
+ /* cpu id of processor entered to hard_start_xmit or -1,
+ if nobody entered there.
+ */
+ int xmit_lock_owner;
+ /* device queue lock */
+ spinlock_t queue_lock;
+ atomic_t refcnt;
+
/* Pointers to interface service routines. */
int (*open)(struct device *dev);
int (*stop)(struct device *dev);
@@ -331,7 +343,7 @@ struct packet_type
extern struct device loopback_dev; /* The loopback */
extern struct device *dev_base; /* All devices */
-extern struct packet_type *ptype_base[16]; /* Hashed types */
+extern rwlock_t dev_base_lock; /* Device list lock */
extern int netdev_dropping;
extern int net_cpu_congestion;
@@ -405,7 +417,7 @@ extern __inline__ void dev_unlock_list(void)
extern __inline__ void dev_lock_wait(void)
{
while (atomic_read(&dev_lockct)) {
- current->counter = 0;
+ current->policy |= SCHED_YIELD;
schedule();
}
}
diff --git a/include/linux/nfs.h b/include/linux/nfs.h
index 7936d5a71..4f7d3230e 100644
--- a/include/linux/nfs.h
+++ b/include/linux/nfs.h
@@ -158,6 +158,11 @@ struct nfs_diropargs {
const char * name;
};
+struct nfs_readlinkargs {
+ struct nfs_fh * fh;
+ const void * buffer;
+};
+
struct nfs_readargs {
struct nfs_fh * fh;
__u32 offset;
@@ -195,7 +200,7 @@ struct nfs_readdirargs {
struct nfs_fh * fh;
__u32 cookie;
void * buffer;
- unsigned int bufsiz;
+ int bufsiz;
};
struct nfs_diropok {
@@ -208,16 +213,10 @@ struct nfs_readres {
unsigned int count;
};
-struct nfs_readlinkres {
- char ** string;
- unsigned int * lenp;
- unsigned int maxlen;
- void * buffer;
-};
-
struct nfs_readdirres {
void * buffer;
- unsigned int bufsiz;
+ int bufsiz;
+ u32 cookie;
};
#endif /* NFS_NEED_XDR_TYPES */
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index af9615066..613eb6872 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -79,6 +79,8 @@ do { \
#define NFS_FLAGS(inode) ((inode)->u.nfs_i.flags)
#define NFS_REVALIDATING(inode) (NFS_FLAGS(inode) & NFS_INO_REVALIDATE)
#define NFS_WRITEBACK(inode) ((inode)->u.nfs_i.writeback)
+#define NFS_COOKIES(inode) ((inode)->u.nfs_i.cookies)
+#define NFS_DIREOF(inode) ((inode)->u.nfs_i.direof)
/*
* These are the default flags for swap requests
@@ -100,7 +102,7 @@ struct nfs_wreq {
struct rpc_task wb_task; /* RPC task */
struct file * wb_file; /* dentry referenced */
struct page * wb_page; /* page to be written */
- struct wait_queue * wb_wait; /* wait for completion */
+ wait_queue_head_t wb_wait; /* wait for completion */
unsigned int wb_offset; /* offset within page */
unsigned int wb_bytes; /* dirty range */
unsigned int wb_count; /* user count */
@@ -139,9 +141,6 @@ extern int nfs_proc_setattr(struct nfs_server *server, struct nfs_fh *fhandle,
extern int nfs_proc_lookup(struct nfs_server *server, struct nfs_fh *dir,
const char *name, struct nfs_fh *fhandle,
struct nfs_fattr *fattr);
-extern int nfs_proc_readlink(struct nfs_server *server, struct nfs_fh *fhandle,
- void **p0, char **string, unsigned int *len,
- unsigned int maxlen);
extern int nfs_proc_read(struct nfs_server *server, struct nfs_fh *fhandle,
int swap, unsigned long offset, unsigned int count,
void *buffer, struct nfs_fattr *fattr);
@@ -166,8 +165,6 @@ extern int nfs_proc_mkdir(struct nfs_server *server, struct nfs_fh *dir,
struct nfs_fh *fhandle, struct nfs_fattr *fattr);
extern int nfs_proc_rmdir(struct nfs_server *server, struct nfs_fh *dir,
const char *name);
-extern int nfs_proc_readdir(struct nfs_server *server, struct nfs_fh *fhandle,
- u32 cookie, unsigned int size, __u32 *entry);
extern int nfs_proc_statfs(struct nfs_server *server, struct nfs_fh *fhandle,
struct nfs_fsinfo *res);
@@ -195,9 +192,7 @@ extern struct inode_operations nfs_file_inode_operations;
*/
extern struct inode_operations nfs_dir_inode_operations;
extern struct dentry_operations nfs_dentry_operations;
-extern void nfs_free_dircache(void);
extern void nfs_invalidate_dircache(struct inode *);
-extern void nfs_invalidate_dircache_sb(struct super_block *);
/*
* linux/fs/nfs/symlink.c
@@ -228,7 +223,7 @@ extern int nfs_wb_file(struct inode *, struct file *);
* back first..
*/
extern void nfs_inval(struct inode *);
-extern int nfs_updatepage(struct file *, struct page *, unsigned long, unsigned int, int);
+extern int nfs_updatepage(struct file *, struct page *, unsigned long, unsigned int);
/*
* linux/fs/nfs/read.c
diff --git a/include/linux/nfs_fs_i.h b/include/linux/nfs_fs_i.h
index 885f21f01..d21f0078f 100644
--- a/include/linux/nfs_fs_i.h
+++ b/include/linux/nfs_fs_i.h
@@ -47,6 +47,10 @@ struct nfs_inode_info {
* pages.
*/
struct nfs_wreq * writeback;
+
+ /* Readdir caching information. */
+ void *cookies;
+ u32 direof;
};
/*
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h
index dc16282e1..5c0d673f2 100644
--- a/include/linux/nfsd/nfsfh.h
+++ b/include/linux/nfsd/nfsfh.h
@@ -33,6 +33,7 @@ struct nfs_fhbase {
__u32 fb_dev; /* our device */
__u32 fb_xdev;
__u32 fb_xino;
+ __u32 fb_generation;
};
#define NFS_FH_PADDING (NFS_FHSIZE - sizeof(struct nfs_fhbase))
@@ -47,6 +48,7 @@ struct knfs_fh {
#define fh_dev fh_base.fb_dev
#define fh_xdev fh_base.fb_xdev
#define fh_xino fh_base.fb_xino
+#define fh_generation fh_base.fb_generation
#ifdef __KERNEL__
diff --git a/include/linux/nfsiod.h b/include/linux/nfsiod.h
index fdd07a2d0..206441c56 100644
--- a/include/linux/nfsiod.h
+++ b/include/linux/nfsiod.h
@@ -26,7 +26,7 @@ typedef int (*nfsiod_callback_t)(int result, struct nfsiod_req *);
struct nfsiod_req {
struct nfsiod_req * rq_next;
struct nfsiod_req * rq_prev;
- struct wait_queue * rq_wait;
+ wait_queue_head_t rq_wait;
struct rpc_ioreq rq_rpcreq;
nfsiod_callback_t rq_callback;
struct nfs_server * rq_server;
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 3e1e89b44..218098416 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -14,7 +14,7 @@
static inline unsigned long page_address(struct page * page)
{
- return PAGE_OFFSET + PAGE_SIZE * (page - mem_map);
+ return PAGE_OFFSET + ((page - mem_map) << PAGE_SHIFT);
}
/*
@@ -28,6 +28,7 @@ static inline unsigned long page_address(struct page * page)
#define PAGE_CACHE_SHIFT PAGE_SHIFT
#define PAGE_CACHE_SIZE PAGE_SIZE
#define PAGE_CACHE_MASK PAGE_MASK
+#define PAGE_CACHE_ALIGN(addr) (((addr)+PAGE_CACHE_SIZE-1)&PAGE_CACHE_MASK)
#define page_cache_alloc() __get_free_page(GFP_USER)
#define page_cache_free(x) free_page(x)
diff --git a/include/linux/parport.h b/include/linux/parport.h
index 3adbc5ab3..d95c5a856 100644
--- a/include/linux/parport.h
+++ b/include/linux/parport.h
@@ -103,9 +103,6 @@ struct parport_operations {
void (*change_mode)(struct parport *, int);
- void (*release_resources)(struct parport *);
- int (*claim_resources)(struct parport *);
-
void (*epp_write_data)(struct parport *, unsigned char);
unsigned char (*epp_read_data)(struct parport *);
void (*epp_write_addr)(struct parport *, unsigned char);
@@ -163,12 +160,13 @@ struct pardevice {
struct pardevice *next;
struct pardevice *prev;
struct parport_state *state; /* saved status over preemption */
- struct wait_queue *wait_q;
+ wait_queue_head_t wait_q;
unsigned long int time;
unsigned long int timeslice;
unsigned int waiting;
struct pardevice *waitprev;
struct pardevice *waitnext;
+ void * sysctl_table;
};
/* Directory information for the /proc interface */
@@ -184,6 +182,7 @@ struct parport_dir {
/* A parallel port */
struct parport {
unsigned long base; /* base address */
+ unsigned long base_hi; /* base address (ECR) */
unsigned int size; /* IO extent */
const char *name;
int irq; /* interrupt (or -1 for none) */
@@ -209,6 +208,14 @@ struct parport {
spinlock_t pardevice_lock;
spinlock_t waitlist_lock;
rwlock_t cad_lock;
+ void * sysctl_table;
+};
+
+struct parport_driver {
+ const char *name;
+ void (*attach) (struct parport *);
+ void (*detach) (struct parport *);
+ struct parport_driver *next;
};
/* parport_register_port registers a new parallel port at the given address (if
@@ -219,21 +226,30 @@ struct parport {
struct parport *parport_register_port(unsigned long base, int irq, int dma,
struct parport_operations *ops);
+/* Once a registered port is ready for high-level drivers to use, the
+ low-level driver that registered it should announce it. This will
+ call the high-level drivers' attach() functions (after things like
+ determining the IEEE 1284.3 topology of the port and collecting
+ DeviceIDs). */
+void parport_announce_port (struct parport *port);
+
/* Unregister a port. */
extern void parport_unregister_port(struct parport *port);
/* parport_in_use returns nonzero if there are devices attached to a port. */
#define parport_in_use(x) ((x)->devices != NULL)
-/* Put a parallel port to sleep; release its hardware resources. Only possible
- * if no devices are registered. */
-extern void parport_quiesce(struct parport *);
-
/* parport_enumerate returns a pointer to the linked list of all the ports
* in this machine.
*/
struct parport *parport_enumerate(void);
+/* Register a new high-level driver. */
+extern int parport_register_driver (struct parport_driver *);
+
+/* Unregister a high-level driver. */
+extern void parport_unregister_driver (struct parport_driver *);
+
/* parport_register_device declares that a device is connected to a port, and
* tells the kernel all it needs to know.
* pf is the preemption function (may be NULL for no callback)
@@ -318,19 +334,22 @@ extern __inline__ void parport_generic_irq(int irq, struct parport *port,
#define PARPORT_DEV_LURK (1<<0) /* WARNING !! DEPRECATED !! */
#define PARPORT_DEV_EXCL (1<<1) /* Need exclusive access. */
-#define PARPORT_FLAG_COMA (1<<0)
+#define PARPORT_FLAG_COMA_ (1<<0) /* No longer used. */
#define PARPORT_FLAG_EXCL (1<<1) /* EXCL driver registered. */
-extern void parport_parse_irqs(int, const char *[], int irqval[]);
+extern int parport_parse_irqs(int, const char *[], int irqval[]);
+extern int parport_parse_dmas(int, const char *[], int irqval[]);
extern int parport_ieee1284_nibble_mode_ok(struct parport *, unsigned char);
extern int parport_wait_peripheral(struct parport *, unsigned char, unsigned
char);
/* Prototypes from parport_procfs */
-extern int parport_proc_init(void);
-extern void parport_proc_cleanup(void);
extern int parport_proc_register(struct parport *pp);
extern int parport_proc_unregister(struct parport *pp);
+extern int parport_device_proc_register(struct pardevice *device);
+extern int parport_device_proc_unregister(struct pardevice *device);
+extern int parport_default_proc_register(void);
+extern int parport_default_proc_unregister(void);
extern void dec_parport_count(void);
extern void inc_parport_count(void);
diff --git a/include/linux/parport_pc.h b/include/linux/parport_pc.h
index a74c7a121..cf93bb008 100644
--- a/include/linux/parport_pc.h
+++ b/include/linux/parport_pc.h
@@ -5,14 +5,14 @@
/* --- register definitions ------------------------------- */
-#define ECONTROL 0x402
-#define CONFIGB 0x401
-#define CONFIGA 0x400
-#define EPPDATA 0x4
-#define EPPADDR 0x3
-#define CONTROL 0x2
-#define STATUS 0x1
-#define DATA 0
+#define ECONTROL(p) ((p)->base_hi + 0x02)
+#define CONFIGB(p) ((p)->base_hi + 0x01)
+#define CONFIGA(p) ((p)->base_hi + 0x00)
+#define EPPDATA(p) ((p)->base + 0x04)
+#define EPPADDR(p) ((p)->base + 0x03)
+#define CONTROL(p) ((p)->base + 0x02)
+#define STATUS(p) ((p)->base + 0x01)
+#define DATA(p) ((p)->base + 0x00)
/* Private data for PC low-level driver. */
struct parport_pc_private {
@@ -26,27 +26,27 @@ extern volatile unsigned char parport_pc_ctr;
extern __inline__ void parport_pc_write_epp(struct parport *p, unsigned char d)
{
- outb(d, p->base+EPPDATA);
+ outb(d, EPPDATA(p));
}
extern __inline__ unsigned char parport_pc_read_epp(struct parport *p)
{
- return inb(p->base+EPPDATA);
+ return inb(EPPDATA(p));
}
extern __inline__ void parport_pc_write_epp_addr(struct parport *p, unsigned char d)
{
- outb(d, p->base+EPPADDR);
+ outb(d, EPPADDR(p));
}
extern __inline__ unsigned char parport_pc_read_epp_addr(struct parport *p)
{
- return inb(p->base+EPPADDR);
+ return inb(EPPADDR(p));
}
extern __inline__ int parport_pc_check_epp_timeout(struct parport *p)
{
- if (!(inb(p->base+STATUS) & 1))
+ if (!(inb(STATUS(p)) & 1))
return 0;
parport_pc_epp_clear_timeout(p);
return 1;
@@ -54,24 +54,24 @@ extern __inline__ int parport_pc_check_epp_timeout(struct parport *p)
extern __inline__ unsigned char parport_pc_read_configb(struct parport *p)
{
- return inb(p->base+CONFIGB);
+ return inb(CONFIGB(p));
}
extern __inline__ void parport_pc_write_data(struct parport *p, unsigned char d)
{
- outb(d, p->base+DATA);
+ outb(d, DATA(p));
}
extern __inline__ unsigned char parport_pc_read_data(struct parport *p)
{
- return inb(p->base+DATA);
+ return inb(DATA(p));
}
extern __inline__ void parport_pc_write_control(struct parport *p, unsigned char d)
{
struct parport_pc_private *priv = p->private_data;
priv->ctr = d;/* update soft copy */
- outb(d, p->base+CONTROL);
+ outb(d, CONTROL(p));
}
extern __inline__ unsigned char parport_pc_read_control(struct parport *p)
@@ -85,34 +85,34 @@ extern __inline__ unsigned char parport_pc_frob_control(struct parport *p, unsig
struct parport_pc_private *priv = p->private_data;
unsigned char ctr = priv->ctr;
ctr = (ctr & ~mask) ^ val;
- outb (ctr, p->base+CONTROL);
+ outb (ctr, CONTROL(p));
return priv->ctr = ctr; /* update soft copy */
}
extern __inline__ void parport_pc_write_status(struct parport *p, unsigned char d)
{
- outb(d, p->base+STATUS);
+ outb(d, STATUS(p));
}
extern __inline__ unsigned char parport_pc_read_status(struct parport *p)
{
- return inb(p->base+STATUS);
+ return inb(STATUS(p));
}
extern __inline__ void parport_pc_write_econtrol(struct parport *p, unsigned char d)
{
- outb(d, p->base+ECONTROL);
+ outb(d, ECONTROL(p));
}
extern __inline__ unsigned char parport_pc_read_econtrol(struct parport *p)
{
- return inb(p->base+ECONTROL);
+ return inb(ECONTROL(p));
}
extern __inline__ unsigned char parport_pc_frob_econtrol(struct parport *p, unsigned char mask, unsigned char val)
{
- unsigned char old = inb(p->base+ECONTROL);
- outb(((old & ~mask) ^ val), p->base+ECONTROL);
+ unsigned char old = inb(ECONTROL(p));
+ outb(((old & ~mask) ^ val), ECONTROL(p));
return old;
}
diff --git a/include/linux/pc_keyb.h b/include/linux/pc_keyb.h
index 29ccd3956..22e00989c 100644
--- a/include/linux/pc_keyb.h
+++ b/include/linux/pc_keyb.h
@@ -124,7 +124,7 @@ extern unsigned char aux_device_present;
struct aux_queue {
unsigned long head;
unsigned long tail;
- struct wait_queue *proc_list;
+ wait_queue_head_t proc_list;
struct fasync_struct *fasync;
unsigned char buf[AUX_BUF_SIZE];
};
diff --git a/include/linux/pci.h b/include/linux/pci.h
index a4e4b9dfe..bd7f320e3 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -273,6 +273,8 @@
#define PCI_CLASS_SERIAL_USB 0x0c03
#define PCI_CLASS_SERIAL_FIBER 0x0c04
+#define PCI_CLASS_HOT_SWAP_CONTROLLER 0xff00
+
#define PCI_CLASS_OTHERS 0xff
/*
@@ -365,6 +367,7 @@
#define PCI_DEVICE_ID_DEC_21150 0x0022
#define PCI_DEVICE_ID_DEC_21152 0x0024
#define PCI_DEVICE_ID_DEC_21153 0x0025
+#define PCI_DEVICE_ID_DEC_21154 0x0026
#define PCI_VENDOR_ID_CIRRUS 0x1013
#define PCI_DEVICE_ID_CIRRUS_7548 0x0038
@@ -510,12 +513,16 @@
#define PCI_DEVICE_ID_WINBOND2_89C940 0x0940
#define PCI_VENDOR_ID_MOTOROLA 0x1057
+#define PCI_VENDOR_ID_MOTOROLA_OOPS 0x1507
#define PCI_DEVICE_ID_MOTOROLA_MPC105 0x0001
#define PCI_DEVICE_ID_MOTOROLA_MPC106 0x0002
#define PCI_DEVICE_ID_MOTOROLA_RAVEN 0x4801
+#define PCI_DEVICE_ID_MOTOROLA_FALCON 0x4802
+#define PCI_DEVICE_ID_MOTOROLA_CPX8216 0x4806
#define PCI_VENDOR_ID_PROMISE 0x105a
#define PCI_DEVICE_ID_PROMISE_20246 0x4d33
+#define PCI_DEVICE_ID_PROMISE_20262 0x4d38
#define PCI_DEVICE_ID_PROMISE_5300 0x5300
#define PCI_VENDOR_ID_N9 0x105d
@@ -659,11 +666,14 @@
#define PCI_DEVICE_ID_AL_M1523 0x1523
#define PCI_DEVICE_ID_AL_M1531 0x1531
#define PCI_DEVICE_ID_AL_M1533 0x1533
+#define PCI_DEVICE_ID_AL_M1541 0x1541
+#define PCI_DEVICE_ID_AL_M1543 0x1543
#define PCI_DEVICE_ID_AL_M3307 0x3307
#define PCI_DEVICE_ID_AL_M4803 0x5215
#define PCI_DEVICE_ID_AL_M5219 0x5219
#define PCI_DEVICE_ID_AL_M5229 0x5229
#define PCI_DEVICE_ID_AL_M5237 0x5237
+#define PCI_DEVICE_ID_AL_M5243 0x5243
#define PCI_DEVICE_ID_AL_M7101 0x7101
#define PCI_VENDOR_ID_MITSUBISHI 0x10ba
@@ -1064,9 +1074,11 @@
#define PCI_VENDOR_ID_ADAPTEC 0x9004
#define PCI_DEVICE_ID_ADAPTEC_7810 0x1078
+#define PCI_DEVICE_ID_ADAPTEC_7821 0x2178
#define PCI_DEVICE_ID_ADAPTEC_7850 0x5078
#define PCI_DEVICE_ID_ADAPTEC_7855 0x5578
#define PCI_DEVICE_ID_ADAPTEC_5800 0x5800
+#define PCI_DEVICE_ID_ADAPTEC_3860 0x6038
#define PCI_DEVICE_ID_ADAPTEC_1480A 0x6075
#define PCI_DEVICE_ID_ADAPTEC_7860 0x6078
#define PCI_DEVICE_ID_ADAPTEC_7861 0x6178
@@ -1081,15 +1093,28 @@
#define PCI_DEVICE_ID_ADAPTEC_7882 0x8278
#define PCI_DEVICE_ID_ADAPTEC_7883 0x8378
#define PCI_DEVICE_ID_ADAPTEC_7884 0x8478
+#define PCI_DEVICE_ID_ADAPTEC_7885 0x8578
+#define PCI_DEVICE_ID_ADAPTEC_7886 0x8678
+#define PCI_DEVICE_ID_ADAPTEC_7887 0x8778
+#define PCI_DEVICE_ID_ADAPTEC_7888 0x8878
#define PCI_DEVICE_ID_ADAPTEC_1030 0x8b78
#define PCI_VENDOR_ID_ADAPTEC2 0x9005
#define PCI_DEVICE_ID_ADAPTEC2_2940U2 0x0010
-#define PCI_DEVICE_ID_ADAPTEC2_78902 0x0013
+#define PCI_DEVICE_ID_ADAPTEC2_2930U2 0x0011
+#define PCI_DEVICE_ID_ADAPTEC2_7890B 0x0013
#define PCI_DEVICE_ID_ADAPTEC2_7890 0x001f
#define PCI_DEVICE_ID_ADAPTEC2_3940U2 0x0050
#define PCI_DEVICE_ID_ADAPTEC2_3950U2D 0x0051
#define PCI_DEVICE_ID_ADAPTEC2_7896 0x005f
+#define PCI_DEVICE_ID_ADAPTEC2_7892A 0x0080
+#define PCI_DEVICE_ID_ADAPTEC2_7892B 0x0081
+#define PCI_DEVICE_ID_ADAPTEC2_7892D 0x0083
+#define PCI_DEVICE_ID_ADAPTEC2_7892P 0x008f
+#define PCI_DEVICE_ID_ADAPTEC2_7899A 0x00c0
+#define PCI_DEVICE_ID_ADAPTEC2_7899B 0x00c1
+#define PCI_DEVICE_ID_ADAPTEC2_7899D 0x00c3
+#define PCI_DEVICE_ID_ADAPTEC2_7899P 0x00cf
#define PCI_VENDOR_ID_ATRONICS 0x907f
#define PCI_DEVICE_ID_ATRONICS_2015 0x2015
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
index 3a847d72c..7d44e8293 100644
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
@@ -2,7 +2,7 @@
#define _LINUX_PIPE_FS_I_H
struct pipe_inode_info {
- struct wait_queue * wait;
+ wait_queue_head_t wait;
char * base;
unsigned int start;
unsigned int lock;
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h
index 4ec170dbd..4f804d15f 100644
--- a/include/linux/pkt_sched.h
+++ b/include/linux/pkt_sched.h
@@ -38,6 +38,9 @@ struct tc_stats
__u32 pps; /* Current flow packet rate */
__u32 qlen;
__u32 backlog;
+#ifdef __KERNEL__
+ spinlock_t *lock;
+#endif
};
struct tc_estimator
diff --git a/include/linux/poll.h b/include/linux/poll.h
index 7eb57334f..b56cdcf4c 100644
--- a/include/linux/poll.h
+++ b/include/linux/poll.h
@@ -13,8 +13,8 @@
struct poll_table_entry {
struct file * filp;
- struct wait_queue wait;
- struct wait_queue ** wait_address;
+ wait_queue_t wait;
+ wait_queue_head_t * wait_address;
};
typedef struct poll_table_struct {
@@ -25,9 +25,9 @@ typedef struct poll_table_struct {
#define __MAX_POLL_TABLE_ENTRIES ((PAGE_SIZE - sizeof (poll_table)) / sizeof (struct poll_table_entry))
-extern void __pollwait(struct file * filp, struct wait_queue ** wait_address, poll_table *p);
+extern void __pollwait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p);
-extern inline void poll_wait(struct file * filp, struct wait_queue ** wait_address, poll_table *p)
+extern inline void poll_wait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p)
{
if (p && wait_address)
__pollwait(filp, wait_address, p);
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index 1de3fe2ec..e9a284573 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -52,7 +52,8 @@ enum root_directory_inos {
PROC_STRAM,
PROC_SOUND,
PROC_MTRR, /* whether enabled or not */
- PROC_FS
+ PROC_FS,
+ PROC_SYSVIPC
};
enum pid_directory_inos {
@@ -135,11 +136,11 @@ enum net_directory_inos {
PROC_NET_TR_RIF,
PROC_NET_DN_DEV,
PROC_NET_DN_ADJ,
- PROC_NET_DN_L1,
- PROC_NET_DN_L2,
+ PROC_NET_DN_ROUTE,
PROC_NET_DN_CACHE,
PROC_NET_DN_SKT,
- PROC_NET_DN_FW,
+ PROC_NET_DN_FW_CHAINS,
+ PROC_NET_DN_FW_CHAIN_NAMES,
PROC_NET_DN_RAW,
PROC_NET_NETSTAT,
PROC_NET_IPFW_CHAINS,
@@ -205,8 +206,10 @@ enum scsi_directory_inos {
PROC_SCSI_53C94,
PROC_SCSI_PLUTO,
PROC_SCSI_INI9100U,
- PROC_SCSI_INIA100,
+ PROC_SCSI_INIA100,
PROC_SCSI_FCAL,
+ PROC_SCSI_I2O,
+ PROC_SCSI_USB_SCSI,
PROC_SCSI_SCSI_DEBUG,
PROC_SCSI_NOT_PRESENT,
PROC_SCSI_FILE, /* I'm assuming here that we */
@@ -243,6 +246,12 @@ enum fs_coda_directory_inos {
PROC_CODA_FS_LAST
};
+enum sysvipc_directory_inos {
+ PROC_SYSVIPC_SHM = PROC_CODA_FS_LAST,
+ PROC_SYSVIPC_SEM,
+ PROC_SYSVIPC_MSG
+};
+
/* Finally, the dynamically allocatable proc entries are reserved: */
#define PROC_DYNAMIC_FIRST 4096
@@ -313,6 +322,7 @@ extern struct proc_dir_entry proc_pid;
extern struct proc_dir_entry proc_pid_fd;
extern struct proc_dir_entry proc_mca;
extern struct proc_dir_entry *proc_bus;
+extern struct proc_dir_entry *proc_sysvipc;
extern struct inode_operations proc_scsi_inode_operations;
@@ -422,6 +432,7 @@ extern struct inode_operations proc_ringbuf_inode_operations;
#endif
extern struct inode_operations proc_omirr_inode_operations;
extern struct inode_operations proc_ppc_htab_inode_operations;
+extern struct inode_operations proc_sysvipc_inode_operations;
/*
* generic.c
diff --git a/include/linux/quota.h b/include/linux/quota.h
index 2c4a5bcef..a3e76e138 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -170,7 +170,7 @@ struct dquot {
struct list_head dq_free; /* free list element */
struct dquot *dq_hash_next; /* Pointer to next in dquot_hash */
struct dquot **dq_hash_pprev; /* Pointer to previous in dquot_hash */
- struct wait_queue *dq_wait; /* Pointer to waitqueue */
+ wait_queue_head_t dq_wait; /* Pointer to waitqueue */
int dq_count; /* Reference count */
/* fields after this point are cleared when invalidating */
diff --git a/include/linux/raid5.h b/include/linux/raid5.h
index 5efd211a2..655d41d54 100644
--- a/include/linux/raid5.h
+++ b/include/linux/raid5.h
@@ -35,7 +35,7 @@ struct stripe_head {
int count; /* nr of waiters */
int write_method; /* reconstruct-write / read-modify-write */
int phase; /* PHASE_BEGIN, ..., PHASE_COMPLETE */
- struct wait_queue *wait; /* processes waiting for this stripe */
+ wait_queue_head_t wait; /* processes waiting for this stripe */
};
/*
@@ -94,7 +94,7 @@ struct raid5_data {
*/
int nr_free_sh;
struct stripe_head *free_sh_list;
- struct wait_queue *wait_for_stripe;
+ wait_queue_head_t wait_for_stripe;
};
#endif
diff --git a/include/linux/rpcsock.h b/include/linux/rpcsock.h
index 80f1fc4c6..2039f4824 100644
--- a/include/linux/rpcsock.h
+++ b/include/linux/rpcsock.h
@@ -77,7 +77,7 @@ struct rpc_wait {
struct rpc_wait * w_next;
struct rpc_ioreq * w_req;
int w_result;
- struct wait_queue * w_wait;
+ wait_queue_head_t w_wait;
rpc_callback_fn_t w_handler;
void * w_cdata;
char w_queued;
@@ -94,8 +94,8 @@ struct rpc_sock {
unsigned long cwnd;
struct rpc_wait * pending;
struct rpc_wait * free;
- struct wait_queue * backlog;
- struct wait_queue * shutwait;
+ wait_queue_head_t backlog;
+ wait_queue_head_t shutwait;
int shutdown;
};
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index b339f6528..fdbdedfe2 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -418,7 +418,9 @@ enum
IFLA_MTU,
IFLA_LINK,
IFLA_QDISC,
- IFLA_STATS
+ IFLA_STATS,
+ IFLA_COST,
+ IFLA_PRIORITY
};
@@ -506,13 +508,13 @@ enum
#define RTMGRP_IPV6_MROUTE 0x200
#define RTMGRP_IPV6_ROUTE 0x400
+#define RTMGRP_DECnet_IFADDR 0x1000
+#define RTMGRP_DECnet_ROUTE 0x4000
+
/* End of information exported to user level */
#ifdef __KERNEL__
-extern atomic_t rtnl_rlockct;
-extern struct wait_queue *rtnl_wait;
-
extern __inline__ int rtattr_strcmp(struct rtattr *rta, char *str)
{
int len = strlen(str) + 1;
@@ -539,128 +541,32 @@ extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const voi
#define RTA_PUT(skb, attrtype, attrlen, data) \
({ if (skb_tailroom(skb) < (int)RTA_SPACE(attrlen)) goto rtattr_failure; \
__rta_fill(skb, attrtype, attrlen, data); })
-
-extern unsigned long rtnl_wlockct;
-
-/* NOTE: these locks are not interrupt safe, are not SMP safe,
- * they are even not atomic. 8)8)8) ... and it is not a bug.
- * Really, if these locks will be programmed correctly,
- * all the addressing/routing machine would become SMP safe,
- * but is absolutely useless at the moment, because all the kernel
- * is not reenterable in any case. --ANK
- *
- * Well, atomic_* and set_bit provide the only thing here:
- * gcc is confused not to overoptimize them, that's all.
- * I remember as gcc splitted ++ operation, but cannot reproduce
- * it with gcc-2.7.*. --ANK
- *
- * One more note: rwlock facility should be written and put
- * to a kernel wide location: f.e. current implementation of semaphores
- * (especially, for x86) looks like a wonder. It would be good
- * to have something similar for rwlock. Recursive lock could be also
- * useful thing. --ANK
- */
-
-extern __inline__ int rtnl_shlock_nowait(void)
-{
- atomic_inc(&rtnl_rlockct);
- if (test_bit(0, &rtnl_wlockct)) {
- atomic_dec(&rtnl_rlockct);
- return -EAGAIN;
- }
- return 0;
-}
-
-extern __inline__ void rtnl_shlock(void)
-{
- while (rtnl_shlock_nowait())
- sleep_on(&rtnl_wait);
-}
-
-/* Check for possibility to PROMOTE shared lock to exclusive.
- Shared lock must be already grabbed with rtnl_shlock*().
- */
-
-extern __inline__ int rtnl_exlock_nowait(void)
-{
- if (atomic_read(&rtnl_rlockct) > 1)
- return -EAGAIN;
- if (test_and_set_bit(0, &rtnl_wlockct))
- return -EAGAIN;
- return 0;
-}
-
-extern __inline__ void rtnl_exlock(void)
-{
- while (rtnl_exlock_nowait())
- sleep_on(&rtnl_wait);
-}
-
-#if 0
-extern __inline__ void rtnl_shunlock(void)
-{
- atomic_dec(&rtnl_rlockct);
- if (atomic_read(&rtnl_rlockct) <= 1) {
- wake_up(&rtnl_wait);
- if (rtnl && rtnl->receive_queue.qlen)
- rtnl->data_ready(rtnl, 0);
- }
-}
-#else
-
-/* The problem: inline requires to include <net/sock.h> and, hence,
- almost all of net includes :-(
- */
-
-#define rtnl_shunlock() ({ \
- atomic_dec(&rtnl_rlockct); \
- if (atomic_read(&rtnl_rlockct) <= 1) { \
- wake_up(&rtnl_wait); \
- if (rtnl && rtnl->receive_queue.qlen) \
- rtnl->data_ready(rtnl, 0); \
- } \
-})
#endif
-/* Release exclusive lock. Note, that we do not wake up rtnetlink socket,
- * it will be done later after releasing shared lock.
- */
-
-extern __inline__ void rtnl_exunlock(void)
-{
- clear_bit(0, &rtnl_wlockct);
- wake_up(&rtnl_wait);
-}
+extern struct semaphore rtnl_sem;
-#else
+#define rtnl_exlock() do { } while(0)
+#define rtnl_exunlock() do { } while(0)
+#define rtnl_exlock_nowait() (0)
-extern __inline__ void rtnl_shlock(void)
-{
- while (atomic_read(&rtnl_rlockct))
- sleep_on(&rtnl_wait);
- atomic_inc(&rtnl_rlockct);
-}
-
-extern __inline__ void rtnl_shunlock(void)
-{
- if (atomic_dec_and_test(&rtnl_rlockct))
- wake_up(&rtnl_wait);
-}
-
-extern __inline__ void rtnl_exlock(void)
-{
-}
-
-extern __inline__ void rtnl_exunlock(void)
-{
-}
+#define rtnl_shlock() down(&rtnl_sem)
+#define rtnl_shlock_nowait() down_trylock(&rtnl_sem)
+#ifndef CONFIG_RTNETLINK
+#define rtnl_shunlock() up(&rtnl_sem)
+#else
+#define rtnl_shunlock() do { up(&rtnl_sem); \
+ if (rtnl && rtnl->receive_queue.qlen) \
+ rtnl->data_ready(rtnl, 0); \
+ } while(0)
#endif
extern void rtnl_lock(void);
extern void rtnl_unlock(void);
extern void rtnetlink_init(void);
+
+
#endif /* __KERNEL__ */
diff --git a/include/linux/sched.h b/include/linux/sched.h
index e0066b3f6..bfa9e633e 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -16,6 +16,7 @@ extern unsigned long event;
#include <asm/system.h>
#include <asm/semaphore.h>
#include <asm/page.h>
+#include <asm/ptrace.h>
#include <linux/smp.h>
#include <linux/tty.h>
@@ -79,6 +80,7 @@ extern int last_pid;
#define TASK_ZOMBIE 4
#define TASK_STOPPED 8
#define TASK_SWAPPING 16
+#define TASK_EXCLUSIVE 32
/*
* Scheduling policies
@@ -161,9 +163,9 @@ struct fs_struct {
#define AVL_MIN_MAP_COUNT 32
struct mm_struct {
- struct vm_area_struct *mmap; /* list of VMAs */
- struct vm_area_struct *mmap_avl; /* tree of VMAs */
- struct vm_area_struct *mmap_cache; /* last find_vma result */
+ struct vm_area_struct * mmap; /* list of VMAs */
+ struct vm_area_struct * mmap_avl; /* tree of VMAs */
+ struct vm_area_struct * mmap_cache; /* last find_vma result */
pgd_t * pgd;
atomic_t count;
int map_count; /* number of VMAs */
@@ -184,11 +186,11 @@ struct mm_struct {
void * segments;
};
-#define INIT_MM { \
+#define INIT_MM(name) { \
&init_mmap, NULL, NULL, \
swapper_pg_dir, \
ATOMIC_INIT(1), 1, \
- MUTEX, \
+ __MUTEX_INITIALIZER(name.mmap_sem), \
0, \
0, 0, 0, 0, \
0, 0, 0, \
@@ -267,7 +269,7 @@ struct task_struct {
/* Pointer to task[] array linkage. */
struct task_struct **tarray_ptr;
- struct wait_queue *wait_chldexit; /* for wait4() */
+ wait_queue_head_t wait_chldexit; /* for wait4() */
struct semaphore *vfork_sem; /* for vfork() */
unsigned long policy, rt_priority;
unsigned long it_real_value, it_prof_value, it_virt_value;
@@ -345,7 +347,7 @@ struct task_struct {
* INIT_TASK is used to set up the first task table, touch at
* your own risk!. Base=0, limit=0x1fffff (=2MB)
*/
-#define INIT_TASK \
+#define INIT_TASK(name) \
/* state etc */ { 0,0,0,KERNEL_DS,&default_exec_domain,0, \
/* counter */ DEF_PRIORITY,DEF_PRIORITY,0, \
/* SMP */ 0,0,0,-1, \
@@ -356,7 +358,7 @@ struct task_struct {
/* proc links*/ &init_task,&init_task,NULL,NULL,NULL, \
/* pidhash */ NULL, NULL, \
/* tarray */ &task[0], \
-/* chld wait */ NULL, NULL, \
+/* chld wait */ __WAIT_QUEUE_HEAD_INITIALIZER(name.wait_chldexit), NULL, \
/* timeout */ SCHED_OTHER,0,0,0,0,0,0,0, \
/* timer */ { NULL, NULL, 0, 0, it_real_fn }, \
/* utime */ {0,0,0,0},0, \
@@ -380,9 +382,13 @@ struct task_struct {
/* signals */ SPIN_LOCK_UNLOCKED, &init_signals, {{0}}, {{0}}, NULL, &init_task.sigqueue, 0, 0, \
}
+#ifndef INIT_TASK_SIZE
+# define INIT_TASK_SIZE 2048*sizeof(long)
+#endif
+
union task_union {
struct task_struct task;
- unsigned long stack[2048];
+ unsigned long stack[INIT_TASK_SIZE/sizeof(long)];
};
extern union task_union init_task_union;
@@ -447,8 +453,8 @@ extern __inline__ struct task_struct *find_task_by_pid(int pid)
}
/* per-UID process charging. */
-extern int alloc_uid(struct task_struct *p);
-void free_uid(struct task_struct *p);
+extern int alloc_uid(struct task_struct *);
+void free_uid(struct task_struct *);
#include <asm/current.h>
@@ -464,39 +470,39 @@ extern unsigned long prof_shift;
#define CURRENT_TIME (xtime.tv_sec)
-extern void FASTCALL(__wake_up(struct wait_queue ** p, unsigned int mode));
-extern void FASTCALL(sleep_on(struct wait_queue ** p));
-extern long FASTCALL(sleep_on_timeout(struct wait_queue ** p,
+extern void FASTCALL(__wake_up(wait_queue_head_t *q, unsigned int mode));
+extern void FASTCALL(sleep_on(wait_queue_head_t *q));
+extern long FASTCALL(sleep_on_timeout(wait_queue_head_t *q,
signed long timeout));
-extern void FASTCALL(interruptible_sleep_on(struct wait_queue ** p));
-extern long FASTCALL(interruptible_sleep_on_timeout(struct wait_queue ** p,
+extern void FASTCALL(interruptible_sleep_on(wait_queue_head_t *q));
+extern long FASTCALL(interruptible_sleep_on_timeout(wait_queue_head_t *q,
signed long timeout));
extern void FASTCALL(wake_up_process(struct task_struct * tsk));
#define wake_up(x) __wake_up((x),TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE)
#define wake_up_interruptible(x) __wake_up((x),TASK_INTERRUPTIBLE)
+extern int in_group_p(gid_t);
+
extern void release(struct task_struct * p);
-extern int in_group_p(gid_t grp);
extern void flush_signals(struct task_struct *);
extern void flush_signal_handlers(struct task_struct *);
-extern int dequeue_signal(sigset_t *block, siginfo_t *);
-extern int send_sig_info(int, struct siginfo *info, struct task_struct *);
-extern int force_sig_info(int, struct siginfo *info, struct task_struct *);
-extern int kill_pg_info(int, struct siginfo *info, pid_t);
-extern int kill_sl_info(int, struct siginfo *info, pid_t);
-extern int kill_proc_info(int, struct siginfo *info, pid_t);
-extern int kill_something_info(int, struct siginfo *info, int);
-extern void notify_parent(struct task_struct * tsk, int);
-extern void force_sig(int sig, struct task_struct * p);
-extern int send_sig(int sig, struct task_struct * p, int priv);
+extern int dequeue_signal(sigset_t *, siginfo_t *);
+extern int send_sig_info(int, struct siginfo *, struct task_struct *);
+extern int force_sig_info(int, struct siginfo *, struct task_struct *);
+extern int kill_pg_info(int, struct siginfo *, pid_t);
+extern int kill_sl_info(int, struct siginfo *, pid_t);
+extern int kill_proc_info(int, struct siginfo *, pid_t);
+extern int kill_something_info(int, struct siginfo *, int);
+extern void notify_parent(struct task_struct *, int);
+extern void force_sig(int, struct task_struct *);
+extern int send_sig(int, struct task_struct *, int);
extern int kill_pg(pid_t, int, int);
extern int kill_sl(pid_t, int, int);
extern int kill_proc(pid_t, int, int);
-extern int do_sigaction(int sig, const struct k_sigaction *act,
- struct k_sigaction *oact);
-extern int do_sigaltstack(const stack_t *ss, stack_t *oss, unsigned long sp);
+extern int do_sigaction(int, const struct k_sigaction *, struct k_sigaction *);
+extern int do_sigaltstack(const stack_t *, stack_t *, unsigned long);
extern inline int signal_pending(struct task_struct *p)
{
@@ -538,8 +544,7 @@ static inline void recalc_sigpending(struct task_struct *t)
static inline int on_sig_stack(unsigned long sp)
{
- return (sp >= current->sas_ss_sp
- && sp < current->sas_ss_sp + current->sas_ss_size);
+ return (sp - current->sas_ss_sp < current->sas_ss_size);
}
static inline int sas_ss_flags(unsigned long sp)
@@ -548,12 +553,10 @@ static inline int sas_ss_flags(unsigned long sp)
: on_sig_stack(sp) ? SS_ONSTACK : 0);
}
-extern int request_irq(unsigned int irq,
+extern int request_irq(unsigned int,
void (*handler)(int, void *, struct pt_regs *),
- unsigned long flags,
- const char *device,
- void *dev_id);
-extern void free_irq(unsigned int irq, void *dev_id);
+ unsigned long, const char *, void *);
+extern void free_irq(unsigned int, void *);
/*
* This has now become a routine instead of a macro, it sets a flag if
@@ -631,54 +634,39 @@ extern void exit_sighand(struct task_struct *);
extern int do_execve(char *, char **, char **, struct pt_regs *);
extern int do_fork(unsigned long, unsigned long, struct pt_regs *);
-/*
- * The wait-queues are circular lists, and you have to be *very* sure
- * to keep them correct. Use only these two functions to add/remove
- * entries in the queues.
- */
-extern inline void __add_wait_queue(struct wait_queue ** p, struct wait_queue * wait)
-{
- wait->next = *p ? : WAIT_QUEUE_HEAD(p);
- *p = wait;
-}
-
-extern rwlock_t waitqueue_lock;
-
-extern inline void add_wait_queue(struct wait_queue ** p, struct wait_queue * wait)
+extern inline void add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait)
{
unsigned long flags;
- write_lock_irqsave(&waitqueue_lock, flags);
- __add_wait_queue(p, wait);
- write_unlock_irqrestore(&waitqueue_lock, flags);
+ wq_write_lock_irqsave(&q->lock, flags);
+ __add_wait_queue(q, wait);
+ wq_write_unlock_irqrestore(&q->lock, flags);
}
-extern inline void __remove_wait_queue(struct wait_queue ** p, struct wait_queue * wait)
+extern inline void add_wait_queue_exclusive(wait_queue_head_t *q,
+ wait_queue_t * wait)
{
- struct wait_queue * next = wait->next;
- struct wait_queue * head = next;
- struct wait_queue * tmp;
+ unsigned long flags;
- while ((tmp = head->next) != wait) {
- head = tmp;
- }
- head->next = next;
+ wq_write_lock_irqsave(&q->lock, flags);
+ __add_wait_queue_tail(q, wait);
+ wq_write_unlock_irqrestore(&q->lock, flags);
}
-extern inline void remove_wait_queue(struct wait_queue ** p, struct wait_queue * wait)
+extern inline void remove_wait_queue(wait_queue_head_t *q, wait_queue_t * wait)
{
unsigned long flags;
- write_lock_irqsave(&waitqueue_lock, flags);
- __remove_wait_queue(p, wait);
- write_unlock_irqrestore(&waitqueue_lock, flags);
+ wq_write_lock_irqsave(&q->lock, flags);
+ __remove_wait_queue(q, wait);
+ wq_write_unlock_irqrestore(&q->lock, flags);
}
#define __wait_event(wq, condition) \
do { \
- struct wait_queue __wait; \
+ wait_queue_t __wait; \
+ init_waitqueue_entry(&__wait, current); \
\
- __wait.task = current; \
add_wait_queue(&wq, &__wait); \
for (;;) { \
current->state = TASK_UNINTERRUPTIBLE; \
@@ -699,9 +687,9 @@ do { \
#define __wait_event_interruptible(wq, condition, ret) \
do { \
- struct wait_queue __wait; \
+ wait_queue_t __wait; \
+ init_waitqueue_entry(&__wait, current); \
\
- __wait.task = current; \
add_wait_queue(&wq, &__wait); \
for (;;) { \
current->state = TASK_INTERRUPTIBLE; \
diff --git a/include/linux/sem.h b/include/linux/sem.h
index 3fb2a48f6..3896d7535 100644
--- a/include/linux/sem.h
+++ b/include/linux/sem.h
@@ -85,7 +85,7 @@ struct sem {
struct sem_queue {
struct sem_queue * next; /* next entry in the queue */
struct sem_queue ** prev; /* previous entry in the queue, *(q->prev) == q */
- struct wait_queue * sleeper; /* sleeping process */
+ wait_queue_head_t sleeper; /* sleeping process */
struct sem_undo * undo; /* undo structure */
int pid; /* process id of requesting process */
int status; /* completion status of operation */
diff --git a/include/linux/serial167.h b/include/linux/serial167.h
index 9f01f3618..8886c292f 100644
--- a/include/linux/serial167.h
+++ b/include/linux/serial167.h
@@ -54,8 +54,8 @@ struct cyclades_port {
struct tq_struct tqueue;
struct termios normal_termios;
struct termios callout_termios;
- struct wait_queue *open_wait;
- struct wait_queue *close_wait;
+ wait_queue_head_t open_wait;
+ wait_queue_head_t close_wait;
struct cyclades_monitor mon;
};
diff --git a/include/linux/serialP.h b/include/linux/serialP.h
index 6bf0746ee..28e66f9e4 100644
--- a/include/linux/serialP.h
+++ b/include/linux/serialP.h
@@ -80,9 +80,9 @@ struct async_struct {
int xmit_tail;
int xmit_cnt;
struct tq_struct tqueue;
- struct wait_queue *open_wait;
- struct wait_queue *close_wait;
- struct wait_queue *delta_msr_wait;
+ wait_queue_head_t open_wait;
+ wait_queue_head_t close_wait;
+ wait_queue_head_t delta_msr_wait;
struct async_struct *next_port; /* For the linked list */
struct async_struct *prev_port;
};
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 2089a9710..d499875de 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -15,6 +15,8 @@
#define _LINUX_SKBUFF_H
#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
#include <linux/time.h>
#include <asm/atomic.h>
@@ -30,15 +32,19 @@
#define CHECKSUM_UNNECESSARY 2
struct sk_buff_head {
+ /* These two members must be first. */
struct sk_buff * next;
struct sk_buff * prev;
- __u32 qlen; /* Must be same length as a pointer
- for using debugging */
+
+ __u32 qlen;
+ spinlock_t lock;
};
struct sk_buff {
+ /* These two members must be first. */
struct sk_buff * next; /* Next buffer in list */
struct sk_buff * prev; /* Previous buffer in list */
+
struct sk_buff_head * list; /* List we are on */
struct sock *sk; /* Socket we are owned by */
struct timeval stamp; /* Time we arrived */
@@ -245,6 +251,7 @@ extern __inline__ __u32 skb_queue_len(struct sk_buff_head *list_)
extern __inline__ void skb_queue_head_init(struct sk_buff_head *list)
{
+ spin_lock_init(&list->lock);
list->prev = (struct sk_buff *)list;
list->next = (struct sk_buff *)list;
list->qlen = 0;
@@ -271,15 +278,13 @@ extern __inline__ void __skb_queue_head(struct sk_buff_head *list, struct sk_buf
prev->next = newsk;
}
-extern spinlock_t skb_queue_lock;
-
extern __inline__ void skb_queue_head(struct sk_buff_head *list, struct sk_buff *newsk)
{
unsigned long flags;
- spin_lock_irqsave(&skb_queue_lock, flags);
+ spin_lock_irqsave(&list->lock, flags);
__skb_queue_head(list, newsk);
- spin_unlock_irqrestore(&skb_queue_lock, flags);
+ spin_unlock_irqrestore(&list->lock, flags);
}
/*
@@ -304,9 +309,9 @@ extern __inline__ void skb_queue_tail(struct sk_buff_head *list, struct sk_buff
{
unsigned long flags;
- spin_lock_irqsave(&skb_queue_lock, flags);
+ spin_lock_irqsave(&list->lock, flags);
__skb_queue_tail(list, newsk);
- spin_unlock_irqrestore(&skb_queue_lock, flags);
+ spin_unlock_irqrestore(&list->lock, flags);
}
/*
@@ -338,9 +343,9 @@ extern __inline__ struct sk_buff *skb_dequeue(struct sk_buff_head *list)
long flags;
struct sk_buff *result;
- spin_lock_irqsave(&skb_queue_lock, flags);
+ spin_lock_irqsave(&list->lock, flags);
result = __skb_dequeue(list);
- spin_unlock_irqrestore(&skb_queue_lock, flags);
+ spin_unlock_irqrestore(&list->lock, flags);
return result;
}
@@ -367,9 +372,9 @@ extern __inline__ void skb_insert(struct sk_buff *old, struct sk_buff *newsk)
{
unsigned long flags;
- spin_lock_irqsave(&skb_queue_lock, flags);
+ spin_lock_irqsave(&old->list->lock, flags);
__skb_insert(newsk, old->prev, old, old->list);
- spin_unlock_irqrestore(&skb_queue_lock, flags);
+ spin_unlock_irqrestore(&old->list->lock, flags);
}
/*
@@ -385,9 +390,9 @@ extern __inline__ void skb_append(struct sk_buff *old, struct sk_buff *newsk)
{
unsigned long flags;
- spin_lock_irqsave(&skb_queue_lock, flags);
+ spin_lock_irqsave(&old->list->lock, flags);
__skb_append(old, newsk);
- spin_unlock_irqrestore(&skb_queue_lock, flags);
+ spin_unlock_irqrestore(&old->list->lock, flags);
}
/*
@@ -417,12 +422,16 @@ extern __inline__ void __skb_unlink(struct sk_buff *skb, struct sk_buff_head *li
extern __inline__ void skb_unlink(struct sk_buff *skb)
{
- unsigned long flags;
+ struct sk_buff_head *list = skb->list;
+
+ if(list) {
+ unsigned long flags;
- spin_lock_irqsave(&skb_queue_lock, flags);
- if(skb->list)
- __skb_unlink(skb, skb->list);
- spin_unlock_irqrestore(&skb_queue_lock, flags);
+ spin_lock_irqsave(&list->lock, flags);
+ if(skb->list == list)
+ __skb_unlink(skb, skb->list);
+ spin_unlock_irqrestore(&list->lock, flags);
+ }
}
/* XXX: more streamlined implementation */
@@ -439,9 +448,9 @@ extern __inline__ struct sk_buff *skb_dequeue_tail(struct sk_buff_head *list)
long flags;
struct sk_buff *result;
- spin_lock_irqsave(&skb_queue_lock, flags);
+ spin_lock_irqsave(&list->lock, flags);
result = __skb_dequeue_tail(list);
- spin_unlock_irqrestore(&skb_queue_lock, flags);
+ spin_unlock_irqrestore(&list->lock, flags);
return result;
}
@@ -449,29 +458,38 @@ extern __inline__ struct sk_buff *skb_dequeue_tail(struct sk_buff_head *list)
* Add data to an sk_buff
*/
+extern __inline__ unsigned char *__skb_put(struct sk_buff *skb, unsigned int len)
+{
+ unsigned char *tmp=skb->tail;
+ skb->tail+=len;
+ skb->len+=len;
+ return tmp;
+}
+
extern __inline__ unsigned char *skb_put(struct sk_buff *skb, unsigned int len)
{
unsigned char *tmp=skb->tail;
skb->tail+=len;
skb->len+=len;
- if(skb->tail>skb->end)
- {
- __label__ here;
- skb_over_panic(skb, len, &&here);
-here: ;
+ if(skb->tail>skb->end) {
+ skb_over_panic(skb, len, current_text_addr());
}
return tmp;
}
+extern __inline__ unsigned char *__skb_push(struct sk_buff *skb, unsigned int len)
+{
+ skb->data-=len;
+ skb->len+=len;
+ return skb->data;
+}
+
extern __inline__ unsigned char *skb_push(struct sk_buff *skb, unsigned int len)
{
skb->data-=len;
skb->len+=len;
- if(skb->data<skb->head)
- {
- __label__ here;
- skb_under_panic(skb, len, &&here);
-here: ;
+ if(skb->data<skb->head) {
+ skb_under_panic(skb, len, current_text_addr());
}
return skb->data;
}
diff --git a/include/linux/smb_fs_sb.h b/include/linux/smb_fs_sb.h
index cedbb5ab8..31052af1f 100644
--- a/include/linux/smb_fs_sb.h
+++ b/include/linux/smb_fs_sb.h
@@ -34,7 +34,7 @@ struct smb_sb_info {
struct smb_conn_opt opt;
struct semaphore sem;
- struct wait_queue * wait;
+ wait_queue_head_t wait;
__u32 packet_size;
unsigned char * packet;
diff --git a/include/linux/smp.h b/include/linux/smp.h
index 75c34e87f..eae129070 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -3,7 +3,7 @@
/*
* Generic SMP support
- * Alan Cox. <alan@cymru.net>
+ * Alan Cox. <alan@redhat.com>
*/
#ifdef __SMP__
diff --git a/include/linux/stallion.h b/include/linux/stallion.h
index 35274488d..94f5a1734 100644
--- a/include/linux/stallion.h
+++ b/include/linux/stallion.h
@@ -95,8 +95,8 @@ typedef struct stlport {
unsigned long hwid;
void *uartp;
struct tty_struct *tty;
- struct wait_queue *open_wait;
- struct wait_queue *close_wait;
+ wait_queue_head_t open_wait;
+ wait_queue_head_t close_wait;
struct termios normaltermios;
struct termios callouttermios;
struct tq_struct tqueue;
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index 8ec30527f..d43dfaf0c 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -12,6 +12,7 @@
#include <linux/timer.h>
#include <linux/tqueue.h>
#include <linux/sunrpc/types.h>
+#include <linux/wait.h>
/*
* Define this if you want to test the fast scheduler for async calls.
@@ -63,7 +64,7 @@ struct rpc_task {
* you have a pathological interest in kernel oopses.
*/
struct timer_list tk_timer; /* kernel timer */
- struct wait_queue * tk_wait; /* sync: sleep on this q */
+ wait_queue_head_t tk_wait; /* sync: sleep on this q */
unsigned long tk_timeout; /* timeout for rpc_sleep() */
unsigned short tk_flags; /* misc flags */
#ifdef RPC_DEBUG
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 4ab59ed1c..db1cb7c41 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -116,7 +116,7 @@ struct svc_rqst {
struct svc_client * rq_client; /* RPC peer info */
struct svc_cacherep * rq_cacherep; /* cache info */
- struct wait_queue * rq_wait; /* synchronozation */
+ wait_queue_head_t rq_wait; /* synchronozation */
};
/*
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 66ba5d623..bc9fb4e48 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -113,6 +113,7 @@ extern void free_page_and_swap_cache(unsigned long addr);
/* linux/mm/swapfile.c */
extern unsigned int nr_swapfiles;
extern struct swap_info_struct swap_info[];
+extern int is_swap_partition(kdev_t);
void si_swapinfo(struct sysinfo *);
unsigned long get_swap_page(void);
extern void FASTCALL(swap_free(unsigned long));
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index db74f03be..b5b46b7f1 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -392,14 +392,42 @@ enum
NET_TR_RIF_TIMEOUT=1
};
-/* /proc/sys/net/decnet */
+/* /proc/sys/net/decnet/ */
enum {
- NET_DECNET_DEF_T3_BROADCAST=1,
- NET_DECNET_DEF_T3_POINTTOPOINT=2,
- NET_DECNET_DEF_T1=3,
- NET_DECNET_DEF_BCT1=4,
- NET_DECNET_CACHETIMEOUT=5,
- NET_DECNET_DEBUG_LEVEL=6
+ NET_DECNET_NODE_TYPE = 1,
+ NET_DECNET_NODE_ADDRESS = 2,
+ NET_DECNET_NODE_NAME = 3,
+ NET_DECNET_DEFAULT_DEVICE = 4,
+ NET_DECNET_TIME_WAIT = 5,
+ NET_DECNET_DN_COUNT = 6,
+ NET_DECNET_DI_COUNT = 7,
+ NET_DECNET_DR_COUNT = 8,
+ NET_DECNET_DST_GC_INTERVAL = 9,
+ NET_DECNET_CONF = 10,
+ NET_DECNET_DEBUG_LEVEL = 255
+};
+
+/* /proc/sys/net/decnet/conf/<dev> */
+enum {
+ NET_DECNET_CONF_LOOPBACK = -2,
+ NET_DECNET_CONF_DDCMP = -3,
+ NET_DECNET_CONF_PPP = -4,
+ NET_DECNET_CONF_X25 = -5,
+ NET_DECNET_CONF_GRE = -6,
+ NET_DECNET_CONF_ETHER = -7
+
+ /* ... and ifindex of devices */
+};
+
+/* /proc/sys/net/decnet/conf/<dev>/ */
+enum {
+ NET_DECNET_CONF_DEV_PRIORITY = 1,
+ NET_DECNET_CONF_DEV_T1 = 2,
+ NET_DECNET_CONF_DEV_T2 = 3,
+ NET_DECNET_CONF_DEV_T3 = 4,
+ NET_DECNET_CONF_DEV_COST = 5,
+ NET_DECNET_CONF_DEV_BLKSIZE = 6,
+ NET_DECNET_CONF_DEV_STATE = 7
};
/* CTL_PROC names: */
@@ -424,7 +452,8 @@ enum
/* CTL_DEV names: */
enum {
DEV_CDROM=1,
- DEV_HWMON=2
+ DEV_HWMON=2,
+ DEV_PARPORT=3
};
/* /proc/sys/dev/cdrom */
@@ -432,6 +461,35 @@ enum {
DEV_CDROM_INFO=1
};
+/* /proc/sys/dev/parport */
+enum {
+ DEV_PARPORT_DEFAULT=-3
+};
+
+/* /proc/sys/dev/parport/default */
+enum {
+ DEV_PARPORT_DEFAULT_TIMESLICE=1,
+ DEV_PARPORT_DEFAULT_SPINTIME=2
+};
+
+/* /proc/sys/dev/parport/parport n */
+enum {
+ DEV_PARPORT_SPINTIME=1,
+ DEV_PARPORT_HARDWARE=2,
+ DEV_PARPORT_DEVICES=3,
+ DEV_PARPORT_AUTOPROBE=16
+};
+
+/* /proc/sys/dev/parport/parport n/devices/ */
+enum {
+ DEV_PARPORT_DEVICES_ACTIVE=-3,
+};
+
+/* /proc/sys/dev/parport/parport n/devices/device n */
+enum {
+ DEV_PARPORT_DEVICE_TIMESLICE=1,
+};
+
#ifdef __KERNEL__
extern asmlinkage int sys_sysctl(struct __sysctl_args *);
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 854cbd1a8..58fb7abfa 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -277,8 +277,8 @@ struct tty_struct {
struct tty_flip_buffer flip;
int max_flip_cnt;
int alt_speed; /* For magic substitution of 38400 bps */
- struct wait_queue *write_wait;
- struct wait_queue *read_wait;
+ wait_queue_head_t write_wait;
+ wait_queue_head_t read_wait;
struct tq_struct tq_hangup;
void *disc_data;
void *driver_data;
diff --git a/include/linux/umsdos_fs_i.h b/include/linux/umsdos_fs_i.h
index 111fd9137..e3af5e921 100644
--- a/include/linux/umsdos_fs_i.h
+++ b/include/linux/umsdos_fs_i.h
@@ -47,7 +47,7 @@
*/
struct dir_locking_info {
- struct wait_queue *p;
+ wait_queue_head_t p;
short int looking; /* How many process doing a lookup */
short int creating; /* Is there any creation going on here
* Only one at a time, although one
diff --git a/include/linux/videodev.h b/include/linux/videodev.h
index 119b60eec..52c1e0f31 100644
--- a/include/linux/videodev.h
+++ b/include/linux/videodev.h
@@ -278,6 +278,7 @@ struct video_unit
#define VID_HARDWARE_TYPHOON 19
#define VID_HARDWARE_VINO 20 /* Reserved for SGI Indy Vino */
#define VID_HARDWARE_CADET 21 /* Cadet radio */
+#define VID_HARDWARE_CPIA 22
/*
* Initialiser list
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index e1b727680..66451acdb 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -27,7 +27,7 @@ extern struct vt_struct {
struct vt_mode vt_mode;
int vt_pid;
int vt_newvt;
- struct wait_queue *paste_wait;
+ wait_queue_head_t paste_wait;
} *vt_cons[MAX_NR_CONSOLES];
void (*kd_mksound)(unsigned int hz, unsigned int ticks);
diff --git a/include/linux/wait.h b/include/linux/wait.h
index 6514693c2..79fae9356 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -8,24 +8,193 @@
#ifdef __KERNEL__
+#include <linux/kernel.h>
+#include <linux/list.h>
+#include <linux/stddef.h>
+
#include <asm/page.h>
+#include <asm/spinlock.h>
+#include <asm/processor.h>
+
+/*
+ * Temporary debugging help until all code is converted to the new
+ * waitqueue usage.
+ */
+#define WAITQUEUE_DEBUG 1
+
+#if WAITQUEUE_DEBUG
+extern int printk(const char *fmt, ...);
+#define WQ_BUG() do { \
+ printk("wq bug, forcing oops.\n"); \
+ *(int*)0 = 0; \
+} while (0)
+
+#define CHECK_MAGIC(x) if (x != (long)&(x)) \
+ { printk("bad magic %lx (should be %lx), ", (long)x, (long)&(x)); WQ_BUG(); }
+
+#define CHECK_MAGIC_WQHEAD(x) do { \
+ if (x->__magic != (long)&(x->__magic)) { \
+ printk("bad magic %lx (should be %lx, creator %lx), ", \
+ x->__magic, (long)&(x->__magic), x->__creator); \
+ WQ_BUG(); \
+ } \
+} while (0)
+#endif
-struct wait_queue {
+struct __wait_queue {
+ unsigned int compiler_warning;
struct task_struct * task;
- struct wait_queue * next;
+ struct list_head task_list;
+#if WAITQUEUE_DEBUG
+ long __magic;
+ long __waker;
+#endif
+};
+typedef struct __wait_queue wait_queue_t;
+
+/*
+ * 'dual' spinlock architecture. Can be switched between spinlock_t and
+ * rwlock_t locks via changing this define. Since waitqueues are quite
+ * decoupled in the new architecture, lightweight 'simple' spinlocks give
+ * us slightly better latencies and smaller waitqueue structure size.
+ */
+#define USE_RW_WAIT_QUEUE_SPINLOCK 0
+
+#if USE_RW_WAIT_QUEUE_SPINLOCK
+# define wq_lock_t rwlock_t
+# define WAITQUEUE_RW_LOCK_UNLOCKED RW_LOCK_UNLOCKED
+
+# define wq_read_lock read_lock
+# define wq_read_lock_irqsave read_lock_irqsave
+# define wq_read_unlock_irqrestore read_unlock_irqrestore
+# define wq_read_unlock read_unlock
+# define wq_write_lock_irq write_lock_irq
+# define wq_write_lock_irqsave write_lock_irqsave
+# define wq_write_unlock_irqrestore write_unlock_irqrestore
+# define wq_write_unlock write_unlock
+#else
+# define wq_lock_t spinlock_t
+# define WAITQUEUE_RW_LOCK_UNLOCKED SPIN_LOCK_UNLOCKED
+
+# define wq_read_lock spin_lock
+# define wq_read_lock_irqsave spin_lock_irqsave
+# define wq_read_unlock spin_unlock
+# define wq_read_unlock_irqrestore spin_unlock_irqrestore
+# define wq_write_lock_irq spin_lock_irq
+# define wq_write_lock_irqsave spin_lock_irqsave
+# define wq_write_unlock_irqrestore spin_unlock_irqrestore
+# define wq_write_unlock spin_unlock
+#endif
+
+struct __wait_queue_head {
+ wq_lock_t lock;
+ struct list_head task_list;
+#if WAITQUEUE_DEBUG
+ long __magic;
+ long __creator;
+#endif
};
+typedef struct __wait_queue_head wait_queue_head_t;
+
+#if WAITQUEUE_DEBUG
+# define __WAITQUEUE_DEBUG_INIT(name) \
+ , (long)&(name).__magic, 0
+# define __WAITQUEUE_HEAD_DEBUG_INIT(name) \
+ , (long)&(name).__magic, (long)&(name).__magic
+#else
+# define __WAITQUEUE_DEBUG_INIT(name)
+# define __WAITQUEUE_HEAD_DEBUG_INIT(name)
+#endif
+
+#define __WAITQUEUE_INITIALIZER(name,task) \
+ { 0x1234567, task, { NULL, NULL } __WAITQUEUE_DEBUG_INIT(name)}
+#define DECLARE_WAITQUEUE(name,task) \
+ wait_queue_t name = __WAITQUEUE_INITIALIZER(name,task)
+
+#define __WAIT_QUEUE_HEAD_INITIALIZER(name) \
+{ WAITQUEUE_RW_LOCK_UNLOCKED, { &(name).task_list, &(name).task_list } \
+ __WAITQUEUE_HEAD_DEBUG_INIT(name)}
+
+#define DECLARE_WAIT_QUEUE_HEAD(name) \
+ wait_queue_head_t name = __WAIT_QUEUE_HEAD_INITIALIZER(name)
-#define WAIT_QUEUE_HEAD(x) ((struct wait_queue *)((x)-1))
+static inline void init_waitqueue_head(wait_queue_head_t *q)
+{
+#if WAITQUEUE_DEBUG
+ if (!q)
+ WQ_BUG();
+#endif
+ q->lock = WAITQUEUE_RW_LOCK_UNLOCKED;
+ INIT_LIST_HEAD(&q->task_list);
+#if WAITQUEUE_DEBUG
+ q->__magic = (long)&q->__magic;
+ q->__creator = (long)current_text_addr();
+#endif
+}
+
+static inline void init_waitqueue_entry(wait_queue_t *q,
+ struct task_struct *p)
+{
+#if WAITQUEUE_DEBUG
+ if (!q || !p)
+ WQ_BUG();
+#endif
+ q->task = p;
+#if WAITQUEUE_DEBUG
+ q->__magic = (long)&q->__magic;
+#endif
+}
+
+static inline int waitqueue_active(wait_queue_head_t *q)
+{
+#if WAITQUEUE_DEBUG
+ if (!q)
+ WQ_BUG();
+ CHECK_MAGIC_WQHEAD(q);
+#endif
+
+ return !list_empty(&q->task_list);
+}
+
+extern inline void __add_wait_queue(wait_queue_head_t *head, wait_queue_t *new)
+{
+#if WAITQUEUE_DEBUG
+ if (!head || !new)
+ WQ_BUG();
+ CHECK_MAGIC_WQHEAD(head);
+ CHECK_MAGIC(new->__magic);
+ if (!head->task_list.next || !head->task_list.prev)
+ WQ_BUG();
+#endif
+ list_add(&new->task_list, &head->task_list);
+}
-static inline void init_waitqueue(struct wait_queue **q)
+/*
+ * Used for wake-one threads:
+ */
+extern inline void __add_wait_queue_tail(wait_queue_head_t *head,
+ wait_queue_t *new)
{
- *q = WAIT_QUEUE_HEAD(q);
+#if WAITQUEUE_DEBUG
+ if (!head || !new)
+ WQ_BUG();
+ CHECK_MAGIC_WQHEAD(head);
+ CHECK_MAGIC(new->__magic);
+ if (!head->task_list.next || !head->task_list.prev)
+ WQ_BUG();
+#endif
+ list_add(&new->task_list, head->task_list.prev);
}
-static inline int waitqueue_active(struct wait_queue **q)
+extern inline void __remove_wait_queue(wait_queue_head_t *head,
+ wait_queue_t *old)
{
- struct wait_queue *head = *q;
- return head && head != WAIT_QUEUE_HEAD(q);
+#if WAITQUEUE_DEBUG
+ if (!old)
+ WQ_BUG();
+ CHECK_MAGIC(old->__magic);
+#endif
+ list_del(&old->task_list);
}
#endif /* __KERNEL__ */
diff --git a/include/linux/wanrouter.h b/include/linux/wanrouter.h
index fd63868f9..c2c5ff4c3 100644
--- a/include/linux/wanrouter.h
+++ b/include/linux/wanrouter.h
@@ -5,6 +5,7 @@
*
* Author: Gene Kozin <genek@compuserve.com>
* Jaspreet Singh <jaspreet@sangoma.com>
+* Additions: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
*
* Copyright: (c) 1995-1997 Sangoma Technologies Inc.
*
@@ -13,11 +14,14 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
* ============================================================================
+* May 23, 1999 Arnaldo Melo Added local_addr to wanif_conf_t
+* WAN_DISCONNECTING state added
* Nov 06, 1997 Jaspreet Singh Changed Router Driver version to 1.1 from 1.0
* Oct 20, 1997 Jaspreet Singh Added 'cir','bc','be' and 'mc' to 'wanif_conf_t'
* Added 'enable_IPX' and 'network_number' to
* 'wan_device_t'. Also added defines for
-* UDP PACKET TYPE, Interrupt test, critical values* for RACE conditions.
+* UDP PACKET TYPE, Interrupt test, critical values
+* for RACE conditions.
* Oct 05, 1997 Jaspreet Singh Added 'dlci_num' and 'dlci[100]' to
* 'wan_fr_conf_t' to configure a list of dlci(s)
* for a NODE
@@ -125,7 +129,7 @@ typedef struct wan_fr_conf
unsigned n392; /* error threshold counter */
unsigned n393; /* monitored events counter */
unsigned dlci_num; /* number of DLCs (access node) */
- unsigned dlci[100]; /* List of all DLCIs */
+ unsigned dlci[100]; /* List of all DLCIs */
} wan_fr_conf_t;
/*----------------------------------------------------------------------------
@@ -274,6 +278,7 @@ enum wan_states
WAN_DISCONNECTED, /* link/channel is disconnected */
WAN_CONNECTING, /* connection is in progress */
WAN_CONNECTED, /* link/channel is operational */
+ WAN_DISCONNECTING, /* disconnection is in progress */
WAN_LIMIT /* for verification only */
};
@@ -298,6 +303,8 @@ typedef struct wanif_conf
unsigned bc; /* Committed Burst Size fwd, bwd */
unsigned be; /* Excess Burst Size fwd, bwd */
char mc; /* Multicast on or off */
+ char local_addr[WAN_ADDRESS_SZ+1];/* local media address, ASCIIZ */
+ unsigned char port; /* board port */
int reserved[8]; /* reserved for future extensions */
} wanif_conf_t;
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index d711d0d51..730fe97b4 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -56,7 +56,7 @@ extern struct inet6_ifaddr * ipv6_chk_addr(struct in6_addr *addr,
extern int ipv6_get_saddr(struct dst_entry *dst,
struct in6_addr *daddr,
struct in6_addr *saddr);
-extern struct inet6_ifaddr * ipv6_get_lladdr(struct device *dev);
+extern int ipv6_get_lladdr(struct device *dev, struct in6_addr *);
/*
* multicast prototypes (mcast.c)
@@ -68,6 +68,7 @@ extern int ipv6_sock_mc_drop(struct sock *sk,
int ifindex,
struct in6_addr *addr);
extern void ipv6_sock_mc_close(struct sock *sk);
+extern int inet6_mc_check(struct sock *sk, struct in6_addr *addr);
extern int ipv6_dev_mc_inc(struct device *dev,
struct in6_addr *addr);
diff --git a/include/net/dst.h b/include/net/dst.h
index baf4f414d..d34eb5079 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -77,9 +77,6 @@ struct dst_ops
#ifdef __KERNEL__
-extern struct dst_entry * dst_garbage_list;
-extern atomic_t dst_total;
-
extern __inline__
struct dst_entry * dst_clone(struct dst_entry * dst)
{
@@ -173,6 +170,9 @@ extern __inline__ void dst_set_expires(struct dst_entry *dst, int timeout)
if (dst->expires == 0 || (long)(dst->expires - expires) > 0)
dst->expires = expires;
}
+
+extern void dst_init(void);
+
#endif
#endif /* _NET_DST_H */
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h
index 4e9ed9780..3702028b6 100644
--- a/include/net/if_inet6.h
+++ b/include/net/if_inet6.h
@@ -44,6 +44,7 @@ struct inet6_ifaddr
__u32 valid_lft;
__u32 prefered_lft;
unsigned long tstamp;
+ atomic_t refcnt;
__u8 probes;
__u8 flags;
@@ -108,6 +109,7 @@ struct inet6_dev
struct inet6_ifaddr *addr_list;
struct ifmcaddr6 *mc_list;
+ rwlock_t lock;
__u32 if_flags;
struct neigh_parms *nd_parms;
diff --git a/include/net/ip.h b/include/net/ip.h
index 5e80fb438..c078484c3 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -83,7 +83,6 @@ extern int ip_mc_procinfo(char *, char **, off_t, int, int);
* Functions provided by ip.c
*/
-extern int ip_ioctl(struct sock *sk, int cmd, unsigned long arg);
extern void ip_build_and_send_pkt(struct sk_buff *skb, struct sock *sk,
u32 saddr, u32 daddr,
struct ip_options *opt);
@@ -147,10 +146,10 @@ extern __inline__ int ip_finish_output(struct sk_buff *skb)
skb->protocol = __constant_htons(ETH_P_IP);
if (hh) {
- read_lock_irq(&hh->hh_lock);
+ read_lock_bh(&hh->hh_lock);
memcpy(skb->data - 16, hh->hh_data, 16);
- read_unlock_irq(&hh->hh_lock);
- skb_push(skb, dev->hard_header_len);
+ read_unlock_bh(&hh->hh_lock);
+ skb_push(skb, hh->hh_len);
return hh->hh_output(skb);
} else if (dst->neighbour)
return dst->neighbour->output(skb);
diff --git a/include/net/ip_masq.h b/include/net/ip_masq.h
index 9c8e9bf94..518e5c4d8 100644
--- a/include/net/ip_masq.h
+++ b/include/net/ip_masq.h
@@ -231,24 +231,6 @@ extern void ip_masq_put(struct ip_masq *ms);
extern rwlock_t __ip_masq_lock;
-#ifdef __SMP__
-#define read_lock_bh(lock) do { start_bh_atomic(); read_lock(lock); \
- } while (0)
-#define read_unlock_bh(lock) do { read_unlock(lock); end_bh_atomic(); \
- } while (0)
-#define write_lock_bh(lock) do { start_bh_atomic(); write_lock(lock); \
- } while (0)
-#define write_unlock_bh(lock) do { write_unlock(lock); end_bh_atomic(); \
- } while (0)
-#else
-#define read_lock_bh(lock) start_bh_atomic()
-#define read_unlock_bh(lock) end_bh_atomic()
-#define write_lock_bh(lock) start_bh_atomic()
-#define write_unlock_bh(lock) end_bh_atomic()
-#endif
-/*
- *
- */
/*
* Debugging stuff
diff --git a/include/net/irda/crc.h b/include/net/irda/crc.h
index d4ee011e4..61a5a6488 100644
--- a/include/net/irda/crc.h
+++ b/include/net/irda/crc.h
@@ -6,25 +6,28 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Mon Aug 4 20:40:53 1997
- * Modified at: Tue Dec 15 22:18:53 1998
+ * Modified at: Sun May 2 20:25:23 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
********************************************************************/
-#ifndef IR_CRC_H
-#define IR_CRC_H
+#ifndef IRDA_CRC_H
+#define IRDA_CRC_H
#include <linux/types.h>
#define INIT_FCS 0xffff /* Initial FCS value */
#define GOOD_FCS 0xf0b8 /* Good final FCS value */
+extern __u16 const irda_crc16_table[];
+
/* Recompute the FCS with one more character appended. */
-#define IR_FCS(fcs, c) (((fcs) >> 8) ^ irda_crc16_table[((fcs) ^ (c)) & 0xff])
+static inline __u16 irda_fcs(__u16 fcs, __u8 c)
+{
+ return (((fcs) >> 8) ^ irda_crc16_table[((fcs) ^ (c)) & 0xff]);
+}
/* Recompute the FCS with len bytes appended. */
unsigned short crc_calc( __u16 fcs, __u8 const *buf, size_t len);
-extern __u16 const irda_crc16_table[];
-
#endif
diff --git a/include/net/irda/dongle.h b/include/net/irda/dongle.h
index d8983c009..82f129fca 100644
--- a/include/net/irda/dongle.h
+++ b/include/net/irda/dongle.h
@@ -6,10 +6,10 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Wed Oct 21 22:47:12 1998
- * Modified at: Sat Feb 6 07:37:49 1999
+ * Modified at: Sun May 16 13:40:03 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
- * Copyright (c) 1998 Dag Brattli, All Rights Reserved.
+ * Copyright (c) 1998-1999 Dag Brattli, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -26,7 +26,6 @@
#define DONGLE_H
#include <net/irda/qos.h>
-#include <net/irda/irda_device.h>
/* These are the currently known dongles */
typedef enum {
@@ -35,13 +34,16 @@ typedef enum {
ACTISYS_DONGLE,
ACTISYS_PLUS_DONGLE,
GIRBIL_DONGLE,
-} DONGLE_T;
+ LITELINK_DONGLE,
+} IRDA_DONGLE;
+
+struct irda_device;
struct dongle {
- DONGLE_T type;
+ IRDA_DONGLE type;
void (*open)(struct irda_device *, int type);
void (*close)(struct irda_device *);
- void (*reset)( struct irda_device *, int unused);
+ void (*reset)( struct irda_device *);
void (*change_speed)( struct irda_device *, int baudrate);
void (*qos_init)( struct irda_device *, struct qos_info *);
};
diff --git a/include/net/irda/ircomm_common.h b/include/net/irda/ircomm_common.h
index cd1c41f86..44d1b1774 100644
--- a/include/net/irda/ircomm_common.h
+++ b/include/net/irda/ircomm_common.h
@@ -6,7 +6,7 @@
* Status: Experimental.
* Author: Takahide Higuchi <thiguchi@pluto.dti.ne.jp>
*
- * Copyright (c) 1998, Takahide Higuchi, <thiguchi@pluto.dti.ne.jp>,
+ * Copyright (c) 1998-1999, Takahide Higuchi, <thiguchi@pluto.dti.ne.jp>,
* All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
@@ -77,9 +77,9 @@ typedef enum {
#define IRCOMM_MAGIC 0x434f4d4d
#define COMM_INIT_CTRL_PARAM 3 /* length of initial control parameters */
-#define COMM_HEADER 1 /* length of clen field */
-#define COMM_HEADER_SIZE (LAP_HEADER+LMP_HEADER+TTP_HEADER+COMM_HEADER)
-#define COMM_DEFAULT_DATA_SIZE 64
+#define COMM_HEADER_SIZE 1 /* length of clen field */
+#define COMM_MAX_HEADER_SIZE (TTP_MAX_HEADER+COMM_HEADER_SIZE)
+#define COMM_DEFAULT_SDU_SIZE (64 - COMM_HEADER_SIZE)
#define IRCOMM_MAX_CONNECTION 1 /* Don't change for now */
@@ -167,7 +167,7 @@ typedef enum {
#define LSR_BI 0x01 /* Break interrupt indicator */
-struct ircomm_cb{
+struct ircomm_cb {
int magic;
int state; /* Current state of IrCOMM layer:
* DISCOVERY,COMM_IDLE, COMM_WAITR,
@@ -177,8 +177,9 @@ struct ircomm_cb{
int null_modem_mode; /* switch for null modem emulation */
int ttp_stop;
- int max_txbuff_size;
- __u32 maxsdusize;
+ __u32 tx_max_sdu_size;
+ __u32 rx_max_sdu_size;
+ __u8 max_header_size;
__u32 daddr; /* Device address of the peer device */
__u32 saddr;
@@ -201,8 +202,8 @@ struct ircomm_cb{
see Irlmp.c or somewhere :p)*/
int peer_cap; /* capability of peer device */
- struct wait_queue *discovery_wait;
- struct wait_queue *ias_wait;
+ wait_queue_head_t discovery_wait;
+ wait_queue_head_t ias_wait;
/* statistics */
int tx_packets;
@@ -211,8 +212,6 @@ struct ircomm_cb{
int pending_control_tuples;
int ignored_control_tuples;
-
-
__u8 pi ; /* instruction of control channel*/
__u8 port_type;
@@ -253,8 +252,6 @@ struct ircomm_cb{
int port_name_critical;
};
-
-
void ircomm_connect_request(struct ircomm_cb *self, __u8 servicetype);
void ircomm_connect_response(struct ircomm_cb *self, struct sk_buff *userdata,
__u32 maxsdusize);
diff --git a/include/net/irda/irda.h b/include/net/irda/irda.h
index 35c15fadc..b0e67385b 100644
--- a/include/net/irda/irda.h
+++ b/include/net/irda/irda.h
@@ -6,10 +6,10 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Tue Dec 9 21:13:12 1997
- * Modified at: Wed Apr 21 17:49:00 1999
+ * Modified at: Mon May 10 09:51:13 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
- * Copyright (c) 1998 Dag Brattli, All Rights Reserved.
+ * Copyright (c) 1998-1999 Dag Brattli, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -109,6 +109,8 @@ struct irda_sock {
__u32 max_sdu_size_rx;
__u32 max_sdu_size_tx;
+ __u32 max_data_size;
+ __u8 max_header_size;
struct qos_info qos_tx;
__u16 mask; /* Hint bits mask */
@@ -122,7 +124,7 @@ struct irda_sock {
int errno;
struct sock *sk;
- struct wait_queue *ias_wait; /* Wait for LM-IAS answer */
+ wait_queue_head_t ias_wait; /* Wait for LM-IAS answer */
LOCAL_FLOW tx_flow;
LOCAL_FLOW rx_flow;
@@ -225,10 +227,10 @@ struct notify_t {
int (*udata_indication)(void *priv, void *sap, struct sk_buff *skb);
void (*connect_confirm)(void *instance, void *sap,
struct qos_info *qos, __u32 max_sdu_size,
- struct sk_buff *skb);
+ __u8 max_header_size, struct sk_buff *skb);
void (*connect_indication)(void *instance, void *sap,
struct qos_info *qos, __u32 max_sdu_size,
- struct sk_buff *skb);
+ __u8 max_header_size, struct sk_buff *skb);
void (*disconnect_indication)(void *instance, void *sap,
LM_REASON reason, struct sk_buff *);
void (*flow_indication)(void *instance, void *sap, LOCAL_FLOW flow);
diff --git a/include/net/irda/irda_device.h b/include/net/irda/irda_device.h
index a3dcf2d6e..5272633f7 100644
--- a/include/net/irda/irda_device.h
+++ b/include/net/irda/irda_device.h
@@ -4,24 +4,29 @@
* Version:
* Description:
* Status: Experimental.
- * Author: Haris Zukanovic <haris@stud.cs.uit.no>
+ * Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Tue Apr 14 12:41:42 1998
- * Modified at: Tue Apr 20 11:06:28 1999
+ * Modified at: Wed May 19 08:44:48 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
- * Copyright (c) 1998 Haris Zukanovic, <haris@stud.cs.uit.no>
- * Copyright (c) 1998 Dag Brattli, <dagb@cs.uit.no>
+ * Copyright (c) 1999 Dag Brattli, All Rights Reserved.
* Copyright (c) 1998 Thomas Davis, <ratbert@radiks.net>,
- * All Rights Reserved.
- *
+ * Copyright (c) 1998 Haris Zukanovic, <haris@stud.cs.uit.no>
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
- *
- * Neither Haris Zukanovic nor University of Tromsø admit liability nor
- * provide warranty for any of this software. This material is
- * provided "AS-IS" and at no charge.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
*
********************************************************************/
@@ -35,6 +40,7 @@
#include <net/irda/irda.h>
#include <net/irda/qos.h>
+#include <net/irda/dongle.h>
#include <net/irda/irqueue.h>
#include <net/irda/irlap_frame.h>
@@ -52,6 +58,11 @@
#define IO_XMIT 0x01
#define IO_RECV 0x02
+struct dongle_q {
+ QUEUE q;
+ struct dongle *dongle;
+};
+
/* Chip specific info */
struct chipio_t {
int iobase, iobase2; /* IO base */
@@ -111,16 +122,19 @@ struct irda_device {
struct iobuff_t tx_buff;
struct iobuff_t rx_buff;
- /* spinlock_t lock; */ /* For serializing operations */
+ struct dongle *dongle; /* Dongle driver */
+
+ spinlock_t lock; /* For serializing operations */
/* Media busy stuff */
int media_busy;
struct timer_list media_busy_timer;
/* Callbacks for driver specific implementation */
- void (*change_speed)(struct irda_device *driver, int baud);
+ void (*change_speed)(struct irda_device *idev, int baud);
int (*is_receiving)(struct irda_device *); /* receiving? */
- /* int (*is_tbusy)(struct irda_device *); */ /* transmitting? */
+ void (*set_dtr_rts)(struct irda_device *idev, int dtr, int rts);
+ int (*raw_write)(struct irda_device *idev, __u8 *buf, int len);
void (*wait_until_sent)(struct irda_device *);
void (*set_caddr)(struct irda_device *); /* Set connection addr */
};
@@ -142,6 +156,9 @@ inline void irda_device_change_speed(struct irda_device *, int);
inline struct qos_info *irda_device_get_qos(struct irda_device *self);
int irda_device_txqueue_empty(struct irda_device *self);
+void irda_device_init_dongle(struct irda_device *self, int type);
+void irda_device_unregister_dongle(struct dongle *dongle);
+int irda_device_register_dongle(struct dongle *dongle);
int irda_device_setup(struct device *dev);
@@ -153,7 +170,7 @@ void setup_dma(int channel, char *buffer, int count, int mode);
* Utility function for getting the minimum turnaround time out of
* the skb, where it has been hidden in the cb field.
*/
-inline static __u16 irda_get_mtt(struct sk_buff *skb)
+extern inline __u16 irda_get_mtt(struct sk_buff *skb)
{
__u16 mtt;
@@ -167,6 +184,23 @@ inline static __u16 irda_get_mtt(struct sk_buff *skb)
return mtt;
}
+extern inline void irda_device_set_dtr_rts(struct irda_device *self, int dtr,
+ int rts)
+{
+ if (self->set_dtr_rts)
+ self->set_dtr_rts(self, dtr, rts);
+}
+
+extern inline int irda_device_raw_write(struct irda_device *self, __u8 *buf,
+ int len)
+{
+ int ret = -1;
+
+ if (self->raw_write)
+ ret = self->raw_write(self, buf, len);
+ return ret;
+}
+
#endif
diff --git a/include/net/irda/iriap.h b/include/net/irda/iriap.h
index 071ed8561..355751afa 100644
--- a/include/net/irda/iriap.h
+++ b/include/net/irda/iriap.h
@@ -6,10 +6,10 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Thu Aug 21 00:02:07 1997
- * Modified at: Wed Apr 21 16:37:21 1999
+ * Modified at: Sun May 9 10:56:57 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
- * Copyright (c) 1997 Dag Brattli <dagb@cs.uit.no>, All Rights Reserved.
+ * Copyright (c) 1997, 1999 Dag Brattli <dagb@cs.uit.no>, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -81,6 +81,8 @@ struct iriap_cb {
CONFIRM_CALLBACK confirm;
void *priv;
+ __u8 max_header_size;
+
struct timer_list watchdog_timer;
};
@@ -92,8 +94,6 @@ void iriap_getvaluebyclass_request( char *name, char *attr,
void iriap_getvaluebyclass_confirm(struct iriap_cb *self, struct sk_buff *skb);
void iriap_send_ack( struct iriap_cb *self);
-void iriap_connect_confirm(void *instance, void *sap, struct qos_info *qos,
- __u32 max_sdu_size, struct sk_buff *skb);
void iriap_call_indication(struct iriap_cb *self, struct sk_buff *skb);
void iriap_register_server(void);
diff --git a/include/net/irda/irlan_common.h b/include/net/irda/irlan_common.h
index 35d83096f..fc343e5c0 100644
--- a/include/net/irda/irlan_common.h
+++ b/include/net/irda/irlan_common.h
@@ -6,10 +6,11 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Sun Aug 31 20:14:37 1997
- * Modified at: Thu Apr 22 14:30:37 1999
+ * Modified at: Mon May 31 13:54:20 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
- * Copyright (c) 1998 Dag Brattli <dagb@cs.uit.no>, All Rights Reserved.
+ * Copyright (c) 1998-1999 Dag Brattli <dagb@cs.uit.no>,
+ * All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -98,7 +99,7 @@
#define IRLAN_SHORT 1
#define IRLAN_ARRAY 2
-#define IRLAN_MAX_HEADER (TTP_HEADER+LMP_HEADER+LAP_HEADER)
+#define IRLAN_MAX_HEADER (TTP_HEADER+LMP_HEADER+LAP_MAX_HEADER)
/*
* IrLAN client
@@ -109,7 +110,10 @@ struct irlan_client_cb {
int open_retries;
struct tsap_cb *tsap_ctrl;
+ __u32 max_sdu_size;
+ __u8 max_header_size;
+ int access_type; /* Access type of provider */
__u8 reconnect_key[255];
__u8 key_len;
@@ -120,6 +124,9 @@ struct irlan_client_cb {
int unicast_open;
int broadcast_open;
+ int tx_busy;
+ struct sk_buff_head txq; /* Transmit control queue */
+
struct timer_list kick_timer;
};
@@ -130,6 +137,8 @@ struct irlan_provider_cb {
int state;
struct tsap_cb *tsap_ctrl;
+ __u32 max_sdu_size;
+ __u8 max_header_size;
/*
* Store some values here which are used by the provider to parse
@@ -140,42 +149,45 @@ struct irlan_provider_cb {
int filter_mode;
int filter_operation;
int filter_entry;
-
+ int access_type; /* Access type */
__u16 send_arb_val;
__u8 mac_address[6]; /* Generated MAC address for peer device */
};
/*
- * IrLAN
+ * IrLAN control block
*/
struct irlan_cb {
QUEUE queue; /* Must be first */
int magic;
char ifname[9];
- struct device dev; /* Ethernet device structure*/
+ struct device dev; /* Ethernet device structure*/
struct enet_statistics stats;
- __u32 saddr; /* Source devcie address */
- __u32 daddr; /* Destination device address */
+ __u32 saddr; /* Source device address */
+ __u32 daddr; /* Destination device address */
int netdev_registered;
int notify_irmanager;
- int media; /* Media type */
- int access_type; /* Currently used access type */
- __u8 version[2]; /* IrLAN version */
+ int media; /* Media type */
+ __u8 version[2]; /* IrLAN version */
struct tsap_cb *tsap_data;
- int use_udata; /* Use Unit Data transfers */
+ int master; /* Master instance? */
+ int use_udata; /* Use Unit Data transfers */
- __u8 stsap_sel_data; /* Source data TSAP selector */
- __u8 dtsap_sel_data; /* Destination data TSAP selector */
- __u8 dtsap_sel_ctrl; /* Destination ctrl TSAP selector */
+ __u8 stsap_sel_data; /* Source data TSAP selector */
+ __u8 dtsap_sel_data; /* Destination data TSAP selector */
+ __u8 dtsap_sel_ctrl; /* Destination ctrl TSAP selector */
- struct irlan_client_cb client; /* Client specific fields */
+ struct irlan_client_cb client; /* Client specific fields */
struct irlan_provider_cb provider; /* Provider specific fields */
+
+ __u32 max_sdu_size;
+ __u8 max_header_size;
struct timer_list watchdog_timer;
};
@@ -192,6 +204,8 @@ void irlan_start_watchdog_timer(struct irlan_cb *self, int timeout);
void irlan_open_data_tsap(struct irlan_cb *self);
+int irlan_run_ctrl_tx_queue(struct irlan_cb *self);
+
void irlan_get_provider_info(struct irlan_cb *self);
void irlan_get_unicast_addr(struct irlan_cb *self);
void irlan_get_media_char(struct irlan_cb *self);
diff --git a/include/net/irda/irlan_eth.h b/include/net/irda/irlan_eth.h
index 6ad33ee48..376df91ff 100644
--- a/include/net/irda/irlan_eth.h
+++ b/include/net/irda/irlan_eth.h
@@ -6,10 +6,10 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Thu Oct 15 08:36:58 1998
- * Modified at: Thu Apr 22 14:09:37 1999
+ * Modified at: Fri May 14 23:29:00 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
- * Copyright (c) 1998 Dag Brattli, All Rights Reserved.
+ * Copyright (c) 1998-1999 Dag Brattli, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -32,6 +32,7 @@ int irlan_eth_receive(void *instance, void *sap, struct sk_buff *skb);
int irlan_eth_xmit(struct sk_buff *skb, struct device *dev);
void irlan_eth_flow_indication( void *instance, void *sap, LOCAL_FLOW flow);
+void irlan_eth_send_gratuitous_arp(struct device *dev);
void irlan_eth_set_multicast_list( struct device *dev);
struct enet_statistics *irlan_eth_get_stats(struct device *dev);
diff --git a/include/net/irda/irlan_provider.h b/include/net/irda/irlan_provider.h
index aafbf9141..ca51d5b7c 100644
--- a/include/net/irda/irlan_provider.h
+++ b/include/net/irda/irlan_provider.h
@@ -6,10 +6,10 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Sun Aug 31 20:14:37 1997
- * Modified at: Thu Apr 22 14:29:16 1999
+ * Modified at: Sun May 9 12:26:11 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
- * Copyright (c) 1998 Dag Brattli <dagb@cs.uit.no>, All Rights Reserved.
+ * Copyright (c) 1998-1999 Dag Brattli <dagb@cs.uit.no>, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -36,13 +36,7 @@ void irlan_provider_ctrl_disconnect_indication(void *instance, void *sap,
LM_REASON reason,
struct sk_buff *skb);
-void irlan_provider_ctrl_data_indication(void *instance, void *sap,
- struct sk_buff *skb);
-void irlan_provider_connect_indication(void *instance, void *sap,
- struct qos_info *qos,
- __u32 max_sdu_size,
- struct sk_buff *skb);
void irlan_provider_connect_response(struct irlan_cb *, struct tsap_cb *);
int irlan_parse_open_data_cmd(struct irlan_cb *self, struct sk_buff *skb);
diff --git a/include/net/irda/irlap.h b/include/net/irda/irlap.h
index f3b26110f..c5767397e 100644
--- a/include/net/irda/irlap.h
+++ b/include/net/irda/irlap.h
@@ -6,10 +6,10 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Mon Aug 4 20:40:53 1997
- * Modified at: Fri Apr 23 09:51:15 1999
+ * Modified at: Sun May 9 11:38:18 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
- * Copyright (c) 1998 Dag Brattli <dagb@cs.uit.no>, All Rights Reserved.
+ * Copyright (c) 1998-1999 Dag Brattli <dagb@cs.uit.no>, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -42,11 +42,11 @@
#define LAP_COMP_HEADER 1 /* IrLAP Compression Header */
#ifdef CONFIG_IRDA_COMPRESSION
-# define LAP_HEADER (LAP_ADDR_HEADER + LAP_CTRL_HEADER + LAP_COMP_HEADER)
+# define LAP_MAX_HEADER (LAP_ADDR_HEADER + LAP_CTRL_HEADER + LAP_COMP_HEADER)
# define IRDA_COMPRESSED 1
# define IRDA_NORMAL 0
#else
-#define LAP_HEADER (LAP_ADDR_HEADER + LAP_CTRL_HEADER)
+#define LAP_MAX_HEADER (LAP_ADDR_HEADER + LAP_CTRL_HEADER)
#endif
#define BROADCAST 0xffffffff /* Broadcast device address */
@@ -138,7 +138,7 @@ struct irlap_cb {
__u8 vs; /* Next frame to be sent */
__u8 vr; /* Next frame to be received */
- int tmp;
+/* int tmp; */
__u8 va; /* Last frame acked */
int window; /* Nr of I-frames allowed to send */
int window_size; /* Current negotiated window size */
@@ -155,8 +155,7 @@ struct irlap_cb {
__u8 s; /* Current slot */
int frame_sent; /* Have we sent reply? */
- int discovery_count;
- hashbin_t *discovery_log;
+ hashbin_t *discovery_log;
discovery_t *discovery_cmd;
struct qos_info qos_tx; /* QoS requested by peer */
@@ -227,4 +226,9 @@ void irlap_init_qos_capabilities(struct irlap_cb *, struct qos_info *);
void irlap_apply_default_connection_parameters(struct irlap_cb *self);
void irlap_apply_connection_parameters(struct irlap_cb *, struct qos_info *);
+extern inline __u8 irlap_get_header_size(struct irlap_cb *self)
+{
+ return 2;
+}
+
#endif
diff --git a/include/net/irda/irlmp.h b/include/net/irda/irlmp.h
index 31785883a..e879c6b94 100644
--- a/include/net/irda/irlmp.h
+++ b/include/net/irda/irlmp.h
@@ -6,10 +6,10 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Sun Aug 17 20:54:32 1997
- * Modified at: Fri Apr 23 09:15:07 1999
+ * Modified at: Sun May 9 11:01:34 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
- * Copyright (c) 1998 Dag Brattli <dagb@cs.uit.no>, All Rights Reserved.
+ * Copyright (c) 1998-1999 Dag Brattli <dagb@cs.uit.no>, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -52,7 +52,7 @@
#define LMP_HEADER 2 /* Dest LSAP + Source LSAP */
#define LMP_CONTROL_HEADER 4
-#define LMP_MAX_HEADER (LAP_HEADER+LMP_HEADER)
+#define LMP_MAX_HEADER (LMP_CONTROL_HEADER+LAP_MAX_HEADER)
#define LM_MAX_CONNECTIONS 10
diff --git a/include/net/irda/irlpt_common.h b/include/net/irda/irlpt_common.h
index 83a9c307c..25ad8ef01 100644
--- a/include/net/irda/irlpt_common.h
+++ b/include/net/irda/irlpt_common.h
@@ -46,7 +46,7 @@ extern char *irlpt_client_fsm_state[];
extern char *irlpt_server_fsm_state[];
extern char *irlpt_fsm_event[];
-extern struct wait_queue *lpt_wait;
+extern wait_queue_head_t lpt_wait;
extern struct irlpt_cb *irlpt_find_handle(unsigned int minor);
extern void irlpt_flow_control(struct sk_buff *skb);
@@ -158,12 +158,13 @@ struct irlpt_cb {
struct miscdevice ir_dev; /* used to register the misc device. */
int count; /* open count */
- int irlap_data_size; /* max frame size we can send */
+ int max_data_size; /* max frame size we can send */
+ int max_header_size; /* how much header space is needed */
int pkt_count; /* how many packets are queued up */
- struct wait_queue *read_wait; /* wait queues */
- struct wait_queue *write_wait;
- struct wait_queue *ex_wait;
+ wait_queue_head_t read_wait; /* wait queues */
+ wait_queue_head_t write_wait;
+ wait_queue_head_t ex_wait;
/* this is used to remove the printer when it's gone */
struct timer_list lpt_timer;
diff --git a/include/net/irda/irmod.h b/include/net/irda/irmod.h
index 651e87dbc..9612a5572 100644
--- a/include/net/irda/irmod.h
+++ b/include/net/irda/irmod.h
@@ -90,7 +90,7 @@ struct irda_todo {
*/
struct irda_cb {
struct miscdevice dev;
- struct wait_queue *wait_queue;
+ wait_queue_head_t *wait_queue;
int in_use;
diff --git a/include/net/irda/irport.h b/include/net/irda/irport.h
index c4a036a4d..0912e0496 100644
--- a/include/net/irda/irport.h
+++ b/include/net/irda/irport.h
@@ -6,10 +6,10 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Sun Aug 3 13:49:59 1997
- * Modified at: Thu Jan 7 14:17:31 1999
+ * Modified at: Wed May 19 15:31:16 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
- * Copyright (c) 1997, 1998 Dag Brattli <dagb@cs.uit.no>
+ * Copyright (c) 1997, 1998-1999 Dag Brattli <dagb@cs.uit.no>
* All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
@@ -49,13 +49,14 @@
#define FRAME_MAX_SIZE 2048
-void irport_close( int iobase);
-int irport_open( int iobase);
-int irport_detect(struct irda_device *idev);
+void irport_start(struct irda_device *idev, int iobase);
+void irport_stop(struct irda_device *idev, int iobase);
+int irport_probe(int iobase);
-void irport_change_speed( int iobase, int speed);
+void irport_change_speed(struct irda_device *idev, int speed);
void irport_interrupt(int irq, void *dev_id, struct pt_regs *regs);
-int irport_hard_xmit( struct sk_buff *skb, struct device *dev);
+int irport_hard_xmit(struct sk_buff *skb, struct device *dev);
+void irport_wait_until_sent(struct irda_device *idev);
#endif
diff --git a/include/net/irda/irqueue.h b/include/net/irda/irqueue.h
index 1e208ccf4..523de0db6 100644
--- a/include/net/irda/irqueue.h
+++ b/include/net/irda/irqueue.h
@@ -6,7 +6,7 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Tue Jun 9 13:26:50 1998
- * Modified at: Thu Feb 25 20:34:21 1999
+ * Modified at: Tue May 25 07:54:41 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
* Copyright (C) 1998, Aage Kvalnes <aage@cs.uit.no>
@@ -30,8 +30,6 @@
#include <linux/types.h>
#include <asm/spinlock.h>
-/* #include <net/irda/irda.h> */
-
#ifndef QUEUE_H
#define QUEUE_H
diff --git a/include/net/irda/irttp.h b/include/net/irda/irttp.h
index aec1d57dc..3e6511cea 100644
--- a/include/net/irda/irttp.h
+++ b/include/net/irda/irttp.h
@@ -6,10 +6,10 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Sun Aug 31 20:14:31 1997
- * Modified at: Sat Apr 10 10:19:56 1999
+ * Modified at: Mon May 10 19:14:51 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
- * Copyright (c) 1998 Dag Brattli <dagb@cs.uit.no>, All Rights Reserved.
+ * Copyright (c) 1998-1999 Dag Brattli <dagb@cs.uit.no>, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -36,7 +36,8 @@
#define TTP_MAX_CONNECTIONS LM_MAX_CONNECTIONS
#define TTP_HEADER 1
-#define TTP_HEADER_WITH_SAR 6
+#define TTP_MAX_HEADER (TTP_HEADER + LMP_MAX_HEADER)
+#define TTP_SAR_HEADER 5
#define TTP_PARAMETERS 0x80
#define TTP_MORE 0x80
@@ -61,8 +62,6 @@ struct tsap_cb {
QUEUE queue; /* For linking it into the hashbin */
int magic; /* Just in case */
- int max_seg_size; /* Max data that fit into an IrLAP frame */
-
__u8 stsap_sel; /* Source TSAP */
__u8 dtsap_sel; /* Destination TSAP */
@@ -88,6 +87,9 @@ struct tsap_cb {
struct irda_statistics stats;
struct timer_list todo_timer;
+ __u32 max_seg_size; /* Max data that fit into an IrLAP frame */
+ __u8 max_header_size;
+
int rx_sdu_busy; /* RxSdu.busy */
__u32 rx_sdu_size; /* Current size of a partially received frame */
__u32 rx_max_sdu_size; /* Max receive user data size */
@@ -120,8 +122,6 @@ int irttp_connect_request(struct tsap_cb *self, __u8 dtsap_sel,
__u32 saddr, __u32 daddr,
struct qos_info *qos, __u32 max_sdu_size,
struct sk_buff *userdata);
-void irttp_connect_confirm(void *instance, void *sap, struct qos_info *qos,
- __u32 max_sdu_size, struct sk_buff *skb);
void irttp_connect_response(struct tsap_cb *self, __u32 max_sdu_size,
struct sk_buff *userdata);
struct tsap_cb *irttp_dup(struct tsap_cb *self, void *instance);
diff --git a/include/net/irda/irtty.h b/include/net/irda/irtty.h
index 920909600..38b5c4d81 100644
--- a/include/net/irda/irtty.h
+++ b/include/net/irda/irtty.h
@@ -6,10 +6,10 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Tue Dec 9 21:13:12 1997
- * Modified at: Sun Feb 7 01:57:33 1999
+ * Modified at: Mon May 10 13:22:23 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
- * Copyright (c) 1997 Dag Brattli, All Rights Reserved.
+ * Copyright (c) 1997, 1999 Dag Brattli, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -33,8 +33,6 @@
#include <net/irda/irqueue.h>
#include <net/irda/irda_device.h>
-#include <net/irda/dongle.h>
-
#define IRTTY_IOC_MAGIC 'e'
#define IRTTY_IOCTDONGLE _IO(IRTTY_IOC_MAGIC, 1)
#define IRTTY_IOC_MAXNR 1
@@ -43,28 +41,21 @@
#define N_IRDA 11 /* This one should go in </asm/termio.h> */
#endif
-struct dongle_q {
- QUEUE q;
-
- struct dongle *dongle;
-};
-
struct irtty_cb {
QUEUE q; /* Must be first */
-/* char name[16]; */
-
int magic;
struct tty_struct *tty; /* Ptr to TTY structure */
struct irda_device idev;
-
- struct dongle_q *dongle_q; /* Has this tty got a dongle attached? */
};
-int irtty_register_dongle( struct dongle *dongle);
-void irtty_unregister_dongle( struct dongle *dongle);
-
-void irtty_set_dtr_rts(struct tty_struct *tty, int dtr, int rts);
+int irtty_register_dongle(struct dongle *dongle);
+void irtty_unregister_dongle(struct dongle *dongle);
#endif
+
+
+
+
+
diff --git a/include/net/irda/irvtd.h b/include/net/irda/irvtd.h
index 1fc7d6b0f..68340087a 100644
--- a/include/net/irda/irvtd.h
+++ b/include/net/irda/irvtd.h
@@ -53,6 +53,8 @@ struct irvtd_cb {
struct sk_buff_head rxbuff;
struct ircomm_cb *comm; /* ircomm instance */
+ __u32 tx_max_sdu_size;
+ __u32 max_header_size;
/*
* These members are used for compatibility with usual serial device.
* See linux/serial.h
@@ -64,12 +66,13 @@ struct irvtd_cb {
int line;
int count; /* open count */
int blocked_open;
- struct wait_queue *open_wait;
- struct wait_queue *close_wait;
- struct wait_queue *delta_msr_wait;
- struct wait_queue *tx_wait;
+ wait_queue_head_t open_wait;
+ wait_queue_head_t close_wait;
+ wait_queue_head_t delta_msr_wait;
+ wait_queue_head_t tx_wait;
- struct timer_list timer;
+ struct timer_list tx_timer;
+ struct timer_list rx_timer;
long pgrp;
long session;
diff --git a/include/net/irda/w83977af_ir.h b/include/net/irda/w83977af_ir.h
index 3e3200b2d..d86456ada 100644
--- a/include/net/irda/w83977af_ir.h
+++ b/include/net/irda/w83977af_ir.h
@@ -6,10 +6,10 @@
* Status: Experimental.
* Author: Paul VanderSpek
* Created at: Thu Nov 19 13:55:34 1998
- * Modified at: Thu Dec 10 14:06:18 1998
+ * Modified at: Mon May 3 12:07:25 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
- * Copyright (c) 1998 Dag Brattli, All Rights Reserved.
+ * Copyright (c) 1998-1999 Dag Brattli, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -150,6 +150,29 @@
#define IRM_CR_IRX_MSL 0x40
#define IRM_CR_AF_MNT 0x80 /* Automatic format */
+/* For storing entries in the status FIFO */
+struct st_fifo_entry {
+ int status;
+ int len;
+};
+
+struct st_fifo {
+ struct st_fifo_entry entries[10];
+ int head;
+ int tail;
+ int len;
+};
+
+/* Private data for each instance */
+struct w83977af_ir {
+ struct st_fifo st_fifo;
+
+ int tx_buff_offsets[10]; /* Offsets between frames in tx_buff */
+ int tx_len; /* Number of frames in tx_buff */
+
+ struct irda_device idev;
+};
+
static inline void switch_bank( int iobase, int set)
{
outb( set, iobase+SSR);
diff --git a/include/net/irda/wrapper.h b/include/net/irda/wrapper.h
index ca21ebec5..fa7ceb25c 100644
--- a/include/net/irda/wrapper.h
+++ b/include/net/irda/wrapper.h
@@ -1,15 +1,16 @@
/*********************************************************************
*
* Filename: wrapper.h
- * Version: 1.0
- * Description: IrDA Wrapper layer
+ * Version: 1.2
+ * Description: IrDA SIR async wrapper layer
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Mon Aug 4 20:40:53 1997
- * Modified at: Fri Jan 29 10:15:46 1999
+ * Modified at: Mon May 3 09:02:36 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
- * Copyright (c) 1998 Dag Brattli <dagb@cs.uit.no>, All Rights Reserved.
+ * Copyright (c) 1998-1999 Dag Brattli <dagb@cs.uit.no>,
+ * All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -38,17 +39,18 @@
#define STA BOF /* Start flag */
#define STO EOF /* End flag */
-#define IR_TRANS 0x20 /* Asynchronous transparency modifier */
+#define IRDA_TRANS 0x20 /* Asynchronous transparency modifier */
+/* States for receving a frame in async mode */
enum {
- OUTSIDE_FRAME = 1,
+ OUTSIDE_FRAME,
BEGIN_FRAME,
LINK_ESCAPE,
INSIDE_FRAME
};
/* Proto definitions */
-int async_wrap_skb( struct sk_buff *skb, __u8 *tx_buff, int buffsize);
-void async_unwrap_char( struct irda_device *, __u8 byte);
+int async_wrap_skb(struct sk_buff *skb, __u8 *tx_buff, int buffsize);
+inline void async_unwrap_char(struct irda_device *idev, __u8 byte);
#endif
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 5c5d90bb0..95803be46 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -96,7 +96,8 @@ struct neighbour
__u8 flags;
__u8 nud_state;
__u8 type;
- __u8 probes;
+ atomic_t probes;
+ rwlock_t lock;
unsigned char ha[MAX_ADDR_LEN];
struct hh_cache *hh;
atomic_t refcnt;
@@ -155,7 +156,7 @@ struct neigh_table
struct timer_list proxy_timer;
struct sk_buff_head proxy_queue;
int entries;
- atomic_t lock;
+ rwlock_t lock;
unsigned long last_rand;
struct neigh_parms *parms_list;
struct neigh_statistics stats;
@@ -165,9 +166,12 @@ struct neigh_table
extern void neigh_table_init(struct neigh_table *tbl);
extern int neigh_table_clear(struct neigh_table *tbl);
-extern struct neighbour *__neigh_lookup(struct neigh_table *tbl,
- const void *pkey, struct device *dev,
- int creat);
+extern struct neighbour * neigh_lookup(struct neigh_table *tbl,
+ const void *pkey,
+ struct device *dev);
+extern struct neighbour * neigh_create(struct neigh_table *tbl,
+ const void *pkey,
+ struct device *dev);
extern void neigh_destroy(struct neighbour *neigh);
extern int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb);
extern int neigh_update(struct neighbour *neigh, u8 *lladdr, u8 new, int override, int arp);
@@ -226,16 +230,6 @@ extern __inline__ void neigh_confirm(struct neighbour *neigh)
neigh->confirmed = jiffies;
}
-extern __inline__ struct neighbour *
-neigh_lookup(struct neigh_table *tbl, const void *pkey, struct device *dev)
-{
- struct neighbour *neigh;
- start_bh_atomic();
- neigh = __neigh_lookup(tbl, pkey, dev, 0);
- end_bh_atomic();
- return neigh;
-}
-
extern __inline__ int neigh_is_connected(struct neighbour *neigh)
{
return neigh->nud_state&NUD_CONNECTED;
@@ -254,17 +248,16 @@ extern __inline__ int neigh_event_send(struct neighbour *neigh, struct sk_buff *
return 0;
}
-extern __inline__ void neigh_table_lock(struct neigh_table *tbl)
+extern __inline__ struct neighbour *
+__neigh_lookup(struct neigh_table *tbl, const void *pkey, struct device *dev, int creat)
{
- atomic_inc(&tbl->lock);
- synchronize_bh();
-}
+ struct neighbour *n = neigh_lookup(tbl, pkey, dev);
-extern __inline__ void neigh_table_unlock(struct neigh_table *tbl)
-{
- atomic_dec(&tbl->lock);
-}
+ if (n || !creat)
+ return n;
+ return neigh_create(tbl, pkey, dev);
+}
#endif
#endif
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 4c37d11ed..f9c80dd0f 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -77,14 +77,11 @@ extern __inline__ int tc_classify(struct sk_buff *skb, struct tcf_proto *tp, str
return -1;
}
-extern __inline__ unsigned long cls_set_class(unsigned long *clp, unsigned long cl)
-{
- cl = xchg(clp, cl);
- synchronize_bh();
- return cl;
-}
+
extern int register_tcf_proto_ops(struct tcf_proto_ops *ops);
extern int unregister_tcf_proto_ops(struct tcf_proto_ops *ops);
+
+
#endif
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 9911464fc..46262159d 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -66,9 +66,12 @@ struct Qdisc_ops
struct Qdisc_head
{
struct Qdisc_head *forw;
+ struct Qdisc_head *back;
};
extern struct Qdisc_head qdisc_head;
+extern spinlock_t qdisc_runqueue_lock;
+extern rwlock_t qdisc_tree_lock;
struct Qdisc
{
@@ -106,6 +109,46 @@ struct qdisc_rate_table
int refcnt;
};
+extern __inline__ void sch_tree_lock(struct Qdisc *q)
+{
+ write_lock(&qdisc_tree_lock);
+ spin_lock_bh(&q->dev->queue_lock);
+}
+
+extern __inline__ void sch_tree_unlock(struct Qdisc *q)
+{
+ spin_unlock_bh(&q->dev->queue_lock);
+ write_unlock(&qdisc_tree_lock);
+}
+
+extern __inline__ void tcf_tree_lock(struct tcf_proto *tp)
+{
+ write_lock(&qdisc_tree_lock);
+ spin_lock_bh(&tp->q->dev->queue_lock);
+}
+
+extern __inline__ void tcf_tree_unlock(struct tcf_proto *tp)
+{
+ spin_unlock_bh(&tp->q->dev->queue_lock);
+ write_unlock(&qdisc_tree_lock);
+}
+
+
+extern __inline__ unsigned long
+cls_set_class(struct tcf_proto *tp, unsigned long *clp, unsigned long cl)
+{
+ tcf_tree_lock(tp);
+ cl = xchg(clp, cl);
+ tcf_tree_unlock(tp);
+ return cl;
+}
+
+extern __inline__ unsigned long
+__cls_set_class(unsigned long *clp, unsigned long cl)
+{
+ return xchg(clp, cl);
+}
+
/*
Timer resolution MUST BE < 10% of min_schedulable_packet_size/bandwidth
@@ -343,12 +386,14 @@ struct tcf_police
u32 toks;
u32 ptoks;
psched_time_t t_c;
+ spinlock_t lock;
struct qdisc_rate_table *R_tab;
struct qdisc_rate_table *P_tab;
struct tc_stats stats;
};
+extern int qdisc_copy_stats(struct sk_buff *skb, struct tc_stats *st);
extern void tcf_police_destroy(struct tcf_police *p);
extern struct tcf_police * tcf_police_locate(struct rtattr *rta, struct rtattr *est);
extern int tcf_police_dump(struct sk_buff *skb, struct tcf_police *p);
@@ -384,20 +429,56 @@ int teql_init(void);
int tc_filter_init(void);
int pktsched_init(void);
-void qdisc_run_queues(void);
-int qdisc_restart(struct device *dev);
+extern void qdisc_run_queues(void);
+extern int qdisc_restart(struct device *dev);
+
+extern spinlock_t qdisc_runqueue_lock;
+
+/* Is it on run list? Reliable only under qdisc_runqueue_lock. */
+
+extern __inline__ int qdisc_on_runqueue(struct Qdisc *q)
+{
+ return q->h.forw != NULL;
+}
+
+/* Is run list not empty? Reliable only under qdisc_runqueue_lock. */
+
+extern __inline__ int qdisc_pending(void)
+{
+ return qdisc_head.forw != &qdisc_head;
+}
+
+/* Add qdisc to tail of run list. Called with BH, disabled on this CPU */
+
+extern __inline__ void qdisc_run(struct Qdisc *q)
+{
+ spin_lock(&qdisc_runqueue_lock);
+ if (!qdisc_on_runqueue(q)) {
+ q->h.forw = &qdisc_head;
+ q->h.back = qdisc_head.back;
+ qdisc_head.back->forw = &q->h;
+ qdisc_head.back = &q->h;
+ }
+ spin_unlock(&qdisc_runqueue_lock);
+}
+
+/* If the device is not throttled, restart it and add to run list.
+ * BH must be disabled on this CPU.
+ */
extern __inline__ void qdisc_wakeup(struct device *dev)
{
if (!dev->tbusy) {
- struct Qdisc *q = dev->qdisc;
- if (qdisc_restart(dev) && q->h.forw == NULL) {
- q->h.forw = qdisc_head.forw;
- qdisc_head.forw = &q->h;
- }
+ spin_lock(&dev->queue_lock);
+ if (qdisc_restart(dev))
+ qdisc_run(dev->qdisc);
+ spin_unlock(&dev->queue_lock);
}
}
+/* Calculate maximal size of packet seen by hard_start_xmit
+ routine of this device.
+ */
extern __inline__ unsigned psched_mtu(struct device *dev)
{
unsigned mtu = dev->mtu;
diff --git a/include/net/route.h b/include/net/route.h
index 66df47122..e230f45fc 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -35,13 +35,6 @@
#define RT_HASH_DIVISOR 256
-/*
- * Prevents LRU trashing, entries considered equivalent,
- * if the difference between last use times is less then this number.
- */
-#define RT_CACHE_BUBBLE_THRESHOLD (5*HZ)
-
-
#define RTO_ONLINK 0x01
#define RTO_TPROXY 0x80000000
@@ -94,8 +87,6 @@ struct rtable
#endif
};
-extern struct rtable *rt_hash_table[RT_HASH_DIVISOR];
-
struct ip_rt_acct
{
__u32 o_bytes;
@@ -105,6 +96,7 @@ struct ip_rt_acct
};
extern struct ip_rt_acct ip_rt_acct[256];
+extern rwlock_t ip_rt_acct_lock;
extern void ip_rt_init(void);
extern void ip_rt_redirect(u32 old_gw, u32 dst, u32 new_gw,
diff --git a/include/net/sock.h b/include/net/sock.h
index e11c1be22..73ef988a7 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -105,6 +105,7 @@ struct unix_opt {
struct sock ** list;
struct sock * gc_tree;
int inflight;
+ atomic_t user_count;
};
#ifdef CONFIG_NETLINK
@@ -353,6 +354,22 @@ struct tcp_opt {
#define SOCK_DEBUG(sk, msg...) do { } while (0)
#endif
+/* This is the per-socket lock. The spinlock provides a synchronization
+ * between user contexts and software interrupt processing, whereas the
+ * mini-semaphore synchronizes multiple users amongst themselves.
+ */
+typedef struct {
+ spinlock_t slock;
+ unsigned int users;
+ wait_queue_head_t wq;
+} socket_lock_t;
+
+#define sock_lock_init(__sk) \
+do { spin_lock_init(&((__sk)->lock.slock)); \
+ (__sk)->lock.users = 0; \
+ init_waitqueue_head(&((__sk)->lock.wq)); \
+} while(0);
+
struct sock {
/* This must be first. */
struct sock *sklist_next;
@@ -381,10 +398,10 @@ struct sock {
unsigned char reuse, /* SO_REUSEADDR setting */
nonagle; /* Disable Nagle algorithm? */
- atomic_t sock_readers; /* User count */
+ socket_lock_t lock; /* Synchronizer... */
int rcvbuf; /* Size of receive buffer in bytes */
- struct wait_queue **sleep; /* Sock wait queue */
+ wait_queue_head_t *sleep; /* Sock wait queue */
struct dst_entry *dst_cache; /* Destination cache */
atomic_t rmem_alloc; /* Receive queue bytes committed */
struct sk_buff_head receive_queue; /* Incoming packets */
@@ -415,9 +432,17 @@ struct sock {
int hashent;
struct sock *pair;
- /* Error and backlog packet queues, rarely used. */
- struct sk_buff_head back_log,
- error_queue;
+ /* The backlog queue is special, it is always used with
+ * the per-socket spinlock held and requires low latency
+ * access. Therefore we special case it's implementation.
+ */
+ struct {
+ struct sk_buff *head;
+ struct sk_buff *tail;
+ } backlog;
+
+ /* Error queue, rarely used. */
+ struct sk_buff_head error_queue;
struct proto *prot;
@@ -537,6 +562,18 @@ struct sock {
void (*destruct)(struct sock *sk);
};
+/* The per-socket spinlock must be held here. */
+#define sk_add_backlog(__sk, __skb) \
+do { if((__sk)->backlog.tail == NULL) { \
+ (__sk)->backlog.head = \
+ (__sk)->backlog.tail = (__skb); \
+ } else { \
+ ((__sk)->backlog.tail)->next = (__skb); \
+ (__sk)->backlog.tail = (__skb); \
+ } \
+ (__skb)->next = NULL; \
+} while(0)
+
/* IP protocol blocks we attach to sockets.
* socket layer -> transport layer interface
* transport -> network interface is defined by struct inet_proto
@@ -616,15 +653,26 @@ struct proto {
/* Per-protocol hash table implementations use this to make sure
* nothing changes.
*/
-#define SOCKHASH_LOCK() start_bh_atomic()
-#define SOCKHASH_UNLOCK() end_bh_atomic()
+extern rwlock_t sockhash_lock;
+#define SOCKHASH_LOCK_READ() read_lock_bh(&sockhash_lock)
+#define SOCKHASH_UNLOCK_READ() read_unlock_bh(&sockhash_lock)
+#define SOCKHASH_LOCK_WRITE() write_lock_bh(&sockhash_lock)
+#define SOCKHASH_UNLOCK_WRITE() write_unlock_bh(&sockhash_lock)
+
+/* The following variants must _only_ be used when you know you
+ * can only be executing in a BH context.
+ */
+#define SOCKHASH_LOCK_READ_BH() read_lock(&sockhash_lock)
+#define SOCKHASH_UNLOCK_READ_BH() read_unlock(&sockhash_lock)
+#define SOCKHASH_LOCK_WRITE_BH() write_lock(&sockhash_lock)
+#define SOCKHASH_UNLOCK_WRITE_BH() write_unlock(&sockhash_lock)
/* Some things in the kernel just want to get at a protocols
* entire socket list commensurate, thus...
*/
static __inline__ void add_to_prot_sklist(struct sock *sk)
{
- SOCKHASH_LOCK();
+ SOCKHASH_LOCK_WRITE();
if(!sk->sklist_next) {
struct proto *p = sk->prot;
@@ -638,54 +686,37 @@ static __inline__ void add_to_prot_sklist(struct sock *sk)
if(sk->prot->highestinuse < sk->prot->inuse)
sk->prot->highestinuse = sk->prot->inuse;
}
- SOCKHASH_UNLOCK();
+ SOCKHASH_UNLOCK_WRITE();
}
static __inline__ void del_from_prot_sklist(struct sock *sk)
{
- SOCKHASH_LOCK();
+ SOCKHASH_LOCK_WRITE();
if(sk->sklist_next) {
sk->sklist_next->sklist_prev = sk->sklist_prev;
sk->sklist_prev->sklist_next = sk->sklist_next;
sk->sklist_next = NULL;
sk->prot->inuse--;
}
- SOCKHASH_UNLOCK();
+ SOCKHASH_UNLOCK_WRITE();
}
-/*
- * Used by processes to "lock" a socket state, so that
+/* Used by processes to "lock" a socket state, so that
* interrupts and bottom half handlers won't change it
* from under us. It essentially blocks any incoming
* packets, so that we won't get any new data or any
* packets that change the state of the socket.
*
- * Note the 'barrier()' calls: gcc may not move a lock
- * "downwards" or a unlock "upwards" when optimizing.
+ * While locked, BH processing will add new packets to
+ * the backlog queue. This queue is processed by the
+ * owner of the socket lock right before it is released.
*/
-extern void __release_sock(struct sock *sk);
-
-static inline void lock_sock(struct sock *sk)
-{
-#if 0
-/* debugging code: the test isn't even 100% correct, but it can catch bugs */
-/* Note that a double lock is ok in theory - it's just _usually_ a bug */
- if (atomic_read(&sk->sock_readers)) {
- __label__ here;
- printk("double lock on socket at %p\n", &&here);
-here:
- }
-#endif
- atomic_inc(&sk->sock_readers);
- synchronize_bh();
-}
+extern void lock_sock(struct sock *sk);
+extern void release_sock(struct sock *sk);
-static inline void release_sock(struct sock *sk)
-{
- barrier();
- if (atomic_dec_and_test(&sk->sock_readers))
- __release_sock(sk);
-}
+/* BH context may only use the following locking interface. */
+#define bh_lock_sock(__sk) spin_lock(&((__sk)->lock.slock))
+#define bh_unlock_sock(__sk) spin_unlock(&((__sk)->lock.slock))
/*
* This might not be the most appropriate place for this two
@@ -944,4 +975,26 @@ extern __inline__ int gfp_any(void)
#define NETDEBUG(x) do { x; } while (0)
#endif
+/*
+ * Macros for sleeping on a socket. Use them like this:
+ *
+ * SOCK_SLEEP_PRE(sk)
+ * if (condition)
+ * schedule();
+ * SOCK_SLEEP_POST(sk)
+ *
+ */
+
+#define SOCK_SLEEP_PRE(sk) { struct task_struct *tsk = current; \
+ DECLARE_WAITQUEUE(wait, tsk); \
+ tsk->state = TASK_INTERRUPTIBLE; \
+ add_wait_queue((sk)->sleep, &wait); \
+ release_sock(sk);
+
+#define SOCK_SLEEP_POST(sk) tsk->state = TASK_RUNNING; \
+ remove_wait_queue((sk)->sleep, &wait); \
+ lock_sock(sk); \
+ }
+
+
#endif /* _SOCK_H */
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 2d91a8d43..28fc52125 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -27,19 +27,16 @@
* New scheme, half the table is for TIME_WAIT, the other half is
* for the rest. I'll experiment with dynamic table growth later.
*/
-#define TCP_HTABLE_SIZE 512
+extern int tcp_ehash_size;
+extern struct sock **tcp_ehash;
/* This is for listening sockets, thus all sockets which possess wildcards. */
#define TCP_LHTABLE_SIZE 32 /* Yes, really, this is all you need. */
-/* This is for all sockets, to keep track of the local port allocations. */
-#define TCP_BHTABLE_SIZE 512
-
/* tcp_ipv4.c: These need to be shared by v4 and v6 because the lookup
* and hashing code needs to work with different AF's yet
* the port space is shared.
*/
-extern struct sock *tcp_established_hash[TCP_HTABLE_SIZE];
extern struct sock *tcp_listening_hash[TCP_LHTABLE_SIZE];
/* There are a few simple rules, which allow for local port reuse by
@@ -85,7 +82,9 @@ struct tcp_bind_bucket {
struct tcp_bind_bucket **pprev;
};
-extern struct tcp_bind_bucket *tcp_bound_hash[TCP_BHTABLE_SIZE];
+extern struct tcp_bind_bucket **tcp_bhash;
+extern int tcp_bhash_size;
+
extern kmem_cache_t *tcp_bucket_cachep;
extern struct tcp_bind_bucket *tcp_bucket_create(unsigned short snum);
extern void tcp_bucket_unlock(struct sock *sk);
@@ -113,7 +112,7 @@ static __inline__ void tcp_reg_zap(struct sock *sk)
/* These are AF independent. */
static __inline__ int tcp_bhashfn(__u16 lport)
{
- return (lport & (TCP_BHTABLE_SIZE - 1));
+ return (lport & (tcp_bhash_size - 1));
}
static __inline__ void tcp_sk_bindify(struct sock *sk)
@@ -121,7 +120,7 @@ static __inline__ void tcp_sk_bindify(struct sock *sk)
struct tcp_bind_bucket *tb;
unsigned short snum = sk->num;
- for(tb = tcp_bound_hash[tcp_bhashfn(snum)]; tb->port != snum; tb = tb->next)
+ for(tb = tcp_bhash[tcp_bhashfn(snum)]; tb->port != snum; tb = tb->next)
;
/* Update bucket flags. */
if(tb->owners == NULL) {
@@ -290,7 +289,7 @@ static __inline__ int tcp_sk_listen_hashfn(struct sock *sk)
#define TCP_PROBEWAIT_LEN (1*HZ)/* time to wait between probes when
* I've got something to write and
* there is no window */
-#define TCP_KEEPALIVE_TIME (180*60*HZ) /* two hours */
+#define TCP_KEEPALIVE_TIME (120*60*HZ) /* two hours */
#define TCP_KEEPALIVE_PROBES 9 /* Max of 9 keepalive probes */
#define TCP_KEEPALIVE_PERIOD ((75*HZ)>>2) /* period of keepalive check */
@@ -728,7 +727,7 @@ extern __inline__ int tcp_raise_window(struct sock *sk)
*/
extern __inline__ __u32 tcp_recalc_ssthresh(struct tcp_opt *tp)
{
- __u32 snd_wnd_packets = tp->snd_wnd / tp->mss_cache;
+ __u32 snd_wnd_packets = tp->snd_wnd / max(tp->mss_cache, 1);
return max(min(snd_wnd_packets, tp->snd_cwnd) >> 1, 2);
}
diff --git a/include/net/udp.h b/include/net/udp.h
index 5af3c18b7..30a59b3f0 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -34,8 +34,14 @@ extern struct sock *udp_hash[UDP_HTABLE_SIZE];
extern unsigned short udp_good_socknum(void);
-#define UDP_NO_CHECK 0
+/* Note: this must match 'valbool' in sock_setsockopt */
+#define UDP_CSUM_NOXMIT 1
+/* Used by SunRPC/xprt layer. */
+#define UDP_CSUM_NORCV 2
+
+/* Default, as per the RFC, is to always do csums. */
+#define UDP_CSUM_DEFAULT 0
extern struct proto udp_prot;
diff --git a/include/scsi/scsicam.h b/include/scsi/scsicam.h
index 954e1407e..a9f00e229 100644
--- a/include/scsi/scsicam.h
+++ b/include/scsi/scsicam.h
@@ -14,4 +14,6 @@
#define SCSICAM_H
#include <linux/kdev_t.h>
extern int scsicam_bios_param (Disk *disk, kdev_t dev, int *ip);
+extern int scsi_partsize(struct buffer_head *bh, unsigned long capacity,
+ unsigned int *cyls, unsigned int *hds, unsigned int *secs);
#endif /* def SCSICAM_H */
diff --git a/include/scsi/sg.h b/include/scsi/sg.h
index 3e112c659..8b50bb3da 100644
--- a/include/scsi/sg.h
+++ b/include/scsi/sg.h
@@ -12,10 +12,16 @@ Original driver (sg.h):
* Copyright (C) 1998, 1999 Douglas Gilbert
- Version: 2.1.32 (990501)
- This version for later 2.1.x series and 2.2.x kernels
+ Version: 2.1.34 (990603)
+ This version for later 2.1.x and 2.2.x series kernels
D. P. Gilbert (dgilbert@interlog.com, dougg@triode.net.au)
+ Changes since 2.1.33 (990521)
+ - implement SG_SET_RESERVED_SIZE and associated memory re-org.
+ - add SG_NEXT_CMD_LEN to override SCSI command lengths
+ - add SG_GET_VERSION_NUM to get version expressed as an integer
+ Changes since 2.1.32 (990501)
+ - fix race condition in sg_read() and sg_open()
Changes since 2.1.31 (990327)
- add ioctls SG_GET_UNDERRUN_FLAG and _SET_. Change the default
to _not_ flag underruns (affects aic7xxx driver)
@@ -25,24 +31,6 @@ Original driver (sg.h):
Changes since 2.1.30 (990320)
- memory tweaks: change flags on kmalloc (GFP_KERNEL to GFP_ATOMIC)
- increase max allowable mid-level pool usage
- Changes since 2.1.21 (990315)
- - skipped to 2.1.30 indicating interface change (revert to 2.1.9)
- - remove attempt to accomodate cdrecord 1.8, will fix app
- - keep SG_?ET_RESERVED_SIZE naming for clarity
- Changes since 2.1.20 (990313)
- - ommission: left out logic for SG_?ET_ALT_INTERFACE, now added
- Changes since 2.1.9 (990309)
- - skipped to version 2.1.20 to indicate some interface changes
- - incorporate sg changes to make cdrecord 1.8 work (had its
- own patches that were different from the original)
- - change SG_?ET_BUFF_SIZE to SG_?ET_RESERVED_SIZE for clarity
- Changes since 2.1.8 (990303)
- - debug ">9" option dumps debug for _all_ active sg devices
- - increase allowable dma pool usage + increase minimum threshhold
- - pad out sg_scsi_id structure
- Changes since 2.1.7 (990227)
- - command queuing now "non-default" [back. compat. with cdparanoia]
- - Tighten access on some ioctls
New features and changes:
@@ -52,24 +40,32 @@ Original driver (sg.h):
- the SCSI target, host and driver status are returned
in unused fields of sg_header (maintaining its original size).
- asynchronous notification support added (SIGPOLL, SIGIO) for
- read()s ( write()s should never block).
- - pack_id logic added so read() can be made to wait for a specific
- pack_id.
+ read()s (write()s should never block).
+ - pack_id logic added so read() can wait for a specific pack_id.
- uses memory > ISA_DMA_THRESHOLD if adapter allows it (e.g. a
pci scsi adapter).
- this driver no longer uses a single SG_BIG_BUFF sized buffer
- obtained at driver/module init time. Rather it obtains a
- SG_SCATTER_SZ buffer when a fd is open()ed and frees it at
- the corresponding release() (ie pr fd). Hence open() can return
- ENOMEM! If write() request > SG_SCATTER_SZ bytes for data then
- it can fail with ENOMEM as well (if so, scale back).
+ obtained at driver/module init time. Rather it tries to obtain a
+ SG_DEF_RESERVED_SIZE buffer when a fd is open()ed and frees it
+ at the corresponding release() (ie per fd). Actually the "buffer"
+ may be a collection of buffers if scatter-gather is being used.
+ - add SG_SET_RESERVED_SIZE ioctl allowing the user to request a
+ large buffer for duration of current file descriptor's lifetime.
+ - SG_GET_RESERVED_SIZE ioctl can be used to find out how much
+ actually has been reserved.
+ - add SG_NEXT_CMD_LEN ioctl to override SCSI command length on
+ the next write() to this file descriptor.
+ - SG_GET_RESERVED_SIZE's presence as a symbol can be used for
+ compile time identification of the version 2 sg driver.
+ However, it is recommended that run time identification based on
+ calling the ioctl of the same name is a more flexible and
+ safer approach.
- adds several ioctl calls, see ioctl section below.
- - SG_SCATTER_SZ's presence indicates this version of "sg" driver.
Good documentation on the original "sg" device interface and usage can be
- found in the Linux HOWTO document: "SCSI Programming HOWTO" by Heiko
- Eissfeldt; last updated 7 May 1996. I will add more info on using the
- extensions in this driver as required. A quick summary:
+ found in the Linux HOWTO document: "SCSI Programming HOWTO" (version 0.5)
+ by Heiko Eissfeldt; last updated 7 May 1996. Here is a quick summary of
+ sg basics:
An SG device is accessed by writing SCSI commands plus any associated
outgoing data to it; the resulting status codes and any incoming data
are then obtained by a read call. The device can be opened O_NONBLOCK
@@ -88,38 +84,37 @@ Original driver (sg.h):
The given SCSI command has its LUN field overwritten internally by the
value associated with the device that has been opened.
- Memory (RAM) is used within this driver for direct memory access (DMA)
- in transferring data to and from the SCSI device. The dreaded ENOMEM
- seems to be more prevalent under early 2.2.x kernels than under the
- 2.0.x kernel series. For a given (large) transfer the memory obtained by
- this driver must be contiguous or scatter-gather must be used (if
- supported by the adapter). [Furthermore, ISA SCSI adapters can only use
- memory below the 16MB level on a i386.]
- This driver tries hard to find some suitable memory before admitting
- defeat and returning ENOMEM. All is not lost if application writers
- then back off the amount they are requesting. The value returned by
- the SG_GET_RESERVED_SIZE ioctl is guaranteed to be available (one
- per fd). This driver does the following:
- - attempts to reserve a SG_SCATTER_SZ sized buffer on open(). The
- actual amount reserved is given by the SG_GET_RESERVED_SIZE ioctl().
- - each write() needs to reserve a DMA buffer of the size of the
- data buffer indicated (excluding sg_header and command overhead).
- This buffer, depending on its size, adapter type (ISA or not) and
- the amount of memory available will be obtained from the kernel
- directly (get_free_pages or kmalloc) or the from the scsi mid-level
- dma pool (taking care not to exhaust it).
- If the buffer requested is > SG_SCATTER_SZ or memory is tight then
- scatter-gather will be used if supported by the adapter.
- - write() will also attempt to use the buffer reserved on open()
- if it is large enough.
- The above strategy ensures that a write() can always depend on a buffer
- of the size indicated by the SG_GET_RESERVED_SIZE ioctl() (which could be
- 0, but at least the app knows things are tight in advance).
- Hence application writers can adopt quite aggressive strategies (e.g.
- requesting 512KB) and scale them back in the face of ENOMEM errors.
- N.B. Queuing up commands also ties up kernel memory.
-
- More documentation can be found at www.torque.net/sg
+ This device currently uses "indirect IO" in the sense that data is
+ DMAed into kernel buffers from the hardware and afterwards is
+ transferred into the user space (or vice versa if you are writing).
+ Transfer speeds or up to 20 to 30MBytes/sec have been measured using
+ indirect IO. For faster throughputs "direct IO" which cuts out the
+ double handling of data is required. This will also need a new interface.
+
+ Grabbing memory for those kernel buffers used in this driver for DMA may
+ cause the dreaded ENOMEM error. This error seems to be more prevalent
+ under early 2.2.x kernels than under the 2.0.x kernel series. For a given
+ (large) transfer the memory obtained by this driver must be contiguous or
+ scatter-gather must be used (if supported by the adapter). [Furthermore,
+ ISA SCSI adapters can only use memory below the 16MB level on a i386.]
+
+ When a "sg" device is open()ed O_RDWR then this driver will attempt to
+ reserve a buffer of SG_DEF_RESERVED_SIZE that will be used by subsequent
+ write()s on this file descriptor as long as:
+ - it is not already in use (eg when command queuing is in use)
+ - the write() does not call for a buffer size larger than the
+ reserved size.
+ In these cases the write() will attempt to find the memory it needs for
+ DMA buffers dynamically and in the worst case will fail with ENOMEM.
+ The amount of memory actually reserved depends on various dynamic factors
+ and can be checked with the SG_GET_RESERVED_SIZE ioctl(). [In a very
+ tight memory situation it may yield 0!] The size of the reserved buffer
+ can be changed with the SG_SET_RESERVED_SIZE ioctl(). It should be
+ followed with a call to the SG_GET_RESERVED_SIZE ioctl() to find out how
+ much was actually reserved.
+
+ More documentation plus test and utility programs can be found at
+ http://www.torque.net/sg
*/
#define SG_MAX_SENSE 16 /* too little, unlikely to change in 2.2.x */
@@ -129,7 +124,7 @@ struct sg_header
int pack_len; /* [o] reply_len (ie useless), ignored as input */
int reply_len; /* [i] max length of expected reply (inc. sg_header) */
int pack_id; /* [io] id number of packet (use ints >= 0) */
- int result; /* [o] 0==ok, else (+ve) Unix errno code (e.g. EIO) */
+ int result; /* [o] 0==ok, else (+ve) Unix errno (best ignored) */
unsigned int twelve_byte:1;
/* [i] Force 12 byte command length for group 6 & 7 commands */
unsigned int target_status:5; /* [o] scsi status from target */
@@ -154,9 +149,9 @@ typedef struct sg_scsi_id {
int unused3;
} Sg_scsi_id;
-/* ioctls ( _GET_s yield result via 'int *' 3rd argument unless
- otherwise indicated */
-#define SG_SET_TIMEOUT 0x2201 /* unit: jiffies, 10ms on i386 */
+/* IOCTLs: ( _GET_s yield result via 'int *' 3rd argument unless
+ otherwise indicated) */
+#define SG_SET_TIMEOUT 0x2201 /* unit: jiffies (10ms on i386) */
#define SG_GET_TIMEOUT 0x2202 /* yield timeout as _return_ value */
#define SG_EMULATED_HOST 0x2203 /* true for emulated host adapter (ATAPI) */
@@ -165,23 +160,21 @@ typedef struct sg_scsi_id {
#define SG_SET_TRANSFORM 0x2204
#define SG_GET_TRANSFORM 0x2205
-#define SG_SET_RESERVED_SIZE 0x2275 /* currently ignored, future addition */
-/* Following yields buffer reserved by open(): 0 <= x <= SG_SCATTER_SZ */
-#define SG_GET_RESERVED_SIZE 0x2272
+#define SG_SET_RESERVED_SIZE 0x2275 /* request a new reserved buffer size */
+#define SG_GET_RESERVED_SIZE 0x2272 /* actual size of reserved buffer */
/* The following ioctl takes a 'Sg_scsi_id *' object as its 3rd argument. */
-#define SG_GET_SCSI_ID 0x2276 /* Yields fd's bus,chan,dev,lun+type */
+#define SG_GET_SCSI_ID 0x2276 /* Yields fd's bus, chan, dev, lun + type */
/* SCSI id information can also be obtained from SCSI_IOCTL_GET_IDLUN */
-/* Override adapter setting and always DMA using low memory ( <16MB on i386).
- Default is 0 (off - use adapter setting) */
+/* Override host setting and always DMA using low memory ( <16MB on i386) */
#define SG_SET_FORCE_LOW_DMA 0x2279 /* 0-> use adapter setting, 1-> force */
#define SG_GET_LOW_DMA 0x227a /* 0-> use all ram for dma; 1-> low dma ram */
/* When SG_SET_FORCE_PACK_ID set to 1, pack_id is input to read() which
will attempt to read that pack_id or block (or return EAGAIN). If
pack_id is -1 then read oldest waiting. When ...FORCE_PACK_ID set to 0
- (default) then pack_id ignored by read() and oldest readable fetched. */
+ then pack_id ignored by read() and oldest readable fetched. */
#define SG_SET_FORCE_PACK_ID 0x227b
#define SG_GET_PACK_ID 0x227c /* Yields oldest readable pack_id (or -1) */
@@ -194,43 +187,47 @@ typedef struct sg_scsi_id {
/* Yields max scatter gather tablesize allowed by current host adapter */
#define SG_GET_SG_TABLESIZE 0x227F /* 0 implies can't do scatter gather */
-/* Control whether sequencing per file descriptor (default) or per device */
-#define SG_GET_MERGE_FD 0x2274 /* 0-> per fd (default), 1-> per device */
+/* Control whether sequencing per file descriptor or per device */
+#define SG_GET_MERGE_FD 0x2274 /* 0-> per fd, 1-> per device */
#define SG_SET_MERGE_FD 0x2273 /* Attempt to change sequencing state,
- if more than 1 fd open on device, will fail with EBUSY */
+ if more than current fd open on device, will fail with EBUSY */
/* Get/set command queuing state per fd (default is SG_DEF_COMMAND_Q) */
#define SG_GET_COMMAND_Q 0x2270 /* Yields 0 (queuing off) or 1 (on) */
#define SG_SET_COMMAND_Q 0x2271 /* Change queuing state with 0 or 1 */
-/* Get/set whether DMA underrun will cause an error (DID_ERROR) [this only
- currently applies to the [much-used] aic7xxx driver) */
+/* Get/set whether DMA underrun will cause an error (DID_ERROR). This only
+ currently applies to the [much-used] aic7xxx driver. */
#define SG_GET_UNDERRUN_FLAG 0x2280 /* Yields 0 (don't flag) or 1 (flag) */
#define SG_SET_UNDERRUN_FLAG 0x2281 /* Change flag underrun state */
+#define SG_GET_VERSION_NUM 0x2282 /* Example: version 2.1.34 yields 20134 */
+#define SG_NEXT_CMD_LEN 0x2283 /* override SCSI command length with given
+ number on the next write() on this file descriptor */
+
+
+#define SG_SCATTER_SZ (8 * 4096) /* PAGE_SIZE not available to user */
+/* Largest size (in bytes) a single scatter-gather list element can have.
+ The value must be a power of 2 and <= (PAGE_SIZE * 32) [131072 bytes on
+ i386]. The minimum value is PAGE_SIZE. If scatter-gather not supported
+ by adapter then this value is the largest data block that can be
+ read/written by a single scsi command. The user can find the value of
+ PAGE_SIZE by calling getpagesize() defined in unistd.h . */
#define SG_DEFAULT_TIMEOUT (60*HZ) /* HZ == 'jiffies in 1 second' */
#define SG_DEFAULT_RETRIES 1
-/* Default modes, commented if they differ from original sg driver */
+/* Defaults, commented if they differ from original sg driver */
#define SG_DEF_COMMAND_Q 0
#define SG_DEF_MERGE_FD 0 /* was 1 -> per device sequencing */
#define SG_DEF_FORCE_LOW_DMA 0 /* was 1 -> memory below 16MB on i386 */
#define SG_DEF_FORCE_PACK_ID 0
#define SG_DEF_UNDERRUN_FLAG 0
+#define SG_DEF_RESERVED_SIZE SG_SCATTER_SZ
/* maximum outstanding requests, write() yields EDOM if exceeded */
#define SG_MAX_QUEUE 16
-#define SG_SCATTER_SZ (8 * 4096) /* PAGE_SIZE not available to user */
-/* Largest size (in bytes) a single scatter-gather list element can have.
- The value must be a power of 2 and <= (PAGE_SIZE * 32) [131072 bytes on
- i386]. The minimum value is PAGE_SIZE. If scatter-gather not supported
- by adapter then this value is the largest data block that can be
- read/written by a single scsi command. Max number of scatter-gather
- list elements seems to be limited to 255. */
-
-#define SG_BIG_BUFF SG_SCATTER_SZ /* for backward compatibility */
-/* #define SG_BIG_BUFF (SG_SCATTER_SZ * 8) */ /* =256KB, if you want */
+#define SG_BIG_BUFF SG_DEF_RESERVED_SIZE /* for backward compatibility */
#endif