Subject: Re: Access to m68k SR from userland?
To: Hauke Fath <saw@sun0.urz.uni-heidelberg.de>
From: John P. Wittkoski <jpw@insoft.com>
List: port-mac68k
Date: 06/12/1996 09:51:04
On Wed, 12 Jun 1996, Hauke Fath wrote:

> is it possible to move the CPU to supervisor mode and/or access the
> interrupt mask in reg 'SR' from userland code? If so, how?

No. The user can force a change to supervisor mode only by reset, a-trap,
or indirectly through an interrupt. (There are a few other similar methods,
but I don't have the data book right here.) There is no way for the user 
to directly write to the supervisor parts of the SR to change the interrupt
level.

> I am trying polled data transfers on the SWIM and have to block all
> interrupts while reading.

One thing I found useful when I started trying to write code for the ADB
support that uses the hardware directly: Do the initial work in MacOS. From
there, you are in supervisor mode all the time and have access to all the
hardware. The big drawback: Sometimes your code interfers with the MacOS
itself, which may be  writing to the same chip at the same time if you 
aren't careful.

Later,
	--John

--
--------------------------------------------------------------
 John Wittkoski				InSoft, Inc.
 Senior Systems Engineer                Phone: (717) 730-9501
 Email: jpw@insoft.com                  Fax  : (717) 730-9504
--------------------------------------------------------------