arch.h 2.6 KB

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