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