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

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

?? osslib.c

?? VxWorks BSP框架源代碼包含頭文件和驅動
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* ossLib.c - O/S-independent services for vxWorks *//* Copyright 2000-2002 Wind River Systems, Inc. *//*Modification history--------------------01f,22jan02,wef  All USB memory now comes from a cacheDmaMalloc'd partition.  		 Instrument routines to get partition information.01e,25oct01,wef  changed ossMalloc to call memalign instead of malloc - it now		 returns buffers that are a multiple of a cache line size 		 aligned on a cache line boundary01d,18sep01,wef  merge from wrs.tor2_0.usb1_1-f for veloce01c,01aug01,rcb  fixed manpage generation in comments01b,07mar00,rcb  Cast handles as necessary to reflect change in handle		 definition from UINT32 to pVOID.01a,07jun99,rcb  First.*//*DESCRIPTIONImplements functions defined by ossLib.h.  See ossLib.h fora complete description of these functions.*//* includes */#include "vxWorks.h"#include "stdio.h"#include "stdlib.h"#include "string.h"#include "errnoLib.h"		/* errno */#include "sysLib.h"		/* sysClkRateGet(), etc. */#include "taskLib.h"		/* taskSpawn(), etc. */#include "semLib.h"		/* semCreate(), etc. */#include "objLib.h"		/* S_objLib_OBJ_xxxx errors */#include "tickLib.h"		/* tickGet(), etc. */#include "cacheLib.h"		/* cacheDmaMalloc, Free */#include "usb/usbPlatform.h"#include "usb/ossLib.h" 	/* Our API *//* Defines *//* #define  FILL_MEMORY */	    /* for debugging *//* Definitions related to the creation of new threads. */#define DEFAULT_OPTIONS     0	    /* task options */#define DEFAULT_STACK	    0x4000  /* Default stack size *//*  * TIMEOUT() calculates the number of ticks for a timeout from a blockFlag * parameter to one of the ossLib functions. */#define TIMEOUT(bf) (((bf) == OSS_BLOCK) ? \    WAIT_FOREVER : ((bf) + msecsPerTick - 1) / msecsPerTick)#define USB_MEM_PART_DEF_SIZE 0x10000	/* 0x10000  Default 					 * partition size - 64k 					 *//* typedefs *//* globals *//* Default to using the partition method of malloc / free. */FUNCPTR ossMallocFuncPtr;FUNCPTR ossFreeFuncPtr;/* locals */LOCAL int msecsPerTick = 55;	    /* milliseconds per system tick */				    /* value updated by ossInitialize() */LOCAL BOOL 	ossPartInitFlag = TRUE;LOCAL char *  	pUsbMemSpace; LOCAL PART_ID 	usbMemPartId;LOCAL UINT32 	usbMemPartSize = USB_MEM_PART_DEF_SIZE;LOCAL UINT32 	usbMemCount = 0;LOCAL UINT32 	ossOldInstallFlag = FALSE;/* Functions *//***************************************************************************** translateError - translates vxWorks error to S_ossLib_xxxx** Translates certain vxWorks errno values to an appropriate S_ossLib_xxxx.* This function should only be invoked when the caller has already* ascertained that a vxWorks function has returned an error.** RETURNS: S_ossLib_xxxx** ERRNO:*  S_ossLib_BAD_HANDLE*  S_ossLib_TIMEOUT*  S_ossLib_GENERAL_FAULT*/LOCAL int translateError (void)    {    switch (errno)	{	case S_objLib_OBJ_ID_ERROR:	return S_ossLib_BAD_HANDLE;	case S_objLib_OBJ_TIMEOUT:	return S_ossLib_TIMEOUT;	default:			return S_ossLib_GENERAL_FAULT;	}    }/***************************************************************************** translatePriority - translates OSS_PRIORITY_xxx to vxWorks priority** RETURNS: vxWorks task priority*/LOCAL int translatePriority    (    UINT16 priority    )    {    int curPriority;    switch (priority)	{	case OSS_PRIORITY_LOW:	case OSS_PRIORITY_TYPICAL:	case OSS_PRIORITY_HIGH:	case OSS_PRIORITY_INTERRUPT:	    return priority;	case OSS_PRIORITY_INHERIT:	default:	    taskPriorityGet (0, &curPriority);	    return curPriority;	}    }/***************************************************************************** threadHead - vxWorks taskSpawn() compatible thread entry point** ossThreadCreate() uses this intermediary function to spawn threads.  The* vxWorks taskSpawn() function passes 10 int parameters to the task entry* point.  By convention, ossThreadCreate passes the function's real entry* point in <arg1> and the thread's <param> in <arg2>..*/LOCAL int threadHead    (    int arg1,			    /* <func> in this parameter */    int arg2,			    /* <param> in this parameter */    int arg3,    int arg4,    int arg5,    int arg6,    int arg7,    int arg8,    int arg9,    int arg10    )        {    THREAD_PROTOTYPE func = (THREAD_PROTOTYPE) arg1;    pVOID param = (pVOID) arg2;    (*func) (param);    return 0;    }/***************************************************************************** ossStatus - Returns OK or ERROR and sets errno based on status** If <status> & 0xffff is not equal to zero, then sets errno to the* indicated <status> and returns ERROR.  Otherwise, does not set errno* and returns OK.** RETURNS: OK or ERROR*/STATUS ossStatus     (    int status    )    {    if ((status & 0xffff) != 0)	{	errnoSet (status);	return ERROR;	}        return OK;    }/***************************************************************************** ossShutdown - Shuts down ossLib** This function should be called once at system shutdown if an only if* the corresponding call to ossInitialize() was successful.** RETURNS: OK or ERROR*/STATUS ossShutdown (void)    {    return OK;    }/***************************************************************************** ossThreadCreate - Spawns a new thread** The ossThreadCreate() function creates a new thread which begins execution * with the specified <func>.  The <param> argument will be passed to <func>.  * The ossThreadCreate() function creates the new thread with a stack of a * default size and with no security restrictions - that is, there are no * restrictions on the use of the returned <pThreadHandle> by other threads.  * The newly created thread will execute in the same address space as the * calling thread.  <priority> specifies the thread's desired priority - in* systems which implement thread priorities, as OSS_PRIORITY_xxxx.  ** RETURNS: OK or ERROR** ERRNO:*  S_ossLib_BAD_PARAMETER*  S_ossLib_GENERAL_FAULT*/STATUS ossThreadCreate     (    THREAD_PROTOTYPE func,	    /* function to spawn as new thread */    pVOID param,		    /* Parameter to be passed to new thread */    UINT16 priority,		    /* OSS_PRIORITY_xxxx */    pCHAR name, 		    /* thread name or NULL */    pTHREAD_HANDLE pThreadHandle    /* Handle of newly spawned thread */    )    {    /* validate params */    if (pThreadHandle == NULL)	return ossStatus (S_ossLib_BAD_PARAMETER);    /* Use vxWorks to spawn a new thread (task in vxWorks parlance). */    if ((*pThreadHandle = (THREAD_HANDLE) taskSpawn (name, 	translatePriority (priority), DEFAULT_OPTIONS, DEFAULT_STACK, 	threadHead, (int) func, (int) param, 0, 0, 0, 0, 0, 0, 0, 0)) == 	(THREAD_HANDLE) ERROR)	return ossStatus (S_ossLib_GENERAL_FAULT);    return OK;    }/***************************************************************************** ossThreadDestroy - Attempts to destroy a thread** This function attempts to destroy the thread specified by <threadHandle>.** NOTE: Generally, this function should be called only after the given* thread has terminated normally.  Destroying a running thread may result* in a failure to release resources allocated by the thread.** RETURNS: OK or ERROR** ERRNO:*  S_ossLib_GENERAL_FAULT*/STATUS ossThreadDestroy     (    THREAD_HANDLE threadHandle	    /* handle of thread to be destroyed */    )    {    if (taskDelete ((int) threadHandle) == ERROR)	return ossStatus (S_ossLib_GENERAL_FAULT);    return OK;    }    /***************************************************************************** ossThreadSleep - Voluntarily relinquishes the CPU** Threads may call ossThreadSleeph() to voluntarily release the CPU to* another thread/process.  If the <msec> argument is 0, then the thread will* be reschuled for execution as soon as possible.  If the <msec> argument is* greater than 0, then the current thread will sleep for at least the number* of milliseconds specified.** RETURNS: OK or ERROR*/STATUS ossThreadSleep    (    UINT32 msec 		    /* Number of msec to sleep */    )    {    /* Delay for a number of ticks at least as long as the number of    milliseconds requested by the caller. */    taskDelay ((msec == 0) ? 0 : ((msec + msecsPerTick - 1) / msecsPerTick) + 1);    return OK;    }/***************************************************************************** ossSemCreate - Creates a new semaphore** This function creates a new semaphore and returns the handle of that* semaphore in <pSemHandle>.  The semaphore's initial count is set to* <curCount> and has a maximum count as specified by <maxCount>.** RETURNS: OK or ERROR* * ERRNO:*  S_ossLib_BAD_PARAMETER*  S_ossLib_GENERAL_FAULT*/STATUS ossSemCreate     (    UINT32 maxCount,		    /* Max count allowed for semaphore */    UINT32 curCount,		    /* initial count for semaphore */    pSEM_HANDLE pSemHandle	    /* newly created semaphore handle */    )    {    /* Validate parameters */    if (pSemHandle == NULL) 	return ossStatus (S_ossLib_BAD_PARAMETER);    if ((*pSemHandle = (SEM_HANDLE) semCCreate (SEM_Q_FIFO, curCount)) == NULL)	return ossStatus (S_ossLib_GENERAL_FAULT);    return OK;    }/***************************************************************************** ossSemDestroy - Destroys a semaphore** Destroys the semaphore <semHandle> created by ossSemCreate().** RETURNS: OK or ERROR** ERRNO:*  S_ossLib_GENERAL_FAULT*/STATUS ossSemDestroy     (    SEM_HANDLE semHandle	    /* Handle of semaphore to destroy */    )    {    if (semDelete ((SEM_ID) semHandle) != OK)	return ossStatus (S_ossLib_GENERAL_FAULT);    return OK;    }/***************************************************************************** ossSemGive - Signals a semaphore** This function signals the sepcified semaphore.  A semaphore may have more* than one outstanding signal, as specified by the maxCount parameter when* the semaphore was created by ossSemCreate().	While the semaphore is at its* maximum count, additional calls to ossSemSignal for that semaphore have no* effect.** RETURNS: OK or ERROR** ERRNO:*  S_ossLib_BAD_HANDLE*/STATUS ossSemGive    (    SEM_HANDLE semHandle	    /* semaphore to signal */    )    {    if (semGive ((SEM_ID) semHandle) != OK)	return ossStatus (S_ossLib_BAD_HANDLE);    return OK;    }/***************************************************************************** ossSemTake - Attempts to take a semaphore** ossSemTake() attempts to "take" the semaphore specified by <semHandle>.* <blockFlag> specifies the blocking behavior.	OSS_BLOCK blocks indefinitely* waiting for the semaphore to be signalled.  OSS_DONT_BLOCK does not block* and returns an error if the semaphore is not in the signalled state.	Other* values of <blockFlag> are interpreted as a count of milliseconds to wait* for the semaphore to enter the signalled state before declaring an error.** RETURNS: OK or ERROR*/STATUS ossSemTake     (    SEM_HANDLE semHandle,	    /* semaphore to take */    UINT32 blockFlag		    /* specifies blocking action */    )    {    if (semTake ((SEM_ID) semHandle, TIMEOUT (blockFlag)) != OK)	return ossStatus (translateError ());    return OK;    }/***************************************************************************** ossMutexCreate - Creates a new mutex** This function creates a new mutex and returns the handle of that* mutex in <pMutexHandle>.  The mutex is created in the "untaken" state.** RETURNS: OK or STATUS** ERRNO:*  S_ossLib_BAD_PARAMETER*  S_ossLib_GENERAL_FAULT*/STATUS ossMutexCreate     (    pMUTEX_HANDLE pMutexHandle	    /* Handle of newly created mutex */    )    {        /* Validate parameters */    if (pMutexHandle == NULL) 	return ossStatus (S_ossLib_BAD_PARAMETER);    if ((*pMutexHandle = (MUTEX_HANDLE) semMCreate (SEM_Q_FIFO)) == NULL)	return ossStatus (S_ossLib_GENERAL_FAULT);    return OK;    }/***************************************************************************** ossMutexDestroy - Destroys a mutex** Destroys the mutex <mutexHandle> created by ossMutexCreate().** RETURNS: OK or ERROR** ERRNO:

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区三区免费观看| 成人免费黄色在线| 成人污污视频在线观看| 欧美日韩久久久久久| 国产精品久久久久影院亚瑟| 麻豆精品新av中文字幕| 欧美高清性hdvideosex| 欧美大片一区二区| 午夜精品成人在线视频| 色视频成人在线观看免| 欧美激情自拍偷拍| 国产精品一卡二卡| 日韩欧美精品在线视频| 日本中文字幕不卡| 欧美猛男超大videosgay| 亚洲精品少妇30p| 在线观看欧美精品| 亚洲精品视频免费看| 成人av资源在线| 亚洲人成网站影音先锋播放| 91浏览器打开| 国产精品久久久久久久裸模| 99久久久国产精品| 亚洲精品你懂的| 宅男噜噜噜66一区二区66| 亚洲精品免费视频| 欧美一区二区三区人| 免费黄网站欧美| 久久九九影视网| 91丨porny丨首页| 五月婷婷综合在线| 中文字幕巨乱亚洲| www.色综合.com| 日韩av一区二区三区四区| 久久久久久影视| 在线观看亚洲一区| 国产精品亚洲第一区在线暖暖韩国| 欧美国产综合一区二区| 欧美日韩免费在线视频| 国产一区二区三区精品视频| 夜夜嗨av一区二区三区网页| 国产亚洲精品资源在线26u| 欧美在线一区二区三区| 91丨porny丨中文| 成人福利电影精品一区二区在线观看| 午夜电影网一区| 日韩激情在线观看| 亚洲午夜私人影院| 亚洲国产综合在线| 亚洲成人福利片| 午夜成人免费电影| 丝瓜av网站精品一区二区| 久久99国产精品久久| 亚洲国产精品久久人人爱 | 婷婷亚洲久悠悠色悠在线播放| 亚洲欧美怡红院| 亚洲欧美偷拍另类a∨色屁股| 久久精品人人做| 中文字幕在线不卡一区| 国产精品久久一级| 一区二区三区中文字幕电影 | 欧美一区二区三区成人| 精品处破学生在线二十三| 久久色视频免费观看| 国产日产欧美一区二区三区| 国产日产亚洲精品系列| 亚洲青青青在线视频| 亚洲一区二区精品视频| 三级不卡在线观看| 成人夜色视频网站在线观看| 一本大道久久精品懂色aⅴ | 在线观看av一区| 日韩欧美中文字幕公布| 国产欧美日韩在线观看| 一区二区三区四区五区视频在线观看 | 日本成人在线一区| 国产盗摄视频一区二区三区| 色综合久久九月婷婷色综合| 9191久久久久久久久久久| 国产精品午夜春色av| 免费人成在线不卡| 色吧成人激情小说| 久久久久久久久久久久久女国产乱| 亚洲视频你懂的| 国产成人啪免费观看软件 | 色综合欧美在线视频区| 精品sm在线观看| 五月天亚洲精品| 色综合中文综合网| 久久久久久久av麻豆果冻| 亚洲综合一区在线| 日本高清不卡aⅴ免费网站| 久久众筹精品私拍模特| 奇米一区二区三区av| 在线观看日产精品| 亚洲一二三专区| 在线观看欧美日本| 亚洲一区二区中文在线| 色综合网色综合| 亚洲精选一二三| 欧美视频一区二区三区在线观看| 亚洲欧美在线高清| 在线看不卡av| 午夜成人免费视频| 欧美一区二区三区在| 久久99蜜桃精品| 国产欧美一区二区精品久导航| 九九**精品视频免费播放| 久久久亚洲精品石原莉奈| 国产成人亚洲精品狼色在线| 精品少妇一区二区| 国产成人av电影在线| 综合色中文字幕| 欧日韩精品视频| 日韩国产欧美一区二区三区| 欧美一区二区三区爱爱| 国产麻豆精品一区二区| 中文字幕一区在线观看视频| 色老综合老女人久久久| 日本免费新一区视频| 亚洲国产精品高清| 欧美日韩激情一区| 国产.欧美.日韩| 日韩不卡一区二区| 亚洲成人精品一区| 国产欧美视频一区二区| 欧美在线观看一二区| 精品一区二区三区av| 亚洲综合色自拍一区| 国产午夜精品一区二区三区四区 | 欧美国产日韩精品免费观看| 在线观看免费一区| 成人黄色电影在线| 美日韩黄色大片| 一区二区在线观看免费视频播放| 精品电影一区二区| 91精品国产品国语在线不卡| 色综合天天综合给合国产| 韩国视频一区二区| 麻豆久久一区二区| 亚洲18女电影在线观看| 亚洲三级免费电影| 亚洲私人影院在线观看| 国产日产亚洲精品系列| 久久久久国产精品麻豆ai换脸| 日韩一区二区三区免费看 | 精品一区二区在线看| 精品一区二区三区免费观看| 国产高清精品网站| 久久99久久精品| 久久国内精品自在自线400部| 日本人妖一区二区| 另类的小说在线视频另类成人小视频在线 | 欧美高清性hdvideosex| 欧美久久一二区| 日韩欧美在线综合网| 日韩精品中文字幕在线不卡尤物| 日韩欧美一区在线观看| 久久久久国产精品人| 成人欧美一区二区三区视频网页| 欧美高清在线视频| 亚洲精品大片www| 亚洲成年人网站在线观看| 日本午夜精品视频在线观看| 精品在线观看视频| 不卡的看片网站| 在线电影院国产精品| 久久精品人人爽人人爽| 亚洲男人的天堂网| 久久疯狂做爰流白浆xx| av午夜一区麻豆| 91精品国产全国免费观看| 国产欧美视频一区二区| 亚洲大尺度视频在线观看| 国产美女av一区二区三区| 一本一本大道香蕉久在线精品 | 久久久国产精华| 视频一区中文字幕| 成人av综合在线| 久久午夜老司机| 久色婷婷小香蕉久久| 99久久精品国产网站| 久久婷婷久久一区二区三区| 亚洲高清一区二区三区| 97成人超碰视| 久久精品在线免费观看| 石原莉奈一区二区三区在线观看 | 美国毛片一区二区三区| 欧美综合一区二区三区| 欧美韩日一区二区三区四区| 久久精品国产久精国产爱| 欧美特级限制片免费在线观看| 国产欧美日本一区视频| 国产在线精品视频| 精品99一区二区三区| 久久久久国产精品人| 久久精品999| 久久蜜桃一区二区| 成人性生交大合| 欧美国产禁国产网站cc|