arch.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 machine_desc {
  16. unsigned int nr; /* architecture number */
  17. const char *name; /* architecture name */
  18. unsigned long atag_offset; /* tagged list (relative) */
  19. const char *const *dt_compat; /* array of device tree
  20. * 'compatible' strings */
  21. unsigned int nr_irqs; /* number of IRQs */
  22. #ifdef CONFIG_ZONE_DMA
  23. unsigned long dma_zone_size; /* size of DMA-able area */
  24. #endif
  25. unsigned int video_start; /* start of video RAM */
  26. unsigned int video_end; /* end of video RAM */
  27. unsigned char reserve_lp0 :1; /* never has lp0 */
  28. unsigned char reserve_lp1 :1; /* never has lp1 */
  29. unsigned char reserve_lp2 :1; /* never has lp2 */
  30. char restart_mode; /* default restart mode */
  31. void (*fixup)(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. void (*restart)(char, const char *);
  43. };
  44. /*
  45. * Current machine - only accessible during boot.
  46. */
  47. extern struct machine_desc *machine_desc;
  48. /*
  49. * Machine type table - also only accessible during boot
  50. */
  51. extern struct machine_desc __arch_info_begin[], __arch_info_end[];
  52. #define for_each_machine_desc(p) \
  53. for (p = __arch_info_begin; p < __arch_info_end; p++)
  54. /*
  55. * Set of macros to define architecture features. This is built into
  56. * a table by the linker.
  57. */
  58. #define MACHINE_START(_type,_name) \
  59. static const struct machine_desc __mach_desc_##_type \
  60. __used \
  61. __attribute__((__section__(".arch.info.init"))) = { \
  62. .nr = MACH_TYPE_##_type, \
  63. .name = _name,
  64. #define MACHINE_END \
  65. };
  66. #define DT_MACHINE_START(_name, _namestr) \
  67. static const struct machine_desc __mach_desc_##_name \
  68. __used \
  69. __attribute__((__section__(".arch.info.init"))) = { \
  70. .nr = ~0, \
  71. .name = _namestr,
  72. #endif