diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-i386/math_emu.h | 1 | ||||
| -rw-r--r-- | include/asm-i386/softirq.h | 4 | ||||
| -rw-r--r-- | include/asm-sparc/bitops.h | 54 | ||||
| -rw-r--r-- | include/linux/blkdev.h | 6 | ||||
| -rw-r--r-- | include/linux/interrupt.h | 54 | ||||
| -rw-r--r-- | include/linux/mii.h | 36 | ||||
| -rw-r--r-- | include/linux/netdevice.h | 1 | ||||
| -rw-r--r-- | include/linux/parport_pc.h | 22 |
8 files changed, 112 insertions, 66 deletions
diff --git a/include/asm-i386/math_emu.h b/include/asm-i386/math_emu.h index a5e7361e4f88..bc8421d5e5ff 100644 --- a/include/asm-i386/math_emu.h +++ b/include/asm-i386/math_emu.h @@ -12,7 +12,6 @@ int save_i387_soft(void *s387, struct _fpstate * buf); */ struct info { long ___orig_eip; - long ___ret_from_system_call; long ___ebx; long ___ecx; long ___edx; diff --git a/include/asm-i386/softirq.h b/include/asm-i386/softirq.h index 4bf8d607b906..2e4cf1762073 100644 --- a/include/asm-i386/softirq.h +++ b/include/asm-i386/softirq.h @@ -25,7 +25,11 @@ #define local_bh_enable() \ do { \ unsigned int *ptr = &local_bh_count(smp_processor_id()); \ + unsigned long flags; \ \ + __save_flags(flags); \ + if (!(flags & (1 << 9))) \ + BUG(); \ barrier(); \ if (!--*ptr) \ __asm__ __volatile__ ( \ diff --git a/include/asm-sparc/bitops.h b/include/asm-sparc/bitops.h index e75775f853be..40eaa82244ac 100644 --- a/include/asm-sparc/bitops.h +++ b/include/asm-sparc/bitops.h @@ -1,4 +1,4 @@ -/* $Id: bitops.h,v 1.63 2001/07/17 16:17:33 anton Exp $ +/* $Id: bitops.h,v 1.64 2001/07/18 13:48:23 anton Exp $ * bitops.h: Bit string operations on the Sparc. * * Copyright 1995 David S. Miller (davem@caip.rutgers.edu) @@ -25,22 +25,36 @@ static __inline__ int test_and_set_bit(unsigned long nr, volatile void *addr) { register unsigned long mask asm("g2"); register unsigned long *ADDR asm("g1"); + ADDR = ((unsigned long *) addr) + (nr >> 5); mask = 1 << (nr & 31); + __asm__ __volatile__(" mov %%o7, %%g4 call ___set_bit add %%o7, 8, %%o7 " : "=&r" (mask) : "0" (mask), "r" (ADDR) - : "g3", "g4", "g5", "g7", "cc"); + : "g3", "g4", "g5", "g7", "memory", "cc"); return mask != 0; } static __inline__ void set_bit(unsigned long nr, volatile void *addr) { - (void) test_and_set_bit(nr, addr); + register unsigned long mask asm("g2"); + register unsigned long *ADDR asm("g1"); + + ADDR = ((unsigned long *) addr) + (nr >> 5); + mask = 1 << (nr & 31); + + __asm__ __volatile__(" + mov %%o7, %%g4 + call ___set_bit + add %%o7, 8, %%o7 +" : "=&r" (mask) + : "0" (mask), "r" (ADDR) + : "g3", "g4", "g5", "g7", "cc"); } static __inline__ int test_and_clear_bit(unsigned long nr, volatile void *addr) @@ -50,20 +64,33 @@ static __inline__ int test_and_clear_bit(unsigned long nr, volatile void *addr) ADDR = ((unsigned long *) addr) + (nr >> 5); mask = 1 << (nr & 31); + __asm__ __volatile__(" mov %%o7, %%g4 call ___clear_bit add %%o7, 8, %%o7 " : "=&r" (mask) : "0" (mask), "r" (ADDR) - : "g3", "g4", "g5", "g7", "cc"); + : "g3", "g4", "g5", "g7", "memory", "cc"); return mask != 0; } static __inline__ void clear_bit(unsigned long nr, volatile void *addr) { - (void) test_and_clear_bit(nr, addr); + register unsigned long mask asm("g2"); + register unsigned long *ADDR asm("g1"); + + ADDR = ((unsigned long *) addr) + (nr >> 5); + mask = 1 << (nr & 31); + + __asm__ __volatile__(" + mov %%o7, %%g4 + call ___clear_bit + add %%o7, 8, %%o7 +" : "=&r" (mask) + : "0" (mask), "r" (ADDR) + : "g3", "g4", "g5", "g7", "cc"); } static __inline__ int test_and_change_bit(unsigned long nr, volatile void *addr) @@ -73,20 +100,33 @@ static __inline__ int test_and_change_bit(unsigned long nr, volatile void *addr) ADDR = ((unsigned long *) addr) + (nr >> 5); mask = 1 << (nr & 31); + __asm__ __volatile__(" mov %%o7, %%g4 call ___change_bit add %%o7, 8, %%o7 " : "=&r" (mask) : "0" (mask), "r" (ADDR) - : "g3", "g4", "g5", "g7", "cc"); + : "g3", "g4", "g5", "g7", "memory", "cc"); return mask != 0; } static __inline__ void change_bit(unsigned long nr, volatile void *addr) { - (void) test_and_change_bit(nr, addr); + register unsigned long mask asm("g2"); + register unsigned long *ADDR asm("g1"); + + ADDR = ((unsigned long *) addr) + (nr >> 5); + mask = 1 << (nr & 31); + + __asm__ __volatile__(" + mov %%o7, %%g4 + call ___change_bit + add %%o7, 8, %%o7 +" : "=&r" (mask) + : "0" (mask), "r" (ADDR) + : "g3", "g4", "g5", "g7", "cc"); } /* diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 3fd98287a093..1c45c2cb3637 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -14,9 +14,7 @@ typedef struct elevator_s elevator_t; /* * Ok, this is an expanded form so that we can use the same - * request for paging requests when that is implemented. In - * paging, 'bh' is NULL, and the completion is used to wait - * for the IO to be ready. + * request for paging requests. */ struct request { struct list_head queue; @@ -184,7 +182,7 @@ extern atomic_t queued_sectors; #define PageAlignSize(size) (((size) + PAGE_SIZE -1) & PAGE_MASK) /* read-ahead in pages.. */ -#define MAX_READAHEAD 31 +#define MAX_READAHEAD 127 #define MIN_READAHEAD 3 #define blkdev_entry_to_request(entry) list_entry((entry), struct request, queue) diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 5e8c520f42bf..d5e7e9acf99c 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -118,7 +118,7 @@ struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(1), func, data } enum { TASKLET_STATE_SCHED, /* Tasklet is scheduled for execution */ - TASKLET_STATE_RUN /* Tasklet is running */ + TASKLET_STATE_RUN /* Tasklet is running (SMP only) */ }; struct tasklet_head @@ -129,34 +129,68 @@ struct tasklet_head extern struct tasklet_head tasklet_vec[NR_CPUS]; extern struct tasklet_head tasklet_hi_vec[NR_CPUS]; -#define tasklet_trylock(t) (!test_and_set_bit(TASKLET_STATE_RUN, &(t)->state)) -#define tasklet_unlock(t) do { smp_mb__before_clear_bit(); clear_bit(TASKLET_STATE_RUN, &(t)->state); } while(0) -#define tasklet_unlock_wait(t) while (test_bit(TASKLET_STATE_RUN, &(t)->state)) { barrier(); } +#ifdef CONFIG_SMP +static inline int tasklet_trylock(struct tasklet_struct *t) +{ + return !test_and_set_bit(TASKLET_STATE_RUN, &(t)->state); +} + +static inline void tasklet_unlock(struct tasklet_struct *t) +{ + smp_mb__before_clear_bit(); + clear_bit(TASKLET_STATE_RUN, &(t)->state); +} + +static inline void tasklet_unlock_wait(struct tasklet_struct *t) +{ + while (test_bit(TASKLET_STATE_RUN, &(t)->state)) { barrier(); } +} +#else +#define tasklet_trylock(t) 1 +#define tasklet_unlock_wait(t) do { } while (0) +#define tasklet_unlock(t) do { } while (0) +#endif + +extern void FASTCALL(__tasklet_schedule(struct tasklet_struct *t)); + +static inline void tasklet_schedule(struct tasklet_struct *t) +{ + if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) + __tasklet_schedule(t); +} + +extern void FASTCALL(__tasklet_hi_schedule(struct tasklet_struct *t)); + +static inline void tasklet_hi_schedule(struct tasklet_struct *t) +{ + if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) + __tasklet_hi_schedule(t); +} -extern void tasklet_schedule(struct tasklet_struct *t); -extern void tasklet_hi_schedule(struct tasklet_struct *t); static inline void tasklet_disable_nosync(struct tasklet_struct *t) { atomic_inc(&t->count); + smp_mb__after_atomic_inc(); } static inline void tasklet_disable(struct tasklet_struct *t) { tasklet_disable_nosync(t); tasklet_unlock_wait(t); + smp_mb(); } static inline void tasklet_enable(struct tasklet_struct *t) { - if (atomic_dec_and_test(&t->count)) - tasklet_schedule(t); + smp_mb__before_atomic_dec(); + atomic_dec(&t->count); } static inline void tasklet_hi_enable(struct tasklet_struct *t) { - if (atomic_dec_and_test(&t->count)) - tasklet_hi_schedule(t); + smp_mb__before_atomic_dec(); + atomic_dec(&t->count); } extern void tasklet_kill(struct tasklet_struct *t); diff --git a/include/linux/mii.h b/include/linux/mii.h index be785d31c96f..943913583dea 100644 --- a/include/linux/mii.h +++ b/include/linux/mii.h @@ -2,7 +2,7 @@ * linux/mii.h: definitions for MII-compatible transceivers * Originally drivers/net/sunhme.h. * - * Copyright (C) 1996, 1999 David S. Miller (davem@redhat.com) + * Copyright (C) 1996, 1999, 2001 David S. Miller (davem@redhat.com) */ #ifndef __LINUX_MII_H__ @@ -10,19 +10,8 @@ #include <linux/types.h> -/* Inside the Happy Meal transceiver is the physical layer, they use an - * implementations for National Semiconductor, part number DP83840VCE. - * You can retrieve the data sheets and programming docs for this beast - * from http://www.national.com/ - * - * The DP83840 is capable of both 10 and 100Mbps ethernet, in both - * half and full duplex mode. It also supports auto negotiation. - * - * But.... THIS THING IS A PAIN IN THE ASS TO PROGRAM! - * Debugging eeprom burnt code is more fun than programming this chip! - */ +/* Generic MII registers. */ -/* First, the MII register numbers (actually DP83840 register numbers). */ #define MII_BMCR 0x00 /* Basic mode control register */ #define MII_BMSR 0x01 /* Basic mode status register */ #define MII_PHYSID1 0x02 /* PHYS ID 1 */ @@ -35,10 +24,10 @@ #define MII_NWAYTEST 0x14 /* N-way auto-neg test reg */ #define MII_RERRCOUNTER 0x15 /* Receive error counter */ #define MII_SREVISION 0x16 /* Silicon revision */ -#define MII_CSCONFIG 0x17 /* CS configuration */ +#define MII_RESV1 0x17 /* Reserved... */ #define MII_LBRERROR 0x18 /* Lpback, rx, bypass error */ #define MII_PHYADDR 0x19 /* PHY address */ -#define MII_RESERVED 0x1a /* Unused... */ +#define MII_RESV2 0x1a /* Reserved... */ #define MII_TPISTATUS 0x1b /* TPI status for 10mbps */ #define MII_NCONFIG 0x1c /* Network interface config */ @@ -112,23 +101,6 @@ #define NWAYTEST_LOOPBACK 0x0100 /* Enable loopback for N-way */ #define NWAYTEST_RESV2 0xfe00 /* Unused... */ -/* The Carrier Sense config register. */ -#define CSCONFIG_RESV1 0x0001 /* Unused... */ -#define CSCONFIG_LED4 0x0002 /* Pin for full-dplx LED4 */ -#define CSCONFIG_LED1 0x0004 /* Pin for conn-status LED1 */ -#define CSCONFIG_RESV2 0x0008 /* Unused... */ -#define CSCONFIG_TCVDISAB 0x0010 /* Turns off the transceiver */ -#define CSCONFIG_DFBYPASS 0x0020 /* Bypass disconnect function */ -#define CSCONFIG_GLFORCE 0x0040 /* Good link force for 100mbps */ -#define CSCONFIG_CLKTRISTATE 0x0080 /* Tristate 25m clock */ -#define CSCONFIG_RESV3 0x0700 /* Unused... */ -#define CSCONFIG_ENCODE 0x0800 /* 1=MLT-3, 0=binary */ -#define CSCONFIG_RENABLE 0x1000 /* Repeater mode enable */ -#define CSCONFIG_TCDISABLE 0x2000 /* Disable timeout counter */ -#define CSCONFIG_RESV4 0x4000 /* Unused... */ -#define CSCONFIG_NDISABLE 0x8000 /* Disable NRZI */ - - /* This structure is used in all SIOCxMIIxxx ioctl calls */ struct mii_ioctl_data { u16 phy_id; diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 090f05fe7951..a00adf046d50 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -298,7 +298,6 @@ struct net_device /* Interface address info. */ unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ - unsigned char pad; /* make dev_addr aligned to 8 bytes */ unsigned char dev_addr[MAX_ADDR_LEN]; /* hw address */ unsigned char addr_len; /* hardware address length */ diff --git a/include/linux/parport_pc.h b/include/linux/parport_pc.h index fb48227816b9..9e2f6468c63c 100644 --- a/include/linux/parport_pc.h +++ b/include/linux/parport_pc.h @@ -41,7 +41,7 @@ struct parport_pc_private { struct pci_dev *dev; }; -static __inline__ void parport_pc_write_data(struct parport *p, unsigned char d) +extern __inline__ void parport_pc_write_data(struct parport *p, unsigned char d) { #ifdef DEBUG_PARPORT printk (KERN_DEBUG "parport_pc_write_data(%p,0x%02x)\n", p, d); @@ -49,7 +49,7 @@ static __inline__ void parport_pc_write_data(struct parport *p, unsigned char d) outb(d, DATA(p)); } -static __inline__ unsigned char parport_pc_read_data(struct parport *p) +extern __inline__ unsigned char parport_pc_read_data(struct parport *p) { unsigned char val = inb (DATA (p)); #ifdef DEBUG_PARPORT @@ -60,7 +60,7 @@ static __inline__ unsigned char parport_pc_read_data(struct parport *p) } #ifdef DEBUG_PARPORT -static __inline__ void dump_parport_state (char *str, struct parport *p) +extern __inline__ void dump_parport_state (char *str, struct parport *p) { /* here's hoping that reading these ports won't side-effect anything underneath */ unsigned char ecr = inb (ECONTROL (p)); @@ -124,17 +124,17 @@ static __inline__ unsigned char __parport_pc_frob_control (struct parport *p, return ctr; } -static __inline__ void parport_pc_data_reverse (struct parport *p) +extern __inline__ void parport_pc_data_reverse (struct parport *p) { __parport_pc_frob_control (p, 0x20, 0x20); } -static __inline__ void parport_pc_data_forward (struct parport *p) +extern __inline__ void parport_pc_data_forward (struct parport *p) { __parport_pc_frob_control (p, 0x20, 0x00); } -static __inline__ void parport_pc_write_control (struct parport *p, +extern __inline__ void parport_pc_write_control (struct parport *p, unsigned char d) { const unsigned char wm = (PARPORT_CONTROL_STROBE | @@ -152,7 +152,7 @@ static __inline__ void parport_pc_write_control (struct parport *p, __parport_pc_frob_control (p, wm, d & wm); } -static __inline__ unsigned char parport_pc_read_control(struct parport *p) +extern __inline__ unsigned char parport_pc_read_control(struct parport *p) { const unsigned char rm = (PARPORT_CONTROL_STROBE | PARPORT_CONTROL_AUTOFD | @@ -162,7 +162,7 @@ static __inline__ unsigned char parport_pc_read_control(struct parport *p) return priv->ctr & rm; /* Use soft copy */ } -static __inline__ unsigned char parport_pc_frob_control (struct parport *p, +extern __inline__ unsigned char parport_pc_frob_control (struct parport *p, unsigned char mask, unsigned char val) { @@ -189,18 +189,18 @@ static __inline__ unsigned char parport_pc_frob_control (struct parport *p, return __parport_pc_frob_control (p, mask, val); } -static __inline__ unsigned char parport_pc_read_status(struct parport *p) +extern __inline__ unsigned char parport_pc_read_status(struct parport *p) { return inb(STATUS(p)); } -static __inline__ void parport_pc_disable_irq(struct parport *p) +extern __inline__ void parport_pc_disable_irq(struct parport *p) { __parport_pc_frob_control (p, 0x10, 0x00); } -static __inline__ void parport_pc_enable_irq(struct parport *p) +extern __inline__ void parport_pc_enable_irq(struct parport *p) { __parport_pc_frob_control (p, 0x10, 0x10); } |
