⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cachesync.c

📁 Sirf/Centrality公司GPS平台AtlasIII芯片AT640的Nboot源码
💻 C
字号:
//
// Copyright (c) Centralty Communications Corporation.  All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Module Name:	CacheSync.c

Abstract:		  
-----------------------------------------------------------------------------*/

#include "cachesync.h"
#include "at4x0f.h"

DWORD dwCacheInfo;

// drain the post-write FIFO of the RISK interface
__inline void DrainPostWriteFIFO(void)
{
	int t;

	// drain the 1st post-write FIFO
	RISCINT_FIFO_FLUSH = 3; // flush & auto-flush enable
	// drain the 2nd post-write FIFO, move pointer to the 1st FIFO
	RISCINT_FIFO_FLUSH = 3; // flush & auto-flush enable
	// wait
	for (t = 10000; t && !(RISCINT_FIFO_FLUSH & 0x04); t--);
	if (t == 0)
	{
		//NandDbgPutString("flush post-write fifo timeout!\r\n");
	}
}

void CacheRangeFlush(PVOID pAddr, DWORD dwLen, DWORD dwFlag)
{
	DWORD dwNormalizedAddress;
    DWORD dwNormalizedLength;

	dwNormalizedAddress = (DWORD) pAddr & ~(DCACHE_LINE_SIZE - 1);
	dwNormalizedLength = dwLen + ((DWORD) pAddr - dwNormalizedAddress);
	ARMFlushDCacheLines((void*) dwNormalizedAddress, dwNormalizedLength, DCACHE_LINE_SIZE);
	DrainPostWriteFIFO(); // drain post-write buffer
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -