Plan 9 from Bell Labs’s /usr/web/sources/extra/9hist/gnot/l.s

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


## diffname gnot/l.s 1990/03091
## diff -e /dev/null /n/bootesdump/1990/03091/sys/src/9/68020/l.s
0a
#include "mem.h"

/*
 * Boot first processor
 */
TEXT	start(SB), $-4

	MOVW	$(SUPER|SPL(7)), SR
	MOVL	$0, R0
	MOVL	R0, CACR
	MOVL	R0, TACADDR
	MOVL	$a6base(SB), A6

	MOVL	$mach0(SB), A0
	MOVL	A0, m(SB)
	MOVL	$0, 0(A0)
	MOVL	A0, A7
	ADDL	$(MACHSIZE-4), A7
	MOVL	$0, u(SB)

	MOVL	$vectors(SB), A0
	MOVL	A0, VBR

	BSR	main(SB)
	/* never returns */
dead:
	BRA	dead

/*
 * Take first processor into user mode
 */

TEXT	touser(SB), $-4

	MOVL	$(USERADDR+BY2PG), A7
	MOVW	$0, -(A7)
	MOVL	$(UTZERO+32), -(A7)	/* header is in text */
	MOVW	$0, -(A7)
	MOVL	$(USTKTOP-4*BY2WD), A0
	MOVL	A0, USP
	MOVW	$(SUPER|SPL(0)), SR
	MOVL	$8, R0
	MOVL	R0, CACR
	RTE

TEXT	splhi(SB), $0

	MOVL	$0, R0
	MOVW	SR, R0
	MOVW	$(SUPER|SPL(7)), SR
	RTS

TEXT	spllo(SB), $0

	MOVL	$0, R0
	MOVW	SR, R0
	MOVW	$(SUPER|SPL(0)), SR
	RTS

TEXT	splx(SB), $0

	MOVL	sr+0(FP), R0
	MOVW	R0, SR
	RTS


TEXT	flushcpucache(SB), $0

	MOVL	$(CCLEAR|CENABLE), R0
	MOVL	R0, CACR
	RTS

TEXT	setlabel(SB), $0

	MOVL	sr+0(FP), A0
	MOVL	A7, (A0)+		/* stack pointer */
	MOVL	(A7), (A0)+		/* pc of caller */
	MOVW	SR, (A0)+		/* status register */
	CLRL	R0			/* ret 0 => not returning */
	RTS

TEXT	gotolabel(SB), $0

	MOVL	p+0(FP), A0
	MOVW	$(SUPER|SPL(7)), SR
	MOVL	(A0)+, A7		/* stack pointer */
	MOVL	(A0)+, (A7)		/* pc; stuff into stack frame */
	MOVW	(A0)+, R0		/* status register */
	MOVW	R0, SR
	MOVL	$1, R0			/* ret 1 => returning */
	RTS

/*
 * Test and set, as a subroutine
 */

TEXT	tas(SB), $0

	MOVL	$0, R0
	MOVL	a+0(FP), A0
	TAS	(A0)
	BEQ	tas_1
	MOVL	$1, R0
tas_1:
	RTS

TEXT	illegal(SB), $0

	SUBL	$((8+8+1)*BY2WD), A7
	MOVEM	$0xFFFF, (A7)
	MOVL	$a6base(SB), A6
	MOVL	USP, A0
	MOVL	A0, ((8+8)*BY2WD)(A7)
	MOVL	A7, -(A7)
	BSR	trap(SB)
	ADDL	$4, A7
	MOVL	((8+8)*BY2WD)(A7), A0
	MOVL	A0, USP
	MOVEM	(A7), $0xFFFF
	ADDL	$((8+8+1)*4), A7
	RTE

TEXT	systrap(SB), $0

	SUBL	$((8+8+1)*BY2WD), A7
	MOVL	A6, ((8+6)*BY2WD)(A7)
	MOVL	R0, (A7)
	MOVL	$a6base(SB), A6
	MOVL	USP, A0
	MOVL	A0, ((8+8)*BY2WD)(A7)
	MOVL	A7, -(A7)
	BSR	syscall(SB)
	MOVL	((1+8+8)*BY2WD)(A7), A0
	MOVL	A0, USP
	MOVL	((1+8+6)*BY2WD)(A7), A6
	ADDL	$((1+8+8+1)*4), A7
	RTE

