On 11/11/19 3:08 am, Samuel Thibault wrote:
> Samuel Thibault, le dim. 10 nov. 2019 16:25:22 +0100, a ecrit:
>> Samuel Thibault, le dim. 10 nov. 2019 16:22:04 +0100, a ecrit:
>>> Ok, I have restored some of the mask/unmask_irq, so that curr_pic_mask
>>> will still exist, but without the notion of spl: it will just store
>>> which IRQs have been effectively disabled. That'll already be good for a
>>> first step :)
>>
>> And we'll have to rethink this all against edge/level-triggered
>> interrupts etc. for the interface for userlevel interrupts.
> 
> (what was happening with netdde is that the interrupt kept raising again
> and again, thus never returning from interrupt handling.  That's why I
> had to restore the code that can mask an interrupt)

See attached patch that fixes the hang with current master when applying
netdde patches and trying to bring up /dev/eth0.

Cheers,
Damien
>From 1dc2aedc175fdc5297eab566820ff26e664e4eca Mon Sep 17 00:00:00 2001
From: Damien Zammit <dam...@zamaudio.com>
Date: Mon, 11 Nov 2019 21:04:47 +1100
Subject: [PATCH] Fix unmasking curr_pic_mask only irqs

---
 i386/i386at/interrupt.S | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/i386/i386at/interrupt.S b/i386/i386at/interrupt.S
index 9f159c5c..3afebc86 100644
--- a/i386/i386at/interrupt.S
+++ b/i386/i386at/interrupt.S
@@ -51,8 +51,9 @@ ENTRY(interrupt)
 	jl	1f			/* no, skip it */
 	outb	%al,$(PIC_SLAVE_ICW)
 1:
-	movb	$0,%al			/* empty mask */
+	movl	EXT(curr_pic_mask),%eax	/* PIC mask to restore */
 	outb	%al,$(PIC_MASTER_OCW)	/* unmask master */
+	movb	%ah,%al			/* shuffle byte */
 	outb	%al,$(PIC_SLAVE_OCW)	/* unmask slave */
 	ret				/* return */
 END(interrupt)
-- 
2.23.0

Reply via email to