亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? fpparchlib.c

?? VXWORKS 源碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* fppArchLib.c - floating-point coprocessor support library *//* Copyright 1984-2002 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01j,25mar02,hdn  added two APIs to detect illegal FPU usage (spr 70187)01i,20nov01,hdn  doc clean up for 5.501h,21aug01,hdn  imported SSE support from T31 ver 01k01g,21apr99,hdn  changed selector of the emulator exception handler.01f,14jun95,hdn  added support for fpp emulation library from USS.01e,25may95,ms   added fppRegsToCtx and fppCtxToRegs.01d,10aug93,hdn  added two global variables for fppProbeSup().01c,03jun93,hdn  updated to 5.1		  - moved fppInit(), fppCreateHook(), fppSwapHook(),		    fppTaskRegsShow() to src/all/fppLib.c.  		  - changed to pointer to floating-point register to 		    fppTasksRegs{S,G}et().		  - added arrays fpRegIndex[], fpCtlRegIndex[].		  - added fppArchTastInit().  		  - included regs.h, intLib.h.                  - changed functions to ansi style		  - changed VOID to void01b,29sep92,hdn  fixed a bug.01a,07apr92,hdn  written based on TRON version.*//*DESCRIPTIONThis library provides a low-level interface to the Intel ArchitectureFloating-Point Unit (FPU).  Routines fppTaskRegsShow(), fppTaskRegsSet(),and fppTaskRegsGet() inspect and set coprocessor registers on a per taskbasis.  The routine fppProbe() checks for the presence of theIntel Architecture FPU.  With the exception of fppProbe(), the higherlevel facilities in dbgLib and usrLib should be used instead of theseroutines.There are two kind of floating-point contexts and set of routines for each kind.  One is 108 bytes for older FPU (i80387, i80487, Pentium) and older MMX technology and fppSave(), fppRestore(), fppRegsToCtx(), and fppCtxToRegs() are used to save and restore the context, convert to or from the FPPREG_SET.The other is 512 bytes for newer FPU, newer MMX technology and streaming SIMD technology (PentiumII, III, 4) and fppXsave(), fppXrestore(), fppXregsToCtx(), and fppXctxToRegs() are used to save and restore the context, convert to or from the FPPREG_SET.  Which to use is automatically detected by checking CPUID information in fppArchInit().  And fppTaskRegsSet() and fppTaskRegsGet() access the appropriate floating-point context.  The bit interrogated for the automatic detection is the "Fast Save and Restore" feature flag.INITIALIZATIONTo activate floating-point support, fppInit() must be called before anytasks using the coprocessor are spawned.  If INCLUDE_FLOATING_POINT isdefined in configAll.h, this is done by the root task, usrRoot(), inusrConfig.c.VX_FP_TASK OPTION Saving and restoring floating-point registers adds to the context switchtime of a task.Therefore, floating-point registers are \f2not\fP saved and restored for \f2every\fP task.  Only those tasks spawned with the task option VX_FP_TASKwill have floating-point state, MMX technology state, and streaming SIMD state saved and restored.  \f3NOTE:\fP  If a task does any floating-point operations, MMX operations,and streaming SIMD operation, it must be spawned with VX_FP_TASK.It is deadly to execute any floating-point operations in a task spawned without VX_FP_TASK option, and very difficult to find.  To detect thatillegal/unintentional/accidental floating-point operations, a new API andmechanism is added.  The mechanism is to enable or disable the FPU by toggling the TS flag in the CR0 in the new task switch hook routine -fppArchSwitchHook() - respecting the VX_FP_TASK option.  If VX_FP_TASKoption is not set in the switching-in task, the FPU is disabled.  Thusthe device-not-available exception will be raised if that task does any floating-point operations.  This mechanism is disabled in the default.To enable, call the enabler - fppArchSwitchHookEnable() - with a parameter TRUE(1).  A parameter FALSE(0) disables the mechanism.MIXING MMX AND FPU INSTRUCTIONSA task with VX_FP_TASK option saves and restores the FPU and MMX statewhen performing a context switch.  Therefore, the application does nothave to save or restore the FPU and MMX state if the FPU and MMX instructions are not mixed within a task.  Because the MMX registersare aliased to the FPU registers, care must be taken when makingtransitions between FPU instructions and MMX instructions to preventthe loss of data in the FPU and MMX registers and to prevent incoherentor unexpected result.  When mixing MMX and FPU instructions within a task, follow these guidelines from Intel:    - Keep the code in separate modules, procedures, or routines.    - Do not rely on register contents across transitions between FPU      and MMX code modules.    - When transitioning between MMX code and FPU code, save the MMX      register state (if it will be needed in the future) and execute      an EMMS instruction to empty the MMX state.    - When transitioning between FPU and MMX code, save the FPU state,      if it will be needed in the future.MIXING SSE/SSE2 AND FPU/MMX INSTRUCTIONSThe XMM registers and the FPU/MMX registers represent separate execution environments, which has certain ramifications when executingSSE, SSE2, MMX and FPU instructions in the same task context:    - Those SSE and SSE2 instruction that operate only on the XMM       registers (such as the packed and scalar floating-point      instructions and the 128-bit SIMD integer instructions) can be      executed in the same instruction stream with 64-bit SIMD integer      or FPU instructions without any restrictions.  For example, an      application can perform the majority of its floating-point       computations in the XMM registers, using the packed and scalar      floating-point instructions, and at the same time use the FPU      to perform trigonometric and other transcendental computations.      Likewise, an application can perform packed 64-bit and 128-bit      SIMD integer operations can be executed together without      restrictions.    - Those SSE and SSE2 instructions that operate on MMX registers      (such as the CVTPS2PI, CVTTPS2PI, CVTPI2PS, CVTPD2PI, CVTTPD2PI,      CVTPI2PD, MOVDQ2Q, MOVQ2DQ, PADDQ, and PSUBQ instructions) can      also be executed in the same instruction stream as 64-bit SIMD      integer or FPU instructions, however, here they subject to the      restrictions on the simultaneous use of MMX and FPU instructions,      which mentioned in the previous paragraph.INTERRUPT LEVELFloating-point registers are \f2not\fP saved and restored for interruptservice routines connected with intConnect().  However, if necessary,an interrupt service routine can save and restore floating-point registersby calling routines in fppALib.  See the manual entry for intConnect() formore information.EXCEPTIONSThere are six FPU exceptions that can send an exception to the CPU.  They are controlled by Exception Mask bits of the Control Word register.  VxWorks disables them in the default configuration.  Theyare:    - Precision    - Overflow    - Underflow    - Division by zero    - Denormalized operand    - Invalid Operation  SEE ALSO: fppALib, intConnect(), Intel Architecture Software Developer's Manual*/#include "vxWorks.h"#include "objLib.h"#include "taskLib.h"#include "taskArchLib.h"#include "memLib.h"#include "string.h"#include "iv.h"#include "intLib.h"#include "regs.h"#include "fppLib.h"#include "vxLib.h"#include "taskHookLib.h"/* externals */IMPORT CPUID	sysCpuId;IMPORT int	sysCsExc;IMPORT void	intVecSet2 (FUNCPTR * vec, FUNCPTR func, int idtGate, \			    int idtSelector);/* globals */REG_INDEX fpRegName [] =	/* FP non-control register name and offset */    {    {"st/mm0",	FPREG_FPX(0)},    {"st/mm1",	FPREG_FPX(1)},    {"st/mm2",	FPREG_FPX(2)},    {"st/mm3",	FPREG_FPX(3)},    {"st/mm4",	FPREG_FPX(4)},    {"st/mm5",	FPREG_FPX(5)},    {"st/mm6",	FPREG_FPX(6)},    {"st/mm7",	FPREG_FPX(7)},    {NULL, 0},    };REG_INDEX fpCtlRegName [] =	/* FP control register name and offset */    {    {"fpcr",	FPREG_FPCR},    {"fpsr",	FPREG_FPSR},    {"fptag",	FPREG_FPTAG},    {"op",	FPREG_OP},    {"ip",	FPREG_IP},    {"cs",	FPREG_CS},    {"dp",	FPREG_DP},    {"ds",	FPREG_DS},    {NULL, 0},    };int fppFsw = 0;int fppFcw = 0;VOIDFUNCPTR emu387Func	= NULL;		/* func ptr to trap handler */VOIDFUNCPTR emuInitFunc	= NULL;		/* func ptr to initializer */VOIDFUNCPTR _func_fppSaveRtn = NULL;	/* func ptr to fppSave/fppXsave */VOIDFUNCPTR _func_fppRestoreRtn = NULL; /* func ptr to fppRestore/fppXrestore *//* locals */LOCAL FP_CONTEXT * pFppInitContext;	/* pointer to initial FP context *//********************************************************************************* fppArchInit - initialize floating-point coprocessor support** This routine must be called before using the floating-point coprocessor.* It is typically called from fppInit().  ** NOMANUAL*/void fppArchInit (void)    {        /* initialize the function pointer and the CR4 OSFXSR bit */    if (sysCpuId.featuresEdx & CPUID_FXSR)	{	_func_fppSaveRtn = fppXsave;		/* new FP save routine */	_func_fppRestoreRtn = fppXrestore;	/* new FP restore routine */	vxCr4Set (vxCr4Get () | CR4_OSFXSR);	/* set OSFXSR bit */	}    else	{	_func_fppSaveRtn = fppSave;		/* old FP save routine */	_func_fppRestoreRtn = fppRestore;	/* old FP restore routine */	vxCr4Set (vxCr4Get () & ~CR4_OSFXSR);	/* clear OSFXSR bit */	}    fppCreateHookRtn = (FUNCPTR) NULL;    /* allocate and initialize the initial FP_CONTEXT */    pFppInitContext = (FP_CONTEXT *) memalign \				     (_CACHE_ALIGN_SIZE, sizeof (FP_CONTEXT));    (*_func_fppSaveRtn) (pFppInitContext);    }/********************************************************************************* fppArchTaskCreateInit - initialize floating-point coprocessor support for task** INTERNAL* It might seem odd that we use a bcopy() to initialize the floating point* context when a fppSave() of an idle frame would accomplish the same thing* without the cost of a 108/512 byte data structure.  The problem is that we* are not guaranteed to have an idle frame.  Consider the following scenario:* a floating point task is midway through a floating point instruction when* it is preempted by a *non-floting point* task.  In this case the swap-in* hook does not save the coprocessor state as an optimization.  Now if we* create a floating point task the initial coprocessor frame would not be* idle but rather mid-instruction.  To make matters worse when get around* to saving the original fp task's floating point context frame, it would be* incorrectly saved as idle!  One solution would be to fppSave() once to* the original fp task's context, then fppSave() an idle frame to the new task,* and finally restore the old fp task's context (in case we return to it* before another fp task).  The problem with this approach is that it is* *slow* and considering the fact that preemption is locked, the 108/512 bytes* don't look so bad anymore.  Indeed, when this approach is adopted by all* architectures we will not need to lock out preemption anymore.** NOMANUAL*/void fppArchTaskCreateInit    (    FP_CONTEXT * pFpContext		/* pointer to FP_CONTEXT */    )    {    if (sysCpuId.featuresEdx & CPUID_FXSR)	{	bcopyLongs ((char *) pFppInitContext, (char *)pFpContext,	            (sizeof (FPX_CONTEXT) >> 2));	/* copy 512>>2 longs */	}    else	{	bcopyLongs ((char *) pFppInitContext, (char *)pFpContext,	            (sizeof (FPO_CONTEXT) >> 2));	/* copy 108>>2 longs */	}    }/******************************************************************************** fppRegsToCtx - convert FPREG_SET to FPO_CONTEXT.*/ void fppRegsToCtx    (    FPREG_SET *  pFpRegSet,             /* input -  fpp reg set */    FP_CONTEXT * pFpContext             /* output - fpp context */    )    {    int ix;    for (ix = 0; ix < FP_NUM_REGS; ix++)        fppDtoDx ((DOUBLEX *)&pFpContext->u.o.fpx[ix],                   (double *)&pFpRegSet->fpx[ix]);    pFpContext->u.o.fpcr  = pFpRegSet->fpcr;    pFpContext->u.o.fpsr  = pFpRegSet->fpsr;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
午夜av一区二区| 精品综合久久久久久8888| 欧美精品国产精品| 国产精品99久久久久久宅男| 亚洲五码中文字幕| 中文字幕高清一区| 91精品国产91久久综合桃花| k8久久久一区二区三区 | 欧美精品久久99| 99re这里只有精品首页| 韩国中文字幕2020精品| 香蕉久久夜色精品国产使用方法| 欧美激情一区二区三区不卡 | 色婷婷综合久久久| 国产精品一区久久久久| 日韩成人精品在线观看| 一区二区三区在线高清| 中文av一区二区| 亚洲精品在线观| 欧美一卡在线观看| 欧美日韩一区久久| 91蝌蚪porny| 不卡一区二区三区四区| 国产成人在线视频网址| 狠狠网亚洲精品| 麻豆一区二区三区| 日本不卡视频在线观看| 午夜久久久久久| 亚洲成av人片一区二区梦乃| 亚洲人一二三区| 中文字幕欧美一| 欧美国产精品v| 久久久精品中文字幕麻豆发布| 日韩三级在线免费观看| 欧美精品日韩综合在线| 欧美色图第一页| 欧美在线free| 欧美日韩国产综合一区二区三区| 欧美三电影在线| 欧美视频一区在线| 欧美视频中文字幕| 欧美亚洲国产一区二区三区va| 色婷婷久久久久swag精品 | 在线观看一区日韩| 色综合久久久网| 在线亚洲高清视频| 欧美主播一区二区三区| 欧美影院一区二区| 欧美日韩高清一区| 7777精品伊人久久久大香线蕉超级流畅 | 精品国产伦理网| 久久婷婷久久一区二区三区| 久久久久久久久久美女| 国产偷国产偷精品高清尤物| 国产精品三级av| 亚洲精品乱码久久久久久| 亚洲一二三区不卡| 美女视频黄久久| 国产成人免费在线| 色欧美片视频在线观看在线视频| 在线观看日韩一区| 91精品国产综合久久久久久 | 91亚洲精华国产精华精华液| 91福利在线播放| 欧美电影影音先锋| 精品国产一区二区三区四区四| 国产视频不卡一区| 樱桃国产成人精品视频| 五月天中文字幕一区二区| 美女mm1313爽爽久久久蜜臀| 国产精品资源在线看| 99re这里只有精品6| 欧美日韩国产高清一区二区三区| 日韩欧美123| 中文字幕一区二区三区不卡在线 | 国产丝袜欧美中文另类| 亚洲色图清纯唯美| 日韩av一区二区三区四区| 国产一区在线看| 在线观看免费视频综合| 91精品久久久久久久久99蜜臂| 国产日韩在线不卡| 亚洲国产精品尤物yw在线观看| 久久成人久久爱| 色婷婷av一区二区三区软件| 欧美mv日韩mv| 一区二区三区日本| 国产自产视频一区二区三区| 欧美午夜理伦三级在线观看| 久久婷婷久久一区二区三区| 亚洲成人动漫一区| 丁香婷婷深情五月亚洲| 91麻豆精品国产91久久久久| 亚洲欧美日韩久久| 精品一区二区免费在线观看| 在线观看日韩电影| 国产网站一区二区| 美国十次综合导航| 在线观看日韩国产| 国产精品麻豆网站| 久草在线在线精品观看| 欧美丝袜丝交足nylons| 国产精品久久久久天堂| 美女视频黄a大片欧美| 欧洲精品在线观看| 国产精品美女久久久久aⅴ| 日本欧美一区二区| 在线这里只有精品| 亚洲欧洲精品天堂一级| 韩国三级在线一区| 91精品国产综合久久久久 | 国产成人免费9x9x人网站视频| 日韩一区二区视频在线观看| 亚洲一区二区三区影院| 不卡的av电影| 国产丝袜欧美中文另类| 毛片不卡一区二区| 91精品欧美福利在线观看| 亚洲午夜日本在线观看| 色综合久久中文综合久久牛| 国产精品美女久久久久久久久久久 | 欧美一级精品在线| 亚洲综合在线电影| av不卡在线播放| 久久久久久久久久美女| 久久66热偷产精品| 精品久久一区二区| 成人av集中营| 国产免费久久精品| 国产激情偷乱视频一区二区三区| 精品美女一区二区| 精品一区二区综合| 久久一二三国产| 国产一区二三区| 久久免费精品国产久精品久久久久| 久久国产人妖系列| 精品国产乱码久久久久久久久| 美女视频黄 久久| 久久综合成人精品亚洲另类欧美| 久久精品99久久久| 日韩欧美国产wwwww| 九色综合狠狠综合久久| 久久天天做天天爱综合色| 国产在线视频不卡二| 欧美精品一区二区三区很污很色的| 韩国av一区二区三区| 久久久久久99精品| 成人免费精品视频| 亚洲精品日韩一| 欧美私人免费视频| 日本aⅴ免费视频一区二区三区| 日韩欧美国产午夜精品| 国产jizzjizz一区二区| 《视频一区视频二区| 欧美曰成人黄网| 青青草成人在线观看| 2022国产精品视频| 成人国产电影网| 亚洲成人精品在线观看| 日韩欧美二区三区| 波多野结衣中文字幕一区二区三区| 国产精品乱码妇女bbbb| 欧美中文字幕亚洲一区二区va在线 | 午夜天堂影视香蕉久久| 精品国产露脸精彩对白| 成人激情开心网| 亚洲成人免费观看| 久久久久久久综合| 91福利区一区二区三区| 美女视频黄 久久| 亚洲天堂2014| 日韩欧美不卡在线观看视频| www.欧美日韩| 日韩精品福利网| 欧美激情资源网| 欧美三电影在线| 懂色av一区二区三区免费观看 | 国产丶欧美丶日本不卡视频| 一区二区三区中文在线观看| 欧美一卡2卡三卡4卡5免费| 成人精品视频一区二区三区尤物| 午夜精品国产更新| 中文字幕av一区二区三区高| 欧美日韩一区二区三区不卡| 国产大陆亚洲精品国产| 亚洲成av人**亚洲成av**| 欧美国产日韩一二三区| 欧美一区二区三区男人的天堂| a在线播放不卡| 精品无人码麻豆乱码1区2区| 亚洲综合在线第一页| 中文字幕精品一区二区三区精品| 欧美精品一卡两卡| 一本到一区二区三区| 国产精品亚洲专一区二区三区 | 大陆成人av片| 秋霞影院一区二区| 亚洲精品免费在线| 久久精品人人做人人综合| 欧美精品丝袜中出|