📄 vfpundef.c
字号:
/*
* vfpundef.c
* VFP UNDEF handler
* called _after_ the top-level UNDEF handler has:
* saved registers, switched mode, and identified CP10,11 bounce.
* Copyright (C) ARM Limited, 2002. All rights reserved.
*/
typedef unsigned uint32;
#define IGNORE(x) (void)(x)
#include "slundef.h"
#include "controlbuffer.h"
#include "vfpsubarch.h"
/* this is a non-ATPCS entry point: we only need the address here */
EXTERN_C
void VFP_Computation_Engine_Wrapper(void);
#pragma arm /* force ARM state code */
/* returns the EN bit FPEXC[30] */
__inline int VFP_Is_Enabled(void)
{
int x;
/* FMRX x, FPEXC */
__asm { MRC p10, 7, x, c8, c0, 0 }
return ((x & /* EN bit */(1 << 30)) != 0);
}
__value_in_regs
HandlerReturnType VFP_Undef_Handler(uint32 instr, ARM_RegDump *regdump)
{
ControlBuffer *controlbuffer;
_VFP_Computation_Description *desc;
uint32 skip_instr;
if (!VFP_Is_Enabled())
/* Replace this with jump to lazy context switch code */
return Unknown_Coproc_Handler(instr, regdump);
if (!_VFP_Is_Compute_Exception(instr))
return Unknown_Coproc_Handler(instr, regdump);
/* Find a controlbuffer for a user-level exception */
controlbuffer =
GetControlBuffer(regdump,
&VFP_Computation_Engine_Wrapper,
sizeof(_VFP_Computation_Description));
desc = (_VFP_Computation_Description *)&controlbuffer->data;
/* Fill out the _VFP_Computation_Description */
skip_instr =
_VFP_Collect_Trap_Description(desc, instr);
/* and return to the top-level handler */
{
HandlerReturnType ret;
ret.skip_instr = skip_instr;
ret.controlbuffer = controlbuffer;
return ret;
}
}
/* end of vfpundef.c */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -