Subject: Re: Recent serial port problems
To: None <port-i386@NetBSD.ORG>
From: Charles Hannum <Charles-Hannum@deshaw.com>
List: port-i386
Date: 01/06/1996 16:52:07
Could people who have been having problems with serial ports `locking
up' please try the following patch, and let me know whether or not it
fixes your problems?


Index: i386/locore.s
===================================================================
RCS file: /a/cvsroot/src/sys/arch/i386/i386/locore.s,v
retrieving revision 1.140
diff -c -2 -r1.140 locore.s
*** locore.s	1995/10/24 16:27:54	1.140
--- locore.s	1996/01/06 21:43:24
***************
*** 102,107 ****
  	movl	%ax,%ds		; \
  	movl	%ax,%es
- #define	INTREXIT \
- 	jmp	_Xdoreti
  #define	INTRFASTEXIT \
  	popl	%es		; \
--- 102,105 ----
***************
*** 1878,1882 ****
  	call	_npxintr
  	addl	$4,%esp
! 	INTREXIT
  #else
  	ZTRAP(T_ARITHTRAP)
--- 1876,1880 ----
  	call	_npxintr
  	addl	$4,%esp
! 	INTRFASTEXIT
  #else
  	ZTRAP(T_ARITHTRAP)
Index: isa/icu.s
===================================================================
RCS file: /a/cvsroot/src/sys/arch/i386/isa/icu.s,v
retrieving revision 1.43
diff -c -2 -r1.43 icu.s
*** icu.s	1995/10/11 04:20:31	1.43
--- icu.s	1996/01/06 21:43:27
***************
*** 106,110 ****
  	jmp	*_Xresume(,%eax,4)
  2:	/* Check for ASTs on exit to user mode. */
- 	cli
  	cmpb	$0,_astpending
  	je	3f
--- 106,109 ----
Index: isa/vector.s
===================================================================
RCS file: /a/cvsroot/src/sys/arch/i386/isa/vector.s,v
retrieving revision 1.29
diff -c -2 -r1.29 vector.s
*** vector.s	1995/05/08 18:00:20	1.29
--- vector.s	1996/01/06 21:43:34
***************
*** 89,99 ****
  	outb	%al,$(icu+1)
  #define	UNMASK(irq_num, icu) \
- 	cli								;\
  	movb	_imen + IRQ_BYTE(irq_num),%al				;\
  	andb	$~IRQ_BIT(irq_num),%al					;\
  	movb	%al,_imen + IRQ_BYTE(irq_num)				;\
  	FASTER_NOP							;\
! 	outb	%al,$(icu+1)						;\
! 	sti
  
  #else /* ICU_HARDWARE_MASK */
--- 89,97 ----
  	outb	%al,$(icu+1)
  #define	UNMASK(irq_num, icu) \
  	movb	_imen + IRQ_BYTE(irq_num),%al				;\
  	andb	$~IRQ_BIT(irq_num),%al					;\
  	movb	%al,_imen + IRQ_BYTE(irq_num)				;\
  	FASTER_NOP							;\
! 	outb	%al,$(icu+1)
  
  #else /* ICU_HARDWARE_MASK */
***************
*** 235,240 ****
  	jnz	7b							;\
  	STRAY_TEST			/* see if it's a stray */	;\
! 5:	UNMASK(irq_num, icu)		/* unmask it in hardware */	;\
! 	INTREXIT			/* lower spl and do ASTs */	;\
  IDTVEC(stray/**/irq_num)						;\
  	pushl	$irq_num						;\
--- 254,260 ----
  	jnz	7b							;\
  	STRAY_TEST			/* see if it's a stray */	;\
! 5:	cli				/* hold interrupts */		;\
! 	UNMASK(irq_num, icu)		/* unmask it in hardware */	;\
! 	jmp	_Xdoreti		/* lower spl and do ASTs */	;\
  IDTVEC(stray/**/irq_num)						;\
  	pushl	$irq_num						;\