bounds.c 751 B

1234567891011121314151617181920212223242526272829
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Generate definitions needed by the preprocessor.
  4. * This code generates raw asm output which is post-processed
  5. * to extract and format the required data.
  6. */
  7. #define __GENERATING_BOUNDS_H
  8. /* Include headers that define the enum constants of interest */
  9. #include <linux/page-flags.h>
  10. #include <linux/mmzone.h>
  11. #include <linux/kbuild.h>
  12. #include <linux/log2.h>
  13. #include <linux/spinlock_types.h>
  14. int main(void)
  15. {
  16. /* The enum constants to put into include/generated/bounds.h */
  17. DEFINE(NR_PAGEFLAGS, __NR_PAGEFLAGS);
  18. DEFINE(MAX_NR_ZONES, __MAX_NR_ZONES);
  19. #ifdef CONFIG_SMP
  20. DEFINE(NR_CPUS_BITS, ilog2(CONFIG_NR_CPUS));
  21. #endif
  22. DEFINE(SPINLOCK_SIZE, sizeof(spinlock_t));
  23. /* End of constants */
  24. return 0;
  25. }