asm.h 430 B

12345678910111213141516171819202122232425262728
  1. #pragma once
  2. #ifndef __ASM__
  3. #define __ASM__
  4. // 符号名
  5. #define SYMBOL_NAME(X) X
  6. // 符号名字符串
  7. #define SYMBOL_NAME_STR(X) #X
  8. // 符号名label
  9. #define SYMBOL_NAME_LABEL(X) X##:
  10. #define L1_CACHE_BYTES 32
  11. #define asmlinkage __attribute__((regparm(0)))
  12. #define ____cacheline_aligned __attribute__((__aligned__(L1_CACHE_BYTES)))
  13. #define ENTRY(name) \
  14. .global SYMBOL_NAME(name); \
  15. SYMBOL_NAME_LABEL(name)
  16. #endif