arch/m68k/fpsp040/gen_except.S

Source file repositories/reference/linux-study-clean/arch/m68k/fpsp040/gen_except.S

File Facts

System
Linux kernel
Corpus path
arch/m68k/fpsp040/gen_except.S
Extension
.S
Size
13176 bytes
Lines
468
Domain
Architecture Layer
Bucket
arch/m68k
Inferred role
Architecture Layer: arch/m68k
Status
atlas-only

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

bfextu	CMDREG1B(%a6){#13:#1},%d1	|extract bit 2
	lsll	#5,%d1
	swap	%d1
	orl	%d1,%d0			|put it in the right place
	bfextu	CMDREG1B(%a6){#10:#3},%d1	|extract bit 3,4,5
	lsll	#2,%d1
	swap	%d1
	orl	%d1,%d0			|put them in the right place
	movel	%d0,CMDREG3B(%a1)		|in the busy frame
|
| Or in the FPSR from the emulation with the USER_FPSR on the stack.
|
	fmovel	%FPSR,%d0
	orl	%d0,USER_FPSR(%a6)
	movel	USER_FPSR(%a6),FPSR_SHADOW(%a1) |set exc bits
	orl	#sx_mask,E_BYTE(%a1)
	bra	do_clean

|
| Frame is an unimp frame possible resulting from an fmove <ea>,fp0
| that caused an exception
|
| a1 is modified to point into the new frame allowing fpsp equates
| to be valid.
|
unimp_x:
	cmpib	#UNIMP_40_SIZE-4,1(%a7)	|test for orig unimp frame
	bnes	test_rev
	leal	UNIMP_40_SIZE+LOCAL_SIZE(%a7),%a1
	bras	unimp_con
test_rev:
	cmpib	#UNIMP_41_SIZE-4,1(%a7)	|test for rev unimp frame
	bnel	fpsp_fmt_error		|if not $28 or $30
	leal	UNIMP_41_SIZE+LOCAL_SIZE(%a7),%a1

unimp_con:
|
| Fix up the new unimp frame with entries from the old unimp frame
|
	movel	CMDREG1B(%a6),CMDREG1B(%a1) |set inst in frame to unimp
|
| Or in the FPSR from the emulation with the USER_FPSR on the stack.
|
	fmovel	%FPSR,%d0
	orl	%d0,USER_FPSR(%a6)
	bra	do_clean

|
| Frame is idle, so check for exceptions reported through
| USER_FPSR and set the unimp frame accordingly.
| A7 must be incremented to the point before the
| idle fsave vector to the unimp vector.
|

do_check:
	addl	#4,%a7			|point A7 back to unimp frame
|
| Or in the FPSR from the emulation with the USER_FPSR on the stack.
|
	fmovel	%FPSR,%d0
	orl	%d0,USER_FPSR(%a6)
|
| On a busy frame, we must clear the nmnexc bits.
|
	cmpib	#BUSY_SIZE-4,1(%a7)	|check frame type
	bnes	check_fr		|if busy, clr nmnexc
	clrw	NMNEXC(%a6)		|clr nmnexc & nmcexc
	btstb	#5,CMDREG1B(%a6)		|test for fmove out
	bnes	frame_com
	movel	USER_FPSR(%a6),FPSR_SHADOW(%a6) |set exc bits

Annotation

Implementation Notes