亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
在线播放国产精品二区一二区四区| 国产精品77777竹菊影视小说| 欧美mv日韩mv国产网站app| 成人激情小说乱人伦| 天天色天天爱天天射综合| 久久久久久电影| 884aa四虎影成人精品一区| 成人丝袜18视频在线观看| 欧美日韩在线观看一区二区| 久久九九久久九九| 欧美日韩精品久久久| www.亚洲在线| 久久99精品久久久久| 图片区小说区区亚洲影院| 亚洲桃色在线一区| 国产农村妇女毛片精品久久麻豆 | 亚洲精品国产无天堂网2021| 久久久噜噜噜久久中文字幕色伊伊| 欧美日韩另类一区| 日本久久精品电影| 91在线你懂得| 成人免费高清在线| 从欧美一区二区三区| 国产大陆精品国产| 国产精品99久久久久久有的能看| 免费观看在线综合色| 午夜精品爽啪视频| 亚洲风情在线资源站| 亚洲综合激情网| 亚洲一区二区av在线| 亚洲美女屁股眼交| 亚洲品质自拍视频网站| 国产精品嫩草影院com| 国产精品久久毛片a| 国产精品萝li| 日韩美女精品在线| 亚洲欧美视频一区| 一区二区三区日韩欧美| 一区二区三区四区不卡在线| 亚洲免费视频中文字幕| 一区二区三区在线免费播放| 亚洲卡通欧美制服中文| 一区二区三区精品| 亚洲福利视频三区| 日韩成人午夜精品| 久久精品国产精品亚洲综合| 国产一区视频导航| 丁香啪啪综合成人亚洲小说| 菠萝蜜视频在线观看一区| aaa国产一区| 欧美少妇bbb| 欧美一级黄色录像| 久久先锋资源网| 国产欧美日韩在线看| 日韩理论片中文av| 亚洲成a人片在线观看中文| 午夜不卡av免费| 韩国精品在线观看| 成人精品国产免费网站| 色哟哟一区二区在线观看| 欧美日韩视频第一区| 日韩一区和二区| 欧美变态tickling挠脚心| 久久免费偷拍视频| 成人免费在线观看入口| 亚洲午夜日本在线观看| 精品一区二区三区影院在线午夜| 国产**成人网毛片九色| 一本大道久久a久久综合| 777色狠狠一区二区三区| 国产午夜精品久久久久久久| 日韩美女久久久| 蜜臀av一区二区在线免费观看| 国产成人精品免费看| 欧美亚洲综合一区| 久久久综合视频| 亚洲精品视频在线看| 免费av成人在线| 99在线视频精品| 欧美一级黄色录像| 国产精品护士白丝一区av| 亚洲aaa精品| 成人三级伦理片| 精品视频1区2区| 欧美激情在线一区二区| 日韩精品免费视频人成| 成人永久看片免费视频天堂| 欧美色手机在线观看| 久久精品亚洲一区二区三区浴池| 亚洲精品ww久久久久久p站| 国产在线播放一区| 欧美日韩一级片在线观看| 欧美国产成人精品| 蜜桃一区二区三区在线观看| 91亚洲精品一区二区乱码| 精品国产一区二区三区四区四| 一区二区三区丝袜| 波多野结衣亚洲一区| 日韩美女天天操| 亚洲国产日韩一级| 成人av资源站| 欧美精品一区二区三区高清aⅴ | 国产成人综合网| 69久久夜色精品国产69蝌蚪网| 亚洲天堂2014| 成人丝袜18视频在线观看| 精品国产制服丝袜高跟| 日韩专区中文字幕一区二区| 色狠狠一区二区三区香蕉| 国产精品网站一区| 国产精品一二三四| 日韩免费观看高清完整版 | 国产一区二区三区在线观看精品| 欧美日韩第一区日日骚| 日韩理论电影院| 成人黄色电影在线| 亚洲国产成人在线| 国产一区二区福利| 久久婷婷久久一区二区三区| 91啪九色porn原创视频在线观看| 日本韩国视频一区二区| 国产亚洲自拍一区| 男男成人高潮片免费网站| 欧美日韩一区二区欧美激情| 亚洲精品ww久久久久久p站| 91网上在线视频| 中文字幕一区二区三| 国产91精品欧美| 国产片一区二区| 国产乱码精品一区二区三区五月婷| 日韩欧美视频在线| 首页国产欧美久久| 欧美高清视频不卡网| 日韩激情一二三区| 欧美一区二区视频在线观看| 日韩av一级片| 777奇米成人网| 久久99精品久久久久久动态图| 欧美v国产在线一区二区三区| 久久精品99久久久| 久久蜜臀中文字幕| 成人一区二区三区在线观看| 中文字幕av一区二区三区高| 97精品视频在线观看自产线路二| 亚洲精品国产一区二区精华液 | 日本一区二区三区电影| 国产乱人伦偷精品视频不卡| 国产日韩一级二级三级| 成人中文字幕电影| 日韩理论在线观看| 色爱区综合激月婷婷| 亚洲韩国精品一区| 欧美一区二区三区精品| 精品一区免费av| 国产精品网站一区| 日本福利一区二区| 日韩电影免费在线观看网站| 精品日韩一区二区| 99视频精品在线| 图片区日韩欧美亚洲| 2019国产精品| 91原创在线视频| 三级久久三级久久| 久久精品在线免费观看| 一本一道久久a久久精品综合蜜臀| 午夜激情久久久| 2019国产精品| 欧美自拍偷拍午夜视频| 蓝色福利精品导航| 亚洲三级理论片| 欧美一区二区三区四区在线观看| 国产成人免费视频| 夜夜揉揉日日人人青青一国产精品| 日韩三级精品电影久久久| 丁香五精品蜜臀久久久久99网站| 亚洲一区二区黄色| 久久久久国色av免费看影院| 91免费在线播放| 久久99精品久久久久久久久久久久 | 夜夜嗨av一区二区三区中文字幕| 这里只有精品99re| 91在线精品一区二区三区| 天天综合日日夜夜精品| 国产精品久久久久久久蜜臀| 日韩亚洲欧美高清| 91日韩精品一区| 经典三级视频一区| 亚洲国产你懂的| 国产欧美一区视频| 欧美一级久久久久久久大片| 91麻豆精品秘密| 国内精品写真在线观看| 性做久久久久久免费观看| 国产欧美一区二区三区在线看蜜臀 | 欧美电视剧免费全集观看| 色综合婷婷久久| 韩国精品一区二区| 亚洲成人精品一区| 中文字幕一区二区三区视频| 久久综合色天天久久综合图片|