From f17051d751d0843be1d683fbf2790b17cbd26134 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 23 Nov 2007 15:24:59 -0500 Subject: [PATCH] Import 2.3.1pre1 --- Makefile | 2 +- arch/i386/kernel/init_task.c | 5 +- drivers/block/floppy.c | 4 +- drivers/block/hd.c | 2 +- drivers/block/ide-dma.c | 2 +- drivers/block/ide.c | 2 +- drivers/block/ide.h | 2 +- drivers/block/ll_rw_blk.c | 4 +- drivers/block/md.c | 2 +- drivers/block/rd.c | 2 + drivers/char/console.c | 2 +- drivers/char/keyboard.c | 2 +- drivers/char/n_tty.c | 8 +- drivers/char/pc_keyb.c | 4 +- drivers/char/pc_keyb.h | 2 +- drivers/char/pty.c | 6 +- drivers/char/qpmouse.c | 6 +- drivers/char/random.c | 8 +- drivers/char/rtc.c | 5 +- drivers/char/selection.c | 2 +- drivers/char/serial.c | 4 +- drivers/char/tty_io.c | 6 +- drivers/char/tty_ioctl.c | 2 +- drivers/char/vt.c | 4 +- drivers/scsi/atari_scsi.c | 4 +- drivers/scsi/hosts.c | 4 +- drivers/scsi/hosts.h | 2 +- drivers/scsi/megaraid.c | 2 +- drivers/scsi/scsi.c | 14 +- drivers/scsi/scsi.h | 4 +- drivers/scsi/scsi_error.c | 6 +- drivers/scsi/scsi_ioctl.c | 4 +- drivers/scsi/sd.c | 8 +- drivers/scsi/sg.c | 6 +- drivers/scsi/sr.c | 2 +- drivers/scsi/sr_ioctl.c | 2 +- drivers/scsi/st.c | 2 +- drivers/video/Config.in | 27 +- drivers/video/Makefile | 8 + drivers/video/acornfb.c | 1966 ++++++++++++++++++++++--- drivers/video/cyber2000fb.c | 1057 +++++++++++++ drivers/video/cyber2000fb.h | 78 + drivers/video/dummycon.c | 3 +- drivers/video/fbmem.c | 14 +- drivers/video/vgacon.c | 20 +- fs/adfs/dir.c | 49 +- fs/autofs/autofs_i.h | 2 +- fs/autofs/waitq.c | 2 +- fs/buffer.c | 12 +- fs/dquot.c | 4 +- fs/ext2/ialloc.c | 17 +- fs/ext2/inode.c | 4 +- fs/ext2/ioctl.c | 4 +- fs/fifo.c | 2 +- fs/inode.c | 4 +- fs/isofs/inode.c | 1 + fs/lockd/clntlock.c | 4 +- fs/lockd/host.c | 4 +- fs/lockd/svc.c | 8 +- fs/lockd/svcsubs.c | 4 +- fs/locks.c | 4 + fs/nfs/dir.c | 7 +- fs/nfs/write.c | 3 +- fs/pipe.c | 2 +- fs/proc/array.c | 4 +- fs/proc/kmsg.c | 2 +- fs/select.c | 5 +- fs/super.c | 5 +- include/asm-arm/arch-ebsa285/irq.h | 1 - include/asm-arm/arch-ebsa285/memory.h | 2 - include/asm-arm/arch-rpc/io.h | 51 +- include/asm-arm/proc-fns.h | 2 +- include/asm-arm/semaphore.h | 1 - include/asm-i386/semaphore.h | 70 +- include/linux/blkdev.h | 2 +- include/linux/ext2_fs.h | 2 +- include/linux/ext2_fs_i.h | 2 +- include/linux/fs.h | 8 +- include/linux/hfs_sysdep.h | 4 +- include/linux/keyboard.h | 4 +- include/linux/lockd/lockd.h | 2 +- include/linux/md.h | 2 +- include/linux/mm.h | 2 +- include/linux/msg.h | 4 +- include/linux/net.h | 3 +- include/linux/nfs_fs.h | 2 +- include/linux/nfsd/nfsfh.h | 2 + include/linux/nfsiod.h | 2 +- include/linux/pipe_fs_i.h | 2 +- include/linux/poll.h | 8 +- include/linux/rtnetlink.h | 2 +- include/linux/sched.h | 78 +- include/linux/sem.h | 2 +- include/linux/serialP.h | 6 +- include/linux/sunrpc/sched.h | 3 +- include/linux/sunrpc/svc.h | 2 +- include/linux/tty.h | 4 +- include/linux/vt_kern.h | 2 +- include/linux/wait.h | 183 ++- include/net/sock.h | 2 +- ipc/msg.c | 7 +- ipc/sem.c | 6 +- ipc/shm.c | 4 +- kernel/exit.c | 2 +- kernel/fork.c | 6 +- kernel/ksyms.c | 1 - kernel/printk.c | 2 +- kernel/sched.c | 100 +- kernel/signal.c | 2 +- kernel/sys.c | 3 +- mm/filemap.c | 8 +- mm/page_alloc.c | 1 + mm/page_io.c | 2 +- mm/slab.c | 2 +- net/core/datagram.c | 2 +- net/core/rtnetlink.c | 2 +- net/core/sock.c | 5 +- net/ipv4/af_inet.c | 2 +- net/ipv4/icmp.c | 2 + net/ipv4/ip_masq_quake.c | 2 +- net/ipv4/tcp.c | 33 +- net/ipv4/tcp_ipv4.c | 2 + net/socket.c | 2 +- net/sunrpc/clnt.c | 2 +- net/sunrpc/sched.c | 11 +- net/sunrpc/svc.c | 2 + net/sunrpc/svcsock.c | 2 +- net/unix/af_unix.c | 6 +- 128 files changed, 3568 insertions(+), 589 deletions(-) create mode 100644 drivers/video/cyber2000fb.c create mode 100644 drivers/video/cyber2000fb.h diff --git a/Makefile b/Makefile index 4f269d0c30b5..ff7e4be2349e 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ VERSION = 2 PATCHLEVEL = 3 -SUBLEVEL = 0 +SUBLEVEL = 1 EXTRAVERSION = ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/) diff --git a/arch/i386/kernel/init_task.c b/arch/i386/kernel/init_task.c index d3b395732c54..0faa696a4e3e 100644 --- a/arch/i386/kernel/init_task.c +++ b/arch/i386/kernel/init_task.c @@ -10,7 +10,7 @@ static struct fs_struct init_fs = INIT_FS; static struct file * init_fd_array[NR_OPEN] = { NULL, }; static struct files_struct init_files = INIT_FILES; static struct signal_struct init_signals = INIT_SIGNALS; -struct mm_struct init_mm = INIT_MM; +struct mm_struct init_mm = INIT_MM(init_mm); /* * Initial task structure. @@ -20,5 +20,6 @@ struct mm_struct init_mm = INIT_MM; * "init_task" linker map entry.. */ union task_union init_task_union - __attribute__((__section__(".data.init_task"))) = { INIT_TASK }; + __attribute__((__section__(".data.init_task"))) = + { INIT_TASK(init_task_union.task) }; diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index b4c986f4cd15..574f430e7564 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -466,7 +466,9 @@ static int probing = 0; #define FD_COMMAND_OKAY 3 static volatile int command_status = FD_COMMAND_NONE, fdc_busy = 0; -static struct wait_queue *fdc_wait = NULL, *command_done = NULL; +static DECLARE_WAIT_QUEUE_HEAD(fdc_wait); +static DECLARE_WAIT_QUEUE_HEAD(command_done); + #define NO_SIGNAL (!interruptible || !signal_pending(current)) #define CALL(x) if ((x) == -EINTR) return -EINTR #define ECALL(x) if ((ret = (x))) return ret; diff --git a/drivers/block/hd.c b/drivers/block/hd.c index 203c2d609acb..e097ca2c7239 100644 --- a/drivers/block/hd.c +++ b/drivers/block/hd.c @@ -68,7 +68,7 @@ static char recalibrate[MAX_HD] = { 0, }; static char special_op[MAX_HD] = { 0, }; static int access_count[MAX_HD] = {0, }; static char busy[MAX_HD] = {0, }; -static struct wait_queue * busy_wait = NULL; +static DECLARE_WAIT_QUEUE_HEAD(busy_wait); static int reset = 0; static int hd_error = 0; diff --git a/drivers/block/ide-dma.c b/drivers/block/ide-dma.c index a3ac372384bc..17f46f464f85 100644 --- a/drivers/block/ide-dma.c +++ b/drivers/block/ide-dma.c @@ -425,7 +425,7 @@ __initfunc(unsigned long ide_get_or_set_dma_base (ide_hwif_t *hwif, int extra, c } else { dma_base = dev->base_address[4] & PCI_BASE_ADDRESS_IO_MASK; if (!dma_base || dma_base == PCI_BASE_ADDRESS_IO_MASK) { - printk("%s: dma_base is invalid (0x%04lx, BIOS problem), please report to \n", name, dma_base); + printk("%s: dma_base is invalid (0x%04lx)\n", name, dma_base); dma_base = 0; } } diff --git a/drivers/block/ide.c b/drivers/block/ide.c index 2e703455d5b8..b8d81652d9a2 100644 --- a/drivers/block/ide.c +++ b/drivers/block/ide.c @@ -1490,7 +1490,7 @@ int ide_do_drive_cmd (ide_drive_t *drive, struct request *rq, ide_action_t actio ide_hwgroup_t *hwgroup = HWGROUP(drive); unsigned int major = HWIF(drive)->major; struct request *cur_rq; - struct semaphore sem = MUTEX_LOCKED; + DECLARE_MUTEX_LOCKED(sem); if (IS_PDC4030_DRIVE && rq->buffer != NULL) return -ENOSYS; /* special drive cmds not supported */ diff --git a/drivers/block/ide.h b/drivers/block/ide.h index bc7d7fbdd37e..52bb4e258d39 100644 --- a/drivers/block/ide.h +++ b/drivers/block/ide.h @@ -250,7 +250,7 @@ typedef struct ide_drive_s { unsigned short cyl; /* "real" number of cyls */ unsigned int drive_data; /* for use by tuneproc/selectproc as needed */ void *hwif; /* actually (ide_hwif_t *) */ - struct wait_queue *wqueue; /* used to wait for drive in open() */ + wait_queue_head_t wqueue; /* used to wait for drive in open() */ struct hd_driveid *id; /* drive model identification info */ struct hd_struct *part; /* drive partition table */ char name[4]; /* drive name, such as "hda" */ diff --git a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c index 69a2848af04b..1c1bdc9738ca 100644 --- a/drivers/block/ll_rw_blk.c +++ b/drivers/block/ll_rw_blk.c @@ -53,7 +53,7 @@ spinlock_t io_request_lock = SPIN_LOCK_UNLOCKED; /* * used to wait on when there are no free requests */ -struct wait_queue * wait_for_request = NULL; +DECLARE_WAIT_QUEUE_HEAD(wait_for_request); /* This specifies how many sectors to read ahead on the disk. */ @@ -208,7 +208,7 @@ static inline struct request * get_request(int n, kdev_t dev) static struct request * __get_request_wait(int n, kdev_t dev) { register struct request *req; - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); unsigned long flags; add_wait_queue(&wait_for_request, &wait); diff --git a/drivers/block/md.c b/drivers/block/md.c index 77090708e6d1..fd36d507363b 100644 --- a/drivers/block/md.c +++ b/drivers/block/md.c @@ -822,7 +822,7 @@ struct md_thread *md_register_thread (void (*run) (void *), void *data) if (!thread) return NULL; memset(thread, 0, sizeof(struct md_thread)); - init_waitqueue(&thread->wqueue); + init_waitqueue_head(&thread->wqueue); thread->sem = &sem; thread->run = run; diff --git a/drivers/block/rd.c b/drivers/block/rd.c index 13a4307a8988..6df2a1c10757 100644 --- a/drivers/block/rd.c +++ b/drivers/block/rd.c @@ -482,6 +482,7 @@ __initfunc(static void rd_load_image(kdev_t device, int offset, int unit)) memset(&inode, 0, sizeof(inode)); memset(&in_dentry, 0, sizeof(in_dentry)); inode.i_rdev = device; + init_waitqueue_head(&inode.i_wait); infile.f_mode = 1; /* read only */ infile.f_dentry = &in_dentry; in_dentry.d_inode = &inode; @@ -490,6 +491,7 @@ __initfunc(static void rd_load_image(kdev_t device, int offset, int unit)) memset(&out_inode, 0, sizeof(out_inode)); memset(&out_dentry, 0, sizeof(out_dentry)); out_inode.i_rdev = ram_device; + init_waitqueue_head(&out_inode.i_wait); outfile.f_mode = 3; /* read/write */ outfile.f_dentry = &out_dentry; out_dentry.d_inode = &out_inode; diff --git a/drivers/char/console.c b/drivers/char/console.c index cea651b2827e..2005390d943f 100644 --- a/drivers/char/console.c +++ b/drivers/char/console.c @@ -2269,7 +2269,7 @@ static void vc_init(unsigned int currcons, unsigned int rows, unsigned int cols, def_color = 0x07; /* white */ ulcolor = 0x0f; /* bold white */ halfcolor = 0x08; /* grey */ - vt_cons[currcons]->paste_wait = 0; + init_waitqueue_head(&vt_cons[currcons]->paste_wait); reset_terminal(currcons, do_clear); } diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c index 607f4b664f51..e40a2631fe03 100644 --- a/drivers/char/keyboard.c +++ b/drivers/char/keyboard.c @@ -64,7 +64,7 @@ EXPORT_SYMBOL(handle_scancode); extern void ctrl_alt_del(void); -struct wait_queue * keypress_wait = NULL; +DECLARE_WAIT_QUEUE_HEAD(keypress_wait); struct console; int keyboard_wait_for_keypress(struct console *co) diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c index 1c6f93f44817..af4daecfbf6a 100644 --- a/drivers/char/n_tty.c +++ b/drivers/char/n_tty.c @@ -605,7 +605,7 @@ send_signal: tty->canon_data++; if (tty->fasync) kill_fasync(tty->fasync, SIGIO); - if (tty->read_wait) + if (waitqueue_active(&tty->read_wait)) wake_up_interruptible(&tty->read_wait); return; } @@ -707,7 +707,7 @@ static void n_tty_receive_buf(struct tty_struct *tty, const unsigned char *cp, if (!tty->icanon && (tty->read_cnt >= tty->minimum_to_wake)) { if (tty->fasync) kill_fasync(tty->fasync, SIGIO); - if (tty->read_wait) + if (waitqueue_active(&tty->read_wait)) wake_up_interruptible(&tty->read_wait); } @@ -868,7 +868,7 @@ static ssize_t read_chan(struct tty_struct *tty, struct file *file, unsigned char *buf, size_t nr) { unsigned char *b = buf; - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); int c; int minimum, time; ssize_t retval = 0; @@ -1058,7 +1058,7 @@ static ssize_t write_chan(struct tty_struct * tty, struct file * file, const unsigned char * buf, size_t nr) { const unsigned char *b = buf; - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); int c; ssize_t retval = 0; diff --git a/drivers/char/pc_keyb.c b/drivers/char/pc_keyb.c index 62f0c57bb99e..2a0a561e795c 100644 --- a/drivers/char/pc_keyb.c +++ b/drivers/char/pc_keyb.c @@ -864,7 +864,7 @@ static int open_aux(struct inode * inode, struct file * file) static ssize_t read_aux(struct file * file, char * buffer, size_t count, loff_t *ppos) { - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); ssize_t i = count; unsigned char c; @@ -964,7 +964,7 @@ static int __init psaux_init(void) queue = (struct aux_queue *) kmalloc(sizeof(*queue), GFP_KERNEL); memset(queue, 0, sizeof(*queue)); queue->head = queue->tail = 0; - queue->proc_list = NULL; + init_waitqueue_head(&queue->proc_list); #ifdef INITIALIZE_MOUSE kbd_write(KBD_CNTL_REG, KBD_CCMD_MOUSE_ENABLE); /* Enable Aux. */ diff --git a/drivers/char/pc_keyb.h b/drivers/char/pc_keyb.h index 256b4788bbc2..245df6254d35 100644 --- a/drivers/char/pc_keyb.h +++ b/drivers/char/pc_keyb.h @@ -124,7 +124,7 @@ extern unsigned char aux_device_present; struct aux_queue { unsigned long head; unsigned long tail; - struct wait_queue *proc_list; + wait_queue_head_t proc_list; struct fasync_struct *fasync; unsigned char buf[AUX_BUF_SIZE]; }; diff --git a/drivers/char/pty.c b/drivers/char/pty.c index 48e81fc614ce..dab25c97649f 100644 --- a/drivers/char/pty.c +++ b/drivers/char/pty.c @@ -30,7 +30,7 @@ struct pty_struct { int magic; - struct wait_queue * open_wait; + wait_queue_head_t open_wait; }; #define PTY_MAGIC 0x5001 @@ -336,13 +336,13 @@ static void pty_set_termios(struct tty_struct *tty, struct termios *old_termios) __initfunc(int pty_init(void)) { -#ifdef CONFIG_UNIX98_PTYS int i; -#endif /* Traditional BSD devices */ memset(&pty_state, 0, sizeof(pty_state)); + for (i = 0; i < NR_PTYS; i++) + init_waitqueue_head(&pty_state[i].open_wait); memset(&pty_driver, 0, sizeof(struct tty_driver)); pty_driver.magic = TTY_DRIVER_MAGIC; pty_driver.driver_name = "pty_master"; diff --git a/drivers/char/qpmouse.c b/drivers/char/qpmouse.c index 8b9d3604667b..e6076d926cda 100644 --- a/drivers/char/qpmouse.c +++ b/drivers/char/qpmouse.c @@ -55,7 +55,7 @@ struct qp_queue { unsigned long head; unsigned long tail; - struct wait_queue *proc_list; + wait_queue_head_t proc_list; struct fasync_struct *fasync; unsigned char buf[QP_BUF_SIZE]; }; @@ -258,7 +258,7 @@ static int poll_qp_status(void) static ssize_t read_qp(struct file * file, char * buffer, size_t count, loff_t *ppos) { - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); ssize_t i = count; unsigned char c; @@ -354,7 +354,7 @@ int __init qpmouse_init(void) queue = (struct qp_queue *) kmalloc(sizeof(*queue), GFP_KERNEL); memset(queue, 0, sizeof(*queue)); queue->head = queue->tail = 0; - queue->proc_list = NULL; + init_waitqueue_head(&queue->proc_list); return 0; } diff --git a/drivers/char/random.c b/drivers/char/random.c index f78974d6922e..f1dd26cd2e6f 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -424,8 +424,8 @@ static struct timer_rand_state mouse_timer_state; static struct timer_rand_state extract_timer_state; static struct timer_rand_state *irq_timer_state[NR_IRQS]; static struct timer_rand_state *blkdev_timer_state[MAX_BLKDEV]; -static struct wait_queue *random_read_wait; -static struct wait_queue *random_write_wait; +static DECLARE_WAIT_QUEUE_HEAD(random_read_wait); +static DECLARE_WAIT_QUEUE_HEAD(random_write_wait); static ssize_t random_read(struct file * file, char * buf, size_t nbytes, loff_t *ppos); @@ -555,8 +555,6 @@ __initfunc(void rand_initialize(void)) initialize_benchmark(&timer_benchmark, "timer", 0); #endif extract_timer_state.dont_count_entropy = 1; - random_read_wait = NULL; - random_write_wait = NULL; } void rand_initialize_irq(int irq) @@ -1303,7 +1301,7 @@ void get_random_bytes(void *buf, int nbytes) static ssize_t random_read(struct file * file, char * buf, size_t nbytes, loff_t *ppos) { - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); ssize_t n, retval = 0, count = 0; if (nbytes == 0) diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c index 6425f1dc940f..d47ae941f470 100644 --- a/drivers/char/rtc.c +++ b/drivers/char/rtc.c @@ -69,7 +69,7 @@ * ioctls. */ -static struct wait_queue *rtc_wait; +static DECLARE_WAIT_QUEUE_HEAD(rtc_wait); static struct timer_list rtc_irq_timer; @@ -150,7 +150,7 @@ static long long rtc_llseek(struct file *file, loff_t offset, int origin) static ssize_t rtc_read(struct file *file, char *buf, size_t count, loff_t *ppos) { - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); unsigned long data; ssize_t retval; @@ -567,7 +567,6 @@ __initfunc(int rtc_init(void)) #endif init_timer(&rtc_irq_timer); rtc_irq_timer.function = rtc_dropped_irq; - rtc_wait = NULL; save_flags(flags); cli(); /* Initialize periodic freq. to CMOS reset default, which is 1024Hz */ diff --git a/drivers/char/selection.c b/drivers/char/selection.c index 6d38fcf7e562..1529bd7eef37 100644 --- a/drivers/char/selection.c +++ b/drivers/char/selection.c @@ -296,7 +296,7 @@ int paste_selection(struct tty_struct *tty) { struct vt_struct *vt = (struct vt_struct *) tty->driver_data; int pasted = 0, count; - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); poke_blanked_console(); add_wait_queue(&vt->paste_wait, &wait); diff --git a/drivers/char/serial.c b/drivers/char/serial.c index efae2d6cc46e..e8c1effd6ba2 100644 --- a/drivers/char/serial.c +++ b/drivers/char/serial.c @@ -225,7 +225,7 @@ static struct termios *serial_termios_locked[NR_PORTS]; * memory if large numbers of serial ports are open. */ static unsigned char *tmp_buf; -static struct semaphore tmp_buf_sem = MUTEX; +static DECLARE_MUTEX(tmp_buf_sem); static inline int serial_paranoia_check(struct async_struct *info, kdev_t device, const char *routine) @@ -2422,7 +2422,7 @@ static void rs_hangup(struct tty_struct *tty) static int block_til_ready(struct tty_struct *tty, struct file * filp, struct async_struct *info) { - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); struct serial_state *state = info->state; int retval; int do_clocal = 0, extra_count = 0; diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index 1049789db18c..3e11bf7d60d5 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -729,7 +729,7 @@ static ssize_t tty_write(struct file * file, const char * buf, size_t count, } /* Semaphore to protect creating and releasing a tty */ -static struct semaphore tty_sem = MUTEX; +static DECLARE_MUTEX(tty_sem); static void down_tty_sem(int index) { @@ -1930,7 +1930,9 @@ static void initialize_tty_struct(struct tty_struct *tty) tty->flip.flag_buf_ptr = tty->flip.flag_buf; tty->flip.tqueue.routine = flush_to_ldisc; tty->flip.tqueue.data = tty; - tty->flip.pty_sem = MUTEX; + init_MUTEX(&tty->flip.pty_sem); + init_waitqueue_head(&tty->write_wait); + init_waitqueue_head(&tty->read_wait); tty->tq_hangup.routine = do_tty_hangup; tty->tq_hangup.data = tty; sema_init(&tty->atomic_read, 1); diff --git a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c index 2cad9dba6e25..44dfbfcd8677 100644 --- a/drivers/char/tty_ioctl.c +++ b/drivers/char/tty_ioctl.c @@ -42,7 +42,7 @@ void tty_wait_until_sent(struct tty_struct * tty, long timeout) { - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); #ifdef TTY_DEBUG_WAIT_UNTIL_SENT char buf[64]; diff --git a/drivers/char/vt.c b/drivers/char/vt.c index 97be390b03a1..5d223af218b4 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c @@ -1099,7 +1099,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, * while those not ready go back to sleep. Seems overkill to add a wait * to each vt just for this - usually this does nothing! */ -static struct wait_queue *vt_activate_queue = NULL; +static DECLARE_WAIT_QUEUE_HEAD(vt_activate_queue); /* * Sleeps until a vt is activated, or the task is interrupted. Returns @@ -1108,7 +1108,7 @@ static struct wait_queue *vt_activate_queue = NULL; int vt_waitactive(int vt) { int retval; - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); add_wait_queue(&vt_activate_queue, &wait); for (;;) { diff --git a/drivers/scsi/atari_scsi.c b/drivers/scsi/atari_scsi.c index 4e98df49cac6..f25bbba0d8b6 100644 --- a/drivers/scsi/atari_scsi.c +++ b/drivers/scsi/atari_scsi.c @@ -497,9 +497,9 @@ static void atari_scsi_fetch_restbytes( void ) static int falcon_got_lock = 0; -static struct wait_queue *falcon_fairness_wait = NULL; +static DECLARE_WAIT_QUEUE_HEAD(falcon_fairness_wait); static int falcon_trying_lock = 0; -static struct wait_queue *falcon_try_wait = NULL; +static DECLARE_WAIT_QUEUE_HEAD(falcon_try_wait); static int falcon_dont_release = 0; /* This function releases the lock on the DMA chip if there is no diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index 55082434cf1f..0999b88d8e3b 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c @@ -665,7 +665,7 @@ struct Scsi_Host * scsi_register(Scsi_Host_Template * tpnt, int j){ retval->host_no = max_scsi_hosts++; /* never reuse host_no (DB) */ next_scsi_host++; retval->host_queue = NULL; - retval->host_wait = NULL; + init_waitqueue_head(&retval->host_wait); retval->resetting = 0; retval->last_reset = 0; retval->irq = 0; @@ -738,7 +738,7 @@ scsi_register_device(struct Scsi_Device_Template * sdpnt) */ static void launch_error_handler_thread(struct Scsi_Host * shpnt) { - struct semaphore sem = MUTEX_LOCKED; + DECLARE_MUTEX_LOCKED(sem); shpnt->eh_notify = &sem; diff --git a/drivers/scsi/hosts.h b/drivers/scsi/hosts.h index 393d03f4e383..4d25e2e2cfb3 100644 --- a/drivers/scsi/hosts.h +++ b/drivers/scsi/hosts.h @@ -313,7 +313,7 @@ struct Scsi_Host host. */ unsigned int eh_active:1; /* Indicates the eh thread is awake and active if this is true. */ - struct wait_queue * host_wait; + wait_queue_head_t host_wait; Scsi_Host_Template * hostt; atomic_t host_active; /* commands checked out */ volatile unsigned short host_busy; /* commands actually active on low-level */ diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index 05f95e626427..3551f3863204 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c @@ -1522,7 +1522,7 @@ int megaraid_queue (Scsi_Cmnd * SCpnt, void (*pktComp) (Scsi_Cmnd *)) *----------------------------------------------------------------------*/ volatile static int internal_done_flag = 0; volatile static int internal_done_errcode = 0; -static struct wait_queue *internal_wait = NULL; +static DECLARE_WAIT_QUEUE_HEAD(internal_wait); static void internal_done (Scsi_Cmnd * SCpnt) { diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index d9647d6dc228..67ae9503f98d 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -473,6 +473,8 @@ static void scan_scsis (struct Scsi_Host *shpnt, SDpnt->host = shpnt; SDpnt->online = TRUE; + init_waitqueue_head(&SDpnt->device_wait); + /* * Next, hook the device to the host in question. */ @@ -660,7 +662,7 @@ int scan_scsis_single (int channel, int dev, int lun, int *max_dev_lun, SCpnt->lun = SDpnt->lun; SCpnt->channel = SDpnt->channel; { - struct semaphore sem = MUTEX_LOCKED; + DECLARE_MUTEX_LOCKED(sem); SCpnt->request.sem = &sem; SCpnt->request.rq_status = RQ_SCSI_BUSY; spin_lock_irq(&io_request_lock); @@ -703,7 +705,7 @@ int scan_scsis_single (int channel, int dev, int lun, int *max_dev_lun, scsi_cmd[5] = 0; SCpnt->cmd_len = 0; { - struct semaphore sem = MUTEX_LOCKED; + DECLARE_MUTEX_LOCKED(sem); SCpnt->request.sem = &sem; SCpnt->request.rq_status = RQ_SCSI_BUSY; spin_lock_irq(&io_request_lock); @@ -849,7 +851,7 @@ int scan_scsis_single (int channel, int dev, int lun, int *max_dev_lun, scsi_cmd[5] = 0; SCpnt->cmd_len = 0; { - struct semaphore sem = MUTEX_LOCKED; + DECLARE_MUTEX_LOCKED(sem); SCpnt->request.rq_status = RQ_SCSI_BUSY; SCpnt->request.sem = &sem; spin_lock_irq(&io_request_lock); @@ -890,6 +892,8 @@ int scan_scsis_single (int channel, int dev, int lun, int *max_dev_lun, SDpnt->device_queue = SCpnt; SDpnt->online = TRUE; + init_waitqueue_head(&SDpnt->device_wait); + /* * Since we just found one device, there had damn well better be one in the list * already. @@ -2639,7 +2643,7 @@ static int scsi_register_host(Scsi_Host_Template * tpnt) { if( shpnt->hostt == tpnt && shpnt->hostt->use_new_eh_code ) { - struct semaphore sem = MUTEX_LOCKED; + DECLARE_MUTEX_LOCKED(sem); shpnt->eh_notify = &sem; kernel_thread((int (*)(void *))scsi_error_handler, @@ -2876,7 +2880,7 @@ static void scsi_unregister_host(Scsi_Host_Template * tpnt) && shpnt->hostt->use_new_eh_code && shpnt->ehandler != NULL ) { - struct semaphore sem = MUTEX_LOCKED; + DECLARE_MUTEX_LOCKED(sem); shpnt->eh_notify = &sem; send_sig(SIGKILL, shpnt->ehandler, 1); diff --git a/drivers/scsi/scsi.h b/drivers/scsi/scsi.h index 2966ca4cd309..aab3ff235d4e 100644 --- a/drivers/scsi/scsi.h +++ b/drivers/scsi/scsi.h @@ -417,7 +417,7 @@ struct scsi_device { */ struct scsi_device * next; /* Used for linked list */ struct scsi_device * prev; /* Used for linked list */ - struct wait_queue * device_wait;/* Used to wait if + wait_queue_head_t device_wait;/* Used to wait if device is busy */ struct Scsi_Host * host; volatile unsigned short device_busy; /* commands actually active on low-level */ @@ -711,7 +711,7 @@ static Scsi_Cmnd * end_scsi_request(Scsi_Cmnd * SCpnt, int uptodate, int sectors #define SCSI_SLEEP(QUEUE, CONDITION) { \ if (CONDITION) { \ - struct wait_queue wait = { current, NULL}; \ + DECLARE_WAITQUEUE(wait, current); \ add_wait_queue(QUEUE, &wait); \ for(;;) { \ current->state = TASK_UNINTERRUPTIBLE; \ diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index bdff5d78c571..9bb08ce58b62 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -560,7 +560,7 @@ void scsi_sleep_done (struct semaphore * sem) void scsi_sleep (int timeout) { - struct semaphore sem = MUTEX_LOCKED; + DECLARE_MUTEX_LOCKED(sem); struct timer_list timer; init_timer(&timer); @@ -603,7 +603,7 @@ retry: if (host->can_queue) { - struct semaphore sem = MUTEX_LOCKED; + DECLARE_MUTEX_LOCKED(sem); SCpnt->eh_state = SCSI_STATE_QUEUED; @@ -1924,7 +1924,7 @@ scsi_error_handler(void * data) { struct Scsi_Host * host = (struct Scsi_Host *) data; int rtn; - struct semaphore sem = MUTEX_LOCKED; + DECLARE_MUTEX_LOCKED(sem); unsigned long flags; lock_kernel(); diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c index 6587d5b53789..c993661452c8 100644 --- a/drivers/scsi/scsi_ioctl.c +++ b/drivers/scsi/scsi_ioctl.c @@ -113,7 +113,7 @@ static int ioctl_internal_command(Scsi_Device *dev, char * cmd, SCSI_LOG_IOCTL(1, printk("Trying ioctl with scsi command %d\n", cmd[0])); SCpnt = scsi_allocate_device(NULL, dev, 1); { - struct semaphore sem = MUTEX_LOCKED; + DECLARE_MUTEX_LOCKED(sem); SCpnt->request.sem = &sem; scsi_do_cmd(SCpnt, cmd, NULL, 0, scsi_ioctl_done, timeout, retries); spin_unlock_irqrestore(&io_request_lock, flags); @@ -289,7 +289,7 @@ int scsi_ioctl_send_command(Scsi_Device *dev, Scsi_Ioctl_Command *sic) SCpnt = scsi_allocate_device(NULL, dev, 1); { - struct semaphore sem = MUTEX_LOCKED; + DECLARE_MUTEX_LOCKED(sem); SCpnt->request.sem = &sem; scsi_do_cmd(SCpnt, cmd, buf, needed, scsi_ioctl_done, timeout, retries); diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index e32d6f6cf613..c8a37f63a762 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -1183,7 +1183,7 @@ static int sd_init_onedisk(int i) SCpnt->sense_buffer[2] = 0; { - struct semaphore sem = MUTEX_LOCKED; + DECLARE_MUTEX_LOCKED(sem); /* Mark as really busy again */ SCpnt->request.rq_status = RQ_SCSI_BUSY; SCpnt->request.sem = &sem; @@ -1221,7 +1221,7 @@ static int sd_init_onedisk(int i) SCpnt->sense_buffer[2] = 0; { - struct semaphore sem = MUTEX_LOCKED; + DECLARE_MUTEX_LOCKED(sem); /* Mark as really busy again */ SCpnt->request.rq_status = RQ_SCSI_BUSY; SCpnt->request.sem = &sem; @@ -1263,7 +1263,7 @@ static int sd_init_onedisk(int i) SCpnt->sense_buffer[2] = 0; { - struct semaphore sem = MUTEX_LOCKED; + DECLARE_MUTEX_LOCKED(sem); /* Mark as really busy again */ SCpnt->request.rq_status = RQ_SCSI_BUSY; SCpnt->request.sem = &sem; @@ -1444,7 +1444,7 @@ static int sd_init_onedisk(int i) /* same code as READCAPA !! */ { - struct semaphore sem = MUTEX_LOCKED; + DECLARE_MUTEX_LOCKED(sem); SCpnt->request.rq_status = RQ_SCSI_BUSY; /* Mark as really busy again */ SCpnt->request.sem = &sem; scsi_do_cmd (SCpnt, diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index fd63ef0f6045..5457fcac5e93 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -135,7 +135,7 @@ typedef struct sg_fd /* holds the state of a file descriptor */ { struct sg_fd * nextfp; /* NULL when last opened fd on this device */ struct sg_device * parentdp; /* owning device */ - struct wait_queue * read_wait; /* queue read until command done */ + wait_queue_head_t read_wait; /* queue read until command done */ int timeout; /* defaults to SG_DEFAULT_TIMEOUT */ char * fst_buf; /* try to grab SG_SCATTER_SZ sized buffer on open */ int fb_size; /* actual size of allocated fst_buf */ @@ -153,7 +153,7 @@ typedef struct sg_fd /* holds the state of a file descriptor */ typedef struct sg_device /* holds the state of each scsi generic device */ { Scsi_Device * device; - struct wait_queue * generic_wait;/* queue open if O_EXCL on prev. open */ + wait_queue_head_t generic_wait;/* queue open if O_EXCL on prev. open */ int sg_tablesize; /* adapter's max scatter-gather table size */ Sg_fd * headfp; /* first open fd belonging to this device */ kdev_t i_rdev; /* holds device major+minor number */ @@ -988,7 +988,7 @@ static int sg_attach(Scsi_Device * scsidp) SCSI_LOG_TIMEOUT(3, printk("sg_attach: dev=%d \n", k)); sdp->device = scsidp; - sdp->generic_wait = NULL; + init_waitqueue_head(&sdp->generic_wait); sdp->headfp= NULL; sdp->exclude = 0; sdp->merge_fd = 0; /* Cope with SG_DEF_MERGE_FD on open */ diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index d495363c5535..b15966334e63 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c @@ -895,7 +895,7 @@ void get_sectorsize(int i){ /* Do the command and wait.. */ { - struct semaphore sem = MUTEX_LOCKED; + DECLARE_MUTEX_LOCKED(sem); SCpnt->request.sem = &sem; spin_lock_irqsave(&io_request_lock, flags); scsi_do_cmd (SCpnt, diff --git a/drivers/scsi/sr_ioctl.c b/drivers/scsi/sr_ioctl.c index b01ab7f1c029..ed503d5b7b8b 100644 --- a/drivers/scsi/sr_ioctl.c +++ b/drivers/scsi/sr_ioctl.c @@ -64,7 +64,7 @@ retry: if( !scsi_block_when_processing_errors(SDev) ) return -ENODEV; { - struct semaphore sem = MUTEX_LOCKED; + DECLARE_MUTEX_LOCKED(sem); SCpnt->request.sem = &sem; spin_lock_irqsave(&io_request_lock, flags); scsi_do_cmd(SCpnt, diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index c53e2e7908a2..4714213bf2e3 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c @@ -279,7 +279,7 @@ st_do_scsi(Scsi_Cmnd *SCpnt, Scsi_Tape *STp, unsigned char *cmd, int bytes, } cmd[1] |= (SCpnt->lun << 5) & 0xe0; - STp->sem = MUTEX_LOCKED; + init_MUTEX_LOCKED(&STp->sem); SCpnt->use_sg = (bytes > (STp->buffer)->sg[0].length) ? (STp->buffer)->use_sg : 0; if (SCpnt->use_sg) { diff --git a/drivers/video/Config.in b/drivers/video/Config.in index 4ca9e81a0a97..91f7801b1d1d 100644 --- a/drivers/video/Config.in +++ b/drivers/video/Config.in @@ -21,6 +21,9 @@ if [ "$CONFIG_FB" = "y" ]; then if [ "$CONFIG_ARCH_ACORN" = "y" ]; then bool 'Acorn VIDC support' CONFIG_FB_ACORN fi + if [ "$CONFIG_ARCH_NETWINDER" = "y" ]; then + tristate 'Cyber2000 support' CONFIG_FB_CYBER2000 + fi if [ "$CONFIG_APOLLO" = "y" ]; then define_bool CONFIG_FB_APOLLO y fi @@ -177,8 +180,8 @@ if [ "$CONFIG_FB" = "y" ]; then "$CONFIG_FB_VIRGE" = "y" -o "$CONFIG_FB_CYBER" = "y" -o \ "$CONFIG_FB_VALKYRIE" = "y" -o "$CONFIG_FB_PLATINUM" = "y" -o \ "$CONFIG_FB_IGA" = "y" -o "$CONFIG_FB_MATROX" = "y" -o \ - "$CONFIG_FB_CT65550" = "y" -o "$CONFIG_FB_PM2" = "y" -o \ - "$CONFIG_FB_SGIVW" = "y" ]; then + "$CONFIG_FB_CT65550" = "y" -o "$CONFIG_FB_PM2" = "y" -o \ + "$CONFIG_FB_SGIVW" = "y" -o "$CONFIG_FB_CYBER2000" = "y" ]; then define_bool CONFIG_FBCON_CFB8 y else if [ "$CONFIG_FB_ACORN" = "m" -o "$CONFIG_FB_ATARI" = "m" -o \ @@ -191,8 +194,8 @@ if [ "$CONFIG_FB" = "y" ]; then "$CONFIG_FB_VIRGE" = "m" -o "$CONFIG_FB_CYBER" = "m" -o \ "$CONFIG_FB_VALKYRIE" = "m" -o "$CONFIG_FB_PLATINUM" = "m" -o \ "$CONFIG_FB_IGA" = "m" -o "$CONFIG_FB_MATROX" = "m" -o \ - "$CONFIG_FB_CT65550" = "m" -o "$CONFIG_FB_PM2" = "m" -o \ - "$CONFIG_FB_SGIVW" = "m" ]; then + "$CONFIG_FB_CT65550" = "m" -o "$CONFIG_FB_PM2" = "m" -o \ + "$CONFIG_FB_SGIVW" = "m" -o "$CONFIG_FB_CYBER2000" = "m" ]; then define_bool CONFIG_FBCON_CFB8 m fi fi @@ -204,7 +207,8 @@ if [ "$CONFIG_FB" = "y" ]; then "$CONFIG_FB_VIRGE" = "y" -o "$CONFIG_FB_CYBER" = "y" -o \ "$CONFIG_FB_VALKYRIE" = "y" -o "$CONFIG_FB_PLATINUM" = "y" -o \ "$CONFIG_FB_CT65550" = "y" -o "$CONFIG_FB_MATROX" = "y" -o \ - "$CONFIG_FB_PM2" = "y" -o "$CONFIG_FB_SGIVW" = "y" ]; then + "$CONFIG_FB_PM2" = "y" -o "$CONFIG_FB_SGIVW" = "y" -o \ + "$CONFIG_FB_CYBER2000" = "y" ]; then define_bool CONFIG_FBCON_CFB16 y else if [ "$CONFIG_FB_ATARI" = "m" -o "$CONFIG_FB_ATY" = "m" -o \ @@ -214,19 +218,22 @@ if [ "$CONFIG_FB" = "y" ]; then "$CONFIG_FB_CONTROL" = "m" -o "$CONFIG_FB_CLGEN" = "m" -o \ "$CONFIG_FB_VIRGE" = "m" -o "$CONFIG_FB_CYBER" = "m" -o \ "$CONFIG_FB_VALKYRIE" = "m" -o "$CONFIG_FB_PLATINUM" = "m" -o \ - "$CONFIG_FB_CT65550" = "m" -o "$CONFIG_FB_MATROX" = "m" -o \ - "$CONFIG_FB_PM2" = "m" -o "$CONFIG_FB_SGIVW" = "m" ]; then + "$CONFIG_FB_CT65550" = "m" -o "$CONFIG_FB_MATROX" = "m" -o \ + "$CONFIG_FB_PM2" = "y" -o "$CONFIG_FB_SGIVW" = "m" -o \ + "$CONFIG_FB_CYBER2000" = "m" ]; then define_bool CONFIG_FBCON_CFB16 m fi fi if [ "$CONFIG_FB_ATY" = "y" -o "$CONFIG_FB_VIRTUAL" = "y" -o \ "$CONFIG_FB_CLGEN" = "y" -o "$CONFIG_FB_VESA" = "y" -o \ - "$CONFIG_FB_MATROX" = "y" -o "$CONFIG_FB_PM2" = "y" ]; then + "$CONFIG_FB_MATROX" = "y" -o "$CONFIG_FB_PM2" = "y" -o \ + "$CONFIG_FB_CYBER2000" = "y" ]; then define_bool CONFIG_FBCON_CFB24 y else if [ "$CONFIG_FB_ATY" = "m" -o "$CONFIG_FB_VIRTUAL" = "m" -o \ "$CONFIG_FB_CLGEN" = "m" -o "$CONFIG_FB_VESA" = "m" -o \ - "$CONFIG_FB_MATROX" = "m" -o "$CONFIG_FB_PM2" = "m" ]; then + "$CONFIG_FB_MATROX" = "m" -o "$CONFIG_FB_PM2" = "m" -o \ + "$CONFIG_FB_CYBER2000" = "m" ]; then define_bool CONFIG_FBCON_CFB24 m fi fi @@ -323,7 +330,7 @@ if [ "$CONFIG_FB" = "y" ]; then if [ "$CONFIG_AMIGA" = "y" ]; then define_bool CONFIG_FONT_PEARL_8x8 y fi - if [ "$CONFIG_ARM" = "y" ]; then + if [ "$CONFIG_ARM" = "y" -a "$CONFIG_ARCH_ACORN" = "y" ]; then define_bool CONFIG_FONT_ACORN_8x8 y fi fi diff --git a/drivers/video/Makefile b/drivers/video/Makefile index 721a878130ab..28ac786a7464 100644 --- a/drivers/video/Makefile +++ b/drivers/video/Makefile @@ -132,6 +132,14 @@ else endif endif +ifeq ($(CONFIG_FB_CYBER2000),y) +L_OBJS += cyber2000fb.o +else + ifeq ($(CONFIG_FB_CYBER2000),m) + M_OBJS += cyber2000fb.o + endif +endif + ifeq ($(CONFIG_FB_SGIVW),y) L_OBJS += sgivwfb.o else diff --git a/drivers/video/acornfb.c b/drivers/video/acornfb.c index a20259904683..e1bc0857caf8 100644 --- a/drivers/video/acornfb.c +++ b/drivers/video/acornfb.c @@ -1,15 +1,22 @@ /* * linux/drivers/video/acorn.c * - * Copyright (C) 1998 Russell King + * Copyright (C) 1998,1999 Russell King * * Frame buffer code for Acorn platforms + * + * NOTE: Most of the modes with X!=640 will disappear shortly. + * NOTE: Startup setting of HS & VS polarity not supported. + * (do we need to support it if we're coming up in 640x480?) */ + +#include #include #include #include #include #include +#include #include #include #include @@ -21,49 +28,846 @@ #include #include +#include