TEXT	buserror(SB), $0

	SUBL	$((8+8+1)*BY2WD), A7
	MOVEM	$0xFFFF, (A7)
	MOVL	$a6base(SB), A6
	MOVL	USP, A0
	MOVL	A0, ((8+8)*BY2WD)(A7)
	PEA	((8+8+1+2)*BY2WD)(A7)
	PEA	4(A7)
	BSR	fault(SB)
	ADDL	$8, A7
	MOVL	((8+8)*BY2WD)(A7), A0
	MOVL	A0, USP
	MOVEM	(A7), $0xFFFF
	ADDL	$((8+8+1)*4), A7
	RTE

TEXT	tacintr(SB), $0			/* level 1 */

	MOVL	R0, -(A7)
	MOVL	TACADDR, R0
	ADDL	$4, A7
	RTE

TEXT	dkintr(SB), $0			/* level 2 */

	SUBL	$((8+8+1)*BY2WD), A7
	MOVEM	$0xFFFF, (A7)
	MOVL	$a6base(SB), A6
	MOVL	USP, A0
	MOVL	A0, ((8+8)*BY2WD)(A7)
	MOVL	A7, -(A7)
	BSR	inconintr(SB)
	ADDL	$4, A7
	MOVL	((8+8)*BY2WD)(A7), A0
	MOVL	A0, USP
	MOVEM	(A7), $0xFFFF
	ADDL	$((8+8+1)*4), A7
	RTE

TEXT	mouseintr(SB), $0		/* level 4 */

	MOVEM	$0x8082, -(A7)		/* D0, A0, A6 */
	MOVL	$a6base(SB), A6
	MOVL	$15, R0			/* mask off hex switch */
	ANDB	MOUSE,R0		/* clears quadrature interrupt */
	LEA	mousetab(SB)(R0.W*8), A0
#ifdef asdf
	MOVL	(A0)+, R0
	ADDL	R0, mousedx(SB)
	MOVL	(A0), R0
	ADDL	R0, mousedy(SB)
	ADDL	$1, mousechanged(SB)
	ADDL	$1, dotrack(SB)
#endif
	MOVEM	(A7)+, $0x4101
	RTE

TEXT	uartintr(SB), $0		/* level 5 */

	SUBL	$((8+8+1)*BY2WD), A7
	MOVEM	$0xFFFF, (A7)
	MOVL	$a6base(SB), A6
	MOVL	USP, A0
	MOVL	A0, ((8+8)*BY2WD)(A7)
	MOVL	A7, -(A7)
	BSR	duartintr(SB)
	ADDL	$4, A7
	MOVL	((8+8)*BY2WD)(A7), A0
	MOVL	A0, USP
	MOVEM	(A7), $0xFFFF
	ADDL	$((8+8+1)*4), A7
	RTE

TEXT	syncintr(SB), $0		/* level 6 */

	SUBL	$((8+8+1)*BY2WD), A7
	MOVEM	$0xFFFF, (A7)
	MOVL	$a6base(SB), A6
	MOVL	USP, A0
	MOVL	A0, ((8+8)*BY2WD)(A7)
	MOVL	A7, -(A7)
	BSR	clock(SB)
	ADDL	$4, A7
	MOVL	((8+8)*BY2WD)(A7), A0
	MOVL	A0, USP
	MOVEM	(A7), $0xFFFF
	ADDL	$((8+8+1)*4), A7
	RTE

GLOBL	mousetab(SB), $128
DATA	mousetab+  0(SB)/4, -1		/* x down,        */
DATA	mousetab+  4(SB)/4,  1		/*         y up   */
DATA	mousetab+  8(SB)/4,  0		/* x -            */
DATA	mousetab+ 12(SB)/4,  1		/*         y up   */
DATA	mousetab+ 16(SB)/4,  1		/* x up           */
DATA	mousetab+ 20(SB)/4,  1		/*         y up   */
DATA	mousetab+ 24(SB)/4,  0		/* x  -           */
DATA	mousetab+ 28(SB)/4,  1		/*         y up   */
DATA	mousetab+ 32(SB)/4, -1		/* x down         */
DATA	mousetab+ 36(SB)/4,  0		/*         y -    */
DATA	mousetab+ 40(SB)/4,  0		/* x -            */
DATA	mousetab+ 44(SB)/4,  0		/*         y -    */
DATA	mousetab+ 48(SB)/4,  1		/* x up,          */
DATA	mousetab+ 52(SB)/4,  0		/*         y -    */
DATA	mousetab+ 56(SB)/4,  0		/* x -            */
DATA	mousetab+ 60(SB)/4,  0		/*         y -    */
DATA	mousetab+ 64(SB)/4, -1		/* x down         */
DATA	mousetab+ 68(SB)/4, -1		/*         y down */
DATA	mousetab+ 72(SB)/4,  0		/* x -            */
DATA	mousetab+ 76(SB)/4, -1		/*         y down */
DATA	mousetab+ 80(SB)/4,  1		/* x up           */
DATA	mousetab+ 84(SB)/4, -1		/*         y down */
DATA	mousetab+ 88(SB)/4,  0		/* x -            */
DATA	mousetab+ 92(SB)/4, -1		/*         y down */
DATA	mousetab+ 96(SB)/4, -1		/* x down         */
DATA	mousetab+100(SB)/4,  0		/*         y -    */
DATA	mousetab+104(SB)/4,  0		/* x -            */
DATA	mousetab+108(SB)/4,  0		/*         y -    */
DATA	mousetab+112(SB)/4,  1		/* x up           */
DATA	mousetab+116(SB)/4,  0		/*         y -    */
DATA	mousetab+120(SB)/4,  0		/* x -            */
DATA	mousetab+124(SB)/4,  0		/*         y -    */

