亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
日韩一区二区三区在线观看| 亚洲精品视频免费看| 亚洲色图欧美偷拍| 久久国产精品区| 色www精品视频在线观看| 国产午夜三级一区二区三| 亚洲三级理论片| 偷拍与自拍一区| 亚洲精品中文在线影院| 午夜激情久久久| 国产99久久久久| 欧美日韩专区在线| 国产亚洲精品资源在线26u| 国产精品理论片| 天堂久久久久va久久久久| 国产精品自拍在线| 在线视频一区二区三| 亚洲精品在线一区二区| 久久精品人人做人人综合| 一区二区中文字幕在线| 日韩国产精品91| 不卡一区二区三区四区| 制服丝袜一区二区三区| 1000部国产精品成人观看| 秋霞影院一区二区| 在线看不卡av| 一二三区精品福利视频| 国产精品女同一区二区三区| 国产精品网曝门| 国产成人在线视频网址| 精品国产凹凸成av人网站| 国产精品久久久久aaaa樱花| 蜜臀av国产精品久久久久| 色婷婷综合久久| 国产女人aaa级久久久级| 性欧美疯狂xxxxbbbb| 欧美无人高清视频在线观看| 亚洲四区在线观看| 岛国av在线一区| 国产精品亲子乱子伦xxxx裸| voyeur盗摄精品| 一区二区在线观看不卡| 欧美日韩国产影片| 另类小说一区二区三区| 欧美一级片免费看| 美日韩一区二区| 国产午夜亚洲精品羞羞网站| 成人av电影免费观看| 在线不卡一区二区| 免费欧美日韩国产三级电影| 国产 日韩 欧美大片| 99综合电影在线视频| 欧美一二三四区在线| 亚洲国产va精品久久久不卡综合| av不卡免费电影| 欧美不卡激情三级在线观看| 视频一区二区欧美| 91论坛在线播放| 久久九九久久九九| 久久激情五月激情| 日韩精品一区在线| 日韩福利视频导航| 欧美三区免费完整视频在线观看| 亚洲丝袜美腿综合| 91蜜桃免费观看视频| 国产精品伦一区| 国产成人精品免费一区二区| 国产蜜臀av在线一区二区三区| 国产在线播精品第三| 9191国产精品| 日韩vs国产vs欧美| 欧美日韩国产在线观看| 一区二区三区不卡视频| 欧美日韩在线播放三区| 日韩电影在线观看一区| 久久久久久久综合狠狠综合| 一区二区三区免费网站| 国产成人av电影在线观看| 日韩欧美亚洲国产另类| 精品一区二区三区免费观看| 在线观看亚洲成人| 国产在线一区观看| 国产91丝袜在线播放| 91精品国产综合久久久久久久| 日韩午夜在线观看| 亚洲va欧美va人人爽午夜| 欧美日韩综合在线| 日韩电影一区二区三区| 精品免费国产一区二区三区四区| 国产一区二区三区四区在线观看| 日本一区二区视频在线观看| 久久99国产精品久久99果冻传媒| 亚洲激情图片小说视频| 久久久久久9999| 日韩免费观看高清完整版在线观看| 91日韩在线专区| 国产成人精品综合在线观看| 婷婷亚洲久悠悠色悠在线播放| 久久精品一区二区三区不卡牛牛 | 日韩影院在线观看| 国产日韩欧美电影| 日韩欧美高清一区| 欧美自拍偷拍午夜视频| caoporn国产一区二区| 精品写真视频在线观看| 日本免费在线视频不卡一不卡二| 一二三区精品视频| 悠悠色在线精品| 亚洲欧美视频在线观看视频| 国产精品毛片无遮挡高清| 国产日产欧美一区二区三区| 精品日韩一区二区| 精品国产sm最大网站| 欧美成人午夜电影| 久久久久久免费| 久久久久国产精品免费免费搜索| 日韩亚洲欧美成人一区| 日韩午夜小视频| 国产喂奶挤奶一区二区三区| 一区二区三区欧美日| 另类小说色综合网站| 亚洲女同一区二区| 亚洲九九爱视频| av电影在线观看一区| 专区另类欧美日韩| 精品精品国产高清a毛片牛牛| 国产一区二区不卡在线| 国产精品福利影院| 欧美一级视频精品观看| 成人福利在线看| 日本午夜精品视频在线观看| 最新欧美精品一区二区三区| 日韩丝袜情趣美女图片| 91浏览器入口在线观看| 国产麻豆精品视频| 亚洲va欧美va天堂v国产综合| 国产欧美一区在线| 成人网在线免费视频| 在线亚洲免费视频| 欧美精品一区二区久久婷婷| 国产精品麻豆视频| 日本视频一区二区| av综合在线播放| 精品国内二区三区| 亚洲一区二区三区激情| 久久成人av少妇免费| 国产a久久麻豆| 91精品久久久久久久91蜜桃| 国产欧美精品一区二区三区四区| 亚洲高清久久久| 国产高清亚洲一区| 日韩视频免费直播| 亚洲综合在线电影| 成人精品视频.| 精品国产三级电影在线观看| 亚洲欧美日韩国产综合| 国产精品一区久久久久| 91麻豆精品久久久久蜜臀| 亚洲欧洲av色图| 国产91丝袜在线18| 欧美精品一区二区在线观看| 无吗不卡中文字幕| 欧美视频在线不卡| 亚洲视频在线观看一区| 蜜桃一区二区三区四区| 欧美三级中文字幕| 亚洲乱码中文字幕| 99re在线视频这里只有精品| 丝袜亚洲精品中文字幕一区| 91麻豆精品国产91久久久使用方法| 午夜久久久久久电影| 91精品一区二区三区久久久久久 | 欧美日韩精品高清| k8久久久一区二区三区| 91网站视频在线观看| 国产一本一道久久香蕉| 国内精品久久久久影院一蜜桃| 美国十次综合导航| 蜜臀久久99精品久久久画质超高清 | 亚洲国产一区二区视频| 夜夜精品浪潮av一区二区三区| 中文字幕av一区二区三区| av中文一区二区三区| 国产精品欧美精品| 91在线视频观看| 亚洲综合丝袜美腿| 在线不卡免费欧美| 九一九一国产精品| 亚洲国产精品99久久久久久久久| 国产馆精品极品| 亚洲精品少妇30p| 欧美精品xxxxbbbb| 捆绑调教美女网站视频一区| 国产日韩av一区| 欧美性猛交xxxxxx富婆| 免费看精品久久片| 国产午夜三级一区二区三| 成人视屏免费看| 日韩中文字幕1| 国产欧美精品在线观看|