arch.h 2.5 KB

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