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
25 #include <asm/segment.h>
26 #include <asm/system.h>
27 #include <asm/hwrpb.h>
28 #include <asm/dma.h>
29 #include <asm/io.h>
30
31 struct hae hae = {
32 0,
33 (unsigned long*) HAE_ADDRESS
34 };
35
36 struct hwrpb_struct *hwrpb;
37
38 unsigned char aux_device_present;
39
40
41
42
43
44
45
46 #define PARAM ZERO_PGE
47 #define COMMAND_LINE ((char*)(PARAM + 0x0000))
48 #define COMMAND_LINE_SIZE 256
49
50 static char command_line[COMMAND_LINE_SIZE] = { 0, };
51
52
53
54
55
56
57 struct screen_info screen_info = {
58 0, 0,
59 { 0, 0 },
60 0,
61 0,
62 80,
63 0,0,0,
64 25
65 };
66
67 static unsigned long find_end_memory(void)
68 {
69 int i;
70 unsigned long high = 0;
71 struct memclust_struct * cluster;
72 struct memdesc_struct * memdesc;
73
74 memdesc = (struct memdesc_struct *) (INIT_HWRPB->mddt_offset + (unsigned long) INIT_HWRPB);
75 cluster = memdesc->cluster;
76 for (i = memdesc->numclusters ; i > 0; i--, cluster++) {
77 unsigned long tmp;
78 tmp = (cluster->start_pfn + cluster->numpages) << PAGE_SHIFT;
79 if (tmp > high)
80 high = tmp;
81 }
82
83 high = (high + PAGE_SIZE) & (PAGE_MASK*2);
84 return PAGE_OFFSET + high;
85 }
86
87 void setup_arch(char **cmdline_p,
88 unsigned long * memory_start_p, unsigned long * memory_end_p)
89 {
90 extern int _end;
91
92 hwrpb = (struct hwrpb_struct*)(IDENT_ADDR + INIT_HWRPB->phys_addr);
93
94 set_hae(hae.cache);
95
96 ROOT_DEV = 0x0802;
97 #ifndef CONFIG_PCI
98 aux_device_present = 0xaa;
99 #else
100 aux_device_present = 0x00;
101 #endif
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 #ifdef CONFIG_PCI
110 *memory_start_p = lca_init(*memory_start_p, *memory_end_p);
111 #endif
112 }
113
114 asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on)
115 {
116 return -EIO;
117 }
118
119
120
121
122
123 int get_cpuinfo(char *buffer)
124 {
125 const char *cpu_name[] = {
126 "EV3", "EV4", "Unknown 1", "LCA4", "EV5", "EV45"
127 };
128 const char *systype_name[] = {
129 "ADU", "Cobra", "Ruby", "Flamingo", "Unknown 1", "Jensen",
130 "Pelican", "Unknown 2", "Sable", "AXPvme", "Noname",
131 "Turbolaser", "Avanti", "Mustang", "Alcor", "Unknown 3",
132 "Mikasa", "Unknown3", "EB66", "EB64+"
133 };
134 struct percpu_struct *cpu;
135 unsigned int cpu_index, system_index;
136 # define N(a) (sizeof(a)/sizeof(a[0]))
137
138 cpu = (struct percpu_struct*)((char*)hwrpb + hwrpb->processor_offset);
139 cpu_index = (unsigned) (cpu->type - 1);
140 system_index = (unsigned) (hwrpb->sys_type - 1);
141
142 return sprintf(buffer,
143 "cpu\t\t\t: Alpha\n"
144 "cpu model\t\t: %s\n"
145 "cpu variation\t\t: %ld\n"
146 "cpu revision\t\t: %ld\n"
147 "cpu serial number\t: %s\n"
148 "system type\t\t: %s\n"
149 "system variation\t: %ld\n"
150 "system revision\t\t: %ld\n"
151 "system serial number\t: %s\n"
152 "cycle frequency [Hz]\t: %lu\n"
153 "timer frequency [Hz]\t: %lu.%02lu\n"
154 "page size [bytes]\t: %ld\n"
155 "phys. address bits\t: %ld\n"
156 "max. addr. space #\t: %ld\n"
157 "BogoMIPS\t\t: %lu.%02lu\n",
158
159 (cpu_index < N(cpu_name) ? cpu_name[cpu_index] : "Unknown"),
160 cpu->variation, cpu->revision, (char*)cpu->serial_no,
161 (system_index < N(systype_name) ? systype_name[system_index] : "Unknown"),
162 hwrpb->sys_variation, hwrpb->sys_revision,
163 (char*)hwrpb->ssn,
164 hwrpb->cycle_freq,
165 hwrpb->intr_freq / 4096,
166 (100 * hwrpb->intr_freq / 4096) % 100,
167 hwrpb->pagesize,
168 hwrpb->pa_bits,
169 hwrpb->max_asn,
170 loops_per_sec / 500000, (loops_per_sec / 5000) % 100);
171 # undef N
172 }