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