arch.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. void (*init_late)(void);
  40. #ifdef CONFIG_MULTI_IRQ_HANDLER
  41. void (*handle_irq)(struct pt_regs *);
  42. #endif
  43. void (*restart)(char, const char *);
  44. };
  45. /*
  46. * Current machine - only accessible during boot.
  47. */
  48. extern struct machine_desc *machine_desc;
  49. /*
  50. * Machine type table - also only accessible during boot
  51. */
  52. extern struct machine_desc __arch_info_begin[], __arch_info_end[];
  53. #define for_each_machine_desc(p) \
  54. for (p = __arch_info_begin; p < __arch_info_end; p++)
  55. /*
  56. * Set of macros to define architecture features. This is built into
  57. * a table by the linker.
  58. */
  59. #define MACHINE_START(_type,_name) \
  60. static const struct machine_desc __mach_desc_##_type \
  61. __used \
  62. __attribute__((__section__(".arch.info.init"))) = { \
  63. .nr = MACH_TYPE_##_type, \
  64. .name = _name,
  65. #define MACHINE_END \
  66. };
  67. #define DT_MACHINE_START(_name, _namestr) \
  68. static const struct machine_desc __mach_desc_##_name \
  69. __used \
  70. __attribute__((__section__(".arch.info.init"))) = { \
  71. .nr = ~0, \
  72. .name = _namestr,
  73. #endif