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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? altivec.c

?? ge公司的dv4av4信號(hào)處理板的bsp源代碼
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/* altivec.c - Altivec support functions */

/*

  $RCSfile: altivec.c $

  Copyright 2000 by Ixthos, Inc.  All Rights Reserved.

  $Revision: 1.8 $

  $Name: AV4-ISP-R1.2-1 AV4-ISP-R1.2-0 HMTST2 HMTST1 DVT_AV4_4.101 AV4-VSP-R1.0-2 AV4-VSP-R1.0 CT-ISP-1.1 AV4 ISP 1.1 CT_R0.1_AV4/CAV4 champtools2.22 CAV4_CP1 CHAMPtools FW 3.0 champtools2.21_1215 champtools2.21 champ221_build1 champtools2.2 $  $State: Developmental $  $Locker: $

  $Source: L:/SWRND/champAV2/src/vx/src/drv/altivec/rcs/altivec.c $

  RCS Project Name: vx_7xx

  Target: IXA board, 750/7400 processors

  DESCRIPTION
  This library provides task hook functions that save and
  restore the altivec registers during context switches.

  BSP CONFIGURATION

  This function must be included within the BSP.  The function
  sysAltivecInit must be called first to install task switch 
  hooks.  This must be called after the OS is initialized but
  before the first Altivec functions are called; calling from
  sysHwInit2 is recommended.
 
  Tasks wishing to use the Altivec should be created with the
  option VX_ALTIVEC.  Such tasks will be allocated an Altivec
  register save area, and have the Altivec enable bit in the
  MSR set.

  Alternately, each task wishing to use the Altivec should call
  the function sysAltivecEnable.  This creates the register
  save area, saves the Altivec context (if it was busy), and
  sets the Altivec enable bit within the MSR.

  INCLUDE FILES:

  SEE ALSO:

  $Log: altivec.c $
  Revision 1.8  2004/07/30 18:52:37Z  dsessler
  now using proctypes in bsl.h; Probe should now return OK for 7410,7400,7447,7447A;
  Enable now calls Probe to check proctype.
  Revision 1.7  2003/05/21 21:01:25  dsessler
  T2.2 fix for paths of included files under the bsp
  Revision 1.6  2002/05/14 18:57:01  coopertr
  Revision 1.5  2002/05/14 14:38:35  dsessler
  Had old copy.
  Revision 1.7  2001/12/13 13:33:13  coopertr
  Modified to check for valid register save area address before
  saving/restoring AltiVec registers
  Revision 1.6  2001/10/17 12:45:03  coopertr
  Modified for Tornado 2.1 support.  If INCLUDE_ALTIVEC is defined
  (indicating OS support for the Altivec), then the functions in this source
  file are configured for OS support of the AltiVec.
  Revision 1.5  2001/05/16 14:55:29  seckardt
  Removed PROCTYPE_MPC_7400 definition; it is already in ixa.h.
  Revision 1.4  2000/10/31 18:37:09  dbratton
  Updated for man pages.
  Revision 1.3  2000/10/24 10:40:54  coopertr
  Modified to create task in non-Java mode
  Revision 1.2  2000/10/17 14:43:06  coopertr
  Added altivec.h file
  Revision 1.1  2000/09/26 10:39:00  coopertr
  Initial revision

*/


/* includes */

#include <vxWorks.h>
#include <memLib.h>
#include <taskLib.h>
#include <taskHookLib.h>
#include "h/drv/altivec/altivec.h"
#include "bsl.h"

/* defines */

#define MSR_ALTIVEC_ENABLE	0x02000000	/* enable AV in MSR 	*/
#define NJ			0x00010000	/* non-Java mode	*/
#define VSCR_PTR(x)		(((unsigned long *)(x))+32*4)



/*  the support method used is different for Tornado 2.1
    Altivec support (indicated by INCLUDE_ALTIVEC) versus
    non-Tornado support.                                  */


#ifdef INCLUDE_ALTIVEC

LOCAL void taskCreateAV (WIND_TCB *t);
LOCAL void setAltivecNonJavaMode (void);
extern void *_func_altivecProbeRtn;

#else  /* INCLUDE_ALTIVEC */

