arch/m68k/fpsp040/fpsp.h

Source file repositories/reference/linux-study-clean/arch/m68k/fpsp040/fpsp.h

File Facts

System
Linux kernel
Corpus path
arch/m68k/fpsp040/fpsp.h
Extension
.h
Size
11435 bytes
Lines
348
Domain
Architecture Layer
Bucket
arch/m68k
Inferred role
Architecture Layer: implementation source
Status
source implementation candidate

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

|
|	fpsp.h 3.3 3.3
|

|		Copyright (C) Motorola, Inc. 1990
|			All Rights Reserved
|
|       For details on the license for this file, please see the
|       file, README, in this same directory.

|	fpsp.h --- stack frame offsets during FPSP exception handling
|
|	These equates are used to access the exception frame, the fsave
|	frame and any local variables needed by the FPSP package.
|
|	All FPSP handlers begin by executing:
|
|		link	a6,#-LOCAL_SIZE
|		fsave	-(a7)
|		movem.l	d0-d1/a0-a1,USER_DA(a6)
|		fmovem.x fp0-fp3,USER_FP0(a6)
|		fmove.l	fpsr/fpcr/fpiar,USER_FPSR(a6)
|
|	After initialization, the stack looks like this:
|
|	A7 --->	+-------------------------------+
|		|				|
|		|	FPU fsave area		|
|		|				|
|		+-------------------------------+
|		|				|
|		|	FPSP Local Variables	|
|		|	     including		|
|		|	  saved registers	|
|		|				|
|		+-------------------------------+
|	A6 --->	|	Saved A6		|
|		+-------------------------------+
|		|				|
|		|	Exception Frame		|
|		|				|
|		|				|
|
|	Positive offsets from A6 refer to the exception frame.  Negative
|	offsets refer to the Local Variable area and the fsave area.
|	The fsave frame is also accessible from the top via A7.
|
|	On exit, the handlers execute:
|
|		movem.l	USER_DA(a6),d0-d1/a0-a1
|		fmovem.x USER_FP0(a6),fp0-fp3
|		fmove.l	USER_FPSR(a6),fpsr/fpcr/fpiar
|		frestore (a7)+
|		unlk	a6
|
|	and then either "bra fpsp_done" if the exception was completely
|	handled	by the package, or "bra real_xxxx" which is an external
|	label to a routine that will process a real exception of the
|	type that was generated.  Some handlers may omit the "frestore"
|	if the FPU state after the exception is idle.
|
|	Sometimes the exception handler will transform the fsave area
|	because it needs to report an exception back to the user.  This
|	can happen if the package is entered for an unimplemented float
|	instruction that generates (say) an underflow.  Alternatively,
|	a second fsave frame can be pushed onto the stack and the
|	handler	exit code will reload the new frame and discard the old.
|
|	The registers d0, d1, a0, a1 and fp0-fp3 are always saved and
|	restored from the "local variable" area and can be used as
|	temporaries.  If a routine needs to change any
|	of these registers, it should modify the saved copy and let
|	the handler exit code restore the value.
|
|----------------------------------------------------------------------
|
|	Local Variables on the stack
|
	.set	LOCAL_SIZE,192		| bytes needed for local variables
	.set	LV,-LOCAL_SIZE	| convenient base value
|
	.set	USER_DA,LV+0		| save space for D0-D1,A0-A1
	.set	USER_D0,LV+0		| saved user D0
	.set	USER_D1,LV+4		| saved user D1
	.set	USER_A0,LV+8		| saved user A0
	.set	USER_A1,LV+12		| saved user A1
	.set	USER_FP0,LV+16		| saved user FP0
	.set	USER_FP1,LV+28		| saved user FP1
	.set	USER_FP2,LV+40		| saved user FP2
	.set	USER_FP3,LV+52		| saved user FP3

Annotation

Implementation Notes