machvec.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __ALPHA_MACHVEC_H
  3. #define __ALPHA_MACHVEC_H 1
  4. #include <linux/types.h>
  5. /*
  6. * This file gets pulled in by asm/io.h from user space. We don't
  7. * want most of this escaping.
  8. */
  9. #ifdef __KERNEL__
  10. /* The following structure vectors all of the I/O and IRQ manipulation
  11. from the generic kernel to the hardware specific backend. */
  12. struct task_struct;
  13. struct mm_struct;
  14. struct vm_area_struct;
  15. struct linux_hose_info;
  16. struct pci_dev;
  17. struct pci_ops;
  18. struct pci_controller;
  19. struct _alpha_agp_info;
  20. struct rtc_time;
  21. struct alpha_machine_vector
  22. {
  23. /* This "belongs" down below with the rest of the runtime
  24. variables, but it is convenient for entry.S if these
  25. two slots are at the beginning of the struct. */
  26. unsigned long hae_cache;
  27. unsigned long *hae_register;
  28. int nr_irqs;
  29. int rtc_port;
  30. int rtc_boot_cpu_only;
  31. unsigned int max_asn;
  32. unsigned long max_isa_dma_address;
  33. unsigned long irq_probe_mask;
  34. unsigned long iack_sc;
  35. unsigned long min_io_address;
  36. unsigned long min_mem_address;
  37. unsigned long pci_dac_offset;
  38. void (*mv_pci_tbi)(struct pci_controller *hose,
  39. dma_addr_t start, dma_addr_t end);
  40. u8 (*mv_ioread8)(const void __iomem *);
  41. u16 (*mv_ioread16)(const void __iomem *);
  42. u32 (*mv_ioread32)(const void __iomem *);
  43. u64 (*mv_ioread64)(const void __iomem *);
  44. void (*mv_iowrite8)(u8, void __iomem *);
  45. void (*mv_iowrite16)(u16, void __iomem *);
  46. void (*mv_iowrite32)(u32, void __iomem *);
  47. void (*mv_iowrite64)(u64, void __iomem *);
  48. u8 (*mv_readb)(const volatile void __iomem *);
  49. u16 (*mv_readw)(const volatile void __iomem *);
  50. u32 (*mv_readl)(const volatile void __iomem *);
  51. u64 (*mv_readq)(const volatile void __iomem *);
  52. void (*mv_writeb)(u8, volatile void __iomem *);
  53. void (*mv_writew)(u16, volatile void __iomem *);
  54. void (*mv_writel)(u32, volatile void __iomem *);
  55. void (*mv_writeq)(u64, volatile void __iomem *);
  56. void __iomem *(*mv_ioportmap)(unsigned long);
  57. void __iomem *(*mv_ioremap)(unsigned long, unsigned long);
  58. void (*mv_iounmap)(volatile void __iomem *);
  59. int (*mv_is_ioaddr)(unsigned long);
  60. int (*mv_is_mmio)(const volatile void __iomem *);
  61. void (*mv_switch_mm)(struct mm_struct *, struct mm_struct *,
  62. struct task_struct *);
  63. void (*mv_activate_mm)(struct mm_struct *, struct mm_struct *);
  64. void (*mv_flush_tlb_current)(struct mm_struct *);
  65. void (*mv_flush_tlb_current_page)(struct mm_struct * mm,
  66. struct vm_area_struct *vma,
  67. unsigned long addr);
  68. void (*update_irq_hw)(unsigned long, unsigned long, int);
  69. void (*ack_irq)(unsigned long);
  70. void (*device_interrupt)(unsigned long vector);
  71. void (*machine_check)(unsigned long vector, unsigned long la);
  72. void (*smp_callin)(void);
  73. void (*init_arch)(void);
  74. void (*init_irq)(void);
  75. void (*init_rtc)(void);
  76. void (*init_pci)(void);
  77. void (*kill_arch)(int);
  78. u8 (*pci_swizzle)(struct pci_dev *, u8 *);
  79. int (*pci_map_irq)(const struct pci_dev *, u8, u8);
  80. struct pci_ops *pci_ops;
  81. struct _alpha_agp_info *(*agp_info)(void);
  82. const char *vector_name;
  83. /* System specific parameters. */
  84. union {
  85. struct {
  86. unsigned long gru_int_req_bits;
  87. } cia;
  88. struct {
  89. unsigned long gamma_bias;
  90. } t2;
  91. struct {
  92. unsigned int route_tab;
  93. } sio;
  94. } sys;
  95. };
  96. extern struct alpha_machine_vector alpha_mv;
  97. #ifdef CONFIG_ALPHA_GENERIC
  98. extern int alpha_using_srm;
  99. extern int alpha_using_qemu;
  100. #else
  101. # ifdef CONFIG_ALPHA_SRM
  102. # define alpha_using_srm 1
  103. # else
  104. # define alpha_using_srm 0
  105. # endif
  106. # ifdef CONFIG_ALPHA_QEMU
  107. # define alpha_using_qemu 1
  108. # else
  109. # define alpha_using_qemu 0
  110. # endif
  111. #endif /* GENERIC */
  112. #endif /* __KERNEL__ */
  113. #endif /* __ALPHA_MACHVEC_H */