syscall_data.h 994 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Copyright (c) 2006-2022, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2022-11-10 RT-Thread The first version
  9. */
  10. #ifndef __SYSCALL_DATA_H__
  11. #define __SYSCALL_DATA_H__
  12. #include <rtthread.h>
  13. /**
  14. * @brief signature for syscall, used to locate syscall metadata.
  15. *
  16. * We don't allocate an exclusive section in ELF like Linux do
  17. * to avoid initializing necessary data by iterating that section,
  18. * which increases system booting time. We signature a pointer
  19. * just below each syscall entry in syscall table to make it
  20. * easy to locate every syscall's metadata by using syscall id.
  21. *
  22. * TODO Currently this adds a dummy pointer to syscall name.
  23. * After adding metadata of every syscalls in front of their definition,
  24. * this should be replaced by a pointer to that structure
  25. */
  26. #define SYSCALL_SIGN(func) \
  27. (void *)func, \
  28. RT_STRINGIFY(func)
  29. #endif /* __SYSCALL_DATA_H__ */