The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: bqt@update.uu.se (Johnny Billquist)
Subject: [TUHS] PDP-11/70 SPL
Date: Mon, 28 Mar 2016 01:07:42 +0200	[thread overview]
Message-ID: <56F867BE.2080807@update.uu.se> (raw)
In-Reply-To: <mailman.171.1459115387.15972.tuhs@minnie.tuhs.org>

On 2016-03-27 23:49, jnc at mercury.lcs.mit.edu  (Noel Chiappa) wrote:
>
>      > From: Johnny Billquist
>
>      > It would also be interesting if anyone can come up with a good reason
>      > why SPL should work that way.
>
> So that when doing:
>
> 	SPL	0
> 	WAIT
>
> you don't lose by having the interrupt happen between the SPL and the WAIT?

Hmm. A good point. If you depend on WAIT waking you up at an interrupt, 
then you need SPL to block here. But this also means that you must be at 
SPL 7 before any of this, otherwise you are still exposed to this 
problem (nothing says that the interrupt won't happen before the SPL as 
well).

In general, I would say that this is not the way I would write code, but 
checking in RSX and 2.11BSD I can tell that RSX do not use this pattern, 
and does a WAIT without any SPL, while 2.11BSD do an SPL 0 followed by 
WAIT. And the routine in 2.11BSD is also called at SPL 7.

So obviously, both ways have been done, and 2.11BSD will work 
potentially with a slight degration if the SPL do not block interrupts. 
It will still work fine, as you will, at a minimum, get an interrupt at 
the next clock tick, which will wake it up. But it might possibly be 
sitting in a WAIT slightly longer than required.

RSX in fact just loops after the WAIT. If an interrupt should cause the 
system to be able to do something more productive, it will not return to 
the idle loop. So yes, it also detects in the interrupt exit processing, 
that it was/is in the idle loop.

I still haven't had time to investigate properly. But at least processor 
and chip manuals do not say that SPL will block interrupts. But that is 
no guarantee that it don't in reality.

	Johnny

-- 
Johnny Billquist                  || "I'm on a bus
                                   ||  on a psychedelic trip
email: bqt at softjar.se             ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol


       reply	other threads:[~2016-03-27 23:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.171.1459115387.15972.tuhs@minnie.tuhs.org>
2016-03-27 23:07 ` Johnny Billquist [this message]
2016-03-28 13:37   ` Dave Horsfall
2016-03-28 15:18     ` John Cowan
2016-03-28 13:43 Noel Chiappa
2016-03-28 14:18 Noel Chiappa
2016-03-28 14:44 ` Johnny Billquist
     [not found]   ` <0BAE4C73-C72B-453E-BEBD-EA34CEEA9853@uwlax.edu>
2016-03-28 16:37     ` Johnny Billquist
2016-03-28 16:52       ` Milo Velimirović

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56F867BE.2080807@update.uu.se \
    --to=bqt@update.uu.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).