arch.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * arch/arm/include/asm/mach/arch.h
  3. *
  4. * Copyright (C) 2000 Russell King
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #ifndef __ASSEMBLY__
  11. struct tag;
  12. struct meminfo;
  13. struct sys_timer;
  14. struct machine_desc {
  15. unsigned int nr; /* architecture number */
  16. const char *name; /* architecture name */
  17. unsigned long boot_params; /* tagged list */
  18. const char **dt_compat; /* array of device tree
  19. * 'compatible' strings */
  20. unsigned int nr_irqs; /* number of IRQs */
  21. #ifdef CONFIG_ZONE_DMA
  22. unsigned long dma_zone_size; /* size of DMA-able area */
  23. #endif
  24. unsigned int video_start; /* start of video RAM */
  25. unsigned int video_end; /* end of video RAM */
  26. unsigned int reserve_lp0 :1; /* never has lp0 */
  27. unsigned int reserve_lp1 :1; /* never has lp1 */
  28. unsigned int reserve_lp2 :1; /* never has lp2 */
  29. unsigned int soft_reboot :1; /* soft reboot */
  30. void (*fixup)(struct machine_desc *,
  31. struct tag *, char **,
  32. struct meminfo *);
  33. void (*reserve)(void);/* reserve mem blocks */
  34. void (*map_io)(void);/* IO mapping function */
  35. void (*init_early)(void);
  36. void (*init_irq)(void);
  37. struct sys_timer *timer; /* system tick timer */
  38. void (*init_machine)(void);
  39. #ifdef CONFIG_MULTI_IRQ_HANDLER
  40. void (*handle_irq)(struct pt_regs *);
  41. #endif
  42. };
  43. /*
  44. * Current machine - only accessible during boot.
  45. */
  46. extern struct machine_desc *machine_desc;
  47. /*
  48. * Machine type table - also only accessible during boot
  49. */
  50. extern struct machine_desc __arch_info_begin[], __arch_info_end[];
  51. #define for_each_machine_desc(p) \
  52. for (p = __arch_info_begin; p < __arch_info_end; p++)
  53. /*
  54. * Set of macros to define architecture features. This is built into
  55. * a table by the linker.
  56. */
  57. #define MACHINE_START(_type,_name) \
  58. static const struct machine_desc __mach_desc_##_type \
  59. __used \
  60. __attribute__((__section__(".arch.info.init"))) = { \
  61. .nr = MACH_TYPE_##_type, \
  62. .name = _name,
  63. #define MACHINE_END \
  64. };
  65. #define DT_MACHINE_START(_name, _namestr) \
  66. static const struct machine_desc __mach_desc_##_name \
  67. __used \
  68. __attribute__((__section__(".arch.info.init"))) = { \
  69. .nr = ~0, \
  70. .name = _namestr,
  71. #endif