xref: /OK3568_Linux_fs/kernel/arch/csky/include/asm/tcm.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 */
2*4882a593Smuzhiyun 
3*4882a593Smuzhiyun #ifndef __ASM_CSKY_TCM_H
4*4882a593Smuzhiyun #define __ASM_CSKY_TCM_H
5*4882a593Smuzhiyun 
6*4882a593Smuzhiyun #ifndef CONFIG_HAVE_TCM
7*4882a593Smuzhiyun #error "You should not be including tcm.h unless you have a TCM!"
8*4882a593Smuzhiyun #endif
9*4882a593Smuzhiyun 
10*4882a593Smuzhiyun #include <linux/compiler.h>
11*4882a593Smuzhiyun 
12*4882a593Smuzhiyun /* Tag variables with this */
13*4882a593Smuzhiyun #define __tcmdata __section(".tcm.data")
14*4882a593Smuzhiyun /* Tag constants with this */
15*4882a593Smuzhiyun #define __tcmconst __section(".tcm.rodata")
16*4882a593Smuzhiyun /* Tag functions inside TCM called from outside TCM with this */
17*4882a593Smuzhiyun #define __tcmfunc __section(".tcm.text") noinline
18*4882a593Smuzhiyun /* Tag function inside TCM called from inside TCM  with this */
19*4882a593Smuzhiyun #define __tcmlocalfunc __section(".tcm.text")
20*4882a593Smuzhiyun 
21*4882a593Smuzhiyun void *tcm_alloc(size_t len);
22*4882a593Smuzhiyun void tcm_free(void *addr, size_t len);
23*4882a593Smuzhiyun 
24*4882a593Smuzhiyun #endif
25