arch.h 2.7 KB

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