diff options
| author | Linus Torvalds <torvalds@home.transmeta.com> | 2002-09-08 18:41:49 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-09-08 18:41:49 -0700 |
| commit | d4cddb795d19f1ed3bdaa216f8be4e8b1034843c (patch) | |
| tree | decaab32244e646d049e4663789505fbaad2b8ba /include | |
| parent | f9506f4d7e4d06ca6f7006d8156ef6ba08ff1f1d (diff) | |
| parent | b32c3a0cc6c27e43c1b6dbbc840bbd569c5f84cc (diff) | |
Merge bk://thebsh.namesys.com/bk/reiser3-linux-2.5
into home.transmeta.com:/home/torvalds/v2.5/linux
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-alpha/core_t2.h | 40 | ||||
| -rw-r--r-- | include/asm-alpha/dma.h | 47 | ||||
| -rw-r--r-- | include/asm-alpha/floppy.h | 23 | ||||
| -rw-r--r-- | include/asm-alpha/ide.h | 11 | ||||
| -rw-r--r-- | include/asm-alpha/kmap_types.h | 31 | ||||
| -rw-r--r-- | include/asm-alpha/user.h | 1 | ||||
| -rw-r--r-- | include/asm-i386/highmem.h | 6 | ||||
| -rw-r--r-- | include/asm-i386/spinlock.h | 2 | ||||
| -rw-r--r-- | include/asm-i386/tlbflush.h | 18 | ||||
| -rw-r--r-- | include/asm-ppc/hardirq.h | 2 | ||||
| -rw-r--r-- | include/asm-ppc/highmem.h | 6 | ||||
| -rw-r--r-- | include/asm-sparc/hardirq.h | 6 | ||||
| -rw-r--r-- | include/asm-sparc/highmem.h | 6 | ||||
| -rw-r--r-- | include/linux/blkdev.h | 3 | ||||
| -rw-r--r-- | include/linux/genhd.h | 33 | ||||
| -rw-r--r-- | include/linux/highmem.h | 4 | ||||
| -rw-r--r-- | include/linux/ide.h | 3 | ||||
| -rw-r--r-- | include/linux/init_task.h | 5 | ||||
| -rw-r--r-- | include/linux/pci.h | 10 | ||||
| -rw-r--r-- | include/linux/preempt.h | 10 | ||||
| -rw-r--r-- | include/linux/raid/md.h | 1 | ||||
| -rw-r--r-- | include/linux/sched.h | 53 |
22 files changed, 207 insertions, 114 deletions
diff --git a/include/asm-alpha/core_t2.h b/include/asm-alpha/core_t2.h index 007cf43baf10..fdaa57aa2c14 100644 --- a/include/asm-alpha/core_t2.h +++ b/include/asm-alpha/core_t2.h @@ -19,7 +19,7 @@ * */ -#define T2_MEM_R1_MASK 0x03ffffff /* Mem sparse region 1 mask is 26 bits */ +#define T2_MEM_R1_MASK 0x07ffffff /* Mem sparse region 1 mask is 26 bits */ /* GAMMA-SABLE is a SABLE with EV5-based CPUs */ #define _GAMMA_BIAS 0x8000000000UL @@ -402,13 +402,17 @@ __EXTERN_INLINE void t2_outl(u32 b, unsigned long addr) * */ +#define t2_set_hae { \ + msb = addr >> 27; \ + addr &= T2_MEM_R1_MASK; \ + set_hae(msb); \ +} + __EXTERN_INLINE u8 t2_readb(unsigned long addr) { unsigned long result, msb; - msb = addr & 0xE0000000; - addr &= T2_MEM_R1_MASK; - set_hae(msb); + t2_set_hae; result = *(vip) ((addr << 5) + T2_SPARSE_MEM + 0x00); return __kernel_extbl(result, addr & 3); @@ -418,9 +422,7 @@ __EXTERN_INLINE u16 t2_readw(unsigned long addr) { unsigned long result, msb; - msb = addr & 0xE0000000; - addr &= T2_MEM_R1_MASK; - set_hae(msb); + t2_set_hae; result = *(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x08); return __kernel_extwl(result, addr & 3); @@ -431,9 +433,7 @@ __EXTERN_INLINE u32 t2_readl(unsigned long addr) { unsigned long msb; - msb = addr & 0xE0000000; - addr &= T2_MEM_R1_MASK; - set_hae(msb); + t2_set_hae; return *(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x18); } @@ -442,9 +442,7 @@ __EXTERN_INLINE u64 t2_readq(unsigned long addr) { unsigned long r0, r1, work, msb; - msb = addr & 0xE0000000; - addr &= T2_MEM_R1_MASK; - set_hae(msb); + t2_set_hae; work = (addr << 5) + T2_SPARSE_MEM + 0x18; r0 = *(vuip)(work); @@ -456,9 +454,7 @@ __EXTERN_INLINE void t2_writeb(u8 b, unsigned long addr) { unsigned long msb, w; - msb = addr & 0xE0000000; - addr &= T2_MEM_R1_MASK; - set_hae(msb); + t2_set_hae; w = __kernel_insbl(b, addr & 3); *(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x00) = w; @@ -468,9 +464,7 @@ __EXTERN_INLINE void t2_writew(u16 b, unsigned long addr) { unsigned long msb, w; - msb = addr & 0xE0000000; - addr &= T2_MEM_R1_MASK; - set_hae(msb); + t2_set_hae; w = __kernel_inswl(b, addr & 3); *(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x08) = w; @@ -481,9 +475,7 @@ __EXTERN_INLINE void t2_writel(u32 b, unsigned long addr) { unsigned long msb; - msb = addr & 0xE0000000; - addr &= T2_MEM_R1_MASK; - set_hae(msb); + t2_set_hae; *(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x18) = b; } @@ -492,9 +484,7 @@ __EXTERN_INLINE void t2_writeq(u64 b, unsigned long addr) { unsigned long msb, work; - msb = addr & 0xE0000000; - addr &= T2_MEM_R1_MASK; - set_hae(msb); + t2_set_hae; work = (addr << 5) + T2_SPARSE_MEM + 0x18; *(vuip)work = b; diff --git a/include/asm-alpha/dma.h b/include/asm-alpha/dma.h index e6d667144b50..97daf7d786aa 100644 --- a/include/asm-alpha/dma.h +++ b/include/asm-alpha/dma.h @@ -75,34 +75,49 @@ #define MAX_DMA_CHANNELS 8 -/* The maximum address that we can perform a DMA transfer to on Alpha XL, - due to a hardware SIO (PCI<->ISA bus bridge) chip limitation, is 64MB. - See <asm/apecs.h> for more info. +/* + ISA DMA limitations on Alpha platforms, + + These may be due to SIO (PCI<->ISA bridge) chipset limitation, or + just a wiring limit. */ -/* The maximum address that we can perform a DMA transfer to on RUFFIAN, - due to a hardware SIO (PCI<->ISA bus bridge) chip limitation, is 16MB. - See <asm/pyxis.h> for more info. + +/* The maximum address for ISA DMA transfer on Alpha XL, due to an + hardware SIO limitation, is 64MB. +*/ +#define ALPHA_XL_MAX_DMA_ADDRESS (IDENT_ADDR+0x04000000UL) + +/* The maximum address for ISA DMA transfer on RUFFIAN and NAUTILUS, + due to an hardware SIO limitation, is 16MB. */ -/* NOTE: we must define the maximum as something less than 64Mb, to prevent - virt_to_bus() from returning an address in the first window, for a - data area that goes beyond the 64Mb first DMA window. Sigh... - We MUST coordinate the maximum with <asm/apecs.h> for consistency. - For now, this limit is set to 48Mb... +#define ALPHA_RUFFIAN_MAX_DMA_ADDRESS (IDENT_ADDR+0x01000000UL) +#define ALPHA_NAUTILUS_MAX_DMA_ADDRESS (IDENT_ADDR+0x01000000UL) + +/* The maximum address for ISA DMA transfer on SABLE, and some ALCORs, + due to an hardware SIO chip limitation, is 2GB. +*/ +#define ALPHA_SABLE_MAX_DMA_ADDRESS (IDENT_ADDR+0x80000000UL) +#define ALPHA_ALCOR_MAX_DMA_ADDRESS (IDENT_ADDR+0x80000000UL) + +/* + Maximum address for all the others is the complete 32-bit bus + address space. */ -#define ALPHA_XL_MAX_DMA_ADDRESS (IDENT_ADDR+0x3000000UL) -#define ALPHA_RUFFIAN_MAX_DMA_ADDRESS (IDENT_ADDR+0x1000000UL) -#define ALPHA_NAUTILUS_MAX_DMA_ADDRESS (IDENT_ADDR+0x1000000UL) -#define ALPHA_MAX_DMA_ADDRESS (~0UL) +#define ALPHA_MAX_DMA_ADDRESS (IDENT_ADDR+0x100000000UL) #ifdef CONFIG_ALPHA_GENERIC # define MAX_DMA_ADDRESS (alpha_mv.max_dma_address) #else -# ifdef CONFIG_ALPHA_XL +# if defined(CONFIG_ALPHA_XL) # define MAX_DMA_ADDRESS ALPHA_XL_MAX_DMA_ADDRESS # elif defined(CONFIG_ALPHA_RUFFIAN) # define MAX_DMA_ADDRESS ALPHA_RUFFIAN_MAX_DMA_ADDRESS # elif defined(CONFIG_ALPHA_NAUTILUS) # define MAX_DMA_ADDRESS ALPHA_NAUTILUS_MAX_DMA_ADDRESS +# elif defined(CONFIG_ALPHA_SABLE) +# define MAX_DMA_ADDRESS ALPHA_SABLE_MAX_DMA_ADDRESS +# elif defined(CONFIG_ALPHA_ALCOR) +# define MAX_DMA_ADDRESS ALPHA_ALCOR_MAX_DMA_ADDRESS # else # define MAX_DMA_ADDRESS ALPHA_MAX_DMA_ADDRESS # endif diff --git a/include/asm-alpha/floppy.h b/include/asm-alpha/floppy.h index 58d053db1a7f..88049a927ddd 100644 --- a/include/asm-alpha/floppy.h +++ b/include/asm-alpha/floppy.h @@ -97,25 +97,22 @@ static int FDC2 = -1; /* * Most Alphas have no problems with floppy DMA crossing 64k borders, - * except for XL and RUFFIAN. They are also the only one with DMA - * limits, so we use that to test in the generic kernel. + * except for certain ones, like XL and RUFFIAN. + * + * However, the test is simple and fast, and this *is* floppy, after all, + * so we do it for all platforms, just to make sure. + * + * This is advantageous in other circumstances as well, as in moving + * about the PCI DMA windows and forcing the floppy to start doing + * scatter-gather when it never had before, and there *is* a problem + * on that platform... ;-} */ -#define __CROSS_64KB(a,s) \ +#define CROSS_64KB(a,s) \ ({ unsigned long __s64 = (unsigned long)(a); \ unsigned long __e64 = __s64 + (unsigned long)(s) - 1; \ (__s64 ^ __e64) & ~0xfffful; }) -#ifdef CONFIG_ALPHA_GENERIC -# define CROSS_64KB(a,s) (__CROSS_64KB(a,s) && ~alpha_mv.max_dma_address) -#else -# if defined(CONFIG_ALPHA_XL) || defined(CONFIG_ALPHA_RUFFIAN) || defined(CONFIG_ALPHA_NAUTILUS) -# define CROSS_64KB(a,s) __CROSS_64KB(a,s) -# else -# define CROSS_64KB(a,s) (0) -# endif -#endif - #define EXTRA_FLOPPY_PARAMS #endif /* __ASM_ALPHA_FLOPPY_H */ diff --git a/include/asm-alpha/ide.h b/include/asm-alpha/ide.h index 63bb9f785498..0ca863142cf5 100644 --- a/include/asm-alpha/ide.h +++ b/include/asm-alpha/ide.h @@ -80,6 +80,17 @@ static __inline__ void ide_init_default_hwifs(void) #endif } +#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)) + +#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__ */ #endif /* __ASMalpha_IDE_H */ diff --git a/include/asm-alpha/kmap_types.h b/include/asm-alpha/kmap_types.h new file mode 100644 index 000000000000..3e755b973e65 --- /dev/null +++ b/include/asm-alpha/kmap_types.h @@ -0,0 +1,31 @@ +#ifndef _ASM_KMAP_TYPES_H +#define _ASM_KMAP_TYPES_H + +/* Dummy header just to define km_type. */ + +#include <linux/config.h> + +#if CONFIG_DEBUG_HIGHMEM +# define D(n) __KM_FENCE_##n , +#else +# define D(n) +#endif + +enum km_type { +D(0) KM_BOUNCE_READ, +D(1) KM_SKB_SUNRPC_DATA, +D(2) KM_SKB_DATA_SOFTIRQ, +D(3) KM_USER0, +D(4) KM_USER1, +D(5) KM_BIO_SRC_IRQ, +D(6) KM_BIO_DST_IRQ, +D(7) KM_PTE0, +D(8) KM_PTE1, +D(9) KM_IRQ0, +D(10) KM_IRQ1, +D(11) KM_TYPE_NR +}; + +#undef D + +#endif diff --git a/include/asm-alpha/user.h b/include/asm-alpha/user.h index c5519bf162d7..7e417fc9d491 100644 --- a/include/asm-alpha/user.h +++ b/include/asm-alpha/user.h @@ -1,6 +1,7 @@ #ifndef _ALPHA_USER_H #define _ALPHA_USER_H +#include <linux/sched.h> #include <linux/ptrace.h> #include <asm/page.h> diff --git a/include/asm-i386/highmem.h b/include/asm-i386/highmem.h index 1cba7fc45882..0316b53f868f 100644 --- a/include/asm-i386/highmem.h +++ b/include/asm-i386/highmem.h @@ -81,7 +81,7 @@ static inline void *kmap_atomic(struct page *page, enum km_type type) enum fixed_addresses idx; unsigned long vaddr; - preempt_disable(); + inc_preempt_count(); if (page < highmem_start_page) return page_address(page); @@ -104,7 +104,7 @@ static inline void kunmap_atomic(void *kvaddr, enum km_type type) enum fixed_addresses idx = type + KM_TYPE_NR*smp_processor_id(); if (vaddr < FIXADDR_START) { // FIXME - preempt_enable(); + dec_preempt_count(); return; } @@ -119,7 +119,7 @@ static inline void kunmap_atomic(void *kvaddr, enum km_type type) __flush_tlb_one(vaddr); #endif - preempt_enable(); + dec_preempt_count(); } #endif /* __KERNEL__ */ diff --git a/include/asm-i386/spinlock.h b/include/asm-i386/spinlock.h index d565c78c2d81..d26bf652d894 100644 --- a/include/asm-i386/spinlock.h +++ b/include/asm-i386/spinlock.h @@ -158,6 +158,8 @@ typedef struct { #define rwlock_init(x) do { *(x) = RW_LOCK_UNLOCKED; } while(0) +#define rwlock_is_locked(x) ((x)->lock != RW_LOCK_BIAS) + /* * On x86, we implement read-write locks as a 32-bit counter * with the high bit (sign) being the "contended" bit. diff --git a/include/asm-i386/tlbflush.h b/include/asm-i386/tlbflush.h index c0c0388c9387..8b2e98c1425e 100644 --- a/include/asm-i386/tlbflush.h +++ b/include/asm-i386/tlbflush.h @@ -45,11 +45,21 @@ extern unsigned long pgkern_mask; __flush_tlb(); \ } while (0) -#ifndef CONFIG_X86_INVLPG -#define __flush_tlb_one(addr) __flush_tlb() +#define cpu_has_invlpg (boot_cpu_data.x86 > 3) + +#define __flush_tlb_single(addr) \ + __asm__ __volatile__("invlpg %0": :"m" (*(char *) addr)) + +#ifdef CONFIG_X86_INVLPG +# define __flush_tlb_one(addr) __flush_tlb_single(addr) #else -#define __flush_tlb_one(addr) \ -__asm__ __volatile__("invlpg %0": :"m" (*(char *) addr)) +# define __flush_tlb_one(addr) \ + do { \ + if (cpu_has_invlpg) \ + __flush_tlb_single(addr); \ + else \ + __flush_tlb(); \ + } while (0) #endif /* diff --git a/include/asm-ppc/hardirq.h b/include/asm-ppc/hardirq.h index d56152a03ccc..547f2491000f 100644 --- a/include/asm-ppc/hardirq.h +++ b/include/asm-ppc/hardirq.h @@ -85,8 +85,10 @@ typedef struct { #define irq_enter() (preempt_count() += HARDIRQ_OFFSET) #if CONFIG_PREEMPT +# define in_atomic() (preempt_count() != kernel_locked()) # define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1) #else +# define in_atomic() (preempt_count() != 0) # define IRQ_EXIT_OFFSET HARDIRQ_OFFSET #endif #define irq_exit() \ diff --git a/include/asm-ppc/highmem.h b/include/asm-ppc/highmem.h index 5a630083d014..472482ca3f36 100644 --- a/include/asm-ppc/highmem.h +++ b/include/asm-ppc/highmem.h @@ -88,6 +88,7 @@ static inline void *kmap_atomic(struct page *page, enum km_type type) unsigned int idx; unsigned long vaddr; + inc_preempt_count(); if (page < highmem_start_page) return page_address(page); @@ -109,8 +110,10 @@ static inline void kunmap_atomic(void *kvaddr, enum km_type type) unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK; unsigned int idx = type + KM_TYPE_NR*smp_processor_id(); - if (vaddr < KMAP_FIX_BEGIN) // FIXME + if (vaddr < KMAP_FIX_BEGIN) { // FIXME + dec_preempt_count(); return; + } if (vaddr != KMAP_FIX_BEGIN + idx * PAGE_SIZE) BUG(); @@ -122,6 +125,7 @@ static inline void kunmap_atomic(void *kvaddr, enum km_type type) pte_clear(kmap_pte+idx); flush_tlb_page(0, vaddr); #endif + dec_preempt_count(); } #endif /* __KERNEL__ */ diff --git a/include/asm-sparc/hardirq.h b/include/asm-sparc/hardirq.h index a80212dc3a2a..f77ee7e415cf 100644 --- a/include/asm-sparc/hardirq.h +++ b/include/asm-sparc/hardirq.h @@ -113,6 +113,12 @@ do { \ #define irq_exit() br_read_unlock(BR_GLOBALIRQ_LOCK) #endif +#if CONFIG_PREEMPT +# define in_atomic() (preempt_count() != kernel_locked()) +#else +# define in_atomic() (preempt_count() != 0) +#endif + #ifndef CONFIG_SMP #define synchronize_irq() barrier() diff --git a/include/asm-sparc/highmem.h b/include/asm-sparc/highmem.h index bb2fc2331b5b..2ba438ea6111 100644 --- a/include/asm-sparc/highmem.h +++ b/include/asm-sparc/highmem.h @@ -83,6 +83,7 @@ static inline void *kmap_atomic(struct page *page, enum km_type type) unsigned long idx; unsigned long vaddr; + inc_preempt_count(); if (page < highmem_start_page) return page_address(page); @@ -116,8 +117,10 @@ static inline void kunmap_atomic(void *kvaddr, enum km_type type) unsigned long vaddr = (unsigned long) kvaddr; unsigned long idx = type + KM_TYPE_NR*smp_processor_id(); - if (vaddr < FIX_KMAP_BEGIN) // FIXME + if (vaddr < FIX_KMAP_BEGIN) { // FIXME + dec_preempt_count(); return; + } if (vaddr != FIX_KMAP_BEGIN + idx * PAGE_SIZE) BUG(); @@ -142,6 +145,7 @@ static inline void kunmap_atomic(void *kvaddr, enum km_type type) flush_tlb_all(); #endif #endif + dec_preempt_count(); } #endif /* __KERNEL__ */ diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 9f1ac6d07fe8..a11b6181c76f 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -281,10 +281,7 @@ struct sec_size { extern struct sec_size * blk_sec[MAX_BLKDEV]; extern struct blk_dev_struct blk_dev[MAX_BLKDEV]; -extern void grok_partitions(kdev_t dev, long size); -extern int wipe_partitions(kdev_t dev); extern void register_disk(struct gendisk *dev, kdev_t first, unsigned minors, struct block_device_operations *ops, long size); -extern void check_partition(struct gendisk *disk, struct block_device *bdev); extern void generic_make_request(struct bio *bio); extern inline request_queue_t *bdev_get_queue(struct block_device *bdev); extern void blk_put_request(struct request *); diff --git a/include/linux/genhd.h b/include/linux/genhd.h index fd9f5a8d7c06..ecd747fbe569 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -62,11 +62,12 @@ struct hd_struct { unsigned long start_sect; unsigned long nr_sects; devfs_handle_t de; /* primary (master) devfs entry */ - int number; /* stupid old code wastes space */ struct device hd_driverfs_dev; /* support driverfs hiearchy */ }; #define GENHD_FL_REMOVABLE 1 +#define GENHD_FL_DRIVERFS 2 +#define GENHD_FL_DEVFS 4 struct gendisk { int major; /* major number of driver */ @@ -76,24 +77,35 @@ struct gendisk { get real minor */ struct hd_struct *part; /* [indexed by minor] */ - int nr_real; /* number of real devices */ - struct gendisk *next; struct block_device_operations *fops; - - devfs_handle_t *de_arr; /* one per physical disc */ - struct device **driverfs_dev_arr;/* support driverfs hierarchy */ - char *flags; /* one per physical disc */ + sector_t capacity; + + int flags; + int number; /* devfs crap */ + devfs_handle_t de; /* more of the same */ + devfs_handle_t disk_de; /* piled higher and deeper */ + struct device *driverfs_dev; + struct device disk_dev; }; /* drivers/block/genhd.c */ extern void add_gendisk(struct gendisk *gp); extern void del_gendisk(struct gendisk *gp); +extern void unlink_gendisk(struct gendisk *gp); extern struct gendisk *get_gendisk(kdev_t dev); static inline unsigned long get_start_sect(struct block_device *bdev) { return bdev->bd_offset; } +static inline sector_t get_capacity(struct gendisk *disk) +{ + return disk->capacity; +} +static inline void set_capacity(struct gendisk *disk, sector_t size) +{ + disk->capacity = size; +} #endif /* __KERNEL__ */ @@ -242,11 +254,10 @@ struct unixware_disklabel { #ifdef __KERNEL__ -char *disk_name (struct gendisk *hd, int minor, char *buf); +char *disk_name (struct gendisk *hd, int part, char *buf); -extern void devfs_register_partitions (struct gendisk *dev, int minor, - int unregister); -extern void driverfs_remove_partitions (struct gendisk *hd, int minor); +extern int rescan_partitions(struct gendisk *disk, struct block_device *bdev); +extern void update_partition(struct gendisk *disk, int part); static inline unsigned int disk_index (kdev_t dev) { diff --git a/include/linux/highmem.h b/include/linux/highmem.h index b389a75be5d7..370177037315 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h @@ -24,8 +24,8 @@ static inline void *kmap(struct page *page) { return page_address(page); } #define kunmap(page) do { (void) (page); } while (0) -#define kmap_atomic(page,idx) kmap(page) -#define kunmap_atomic(page,idx) kunmap(page) +#define kmap_atomic(page, idx) page_address(page) +#define kunmap_atomic(addr, idx) do { } while (0) #endif /* CONFIG_HIGHMEM */ diff --git a/include/linux/ide.h b/include/linux/ide.h index 98a2db1db397..1843237adf4a 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -506,7 +506,6 @@ typedef struct ide_drive_s { unsigned int drive_data; /* for use by tuneproc/selectproc as needed */ struct hwif_s *hwif; /* actually (ide_hwif_t *) */ struct hd_driveid *id; /* drive model identification info */ - struct hd_struct *part; /* drive partition table */ char name[4]; /* drive name, such as "hda" */ struct ide_driver_s *driver; /* (ide_driver_t *) */ void *driver_data; /* extra driver data */ @@ -528,6 +527,7 @@ typedef struct ide_drive_s { unsigned int failures; /* current failure count */ unsigned int max_failures; /* maximum allowed failure count */ struct list_head list; + struct gendisk *disk; } ide_drive_t; /* @@ -714,7 +714,6 @@ typedef struct hwif_s { */ hw_regs_t hw; /* Hardware info */ ide_drive_t drives[MAX_DRIVES]; /* drive info */ - struct gendisk *gd[MAX_DRIVES];/* gendisk structure */ int addressing; /* hosts addressing */ void (*tuneproc)(ide_drive_t *, byte); /* routine to tune PIO mode for drives */ int (*speedproc)(ide_drive_t *, byte); /* routine to retune DMA modes for drives */ diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 80a57914bccc..bdf03241a009 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h @@ -29,10 +29,11 @@ .mmlist = LIST_HEAD_INIT(name.mmlist), \ } -#define INIT_SIGNALS { \ +#define INIT_SIGNALS(sig) { \ .count = ATOMIC_INIT(1), \ .action = { {{0,}}, }, \ - .siglock = SPIN_LOCK_UNLOCKED \ + .siglock = SPIN_LOCK_UNLOCKED, \ + .shared_pending = { NULL, &sig.shared_pending.head, {{0}}}, \ } /* diff --git a/include/linux/pci.h b/include/linux/pci.h index 3c76341f02bf..b82ec8e41174 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -386,6 +386,9 @@ struct pci_dev { int ro; /* ISAPnP: read only */ unsigned short regs; /* ISAPnP: supported registers */ + /* These fields are used by common fixups */ + unsigned short transparent:1; /* Transparent PCI bridge */ + int (*prepare)(struct pci_dev *dev); /* ISAPnP hooks */ int (*activate)(struct pci_dev *dev); int (*deactivate)(struct pci_dev *dev); @@ -406,6 +409,10 @@ struct pci_dev { #define PCI_ROM_RESOURCE 6 #define PCI_BRIDGE_RESOURCES 7 #define PCI_NUM_RESOURCES 11 + +#ifndef PCI_BUS_NUM_RESOURCES +#define PCI_BUS_NUM_RESOURCES 4 +#endif #define PCI_REGION_FLAG_MASK 0x0fU /* These bits of resource flags tell us the PCI region flags */ @@ -415,7 +422,8 @@ struct pci_bus { struct list_head children; /* list of child buses */ struct list_head devices; /* list of devices on this bus */ struct pci_dev *self; /* bridge device as seen by parent */ - struct resource *resource[4]; /* address space routed to this bus */ + struct resource *resource[PCI_BUS_NUM_RESOURCES]; + /* address space routed to this bus */ struct pci_ops *ops; /* configuration access functions */ void *sysdata; /* hook for sys-specific extension */ diff --git a/include/linux/preempt.h b/include/linux/preempt.h index b4ff1a7c881c..1b227b3c8ccb 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h @@ -48,9 +48,6 @@ do { \ preempt_check_resched(); \ } while (0) -#define inc_preempt_count_non_preempt() do { } while (0) -#define dec_preempt_count_non_preempt() do { } while (0) - #else #define preempt_disable() do { } while (0) @@ -58,13 +55,6 @@ do { \ #define preempt_enable() do { } while (0) #define preempt_check_resched() do { } while (0) -/* - * Sometimes we want to increment the preempt count, but we know that it's - * already incremented if the kernel is compiled for preemptibility. - */ -#define inc_preempt_count_non_preempt() inc_preempt_count() -#define dec_preempt_count_non_preempt() dec_preempt_count() - #endif #endif /* __LINUX_PREEMPT_H */ diff --git a/include/linux/raid/md.h b/include/linux/raid/md.h index a9cca6e4da8f..f95cdf658a39 100644 --- a/include/linux/raid/md.h +++ b/include/linux/raid/md.h @@ -61,7 +61,6 @@ #define MD_PATCHLEVEL_VERSION 0 extern int md_size[MAX_MD_DEVS]; -extern struct hd_struct md_hd_struct[MAX_MD_DEVS]; extern char * partition_name (kdev_t dev); extern inline char * bdev_partition_name (struct block_device *bdev) diff --git a/include/linux/sched.h b/include/linux/sched.h index 896b7f59941c..bd7073fdefaf 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -211,6 +211,11 @@ struct signal_struct { atomic_t count; struct k_sigaction action[_NSIG]; spinlock_t siglock; + + /* current thread group signal load-balancing target: */ + task_t *curr_target; + + struct sigpending shared_pending; }; /* @@ -356,7 +361,7 @@ struct task_struct { spinlock_t sigmask_lock; /* Protects signal and blocked */ struct signal_struct *sig; - sigset_t blocked; + sigset_t blocked, real_blocked, shared_unblocked; struct sigpending pending; unsigned long sas_ss_sp; @@ -431,6 +436,7 @@ extern void set_cpus_allowed(task_t *p, unsigned long new_mask); extern void set_user_nice(task_t *p, long nice); extern int task_prio(task_t *p); extern int task_nice(task_t *p); +extern int task_curr(task_t *p); extern int idle_cpu(int cpu); void yield(void); @@ -535,7 +541,7 @@ extern void proc_caches_init(void); extern void flush_signals(struct task_struct *); extern void flush_signal_handlers(struct task_struct *); extern void sig_exit(int, int, struct siginfo *); -extern int dequeue_signal(sigset_t *, siginfo_t *); +extern int dequeue_signal(struct sigpending *pending, sigset_t *mask, siginfo_t *info); extern void block_all_signals(int (*notifier)(void *priv), void *priv, sigset_t *mask); extern void unblock_all_signals(void); @@ -654,6 +660,7 @@ extern void exit_thread(void); extern void exit_mm(struct task_struct *); extern void exit_files(struct task_struct *); extern void exit_sighand(struct task_struct *); +extern void remove_thread_group(struct task_struct *tsk, struct signal_struct *sig); extern void reparent_to_init(void); extern void daemonize(void); @@ -786,8 +793,29 @@ static inline struct task_struct *younger_sibling(struct task_struct *p) #define for_each_thread(task) \ for (task = next_thread(current) ; task != current ; task = next_thread(task)) -#define next_thread(p) \ - list_entry((p)->thread_group.next, struct task_struct, thread_group) +static inline task_t *next_thread(task_t *p) +{ + if (!p->sig) + BUG(); +#if CONFIG_SMP + if (!spin_is_locked(&p->sig->siglock) && + !rwlock_is_locked(&tasklist_lock)) + BUG(); +#endif + return list_entry((p)->thread_group.next, task_t, thread_group); +} + +static inline task_t *prev_thread(task_t *p) +{ + if (!p->sig) + BUG(); +#if CONFIG_SMP + if (!spin_is_locked(&p->sig->siglock) && + !rwlock_is_locked(&tasklist_lock)) + BUG(); +#endif + return list_entry((p)->thread_group.prev, task_t, thread_group); +} #define thread_group_leader(p) (p->pid == p->tgid) @@ -903,21 +931,8 @@ static inline void cond_resched(void) This is required every time the blocked sigset_t changes. Athread cathreaders should have t->sigmask_lock. */ -static inline void recalc_sigpending_tsk(struct task_struct *t) -{ - if (has_pending_signals(&t->pending.signal, &t->blocked)) - set_tsk_thread_flag(t, TIF_SIGPENDING); - else - clear_tsk_thread_flag(t, TIF_SIGPENDING); -} - -static inline void recalc_sigpending(void) -{ - if (has_pending_signals(¤t->pending.signal, ¤t->blocked)) - set_thread_flag(TIF_SIGPENDING); - else - clear_thread_flag(TIF_SIGPENDING); -} +extern FASTCALL(void recalc_sigpending_tsk(struct task_struct *t)); +extern void recalc_sigpending(void); /* * Wrappers for p->thread_info->cpu access. No-op on UP. |
