Print this page
cpuid for ARMv7
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/armv7/os/startup.c
+++ new/usr/src/uts/armv7/os/startup.c
1 1 /*
2 2 * This file and its contents are supplied under the terms of the
3 3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 4 * You may only use this file in accordance with the terms of version
5 5 * 1.0 of the CDDL.
6 6 *
7 7 * A full copy of the text of the CDDL should have accompanied this
8 8 * source. A copy of the CDDL is also available via the Internet at
9 9 * http://www.illumos.org/license/CDDL.
10 10 */
11 11
12 12 /*
13 13 * Copyright (c) 2014 Joyent, Inc. All rights reserved.
14 14 */
15 15
16 16 #include <sys/types.h>
17 17 #include <sys/bootconf.h>
18 18 #include <sys/obpdefs.h>
19 19 #include <sys/promif.h>
20 20
21 21 /*
22 22 * 32-bit Kernel's Virtual memory layout.
23 23 * +-----------------------+
24 24 * | exception table |
25 25 * 0xFFFF0000 -|-----------------------|- EXCEPTION_ADDRESS
26 26 * | |
27 27 * 0xFFC00000 -|-----------------------|- ARGSBASE
28 28 * | XXX debugger? |
29 29 * 0xFF800000 -|-----------------------|- XXX SEGDEBUBBASE?+
30 30 * | Kernel Data |
31 31 * 0xFEC00000 -|-----------------------|
32 32 * | Kernel Text |
33 33 * 0xFE800000 -|-----------------------|- KERNEL_TEXT
34 34 * | |
35 35 * | XXX No idea yet |
36 36 * | |
37 37 * 0xC8002000 -|-----------------------|- XXX segmap_start?
38 38 * | Red Zone |
39 39 * 0xC8000000 -|-----------------------|- kernelbase / userlimit (floating)
40 40 * | User Stack |
41 41 * | |
42 42 * | |
43 43 *
44 44 * : :
45 45 * | shared objects |
46 46 * : :
47 47 *
48 48 * : :
49 49 * | user data |
50 50 * -|-----------------------|-
51 51 * | user text |
52 52 * 0x00002000 -|-----------------------|- XXX Not necessairily truetoday
53 53 * | invalid |
54 54 * 0x00000000 -|-----------------------|-
55 55 *
56 56 * + Item does not exist at this time.
57 57 */
58 58
59 59 struct bootops *bootops = 0; /* passed in from boot */
60 60 struct bootops **bootopsp;
61 61 struct boot_syscalls *sysp; /* passed in from boot */
62 62
63 63 char kern_bootargs[OBP_MAXPATHLEN];
64 64 char kern_bootfile[OBP_MAXPATHLEN];
65 65
66 66 caddr_t s_text; /* start of kernel text segment */
67 67 caddr_t e_text; /* end of kernel text segment */
68 68 caddr_t s_data; /* start of kernel data segment */
69 69 caddr_t e_data; /* end of kernel data segment */
70 70 caddr_t modtext; /* start of loadable module text reserved */
71 71 caddr_t e_modtext; /* end of loadable module text reserved */
72 72 caddr_t moddata; /* start of loadable module data reserved */
73 73 caddr_t e_moddata; /* end of loadable module data reserved */
74 74
75 75 /*
76 76 * Some CPUs have holes in the middle of the 64-bit virtual address range.
77 77 */
78 78 uintptr_t hole_start, hole_end;
79 79
80 80 /*
81 81 * PROM debugging facilities
82 82 */
83 83 int prom_debug = 1;
84 84
85 85 /*
86 86 * VM related data
↓ open down ↓ |
86 lines elided |
↑ open up ↑ |
87 87 */
88 88 long page_hashsz; /* Size of page hash table (power of two) */
89 89 unsigned int page_hashsz_shift; /* log2(page_hashsz) */
90 90 struct page *pp_base; /* Base of initial system page struct array */
91 91 struct page **page_hash; /* Page hash table */
92 92 pad_mutex_t *pse_mutex; /* Locks protecting pp->p_selock */
93 93 size_t pse_table_size; /* Number of mutexes in pse_mutex[] */
94 94 int pse_shift; /* log2(pse_table_size) */
95 95
96 96 /*
97 - * Cache size information filled in via cpuid and startup_cache()
97 + * Cache size information filled in via cpuid.
98 98 */
99 -int armv6_cachesz; /* Total size of the l1 cache */
100 -int armv6_cache_assoc; /* L1 cache associativity */
101 -int armv6_l2cache_linesz; /* Size of a line in the l2 cache */
102 -int armv6_l2cache_size; /* Total size of the l2 cache */
99 +int l2cache_sz;
100 +int l2cache_linesz ;
101 +int l2cache_assoc;
103 102
104 103 /*
105 104 * Do basic set up.
106 105 */
107 106 static void
108 107 startup_init()
109 108 {
110 109 if (BOP_GETPROPLEN(bootops, "prom_debug") >= 0) {
111 110 ++prom_debug;
112 111 prom_printf("prom_debug found in boot enviroment");
113 112 }
114 113 }
115 114
116 115 static void
117 116 startup_memlist()
118 117 {
119 118 bop_panic("startup_memlist");
120 119 }
121 120
122 121 static void
123 122 startup_kmem()
124 123 {
125 124 bop_panic("startup_kmem");
126 125 }
127 126
128 127 static void
129 128 startup_vm()
130 129 {
131 130 bop_panic("startup_vm");
132 131 }
133 132
134 133 static void
135 134 startup_modules()
136 135 {
137 136 bop_panic("startup_modules");
138 137 }
139 138
140 139 static void
141 140 startup_end()
142 141 {
143 142 bop_panic("startup_end");
144 143 }
145 144
146 145 /*
147 146 * Our kernel text is at 0xfe800000, data at 0xfec000000, and exception vector
148 147 * at 0xffff0000. These addresses are all determined and set in stone at link
149 148 * time.
150 149 *
151 150 * This is the ARM machine-dependent startup code. Let's startup the world!
152 151 */
153 152 void
154 153 startup(void)
155 154 {
156 155 startup_init();
157 156 /* TODO if we ever need a board specific startup, it goes here */
158 157 startup_memlist();
159 158 startup_kmem();
160 159 startup_vm();
161 160 startup_modules();
162 161 startup_end();
163 162 }
↓ open down ↓ |
51 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX