diff options
| author | Vojtech Pavlik <vojtech@suse.cz> | 2002-10-07 14:34:15 +0200 |
|---|---|---|
| committer | Vojtech Pavlik <vojtech@suse.cz> | 2002-10-07 14:34:15 +0200 |
| commit | 22f873625ed81f66fdccd21b57e9bcf84a776eda (patch) | |
| tree | 042ff4ed16a8c3644fa3acc48500e9559f1950d9 /include/linux | |
| parent | 948ea7327101243d8cbd2a19e02806afff099c0f (diff) | |
| parent | 258ee56ad55dd9c90fefe616411d25f143541f65 (diff) | |
Merge suse.cz:/home/vojtech/bk/linus into suse.cz:/home/vojtech/bk/input
Diffstat (limited to 'include/linux')
55 files changed, 432 insertions, 336 deletions
diff --git a/include/linux/amifd.h b/include/linux/amifd.h index eac36f77fa8f..346993268b45 100644 --- a/include/linux/amifd.h +++ b/include/linux/amifd.h @@ -55,7 +55,7 @@ struct amiga_floppy_struct { int busy; /* true when drive is active */ int dirty; /* true when trackbuf is not on disk */ int status; /* current error code for unit */ - struct gendisk disk; + struct gendisk *gendisk; }; #endif diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index ee1171a3ae67..a93abb3df305 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -4,7 +4,6 @@ #include <linux/major.h> #include <linux/sched.h> #include <linux/genhd.h> -#include <linux/tqueue.h> #include <linux/list.h> #include <linux/pagemap.h> #include <linux/backing-dev.h> @@ -401,4 +400,8 @@ static inline void put_dev_sector(Sector p) page_cache_release(p.v); } +extern atomic_t nr_iowait_tasks; +void io_schedule(void); +void io_schedule_timeout(long timeout); + #endif diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index dd8f1bfb150e..71732e1216fc 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -140,7 +140,6 @@ void end_buffer_io_sync(struct buffer_head *bh, int uptodate); void buffer_insert_list(spinlock_t *lock, struct buffer_head *, struct list_head *); void mark_buffer_dirty_inode(struct buffer_head *bh, struct inode *inode); -int write_mapping_buffers(struct address_space *mapping); int inode_has_buffers(struct inode *); void invalidate_inode_buffers(struct inode *); int fsync_buffers_list(spinlock_t *lock, struct list_head *); @@ -168,6 +167,9 @@ void free_buffer_head(struct buffer_head * bh); void FASTCALL(unlock_buffer(struct buffer_head *bh)); void ll_rw_block(int, int, struct buffer_head * bh[]); int submit_bh(int, struct buffer_head *); +void write_boundary_block(struct block_device *bdev, + sector_t bblock, unsigned blocksize); + extern int buffer_heads_over_limit; /* diff --git a/include/linux/compatmac.h b/include/linux/compatmac.h index 1e28380cabb7..5ae68a6b58e7 100644 --- a/include/linux/compatmac.h +++ b/include/linux/compatmac.h @@ -102,7 +102,7 @@ static inline void *ioremap(unsigned long base, long length) #define my_iounmap(x, b) (((long)x<0x100000)?0:vfree ((void*)x)) -#define tty_flip_buffer_push(tty) queue_task(&tty->flip.tqueue, &tq_timer) +#define tty_flip_buffer_push(tty) schedule_delayed_work(&tty->flip.work, 1) #define signal_pending(current) (current->signal & ~current->blocked) #define schedule_timeout(to) do {current->timeout = jiffies + (to);schedule ();} while (0) #define time_after(t1,t2) (((long)t1-t2) > 0) diff --git a/include/linux/cyclades.h b/include/linux/cyclades.h index 0fe53b96a2e4..4d6235fb96cf 100644 --- a/include/linux/cyclades.h +++ b/include/linux/cyclades.h @@ -605,7 +605,7 @@ struct cyclades_port { struct cyclades_monitor mon; struct cyclades_idle_stats idle_stats; struct cyclades_icount icount; - struct tq_struct tqueue; + struct work_struct tqueue; wait_queue_head_t open_wait; wait_queue_head_t close_wait; wait_queue_head_t shutdown_wait; diff --git a/include/linux/elevator.h b/include/linux/elevator.h index 5c6c7db6e97e..8a54a1c5e5af 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h @@ -73,8 +73,8 @@ typedef struct blkelv_ioctl_arg_s { #define BLKELVGET _IOR(0x12,106,sizeof(blkelv_ioctl_arg_t)) #define BLKELVSET _IOW(0x12,107,sizeof(blkelv_ioctl_arg_t)) -extern int elevator_init(request_queue_t *, elevator_t *, elevator_t); -extern void elevator_exit(request_queue_t *, elevator_t *); +extern int elevator_init(request_queue_t *, elevator_t *); +extern void elevator_exit(request_queue_t *); extern inline int bio_rq_in_between(struct bio *, struct request *, struct list_head *); extern inline int elv_rq_merge_ok(struct request *, struct bio *); extern inline int elv_try_merge(struct request *, struct bio *); diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index d4550e28f37e..3f370ab642dd 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h @@ -17,6 +17,7 @@ #define _LINUX_EXT3_FS_H #include <linux/types.h> +#include <linux/ext3_fs_sb.h> /* * The second extended filesystem constants/structures diff --git a/include/linux/fs.h b/include/linux/fs.h index 56f2bab87d7f..ad6648e3fd9c 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -627,9 +627,6 @@ extern int send_sigurg(struct fown_struct *fown); #define MNT_FORCE 0x00000001 /* Attempt to forcibily umount */ #define MNT_DETACH 0x00000002 /* Just detach from the tree */ -#include <linux/ext3_fs_sb.h> -#include <linux/hpfs_fs_sb.h> - extern struct list_head super_blocks; extern spinlock_t sb_lock; @@ -670,8 +667,6 @@ struct super_block { char s_id[32]; /* Informational name */ union { - struct ext3_sb_info ext3_sb; - struct hpfs_sb_info hpfs_sb; void *generic_sbp; } u; /* @@ -1140,7 +1135,7 @@ extern int full_check_disk_change(struct block_device *); extern int __check_disk_change(dev_t); extern int invalidate_inodes(struct super_block *); extern int invalidate_device(kdev_t, int); -extern void invalidate_inode_pages(struct inode *); +extern void invalidate_inode_pages(struct address_space *mapping); extern void invalidate_inode_pages2(struct address_space *mapping); extern void write_inode_now(struct inode *, int); extern int filemap_fdatawrite(struct address_space *); diff --git a/include/linux/hayesesp.h b/include/linux/hayesesp.h index 7efc5e31dc11..00774e5d4550 100644 --- a/include/linux/hayesesp.h +++ b/include/linux/hayesesp.h @@ -102,8 +102,8 @@ struct esp_struct { int xmit_head; int xmit_tail; int xmit_cnt; - struct tq_struct tqueue; - struct tq_struct tqueue_hangup; + struct work_struct tqueue; + struct work_struct tqueue_hangup; struct termios normal_termios; struct termios callout_termios; wait_queue_head_t open_wait; diff --git a/include/linux/hpfs_fs_sb.h b/include/linux/hpfs_fs_sb.h index 068035e9a4bd..c6355adaf6f1 100644 --- a/include/linux/hpfs_fs_sb.h +++ b/include/linux/hpfs_fs_sb.h @@ -36,31 +36,4 @@ struct hpfs_sb_info { 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 -#define s_hpfs_gid u.hpfs_sb.sb_gid -#define s_hpfs_mode u.hpfs_sb.sb_mode -#define s_hpfs_n_free u.hpfs_sb.sb_n_free -#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_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/ide.h b/include/linux/ide.h index ca112e24acdb..7b8ebfe2c8dd 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -17,6 +17,7 @@ #include <linux/interrupt.h> #include <linux/bitops.h> #include <linux/bio.h> +#include <linux/device.h> #include <linux/pci.h> #include <asm/byteorder.h> #include <asm/system.h> @@ -301,24 +302,14 @@ typedef struct ide_io_ops_s { void (*OUTB)(u8 addr, u32 port); void (*OUTW)(u16 addr, u32 port); void (*OUTL)(u32 addr, u32 port); - void (*OUTBP)(u8 addr, u32 port); - void (*OUTWP)(u16 addr, u32 port); - void (*OUTLP)(u32 addr, u32 port); void (*OUTSW)(u32 port, void *addr, u32 count); - void (*OUTSWP)(u32 port, void *addr, u32 count); void (*OUTSL)(u32 port, void *addr, u32 count); - void (*OUTSLP)(u32 port, void *addr, u32 count); u8 (*INB)(u32 port); u16 (*INW)(u32 port); u32 (*INL)(u32 port); - u8 (*INBP)(u32 port); - u16 (*INWP)(u32 port); - u32 (*INLP)(u32 port); void (*INSW)(u32 port, void *addr, u32 count); - void (*INSWP)(u32 port, void *addr, u32 count); void (*INSL)(u32 port, void *addr, u32 count); - void (*INSLP)(u32 port, void *addr, u32 count); } ide_io_ops_t; /* @@ -374,41 +365,6 @@ extern int ide_irq_lock; #endif /* IDE_ARCH_LOCK */ /* - * If the arch-dependant ide.h did not declare/define any OUT_BYTE - * or IN_BYTE functions, we make some defaults here. - */ - -#ifndef HAVE_ARCH_OUT_BYTE -# ifdef REALLY_FAST_IO -# define OUT_BYTE(b,p) outb((b),(p)) -# define OUT_WORD(w,p) outw((w),(p)) -# define OUT_LONG(l,p) outl((l),(p)) -# else -# define OUT_BYTE(b,p) outb_p((b),(p)) -# define OUT_WORD(w,p) outw_p((w),(p)) -# define OUT_LONG(l,p) outl_p((l),(p)) -# endif -# define OUT_BYTE_P(b,p) outb_p((b),(p)) -# define OUT_WORD_P(w,p) outw_p((w),(p)) -# define OUT_LONG_P(l,p) outl_p((l),(p)) -#endif - -#ifndef HAVE_ARCH_IN_BYTE -# ifdef REALLY_FAST_IO -# define IN_BYTE(p) (u8) inb(p) -# define IN_WORD(p) (u16) inw(p) -# define IN_LONG(p) (u32) inl(p) -# else -# define IN_BYTE(p) (u8) inb_p(p) -# define IN_WORD(p) (u16) inw_p(p) -# define IN_LONG(p) (u32) inl_p(p) -# endif -# define IN_BYTE_P(p) (u8) inb_p(p) -# define IN_WORD_P(p) (u16) inw_p(p) -# define IN_LONG_P(p) (u32) inl_p(p) -#endif - -/* * Now for the data we need to maintain per-drive: ide_drive_t */ @@ -789,6 +745,7 @@ typedef struct ide_drive_s { unsigned autotune : 2; /* 1=autotune, 2=noautotune, 0=default */ unsigned remap_0_to_1 : 2; /* 0=remap if ezdrive, 1=remap, 2=noremap */ unsigned ata_flash : 1; /* 1=present, 0=default */ + unsigned blocked : 1; /* 1=powermanagment told us not to do anything, so sleep nicely */ unsigned addressing; /* : 3; * 0=28-bit * 1=48-bit @@ -1009,24 +966,14 @@ typedef struct hwif_s { void (*OUTB)(u8 addr, u32 port); void (*OUTW)(u16 addr, u32 port); void (*OUTL)(u32 addr, u32 port); - void (*OUTBP)(u8 addr, u32 port); - void (*OUTWP)(u16 addr, u32 port); - void (*OUTLP)(u32 addr, u32 port); void (*OUTSW)(u32 port, void *addr, u32 count); - void (*OUTSWP)(u32 port, void *addr, u32 count); void (*OUTSL)(u32 port, void *addr, u32 count); - void (*OUTSLP)(u32 port, void *addr, u32 count); u8 (*INB)(u32 port); u16 (*INW)(u32 port); u32 (*INL)(u32 port); - u8 (*INBP)(u32 port); - u16 (*INWP)(u32 port); - u32 (*INLP)(u32 port); void (*INSW)(u32 port, void *addr, u32 count); - void (*INSWP)(u32 port, void *addr, u32 count); void (*INSL)(u32 port, void *addr, u32 count); - void (*INSLP)(u32 port, void *addr, u32 count); #endif /* dma physical region descriptor table (cpu view) */ diff --git a/include/linux/if_eql.h b/include/linux/if_eql.h index 112a3df19067..b68752fdc5c4 100644 --- a/include/linux/if_eql.h +++ b/include/linux/if_eql.h @@ -19,8 +19,6 @@ #ifndef _LINUX_IF_EQL_H #define _LINUX_IF_EQL_H -#include <linux/timer.h> - #define EQL_DEFAULT_SLAVE_PRIORITY 28800 #define EQL_DEFAULT_MAX_SLAVES 4 #define EQL_DEFAULT_MTU 576 @@ -35,46 +33,51 @@ #define EQL_GETMASTRCFG (SIOCDEVPRIVATE + 4) #define EQL_SETMASTRCFG (SIOCDEVPRIVATE + 5) +#ifdef __KERNEL__ + +#include <linux/timer.h> +#include <linux/spinlock.h> + typedef struct slave { - struct net_device *dev; - long priority; - long priority_bps; - long priority_Bps; - long bytes_queued; - struct slave *next; + struct list_head list; + struct net_device *dev; + long priority; + long priority_bps; + long priority_Bps; + long bytes_queued; } slave_t; typedef struct slave_queue { - slave_t *head; - slave_t *best_slave; - int num_slaves; - struct net_device *master_dev; - char lock; + spinlock_t lock; + struct list_head all_slaves; + int num_slaves; + struct net_device *master_dev; } slave_queue_t; typedef struct equalizer { - slave_queue_t *queue; - int min_slaves; - int max_slaves; - struct net_device_stats *stats; - struct timer_list timer; - char timer_on; + slave_queue_t queue; + int min_slaves; + int max_slaves; + struct net_device_stats stats; + struct timer_list timer; } equalizer_t; +#endif /* __KERNEL__ */ + typedef struct master_config { - char master_name[16]; - int max_slaves; - int min_slaves; + char master_name[16]; + int max_slaves; + int min_slaves; } master_config_t; typedef struct slave_config { - char slave_name[16]; - long priority; + char slave_name[16]; + long priority; } slave_config_t; typedef struct slaving_request { - char slave_name[16]; - long priority; + char slave_name[16]; + long priority; } slaving_request_t; diff --git a/include/linux/if_wanpipe_common.h b/include/linux/if_wanpipe_common.h index e1c95b5d4cda..a5cab08d6990 100644 --- a/include/linux/if_wanpipe_common.h +++ b/include/linux/if_wanpipe_common.h @@ -39,7 +39,7 @@ typedef struct { int (*func) (struct sk_buff *, netdevice_t *, struct sock *); - struct tq_struct wanpipe_task; /* Immediate BH handler task */ + struct work_struct wanpipe_work; /* deferred keventd work */ unsigned char rw_bind; /* Sock bind state */ unsigned char usedby; unsigned char state; diff --git a/include/linux/isapnp.h b/include/linux/isapnp.h index 136dac530b93..4884d178909a 100644 --- a/include/linux/isapnp.h +++ b/include/linux/isapnp.h @@ -132,11 +132,11 @@ struct isapnp_resources { #define ISAPNP_CARD_DEVS 8 #define ISAPNP_CARD_ID(_va, _vb, _vc, _device) \ - card_vendor: ISAPNP_VENDOR(_va, _vb, _vc), card_device: ISAPNP_DEVICE(_device) + .card_vendor = ISAPNP_VENDOR(_va, _vb, _vc), .card_device = ISAPNP_DEVICE(_device) #define ISAPNP_CARD_END \ - card_vendor: 0, card_device: 0 + .card_vendor = 0, .card_device = 0 #define ISAPNP_DEVICE_ID(_va, _vb, _vc, _function) \ - { vendor: ISAPNP_VENDOR(_va, _vb, _vc), function: ISAPNP_FUNCTION(_function) } + { .vendor = ISAPNP_VENDOR(_va, _vb, _vc), .function = ISAPNP_FUNCTION(_function) } /* export used IDs outside module */ #define ISAPNP_CARD_TABLE(name) \ @@ -151,10 +151,10 @@ struct isapnp_card_id { }; #define ISAPNP_DEVICE_SINGLE(_cva, _cvb, _cvc, _cdevice, _dva, _dvb, _dvc, _dfunction) \ - card_vendor: ISAPNP_VENDOR(_cva, _cvb, _cvc), card_device: ISAPNP_DEVICE(_cdevice), \ - vendor: ISAPNP_VENDOR(_dva, _dvb, _dvc), function: ISAPNP_FUNCTION(_dfunction) + .card_vendor = ISAPNP_VENDOR(_cva, _cvb, _cvc), .card_device = ISAPNP_DEVICE(_cdevice), \ + .vendor = ISAPNP_VENDOR(_dva, _dvb, _dvc), .function = ISAPNP_FUNCTION(_dfunction) #define ISAPNP_DEVICE_SINGLE_END \ - card_vendor: 0, card_device: 0 + .card_vendor = 0, .card_device = 0 struct isapnp_device_id { unsigned short card_vendor, card_device; diff --git a/include/linux/isdn.h b/include/linux/isdn.h index 9bcc7e3dba80..7de3324606ee 100644 --- a/include/linux/isdn.h +++ b/include/linux/isdn.h @@ -362,7 +362,7 @@ typedef struct isdn_net_local_s { char cisco_line_state; /* state of line according to keepalive packets */ char cisco_debserint; /* debugging flag of cisco hdlc with slarp */ struct timer_list cisco_timer; - struct tq_struct tqueue; + struct work_struct tqueue; struct isdn_netif_ops *ops; } isdn_net_local; diff --git a/include/linux/isicom.h b/include/linux/isicom.h index 6b0fc14f83e5..72114196a2fc 100644 --- a/include/linux/isicom.h +++ b/include/linux/isicom.h @@ -154,8 +154,8 @@ struct isi_port { struct tty_struct * tty; wait_queue_head_t close_wait; wait_queue_head_t open_wait; - struct tq_struct hangup_tq; - struct tq_struct bh_tqueue; + struct work_struct hangup_tq; + struct work_struct bh_tqueue; unsigned char * xmit_buf; int xmit_head; int xmit_tail; diff --git a/include/linux/istallion.h b/include/linux/istallion.h index e8a2709f66fb..c93624048244 100644 --- a/include/linux/istallion.h +++ b/include/linux/istallion.h @@ -79,7 +79,7 @@ typedef struct { wait_queue_head_t close_wait; wait_queue_head_t raw_wait; #endif - struct tq_struct tqhangup; + struct work_struct tqhangup; struct termios normaltermios; struct termios callouttermios; asysigs_t asig; diff --git a/include/linux/jffs2_fs_sb.h b/include/linux/jffs2_fs_sb.h index cab82ddbddc5..611aa1b5b129 100644 --- a/include/linux/jffs2_fs_sb.h +++ b/include/linux/jffs2_fs_sb.h @@ -5,7 +5,7 @@ #include <linux/types.h> #include <linux/spinlock.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/completion.h> #include <asm/semaphore.h> #include <linux/list.h> @@ -82,7 +82,7 @@ struct jffs2_sb_info { uint32_t wbuf_ofs; uint32_t wbuf_len; uint32_t wbuf_pagesize; - struct tq_struct wbuf_task; /* task for timed wbuf flush */ + struct work_struct wbuf_task; /* task for timed wbuf flush */ struct timer_list wbuf_timer; /* timer for flushing wbuf */ /* OS-private pointer for getting back to master superblock info */ diff --git a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h index abc0c3e7bad2..8e6d600dc534 100644 --- a/include/linux/kbd_kern.h +++ b/include/linux/kbd_kern.h @@ -150,7 +150,7 @@ extern unsigned int keymap_count; static inline void con_schedule_flip(struct tty_struct *t) { - schedule_task(&t->flip.tqueue); + schedule_work(&t->flip.work); } #endif diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h index 75533ee86b73..a687f5b224e9 100644 --- a/include/linux/kernel_stat.h +++ b/include/linux/kernel_stat.h @@ -18,19 +18,14 @@ struct kernel_stat { unsigned int per_cpu_user[NR_CPUS], per_cpu_nice[NR_CPUS], - per_cpu_system[NR_CPUS]; + per_cpu_system[NR_CPUS], + per_cpu_idle[NR_CPUS], + per_cpu_iowait[NR_CPUS]; unsigned int dk_drive[DK_MAX_MAJOR][DK_MAX_DISK]; unsigned int dk_drive_rio[DK_MAX_MAJOR][DK_MAX_DISK]; unsigned int dk_drive_wio[DK_MAX_MAJOR][DK_MAX_DISK]; unsigned int dk_drive_rblk[DK_MAX_MAJOR][DK_MAX_DISK]; unsigned int dk_drive_wblk[DK_MAX_MAJOR][DK_MAX_DISK]; - unsigned int pgpgin, pgpgout; - unsigned int pswpin, pswpout; - unsigned int pgalloc, pgfree; - unsigned int pgactivate, pgdeactivate; - unsigned int pgfault, pgmajfault; - unsigned int pgscan, pgsteal; - unsigned int pageoutrun, allocstall; #if !defined(CONFIG_ARCH_S390) unsigned int irqs[NR_CPUS][NR_IRQS]; #endif diff --git a/include/linux/list.h b/include/linux/list.h index bd6f0ac3fb6b..634aab6c4c94 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -86,13 +86,12 @@ static inline void __list_del(struct list_head * prev, struct list_head * next) /** * list_del - deletes entry from list. * @entry: the element to delete from the list. - * Note: list_empty on entry does not return true after this, the entry is in an undefined state. + * Note: list_empty on entry does not return true after this, the entry is + * in an undefined state. */ static inline void list_del(struct list_head *entry) { __list_del(entry->prev, entry->next); - entry->next = (void *) 0; - entry->prev = (void *) 0; } /** diff --git a/include/linux/mm.h b/include/linux/mm.h index 4ae8eb10dcb2..a5107b5043f7 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -176,7 +176,7 @@ struct page { * Architectures with slow multiplication can define * WANT_PAGE_VIRTUAL in asm/page.h */ -#if defined(CONFIG_HIGHMEM) || defined(WANT_PAGE_VIRTUAL) +#if defined(WANT_PAGE_VIRTUAL) void *virtual; /* Kernel virtual address (NULL if not kmapped, ie. highmem) */ #endif /* CONFIG_HIGMEM || WANT_PAGE_VIRTUAL */ @@ -289,38 +289,34 @@ static inline void set_page_zone(struct page *page, unsigned long zone_num) page->flags |= zone_num << ZONE_SHIFT; } -/* - * In order to avoid #ifdefs within C code itself, we define - * set_page_address to a noop for non-highmem machines, where - * the field isn't useful. - * The same is true for page_address() in arch-dependent code. - */ -#if defined(CONFIG_HIGHMEM) || defined(WANT_PAGE_VIRTUAL) +#define lowmem_page_address(page) \ + __va( ( ((page) - page_zone(page)->zone_mem_map) \ + + page_zone(page)->zone_start_pfn) << PAGE_SHIFT) + +#if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL) +#define HASHED_PAGE_VIRTUAL +#endif +#if defined(WANT_PAGE_VIRTUAL) +#define page_address(page) ((page)->virtual) #define set_page_address(page, address) \ do { \ (page)->virtual = (address); \ } while(0) +#define page_address_init() do { } while(0) +#endif -#else /* CONFIG_HIGHMEM || WANT_PAGE_VIRTUAL */ -#define set_page_address(page, address) do { } while(0) -#endif /* CONFIG_HIGHMEM || WANT_PAGE_VIRTUAL */ - -/* - * Permanent address of a page. Obviously must never be - * called on a highmem page. - */ -#if defined(CONFIG_HIGHMEM) || defined(WANT_PAGE_VIRTUAL) - -#define page_address(page) ((page)->virtual) - -#else /* CONFIG_HIGHMEM || WANT_PAGE_VIRTUAL */ - -#define page_address(page) \ - __va( ( ((page) - page_zone(page)->zone_mem_map) \ - + page_zone(page)->zone_start_pfn) << PAGE_SHIFT) +#if defined(HASHED_PAGE_VIRTUAL) +void *page_address(struct page *page); +void set_page_address(struct page *page, void *virtual); +void page_address_init(void); +#endif -#endif /* CONFIG_HIGHMEM || WANT_PAGE_VIRTUAL */ +#if !defined(HASHED_PAGE_VIRTUAL) && !defined(WANT_PAGE_VIRTUAL) +#define page_address(page) lowmem_page_address(page) +#define set_page_address(page, address) do { } while(0) +#define page_address_init() do { } while(0) +#endif /* * Return true if this page is mapped into pagetables. Subtle: test pte.direct diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index d7d12a69f505..2b83fca9e08d 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -62,7 +62,6 @@ struct zone { spinlock_t lock; unsigned long free_pages; unsigned long pages_min, pages_low, pages_high; - int need_balance; ZONE_PADDING(_pad1_) @@ -120,7 +119,8 @@ struct zone { * rarely used fields: */ char *name; - unsigned long size; + unsigned long spanned_pages; /* total size, including holes */ + unsigned long present_pages; /* amount of memory (excluding holes) */ } ____cacheline_maxaligned_in_smp; #define ZONE_DMA 0 diff --git a/include/linux/nbd.h b/include/linux/nbd.h index 8e4b8c236e8b..b20c045dbb79 100644 --- a/include/linux/nbd.h +++ b/include/linux/nbd.h @@ -79,7 +79,7 @@ struct nbd_device { spinlock_t queue_lock; struct list_head queue_head; /* Requests are added here... */ struct semaphore tx_lock; - struct gendisk disk; + struct gendisk *disk; }; #endif diff --git a/include/linux/ncp_fs_sb.h b/include/linux/ncp_fs_sb.h index 02ef9bb50b51..9febc18c6a85 100644 --- a/include/linux/ncp_fs_sb.h +++ b/include/linux/ncp_fs_sb.h @@ -13,7 +13,7 @@ #ifdef __KERNEL__ -#include <linux/tqueue.h> +#include <linux/workqueue.h> #define NCP_DEFAULT_OPTIONS 0 /* 2 for packet signatures */ @@ -91,7 +91,7 @@ struct ncp_server { void (*error_report)(struct sock* sk); void (*write_space)(struct sock* sk); /* STREAM mode only */ struct { - struct tq_struct tq; /* STREAM/DGRAM: data/error ready */ + struct work_struct tq; /* STREAM/DGRAM: data/error ready */ struct ncp_request_reply* creq; /* STREAM/DGRAM: awaiting reply from this request */ struct semaphore creq_sem; /* DGRAM only: lock accesses to rcv.creq */ @@ -110,11 +110,11 @@ struct ncp_server { } rcv; struct { struct list_head requests; /* STREAM only: queued requests */ - struct tq_struct tq; /* STREAM only: transmitter ready */ + struct work_struct tq; /* STREAM only: transmitter ready */ struct ncp_request_reply* creq; /* STREAM only: currently transmitted entry */ } tx; struct timer_list timeout_tm; /* DGRAM only: timeout timer */ - struct tq_struct timeout_tq; /* DGRAM only: associated queue, we run timers from process context */ + struct work_struct timeout_tq; /* DGRAM only: associated queue, we run timers from process context */ int timeout_last; /* DGRAM only: current timeout length */ int timeout_retries; /* DGRAM only: retries left */ struct { diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 0e32a1b9dd5e..5c770f49787a 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -70,7 +70,8 @@ #define PG_direct 16 /* ->pte_chain points directly at pte */ /* - * Global page accounting. One instance per CPU. + * Global page accounting. One instance per CPU. Only unsigned longs are + * allowed. */ extern struct page_state { unsigned long nr_dirty; @@ -80,9 +81,32 @@ extern struct page_state { unsigned long nr_reverse_maps; unsigned long nr_mapped; unsigned long nr_slab; +#define GET_PAGE_STATE_LAST nr_slab + + /* + * The below are zeroed by get_page_state(). Use get_full_page_state() + * to add up all these. + */ + unsigned long pgpgin; + unsigned long pgpgout; + unsigned long pswpin; + unsigned long pswpout; + unsigned long pgalloc; + unsigned long pgfree; + unsigned long pgactivate; + unsigned long pgdeactivate; + unsigned long pgfault; + unsigned long pgmajfault; + unsigned long pgscan; + unsigned long pgrefill; + unsigned long pgsteal; + unsigned long kswapd_steal; + unsigned long pageoutrun; + unsigned long allocstall; } ____cacheline_aligned_in_smp page_states[NR_CPUS]; extern void get_page_state(struct page_state *ret); +extern void get_full_page_state(struct page_state *ret); #define mod_page_state(member, delta) \ do { \ diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index bfc986131fe6..1fe640eaf601 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -41,6 +41,9 @@ extern struct page * find_trylock_page(struct address_space *mapping, unsigned long index); extern struct page * find_or_create_page(struct address_space *mapping, unsigned long index, unsigned int gfp_mask); +extern unsigned int find_get_pages(struct address_space *mapping, + pgoff_t start, unsigned int nr_pages, + struct page **pages); /* * Returns locked page at given index in given cache, creating it if needed. diff --git a/include/linux/pagevec.h b/include/linux/pagevec.h index 278689b2fb2a..0207270b0fe7 100644 --- a/include/linux/pagevec.h +++ b/include/linux/pagevec.h @@ -8,6 +8,7 @@ #define PAGEVEC_SIZE 16 struct page; +struct address_space; struct pagevec { unsigned nr; @@ -21,6 +22,8 @@ void __pagevec_lru_add(struct pagevec *pvec); void lru_add_drain(void); void pagevec_deactivate_inactive(struct pagevec *pvec); void pagevec_strip(struct pagevec *pvec); +unsigned int pagevec_lookup(struct pagevec *pvec, struct address_space *mapping, + pgoff_t start, unsigned int nr_pages); static inline void pagevec_init(struct pagevec *pvec) { diff --git a/include/linux/pci.h b/include/linux/pci.h index ba2e997304fd..9c12d53f9dc7 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -322,15 +322,6 @@ enum pci_mmap_state { #define PCI_ANY_ID (~0) -#define pci_present pcibios_present - - -#define pci_for_each_dev_reverse(dev) \ - for(dev = pci_dev_g(pci_devices.prev); dev != pci_dev_g(&pci_devices); dev = pci_dev_g(dev->global_list.prev)) - -#define pci_for_each_bus(bus) \ -for(bus = pci_bus_b(pci_root_buses.next); bus != pci_bus_b(&pci_root_buses); bus = pci_bus_b(bus->node.next)) - /* * The pci_dev structure is used to describe both PCI and ISAPnP devices. */ @@ -503,8 +494,17 @@ struct pci_driver { /* these external functions are only available when PCI support is enabled */ #ifdef CONFIG_PCI +static inline int pci_present(void) +{ + return !list_empty(&pci_devices); +} + #define pci_for_each_dev(dev) \ for(dev = pci_dev_g(pci_devices.next); dev != pci_dev_g(&pci_devices); dev = pci_dev_g(dev->global_list.next)) +#define pci_for_each_dev_reverse(dev) \ + for(dev = pci_dev_g(pci_devices.prev); dev != pci_dev_g(&pci_devices); dev = pci_dev_g(dev->global_list.prev)) +#define pci_for_each_bus(bus) \ + for(bus = pci_bus_b(pci_root_buses.next); bus != pci_bus_b(&pci_root_buses); bus = pci_bus_b(bus->node.next)) void pcibios_fixup_bus(struct pci_bus *); int pcibios_enable_device(struct pci_dev *, int mask); @@ -520,7 +520,6 @@ void pcibios_fixup_pbus_ranges(struct pci_bus *, struct pbus_set_ranges_data *); /* Backward compatibility, don't use in new code! */ -int pcibios_present(void); int pcibios_read_config_byte (unsigned char bus, unsigned char dev_fn, unsigned char where, unsigned char *val); int pcibios_read_config_word (unsigned char bus, unsigned char dev_fn, @@ -533,10 +532,6 @@ int pcibios_write_config_word (unsigned char bus, unsigned char dev_fn, unsigned char where, unsigned short val); int pcibios_write_config_dword (unsigned char bus, unsigned char dev_fn, unsigned char where, unsigned int val); -int pcibios_find_class (unsigned int class_code, unsigned short index, unsigned char *bus, unsigned char *dev_fn); -int pcibios_find_device (unsigned short vendor, unsigned short dev_id, - unsigned short index, unsigned char *bus, - unsigned char *dev_fn); /* Generic PCI functions used internally */ @@ -660,9 +655,7 @@ void pci_pool_free (struct pci_pool *pool, void *vaddr, dma_addr_t addr); */ #ifndef CONFIG_PCI -static inline int pcibios_present(void) { return 0; } -static inline int pcibios_find_class (unsigned int class_code, unsigned short index, unsigned char *bus, unsigned char *dev_fn) -{ return PCIBIOS_DEVICE_NOT_FOUND; } +static inline int pci_present(void) { return 0; } #define _PCI_NOP(o,s,t) \ static inline int pcibios_##o##_config_##s (u8 bus, u8 dfn, u8 where, t val) \ diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index be4d21956fc5..a652bbf6682d 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -288,6 +288,12 @@ #define PCI_DEVICE_ID_NS_87560_USB 0x0012 #define PCI_DEVICE_ID_NS_83815 0x0020 #define PCI_DEVICE_ID_NS_83820 0x0022 +#define PCI_DEVICE_ID_NS_SCx200_BRIDGE 0x0500 +#define PCI_DEVICE_ID_NS_SCx200_SMI 0x0501 +#define PCI_DEVICE_ID_NS_SCx200_IDE 0x0502 +#define PCI_DEVICE_ID_NS_SCx200_AUDIO 0x0503 +#define PCI_DEVICE_ID_NS_SCx200_VIDEO 0x0504 +#define PCI_DEVICE_ID_NS_SCx200_XBUS 0x0505 #define PCI_DEVICE_ID_NS_87410 0xd001 #define PCI_VENDOR_ID_TSENG 0x100c diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h index d6a7928a2866..407c0e0b3e84 100644 --- a/include/linux/pipe_fs_i.h +++ b/include/linux/pipe_fs_i.h @@ -9,7 +9,6 @@ struct pipe_inode_info { unsigned int start; unsigned int readers; unsigned int writers; - unsigned int waiting_readers; unsigned int waiting_writers; unsigned int r_counter; unsigned int w_counter; @@ -28,7 +27,6 @@ struct pipe_inode_info { #define PIPE_LEN(inode) ((inode).i_pipe->len) #define PIPE_READERS(inode) ((inode).i_pipe->readers) #define PIPE_WRITERS(inode) ((inode).i_pipe->writers) -#define PIPE_WAITING_READERS(inode) ((inode).i_pipe->waiting_readers) #define PIPE_WAITING_WRITERS(inode) ((inode).i_pipe->waiting_writers) #define PIPE_RCOUNTER(inode) ((inode).i_pipe->r_counter) #define PIPE_WCOUNTER(inode) ((inode).i_pipe->w_counter) diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h index fb2e3f3350d3..56d1c668ff2e 100644 --- a/include/linux/radix-tree.h +++ b/include/linux/radix-tree.h @@ -45,5 +45,8 @@ extern int radix_tree_reserve(struct radix_tree_root *, unsigned long, void ***) extern int radix_tree_insert(struct radix_tree_root *, unsigned long, void *); extern void *radix_tree_lookup(struct radix_tree_root *, unsigned long); extern int radix_tree_delete(struct radix_tree_root *, unsigned long); +extern unsigned int +radix_tree_gang_lookup(struct radix_tree_root *root, void **results, + unsigned long first_index, unsigned int max_items); #endif /* _LINUX_RADIX_TREE_H */ diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index 0deab78dea6b..ee20abf5bb6c 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h @@ -16,7 +16,7 @@ #ifdef __KERNEL__ #include <linux/slab.h> #include <linux/interrupt.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <asm/unaligned.h> #include <linux/bitops.h> #include <linux/proc_fs.h> diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h index 74bd8e0a1d3e..28b31edd08dc 100644 --- a/include/linux/reiserfs_fs_sb.h +++ b/include/linux/reiserfs_fs_sb.h @@ -5,7 +5,7 @@ #define _LINUX_REISER_FS_SB #ifdef __KERNEL__ -#include <linux/tqueue.h> +#include <linux/workqueue.h> #endif diff --git a/include/linux/sched.h b/include/linux/sched.h index 8a361b76cf43..89c4ead4cf4b 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -172,9 +172,6 @@ extern unsigned long cache_decay_ticks; extern signed long FASTCALL(schedule_timeout(signed long timeout)); asmlinkage void schedule(void); -extern int start_context_thread(void); -extern int current_is_keventd(void); - struct namespace; /* Maximum number of active map areas.. This is a random (large) number */ @@ -381,7 +378,7 @@ struct task_struct { /* signal handlers */ struct signal_struct *sig; - sigset_t blocked, real_blocked, shared_unblocked; + sigset_t blocked, real_blocked; struct sigpending pending; unsigned long sas_ss_sp; @@ -433,6 +430,7 @@ do { if (atomic_dec_and_test(&(tsk)->usage)) __put_task_struct(tsk); } while(0) #define PF_FROZEN 0x00040000 /* frozen for system suspend */ #define PF_SYNC 0x00080000 /* performing fsync(), etc */ #define PF_FSTRANS 0x00100000 /* inside a filesystem transaction */ +#define PF_KSWAPD 0x00200000 /* I am kswapd */ /* * Ptrace flags @@ -532,7 +530,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(struct sigpending *pending, sigset_t *mask, siginfo_t *info); +extern int dequeue_signal(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); diff --git a/include/linux/scx200.h b/include/linux/scx200.h new file mode 100644 index 000000000000..af7d53acad99 --- /dev/null +++ b/include/linux/scx200.h @@ -0,0 +1,56 @@ +/* linux/include/linux/scx200.h + + Copyright (c) 2001,2002 Christer Weinigel <wingel@nano-system.com> + + Defines for the National Semiconductor SCx200 Processors +*/ + +/* Interesting stuff for the National Semiconductor SCx200 CPU */ + +/* F0 PCI Header/Bridge Configuration Registers */ +#define SCx200_DOCCS_BASE 0x78 /* DOCCS Base Address Register */ +#define SCx200_DOCCS_CTRL 0x7c /* DOCCS Control Register */ + +/* GPIO Register Block */ +#define SCx200_GPIO_SIZE 0x2c /* Size of GPIO register block */ + +/* General Configuration Block */ +#define SCx200_CB_BASE 0x9000 /* Base fixed at 0x9000 according to errata */ + +/* Watchdog Timer */ +#define SCx200_WDT_OFFSET 0x00 /* offset within configuration block */ +#define SCx200_WDT_SIZE 0x05 /* size */ + +#define SCx200_WDT_WDTO 0x00 /* Time-Out Register */ +#define SCx200_WDT_WDCNFG 0x02 /* Configuration Register */ +#define SCx200_WDT_WDSTS 0x04 /* Status Register */ +#define SCx200_WDT_WDSTS_WDOVF (1<<0) /* Overflow bit */ + +/* High Resolution Timer */ +#define SCx200_TIMER_OFFSET 0x08 +#define SCx200_TIMER_SIZE 0x05 + +/* Clock Generators */ +#define SCx200_CLOCKGEN_OFFSET 0x10 +#define SCx200_CLOCKGEN_SIZE 0x10 + +/* Pin Multiplexing and Miscellaneous Configuration Registers */ +#define SCx200_MISC_OFFSET 0x30 +#define SCx200_MISC_SIZE 0x10 + +#define SCx200_PMR 0x30 /* Pin Multiplexing Register */ +#define SCx200_MCR 0x34 /* Miscellaneous Configuration Register */ +#define SCx200_INTSEL 0x38 /* Interrupt Selection Register */ +#define SCx200_IID 0x3c /* IA On a Chip Identification Number Reg */ +#define SCx200_REV 0x3d /* Revision Register */ +#define SCx200_CBA 0x3e /* Configuration Base Address Register */ + +/* Verify that the configuration block really is there */ +#define scx200_cb_probe(base) (inw((base) + SCx200_CBA) == (base)) + +/* + Local variables: + compile-command: "make -C ../.. bzImage modules" + c-basic-offset: 8 + End: +*/ diff --git a/include/linux/scx200_gpio.h b/include/linux/scx200_gpio.h new file mode 100644 index 000000000000..2c6d739706b6 --- /dev/null +++ b/include/linux/scx200_gpio.h @@ -0,0 +1,98 @@ +#include <linux/spinlock.h> + +u32 scx200_gpio_configure(int index, u32 set, u32 clear); +void scx200_gpio_dump(unsigned index); + +extern unsigned scx200_gpio_base; +extern spinlock_t scx200_gpio_lock; +extern long scx200_gpio_shadow[2]; + +#define scx200_gpio_present() (scx200_gpio_base!=0) + +/* Definitions to make sure I do the same thing in all functions */ +#define __SCx200_GPIO_BANK unsigned bank = index>>5 +#define __SCx200_GPIO_IOADDR unsigned short ioaddr = scx200_gpio_base+0x10*bank +#define __SCx200_GPIO_SHADOW long *shadow = scx200_gpio_shadow+bank +#define __SCx200_GPIO_INDEX index &= 31 + +#define __SCx200_GPIO_OUT __asm__ __volatile__("outsl":"=mS" (shadow):"d" (ioaddr), "0" (shadow)) + +/* returns the value of the GPIO pin */ + +static inline int scx200_gpio_get(int index) { + __SCx200_GPIO_BANK; + __SCx200_GPIO_IOADDR + 0x04; + __SCx200_GPIO_INDEX; + + return (inl(ioaddr) & (1<<index)) ? 1 : 0; +} + +/* return the value driven on the GPIO signal (the value that will be + driven if the GPIO is configured as an output, it might not be the + state of the GPIO right now if the GPIO is configured as an input) */ + +static inline int scx200_gpio_current(int index) { + __SCx200_GPIO_BANK; + __SCx200_GPIO_INDEX; + + return (scx200_gpio_shadow[bank] & (1<<index)) ? 1 : 0; +} + +/* drive the GPIO signal high */ + +static inline void scx200_gpio_set_high(int index) { + __SCx200_GPIO_BANK; + __SCx200_GPIO_IOADDR; + __SCx200_GPIO_SHADOW; + __SCx200_GPIO_INDEX; + set_bit(index, shadow); + __SCx200_GPIO_OUT; +} + +/* drive the GPIO signal low */ + +static inline void scx200_gpio_set_low(int index) { + __SCx200_GPIO_BANK; + __SCx200_GPIO_IOADDR; + __SCx200_GPIO_SHADOW; + __SCx200_GPIO_INDEX; + clear_bit(index, shadow); + __SCx200_GPIO_OUT; +} + +/* drive the GPIO signal to state */ + +static inline void scx200_gpio_set(int index, int state) { + __SCx200_GPIO_BANK; + __SCx200_GPIO_IOADDR; + __SCx200_GPIO_SHADOW; + __SCx200_GPIO_INDEX; + if (state) + set_bit(index, shadow); + else + clear_bit(index, shadow); + __SCx200_GPIO_OUT; +} + +/* toggle the GPIO signal */ +static inline void scx200_gpio_change(int index) { + __SCx200_GPIO_BANK; + __SCx200_GPIO_IOADDR; + __SCx200_GPIO_SHADOW; + __SCx200_GPIO_INDEX; + change_bit(index, shadow); + __SCx200_GPIO_OUT; +} + +#undef __SCx200_GPIO_BANK +#undef __SCx200_GPIO_IOADDR +#undef __SCx200_GPIO_SHADOW +#undef __SCx200_GPIO_INDEX +#undef __SCx200_GPIO_OUT + +/* + Local variables: + compile-command: "make -C ../.. bzImage modules" + c-basic-offset: 8 + End: +*/ diff --git a/include/linux/serial167.h b/include/linux/serial167.h index 2c805a1791cf..1683e8941c04 100644 --- a/include/linux/serial167.h +++ b/include/linux/serial167.h @@ -51,7 +51,7 @@ struct cyclades_port { int xmit_cnt; int default_threshold; int default_timeout; - struct tq_struct tqueue; + struct work_struct tqueue; struct termios normal_termios; struct termios callout_termios; wait_queue_head_t open_wait; diff --git a/include/linux/serialP.h b/include/linux/serialP.h index 40c5b938472c..6fcb341a8776 100644 --- a/include/linux/serialP.h +++ b/include/linux/serialP.h @@ -21,7 +21,7 @@ #include <linux/config.h> #include <linux/termios.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/circ_buf.h> #include <linux/wait.h> #if (LINUX_VERSION_CODE < 0x020300) @@ -86,7 +86,7 @@ struct async_struct { u8 *iomem_base; u16 iomem_reg_shift; int io_type; - struct tq_struct tqueue; + struct work_struct work; #ifdef DECLARE_WAITQUEUE wait_queue_head_t open_wait; wait_queue_head_t close_wait; diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 8cf9eccab7c1..c38330747ee1 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -168,6 +168,8 @@ struct uart_port { #define UPF_BUGGY_UART (1 << 14) #define UPF_AUTOPROBE (1 << 15) #define UPF_BOOT_AUTOCONF (1 << 28) +#define UPF_RESOURCES (1 << 30) +#define UPF_IOREMAP (1 << 31) #define UPF_FLAGS (0x7fff) #define UPF_USR_MASK (UPF_SPD_MASK|UPF_LOW_LATENCY) diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h index 9d39c403c0a0..dce3d7f9c252 100644 --- a/include/linux/shmem_fs.h +++ b/include/linux/shmem_fs.h @@ -11,11 +11,11 @@ extern atomic_t shmem_nrpages; struct shmem_inode_info { spinlock_t lock; - struct semaphore sem; unsigned long next_index; swp_entry_t i_direct[SHMEM_NR_DIRECT]; /* for the first blocks */ - void **i_indirect; /* indirect blocks */ - unsigned long swapped; + struct page *i_indirect; /* indirect blocks */ + unsigned long alloced; /* data pages allocated to file */ + unsigned long swapped; /* subtotal assigned to swap */ unsigned long flags; struct list_head list; struct inode vfs_inode; diff --git a/include/linux/stallion.h b/include/linux/stallion.h index 072f89508a13..50cc96401196 100644 --- a/include/linux/stallion.h +++ b/include/linux/stallion.h @@ -104,7 +104,7 @@ typedef struct stlport { #endif struct termios normaltermios; struct termios callouttermios; - struct tq_struct tqueue; + struct work_struct tqueue; comstats_t stats; stlrq_t tx; } stlport_t; diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h index 5d1f842c8512..b338aa49201e 100644 --- a/include/linux/sunrpc/debug.h +++ b/include/linux/sunrpc/debug.h @@ -12,7 +12,7 @@ #include <linux/config.h> #include <linux/timer.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> /* * Enable RPC debugging/profiling. diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index ff3a4ad22a13..601899c6ed87 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h @@ -10,7 +10,6 @@ #define _LINUX_SUNRPC_SCHED_H_ #include <linux/timer.h> -#include <linux/tqueue.h> #include <linux/sunrpc/types.h> #include <linux/wait.h> diff --git a/include/linux/sunrpc/types.h b/include/linux/sunrpc/types.h index d524016fb4ba..d222f47550af 100644 --- a/include/linux/sunrpc/types.h +++ b/include/linux/sunrpc/types.h @@ -10,7 +10,7 @@ #define _LINUX_SUNRPC_TYPES_H_ #include <linux/timer.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/sunrpc/debug.h> #include <linux/list.h> diff --git a/include/linux/suspend.h b/include/linux/suspend.h index ccc76b9ba88b..23e0ccdab015 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h @@ -43,7 +43,7 @@ struct suspend_header { #define SUSPEND_PD_PAGES(x) (((x)*sizeof(struct pbe))/PAGE_SIZE+1) -extern struct tq_struct suspend_tq; +extern struct work_struct suspend_tq; /* mm/vmscan.c */ extern int shrink_mem(void); diff --git a/include/linux/swap.h b/include/linux/swap.h index f4acbd1e9b46..4ec8559245c6 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -218,7 +218,7 @@ extern spinlock_t swaplock; #define swap_device_lock(p) spin_lock(&p->sdev_lock) #define swap_device_unlock(p) spin_unlock(&p->sdev_lock) -extern void shmem_unuse(swp_entry_t entry, struct page *page); +extern int shmem_unuse(swp_entry_t entry, struct page *page); #endif /* __KERNEL__*/ diff --git a/include/linux/timer.h b/include/linux/timer.h index f890f4f3d668..cfedb5e8bb07 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -2,70 +2,59 @@ #define _LINUX_TIMER_H #include <linux/config.h> -#include <linux/smp.h> -#include <linux/stddef.h> #include <linux/list.h> -#include <linux/spinlock.h> -#include <linux/cache.h> struct tvec_t_base_s; -/* - * Timers may be dynamically created and destroyed, and should be initialized - * by a call to init_timer() upon creation. - * - * The "data" field enables use of a common timeout function for several - * timeouts. You can use this field to distinguish between the different - * invocations. - */ -typedef struct timer_list { - struct list_head list; +struct timer_list { + struct list_head entry; unsigned long expires; - unsigned long data; + void (*function)(unsigned long); + unsigned long data; + struct tvec_t_base_s *base; -} timer_t; +}; -extern void add_timer(timer_t * timer); -extern int del_timer(timer_t * timer); - -#ifdef CONFIG_SMP -extern int del_timer_sync(timer_t * timer); -extern void sync_timers(void); -#define timer_enter(base, t) do { base->running_timer = t; mb(); } while (0) -#define timer_exit(base) do { base->running_timer = NULL; } while (0) -#define timer_is_running(base,t) (base->running_timer == t) -#define timer_synchronize(base,t) while (timer_is_running(base,t)) barrier() -#else -#define del_timer_sync(t) del_timer(t) -#define sync_timers() do { } while (0) -#define timer_enter(base,t) do { } while (0) -#define timer_exit(base) do { } while (0) -#endif - -/* - * mod_timer is a more efficient way to update the expire field of an - * active timer (if the timer is inactive it will be activated) - * mod_timer(a,b) is equivalent to del_timer(a); a->expires = b; add_timer(a). - * If the timer is known to be not pending (ie, in the handler), mod_timer - * is less efficient than a->expires = b; add_timer(a). +/*** + * init_timer - initialize a timer. + * @timer: the timer to be initialized + * + * init_timer() must be done to a timer prior calling *any* of the + * other timer functions. */ -int mod_timer(timer_t *timer, unsigned long expires); - -extern void it_real_fn(unsigned long); - -extern void init_timers(void); -extern void run_local_timers(void); - -static inline void init_timer(timer_t * timer) +static inline void init_timer(struct timer_list * timer) { - timer->list.next = timer->list.prev = NULL; timer->base = NULL; } -static inline int timer_pending(const timer_t * timer) +/*** + * timer_pending - is a timer pending? + * @timer: the timer in question + * + * timer_pending will tell whether a given timer is currently pending, + * or not. Callers must ensure serialization wrt. other operations done + * to this timer, eg. interrupt contexts, or other CPUs on SMP. + * + * return value: 1 if the timer is pending, 0 if not. + */ +static inline int timer_pending(const struct timer_list * timer) { - return timer->list.next != NULL; + return timer->base != NULL; } +extern void add_timer(struct timer_list * timer); +extern int del_timer(struct timer_list * timer); +extern int mod_timer(struct timer_list *timer, unsigned long expires); + +#if CONFIG_SMP + extern int del_timer_sync(struct timer_list * timer); +#else +# define del_timer_sync(t) del_timer(t) +#endif + +extern void init_timers(void); +extern void run_local_timers(void); +extern void it_real_fn(unsigned long); + #endif diff --git a/include/linux/tqueue.h b/include/linux/tqueue.h deleted file mode 100644 index cca0b193617b..000000000000 --- a/include/linux/tqueue.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * tqueue.h --- task queue handling for Linux. - * - * Modified version of previous incarnations of task-queues, - * written by: - * - * (C) 1994 Kai Petzke, wpp@marie.physik.tu-berlin.de - * Modified for use in the Linux kernel by Theodore Ts'o, - * tytso@mit.edu. - */ - -#ifndef _LINUX_TQUEUE_H -#define _LINUX_TQUEUE_H - -#include <linux/spinlock.h> -#include <linux/list.h> -#include <linux/bitops.h> -#include <asm/system.h> - -struct tq_struct { - struct list_head list; /* linked list of active tq's */ - unsigned long sync; /* must be initialized to zero */ - void (*routine)(void *); /* function to call */ - void *data; /* argument to function */ -}; - -/* - * Emit code to initialise a tq_struct's routine and data pointers - */ -#define PREPARE_TQUEUE(_tq, _routine, _data) \ - do { \ - (_tq)->routine = _routine; \ - (_tq)->data = _data; \ - } while (0) - -/* - * Emit code to initialise all of a tq_struct - */ -#define INIT_TQUEUE(_tq, _routine, _data) \ - do { \ - INIT_LIST_HEAD(&(_tq)->list); \ - (_tq)->sync = 0; \ - PREPARE_TQUEUE((_tq), (_routine), (_data)); \ - } while (0) - -#define DECLARE_TASK_QUEUE(q) LIST_HEAD(q) - -/* Schedule a tq to run in process context */ -extern int schedule_task(struct tq_struct *task); - -/* finish all currently pending tasks - do not call from irq context */ -extern void flush_scheduled_tasks(void); - -#endif - diff --git a/include/linux/tty.h b/include/linux/tty.h index 3474a7dba9c2..81c8d745f708 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -20,7 +20,7 @@ #include <linux/fs.h> #include <linux/major.h> #include <linux/termios.h> -#include <linux/tqueue.h> +#include <linux/workqueue.h> #include <linux/tty_driver.h> #include <linux/tty_ldisc.h> @@ -138,7 +138,7 @@ extern struct screen_info screen_info; #define TTY_FLIPBUF_SIZE 512 struct tty_flip_buffer { - struct tq_struct tqueue; + struct work_struct work; struct semaphore pty_sem; char *char_buf_ptr; unsigned char *flag_buf_ptr; @@ -279,7 +279,7 @@ struct tty_struct { int alt_speed; /* For magic substitution of 38400 bps */ wait_queue_head_t write_wait; wait_queue_head_t read_wait; - struct tq_struct tq_hangup; + struct work_struct hangup_work; void *disc_data; void *driver_data; struct list_head tty_files; @@ -309,7 +309,7 @@ struct tty_struct { struct semaphore atomic_write; spinlock_t read_lock; /* If the tty has a pending do_SAK, queue it here - akpm */ - struct tq_struct SAK_tq; + struct work_struct SAK_work; }; /* tty magic number */ diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h index 738ffcd53264..abe9bfcf226c 100644 --- a/include/linux/tty_flip.h +++ b/include/linux/tty_flip.h @@ -19,7 +19,7 @@ _INLINE_ void tty_insert_flip_char(struct tty_struct *tty, _INLINE_ void tty_schedule_flip(struct tty_struct *tty) { - schedule_task(&tty->flip.tqueue); + schedule_delayed_work(&tty->flip.work, 1); } #undef _INLINE_ diff --git a/include/linux/types.h b/include/linux/types.h index 3ee38ccc272c..582d35492314 100644 --- a/include/linux/types.h +++ b/include/linux/types.h @@ -4,7 +4,7 @@ #ifdef __KERNEL__ #include <linux/config.h> -#define bitmap_member(name,bits) \ +#define DECLARE_BITMAP(name,bits) \ unsigned long name[((bits)+BITS_PER_LONG-1)/BITS_PER_LONG] #endif diff --git a/include/linux/wanpipe.h b/include/linux/wanpipe.h index 061090a368f8..74b35ec9099c 100644 --- a/include/linux/wanpipe.h +++ b/include/linux/wanpipe.h @@ -320,7 +320,7 @@ typedef struct { #include <linux/sdladrv.h> /* SDLA support module API definitions */ #include <linux/sdlasfm.h> /* SDLA firmware module definitions */ -#include <linux/tqueue.h> +#include <linux/workqueue.h> #ifdef LINUX_2_4 #include <linux/serial.h> #include <linux/serialP.h> @@ -389,7 +389,7 @@ typedef struct sdla unsigned int tty_open; unsigned char *tty_buf; unsigned char *tty_rx; - struct tq_struct tty_task_queue; + struct work_struct tty_work; union { @@ -422,7 +422,7 @@ typedef struct sdla u8 oob_on_modem; /* Option to send modem status to the api */ u16 num_of_ch; /* Number of channels configured by the user */ - struct tq_struct x25_poll_task; + struct work_struct x25_poll_work; struct timer_list x25_timer; } x; struct @@ -545,7 +545,7 @@ int wsppp_init (sdla_t* card, wandev_conf_t* conf); /* Sync PPP on top of RAW CH extern sdla_t * wanpipe_find_card(char *); extern sdla_t * wanpipe_find_card_num (int); -extern void wanpipe_queue_tq (struct tq_struct *); +extern void wanpipe_queue_work (struct work_struct *); extern void wanpipe_mark_bh (void); extern void wakeup_sk_bh (netdevice_t *); extern int change_dev_flags (netdevice_t *, unsigned); diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h new file mode 100644 index 000000000000..8fb06d58739f --- /dev/null +++ b/include/linux/workqueue.h @@ -0,0 +1,65 @@ +/* + * workqueue.h --- work queue handling for Linux. + */ + +#ifndef _LINUX_WORKQUEUE_H +#define _LINUX_WORKQUEUE_H + +#include <linux/timer.h> +#include <linux/linkage.h> + +struct workqueue_struct; + +struct work_struct { + unsigned long pending; + struct list_head entry; + void (*func)(void *); + void *data; + void *wq_data; + struct timer_list timer; +}; + +#define __WORK_INITIALIZER(n, f, d) { \ + .entry = { &(n).entry, &(n).entry }, \ + .func = (f), \ + .data = (d) } + +#define DECLARE_WORK(n, f, d) \ + struct work_struct n = __WORK_INITIALIZER(n, f, d) + +/* + * initialize a work-struct's func and data pointers: + */ +#define PREPARE_WORK(_work, _func, _data) \ + do { \ + (_work)->func = _func; \ + (_work)->data = _data; \ + } while (0) + +/* + * initialize all of a work-struct: + */ +#define INIT_WORK(_work, _func, _data) \ + do { \ + INIT_LIST_HEAD(&(_work)->entry); \ + (_work)->pending = 0; \ + PREPARE_WORK((_work), (_func), (_data)); \ + init_timer(&(_work)->timer); \ + } while (0) + +extern struct workqueue_struct *create_workqueue(const char *name); +extern void destroy_workqueue(struct workqueue_struct *wq); + +extern int FASTCALL(queue_work(struct workqueue_struct *wq, struct work_struct *work)); +extern int FASTCALL(queue_delayed_work(struct workqueue_struct *wq, struct work_struct *work, unsigned long delay)); +extern void FASTCALL(flush_workqueue(struct workqueue_struct *wq)); + +extern int FASTCALL(schedule_work(struct work_struct *work)); +extern int FASTCALL(schedule_delayed_work(struct work_struct *work, unsigned long delay)); +extern void flush_scheduled_work(void); +extern int current_is_keventd(void); + +extern void init_workqueues(void); + +#endif + diff --git a/include/linux/zorro.h b/include/linux/zorro.h index 38d128833a76..a623f17fd028 100644 --- a/include/linux/zorro.h +++ b/include/linux/zorro.h @@ -199,7 +199,7 @@ extern struct zorro_dev *zorro_find_device(zorro_id id, * the corresponding bits. */ -extern bitmap_member(zorro_unused_z2ram, 128); +extern DECLARE_BITMAP(zorro_unused_z2ram, 128); #define Z2RAM_START (0x00200000) #define Z2RAM_END (0x00a00000) |
