tcm.h 925 B

1234567891011121314151617181920212223242526272829303132
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. *
  4. * Copyright (C) 2008-2009 ST-Ericsson AB
  5. *
  6. * Author: Rickard Andersson <[email protected]>
  7. * Author: Linus Walleij <[email protected]>
  8. */
  9. #ifndef __ASMARM_TCM_H
  10. #define __ASMARM_TCM_H
  11. #ifndef CONFIG_HAVE_TCM
  12. #error "You should not be including tcm.h unless you have a TCM!"
  13. #endif
  14. #include <linux/compiler.h>
  15. /* Tag variables with this */
  16. #define __tcmdata __section(".tcm.data")
  17. /* Tag constants with this */
  18. #define __tcmconst __section(".tcm.rodata")
  19. /* Tag functions inside TCM called from outside TCM with this */
  20. #define __tcmfunc __attribute__((long_call)) __section(".tcm.text") noinline
  21. /* Tag function inside TCM called from inside TCM with this */
  22. #define __tcmlocalfunc __section(".tcm.text")
  23. void *tcm_alloc(size_t len);
  24. void tcm_free(void *addr, size_t len);
  25. bool tcm_dtcm_present(void);
  26. bool tcm_itcm_present(void);
  27. #endif