/** @file\r
Cache Maintenance Functions.\r
\r
- Copyright (c) 2006, Intel Corporation<BR>\r
+ Copyright (c) 2006 - 2008, Intel Corporation<BR>\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
**/\r
\r
-\r
-//\r
-// Include common header file for this module.\r
-//\r
#include <Base.h>\r
#include <Library/CacheMaintenanceLib.h>\r
#include <Library/BaseLib.h>\r
#include <Library/DebugLib.h>\r
-#include <Library/PalCallLib.h>\r
+#include <Library/PalLib.h>\r
\r
/**\r
Invalidates the entire instruction cache in cache coherency domain of the\r
VOID\r
)\r
{\r
- PalCall (1, 1, 1, 0);\r
+ PalCall (PAL_CACHE_FLUSH, PAL_CACHE_FLUSH_INSTRUCTION_ALL, PAL_CACHE_FLUSH_INVALIDATE_LINES | PAL_CACHE_FLUSH_NO_INTERRUPT, 0);\r
}\r
\r
/**\r
\r
@param Length The number of bytes to invalidate from the instruction cache.\r
\r
- @return Address\r
+ @return Address.\r
\r
**/\r
VOID *\r
IN UINTN Length\r
)\r
{\r
- return IpfFlushCacheRange (Address, Length);\r
+ ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);\r
+ return AsmFlushCacheRange (Address, Length);\r
}\r
\r
/**\r
VOID\r
)\r
{\r
- PalCall (1, 2, 1, 0);\r
+ PalCall (PAL_CACHE_FLUSH, PAL_CACHE_FLUSH_DATA_ALL, PAL_CACHE_FLUSH_INVALIDATE_LINES | PAL_CACHE_FLUSH_NO_INTERRUPT, 0);\r
}\r
\r
/**\r
@param Length The number of bytes to write back and invalidate from the\r
data cache.\r
\r
- @return Address\r
+ @return Address of cache invalidation.\r
\r
**/\r
VOID *\r
{\r
ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);\r
\r
- return IpfFlushCacheRange (Address, Length);\r
+ return AsmFlushCacheRange (Address, Length);\r
}\r
\r
/**\r
VOID\r
)\r
{\r
- PalCall (1, 2, 0, 0);\r
+ PalCall (PAL_CACHE_FLUSH, PAL_CACHE_FLUSH_DATA_ALL, PAL_CACHE_FLUSH_NO_INVALIDATE_LINES | PAL_CACHE_FLUSH_NO_INTERRUPT, 0);\r
}\r
\r
/**\r
mode, then Address is a virtual address.\r
@param Length The number of bytes to write back from the data cache.\r
\r
- @return Address\r
+ @return Address of cache written in main memory.\r
\r
**/\r
VOID *\r
{\r
ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);\r
\r
- return IpfFlushCacheRange (Address, Length);\r
+ return AsmFlushCacheRange (Address, Length);\r
}\r
\r
/**\r
VOID\r
)\r
{\r
+ //\r
+ // Invalidation of entire data cache without writing back is not supported on\r
+ // IPF architecture, so write back and invalidate operation is performed.\r
+ //\r
WriteBackInvalidateDataCache ();\r
}\r
\r
then Address is a virtual address.\r
@param Length The number of bytes to invalidate from the data cache.\r
\r
- @return Address\r
+ @return Address.\r
\r
**/\r
VOID *\r
IN UINTN Length\r
)\r
{\r
- return IpfFlushCacheRange (Address, Length);\r
+ ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);\r
+ //\r
+ // Invalidation of a data cache range without writing back is not supported on\r
+ // IPF architecture, so write back and invalidate operation is performed.\r
+ //\r
+ return AsmFlushCacheRange (Address, Length);\r
}\r