LOCAL void taskCreateAV (WIND_TCB *t);
LOCAL void taskDeleteAV (WIND_TCB *t);
LOCAL void taskSwitchAV (WIND_TCB *old, WIND_TCB *new);


/*
 *  This pointer remembers the TCB address which last owned
 *  the Altivec registers.  If this pointer is zero, then
 *  the Altivec registers contain no interesting values,
 *  and they may be overwritten freely.  If the pointer is
 *  nonzero, then the indicated task owns the register values,
 *  and the context switch hook must save the registers on
 *  behalf of that task before switching to another task 
 *  that uses the Altivec registers.
 */

static WIND_TCB *currentAVTask = 0;

#endif  /* INCLUDE_ALTIVEC */

/* MACRO Definition for sysAltivecProbe Dino M. Diab Compiler */

#ifdef __DCC__

asm int getAltivecExt()
{
!"r3"
	mfspr 3,287

}

#endif


/***********************************************************
*
* sysAltivecProbe - Determine if the processor has AltiVec
* extensions.
*
* This function examines the processor version register to
* determine if the processor includes AltiVec technology.
* The function returns SUCCESS if the processor
* does indeed support the AltiVec.
*
* SEE ALSO: sysAltivecEnable()
* NOMANUAL
*/

static int sysAltivecProbe 
    (
    void
    )
{ 
    unsigned long proctype, status;
    status   = 1;
    proctype = 0;
    
#ifdef __DCC__ 
   proctype = getAltivecExt();
#else 
    __asm__ (" mfspr %0,287" : "=r" (proctype));   /* read PVR */
#endif

    proctype >>= 16;

    if ((proctype == MPC7400) || (proctype == MPC7410) || 
        (proctype == MPC7447_7457) || (proctype == MPC7447A) || (proctype == MPC7448))
    {
       status = 0;
    }
    return (status); 
}


/***********************************************************
*
* sysAltivecInit - Install Altivec task hooks
*
* This function installs task management hooks for the Altivec.
* This function should be called once during system initialization, 
* before any Altivec tasks are created.  This function has no 
* effect if called on a non-altivec processor.
*
* RETURNS: None
*
* SEE ALSO: sysAlitivecEnable()
* NOMANUAL
*/


void sysAltivecInit
    (
    void
    )
    {
    static int firsttime = 1;
    unsigned long ilock;


    /*
     *  Verify that we are running on an Altivec.
     */

    if (sysAltivecProbe ())
        return;

    ilock = intLock ();

#ifndef INCLUDE_ALTIVEC
    if (firsttime)
        {
        firsttime = 0;
        taskDeleteHookAdd ((FUNCPTR) taskDeleteAV);
        taskCreateHookAdd ((FUNCPTR) taskCreateAV);
        taskSwitchHookAdd ((FUNCPTR) taskSwitchAV);
        }
#else
    if (firsttime)
        {
        firsttime = 0;
        taskCreateHookAdd ((FUNCPTR) taskCreateAV);
        _func_altivecProbeRtn = sysAltivecProbe;
        altivecInit ();
        }
#endif

    intUnlock (ilock);

    return;
    }
    
/***********************************************************
*
* sysAltivecEnable - Enable the Altivec for the calling task
*
* This function enables the Altivec for the task that calls this
* function.  This function may not be called from an ISR.
* This function allocates a register save area for Altivec
* registers.  If the Altivec registers are live (containing data
* from another task) when this call is made, then this function
* saves the altivec registers as part of the context of the task
* which last used the altivec.
*
* If INCLUDE_ALTIVEC is defined, this indicates that the OS 
* supports AltiVec technology.  In this case, this function
* verifies that the calling task has been created with
* altivec enabled, and sets the mode to non-Java mode.  If
* the task was not created with AltiVec enabled, this function
* returns an error status.
*
* NOTE: This function sets the non-Java (NJ) bit within vscr.
*
* RETURNS: 0 for success;  -1 if the processor is not an altivec,
*          -2 = not called from a task, -3 = could not malloc
*          register save area, -4 = task not created with altivec
*          option enabled.
*
* SEE ALSO: sysAltivecInit()
*/

