1 /* SPDX-License-Identifier: BSD-2-Clause */ 2 /* 3 * Copyright (c) 2017, Linaro Limited 4 */ 5 6 #ifndef __KERNEL_CACHE_HELPERS_ARCH_H 7 #define __KERNEL_CACHE_HELPERS_ARCH_H 8 9 #ifndef __ASSEMBLER__ 10 #include <arm.h> 11 #include <types_ext.h> 12 #endif 13 14 #ifndef __ASSEMBLER__ 15 dcache_get_line_size(void)16static inline unsigned int dcache_get_line_size(void) 17 { 18 uint32_t value = read_ctr(); 19 20 return CTR_WORD_SIZE << 21 ((value >> CTR_DMINLINE_SHIFT) & CTR_DMINLINE_MASK); 22 } 23 24 #endif /*!__ASSEMBLER__*/ 25 26 #endif /*__KERNEL_CACHE_HELPERS_ARCH_H*/ 27