arch.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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 pt_regs;
  15. struct smp_operations;
  16. #ifdef CONFIG_SMP
  17. #define smp_ops(ops) (&(ops))
  18. #else
  19. #define smp_ops(ops) (struct smp_operations *)NULL
  20. #endif
  21. struct machine_desc {
  22. unsigned int nr; /* architecture number */
  23. const char *name; /* architecture name */
  24. unsigned long atag_offset; /* tagged list (relative) */
  25. const char *const *dt_compat; /* array of device tree
  26. * 'compatible' strings */
  27. unsigned int nr_irqs; /* number of IRQs */
  28. #ifdef CONFIG_ZONE_DMA
  29. unsigned long dma_zone_size; /* size of DMA-able area */
  30. #endif
  31. unsigned int video_start; /* start of video RAM */
  32. unsigned int video_end; /* end of video RAM */
  33. unsigned char reserve_lp0 :1; /* never has lp0 */
  34. unsigned char reserve_lp1 :1; /* never has lp1 */
  35. unsigned char reserve_lp2 :1; /* never has lp2 */
  36. char restart_mode; /* default restart mode */
  37. struct smp_operations *smp; /* SMP operations */
  38. void (*fixup)(struct tag *, char **,
  39. struct meminfo *);
  40. void (*reserve)(void);/* reserve mem blocks */
  41. void (*map_io)(void);/* IO mapping function */
  42. void (*init_early)(void);
  43. void (*init_irq)(void);
  44. struct sys_timer *timer; /* system tick timer */
  45. void (*init_machine)(void);
  46. void (*init_late)(void);
  47. #ifdef CONFIG_MULTI_IRQ_HANDLER
  48. void (*handle_irq)(struct pt_regs *);
  49. #endif
  50. void (*restart)(char, const char *);
  51. };
  52. /*
  53. * Current machine - only accessible during boot.
  54. */
  55. extern struct machine_desc *machine_desc;
  56. /*
  57. * Machine type table - also only accessible during boot
  58. */
  59. extern struct machine_desc __arch_info_begin[], __arch_info_end[];
  60. #define for_each_machine_desc(p) \
  61. for (p = __arch_info_begin; p < __arch_info_end; p++)
  62. /*
  63. * Set of macros to define architecture features. This is built into
  64. * a table by the linker.
  65. */
  66. #define MACHINE_START(_type,_name) \
  67. static const struct machine_desc __mach_desc_##_type \
  68. __used \
  69. __attribute__((__section__(".arch.info.init"))) = { \
  70. .nr = MACH_TYPE_##_type, \
  71. .name = _name,
  72. #define MACHINE_END \
  73. };
  74. #define DT_MACHINE_START(_name, _namestr) \
  75. static const struct machine_desc __mach_desc_##_name \
  76. __used \
  77. __attribute__((__section__(".arch.info.init"))) = { \
  78. .nr = ~0, \
  79. .name = _namestr,
  80. #endif