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

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

?? unixlib.c

?? vxwork源代碼
?? C
字號:
/* unixLib.c - UNIX kernel compatability library *//* Copyright 1984 - 2001 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------02o,15oct01,rae  merge from truestack ver 02r, base 02n (SPR 32626 etc.)02n,25nov97,vin  changed mBufClGet() to netTupleGet().02m,14nov97,vin  added panic hook.02l,08mar97,vin  added hashinit() for pcb hash look ups (FREEBSD 2.2.1).02k,03dec96,vin  added _netMalloc(..) & _netFree(..) which use network buffers02j,19mar95,dvs  removed tron references.02i,15nov94,tmk  added 29k fix from philm02h,07nov94,tmk  added MC68LC040 support.02g,31oct94,kdl  merge cleanup.02f,02aug94,tpr  added MC68060 cpu support.02e,09jun93,hdn  added a support for I80X8602d,29jul92,smb  moved perror() to fioLib.c.02c,17jun92,jwt  removed SPARC from !PORTABLE list - it no longer works.02b,16jun92,jwt  added SPARC to !PORTABLE list; fixed 02a version number.02a,26may92,rrr  the tree shuffle		  -changed includes to have absolute path from h/01z,17oct91,yao  added support for CPU32.01y,04oct91,rrr  passed through the ansification filter		  -changed includes to have absolute path from h/		  -fixed #else and #endif		  -changed VOID to void		  -changed copyright notice01x,26aug91,rrr  clean up function decls01w,23jul91,hdn  added conditional macro for optimized TRON codes.01v,26apr91,hdn  modified to use portable version of checksum routine.01u,26jun90,jcf  added semSplSemInit ().  Changed splSem to mutex.01t,20mar90,jcf  added timeout of WAIT_FOREVER to semTake calls.01s,18mar90,hjb  ifdef's to use optimized assembly checksum routine for 68k.01r,20aug89,gae  #if'd out un-portable in_cksum.01q,16apr89,gae  updated to 4.3BSD.01p,15oct88,dnw  changed name of sleep() to ksleep() to avoid confusion		   with C library routine of same name.		 changed 'panic' to not suspend unless panicSuspend=TRUE.01o,22jun88,dnw  removed ovbcopy(), copyin(), copyout(), and imin() which		   are now macros in systm.h.		 made spl...() use taskIdCurrent directly.		 made spl...() return 0/1 for "previous level" instead of		   task id.01n,29may88,dnw  removed bcmp() and bzero() now in bLib.		 changed to v4 names.01m,04may88,jcf  changed splSem to splSemId, and sem calls for new semLib.01l,28jan88,jcf  made kernel independent.01k,23jan88,rdc  brought back spl routines because of size issues.01j,04jan88,rdc  made spl{net,imp,x} macro's in systm.h01i,17nov87,dnw  removed printStatus from perror.01h,13nov87,rdc  added perror;01g,22oct87,ecs  delinted.01f,02may87,dnw  added suspend to panic().01e,03apr87,ecs  added copyright.01d,02apr87,jlf  delinted.01c,27feb87,dnw  change myTaskId() to vxMyTaskId().01b,22dec86,dnw  added bcmp.01a,28jul86,rdc  written.*//*DESCRIPTIONThis library provides routines that simulate or replace Unix kernel functionsthat are used in the network code.  This includes the spl...() processorlevel locking routines, wakeup() and sleep() (renamed ksleep() to avoidconfusion with the C library routine called sleep()), perror() and panic(),and a checksum routine.*/#include "vxWorks.h"#include "semLib.h"#include "sys/types.h"#include "net/mbuf.h"#include "taskLib.h"#include "netinet/in.h"#include "netinet/in_systm.h"#include "lstLib.h"#include "net/systm.h"#include "logLib.h"#include "intLib.h"#ifdef WV_INSTRUMENTATION#ifdef INCLUDE_WVNET#include "wvNetLib.h"#endif#endif/* local variables */#ifdef WV_INSTRUMENTATION#ifdef INCLUDE_WVNET    /* Set common fields of event identifiers for this module. */LOCAL UCHAR wvNetModuleId = WV_NET_UNIXLIB_MODULE; /* Value for unixLib.c */LOCAL UCHAR wvNetLocalFilter = WV_NET_NONE;     /* Available event filter */LOCAL ULONG wvNetEventId;       /* Event identifier: see wvNetLib.h */#endif    /* INCLUDE_WVNET */#endif/* global variables */BOOL   panicSuspend;		/* TRUE = suspend task causing panic */#ifndef VIRTUAL_STACKint    splTid;			/* owner of network processor level semaphore */SEM_ID splSemId;		/* spl mutex semaphore id */#else#include "netinet/vsLib.h"#endif /* VIRTUAL_STACK */int mutexOptionsUnixLib = SEM_Q_PRIORITY | SEM_DELETE_SAFE | SEM_INVERSION_SAFE;FUNCPTR	_panicHook = NULL;	/* panicHook for error recovery mechanism *//********************************************************************************* splSemInit - initialize the semaphore used by splnet, splimp, etc.** This routine is called by netLibInit () to initialize the spl semaphore.** NOMANUAL*/void splSemInit ()    {    splSemId = semMCreate (mutexOptionsUnixLib);    }/******************************************************************************** splnet - set network processor level** splnet may be used to insure mutual exclusion among processes which* share common network data structures.  In UNIXland, this is done by* setting the processor interrupt level.  Here in VxWorksLand, however,* we use a simple semaphore mechanism.  splx should be called after* completion of the critical section.  We must check first to see if we're* already at network level.** RETURNS: previous "processor level"*/int splnet ()    {    if ((ULONG) taskIdCurrent == splTid)	return (1);    semTake (splSemId, WAIT_FOREVER);    splTid = (ULONG) taskIdCurrent;    return (0);    }/******************************************************************************** splnet2 - set network processor level _immediately_** WARNING:  Calling this routine with a timeout that is not WAIT_FOREVR *           is a violation of mutual exclusion and will cause problems in*           a running system.*           The caller must have very specific knowledge of the state of*           the networking system.** RETURNS: previous "processor level"*/int splnet2 (timeout)    int timeout;		/* Number of ticks to wait spl semaphore */    {    if ((ULONG) taskIdCurrent == splTid)        return (1);    semTake (splSemId, timeout);    splTid = (ULONG) taskIdCurrent;    return (0);    }/********************************************************************************* splimp - set imp processor level** This routine is indentical to splnet().* Currently, all network interlocking uses the same network semaphore.** RETURNS: previous "processor level"*/int splimp ()    {    if ((ULONG) taskIdCurrent == splTid)	return (1);    semTake (splSemId, WAIT_FOREVER);    splTid = (ULONG) taskIdCurrent;    return (0);    }/********************************************************************************* splx - set processor level** splx is used in UNIX to restore the processor level.* It is used in VxWorks in conjunction with splnet() and splimp() to provide* mutual exclusion of network data structures.  splx marks the end of the* critical section.*/void splx (x)    int x;	/* processor level to restore */    {    if (x == 0)	{	splTid = 0;	semGive (splSemId);	}    }/********************************************************************************* ksleep -  put a process to sleep** In Unix, processes can sleep on any value (typically an address).* In VxWorks, we substitute a semaphore mechanism so sleep()* calls have to be changed to provide the address of a semaphore.** Note: In Unix there are two "sleep" routines.  In the kernel, the sleep* routine causes a process to block until a wakeup is done on the same* value that sleep was called with.  This routine, and the wakeup routine* below, are replacements for that mechanism.  However, in the C library* there is another sleep() routine that will suspend a process for a* specified number of seconds.  Since VxWorks users porting an application* may have calls to the latter but not the former, there is potential for* vast confusion.  Thus this routine has been renamed "ksleep" ("kernel sleep")* and all calls to it in network code have been changed.*/void ksleep (semId)    SEM_ID semId;    {    BOOL hadSplSem;    /* first see if we've got the network semaphore (splSemId);     * if so, give it, and then take it back when we are awakened.     */    hadSplSem = (splTid == (ULONG) taskIdCurrent);    if (hadSplSem)	{	splTid = 0;	semGive (splSemId);	}    semTake (semId, WAIT_FOREVER);    if (hadSplSem)	{	semTake (splSemId, WAIT_FOREVER);	splTid = (ULONG) taskIdCurrent;	}    }/********************************************************************************* wakeup - wakeup a sleeping process*/void wakeup (semId)    SEM_ID semId;    {    semGive (semId);    }#ifdef unixLib_PORTABLE/********************************************************************************* _insque - insert node in list after specified node.** Portable version of _insque ().*/void _insque (pNode, pPrev)    NODE *pNode;    NODE *pPrev;    {    NODE *pNext;    pNext = pPrev->next;    pPrev->next = pNode;    pNext->previous = pNode;    pNode->next = pNext;    pNode->previous = pPrev;    }/********************************************************************************* _remque - remove specified node in list.** Portable version of _remque ().*/void _remque (pNode)    NODE *pNode;    {    pNode->previous->next = pNode->next;    pNode->next->previous = pNode->previous;    }#endif	/* unixLib_PORTABLE *//********************************************************************************* panic - something is very wrong** panic simply logs a message to the console prepended with "panic".* If the panic occurs at task level, the current task is suspended.*/void panic (msg)    char *msg;    {    /* execute the panic hook if one exists */    if (_panicHook != NULL)        {        (*_panicHook) (msg);         return;         }            logMsg ("panic: %s\n", (int)msg, 0,0,0,0,0);    if (!intContext () && panicSuspend)	taskSuspend (0);    }/********************************************************************************* _netMalloc - allocates network buffers** This function allocates the relevant cluster and returns the * the pointer to the memory allocated.* * INTERNAL* The first 4 bytes of the cluster allocated hold a back pointer to the mBlk* The actual cluster size allocated is the user requested size + size of * mBlk pointer to pointer.** NOMANUAL** RETURNS: char pointer /NULL */char * _netMalloc    (    int			bufSize,		/* size of the buffer to get */    UCHAR		type,			/* type of mbuf to allocate */    int 		canWait			/* M_WAIT/M_DONTWAIT */    )    {     FAST struct mbuf * 	pMblk;     FAST struct mbuf ** pPtrMblk;     pMblk = netTupleGet (_pNetSysPool, (bufSize + sizeof(struct mbuf *)),                         canWait, type, TRUE);    if (pMblk != NULL) 	{ 	pPtrMblk = mtod(pMblk, struct mbuf **); 	*pPtrMblk = pMblk; 	pMblk->m_data += sizeof(struct mbuf **); 	return (mtod(pMblk, char *));	}     else 	return (NULL);     }/********************************************************************************* _netFree - frees network buffers** This function allocates the relevant cluster and returns the * the pointer to the memory allocated.* * INTERNAL* The first 4 bytes of the cluster allocated hold a back pointer to the mBlk* The actual cluster size allocated is the user requested size + 4.* Since the mBlk will retain the type,m_free() will automatically free the * relevant type** NOMANUAL** RETURNS: pointer/NULL */void _netFree    (    char * pBuf		/* pointer to buffer to free */	     )     {    if (pBuf != NULL)	(void)m_free (*((struct mbuf **)(pBuf - sizeof(struct mbuf **))));    }/********************************************************************************* hashinit - initialize a hash table of a given size.** This function initializes the hashtable of a given number of elements.* It returns a pointer to the hash mask. * * NOMANUAL** RETURNS: pointer/NULL */void * hashinit    (    int 	elements,	/* number of elements in the hash table */    int 	type,		/* type of entries PCB/IFADDR etc */    u_long *	hashmask	/* ptr to the hash mask */    )    {    long 	hashsize;    int 	ix;    LIST_HEAD(generic, generic) *hashtbl;    if (elements <= 0)        {#ifdef WV_INSTRUMENTATION#ifdef INCLUDE_WVNET    /* WV_NET_EMERGENCY event */        WV_NET_MARKER_1 (NET_AUX_EVENT, WV_NET_EMERGENCY, 45, 1,                         WV_NETEVENT_HASHINIT_PANIC, type)#endif  /* INCLUDE_WVNET */#endif        panic("hashinit: bad elements");        }        for (hashsize = 1; hashsize <= elements; hashsize <<= 1)        continue;        hashsize >>= 1;    hashtbl = malloc((u_long)hashsize * sizeof(*hashtbl));    for (ix = 0; ix < hashsize; ix++)        LIST_INIT(&hashtbl[ix]);    *hashmask = hashsize - 1;    return (hashtbl);    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲图片自拍偷拍| 欧美激情一区三区| 日韩福利电影在线| 欧美一级欧美一级在线播放| 日韩成人午夜电影| xnxx国产精品| 99久久精品国产一区| 亚洲综合色婷婷| 欧美高清www午色夜在线视频| 日本中文字幕一区| 久久精品人人做人人爽人人| 95精品视频在线| 亚洲成av人片一区二区梦乃| 精品国产青草久久久久福利| 成人午夜激情在线| 亚洲自拍都市欧美小说| 日韩三级高清在线| 不卡高清视频专区| 亚洲aaa精品| 国产午夜精品一区二区三区四区| 色综合久久久久综合99| 日韩国产高清在线| 中文字幕av一区二区三区免费看 | 日韩和欧美的一区| 日韩免费观看高清完整版 | 欧美日韩精品一区视频| 久久福利视频一区二区| 亚洲欧美在线视频| 欧美一区二区成人6969| 成人涩涩免费视频| 青青草97国产精品免费观看| 国产精品三级在线观看| 欧美一区二区三区在线视频| 成人的网站免费观看| 免费在线成人网| 日韩美女视频一区二区| 久久综合五月天婷婷伊人| 欧美体内she精视频| 成人高清视频在线| 久久国产婷婷国产香蕉| 一区二区三区免费在线观看| 久久精品视频一区二区三区| 51久久夜色精品国产麻豆| 91老师国产黑色丝袜在线| 精品无人码麻豆乱码1区2区| 亚洲一区在线电影| 国产精品久久夜| 久久日韩精品一区二区五区| 欧美日韩国产首页在线观看| aaa亚洲精品| 国产精品一区二区视频| 蜜臀久久久99精品久久久久久| 亚洲精品视频在线看| 国产色产综合色产在线视频| 日韩三级电影网址| 欧美天堂一区二区三区| 成人福利视频网站| 国产精品一品视频| 韩国一区二区三区| 久久精品99久久久| 日韩高清欧美激情| 五月激情综合网| 亚洲va韩国va欧美va精品| 一区二区三区四区高清精品免费观看 | 69堂国产成人免费视频| 色婷婷狠狠综合| 99综合电影在线视频| www.综合网.com| 91在线你懂得| 91老师国产黑色丝袜在线| 91视频在线观看| 日本乱码高清不卡字幕| 欧美最猛性xxxxx直播| 欧美主播一区二区三区| 欧美日韩免费一区二区三区 | 国产综合色精品一区二区三区| 日产欧产美韩系列久久99| 日本欧洲一区二区| 老司机免费视频一区二区三区| 国产欧美精品一区二区色综合朱莉 | 国产精品乱码人人做人人爱 | 国产日韩欧美电影| 久久新电视剧免费观看| 亚洲精品中文字幕在线观看| 91黄色免费版| 色999日韩国产欧美一区二区| 久久激情综合网| 国产美女精品人人做人人爽| 成人免费看视频| 色播五月激情综合网| 欧美影片第一页| 欧美精品乱码久久久久久按摩| 欧美人狂配大交3d怪物一区| 日韩一区二区在线观看视频播放 | 日韩一卡二卡三卡四卡| 日韩免费一区二区| 中文乱码免费一区二区| 亚洲免费观看视频| 日精品一区二区三区| 国产精品一区二区三区乱码| 91免费观看视频| 在线播放欧美女士性生活| 欧美tickling网站挠脚心| 国产精品成人一区二区三区夜夜夜| 亚洲激情综合网| 免费看日韩精品| 成人免费高清视频| 欧美日韩国产首页| 欧美激情在线观看视频免费| 亚洲尤物在线视频观看| 精品一区二区在线播放| 91麻豆123| 日韩精品一区二区在线| 最好看的中文字幕久久| 老司机精品视频线观看86| www.久久精品| 欧美一区二区三区视频免费播放| 亚洲国产精品av| 午夜一区二区三区视频| 国产久卡久卡久卡久卡视频精品| 91久久精品国产91性色tv| 精品国产一区二区三区不卡| 亚洲美女精品一区| 九一久久久久久| 色www精品视频在线观看| 久久亚洲二区三区| 日韩黄色一级片| 91麻豆免费视频| 久久美女艺术照精彩视频福利播放 | 日韩影院精彩在线| 99精品在线免费| 久久久久久久免费视频了| 亚洲一区二区三区精品在线| 国产精品影视在线| 4438x成人网最大色成网站| 亚洲品质自拍视频| 国产成人丝袜美腿| 91精品国产综合久久香蕉的特点 | 欧美成人性战久久| 亚洲乱码国产乱码精品精可以看 | 成人欧美一区二区三区在线播放| 蜜臀av性久久久久蜜臀aⅴ| 欧美在线影院一区二区| 日韩理论片网站| 国产91富婆露脸刺激对白| 欧美一级久久久| 亚洲激情图片qvod| 国产精品一区二区三区99 | 欧美性欧美巨大黑白大战| 国产亚洲欧美日韩日本| 日产欧产美韩系列久久99| 色综合视频一区二区三区高清| 精品少妇一区二区三区| 亚洲国产精品久久一线不卡| 成熟亚洲日本毛茸茸凸凹| 日韩视频免费直播| 青娱乐精品视频在线| 日韩高清不卡一区二区| 国产一区二区三区国产| 欧美自拍丝袜亚洲| 一区二区三区四区蜜桃| 在线观看免费亚洲| 亚洲综合精品久久| 欧美中文字幕久久| 亚洲成va人在线观看| 欧美日韩大陆在线| 青青草国产精品97视觉盛宴| 91精品婷婷国产综合久久 | 中文字幕一区二区三区在线不卡 | 成人激情校园春色| 中文字幕精品一区二区精品绿巨人| 国产精品一区二区三区99| 欧美国产精品久久| www.av亚洲| 亚洲欧美aⅴ...| 欧美色老头old∨ideo| 日韩 欧美一区二区三区| 日韩欧美一级在线播放| 狠狠色综合色综合网络| 中文字幕乱码久久午夜不卡| 99久免费精品视频在线观看 | 国产婷婷一区二区| 播五月开心婷婷综合| 亚洲人快播电影网| 欧美在线视频日韩| 免费观看91视频大全| 国产亚洲婷婷免费| 色欧美片视频在线观看| 丝袜美腿成人在线| 久久一二三国产| 91尤物视频在线观看| 天堂va蜜桃一区二区三区漫画版| 欧美一卡2卡3卡4卡| 高清不卡一区二区在线| 亚洲激情欧美激情| 日韩亚洲欧美一区| 99精品视频免费在线观看| 日韩中文字幕麻豆| 国产精品嫩草影院av蜜臀| 欧美午夜不卡视频|