int sysAltivecEnable 
    (
    void
    )
    {
#ifndef INCLUDE_ALTIVEC
    unsigned long proctype, ilock;
    int status = 0;
    WIND_TCB *mytcb;


    /*
     *  Verify that we are running on an Altivec.
     */

    if (sysAltivecProbe ())
        return (-1);



    /*
     *  Install task management OS hooks if needed.
     */

    sysAltivecInit ();



    /*
     *  Obtain the TCB address of the calling task.
     */

    if ((mytcb = taskTcb (taskIdSelf ())) == 0)
        return (-2);



    ilock = intLock ();

    /*
     *  If no register save area exists, allocate one now
     */

    if (mytcb->ALTIVEC_RSAVE == 0)
        {
        mytcb->options |= VX_ALTIVEC;

        taskCreateAV (mytcb);

        if (mytcb->ALTIVEC_RSAVE == 0)
            status = -3;

        else
            {
            /*
             *  If an altivec task is currently active,
             *  save its registers.  Reload "our" registers.
             */

            if (currentAVTask != 0 && currentAVTask->ALTIVEC_RSAVE != 0)
                sysAltivecStore ((void *) (currentAVTask->ALTIVEC_RSAVE));

            /*
             *  Set NJ mode of last 32 bit word within VSCR
             */

            VSCR_PTR(mytcb->ALTIVEC_RSAVE)[3] |= NJ;

            sysAltivecLoad ((void *) (mytcb->ALTIVEC_RSAVE));

            currentAVTask = mytcb;

 
            /*
             *  Enable the Altivec bit within MSR.  Set
             *  spr 256 to all 1's indicating all regs
             *  are active.
             */

            __asm__ ("  mfmsr  3
                        or     3,3,%0
                        mtmsr  3  
                        sync
                        li     3,-1
                        mtspr  256,3"
                        : : "r" (MSR_ALTIVEC_ENABLE) : "3");
            }
        }

    intUnlock (ilock);

    return (status);

#else
    /*
     *  Place AltiVec in Java mode.  The calling task must be
	 *  created with AltiVec enabled.
     */

    setAltivecNonJavaMode ();

    return (0);
#endif
    }

/***********************************************************
*
* taskCreateAV - Altivec task create hook
*
* This local function clears the ALTIVEC RSAVE field within the TCB,
* indicating the task is not altivec enabled.  If the ALTIVEC option
* is set, this function creates and clears a register save area
* for the Altivec, and sets the Altivec enable bit within the MSR.
* The VSCR register is set to indicate non-Java mode.
* Note that this hook is installed only for Altivec processors.
*
* If INCLUDE_ALTIVEC is set, this task switch hook translates
* the option field so that the older, non-vxWorks altivec
* option introduced in our past BSPs is translated into the
* newer vxWorks compatible option.
*
* SEE ALSO: taskSwitchAV(), taskDeleteAV()
*/

LOCAL void taskCreateAV 
    (
    WIND_TCB *t		/* pointer to TCB of task being created */
    )
    {
#ifndef INCLUDE_ALTIVEC
    int i;
    unsigned long *rsave; 

    t->ALTIVEC_RSAVE = 0;

    if (t->options & VX_ALTIVEC)
        {
        if ((rsave = memalign (32, 4*ALTIVEC_RSAVE_SIZE)) != 0)
            {
            (void *) (t->ALTIVEC_RSAVE) = rsave;

            for (i = 0; i < ALTIVEC_RSAVE_SIZE; i++)
                rsave[i] = 0;

            VSCR_PTR(rsave)[3] |= NJ;

            t->regs.msr |= MSR_ALTIVEC_ENABLE;
            }
        }
#else
    if (t->options & VX_ALTIVEC)
        {
        t->options &= ~VX_ALTIVEC;
        t->options |= VX_ALTIVEC_TASK;
        }
#endif
    }

/***********************************************************
*
* taskDeleteAV - Altivec task delete hook
*
* This local function is installed as the task delete hook.
* If the task being deleted has an altivec register save area
* allocated, then this function frees that area.
*
* If the task being deleted is the last task to use Altivec
* registers, then clear currentAVTask.  This prevents the
* context switch hook from saving registers for this task
* when switching to a new task.
*
* SEE ALSO: taskSwitchAV(), taskCreateAV()
*/

