common.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Common header file for U-Boot
  4. *
  5. * This file still includes quite a bit of stuff that should be in separate
  6. * headers. Please think before adding more things.
  7. * Patches to remove things are welcome.
  8. *
  9. * (C) Copyright 2000-2009
  10. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  11. */
  12. #ifndef __COMMON_H_
  13. #define __COMMON_H_ 1
  14. #ifndef __ASSEMBLY__ /* put C only stuff in this section */
  15. #include <config.h>
  16. #include <errno.h>
  17. #include <time.h>
  18. #include <asm-offsets.h>
  19. #include <linux/bitops.h>
  20. #include <linux/bug.h>
  21. #include <linux/delay.h>
  22. #include <linux/types.h>
  23. #include <linux/printk.h>
  24. #include <linux/string.h>
  25. #include <linux/stringify.h>
  26. #include <asm/ptrace.h>
  27. #include <stdarg.h>
  28. #include <stdio.h>
  29. #include <linux/kernel.h>
  30. #include <part.h>
  31. #include <flash.h>
  32. #include <image.h>
  33. #ifdef __LP64__
  34. #define CONFIG_SYS_SUPPORT_64BIT_DATA
  35. #endif
  36. #include <log.h>
  37. #include <asm/u-boot.h> /* boot information for Linux kernel */
  38. #include <asm/global_data.h> /* global data used for startup functions */
  39. /* startup functions, used in:
  40. * common/board_f.c
  41. * common/init/board_init.c
  42. * common/board_r.c
  43. * common/board_info.c
  44. */
  45. #include <init.h>
  46. /*
  47. * Function Prototypes
  48. */
  49. void hang (void) __attribute__ ((noreturn));
  50. #include <display_options.h>
  51. /* lib/uuid.c */
  52. #include <uuid.h>
  53. /* lib/vsprintf.c */
  54. #include <vsprintf.h>
  55. /* lib/net_utils.c */
  56. #include <net.h>
  57. #include <bootstage.h>
  58. #else /* __ASSEMBLY__ */
  59. #endif /* __ASSEMBLY__ */
  60. /* Put only stuff here that the assembler can digest */
  61. #define ROUND(a,b) (((a) + (b) - 1) & ~((b) - 1))
  62. /*
  63. * check_member() - Check the offset of a structure member
  64. *
  65. * @structure: Name of structure (e.g. global_data)
  66. * @member: Name of member (e.g. baudrate)
  67. * @offset: Expected offset in bytes
  68. */
  69. #define check_member(structure, member, offset) _Static_assert( \
  70. offsetof(struct structure, member) == offset, \
  71. "`struct " #structure "` offset for `" #member "` is not " #offset)
  72. /* Pull in stuff for the build system */
  73. #ifdef DO_DEPS_ONLY
  74. # include <env_internal.h>
  75. #endif
  76. #endif /* __COMMON_H_ */