GLOBL	mach0+0(SB), $MACHSIZE
GLOBL	u(SB), $4
GLOBL	m(SB), $4
.
## diffname gnot/l.s 1990/0504
## diff -e /n/bootesdump/1990/03091/sys/src/9/68020/l.s /n/bootesdump/1990/0504/sys/src/9/68020/l.s
190,194c
	ADDL	R0, (A1)+		/* dy */
	ADDL	$1, (A1)		/* track */
	MOVEM	(A7)+, $0x4301
.
188c
	ADDL	R0, (A1)+		/* dx */
.
186c
	LEA	mouse(SB), A1
.
181c
	MOVEM	$0x80C2, -(A7)		/* D0, A0, A1, A6 */
.
## diffname gnot/l.s 1990/0705
## diff -e /n/bootesdump/1990/0504/sys/src/9/68020/l.s /n/bootesdump/1990/0705/sys/src/9/68020/l.s
160c
	MOVL	(A7)+, R0
.
18c
	ADDL	$(MACHSIZE-4), A7	/* start stack under machine struct */
.
11,12c
	MOVL	R0, TACADDR		/* zero tac counter (cause an intr?) */
.
8a
	MOVL	$a6base(SB), A6
.
## diffname gnot/l.s 1990/0816
## diff -e /n/bootesdump/1990/0705/sys/src/9/68020/l.s /n/bootesdump/1990/0816/sys/src/9/68020/l.s
106a
TEXT	rfnote(SB), $0

	MOVL	uregpp+0(FP), A0
	MOVL	(A0), A7
	MOVL	A7, -(A7)
	MOVL	((1+8+8)*BY2WD)(A7), A0
	MOVL	A0, USP
	MOVL	((1+8+6)*BY2WD)(A7), A6
	ADDL	$((1+8+8+1)*4), A7
	RTE

.
## diffname gnot/l.s 1990/08163
## diff -e /n/bootesdump/1990/0816/sys/src/9/68020/l.s /n/bootesdump/1990/08163/sys/src/9/68020/l.s
106a
/*
 * Floating point
 */

TEXT	fpsave(SB), $0

	FSAVE	(fp+0(FP))
	RTS

TEXT	fprestore(SB), $0

	FRESTORE	(fp+0(FP))
	RTS

TEXT	fpregsave(SB), $0

	FMOVEM	$0xFF, (3*4)(fr+0(FP))
	FMOVEMC	$0x7, (fr+0(FP))
	RTS

TEXT	fpregrestore(SB), $0

	FMOVEMC	(fr+0(FP)), $0x7
	FMOVEM	(3*4)(fr+0(FP)), $0xFF
	RTS

TEXT	fpcr(SB), $0

	MOVL	new+0(FP), R1
	MOVL	FPCR, R0
	MOVL	R1, FPCR
	RTS


.
## diffname gnot/l.s 1990/08272
## diff -e /n/bootesdump/1990/08163/sys/src/9/68020/l.s /n/bootesdump/1990/08272/sys/src/9/68020/l.s
268c
	MOVEM	(A7), $0x7FFF
.
259c
	MOVEM	$0x7FFF, (A7)
.
252c
	MOVEM	(A7), $0x7FFF
.
243c
	MOVEM	$0x7FFF, (A7)
.
220c
	MOVEM	(A7), $0x77FFF
.
211c
	MOVEM	$0x7FFF, (A7)
.
197c
	MOVEM	(A7), $0x7FFF
.
187c
	MOVEM	$0x7FFF, (A7)
.
164,165c
	MOVEM	(A7), $0x7FFF
	ADDL	$((8+8+1)*BY2WD), A7
.
155c
	MOVEM	$0x7FFF, (A7)
