🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #192

Re: Use of SuperState() call

#192
From: Bryce Nesbitt
Date: Tue, 27 Jun 1989 02:26
81 lines
2981 bytes
In article <10975@behemoth.phx.mcd.mot.com> mph@behemoth.UUCP (Mark Huth) writes:
>start:
>	movem.l d0-d7/a0-a6,-(a7)	save regs
>	movea.l AbsExecBase.w,a6	sets exec lib base register
>	callsys SuperState		get into supervisor mode
>	moveq.l #CacheOff,d1		constant to disable cache
>	movec   d1,cacr			write it to the cache control reg
>	callsys UserState
>	movem.l (a7)+,d0-d7/a0-a6
>	rts
>
>
>This program reliably gurus - 3 or 4, don't remember....
>...Is there a secret that I'm missing?

Yes.  The UserState() function does not work on 68010 or 68020 systems.
This is documented in more recent Exec autodocs.  The next revision of
the SetPatch program will fix this bug.

Use the Supervisor() function instead.  Supervisor will trap to a
short super-level exception function:

	...
	movea.l AbsExecBase.w,a6	sets exec lib base register
	lea.l	SuperCode(pc),a5
	moveq.l #CacheOff,d1		constant to disable cache
	callsys	Supervisor
	...

SuperCode:
	movec   d1,cacr			write it to the cache control reg
	rte





****************************************************************************
		New, official documentation for Exec call.  Works 
		and is blessed for use under all revisions of Amiga Kickstart
****************************************************************************


exec.library/Supervisor 			     exec.library/Supervisor

   NAME
	Supervisor -- trap to a short supervisor mode function

   SYNOPSIS
	result = Supervisor(userFunc)
	Rx                   A5
	ULONG Supervisor(void *);

   FUNCTION
	Execute a short assembly language function in the supervisor mode
	of the processor.  Supervisor() does not modify or save registers;
	the user function has full access to the register set.   All rules
	that apply to interrupt code must be followed.  In addition, no system
	calls are permitted.  The function must end with an RTE instruction.

   EXAMPLE
		;Obtain the Exception Vector base.  68010 or greater only!
		MOVECtrap:	movec.l	VBR,d0	;$4e7a,$0801
				rte

   INPUTS
	userFunc - A pointer to a short assembly language function ending
		  in RTE.  The function has full access to the register set.

   RESULTS
	result   - Whatever values the userFunc left in the registers.

   SEE ALSO
	SuperState/UserState

-- 
|\_/|  . ACK!, NAK!, EOT!, SOH!
{O o} .     Bryce Nesbitt, Commodore-Amiga, Inc.
 (")        BIX: bnesbitt
  U	    USENET: cbmvax!bryce@uunet.uu.NET -or- rutgers!cbmvax!bryce
Lawyers: America's untapped export market.
Technical Details
Message-ID: <7137@cbmvax.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!oliveb!amiga!cbmvax!bryce
References: <10975@behemoth.phx.mcd.mot.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!oliveb!amiga!cbmvax!bryce
From: bryce@cbmvax.UUCP (Bryce Nesbitt)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Use of SuperState() call
Keywords: supervisor guru
Message-ID: <7137@cbmvax.UUCP>
Date: 27 Jun 89 02:26:19 GMT
References: <10975@behemoth.phx.mcd.mot.com>
Reply-To: bryce@cbmvax.UUCP (Bryce Nesbitt)
Organization: Commodore Technology, West Chester, PA
Lines: 81