From: Paul M. <le...@us...> - 2002-04-21 20:02:45
|
Update of /cvsroot/linux-mips/linux/drivers/sgi/char In directory usw-pr-cvs1:/tmp/cvs-serv3535/drivers/sgi/char Modified Files: graphics.c sgiserial.c shmiq.c streamable.c Log Message: More OSS syncing.. Index: graphics.c =================================================================== RCS file: /cvsroot/linux-mips/linux/drivers/sgi/char/graphics.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- graphics.c 2 Jan 2002 20:42:12 -0000 1.3 +++ graphics.c 21 Apr 2002 20:01:15 -0000 1.4 @@ -196,6 +196,7 @@ int board = GRAPHICS_CARD (inode->i_rdev); /* Tell the rendering manager that one client is going away */ + lock_kernel(); rrm_close (inode, file); /* Was this file handle from the board owner?, clear it */ @@ -205,6 +206,7 @@ (*cards [board].g_reset_console)(); enable_gconsole (); } + unlock_kernel(); return 0; } Index: sgiserial.c =================================================================== RCS file: /cvsroot/linux-mips/linux/drivers/sgi/char/sgiserial.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- sgiserial.c 30 Nov 2001 18:34:10 -0000 1.4 +++ sgiserial.c 21 Apr 2002 20:01:15 -0000 1.5 @@ -1239,7 +1239,7 @@ tmp.close_delay = info->close_delay; tmp.closing_wait = info->closing_wait; tmp.custom_divisor = info->custom_divisor; - return copy_to_user(retinfo,&tmp,sizeof(*retinfo)); + return copy_to_user(retinfo,&tmp,sizeof(*retinfo)) ? -EFAULT : 0; } static int set_serial_info(struct sgi_serial * info, @@ -1875,7 +1875,11 @@ memset(&serial_driver, 0, sizeof(struct tty_driver)); serial_driver.magic = TTY_DRIVER_MAGIC; +#ifdef CONFIG_DEVFS_FS + serial_driver.name = "tts/%d"; +#else serial_driver.name = "ttyS"; +#endif serial_driver.major = TTY_MAJOR; serial_driver.minor_start = 64; serial_driver.num = NUM_CHANNELS; @@ -1911,7 +1915,11 @@ * major number and the subtype code. */ callout_driver = serial_driver; +#ifdef CONFIG_DEVFS_FS + callout_driver.name = "cua/%d"; +#else callout_driver.name = "cua"; +#endif callout_driver.major = TTYAUX_MAJOR; callout_driver.subtype = SERIAL_TYPE_CALLOUT; Index: shmiq.c =================================================================== RCS file: /cvsroot/linux-mips/linux/drivers/sgi/char/shmiq.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- shmiq.c 2 Jan 2002 20:42:12 -0000 1.3 +++ shmiq.c 21 Apr 2002 20:01:15 -0000 1.4 @@ -79,10 +79,8 @@ /* /dev/qcntlN attached memory regions, location and size of the event queue */ static struct { - int opened; + int opened; /* if this device has been opened */ void *shmiq_vaddr; /* mapping in kernel-land */ - spinlock_t shmiq_lock; - /* protects vaddr and opened */ int tail; /* our copy of the shmiq->tail */ int events; int mapped; @@ -330,11 +328,12 @@ size = vma->vm_end - vma->vm_start; start = vma->vm_start; - mem = vmalloc_uncached(size); - if (!mem) + lock_kernel(); + mem = (unsigned long) shmiqs [minor].shmiq_vaddr = vmalloc_uncached (size); + if (!mem) { + unlock_kernel(); return -EINVAL; - spin_lock(&shmiqs [minor].shmiq_lock); - shmiqs[minor].shmiq_vaddr = mem; + } /* Prevent the swapper from considering these pages for swap and touching them */ vma->vm_flags |= (VM_SHM | VM_LOCKED | VM_IO); @@ -343,12 +342,13 @@ /* Uncache the pages */ vma->vm_page_prot = PAGE_USERIO; + error = vmap_page_range (vma->vm_start, size, mem); shmiqs [minor].tail = 0; /* Init the shared memory input queue */ - spin_unlock( &shmiqs [minor].shmiq_lock ); memset (shmiqs [minor].shmiq_vaddr, 0, size); - error = vmap_page_range (vma->vm_start, size, mem); + unlock_kernel(); + return error; } @@ -393,16 +393,13 @@ minor--; if (minor > MAX_SHMI_QUEUES) return -EINVAL; - spin_lock( &shmiqs [minor].shmiq_lock ); if (shmiqs [minor].opened) - { - spin_unlock( &shmiqs [minor].shmiq_lock ); return -EBUSY; - } + lock_kernel (); shmiqs [minor].opened = 1; shmiqs [minor].shmiq_vaddr = 0; - spin_unlock( &shmiqs [minor].shmiq_lock ); + unlock_kernel (); return 0; } @@ -432,13 +429,10 @@ if (minor > MAX_SHMI_QUEUES) return -EINVAL; - - spin_lock( &shmiqs [minor].shmiq_lock ); - if (shmiqs [minor].opened == 0) { - spin_unlock( &shmiqs [minor].shmiq_lock ); + if (shmiqs [minor].opened == 0) return -EINVAL; - } + lock_kernel (); shmiq_qcntl_fasync (-1, filp, 0); shmiqs [minor].opened = 0; shmiqs [minor].mapped = 0; @@ -446,7 +440,7 @@ shmiqs [minor].fasync = 0; vfree (shmiqs [minor].shmiq_vaddr); shmiqs [minor].shmiq_vaddr = 0; - spin_unlock( &shmiqs [minor].shmiq_lock ); + unlock_kernel (); return 0; } Index: streamable.c =================================================================== RCS file: /cvsroot/linux-mips/linux/drivers/sgi/char/streamable.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- streamable.c 2 Jan 2002 20:42:12 -0000 1.1 +++ streamable.c 21 Apr 2002 20:01:15 -0000 1.2 @@ -1,14 +1,16 @@ -/* +/* $Id$ + * * streamable.c: streamable devices. /dev/gfx * (C) 1997 Miguel de Icaza (mi...@nu...) * * Major 10 is the streams clone device. The IRIX Xsgi server just * opens /dev/gfx and closes it inmediately. + * */ + #include <linux/fs.h> #include <linux/miscdevice.h> #include <linux/sched.h> -#include <linux/tty.h> #include <linux/kbd_kern.h> #include <linux/vt_kern.h> #include <linux/smp_lock.h> @@ -219,7 +221,9 @@ static int sgi_mouse_close (struct inode *inode, struct file *filp) { + lock_kernel(); mouse_opened = 0; + unlock_kernel(); return 0; } |