arch/powerpc/kvm/fpu.S

Source file repositories/reference/linux-study-clean/arch/powerpc/kvm/fpu.S

File Facts

System
Linux kernel
Corpus path
arch/powerpc/kvm/fpu.S
Extension
.S
Size
5933 bytes
Lines
286
Domain
Architecture Layer
Bucket
arch/powerpc
Inferred role
Architecture Layer: arch/powerpc
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

#include <linux/pgtable.h>
#include <linux/linkage.h>

#include <asm/reg.h>
#include <asm/page.h>
#include <asm/mmu.h>
#include <asm/cputable.h>
#include <asm/cache.h>
#include <asm/thread_info.h>
#include <asm/ppc_asm.h>
#include <asm/asm-offsets.h>

/* Instructions operating on single parameters */

/*
 * Single operation with one input operand
 *
 * R3 = (double*)&fpscr
 * R4 = (short*)&result
 * R5 = (short*)&param1
 */
#define FPS_ONE_IN(name) 					\
_GLOBAL(fps_ ## name);							\
	lfd	0,0(r3);		/* load up fpscr value */	\
	MTFSF_L(0);							\
	lfs	0,0(r5);						\
									\
	name	0,0;							\
									\
	stfs	0,0(r4);						\
	mffs	0;							\
	stfd	0,0(r3);	/* save new fpscr value */	\
	blr

/*
 * Single operation with two input operands
 *
 * R3 = (double*)&fpscr
 * R4 = (short*)&result
 * R5 = (short*)&param1
 * R6 = (short*)&param2
 */
#define FPS_TWO_IN(name) 					\
_GLOBAL(fps_ ## name);							\
	lfd	0,0(r3);		/* load up fpscr value */	\
	MTFSF_L(0);							\
	lfs	0,0(r5);						\
	lfs	1,0(r6);						\
									\
	name	0,0,1;							\
									\
	stfs	0,0(r4);						\
	mffs	0;							\
	stfd	0,0(r3);		/* save new fpscr value */	\
	blr

/*
 * Single operation with three input operands
 *
 * R3 = (double*)&fpscr
 * R4 = (short*)&result
 * R5 = (short*)&param1
 * R6 = (short*)&param2
 * R7 = (short*)&param3
 */
#define FPS_THREE_IN(name) 					\
_GLOBAL(fps_ ## name);							\
	lfd	0,0(r3);		/* load up fpscr value */	\
	MTFSF_L(0);							\
	lfs	0,0(r5);						\

Annotation

Implementation Notes