.
148,149c
	MOVEM	(A7), $0x7FFF
	ADDL	$((8+8+1)*BY2WD), A7
.
145,146c
	MOVL	((8+8)*BY2WD)(A7), A0
.
## diffname gnot/l.s 1990/0902
## diff -e /n/bootesdump/1990/08272/sys/src/9/68020/l.s /n/bootesdump/1990/0902/sys/src/9/68020/l.s
72a
TEXT	cacrtrap(SB), $0	/* user entry point to control cache, e.g. flush */

	MOVL	R0, CACR
	RTE

.
## diffname gnot/l.s 1990/1004
## diff -e /n/bootesdump/1990/0902/sys/src/9/68020/l.s /n/bootesdump/1990/1004/sys/src/9/68020/l.s
65a
TEXT	spldone(SB), $0

	RTS
.
47a
	MOVL	m(SB), A0
	MOVL	(A7), 4(A0)
.
## diffname gnot/l.s 1990/1113
## diff -e /n/bootesdump/1990/1004/sys/src/9/68020/l.s /n/bootesdump/1990/1113/sys/src/9/68020/l.s
158a
	MOVL	$-1, R0			/* note causes error in sys call */
.
## diffname gnot/l.s 1990/1212
## diff -e /n/bootesdump/1990/1113/sys/src/9/68020/l.s /n/bootesdump/1990/1212/sys/src/9/68020/l.s
203c
	BSR	fault68020(SB)
.
## diffname gnot/l.s 1991/0112
## diff -e /n/bootesdump/1990/1212/sys/src/9/68020/l.s /n/bootesdump/1991/0112/sys/src/9/68020/l.s
217a
#ifdef asdf
TEXT	portintr(SB), $0		/* level 2 */

	SUBL	$((8+8+1)*BY2WD), A7
	MOVEM	$0x7FFF, (A7)
	MOVL	$a6base(SB), A6
	MOVL	USP, A0
	MOVL	A0, ((8+8)*BY2WD)(A7)
	MOVL	A7, -(A7)
	BSR	devportintr(SB)
	ADDL	$4, A7
	MOVL	((8+8)*BY2WD)(A7), A0
	MOVL	A0, USP
	MOVEM	(A7), $0x7FFF
	ADDL	$((8+8+1)*BY2WD), A7
	RTE
#endif

.
## diffname gnot/l.s 1991/0115
## diff -e /n/bootesdump/1991/0112/sys/src/9/68020/l.s /n/bootesdump/1991/0115/sys/src/9/68020/l.s
234d
218d
## diffname gnot/l.s 1991/0319
## diff -e /n/bootesdump/1991/0201/sys/src/9/68020/l.s /n/bootesdump/1991/0319/sys/src/9/gnot/l.s
295c
	ADDL	$((8+8+1)*BY2WD+BY2WD), A7
.
283a
	MOVL	$DBMAGIC, -(A7)
.
279c
	ADDL	$((8+8+1)*BY2WD+BY2WD), A7
.
267a
	MOVL	$DBMAGIC, -(A7)
.
247c
	ADDL	$((8+8+1)*BY2WD+BY2WD), A7
.
235a
	MOVL	$DBMAGIC, -(A7)
.
231c
	ADDL	$((8+8+1)*BY2WD+BY2WD), A7
.
219a
	MOVL	$DBMAGIC, -(A7)
.
208c
	ADDL	$((8+8+1)*BY2WD+BY2WD), A7
.
201c
	PEA	((8+8+1+3)*BY2WD)(A7)
.
195a
	MOVL	$DBMAGIC, -(A7)
.
191c
	ADDL	$((1+8+8+1)*BY2WD+BY2WD), A7
.
179a
	MOVL	$DBMAGIC, -(A7)
.
175c
	ADDL	$((8+8+1)*BY2WD+BY2WD), A7
.
163a
	MOVL	$DBMAGIC, -(A7)
.
158c
	ADDL	$((8+8+1)*BY2WD+BY2WD), A7
.
2a
#define	DBMAGIC		0xBADC0C0A

.
## diffname gnot/l.s 1991/0423
## diff -e /n/bootesdump/1991/0319/sys/src/9/gnot/l.s /n/bootesdump/1991/0423/sys/src/9/gnot/l.s
305a

GLOBL	duarttimer+0(SB),$4

TEXT	duartreadtimer+0(SB), $0
	MOVW	SR, R1		/* spl7() */
	MOVW	$0x2700, SR
	MOVL	$0x40100000, A0
	CLRL	R0
	TSTB	15(A0)		/* stop timer */
	MOVW	6(A0), R0	/* read hi,lo */
	TSTB	14(A0)		/* restart timer */
	NOTW	R0		/* timer counts down from 0xffff */
	ADDL	duarttimer(SB), R0
	MOVL	R0, duarttimer(SB)
	MOVW	R1, SR
	RTS
