2 // Copyright (c) 2006, Intel Corporation
3 // All rights reserved. This program and the accompanying materials
4 // are licensed and made available under the terms and conditions of the BSD License
5 // which accompanies this distribution. The full text of the license may be found at
6 // http://opensource.org/licenses/bsd-license.php
8 // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
9 // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 // Contains Misc assembly procedures to support IPF CPU AP.
26 #include "IpfDefines.h"
28 //-----------------------------------------------------------------------------
34 // Input = in0 = Starting Address to Flush.
35 // Input = in1 = Length in bytes.
36 // Input = b0 = return branch register.
43 // IN UINT64 BaseToFlush,
44 // IN UINT64 LengthToFlush
48 //---------------------------------------------------------------------------
49 PROCEDURE_ENTRY (SalFlushCache)
51 NESTED_SETUP (5,8,0,0)
55 mov loc3 = in0 // Start address.
56 mov loc4 = in1;; // Length in bytes.
58 cmp.eq p6,p7 = loc4, r0;; // If Length is zero then don't flush any cache
59 (p6) br.spnt.many DoneFlushingC;;
63 sub loc4 = loc4, loc5 ;; // the End address to flush
65 dep loc3 = r0,loc3,0,5
66 dep loc4 = r0,loc4,0,5;;
68 shr loc4 = loc4,5;; // 32 byte cache line
70 sub loc4 = loc4,loc3;; // total flush count, It should be add 1 but
71 // the br.cloop will first execute one time
80 add loc3 = loc5,loc3;;
81 br.cloop.sptk.few StillFlushingC;;
87 PROCEDURE_EXIT (SalFlushCache)