secure.h 640 B

1234567891011121314151617181920212223242526
  1. #ifndef __ASM_SECURE_H
  2. #define __ASM_SECURE_H
  3. #include <config.h>
  4. #ifdef CONFIG_ARMV7_SECURE_BASE
  5. /*
  6. * Warning, horror ahead.
  7. *
  8. * The target code lives in our "secure ram", but u-boot doesn't know
  9. * that, and has blindly added reloc_off to every relocation
  10. * entry. Gahh. Do the opposite conversion. This hack also prevents
  11. * GCC from generating code veeners, which u-boot doesn't relocate at
  12. * all...
  13. */
  14. #define secure_ram_addr(_fn) ({ \
  15. DECLARE_GLOBAL_DATA_PTR; \
  16. void *__fn = _fn; \
  17. typeof(_fn) *__tmp = (__fn - gd->reloc_off); \
  18. __tmp; \
  19. })
  20. #else
  21. #define secure_ram_addr(_fn) (_fn)
  22. #endif
  23. #endif