This source file includes following definitions.
- find_end_memory
- setup_arch
- sys_ioperm
- get_cpuinfo
1
2
3
4
5
6
7
8
9
10
11 #include <linux/errno.h>
12 #include <linux/sched.h>
13 #include <linux/kernel.h>
14 #include <linux/mm.h>
15 #include <linux/stddef.h>
16 #include <linux/unistd.h>
17 #include <linux/ptrace.h>
18 #include <linux/malloc.h>
19 #include <linux/ldt.h>
20 #include <linux/user.h>
21 #include <linux/a.out.h>
22 #include <linux/tty.h>
23 #include <linux/delay.h>
24 #include <linux/config.h>
25
26 #include <asm/segment.h>
27 #include <asm/system.h>
28 #include <asm/hwrpb.h>
29 #include <asm/dma.h>
30 #include <asm/io.h>
31
32 struct hae hae = {
33 0,
34 (unsigned long*) HAE_ADDRESS
35 };
36
37 struct hwrpb_struct *hwrpb;
38
39 unsigned char aux_device_present = 0xaa;
40
41
42
43
44
45
46
47 #define PARAM ZERO_PGE
48 #define COMMAND_LINE ((char*)(PARAM + 0x0000))
49 #define COMMAND_LINE_SIZE 256
50
51 static char command_line[COMMAND_LINE_SIZE] = { 0, };
52
53
54
55
56
57
58 struct screen_info screen_info = {
59 0, 25,
60 { 0, 0 },
61 0,
62 0,
63 80,
64 0,0,0,
65 25,
66 1,
67 16
68 };
69
70 static unsigned long find_end_memory(void)
71 {
72 int i;
73 unsigned long high = 0;
74 struct memclust_struct * cluster;
75 struct memdesc_struct * memdesc;
76
77 memdesc = (struct memdesc_struct *)
78 (INIT_HWRPB->mddt_offset + (unsigned long) INIT_HWRPB);
79 cluster = memdesc->cluster;
80 for (i = memdesc->numclusters ; i > 0; i--, cluster++) {
81 unsigned long tmp;
82 tmp = (cluster->start_pfn + cluster->numpages) << PAGE_SHIFT;
83 if (tmp > high)
84 high = tmp;
85 }
86
87 high = (high + PAGE_SIZE) & (PAGE_MASK*2);
88 return PAGE_OFFSET + high;
89 }
90
91 void setup_arch(char **cmdline_p,
92 unsigned long * memory_start_p, unsigned long * memory_end_p)
93 {
94 extern int _end;
95
96 hwrpb = (struct hwrpb_struct*)(IDENT_ADDR + INIT_HWRPB->phys_addr);
97
98 set_hae(hae.cache);
99 wrmces(0x7);
100
101 ROOT_DEV = to_kdev_t(0x0802);
102 command_line[COMMAND_LINE_SIZE - 1] = '\0';
103 strcpy(command_line, COMMAND_LINE);
104
105 *cmdline_p = command_line;
106 *memory_start_p = (unsigned long) &_end;
107 *memory_end_p = find_end_memory();
108
109 #if defined(CONFIG_ALPHA_LCA)
110 *memory_start_p = lca_init(*memory_start_p, *memory_end_p);
111 #elif defined(CONFIG_ALPHA_APECS)
112 *memory_start_p = apecs_init(*memory_start_p, *memory_end_p);
113 #endif
114 }
115
116 asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on)
117 {
118 return -EIO;
119 }
120
121
122
123
124
125 int get_cpuinfo(char *buffer)
126 {
127 const char *cpu_name[] = {
128 "EV3", "EV4", "Unknown 1", "LCA4", "EV5", "EV45"
129 };
130 # define SYSTYPE_NAME_BIAS 20
131 const char *systype_name[] = {
132 "Cabriolet", "EB66P", "-18", "-17", "-16", "-15",
133 "-14", "-13", "-12", "-11", "-10", "-9", "-8",
134 "-7", "-6", "-5", "-4", "-3", "-2", "-1", "0",
135 "ADU", "Cobra", "Ruby", "Flamingo", "5", "Jensen",
136 "Pelican", "8", "Sable", "AXPvme", "Noname",
137 "Turbolaser", "Avanti", "Mustang", "Alcor", "16",
138 "Mikasa", "18", "EB66", "EB64+"
139 };
140 struct percpu_struct *cpu;
141 unsigned int cpu_index;
142 long sysname_index;
143 extern struct unaligned_stat {
144 unsigned long count, va, pc;
145 } unaligned[2];
146 # define N(a) (sizeof(a)/sizeof(a[0]))
147
148 cpu = (struct percpu_struct*)((char*)hwrpb + hwrpb->processor_offset);
149 cpu_index = (unsigned) (cpu->type - 1);
150 sysname_index = hwrpb->sys_type + SYSTYPE_NAME_BIAS;
151
152 return sprintf(buffer,
153 "cpu\t\t\t: Alpha\n"
154 "cpu model\t\t: %s\n"
155 "cpu variation\t\t: %ld\n"
156 "cpu revision\t\t: %ld\n"
157 "cpu serial number\t: %s\n"
158 "system type\t\t: %s\n"
159 "system variation\t: %ld\n"
160 "system revision\t\t: %ld\n"
161 "system serial number\t: %s\n"
162 "cycle frequency [Hz]\t: %lu\n"
163 "timer frequency [Hz]\t: %lu.%02lu\n"
164 "page size [bytes]\t: %ld\n"
165 "phys. address bits\t: %ld\n"
166 "max. addr. space #\t: %ld\n"
167 "BogoMIPS\t\t: %lu.%02lu\n"
168 "kernel unaligned acc\t: %ld (pc=%lx,va=%lx)\n"
169 "user unaligned acc\t: %ld (pc=%lx,va=%lx)\n",
170
171 (cpu_index < N(cpu_name)
172 ? cpu_name[cpu_index] : "Unknown"),
173 cpu->variation, cpu->revision, (char*)cpu->serial_no,
174 (sysname_index < N(systype_name)
175 ? systype_name[sysname_index] : "Unknown"),
176 hwrpb->sys_variation, hwrpb->sys_revision,
177 (char*)hwrpb->ssn,
178 hwrpb->cycle_freq,
179 hwrpb->intr_freq / 4096,
180 (100 * hwrpb->intr_freq / 4096) % 100,
181 hwrpb->pagesize,
182 hwrpb->pa_bits,
183 hwrpb->max_asn,
184 loops_per_sec / 500000, (loops_per_sec / 5000) % 100,
185 unaligned[0].count, unaligned[0].pc, unaligned[0].va,
186 unaligned[1].count, unaligned[1].pc, unaligned[1].va);
187 # undef N
188 }