#ifndef INCLUDE_ALTIVEC
LOCAL void taskDeleteAV 
    (
    WIND_TCB *t		/* pointer to TCB of task being deleted */
    )
    {
    /*
     *  If the task being deleted owns the Altivec
     *  registers (indicated by t == current task),
     *  then set the current task pointer to zero.
     *  This signifies that no task owns the Altivec 
     *  registers at this time, and that they need to 
     *  be reloaded when a context switch to an
     *  Altivec task occurs.
     */

    if (t == currentAVTask)
        currentAVTask = 0;

    /*
     *  If the task being deleted had an Altivec 
     *  register area, then free it up now.
     */

    if ((t->regs.msr & MSR_ALTIVEC_ENABLE) && t->ALTIVEC_RSAVE)
        {
        free ((void *) (t->ALTIVEC_RSAVE));

        t->ALTIVEC_RSAVE = 0;
        }
    }
#endif

/*******************************************************************************
*
* taskSwitchAV - Altivec task switch hook
*
* This local function is installed as the task switch hook.
* If we are switching into an Altivec enabled task,
* then we need to load registers from the TCB's
* Altivec register save area.
*
* Furthermore, if the Altivec registers still contain
* live values from another task, then we need to 
* save those registers within the task's register
* save area.
*
* If the Altivec registers contain live data from 
* the task to which we are switching, then no action
* is needed.
*
* SEE ALSO: taskCreateAV(), taskDeleteAV()
*/

