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

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

?? mmu440lib.c

?? vxworks的源代碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
    int		 ix;			/* index of L1 entries */    int		 jx;			/* index into L2 table pages */    LEVEL_1_DESC lvl1Desc;		/* current L1 descriptor */    /* we need to enable writes on the level 1 page table and each level 2     * page table. The level 1 page table is MMU_PAGE_SIZE in size, whereas     * the level 2 page table is 4 * MMU_PAGE_SIZE in size.     */    /* write enable the level 1 page table */    mmu440StateSet (pTransTbl, (void *)pTransTbl->l1TblPtr.pL1Desc,		    MMU_STATE_MASK_WRITABLE, MMU_STATE_WRITABLE);    /* go thru the L 1 table and write enable each L 2 table */    for (ix = 0 ; ix < MMU_LVL_2_DESC_NB; ix++)	{	lvl1Desc = * (pTransTbl->l1TblPtr.pL1Desc + ix);	if (lvl1Desc.field.v)	    {	    for (jx = 0; jx < 4; jx++)		{		mmu440StateSet (pTransTbl,		    (void *)(lvl1Desc.field.l2ba << 2) + (jx * MMU_PAGE_SIZE),		    MMU_STATE_MASK_WRITABLE, MMU_STATE_WRITABLE);		}	    }	}    return (OK);    }#endif /* FALSE *//******************************************************************************** mmu440MemPagesWriteDisable - write disable memory holding PTEs** Memory containing translation table descriptors is marked as read only* to protect the descriptors from being corrupted.  This routine write protects* all the memory used to contain a given translation table's descriptors.** RETURNS: N/A*/LOCAL void mmu440MemPagesWriteDisable    (    MMU_TRANS_TBL * pTransTbl		/* Translation table to disable */    )    {    int		 ix;			/* index of L1 entries */    int		 jx;			/* index into L2 table pages */    LEVEL_1_DESC lvl1Desc;		/* current L1 descriptor */    /* we need to disable writes on the level 1 page table and each level 2     * page table. The level 1 page table is MMU_PAGE_SIZE in size, whereas     * the level 2 page table is 4 * MMU_PAGE_SIZE in size.     */    /* write protect the level 1 page table */    mmu440StateSet (pTransTbl, (void *)pTransTbl->l1TblPtr.pL1Desc,		    MMU_STATE_MASK_WRITABLE, MMU_STATE_WRITABLE_NOT);    /* go thru the L 1 table and write protect each L 2 table */    for (ix = 0 ; ix < MMU_LVL_2_DESC_NB; ix++)	{	lvl1Desc = * (pTransTbl->l1TblPtr.pL1Desc + ix);	if (lvl1Desc.field.v)	    {	    for (jx = 0; jx < 4; jx++)		{		mmu440StateSet (pTransTbl,		    (void *)(lvl1Desc.field.l2ba << 2) + (jx * MMU_PAGE_SIZE),		    MMU_STATE_MASK_WRITABLE, MMU_STATE_WRITABLE_NOT);		}	    }	}    }/******************************************************************************** mmu440TransTblCreate - create a new translation table.** RETURNS: address of new object or NULL if allocation failed.*/LOCAL MMU_TRANS_TBL * mmu440TransTblCreate (void)    {    MMU_TRANS_TBL *	pNewTransTbl;		/* new translation table */    /* allocate a piece of memory to save the new translation table */    pNewTransTbl = (MMU_TRANS_TBL *) malloc (sizeof (MMU_TRANS_TBL));    /* if the memory can not allocated then return the NULL pointer */    if (pNewTransTbl == NULL)	return (NULL);    /* get a free PID for the new translation table */    pNewTransTbl->pid = mmu440PidAlloc (pNewTransTbl);    if (pNewTransTbl->pid == 0) /* no free PIDs ! */	{	free ((char *) pNewTransTbl);	return (NULL);	}    /*     * initialize the new translation table.     * If the initialization fails then free the memory and return the NULL     * pointer.     */    if (mmu440TransTblInit (pNewTransTbl) == ERROR)	{	free ((char *) pNewTransTbl);	return (NULL);	}    /* return the new translation table created */    return (pNewTransTbl);    }/******************************************************************************** mmu440TransTblInit - initialize a new translation table** Initialize a new translation table.  The level 1 table is copied from the* global translation mmuGlobalTransTbl, so that we will share the global* virtual memory with all other translation tables.** RETURNS: OK, or ERROR if unable to allocate memory.*/LOCAL STATUS mmu440TransTblInit    (    MMU_TRANS_TBL * pNewTransTbl	/* translation table to initialize */    )    {    /*     * Allocate memory space for a new Level 1 descriptor table.  This memory     * needs to be page aligned because, we write protect all the page tables     * later, and we don't want other variables sharing a page with the page     * table itself.     */    pNewTransTbl->l1TblPtr.pL1Desc =	(LEVEL_1_DESC *) memalign (MMU_PAGE_SIZE, MMU_PAGE_SIZE);    /* if the memory cannot be allocated then return ERROR */    if (pNewTransTbl->l1TblPtr.pL1Desc == NULL)	return (ERROR);    /* invalidate all entries in the table */    memset ((void *) pNewTransTbl->l1TblPtr.pL1Desc, 0x00, MMU_PAGE_SIZE);    if (mmuGlobalTransTbl != NULL)	{	/* copy the global level 1 descriptor table to the new table */	memcpy ((void *) pNewTransTbl->l1TblPtr.pL1Desc,	    (void *) mmuGlobalTransTbl->l1TblPtr.pL1Desc, MMU_PAGE_SIZE);	}    /* In AE, would page protect the new L1 descriptor table here */    return (OK);    }/******************************************************************************** mmu440TransTblDelete - delete a translation table.** This routine deletes a translation table.** RETURNS: OK always.*/LOCAL STATUS mmu440TransTblDelete    (    MMU_TRANS_TBL * pTransTbl		/* translation table to be deleted */    )    {    LEVEL_1_DESC 	lvl1Desc;	/* level 1 descriptor */    UINT32		ix;    /* free the PID element for this translation table */    mmu440PidFree (pTransTbl->pid);    /* free level 2 page tables */    for (ix = 0 ; ix < MMU_LVL_2_DESC_NB; ix++)	{	lvl1Desc = * (pTransTbl->l1TblPtr.pL1Desc + ix);	if (lvl1Desc.field.v)	    free ((void *) (lvl1Desc.l1desc & MMU_LVL_1_L2BA_MSK));	}    /* free the level 1 table */    free ((void *) pTransTbl->l1TblPtr.pL1Desc);    return (OK);    }/******************************************************************************** mmu440Enable - turn mmu on or off** On the PPC440, the MMU is always on, so turning it off is a misnomer.* Instead, this function changes the MSR[IS,DS] values, which change which TLB* entries match -- either the static ones that emulate 'real mode', or the ones* that provide dynamic mmu page mapping.** RETURNS: OK*/LOCAL STATUS mmu440Enable    (    BOOL enable			/* TRUE to enable, FALSE to disable MMU */    )    {    int lockKey;		/* lock key for intUnlock() */    if (mmuPpcSelected == 0)	return (OK);    /* lock the interrupt */    lockKey = intLock ();    if (enable)	{	if (mmuPpcSelected & MMU_INST)	    mmuPpcAEnable (MMU_I_ADDR_TRANS);	/* enable instruction MMU */	if (mmuPpcSelected & MMU_DATA)	    mmuPpcAEnable (MMU_D_ADDR_TRANS);	/* enable data MMU */	}    else	{	if (mmuPpcSelected & MMU_INST)	    mmuPpcADisable (MMU_I_ADDR_TRANS);	/* disable instruction MMU */	if (mmuPpcSelected & MMU_DATA)	    mmuPpcADisable (MMU_D_ADDR_TRANS);	/* disable data MMU */	}    /* AE would unmap EA 0x0 - 0x2fff here, but only for user mode tasks */    intUnlock (lockKey);			/* unlock the interrupt */    return (OK);    }/******************************************************************************** mmu440StateSet - set state of virtual memory page*** MMU_STATE_VALID	MMU_STATE_VALID_NOT	valid/invalid* MMU_STATE_WRITABLE	MMU_STATE_WRITABLE_NOT	writable/writeprotected* MMU_STATE_CACHEABLE	MMU_STATE_CACHEABLE_NOT	cachable/notcachable* MMU_STATE_CACHEABLE_WRITETHROUGH* MMU_STATE_CACHEABLE_COPYBACK* MMU_STATE_GUARDED	MMU_STATE_GUARDED_NOT	guarded/un-guarded** RETURNS: OK, or ERROR if descriptor address does not exist.*/LOCAL STATUS mmu440StateSet    (    MMU_TRANS_TBL *	pTransTbl, 	/* translation table */    void *		effectiveAddr,	/* page whose state to modify */    UINT 		stateMask,	/* mask of which state bits to modify */    UINT		state		/* new state bit values */    )    {    LEVEL_2_DESC *	pLvl2Desc;	/* level 2 descriptor address */    LEVEL_2_DESC	lvl2Desc;	/* level 2 descriptor */    BOOL		flush = FALSE;	/* page must be flushed from cache */    /*     * get the level 2 descriptor address. If this descriptor address doesn't     * exist then set errno and return ERROR.     */    if (mmu440Lvl2DescAddrGet (pTransTbl, effectiveAddr, &pLvl2Desc) == ERROR)	{	errno = S_mmuLib_NO_DESCRIPTOR;	return (ERROR);	}    /* make a working copy of the Level 2 Descriptor */    lvl2Desc = *pLvl2Desc;    if (stateMask & MMU_STATE_MASK_CACHEABLE)	{	/*	 * Check if the state to set page corresponding to <effectiveAddr>	 * will not set the cache inhibited and writethrough mode. This mode	 * is not supported by the cache.	 */	if ((state & MMU_STATE_CACHEABLE_NOT) &&	    (state & MMU_STATE_CACHEABLE_WRITETHROUGH))	    {	    return (ERROR);	    }	/*	 * if the page is presently COPYBACK, and we plan to set it to	 * cache inhibited or writeback, flush the page before continuing.	 */	if (lvl2Desc.field.v &&	    ((lvl2Desc.words.word2 & MMU_STATE_MASK_CACHEABLE) ==	     MMU_STATE_CACHEABLE_COPYBACK) &&	    ((state & MMU_STATE_MASK_CACHEABLE) !=	     MMU_STATE_CACHEABLE_COPYBACK))	    {	    flush = TRUE;	    }	}    /*     * set or reset the VALID bit if requested. Since the Valid bit     * in MMU_STATE is in a different bit position than in the TLB Word 0,     * we use an if statement to express the logic clearly rather than     * use a complicated mixture of shift, or, and and.     */    if (stateMask & MMU_STATE_MASK_VALID)	{	if (state & stateMask & MMU_STATE_MASK_VALID)	    lvl2Desc.field.v = 1;	else	    lvl2Desc.field.v = 0;	}    /*     * set or reset the WIMG bits as requested. WIMG and write/execute bits     * are in the same bit positions in MMU_STATE as in TLB Word 2, so we     * can use bitwise arithmetic     */    lvl2Desc.words.word2 &= ~(stateMask & MMU_STATE_MASK_WIMG_WRITABLE_EXECUTE);    lvl2Desc.words.word2 |= (state & stateMask &			     MMU_STATE_MASK_WIMG_WRITABLE_EXECUTE);    /* flush out any copyback data before we change the attribute mapping */    if (flush == TRUE)	cacheArchFlush(DATA_CACHE, effectiveAddr, MMU_PAGE_SIZE);    /* update the Level 2 Descriptor */    mmu440Lvl2DescUpdate (pLvl2Desc, lvl2Desc);    /* invalidate the tlb entry for this effective address */    mmu440Tlbie (pTransTbl, effectiveAddr);    return (OK);    }/******************************************************************************** mmu440StateGet - get state of virtual memory page**/LOCAL STATUS mmu440StateGet    (    MMU_TRANS_TBL *	pTransTbl,	/* tranlation table */    void *		effectiveAddr, 	/* page whose state we're querying */    UINT *		state		/* place to return state value */    )    {    LEVEL_2_DESC *	pLvl2Desc;	/* level 2 descriptor address */    LEVEL_2_DESC	lvl2Desc;	/* level 2 descriptor */    /*     * get the level 2 descriptor address. If this descriptor address doesn't     * exist then set errno and return ERROR.     */    if (mmu440Lvl2DescAddrGet (pTransTbl, effectiveAddr, &pLvl2Desc) == ERROR)	{	errno = S_mmuLib_NO_DESCRIPTOR;	return (ERROR);	}    /* make a working copy the Level 2 Descriptor */    lvl2Desc = *pLvl2Desc;    /* extract the state of the VALID, WIMG and EX, WR bits.     * Note that the valid bit is in a different bit position in L2 desc     * than in the MMU_STATE_VALID.     */    * state = (lvl2Desc.field.v ? MMU_STATE_VALID : 0);    * state |= lvl2Desc.words.word2 & MMU_STATE_MASK_WIMG_WRITABLE_EXECUTE;    return (OK);    }/******************************************************************************** mmu440PageMap - map physical memory page to virtual memory page** The physical page address is entered into the level 2 descriptor* corresponding to the given virtual page.  The state of a newly mapped page* is undefined.** RETURNS: OK, or ERROR if translation table creation failed.*/LOCAL STATUS mmu440PageMap    (    MMU_TRANS_TBL *	pTransTbl, 	/* translation table */    void *		effectiveAddr, 	/* effective address */    void *		physicalAddr	/* physical address */    )    {    LEVEL_1_DESC *	pLvl1Desc;	/* level 1 descriptor address */    LEVEL_1_DESC 	lvl1Desc;	/* level 1 descriptor */    LEVEL_2_DESC *	pLvl2Desc;	/* level 2 descriptor address */    LEVEL_2_DESC 	lvl2Desc;	/* level 2 descriptor */    /* get the level 1 descriptor address */    pLvl1Desc = mmu440Lvl1DescAddrGet (pTransTbl, effectiveAddr);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美在线观看视频在线| 国模一区二区三区白浆| 不卡的av网站| 中文字幕日韩一区二区| 色综合久久88色综合天天 | 91视频免费播放| 亚洲免费资源在线播放| 欧美日韩精品一区二区天天拍小说 | 视频在线观看一区| 日韩一区二区在线观看视频播放| 看片网站欧美日韩| 国产精品沙发午睡系列990531| 99久久99久久精品免费看蜜桃| 亚洲一区二区三区视频在线| 欧美一区二区三区在线看| 久久 天天综合| 中文在线一区二区| 欧美午夜精品理论片a级按摩| 日韩高清一区二区| 国产亚洲女人久久久久毛片| 一本大道久久a久久精品综合| 日韩主播视频在线| 国产精品嫩草影院av蜜臀| 欧美三级日韩三级| 国产精品综合二区| 亚洲福利视频一区二区| 久久综合九色欧美综合狠狠| 一本大道av伊人久久综合| 老司机午夜精品99久久| 综合久久综合久久| 精品国产乱码久久久久久蜜臀| 99视频一区二区| 久久精品久久久精品美女| 国产精品理伦片| 日韩女同互慰一区二区| 色久综合一二码| 国产精品一区专区| 亚洲va欧美va人人爽| 日本一区二区高清| 日韩视频一区二区三区在线播放| 99久久久免费精品国产一区二区 | 亚洲精品亚洲人成人网| 日韩一本二本av| 欧美在线一二三| 成人免费的视频| 国内精品久久久久影院色| 亚洲一区二区欧美激情| 欧美国产亚洲另类动漫| 欧美一区二区福利视频| 91丨九色porny丨蝌蚪| 国产精品一区一区| 美女免费视频一区二区| 天天操天天综合网| 一区二区三区在线免费| 国产精品久久久久一区| 国产人妖乱国产精品人妖| 欧美一区二区啪啪| 欧美日韩精品久久久| 91丝袜高跟美女视频| 国产精品系列在线播放| 激情久久五月天| 捆绑紧缚一区二区三区视频| 午夜精品一区在线观看| 亚洲午夜免费视频| 亚洲精品国产品国语在线app| 中文字幕第一区综合| 精品sm在线观看| 精品久久国产字幕高潮| 欧美sm极限捆绑bd| 日韩写真欧美这视频| 日韩免费性生活视频播放| 91精品国产手机| 欧美成va人片在线观看| 欧美tickle裸体挠脚心vk| 精品粉嫩超白一线天av| 337p日本欧洲亚洲大胆精品| 精品国产精品网麻豆系列| 日韩你懂的在线播放| 精品对白一区国产伦| 久久一区二区视频| 中文字幕免费在线观看视频一区| 久久精品男人的天堂| 国产精品亲子伦对白| 日韩一区欧美一区| 一区二区三区在线免费| 亚洲国产日韩精品| 免费精品99久久国产综合精品| 琪琪久久久久日韩精品| 韩国成人福利片在线播放| 国产成人啪免费观看软件 | 日本国产一区二区| 欧美午夜一区二区三区免费大片| 欧美放荡的少妇| 精品99999| 亚洲欧洲日本在线| 亚洲妇熟xx妇色黄| 久久国内精品自在自线400部| 国产一区二区三区在线观看精品| 成人国产一区二区三区精品| 91福利在线播放| 日韩一区二区麻豆国产| 欧美激情在线看| 一区二区三区资源| 美腿丝袜在线亚洲一区| 成人精品视频网站| 欧美人xxxx| 日本一区二区三区dvd视频在线| 亚洲免费资源在线播放| 蜜桃av一区二区在线观看| www.欧美色图| 在线播放欧美女士性生活| 国产视频一区在线播放| 一区二区三区电影在线播| 狠狠网亚洲精品| 91福利区一区二区三区| 久久午夜免费电影| 一区二区高清在线| 国产一区二区美女诱惑| 色美美综合视频| 久久亚洲捆绑美女| 艳妇臀荡乳欲伦亚洲一区| 狠狠色综合播放一区二区| 在线欧美小视频| 久久看人人爽人人| 三级欧美在线一区| 成人av免费在线播放| 日韩三级电影网址| 夜夜嗨av一区二区三区网页 | 日本在线观看不卡视频| 成人动漫一区二区| 日韩一卡二卡三卡| 亚洲一级片在线观看| 成人av一区二区三区| 日韩欧美专区在线| 亚洲色图.com| 粉嫩绯色av一区二区在线观看| 欧美麻豆精品久久久久久| 1024亚洲合集| 国产呦精品一区二区三区网站| 欧美性受极品xxxx喷水| 国产精品嫩草99a| 精品一区二区三区蜜桃| 欧美日韩国产bt| 亚洲综合清纯丝袜自拍| 99国产欧美久久久精品| 久久久久9999亚洲精品| 免费在线观看视频一区| 欧美人狂配大交3d怪物一区 | 日日摸夜夜添夜夜添国产精品| 不卡的av电影在线观看| 久久久精品天堂| 久久99久久精品欧美| 91精品国产综合久久香蕉麻豆| 亚洲精品菠萝久久久久久久| 高清久久久久久| 国产农村妇女精品| 国产乱理伦片在线观看夜一区| 91精品国产一区二区| 日韩高清不卡一区| 欧美日韩亚洲综合一区二区三区| 夜夜爽夜夜爽精品视频| 色域天天综合网| 依依成人综合视频| 色爱区综合激月婷婷| 亚洲视频在线一区| 91麻豆免费在线观看| 1024成人网| 在线一区二区观看| 亚洲va国产va欧美va观看| 欧美在线综合视频| 日韩av电影天堂| 91精品国产综合久久久久久| 青青草国产精品亚洲专区无| 欧美一二三四在线| 激情欧美一区二区三区在线观看| 久久综合狠狠综合久久激情| 国产精品88888| 热久久久久久久| 91精品蜜臀在线一区尤物| 激情五月婷婷综合| 久久精品网站免费观看| 国产精品一区二区黑丝| 国产精品久久久久久福利一牛影视| 成人99免费视频| 亚洲一区二区在线免费观看视频 | 久久电影国产免费久久电影| 日韩女优av电影| 国产不卡视频在线观看| 亚洲欧美日本在线| 欧美日韩国产精选| 国产专区欧美精品| 亚洲欧美日韩在线播放| 欧美日韩高清一区| 久久精品国产99国产| 国产欧美一区二区精品性| 一本久道中文字幕精品亚洲嫩| 亚洲自拍偷拍综合| 欧美精品一区二区高清在线观看| 成人免费视频app| 日日噜噜夜夜狠狠视频欧美人|