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

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

?? mmu40lib.c

?? vxworks的源代碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
/* mmu40Lib.c - mmu library for MC68040 and MC68060 *//* Copyright 1984-1996 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01o,10feb99,wsl  add comment documenting ERRNO code01n,29oct96,dat  fixed in-line assembly for 2.7 compiler. (SPR 7403) 01m,07mar95,ism  fixed problem with restoration of d) from stack (SPR#4065).01l,22nov94,dzb  added cacheClear() in mmuEnable() as per Heurikon request.01k,31oct94,tmk  added MC68LC040 support01j,16jun94,tpr  added MC68060 cpu support.		 clean up following code review.01j,05jul94,rdc  mods to decrease fragmentation and provide alternate memory 		 source.  Fixed bug that caused pages containing page 		 descriptors to be write enabled.01i,12feb93,rdc  changed scheme for sharing data structures with vmLib.01h,09feb93,rdc  fixed bug preventing mapping of large vm spaces.01g,09oct92,rdc  moved reset of TT regs to mmuEnable.01f,01oct92,jcf  warnings.01e,22sep92,rdc  doc.01d,28jul92,jmm  added forward declarations for all functions01c,21jul92,rdc  fixed bug in mmuMemPagesWriteEnable/Disable, 		 added init code to mmuCurrentSet to write protect pte memory		 for global trans tbl.01b,13jul92,rdc  changed reference to vmLib.h to vmLibP.h.01a,08jul92,rdc  written.*//*DESCRIPTION:mmuLib.c provides the architecture dependent routines that directly controlthe memory management unit.  It provides 10 routines that are called by thehigher level architecture independent routines in vmLib.c: mmuLibInit - initialize modulemmuTransTblCreate - create a new translation tablemmuTransTblDelete - delete a translation table.mmuEnable - turn mmu on or offmmuStateSet - set state of virtual memory pagemmuStateGet - get state of virtual memory pagemmuPageMap - map physical memory page to virtual memory pagemmuGlobalPageMap - map physical memory page to global virtual memory pagemmuTranslate - translate a virtual address to a physical addressmmuCurrentSet - change active translation tableApplications using the mmu will never call these routines directly; the visable interface is supported in vmLib.c.mmuLib supports the creation and maintenance of multiple translation tables,one of which is the active translation table when the mmu is enabled.  Note that VxWorks does not include a translation table as part of the taskcontext;  individual tasks do not reside in private virtual memory.  However,we include the facilities to create multiple translation tables so thatthe user may create "private" virtual memory contexts and switch them in anapplication specific manner.  Newtranslation tables are created with a call to mmuTransTblCreate, and installedas the active translation table with mmuCurrentSet.  Translation tablesare modified and potentially augmented with calls to mmuPageMap and mmuStateSet.The state of portions of the translation table can be read with calls to mmuStateGet and mmuTranslate.The traditional VxWorks architecture and design philosophy requires that allobjects and operating systems resources be visable and accessable to all agents(tasks, isrs, watchdog timers, etc) in the system.  This has traditionally beeninsured by the fact that all objects and data structures reside in physical memory; thus, a data structure created by one agent may be accessed by anyother agent using the same pointer (object identifiers in VxWorks are oftenpointers to data structures.) This creates a potential problem if you have multiple virtual memory contexts.  For example, if asemaphore is created in one virtual memory context, you must gurantee thatthat semaphore will be visable in all virtual memory contexts if the semaphoreis to be accessed at interrupt level, when a virtual memory context other thanthe one in which it was created may be active. Another example is thatcode loaded using the incremental loader from the shell must be accessablein all virtual memory contexts, since code is shared by all agents in thesystem.This problem is resolved by maintaining a global "transparent" mappingof virtual to physical memory for all the contiguous segments of physical memory (on board memory, i/o space, sections of vme space, etc) that is sharedby all translation tables;   all available  physical memory appears at the same address in virtual memory in all virtual memory contexts. This technique provides an environment that allowsresources that rely on a globally accessable physical address to run withoutmodification in a system with multiple virtual memory contexts.An additional requirement is that modifications made to the state of global virtual memory in one translation table appear in all translation tables.  Forexample, memory containing the text segment is made read only (to avoidaccidental corruption) by setting the appropriate writeable bits in the translation table entries corresponding to the virtual memory containing the text segment.  This state information must be shared by all virtual memory contexts, so that no matter what translation table is active, the text segmentis protected from corruption.  The mechanism that implements this feature isarchitecture dependent, but usually entails building a section of a translation table that corresponds to the global memory, that is shared byall other translation tables.  Thus, when changes to the state of the globalmemory are made in one translation table, the changes are reflected in allother translation tables.mmuLib provides a seperate call for constructing global virtual memory -mmuGlobalPageMap - which creates translation table entries that are sharedby all translation tables.  Initialization code in usrConfig makes callsto vmGlobalMap (which in turn calls mmuGlobalPageMap) to set up global transparent virtual memory for allavailable physical memory.  All calls made to mmuGlobalPageMap must occur beforeany virtual memory contexts are created;  changes made to global virtualmemory after virtual memory contexts are created are not guaranteed to be reflected in all virtual memory contexts.Most mmu architectures will dedicate some fixed amount of virtual memory to a minimal section of the translation table (a "segment", or "block").  This creates a problem in that the user may map a small section of virtual memoryinto the global translation tables, and then attempt to use the virtual memoryafter this section as private virtual memory.  The problem is that the translation table entries for this virtual memory are contained in the global translation tables, and are thus shared by all translation tables.  This condition is detected by vmMap, and an error is returned, thus, the lowerlevel routines in mmuLib.c (mmuPageMap, mmuGlobalPageMap) need not performany error checking.A global variable called mmuPageBlockSize should be defined which is equal to the minimum virtual segment size.  mmuLib must provide a routine mmuGlobalInfoGet, which returns a pointer to the globalPageBlock array.This provides the user with enough information to be able to allocate virtual memory space that does not conflict with the global memory space.This module supports the 68040 and 68060 mmu with a three level translationtable:                                            root                                             |                                             |    LEVEL 1                 -------------------------------------    TABLE DESCRIPTORS (128) | td  | td  | td  | td  | td  | td  | ...                                 -------------------------------------                               |     |     |     |     |     |                                 |     |     |     |     |     |                        ----------     |     v     v     v     v                        |              |    NULL  NULL  NULL  NULL                      |              |                        |              -------------------------                      |                                      |                      v                                      vLEVEL2   -------------------------------      -------------------------------TABLE    | td  | td  | td  | td  | td  | ...  | td  | td  | td  | td  | td  | ..DESCRIP. -------------------------------      -------------------------------  (128/table) |     |                              |     |            |     ----  ...                      |     ----  ...             |        |                           |        |            v        v                           v        v          ----     ----                         ----     ----          | pd |   | pd |                       | pd |   | pd |PAGE      ----     ----                         ----     ---- DESCRIP. | pd |   | pd |   ...                 | pd |   | pd |   ...(32-64    ----     ----                         ----     ----  per     | pd |   | pd |                       | pd |   | pd | table)   ----     ----                         ----     ----         | pd |   | pd |                       | pd |   | pd |          ----     ----                         ----     ----           .         .           .         .           .         .The top level consists of an array of 128 level 1 table descriptors (LEVEL_1_TABLE_DESC).  These point to arrays of 128 level 2 table descriptors (LEVEL_2_TABLE_DESC), which in turn point to arrays of page descriptors(PAGE_DESC).  The page descriptor arrays contain either 32 entries when usedwith an 8k page size, or 64 entries when used with a 4k page size. Memory forthese data structures is managed internal to the module by the routinesmmuTableDescBlockAlloc and mmuPageDescBlockAlloc, which are fixed block memory allocators.  They obtain memory from the system memory partition alignedto page boundries, and break this memory up into fixed length buffers.  Thememory for all descriptors is free'd automatically when a translation table is deleted.To implement global virtual memory, a seperate translation table called mmuGlobalTransTbl is created when the module is initialized.  Calls to mmuGlobalPageMap will augment and modify this translation table.  When newtranslation tables are created, memory for the top level array of level 1 tabledescriptors is allocated and initialized by duplicating the pointers in mmuGlobalTransTbl's top level level 1 table descriptor array.  Thus, the new translation table will use the globaltranslation table's state information for portions of virtual memory that aredefined as global.  Here's a picture to illustrate:	   GLOBAL TRANS TBL		        NEW TRANS TBL		root				     root                 |                                    |                 |                                    |                 v                                    vLEVEL 1  -------------------                  -------------------TABLE    | td  | td  | td  |...               | td  | td  | td  |... DESC.    -------------------                  -------------------             |     |                              |     |            o-------------------------------------     |            |     |                                    |            |     ------------                         |            |                |                         |            |                o--------------------------            |                |            v                vLEVEL2   -------------      ------------TABLE    | td  | td  |...  | td  | td  |...DESCRIP. -------------      ------------ (128/table) |     |           |     |            |     ----  ...   |     ----  ...             |        |        |        |            v        v        v        v          ----     ----       ----     ----          | pd |   | pd |     | pd |   | pd |PAGE      ----     ----       ----     ---- DESCRIP. | pd |   | pd | ..  | pd |   | pd | ...(32-64    ----     ----       ----     ----  per     | pd |   | pd |     | pd |   | pd | table)   ----     ----       ----     ----         | pd |   | pd |     | pd |   | pd |          ----     ----       ----     ----           .         .           .         .           .         .Note that with this scheme, the global memory granularity is 32MB.  Each timeyou map a section of global virtual memory, you dedicate at least 32MB of the virtual space to global virtual memory that will be shared by all virtualmemory contexts.The physcial memory that holds these data structures is obtained from thesystem memory manager via memalign to insure that the memory is pagealigned.  We want to protect this memory from being corrupted,so we write protect the descriptors that we set up in the global translationthat correspond to the memory containing the translation table data structures.This creates a "chicken and the egg" paradox, in that the only way we canmodify these data structures is through virtual memory that is now write protected, and we can't write enable it because the page descriptors for that memory are in write protected memory (confused yet?)So, you will notice that anywhere that page descriptors are modified, we do so by locking out interrupts, momentarily disabling the mmu, accessing the memory with its physical address, enabling the mmu, andthen re-enabling interrupts (see mmuStateSet, for example.)USER MODIFIABLE OPTIONS:1) Memory fragmentation - mmuLib obtains memory from the system memory   manager via memalign to contain the mmu's translation tables.  This memory   was allocated a page at a time on page boundries.  Unfortunately, in the   current memory management scheme, the memory manager is not able to allocate   these pages contiguously.  Building large translation tables (ie, when   mapping large portions of virtual memory) causes excessive fragmentation   of the system memory pool.  An attempt to alleviate this has been installed   by providing a local buffer of page aligned memory;  the user may control   the buffer size by manipulating the global variable mmuNumPagesInFreeList.   By default, mmuPagesInFreeList is set to 4.2) Alternate memory source - A customer has special purpose hardware that   includes seperate static RAM for the mmu's translation tables.  Thus, they   require the ability to specify an alternate source of memory other than   memalign.  A global variable has been created that points to the memory   partition to be used as the source for translation table memory; by default,   it points to the system memory partition.  The user may modify this to    point to another memory partition before mmu40LibInit is called.*/#include "vxWorks.h"#include "string.h"#include "intLib.h"#include "stdlib.h"#include "memLib.h"#include "private/memPartLibP.h"#include "private/vmLibP.h"#include "arch/mc68k/mmu40Lib.h"#include "mmuLib.h"#include "errno.h"#include "cacheLib.h"/* forward declarations */LOCAL void mmuMemPagesWriteEnable (MMU_TRANS_TBL_ID transTbl);LOCAL void mmuMemPagesWriteDisable (MMU_TRANS_TBL *transTbl);LOCAL STATUS mmuPageDescGet (MMU_TRANS_TBL *pTransTbl, void *virtAddr,                             PAGE_DESC **result);LOCAL MMU_TRANS_TBL *mmuTransTblCreate ();LOCAL STATUS mmuTransTblInit (MMU_TRANS_TBL *newTransTbl);LOCAL STATUS mmuTransTblDelete (MMU_TRANS_TBL *transTbl);LOCAL STATUS mmuVirtualPageCreate (MMU_TRANS_TBL *pTransTbl, void *virtAddr);LOCAL PAGE_DESC *mmuPageDescBlockAlloc (MMU_TRANS_TBL *transTbl);LOCAL LEVEL_2_TABLE_DESC *mmuTableDescBlockAlloc (MMU_TRANS_TBL *transTbl);LOCAL void *mmuBufBlockAlloc(LIST *pList,UINT bufSize,MMU_TRANS_TBL *pTransTbl);LOCAL STATUS mmuEnable (BOOL enable);LOCAL STATUS mmuStateSet (MMU_TRANS_TBL *transTbl, void *pageAddr,                          UINT stateMask, UINT state);LOCAL STATUS mmuStateGet (MMU_TRANS_TBL *transTbl, void *pageAddr, UINT *state);LOCAL STATUS mmuPageMap (MMU_TRANS_TBL *transTbl, void *virtualAddress,                         void *physPage);LOCAL STATUS mmuGlobalPageMap (void *virtualAddress, void *physPage);LOCAL STATUS mmuTranslate (MMU_TRANS_TBL *transTbl, void *virtAddress,                           void **physAddress);LOCAL void mmuCurrentSet (MMU_TRANS_TBL *transTbl);LOCAL void mmuATCFlush (void *addr);int mmuPageSize;/* a translation table to hold the descriptors for the global transparent * translation of physical to virtual memory  */LOCAL MMU_TRANS_TBL mmuGlobalTransTbl;/* initially, the current trans table is a dummy table with mmu disabled */LOCAL MMU_TRANS_TBL *mmuCurrentTransTbl = &mmuGlobalTransTbl;LOCAL BOOL mmuEnabled = FALSE;LOCAL STATE_TRANS_TUPLE mmuStateTransArrayLocal [] =    {    {VM_STATE_MASK_VALID, MMU_STATE_MASK_VALID,     VM_STATE_VALID, MMU_STATE_VALID},    {VM_STATE_MASK_VALID, MMU_STATE_MASK_VALID,     VM_STATE_VALID_NOT, MMU_STATE_VALID_NOT},    {VM_STATE_MASK_WRITABLE, MMU_STATE_MASK_WRITABLE,     VM_STATE_WRITABLE, MMU_STATE_WRITABLE},    {VM_STATE_MASK_WRITABLE, MMU_STATE_MASK_WRITABLE,     VM_STATE_WRITABLE_NOT, MMU_STATE_WRITABLE_NOT},    {VM_STATE_MASK_CACHEABLE, MMU_STATE_MASK_CACHEABLE,     VM_STATE_CACHEABLE, MMU_STATE_CACHEABLE},    {VM_STATE_MASK_CACHEABLE, MMU_STATE_MASK_CACHEABLE,     VM_STATE_CACHEABLE_NOT, MMU_STATE_CACHEABLE_NOT},    {VM_STATE_MASK_CACHEABLE, MMU_STATE_MASK_CACHEABLE,     VM_STATE_CACHEABLE_WRITETHROUGH, MMU_STATE_CACHEABLE_WRITETHROUGH},#if (CPU == MC68040 || CPU == MC68LC040)    {VM_STATE_MASK_CACHEABLE, MMU_STATE_MASK_CACHEABLE,     VM_STATE_CACHEABLE_NOT_NON_SERIAL, MMU_STATE_CACHEABLE_NOT_NON_SERIAL}#elif (CPU == MC68060)    {VM_STATE_MASK_CACHEABLE, MMU_STATE_MASK_CACHEABLE,     VM_STATE_CACHEABLE_NOT_IMPRECISE, MMU_STATE_CACHEABLE_NOT_IMPRECISE}#endif /* (CPU == MC68060) */    };LOCAL MMU_LIB_FUNCS mmuLibFuncsLocal =    {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久不见久久见免费视频7| 91年精品国产| 99精品视频在线免费观看| 欧美老女人在线| 18成人在线视频| 国产美女一区二区| 欧美精品v国产精品v日韩精品 | 在线观看网站黄不卡| 日韩免费高清视频| 亚洲成人在线免费| 91美女视频网站| 国产日韩精品一区二区浪潮av| 欧美网站一区二区| 精品久久久久一区| 午夜伦欧美伦电影理论片| 91视频www| 国产精品无人区| 狠狠色丁香婷综合久久| 在线成人小视频| 亚洲成人动漫精品| 欧美在线免费观看亚洲| 亚洲色图制服诱惑| 成人高清视频免费观看| 久久久精品国产免大香伊| 色噜噜狠狠成人中文综合| 国产日韩欧美亚洲| 国产一区二区三区国产| 久久午夜色播影院免费高清| 日日夜夜精品视频免费| 欧美日韩高清不卡| 亚洲国产美国国产综合一区二区| 亚洲一区二区成人在线观看| 国产成人亚洲精品青草天美| 久久伊人蜜桃av一区二区| 免费成人在线视频观看| 这里是久久伊人| 免费观看在线综合| 精品国产露脸精彩对白| 美女网站一区二区| 精品区一区二区| 麻豆精品在线观看| 91精品国产aⅴ一区二区| 青青草国产精品97视觉盛宴| 精品美女被调教视频大全网站| 国产日韩欧美综合一区| 国产a视频精品免费观看| 国产午夜精品美女毛片视频| 成人国产一区二区三区精品| 中文字幕在线不卡| 99视频精品在线| 玉足女爽爽91| 欧美日本不卡视频| 久久成人羞羞网站| 国产欧美1区2区3区| 成人福利在线看| 日韩久久一区二区| 欧美日韩国产系列| 激情综合亚洲精品| 国产精品成人一区二区艾草| 欧美日免费三级在线| 久久99国产精品麻豆| 中文字幕一区在线| 欧美精品一二三| 国产精一区二区三区| 亚洲精品写真福利| 日韩三级视频中文字幕| 成人性生交大合| 五月天婷婷综合| 国产日韩三级在线| 欧美精品亚洲二区| 国产成都精品91一区二区三| 一区二区三区波多野结衣在线观看| 国内成人自拍视频| 亚洲激情图片一区| 日韩一区二区精品在线观看| 成人精品国产一区二区4080| 性做久久久久久免费观看| 精品嫩草影院久久| 在线精品视频一区二区三四| 日本 国产 欧美色综合| 亚洲欧美日韩系列| 精品入口麻豆88视频| 欧美天堂亚洲电影院在线播放| 综合激情成人伊人| 欧美精品一区二区三区蜜臀| 久久色.com| 欧美日韩一区不卡| 波多野结衣中文字幕一区| 毛片av中文字幕一区二区| 一区二区中文视频| 日韩欧美中文字幕制服| 在线看不卡av| av在线综合网| 国产精品小仙女| 久久成人免费网| 亚洲电影一区二区| 国产精品国产三级国产三级人妇 | 国产一区二区三区免费观看| 亚洲综合久久久| 中文字幕一区免费在线观看| 欧美tickling挠脚心丨vk| 欧美性受xxxx黑人xyx| 丁香天五香天堂综合| 狠狠色丁香久久婷婷综合_中| 久久久蜜臀国产一区二区| 欧美一区二区视频在线观看| 日本高清不卡一区| k8久久久一区二区三区| 大胆亚洲人体视频| 国产精品综合在线视频| 国产综合久久久久久鬼色| 久久er精品视频| 久久精品国产77777蜜臀| 午夜成人在线视频| 午夜精品福利一区二区三区av| 日韩三级电影网址| 欧美日本乱大交xxxxx| 91电影在线观看| 日本韩国一区二区三区| 欧美在线视频不卡| 欧美久久久久久蜜桃| 91 com成人网| 精品久久久久久久久久久久久久久| 国产成人福利片| 国产精品1024久久| 97久久久精品综合88久久| 色综合久久99| 777午夜精品视频在线播放| 欧美一区二区黄| 久久久亚洲高清| 国产精品久久久一本精品| 国产精品高潮久久久久无| 自拍av一区二区三区| 亚洲自拍另类综合| 免费观看在线综合色| 国产91在线看| 91在线视频免费91| 欧美嫩在线观看| 久久久综合激的五月天| 亚洲欧美视频一区| 亚洲444eee在线观看| 韩国成人精品a∨在线观看| 成人一区在线观看| 欧美色老头old∨ideo| 日韩一卡二卡三卡四卡| 久久久亚洲高清| 亚洲一二三级电影| 国内精品久久久久影院薰衣草| 亚洲电影一区二区| 国产在线精品国自产拍免费| 9久草视频在线视频精品| 色美美综合视频| 日韩三级.com| 17c精品麻豆一区二区免费| 日韩福利电影在线| 成人午夜免费av| 欧美精品久久久久久久久老牛影院| 99精品视频在线免费观看| 91精品国产综合久久久久久久久久| 成年人国产精品| 欧美日本在线一区| ww久久中文字幕| 亚洲最新视频在线观看| 国产一区啦啦啦在线观看| 91国偷自产一区二区三区成为亚洲经典 | 丝袜国产日韩另类美女| 国产麻豆精品在线观看| 欧美性生活久久| 久久精品亚洲乱码伦伦中文| 午夜国产精品一区| 色综合色综合色综合色综合色综合| 粉嫩在线一区二区三区视频| 欧美精品aⅴ在线视频| 一区免费观看视频| 国产成人av福利| 日韩亚洲欧美高清| 亚洲影院理伦片| 91视频免费观看| 国产精品欧美一区二区三区| 狠狠色丁香婷婷综合| 欧美日韩一级二级三级| 成人免费在线视频观看| 国产不卡视频一区二区三区| 91精品久久久久久久99蜜桃| 一区二区久久久久久| 91原创在线视频| 日本一区二区三区四区| 激情六月婷婷久久| 日韩欧美www| 麻豆91免费看| 在线综合视频播放| 午夜精品在线视频一区| 在线观看av一区二区| 亚洲精品国产高清久久伦理二区| 亚洲国产另类av| 在线观看日韩国产| 一区二区三区 在线观看视频| 亚洲成av人在线观看| 91麻豆国产在线观看| 亚洲视频一二三区|