xref: /openbmc/linux/arch/alpha/include/asm/machvec.h (revision 994dcf7055df88623d25f3593b931a018a76b502)
1024b246eSLinus Torvalds #ifndef __ALPHA_MACHVEC_H
2024b246eSLinus Torvalds #define __ALPHA_MACHVEC_H 1
3024b246eSLinus Torvalds 
4024b246eSLinus Torvalds #include <linux/types.h>
5024b246eSLinus Torvalds 
6024b246eSLinus Torvalds /*
7024b246eSLinus Torvalds  *	This file gets pulled in by asm/io.h from user space. We don't
8024b246eSLinus Torvalds  *	want most of this escaping.
9024b246eSLinus Torvalds  */
10024b246eSLinus Torvalds 
11024b246eSLinus Torvalds #ifdef __KERNEL__
12024b246eSLinus Torvalds 
13024b246eSLinus Torvalds /* The following structure vectors all of the I/O and IRQ manipulation
14024b246eSLinus Torvalds    from the generic kernel to the hardware specific backend.  */
15024b246eSLinus Torvalds 
16024b246eSLinus Torvalds struct task_struct;
17024b246eSLinus Torvalds struct mm_struct;
18024b246eSLinus Torvalds struct vm_area_struct;
19024b246eSLinus Torvalds struct linux_hose_info;
20024b246eSLinus Torvalds struct pci_dev;
21024b246eSLinus Torvalds struct pci_ops;
22024b246eSLinus Torvalds struct pci_controller;
23024b246eSLinus Torvalds struct _alpha_agp_info;
245f7dc5d7SIvan Kokshaysky struct rtc_time;
25024b246eSLinus Torvalds 
26024b246eSLinus Torvalds struct alpha_machine_vector
27024b246eSLinus Torvalds {
28024b246eSLinus Torvalds 	/* This "belongs" down below with the rest of the runtime
29024b246eSLinus Torvalds 	   variables, but it is convenient for entry.S if these
30024b246eSLinus Torvalds 	   two slots are at the beginning of the struct.  */
31024b246eSLinus Torvalds 	unsigned long hae_cache;
32024b246eSLinus Torvalds 	unsigned long *hae_register;
33024b246eSLinus Torvalds 
34024b246eSLinus Torvalds 	int nr_irqs;
35024b246eSLinus Torvalds 	int rtc_port;
36024b246eSLinus Torvalds 	unsigned int max_asn;
37024b246eSLinus Torvalds 	unsigned long max_isa_dma_address;
38024b246eSLinus Torvalds 	unsigned long irq_probe_mask;
39024b246eSLinus Torvalds 	unsigned long iack_sc;
40024b246eSLinus Torvalds 	unsigned long min_io_address;
41024b246eSLinus Torvalds 	unsigned long min_mem_address;
42024b246eSLinus Torvalds 	unsigned long pci_dac_offset;
43024b246eSLinus Torvalds 
44024b246eSLinus Torvalds 	void (*mv_pci_tbi)(struct pci_controller *hose,
45024b246eSLinus Torvalds 			   dma_addr_t start, dma_addr_t end);
46024b246eSLinus Torvalds 
47024b246eSLinus Torvalds 	unsigned int (*mv_ioread8)(void __iomem *);
48024b246eSLinus Torvalds 	unsigned int (*mv_ioread16)(void __iomem *);
49024b246eSLinus Torvalds 	unsigned int (*mv_ioread32)(void __iomem *);
50024b246eSLinus Torvalds 
51024b246eSLinus Torvalds 	void (*mv_iowrite8)(u8, void __iomem *);
52024b246eSLinus Torvalds 	void (*mv_iowrite16)(u16, void __iomem *);
53024b246eSLinus Torvalds 	void (*mv_iowrite32)(u32, void __iomem *);
54024b246eSLinus Torvalds 
55024b246eSLinus Torvalds 	u8 (*mv_readb)(const volatile void __iomem *);
56024b246eSLinus Torvalds 	u16 (*mv_readw)(const volatile void __iomem *);
57024b246eSLinus Torvalds 	u32 (*mv_readl)(const volatile void __iomem *);
58024b246eSLinus Torvalds 	u64 (*mv_readq)(const volatile void __iomem *);
59024b246eSLinus Torvalds 
60024b246eSLinus Torvalds 	void (*mv_writeb)(u8, volatile void __iomem *);
61024b246eSLinus Torvalds 	void (*mv_writew)(u16, volatile void __iomem *);
62024b246eSLinus Torvalds 	void (*mv_writel)(u32, volatile void __iomem *);
63024b246eSLinus Torvalds 	void (*mv_writeq)(u64, volatile void __iomem *);
64024b246eSLinus Torvalds 
65024b246eSLinus Torvalds 	void __iomem *(*mv_ioportmap)(unsigned long);
66024b246eSLinus Torvalds 	void __iomem *(*mv_ioremap)(unsigned long, unsigned long);
67024b246eSLinus Torvalds 	void (*mv_iounmap)(volatile void __iomem *);
68024b246eSLinus Torvalds 	int (*mv_is_ioaddr)(unsigned long);
69024b246eSLinus Torvalds 	int (*mv_is_mmio)(const volatile void __iomem *);
70024b246eSLinus Torvalds 
71024b246eSLinus Torvalds 	void (*mv_switch_mm)(struct mm_struct *, struct mm_struct *,
72024b246eSLinus Torvalds 			     struct task_struct *);
73024b246eSLinus Torvalds 	void (*mv_activate_mm)(struct mm_struct *, struct mm_struct *);
74024b246eSLinus Torvalds 
75024b246eSLinus Torvalds 	void (*mv_flush_tlb_current)(struct mm_struct *);
76024b246eSLinus Torvalds 	void (*mv_flush_tlb_current_page)(struct mm_struct * mm,
77024b246eSLinus Torvalds 					  struct vm_area_struct *vma,
78024b246eSLinus Torvalds 					  unsigned long addr);
79024b246eSLinus Torvalds 
80024b246eSLinus Torvalds 	void (*update_irq_hw)(unsigned long, unsigned long, int);
81024b246eSLinus Torvalds 	void (*ack_irq)(unsigned long);
82024b246eSLinus Torvalds 	void (*device_interrupt)(unsigned long vector);
835f0e3da6SRandy Dunlap 	void (*machine_check)(unsigned long vector, unsigned long la);
84024b246eSLinus Torvalds 
85024b246eSLinus Torvalds 	void (*smp_callin)(void);
86024b246eSLinus Torvalds 	void (*init_arch)(void);
87024b246eSLinus Torvalds 	void (*init_irq)(void);
88024b246eSLinus Torvalds 	void (*init_rtc)(void);
89024b246eSLinus Torvalds 	void (*init_pci)(void);
90024b246eSLinus Torvalds 	void (*kill_arch)(int);
91024b246eSLinus Torvalds 
92024b246eSLinus Torvalds 	u8 (*pci_swizzle)(struct pci_dev *, u8 *);
93bf362f75SAl Viro 	int (*pci_map_irq)(const struct pci_dev *, u8, u8);
94024b246eSLinus Torvalds 	struct pci_ops *pci_ops;
95024b246eSLinus Torvalds 
96024b246eSLinus Torvalds 	struct _alpha_agp_info *(*agp_info)(void);
97024b246eSLinus Torvalds 
985f7dc5d7SIvan Kokshaysky 	unsigned int (*rtc_get_time)(struct rtc_time *);
995f7dc5d7SIvan Kokshaysky 	int (*rtc_set_time)(struct rtc_time *);
1005f7dc5d7SIvan Kokshaysky 
101024b246eSLinus Torvalds 	const char *vector_name;
102024b246eSLinus Torvalds 
103024b246eSLinus Torvalds 	/* NUMA information */
104024b246eSLinus Torvalds 	int (*pa_to_nid)(unsigned long);
105024b246eSLinus Torvalds 	int (*cpuid_to_nid)(int);
106024b246eSLinus Torvalds 	unsigned long (*node_mem_start)(int);
107024b246eSLinus Torvalds 	unsigned long (*node_mem_size)(int);
108024b246eSLinus Torvalds 
109024b246eSLinus Torvalds 	/* System specific parameters.  */
110024b246eSLinus Torvalds 	union {
111024b246eSLinus Torvalds 	    struct {
112024b246eSLinus Torvalds 		unsigned long gru_int_req_bits;
113024b246eSLinus Torvalds 	    } cia;
114024b246eSLinus Torvalds 
115024b246eSLinus Torvalds 	    struct {
116024b246eSLinus Torvalds 		unsigned long gamma_bias;
117024b246eSLinus Torvalds 	    } t2;
118024b246eSLinus Torvalds 
119024b246eSLinus Torvalds 	    struct {
120024b246eSLinus Torvalds 		unsigned int route_tab;
121024b246eSLinus Torvalds 	    } sio;
122024b246eSLinus Torvalds 	} sys;
123024b246eSLinus Torvalds };
124024b246eSLinus Torvalds 
125024b246eSLinus Torvalds extern struct alpha_machine_vector alpha_mv;
126024b246eSLinus Torvalds 
127024b246eSLinus Torvalds #ifdef CONFIG_ALPHA_GENERIC
128024b246eSLinus Torvalds extern int alpha_using_srm;
129*994dcf70SRichard Henderson extern int alpha_using_qemu;
130024b246eSLinus Torvalds #else
131024b246eSLinus Torvalds # ifdef CONFIG_ALPHA_SRM
132024b246eSLinus Torvalds #  define alpha_using_srm 1
133024b246eSLinus Torvalds # else
134024b246eSLinus Torvalds #  define alpha_using_srm 0
135024b246eSLinus Torvalds # endif
136*994dcf70SRichard Henderson # ifdef CONFIG_ALPHA_QEMU
137*994dcf70SRichard Henderson #  define alpha_using_qemu 1
138*994dcf70SRichard Henderson # else
139*994dcf70SRichard Henderson #  define alpha_using_qemu 0
140*994dcf70SRichard Henderson # endif
141024b246eSLinus Torvalds #endif /* GENERIC */
142024b246eSLinus Torvalds 
143*994dcf70SRichard Henderson #endif /* __KERNEL__ */
144024b246eSLinus Torvalds #endif /* __ALPHA_MACHVEC_H */
145