Subject: Re: changed files: 'src/sys/arch/i386/i386 mem.c'
To: Charles Hannum <mycroft@sun-lamp.cs.berkeley.edu>
From: None <Mark_Weaver@brown.edu>
List: current-users
Date: 04/27/1994 21:31:59
> From: Charles Hannum <mycroft@sun-lamp.cs.berkeley.edu>
> Sender: owner-source-changes@sun-lamp.cs.berkeley.edu
> Date: Tue, 26 Apr 1994 20:53:32 -0700
> 
> Update of /b/source/CVS/src/sys/arch/i386/i386
> In directory sun-lamp.cs.berkeley.edu:/d/users/mycroft/src/sys/arch/i386/i386
> 
> Modified Files:
> 	mem.c 
> Log Message:
> Fix mmopen() and mmclose().

This change broke XFree86 for me, at least for my preliminary version
of R6 (which has virtually identical i386-specific stuff to 2.1).

When launching, X immediately receives a SIGBUS then a SIGSEGV, and
leaves the console in an unusable state (although it hasn't changed
mode at all).

Undoing the change you made to this file to 940427's kernel fixed the
problem.  940425's kernel worked fine for me.  The sup tree wasn't
updated for 940426, so I don't know about that.

Here's the patch to fix 940427.

	Mark
--------------------------------------------------------------------
Email: Mark_Weaver@brown.edu           | Brown University
PGP Key: finger mhw@cs.brown.edu       | Dept of Computer Science


diff -c  src/sys/arch/i386/i386/mem.c.mhw1 src/sys/arch/i386/i386/mem.c
*** src/sys/arch/i386/i386/mem.c.mhw1	Wed Apr 27 06:17:40 1994
--- src/sys/arch/i386/i386/mem.c	Wed Apr 27 21:17:59 1994
***************
*** 38,44 ****
   *
   *	from: Utah Hdr: mem.c 1.13 89/10/08
   *	from: @(#)mem.c 7.2 (Berkeley) 5/9/91
!  *	$Id: mem.c,v 1.17 1994/04/27 03:53:29 mycroft Exp $
   */
  
  /*
--- 38,44 ----
   *
   *	from: Utah Hdr: mem.c 1.13 89/10/08
   *	from: @(#)mem.c 7.2 (Berkeley) 5/9/91
!  *	$Id: mem.c,v 1.16 1994/04/25 06:17:30 mycroft Exp $
   */
  
  /*
***************
*** 61,75 ****
  extern        char *vmmap;            /* poor name! */
  
  /*ARGSUSED*/
! int
! mmclose(dev, flag, mode)
  	dev_t dev;
! 	int flag, mode;
  {
  
  	switch (minor(dev)) {
  	case 0:
! 		if (flag & FWRITE) {
  			struct trapframe *fp;
  			fp = (struct trapframe *)curproc->p_regs;
  			fp->tf_eflags &= ~PSL_IOPL;
--- 61,75 ----
  extern        char *vmmap;            /* poor name! */
  
  /*ARGSUSED*/
! mmclose(dev, uio, mode)
  	dev_t dev;
! 	struct uio *uio;
! 	int mode;
  {
  
  	switch (minor(dev)) {
  	case 0:
! 		if (mode & FWRITE) {
  			struct trapframe *fp;
  			fp = (struct trapframe *)curproc->p_regs;
  			fp->tf_eflags &= ~PSL_IOPL;
***************
*** 82,96 ****
  }
  
  /*ARGSUSED*/
! int
! mmopen(dev, flag, mode)
  	dev_t dev;
! 	int flag, mode;
  {
  
  	switch (minor(dev)) {
  	case 0:
! 		if (flag & FWRITE) {
  			struct trapframe *fp;
  			fp = (struct trapframe *)curproc->p_regs;
  			fp->tf_eflags |= PSL_IOPL;
--- 82,96 ----
  }
  
  /*ARGSUSED*/
! mmopen(dev, uio, mode)
  	dev_t dev;
! 	struct uio *uio;
! 	int mode;
  {
  
  	switch (minor(dev)) {
  	case 0:
! 		if (mode & FWRITE) {
  			struct trapframe *fp;
  			fp = (struct trapframe *)curproc->p_regs;
  			fp->tf_eflags |= PSL_IOPL;

------------------------------------------------------------------------------