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

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

?? vmlib.c

?? vxworks的完整的源代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* vmLib.c - architecture-independent virtual memory support library (VxVMI Option) *//* Copyright 1984-2001 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------02a,02apr02,dtr  Adding PPC860.01z,16nov01,to   declare global variables in vmData.c to avoid getting multiple                 vm*Lib.o pulled01y,26jul01,scm  add extended small page table support for XScale...01x,03mar00,zl   merged SH support into T201w,30mar99,jdi  doc: fixed table formatting that refgen can't handle.01v,14mar99,jdi  doc: removed refs to config.h and/or configAll.h (SPR 25663).01u,21feb99,jdi  doc: listed errnos.01t,02jul96,ms   replaced "%" with "NOT_PAGE_ALIGNED" to fix SPR 6833.01s,04mar96,ms   made null for PPC.01r,13sep93,caf  made null for MIPS.01s,18nov93,edm  changed BOOL mmuPhysAddrShifted to int mmuPhysAddrShift.01r,05apr93,edm  added support for physical addresses->page number option.01q,19feb93,jdi  doc: add VxVMI option label and Availability section.01p,12feb93,jdi  doc tweaks.01o,12feb93,rdc  changed scheme for sharing data structures with mmuLib. Doc.01n,09feb93,rdc  added vmTextPageProtect.  01m,21oct92,jdi  doc change as per pme.01l,19oct92,jcf  cleanup. fixed vmLibInit.01k,14oct92,jdi  made vmContextInit() NOMANUAL.01j,02oct92,jdi  documentation cleanup.01i,01oct92,jcf  added cacheFuncsSet() to attach mmu to cache support.01h,22sep92,rdc  changed NUM_PAGE_STATES to 256.  		 changed globalPageBlockArray to be type UINT8 instead of BOOL.01g,23aug92,jcf  cleanup.01f,30jul92,rdc  added pointer to vmTranslate routine to vmLibInfo. 01e,27jul92,rdc  moved  "vmLib.c" to "vmBaseLib.c", and installed the		 unbundled vmLib.c here.01d,21jul92,rdc  took out mutex in vmStateSet so callable from int level.01c,13jul92,rdc  changed reference to vmLib.h to vmLibP.h.01b,09jul92,rdc  changed indirect routine pointer configuration.01a,08jul92,rdc  written.*//*DESCRIPTIONThis library provides an architecture-independent interface to the CPU'smemory management unit (MMU).  Although vmLib is implemented witharchitecture-specific libraries, application code need never referencedirectly the architecture-dependent code in these libraries.A fundamental goal in the design of vmLib was to permit transparentbackward compatibility with previous versions of VxWorks that did not usethe MMU.  System designers may opt to disable the MMU because of timingconstraints, and some architectures do not support MMUs; therefore VxWorksfunctionality must not be dependent on the MMU.  The resulting designpermits a transparent configuration with no change in the programmingenvironment (but the addition of several protection features, such as textsegment protection) and the ability to disable virtual memory in systemsthat require it.The vmLib library provides a mechanism for creating virtual memory contexts,vmContextCreate().  These contexts are not automatically created for individual tasks, but may be created dynamically by tasks, and swapped in and out in an application specific manner. All virtual memory contexts share a global transparent mapping of virtualto physical memory for all of local memory and the local hardware devicespace (defined in sysLib.c for each board port in the `sysPhysMemDesc'data structure).  When the system is initialized, all of local physicalmemory is accessible at the same address in virtual memory (this is donewith calls to vmGlobalMap().)  Modifications made to this global mappingin one virtual memory context appear in all virtual memory contexts.  Forexample, if the exception vector table (which resides at address 0 inphysical memory) is made read only by calling vmStateSet() on virtualaddress 0, the vector table will be read only in all virtual memorycontexts.Private virtual memory can also be created.  When physical pages aremapped to virtual memory that is not in the global transparent region,this memory becomes accessible only in the context in which it wasmapped.  (The physical pages will also be accessible in the transparenttranslation at the physical address, unless the virtual pages in theglobal transparent translation region are explicitly invalidated.)  Statechanges (writability, validity, etc.) to a section of private virtualmemory in a virtual memory context do not appear in other contexts.  Tofacilitate the allocation of regions of virtual space, vmGlobalInfoGet()returns a pointer to an array of booleans describing which portions of thevirtual address space are devoted to global memory.  Each successive arrayelement corresponds to contiguous regions of virtual memory the size ofwhich is architecture-dependent and which may be obtained with a call tovmPageBlockSizeGet().  If the boolean array element is true, thecorresponding region of virtual memory, a "page block", is reserved forglobal virtual memory and should not be used for private virtual memory.(If vmMap() is called to map virtual memory previously defined as global,the routine will return an error.)All the state information for a block of virtual memory can be set in asingle call to vmStateSet().  It performs parameter checking and checksthe validity of the specified virtual memory context.  It may also be usedto set architecture-dependent state information.  See vmLib.h for additionalarchitecture-dependent state information.The routine vmContextShow() in vmShow displays the virtual memory contextfor a specified context.  For more information, see the manual entry forthis routine.CONFIGURATION:Full MMU support (vmLib, and optionally, vmShow) is included in VxWorkswhen the configuration macro INCLUDE_MMU_FULL is defined.  If theconfiguration macro INCLUDE_MMU_BASIC is also defined, the default isfull MMU support (unbundled).The sysLib.c library contains a data structure called `sysPhysMemDesc',which is an array of PHYS_MEM_DESC structures.  Each element of the arraydescribes a contiguous section of physical memory.  The description ofthis memory includes its physical address, the virtual address where itshould be mapped (typically, this is the same as the physical address, butnot necessarily so), an initial state for the memory, and a mask definingwhich state bits in the state value are to be set.  Default configurationsare defined for each board support package (BSP), but these mappings maybe changed to suit user-specific system configurations.  For example, theuser may need to map additional VME space where the backplane networkinterface data structures appear.INTERNALMutual exclusion is provided in all operations that modify and examinetranslation tables;  routines in mmuLib need not provide mutual exclusionmechanisms for translation tables.AVAILABILITYThis library and vmShow are distributed as the unbundled virtual memorysupport option, VxVMI.  A scaled down version, vmBaseLib, isprovided with VxWorks for systems that do not permit optional use of theMMU, or for architectures that require certain features of the MMU toperform optimally (in particular, architectures that rely heavily oncaching, but do not support bus snooping, and thus require the ability tomark interprocessor communications buffers as non-cacheable.)  Mostroutines in vmBaseLib are referenced internally by VxWorks; they are notcallable by application code.INCLUDE FILES: vmLib.h SEE ALSO: sysLib, vmShow,.pG "Virtual Memory"*/#include "vxWorks.h"#if     (CPU_FAMILY != MIPS)  && ((CPU_FAMILY!=PPC) || (CPU==PPC860))#include "private/vmLibP.h"#include "stdlib.h"#include "mmuLib.h"#include "private/classLibP.h"#include "private/objLibP.h"#include "errno.h"#include "cacheLib.h"#include "sysLib.h"#include "private/semLibP.h"	/* macros and defines *//* detect if addr is in global virtual memory */#define ADDR_IN_GLOBAL_SPACE(vAddr) (globalPageBlockArray[(unsigned) vAddr / mmuPageBlockSize])/* compute if page is aligned without using "%" (SPR 6833) */#define	NOT_PAGE_ALIGNED(addr)	(((UINT)(addr)) & ((UINT)vmPageSize - 1))/* macros to reference mmuLib routines indirectly through mmuLibFunc table */#define MMU_LIB_INIT        	(*(mmuLibFuncs.mmuLibInit))#define MMU_TRANS_TBL_CREATE 	(*(mmuLibFuncs.mmuTransTblCreate))#define MMU_TRANS_TBL_DELETE 	(*(mmuLibFuncs.mmuTransTblDelete))#define MMU_ENABLE 	  	(*(mmuLibFuncs.mmuEnable))#define MMU_STATE_SET 	  	(*(mmuLibFuncs.mmuStateSet))#define MMU_STATE_GET 	  	(*(mmuLibFuncs.mmuStateGet))#define MMU_PAGE_MAP 	  	(*(mmuLibFuncs.mmuPageMap))#define MMU_GLOBAL_PAGE_MAP 	(*(mmuLibFuncs.mmuGlobalPageMap))#define MMU_TRANSLATE 	  	(*(mmuLibFuncs.mmuTranslate))#define MMU_CURRENT_SET 	(*(mmuLibFuncs.mmuCurrentSet))IMPORT int mmuPageBlockSize;			/* initialized by mmuLib.c */IMPORT STATE_TRANS_TUPLE *mmuStateTransArray;	/* initialized by mmuLib.c */IMPORT int mmuStateTransArraySize;		/* initialized by mmuLib.c */IMPORT MMU_LIB_FUNCS mmuLibFuncs; 		/* initialized by mmuLib.c */IMPORT int                      mmuPhysAddrShift;       /* see vmData.c *//* imports */IMPORT void sysInit ();IMPORT void etext ();/* class declaration */LOCAL VM_CONTEXT_CLASS	vmContextClass;VM_CONTEXT_CLASS_ID	vmContextClassId = &vmContextClass;/* state translation tables - these tables are initialized in vmLibInit, * and are used to translate between architecture-independent and architecture * dependent states. arch indep. state info uses 8 bits - 2^8=256 possible * states  */#define NUM_PAGE_STATES 256/* locals */LOCAL UINT		vmStateTransTbl[NUM_PAGE_STATES];LOCAL UINT		vmMaskTransTbl[NUM_PAGE_STATES];LOCAL LIST		vmContextList;		/* XXX delete ? */LOCAL int 		vmPageSize;LOCAL VM_CONTEXT	sysVmContext;      	/* initial vm context */LOCAL VM_CONTEXT *	currentContext = NULL;LOCAL SEMAPHORE 	globalMemMutex;/* globals */UINT8 *globalPageBlockArray;int    mutexOptionsVmLib = SEM_Q_PRIORITY |SEM_DELETE_SAFE | SEM_INVERSION_SAFE;LOCAL STATUS vmTextPageProtect (void *textPageAddr, BOOL protect);/********************************************************************************* vmLibInit - initialize the virtual memory support module (VxVMI Option)** This routine initializes the virtual memory context class.* It is called only once during system initialization.** AVAILABILITY* This routine is distributed as a component of the unbundled virtual memory* support option, VxVMI.** RETURNS: OK.*/STATUS vmLibInit     (    int pageSize		/* size of page */    )    {    int		i;    int 	j;    UINT 	newState;    UINT 	newMask;    int 	arraySize;    if (vmLibInfo.vmLibInstalled)	/* only install vmLib once */	return (OK);    if (pageSize == 0)	return (ERROR);			/* check for reasonable parameter */    vmPageSize = pageSize;    classInit ((OBJ_CLASS *) &vmContextClass.coreClass, sizeof (VM_CONTEXT), 	       OFFSET(VM_CONTEXT, objCore), (FUNCPTR) vmContextCreate, 	       NULL, NULL);    /* initialize the mutual exclusion semaphore that protects the global     * memory mappings.     */    semMInit (&globalMemMutex, mutexOptionsVmLib);    /* initialize the page state translation table.  This table is used to     * translate betseen architecture-independent state values and architecture     * dependent state values */    for (i = 0; i < NUM_PAGE_STATES; i++)	{	newState = 0;	for (j = 0; j < mmuStateTransArraySize; j++)	    {	    STATE_TRANS_TUPLE *thisTuple = &mmuStateTransArray[j];	    UINT archIndepState = thisTuple->archIndepState;	    UINT archDepState = thisTuple->archDepState;	    UINT archIndepMask = thisTuple->archIndepMask;	    if ((i & archIndepMask) == archIndepState)		newState |= archDepState;	    }	vmStateTransTbl [i] = newState;	}    /* initialize the page state mask translation table.  This table is used to     * translate betseen architecture-independent state masks and architecture     * dependent state masks */    for (i = 0; i < NUM_PAGE_STATES; i++)	{	newMask = 0;	for (j = 0; j < mmuStateTransArraySize; j++)	    {	    STATE_TRANS_TUPLE *thisTuple = &mmuStateTransArray[j];	    UINT archIndepMask = thisTuple->archIndepMask;	    UINT archDepMask = thisTuple->archDepMask;	    if ((i & archIndepMask) == archIndepMask)		newMask |= archDepMask;	    }	vmMaskTransTbl [i] = newMask;	}    /* allocate memory for global page block array to keep track of which     * sections of virtual memory are reserved for global virtual memory.     * number of page blocks in virtual space = (2**32)/pageBlockSize.     */    /* what we really want is: 2^32/mmuPageBlockSize, but we can't        represent 2^32, so we assume mmuPageBlockSize is even, and divide       everything by 2 so we can do 32 bit arithmatic */    arraySize = (UINT) 0x80000000 / (mmuPageBlockSize / 2);    globalPageBlockArray = (UINT8 *) calloc (arraySize, sizeof (UINT8));    if (globalPageBlockArray == NULL)        return (ERROR);    lstInit (&vmContextList); 			/* XXX not currently used */    vmLibInfo.pVmStateSetRtn    = vmStateSet;     vmLibInfo.pVmStateGetRtn    = vmStateGet;    vmLibInfo.pVmEnableRtn      = vmEnable;    vmLibInfo.pVmPageSizeGetRtn = vmPageSizeGet;    vmLibInfo.pVmTranslateRtn   = vmTranslate;    vmLibInfo.pVmTextProtectRtn = vmTextPageProtect;    vmLibInfo.vmLibInstalled    = TRUE;    cacheMmuAvailable		= TRUE;    cacheFuncsSet ();			/* update cache funtion pointers */    return (OK);    }/********************************************************************************* vmGlobalMapInit - initialize global mapping (VxVMI Option)** This routine is a convenience routine that creates and installs a virtual* memory context with global mappings defined for each contiguous memory* segment defined in the physical memory descriptor array passed as an* argument.  The context ID returned becomes the current virtual memory* context.  ** The physical memory descriptor also contains state information* used to initialize the state information in the MMU's translation table* for that memory segment.  The following state bits may be or'ed together:** .TS* tab(|);* l2 l2 l .* VM_STATE_VALID    | VM_STATE_VALID_NOT    | valid/invalid* VM_STATE_WRITABLE | VM_STATE_WRITABLE_NOT | writable/write-protected* VM_STATE_CACHEABLE| VM_STATE_CACHEABLE_NOT| cacheable/not-cacheable* .TE** Additionally, mask bits are or'ed together in the `initialStateMask' structure* element to describe which state bits are being specified in the `initialState'* structure element:**  VM_STATE_MASK_VALID*  VM_STATE_MASK_WRITABLE*  VM_STATE_MASK_CACHEABLE** If the <enable> parameter is TRUE, the MMU is enabled upon return.  * The vmGlobalMapInit() routine should be called only after vmLibInit() has been* called.** AVAILABILITY* This routine is distributed as a component of the unbundled virtual memory* support option, VxVMI.** RETURNS: A pointer to a newly created virtual memory context, or* NULL if the memory cannot be mapped.*/VM_CONTEXT_ID vmGlobalMapInit     (    PHYS_MEM_DESC *pMemDescArray, 	/* pointer to array of mem descs    */    int numDescArrayElements,		/* num of elements in pMemDescArray */    BOOL enable				/* enable virtual memory            */    )    {    int i;    PHYS_MEM_DESC *thisDesc;    /* set up global transparent mapping of physical to virtual memory */    for (i = 0; i < numDescArrayElements; i++)        {        thisDesc = &pMemDescArray[i];        /* map physical directly to virtual and set initial state */        if (vmGlobalMap ((void *) thisDesc->virtualAddr, 			 (void *) thisDesc->physicalAddr,			 thisDesc->len) == ERROR)            {	    return (NULL);            }        }    /* create default virtual memory context */    if (vmContextInit (&sysVmContext) == ERROR)	{	return (NULL);	}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美久久一二三四区| 国产拍欧美日韩视频二区| 日韩女优av电影| 中文字幕av免费专区久久| 伊人色综合久久天天| 免费观看久久久4p| av亚洲精华国产精华精| 日韩欧美一区二区视频| 亚洲欧美一区二区三区国产精品 | 国产精品123| 欧美三片在线视频观看| 国产精品无圣光一区二区| 六月丁香婷婷久久| 欧美午夜在线一二页| 国产精品久久久久影院| 精品一区二区三区在线播放| 精品视频在线看| 亚洲啪啪综合av一区二区三区| 久久国产日韩欧美精品| 欧美电影一区二区三区| 亚洲男同性恋视频| 成人avav影音| 国产亚洲一区字幕| 韩国一区二区在线观看| 欧美一级免费大片| 偷拍亚洲欧洲综合| 欧美亚州韩日在线看免费版国语版| 国产亚洲一本大道中文在线| 激情小说亚洲一区| 欧美mv和日韩mv的网站| 美女尤物国产一区| 欧美一级爆毛片| 日本不卡视频在线| 56国语精品自产拍在线观看| 午夜精品福利一区二区三区av | 91福利资源站| 亚洲欧美日韩国产综合| 91亚洲精品久久久蜜桃| 亚洲精品五月天| 日本高清成人免费播放| 亚洲一区精品在线| 制服丝袜日韩国产| 青青草视频一区| 精品伦理精品一区| 国产精品中文字幕一区二区三区| 久久精品视频免费| av成人免费在线观看| 激情综合色综合久久综合| 欧美久久久久久久久| 首页欧美精品中文字幕| 日韩三级在线免费观看| 精品一区二区三区日韩| 国产欧美精品区一区二区三区 | 91久久精品一区二区二区| 一区二区三区日韩精品视频| 日本道精品一区二区三区| 亚洲高清免费视频| 日韩一区二区三区观看| 久久精品噜噜噜成人av农村| 欧美tickling网站挠脚心| 成人高清av在线| 亚洲高清不卡在线| 亚洲精品在线一区二区| www.99精品| 丝袜美腿高跟呻吟高潮一区| 精品久久久久久久久久久久久久久| 国产精品中文字幕欧美| 亚洲一区二区三区视频在线| 日韩免费看的电影| 91麻豆自制传媒国产之光| 日韩精品国产精品| 国产精品污www在线观看| 欧美性三三影院| 国产乱码精品1区2区3区| 亚洲精品中文字幕乱码三区| 日韩精品中文字幕一区二区三区| 懂色一区二区三区免费观看| 一区二区三区.www| 精品久久久久久综合日本欧美| 成人app网站| 男女男精品视频| 国产精品传媒视频| 精品少妇一区二区三区免费观看 | 91天堂素人约啪| 精品中文字幕一区二区小辣椒| 国产精品久久久久久久久久久免费看| 欧美色综合网站| 成人永久aaa| 日本sm残虐另类| 亚洲一区二区三区在线看| 久久精品夜夜夜夜久久| 这里只有精品免费| 91老师片黄在线观看| 国产精品综合在线视频| 日韩成人av影视| 亚洲日本青草视频在线怡红院| 精品福利一二区| 欧美精品精品一区| 色狠狠综合天天综合综合| 国产成人免费视频网站高清观看视频 | 欧美一区二区三区四区久久| 96av麻豆蜜桃一区二区| 国产精品99精品久久免费| 美女任你摸久久| 亚洲成人av电影在线| 亚洲男人电影天堂| 国产精品午夜免费| 国产精品丝袜久久久久久app| 精品嫩草影院久久| 日韩视频免费观看高清在线视频| 欧美性感一区二区三区| 色噜噜狠狠色综合中国| 99久久国产综合精品女不卡| 国产成人午夜视频| 国产精品 欧美精品| 成人亚洲一区二区一| 粉嫩在线一区二区三区视频| 国产丶欧美丶日本不卡视频| 国产精品一区二区男女羞羞无遮挡 | 狠狠v欧美v日韩v亚洲ⅴ| 久久国产人妖系列| 国产美女在线观看一区| 国产精品中文字幕日韩精品 | 国产免费成人在线视频| 国产日本欧洲亚洲| 国产欧美综合色| 欧美经典一区二区| 国产精品第13页| 亚洲精品视频自拍| 午夜精品一区二区三区三上悠亚| 亚洲成人一二三| 日本强好片久久久久久aaa| 美女mm1313爽爽久久久蜜臀| 韩国毛片一区二区三区| 国产成人免费xxxxxxxx| 99精品欧美一区二区三区小说| 日本伦理一区二区| 欧美一区二区三区公司| 久久综合九色综合97婷婷| 中文字幕不卡三区| 亚洲国产sm捆绑调教视频| 青青草97国产精品免费观看 | 国产精品乱人伦中文| 亚洲免费观看高清在线观看| 亚洲国产毛片aaaaa无费看 | 精品国产凹凸成av人网站| 国产调教视频一区| 亚洲激情在线播放| 蜜臀av性久久久久蜜臀aⅴ| 国产麻豆午夜三级精品| 99这里只有精品| 欧美一区欧美二区| 国产婷婷色一区二区三区| 亚洲午夜精品在线| 国产在线精品一区二区不卡了| 99热99精品| 91精品麻豆日日躁夜夜躁| 久久九九久久九九| 香蕉久久夜色精品国产使用方法| 精品一区二区三区免费毛片爱 | 人妖欧美一区二区| 成人一级片在线观看| 欧美一区二区三区精品| 国产精品污网站| 免费在线成人网| 99久久久国产精品| 精品1区2区在线观看| 亚洲精品ww久久久久久p站| 国内不卡的二区三区中文字幕| 色婷婷av久久久久久久| 久久综合久久99| 图片区小说区国产精品视频| 粉嫩绯色av一区二区在线观看 | 色猫猫国产区一区二在线视频| 日韩美女主播在线视频一区二区三区| 国产精品你懂的在线| 日本aⅴ免费视频一区二区三区 | 亚洲欧美日韩在线| 国产一区二区三区av电影| 欧美日韩视频第一区| 自拍偷拍亚洲激情| 国产成人免费视频| 日韩精品在线一区| 亚洲动漫第一页| av高清不卡在线| 欧美激情一区二区三区四区| 男女性色大片免费观看一区二区| 91久久精品一区二区三| 成人欧美一区二区三区视频网页 | 国产成人精品一区二区三区四区| 欧美三级三级三级爽爽爽| 中文字幕av一区二区三区免费看| 激情五月激情综合网| 91麻豆精品国产91久久久久 | 国产精品久久久久久久久搜平片| 麻豆成人av在线| 欧美老肥妇做.爰bbww视频| 亚洲精选一二三| 91免费看视频| 亚洲精品高清在线|