#ifndef INCLUDE_ALTIVEC
LOCAL void taskSwitchAV 
    (
    WIND_TCB *old, 	/* ptr to tcb being switched out */
    WIND_TCB *new	/* ptr to tcb being switched in */
    )

    {
    /*
     *  If the new TCB does not require Altivec  
     *  support, then exit.
     */

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文一区在线播放| 国产精品美女久久久久久久久久久| 成人午夜精品在线| 国产在线看一区| 精品在线观看视频| 蜜桃av一区二区| 久久99热国产| 国内精品不卡在线| 国产原创一区二区| 国产精品456| 国产91丝袜在线播放| 丁香一区二区三区| 成人一二三区视频| 91亚洲国产成人精品一区二区三| 91日韩在线专区| 色www精品视频在线观看| 色婷婷综合激情| 欧洲一区在线观看| 欧美精品777| 日韩欧美一区二区在线视频| 欧美一区日韩一区| 欧美精品一区二区久久久| 久久综合五月天婷婷伊人| 久久久www成人免费毛片麻豆 | 性感美女极品91精品| 亚洲一区二区在线免费看| 亚洲国产日日夜夜| 偷偷要91色婷婷| 黄色资源网久久资源365| 国产美女久久久久| 99re66热这里只有精品3直播| 色狠狠综合天天综合综合| 欧美日韩国产免费| 欧美电影精品一区二区| 久草在线在线精品观看| 狠狠色狠狠色综合系列| 成人国产亚洲欧美成人综合网| 99re视频这里只有精品| 色婷婷av一区二区三区大白胸| 欧美日韩高清一区| 26uuu国产一区二区三区| 国产精品久久久久婷婷| 亚洲一区二区三区三| 久久国产精品99精品国产| 美女视频网站久久| 91精品国产综合久久久久久久久久 | 1000精品久久久久久久久| 夜夜爽夜夜爽精品视频| 蜜桃精品在线观看| 成人av资源网站| 欧美日韩国产一区| 国产亚洲视频系列| 亚洲午夜视频在线观看| 国产专区欧美精品| 91福利小视频| 久久久噜噜噜久久人人看 | 日韩区在线观看| 国产精品初高中害羞小美女文| 亚洲成人你懂的| 国产成人亚洲精品狼色在线| 在线一区二区三区| 久久精品亚洲一区二区三区浴池| 一区在线播放视频| 日韩码欧中文字| 日韩极品在线观看| av中文字幕不卡| 日韩欧美色电影| 一区二区三区四区国产精品| 韩国精品主播一区二区在线观看| 一本色道久久综合亚洲aⅴ蜜桃 | 欧美一区二区高清| 亚洲人成精品久久久久| 另类小说综合欧美亚洲| 色av一区二区| 中文字幕 久热精品 视频在线| 琪琪一区二区三区| 欧美中文字幕不卡| 国产精品美女久久久久久久久 | 色综合天天综合网天天狠天天| 欧美岛国在线观看| 亚洲国产一二三| 99国产精品久| 久久精品夜色噜噜亚洲aⅴ| 偷偷要91色婷婷| 色婷婷av一区二区三区软件 | 91精品国产日韩91久久久久久| 国产精品美女久久久久久久| 精品一区二区免费看| 欧美人体做爰大胆视频| 亚洲欧美国产三级| 99视频精品免费视频| 国产农村妇女精品| 精品一区二区三区免费视频| 在线综合+亚洲+欧美中文字幕| 一区二区三区在线播| 成人免费高清在线观看| 久久精品欧美一区二区三区麻豆| 久久精品国产免费看久久精品| 欧美美女bb生活片| 亚洲va韩国va欧美va| 在线精品视频一区二区三四| 亚洲三级小视频| av在线不卡电影| 国产精品久久久久久久午夜片| 欧美一区二区视频网站| 欧美成人aa大片| 蜜桃视频在线一区| 欧美一区二区三区色| 日韩高清中文字幕一区| 欧美日韩五月天| 亚洲1区2区3区4区| 欧美日韩国产天堂| 视频一区二区国产| 91麻豆精品国产91| 久久国产精品无码网站| 精品国产自在久精品国产| 日本成人中文字幕在线视频| 91精品免费观看| 裸体健美xxxx欧美裸体表演| 欧美成人性战久久| 国模冰冰炮一区二区| 久久久久99精品国产片| 风间由美一区二区av101 | 国产偷国产偷精品高清尤物| 国产一区 二区 三区一级| 久久精品在线观看| av不卡免费电影| 亚洲精品国产成人久久av盗摄 | 久久蜜桃一区二区| 丰满放荡岳乱妇91ww| 中文字幕一区二区三区四区| 色婷婷精品久久二区二区蜜臂av | 欧美电视剧免费观看| 国产激情视频一区二区三区欧美 | 蜜臀av一级做a爰片久久| 欧美成人video| 成人国产精品免费网站| 亚洲小少妇裸体bbw| 欧美一区二区三区播放老司机| 精品无码三级在线观看视频| 国产精品入口麻豆九色| 欧美亚洲日本一区| 久久av中文字幕片| 中文字幕一区二区三区在线播放| 欧美三级电影精品| 国产一区在线视频| 亚洲欧美日韩国产一区二区三区| 欧美精品一二三四| 国产黄色精品视频| 亚洲国产一区二区视频| 久久久九九九九| 色8久久精品久久久久久蜜| 日本不卡不码高清免费观看| 国产婷婷色一区二区三区 | 国产精品久久久久久久第一福利| 在线一区二区三区四区五区| 久久99在线观看| 亚洲精品综合在线| 粉嫩欧美一区二区三区高清影视| 精品日韩99亚洲| av在线播放不卡| 男女性色大片免费观看一区二区 | 在线亚洲+欧美+日本专区| 人人精品人人爱| 国产精品黄色在线观看| 91麻豆精品国产91久久久久久久久| 国产露脸91国语对白| 亚洲一二三四区不卡| 国产亚洲欧美中文| 91精品婷婷国产综合久久| 成人美女视频在线观看18| 色噜噜狠狠色综合中国| 久久精品国产久精国产爱| 亚洲美女视频在线观看| 久久久噜噜噜久久中文字幕色伊伊| 日本道免费精品一区二区三区| 国产一区二区三区不卡在线观看 | 亚洲精品国产高清久久伦理二区| 久久综合色8888| 欧美美女激情18p| 91视频在线观看免费| 国产乱码字幕精品高清av | 蜜桃视频在线一区| 一区二区不卡在线播放| 中文一区在线播放| 精品国产亚洲一区二区三区在线观看| 色先锋久久av资源部| 国产成人在线电影| 老司机午夜精品| 偷拍一区二区三区四区| 亚洲情趣在线观看| 中文幕一区二区三区久久蜜桃| 欧美一级欧美三级| 欧美日韩精品久久久| 色噜噜狠狠一区二区三区果冻| 高清不卡一区二区在线| 国产制服丝袜一区| 久久精品国产亚洲5555| 日本怡春院一区二区| 性感美女极品91精品|