github.com/jlmucb/cloudproxy@v0.0.0-20170830161738-b5aa0b619bc4/cpvmm/vmm/include/cache64.h (about) 1 /* 2 * Copyright (c) 2013 Intel Corporation 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * Unless required by applicable law or agreed to in writing, software 9 * distributed under the License is distributed on an "AS IS" BASIS, 10 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 * See the License for the specific language governing permissions and 12 * limitations under the License. 13 */ 14 15 #ifndef _CACHE64_H_ 16 #define _CACHE64_H_ 17 18 typedef struct CACHE64_STRUCT * CACHE64_OBJECT; 19 typedef void (*CACHE64_FIELD_PROCESS_FUNCTION)(UINT32 entry_no, void *arg); 20 21 #define CACHE_ALL_ENTRIES ((UINT32) -1) 22 #define CACHE_DIRTY_FLAG 1 23 #define CACHE_VALID_FLAG 2 24 25 CACHE64_OBJECT cache64_create(UINT32 num_of_entries); 26 void cache64_write(CACHE64_OBJECT cache, UINT64 value, UINT32 entry_no); 27 BOOLEAN cache64_read(CACHE64_OBJECT cache, UINT64 *p_value, UINT32 entry_no); 28 // return cache flags 29 UINT32 cache64_read_raw(CACHE64_OBJECT cache, UINT64 *p_value, UINT32 entry_no); 30 // clean valid bits 31 void cache64_invalidate(CACHE64_OBJECT cache, UINT32 entry_no); 32 void cache64_flush_dirty(CACHE64_OBJECT cache, 33 UINT32 entry_no, CACHE64_FIELD_PROCESS_FUNCTION function, 34 void *arg); // clean dirty bits 35 void cache64_flush_to_memory(CACHE64_OBJECT cache, void *p_dest, UINT32 max_bytes); 36 // return TRUE if any field is dirty valid 37 BOOLEAN cache64_is_dirty(CACHE64_OBJECT cache); 38 void cache64_destroy(CACHE64_OBJECT cache); 39 40 #endif // _CACHE64_H_ 41 42