.
299a
	/* fall through */
retintr:
	BSR	mousetry(SB)
.
283,288c
	BRA	retintr
.
250,255c
	BRA	retintr
.
240c
TEXT	dkintr(SB), $0			/* level 3 */
.
233,238c
	BRA	retintr
.
56a
TEXT	splduart(SB), $0

	MOVL	$0, R0
	MOVW	SR, R0
	MOVW	$(SUPER|SPL(5)), SR
	RTS

.
## diffname gnot/l.s 1991/0503
## diff -e /n/bootesdump/1991/0423/sys/src/9/gnot/l.s /n/bootesdump/1991/0503/sys/src/9/gnot/l.s
167c
	ADDL	$((8+8+1+1)*BY2WD), A7
.
162,163c
	MOVL	uregp+0(FP), A7
.
## diffname gnot/l.s 1991/0608
## diff -e /n/bootesdump/1991/0503/sys/src/9/gnot/l.s /n/bootesdump/1991/0608/sys/src/9/gnot/l.s
47a
TEXT	firmware(SB), $0

	MOVL	$0x40000090, A0
	JMP	(A0)

.
## diffname gnot/l.s 1991/0719
## diff -e /n/bootesdump/1991/0608/sys/src/9/gnot/l.s /n/bootesdump/1991/0719/sys/src/9/gnot/l.s
41c
	MOVL	$(USTKTOP-6*BY2WD), A0	/* MAXSYSARG=6 */
.
37c
	MOVL	$(USERADDR+BY2PG-UREGVARSZ), A7
.
32c
 * Take first processor into user mode.  Leave enough room on the stack
 * for a full-sized Ureg (including long bus error format) to fit
.
## diffname gnot/l.s 1991/0725
## diff -e /n/bootesdump/1991/0719/sys/src/9/gnot/l.s /n/bootesdump/1991/0725/sys/src/9/gnot/l.s
173d
## diffname gnot/l.s 1991/1102
## diff -e /n/bootesdump/1991/0725/sys/src/9/gnot/l.s /n/bootesdump/1991/1102/sys/src/9/gnot/l.s
86a
TEXT	spl1(SB), $0

	MOVL	$0, R0
	MOVW	SR, R0
	MOVW	$(SUPER|SPL(1)), SR
	RTS

.
## diffname gnot/l.s 1992/0301
## diff -e /n/bootesdump/1991/1102/sys/src/9/gnot/l.s /n/bootesdump/1992/0301/sys/src/9/gnot/l.s
310c
	ADDL	$((8+8+1)*BY2WD), A7
	MOVL	$0, (A7)+
.
231c
	ADDL	$((8+8+1)*BY2WD), A7
	MOVL	$0, (A7)+
.
213c
	ADDL	$((1+8+8+1)*BY2WD), A7
	MOVL	$0, (A7)+
.
196c
	ADDL	$((8+8+1)*BY2WD), A7
	MOVL	$0, (A7)+
.
## diffname gnot/l.s 1992/0318
## diff -e /n/bootesdump/1992/0301/sys/src/9/gnot/l.s /n/bootesdump/1992/0318/sys/src/9/gnot/l.s
42d
37a
	MOVL	usp+0(FP), A0
.
36c
TEXT	touser(SB), $0
.
33a
 * 	- argument is stack pointer to user
.
32c
 * Take first processor into user mode.  Leave enough room on the kernel stack
.
## diffname gnot/l.s 1992/0806
## diff -e /n/bootesdump/1992/0318/sys/src/9/gnot/l.s /n/bootesdump/1992/0806/sys/src/9/gnot/l.s
173d
## diffname gnot/l.s 1992/0914
## diff -e /n/bootesdump/1992/0806/sys/src/9/gnot/l.s /n/bootesdump/1992/0914/sys/src/9/gnot/l.s
332a
TEXT	getsr+0(SB), $0
	MOVL	$0, R0
	MOVW	SR, R0
	RTS

.
## diffname gnot/l.s 1993/0226
## diff -e /n/bootesdump/1992/0914/sys/src/9/gnot/l.s /n/bootesdump/1993/0226/sys/src/9/gnot/l.s
308d
## diffname gnot/l.s 1993/0501 # deleted
## diff -e /n/bootesdump/1993/0226/sys/src/9/gnot/l.s /n/fornaxdump/1993/0501/sys/src/brazil/gnot/l.s
1,373d

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.