4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/** @file
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync AsmFlushCacheRange() function for IPF.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This program and the accompanying materials
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync are licensed and made available under the terms and conditions of the BSD License
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync which accompanies this distribution. The full text of the license may be found at
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync http://opensource.org/licenses/bsd-license.php.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#include "BaseLibInternals.h"
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Flush a range of cache lines in the cache coherency domain of the calling
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync CPU.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Flushes the cache lines specified by Address and Length. If Address is not aligned
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync on a cache line boundary, then entire cache line containing Address is flushed.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Address + Length is not aligned on a cache line boundary, then the entire cache
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync line containing Address + Length - 1 is flushed. This function may choose to flush
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the entire cache if that is more efficient than flushing the specified range. If
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Length is 0, the no cache lines are flushed. Address is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This function is only available on IPF.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Address The base address of the instruction lines to invalidate. If
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the CPU is in a physical addressing mode, then Address is a
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync physical address. If the CPU is in a virtual addressing mode,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync then Address is a virtual address.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Length The number of bytes to invalidate from the instruction cache.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return Address.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncVOID *
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncAsmFlushCacheRange (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN VOID *Address,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Length
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync{
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return InternalFlushCacheRange (Address, Length);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}