sections.h 895 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * decls for symbols defined in the linker script
  3. *
  4. * Copyright (c) 2012 The Chromium OS Authors.
  5. *
  6. * Licensed under the GPL-2 or later.
  7. */
  8. #ifndef __SANDBOX_SECTIONS_H
  9. #define __SANDBOX_SECTIONS_H
  10. #include <asm-generic/sections.h>
  11. struct sandbox_cmdline_option;
  12. static inline struct sandbox_cmdline_option **
  13. __u_boot_sandbox_option_start(void)
  14. {
  15. static char start[0] __aligned(4) __attribute__((unused))
  16. __section(".u_boot_sandbox_getopt_start");
  17. return (struct sandbox_cmdline_option **)&start;
  18. }
  19. static inline struct sandbox_cmdline_option **
  20. __u_boot_sandbox_option_end(void)
  21. {
  22. static char end[0] __aligned(4) __attribute__((unused))
  23. __section(".u_boot_sandbox_getopt_end");
  24. return (struct sandbox_cmdline_option **)&end;
  25. }
  26. static inline size_t __u_boot_sandbox_option_count(void)
  27. {
  28. return __u_boot_sandbox_option_end() - __u_boot_sandbox_option_start();
  29. }
  30. #endif