File: machvec.h

package info (click to toggle)
kernel-source-sparc-2.2.1 2.2.1
  • links: PTS
  • area: main
  • in suites: slink
  • size: 62,800 kB
  • ctags: 188,320
  • sloc: ansic: 1,114,164; asm: 49,922; makefile: 8,272; sh: 1,831; perl: 1,584; tcl: 409; lisp: 218; cpp: 186; awk: 133; sed: 72
file content (132 lines) | stat: -rw-r--r-- 3,641 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#ifndef __ALPHA_MACHVEC_H
#define __ALPHA_MACHVEC_H 1

#include <linux/config.h>
#include <linux/types.h>

/*
 *	This file gets pulled in by asm/io.h from user space. We don't
 *	want most of this escaping.
 */
 
#ifdef __KERNEL__

/* The following structure vectors all of the I/O and IRQ manipulation
   from the generic kernel to the hardware specific backend.  */

struct task_struct;
struct mm_struct;
struct pt_regs;
struct vm_area_struct;
struct linux_hose_info;

struct alpha_machine_vector
{
	/* This "belongs" down below with the rest of the runtime
	   variables, but it is convenient for entry.S if these 
	   two slots are at the beginning of the struct.  */
	unsigned long hae_cache;
	unsigned long *hae_register;

	int nr_irqs;
	int rtc_port;
	int max_asn;
	unsigned long max_dma_address;
	unsigned long mmu_context_mask;
	unsigned long irq_probe_mask;
	unsigned long iack_sc;

	unsigned long (*mv_virt_to_bus)(void *);
	void * (*mv_bus_to_virt)(unsigned long);

	unsigned int (*mv_inb)(unsigned long);
	unsigned int (*mv_inw)(unsigned long);
	unsigned int (*mv_inl)(unsigned long);

	void (*mv_outb)(unsigned char, unsigned long);
	void (*mv_outw)(unsigned short, unsigned long);
	void (*mv_outl)(unsigned int, unsigned long);
	
	unsigned long (*mv_readb)(unsigned long);
	unsigned long (*mv_readw)(unsigned long);
	unsigned long (*mv_readl)(unsigned long);
	unsigned long (*mv_readq)(unsigned long);

	void (*mv_writeb)(unsigned char, unsigned long);
	void (*mv_writew)(unsigned short, unsigned long);
	void (*mv_writel)(unsigned int, unsigned long);
	void (*mv_writeq)(unsigned long, unsigned long);

	unsigned long (*mv_dense_mem)(unsigned long);

	int (*hose_read_config_byte)(u8, u8, u8, u8 *value,
				     struct linux_hose_info *);
	int (*hose_read_config_word)(u8, u8, u8, u16 *value,
				     struct linux_hose_info *);
	int (*hose_read_config_dword)(u8, u8, u8, u32 *value,
				      struct linux_hose_info *);

	int (*hose_write_config_byte)(u8, u8, u8, u8 value,
				      struct linux_hose_info *);
	int (*hose_write_config_word)(u8, u8, u8, u16 value,
				      struct linux_hose_info *);
	int (*hose_write_config_dword)(u8, u8, u8, u32 value,
				       struct linux_hose_info *);
	
	void (*mv_get_mmu_context)(struct task_struct *);
	void (*mv_flush_tlb_current)(struct mm_struct *);
	void (*mv_flush_tlb_other)(struct mm_struct *);
	void (*mv_flush_tlb_current_page)(struct mm_struct * mm,
					  struct vm_area_struct *vma,
					  unsigned long addr);

	void (*update_irq_hw)(unsigned long, unsigned long, int);
	void (*ack_irq)(unsigned long);
	void (*device_interrupt)(unsigned long vector, struct pt_regs *regs);
	void (*machine_check)(u64 vector, u64 la, struct pt_regs *regs);

	void (*init_arch)(unsigned long *, unsigned long *);
	void (*init_irq)(void);
	void (*init_pit)(void);
	void (*pci_fixup)(void);
	void (*kill_arch)(int, char *);

	const char *vector_name;

	/* System specific parameters.  */
	union {
	    struct {
		unsigned long gru_int_req_bits;
	    } cia;

	    struct {
		unsigned long gamma_bias;
	    } t2;
	} sys;

	/* Runtime variables it is handy to keep close.  */
	unsigned long dma_win_base;
	unsigned long dma_win_size;
	unsigned long sm_base_r1, sm_base_r2, sm_base_r3;
};

extern struct alpha_machine_vector alpha_mv;

#ifdef CONFIG_ALPHA_GENERIC
extern int alpha_using_srm;
extern int alpha_use_srm_setup;
#else
#ifdef CONFIG_ALPHA_SRM
#define alpha_using_srm 1
#else
#define alpha_using_srm 0
#endif
#if defined(CONFIG_ALPHA_SRM_SETUP)
#define alpha_use_srm_setup 1
#else
#define alpha_use_srm_setup 0
#endif
#endif /* GENERIC */

#endif
#endif /* __ALPHA_MACHVEC_H */