Rev 1224 | Rev 1474 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1224 | Rev 1264 | ||
---|---|---|---|
1 | /* |
1 | /* |
2 | * Copyright (C) 2005 Jakub Jermar |
2 | * Copyright (C) 2005 Jakub Jermar |
3 | * All rights reserved. |
3 | * All rights reserved. |
4 | * |
4 | * |
5 | * Redistribution and use in source and binary forms, with or without |
5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions |
6 | * modification, are permitted provided that the following conditions |
7 | * are met: |
7 | * are met: |
8 | * |
8 | * |
9 | * - Redistributions of source code must retain the above copyright |
9 | * - Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. |
10 | * notice, this list of conditions and the following disclaimer. |
11 | * - Redistributions in binary form must reproduce the above copyright |
11 | * - Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the |
12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. |
13 | * documentation and/or other materials provided with the distribution. |
14 | * - The name of the author may not be used to endorse or promote products |
14 | * - The name of the author may not be used to endorse or promote products |
15 | * derived from this software without specific prior written permission. |
15 | * derived from this software without specific prior written permission. |
16 | * |
16 | * |
17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | */ |
27 | */ |
28 | 28 | ||
29 | /** |
29 | /** |
- | 30 | * @file cmd.c |
|
- | 31 | * @brief Kernel console command wrappers. |
|
- | 32 | * |
|
30 | * This file is meant to contain all wrapper functions for |
33 | * This file is meant to contain all wrapper functions for |
31 | * all kconsole commands. The point is in separating |
34 | * all kconsole commands. The point is in separating |
32 | * kconsole specific wrappers from kconsole-unaware functions |
35 | * kconsole specific wrappers from kconsole-unaware functions |
33 | * from other subsystems. |
36 | * from other subsystems. |
34 | */ |
37 | */ |
35 | 38 | ||
36 | #include <console/cmd.h> |
39 | #include <console/cmd.h> |
37 | #include <console/kconsole.h> |
40 | #include <console/kconsole.h> |
38 | #include <print.h> |
41 | #include <print.h> |
39 | #include <panic.h> |
42 | #include <panic.h> |
40 | #include <typedefs.h> |
43 | #include <typedefs.h> |
41 | #include <arch/types.h> |
44 | #include <arch/types.h> |
42 | #include <adt/list.h> |
45 | #include <adt/list.h> |
43 | #include <arch.h> |
46 | #include <arch.h> |
44 | #include <func.h> |
47 | #include <func.h> |
45 | #include <macros.h> |
48 | #include <macros.h> |
46 | #include <debug.h> |
49 | #include <debug.h> |
47 | #include <symtab.h> |
50 | #include <symtab.h> |
48 | #include <cpu.h> |
51 | #include <cpu.h> |
49 | #include <mm/tlb.h> |
52 | #include <mm/tlb.h> |
50 | #include <arch/mm/tlb.h> |
53 | #include <arch/mm/tlb.h> |
51 | #include <mm/frame.h> |
54 | #include <mm/frame.h> |
52 | #include <main/version.h> |
55 | #include <main/version.h> |
53 | #include <mm/slab.h> |
56 | #include <mm/slab.h> |
54 | #include <proc/scheduler.h> |
57 | #include <proc/scheduler.h> |
55 | #include <proc/thread.h> |
58 | #include <proc/thread.h> |
56 | #include <proc/task.h> |
59 | #include <proc/task.h> |
57 | 60 | ||
58 | /** Data and methods for 'help' command. */ |
61 | /** Data and methods for 'help' command. */ |
59 | static int cmd_help(cmd_arg_t *argv); |
62 | static int cmd_help(cmd_arg_t *argv); |
60 | static cmd_info_t help_info = { |
63 | static cmd_info_t help_info = { |
61 | .name = "help", |
64 | .name = "help", |
62 | .description = "List of supported commands.", |
65 | .description = "List of supported commands.", |
63 | .func = cmd_help, |
66 | .func = cmd_help, |
64 | .argc = 0 |
67 | .argc = 0 |
65 | }; |
68 | }; |
66 | 69 | ||
67 | static cmd_info_t exit_info = { |
70 | static cmd_info_t exit_info = { |
68 | .name = "exit", |
71 | .name = "exit", |
69 | .description ="Exit kconsole", |
72 | .description ="Exit kconsole", |
70 | .argc = 0 |
73 | .argc = 0 |
71 | }; |
74 | }; |
72 | 75 | ||
73 | /** Data and methods for 'description' command. */ |
76 | /** Data and methods for 'description' command. */ |
74 | static int cmd_desc(cmd_arg_t *argv); |
77 | static int cmd_desc(cmd_arg_t *argv); |
75 | static void desc_help(void); |
78 | static void desc_help(void); |
76 | static char desc_buf[MAX_CMDLINE+1]; |
79 | static char desc_buf[MAX_CMDLINE+1]; |
77 | static cmd_arg_t desc_argv = { |
80 | static cmd_arg_t desc_argv = { |
78 | .type = ARG_TYPE_STRING, |
81 | .type = ARG_TYPE_STRING, |
79 | .buffer = desc_buf, |
82 | .buffer = desc_buf, |
80 | .len = sizeof(desc_buf) |
83 | .len = sizeof(desc_buf) |
81 | }; |
84 | }; |
82 | static cmd_info_t desc_info = { |
85 | static cmd_info_t desc_info = { |
83 | .name = "describe", |
86 | .name = "describe", |
84 | .description = "Describe specified command.", |
87 | .description = "Describe specified command.", |
85 | .help = desc_help, |
88 | .help = desc_help, |
86 | .func = cmd_desc, |
89 | .func = cmd_desc, |
87 | .argc = 1, |
90 | .argc = 1, |
88 | .argv = &desc_argv |
91 | .argv = &desc_argv |
89 | }; |
92 | }; |
90 | 93 | ||
91 | /** Data and methods for 'symaddr' command. */ |
94 | /** Data and methods for 'symaddr' command. */ |
92 | static int cmd_symaddr(cmd_arg_t *argv); |
95 | static int cmd_symaddr(cmd_arg_t *argv); |
93 | static char symaddr_buf[MAX_CMDLINE+1]; |
96 | static char symaddr_buf[MAX_CMDLINE+1]; |
94 | static cmd_arg_t symaddr_argv = { |
97 | static cmd_arg_t symaddr_argv = { |
95 | .type = ARG_TYPE_STRING, |
98 | .type = ARG_TYPE_STRING, |
96 | .buffer = symaddr_buf, |
99 | .buffer = symaddr_buf, |
97 | .len = sizeof(symaddr_buf) |
100 | .len = sizeof(symaddr_buf) |
98 | }; |
101 | }; |
99 | static cmd_info_t symaddr_info = { |
102 | static cmd_info_t symaddr_info = { |
100 | .name = "symaddr", |
103 | .name = "symaddr", |
101 | .description = "Return symbol address.", |
104 | .description = "Return symbol address.", |
102 | .func = cmd_symaddr, |
105 | .func = cmd_symaddr, |
103 | .argc = 1, |
106 | .argc = 1, |
104 | .argv = &symaddr_argv |
107 | .argv = &symaddr_argv |
105 | }; |
108 | }; |
106 | 109 | ||
107 | static char set_buf[MAX_CMDLINE+1]; |
110 | static char set_buf[MAX_CMDLINE+1]; |
108 | static int cmd_set4(cmd_arg_t *argv); |
111 | static int cmd_set4(cmd_arg_t *argv); |
109 | static cmd_arg_t set4_argv[] = { |
112 | static cmd_arg_t set4_argv[] = { |
110 | { |
113 | { |
111 | .type = ARG_TYPE_STRING, |
114 | .type = ARG_TYPE_STRING, |
112 | .buffer = set_buf, |
115 | .buffer = set_buf, |
113 | .len = sizeof(set_buf) |
116 | .len = sizeof(set_buf) |
114 | }, |
117 | }, |
115 | { |
118 | { |
116 | .type = ARG_TYPE_INT |
119 | .type = ARG_TYPE_INT |
117 | } |
120 | } |
118 | }; |
121 | }; |
119 | static cmd_info_t set4_info = { |
122 | static cmd_info_t set4_info = { |
120 | .name = "set4", |
123 | .name = "set4", |
121 | .description = "set <dest_addr> <value> - 4byte version", |
124 | .description = "set <dest_addr> <value> - 4byte version", |
122 | .func = cmd_set4, |
125 | .func = cmd_set4, |
123 | .argc = 2, |
126 | .argc = 2, |
124 | .argv = set4_argv |
127 | .argv = set4_argv |
125 | }; |
128 | }; |
126 | 129 | ||
127 | /** Data and methods for 'call0' command. */ |
130 | /** Data and methods for 'call0' command. */ |
128 | static char call0_buf[MAX_CMDLINE+1]; |
131 | static char call0_buf[MAX_CMDLINE+1]; |
129 | static char carg1_buf[MAX_CMDLINE+1]; |
132 | static char carg1_buf[MAX_CMDLINE+1]; |
130 | static char carg2_buf[MAX_CMDLINE+1]; |
133 | static char carg2_buf[MAX_CMDLINE+1]; |
131 | static char carg3_buf[MAX_CMDLINE+1]; |
134 | static char carg3_buf[MAX_CMDLINE+1]; |
132 | 135 | ||
133 | static int cmd_call0(cmd_arg_t *argv); |
136 | static int cmd_call0(cmd_arg_t *argv); |
134 | static cmd_arg_t call0_argv = { |
137 | static cmd_arg_t call0_argv = { |
135 | .type = ARG_TYPE_STRING, |
138 | .type = ARG_TYPE_STRING, |
136 | .buffer = call0_buf, |
139 | .buffer = call0_buf, |
137 | .len = sizeof(call0_buf) |
140 | .len = sizeof(call0_buf) |
138 | }; |
141 | }; |
139 | static cmd_info_t call0_info = { |
142 | static cmd_info_t call0_info = { |
140 | .name = "call0", |
143 | .name = "call0", |
141 | .description = "call0 <function> -> call function().", |
144 | .description = "call0 <function> -> call function().", |
142 | .func = cmd_call0, |
145 | .func = cmd_call0, |
143 | .argc = 1, |
146 | .argc = 1, |
144 | .argv = &call0_argv |
147 | .argv = &call0_argv |
145 | }; |
148 | }; |
146 | 149 | ||
147 | /** Data and methods for 'call1' command. */ |
150 | /** Data and methods for 'call1' command. */ |
148 | static int cmd_call1(cmd_arg_t *argv); |
151 | static int cmd_call1(cmd_arg_t *argv); |
149 | static cmd_arg_t call1_argv[] = { |
152 | static cmd_arg_t call1_argv[] = { |
150 | { |
153 | { |
151 | .type = ARG_TYPE_STRING, |
154 | .type = ARG_TYPE_STRING, |
152 | .buffer = call0_buf, |
155 | .buffer = call0_buf, |
153 | .len = sizeof(call0_buf) |
156 | .len = sizeof(call0_buf) |
154 | }, |
157 | }, |
155 | { |
158 | { |
156 | .type = ARG_TYPE_VAR, |
159 | .type = ARG_TYPE_VAR, |
157 | .buffer = carg1_buf, |
160 | .buffer = carg1_buf, |
158 | .len = sizeof(carg1_buf) |
161 | .len = sizeof(carg1_buf) |
159 | } |
162 | } |
160 | }; |
163 | }; |
161 | static cmd_info_t call1_info = { |
164 | static cmd_info_t call1_info = { |
162 | .name = "call1", |
165 | .name = "call1", |
163 | .description = "call1 <function> <arg1> -> call function(arg1).", |
166 | .description = "call1 <function> <arg1> -> call function(arg1).", |
164 | .func = cmd_call1, |
167 | .func = cmd_call1, |
165 | .argc = 2, |
168 | .argc = 2, |
166 | .argv = call1_argv |
169 | .argv = call1_argv |
167 | }; |
170 | }; |
168 | 171 | ||
169 | /** Data and methods for 'call2' command. */ |
172 | /** Data and methods for 'call2' command. */ |
170 | static int cmd_call2(cmd_arg_t *argv); |
173 | static int cmd_call2(cmd_arg_t *argv); |
171 | static cmd_arg_t call2_argv[] = { |
174 | static cmd_arg_t call2_argv[] = { |
172 | { |
175 | { |
173 | .type = ARG_TYPE_STRING, |
176 | .type = ARG_TYPE_STRING, |
174 | .buffer = call0_buf, |
177 | .buffer = call0_buf, |
175 | .len = sizeof(call0_buf) |
178 | .len = sizeof(call0_buf) |
176 | }, |
179 | }, |
177 | { |
180 | { |
178 | .type = ARG_TYPE_VAR, |
181 | .type = ARG_TYPE_VAR, |
179 | .buffer = carg1_buf, |
182 | .buffer = carg1_buf, |
180 | .len = sizeof(carg1_buf) |
183 | .len = sizeof(carg1_buf) |
181 | }, |
184 | }, |
182 | { |
185 | { |
183 | .type = ARG_TYPE_VAR, |
186 | .type = ARG_TYPE_VAR, |
184 | .buffer = carg2_buf, |
187 | .buffer = carg2_buf, |
185 | .len = sizeof(carg2_buf) |
188 | .len = sizeof(carg2_buf) |
186 | } |
189 | } |
187 | }; |
190 | }; |
188 | static cmd_info_t call2_info = { |
191 | static cmd_info_t call2_info = { |
189 | .name = "call2", |
192 | .name = "call2", |
190 | .description = "call2 <function> <arg1> <arg2> -> call function(arg1,arg2).", |
193 | .description = "call2 <function> <arg1> <arg2> -> call function(arg1,arg2).", |
191 | .func = cmd_call2, |
194 | .func = cmd_call2, |
192 | .argc = 3, |
195 | .argc = 3, |
193 | .argv = call2_argv |
196 | .argv = call2_argv |
194 | }; |
197 | }; |
195 | 198 | ||
196 | /** Data and methods for 'call3' command. */ |
199 | /** Data and methods for 'call3' command. */ |
197 | static int cmd_call3(cmd_arg_t *argv); |
200 | static int cmd_call3(cmd_arg_t *argv); |
198 | static cmd_arg_t call3_argv[] = { |
201 | static cmd_arg_t call3_argv[] = { |
199 | { |
202 | { |
200 | .type = ARG_TYPE_STRING, |
203 | .type = ARG_TYPE_STRING, |
201 | .buffer = call0_buf, |
204 | .buffer = call0_buf, |
202 | .len = sizeof(call0_buf) |
205 | .len = sizeof(call0_buf) |
203 | }, |
206 | }, |
204 | { |
207 | { |
205 | .type = ARG_TYPE_VAR, |
208 | .type = ARG_TYPE_VAR, |
206 | .buffer = carg1_buf, |
209 | .buffer = carg1_buf, |
207 | .len = sizeof(carg1_buf) |
210 | .len = sizeof(carg1_buf) |
208 | }, |
211 | }, |
209 | { |
212 | { |
210 | .type = ARG_TYPE_VAR, |
213 | .type = ARG_TYPE_VAR, |
211 | .buffer = carg2_buf, |
214 | .buffer = carg2_buf, |
212 | .len = sizeof(carg2_buf) |
215 | .len = sizeof(carg2_buf) |
213 | }, |
216 | }, |
214 | { |
217 | { |
215 | .type = ARG_TYPE_VAR, |
218 | .type = ARG_TYPE_VAR, |
216 | .buffer = carg3_buf, |
219 | .buffer = carg3_buf, |
217 | .len = sizeof(carg3_buf) |
220 | .len = sizeof(carg3_buf) |
218 | } |
221 | } |
219 | 222 | ||
220 | }; |
223 | }; |
221 | static cmd_info_t call3_info = { |
224 | static cmd_info_t call3_info = { |
222 | .name = "call3", |
225 | .name = "call3", |
223 | .description = "call3 <function> <arg1> <arg2> <arg3> -> call function(arg1,arg2,arg3).", |
226 | .description = "call3 <function> <arg1> <arg2> <arg3> -> call function(arg1,arg2,arg3).", |
224 | .func = cmd_call3, |
227 | .func = cmd_call3, |
225 | .argc = 4, |
228 | .argc = 4, |
226 | .argv = call3_argv |
229 | .argv = call3_argv |
227 | }; |
230 | }; |
228 | 231 | ||
229 | /** Data and methods for 'halt' command. */ |
232 | /** Data and methods for 'halt' command. */ |
230 | static int cmd_halt(cmd_arg_t *argv); |
233 | static int cmd_halt(cmd_arg_t *argv); |
231 | static cmd_info_t halt_info = { |
234 | static cmd_info_t halt_info = { |
232 | .name = "halt", |
235 | .name = "halt", |
233 | .description = "Halt the kernel.", |
236 | .description = "Halt the kernel.", |
234 | .func = cmd_halt, |
237 | .func = cmd_halt, |
235 | .argc = 0 |
238 | .argc = 0 |
236 | }; |
239 | }; |
237 | 240 | ||
238 | /** Data and methods for 'tlb' command. */ |
241 | /** Data and methods for 'tlb' command. */ |
239 | static int cmd_tlb(cmd_arg_t *argv); |
242 | static int cmd_tlb(cmd_arg_t *argv); |
240 | cmd_info_t tlb_info = { |
243 | cmd_info_t tlb_info = { |
241 | .name = "tlb", |
244 | .name = "tlb", |
242 | .description = "Print TLB of current processor.", |
245 | .description = "Print TLB of current processor.", |
243 | .help = NULL, |
246 | .help = NULL, |
244 | .func = cmd_tlb, |
247 | .func = cmd_tlb, |
245 | .argc = 0, |
248 | .argc = 0, |
246 | .argv = NULL |
249 | .argv = NULL |
247 | }; |
250 | }; |
248 | 251 | ||
249 | static int cmd_threads(cmd_arg_t *argv); |
252 | static int cmd_threads(cmd_arg_t *argv); |
250 | static cmd_info_t threads_info = { |
253 | static cmd_info_t threads_info = { |
251 | .name = "threads", |
254 | .name = "threads", |
252 | .description = "List all threads", |
255 | .description = "List all threads", |
253 | .func = cmd_threads, |
256 | .func = cmd_threads, |
254 | .argc = 0 |
257 | .argc = 0 |
255 | }; |
258 | }; |
256 | 259 | ||
257 | static int cmd_tasks(cmd_arg_t *argv); |
260 | static int cmd_tasks(cmd_arg_t *argv); |
258 | static cmd_info_t tasks_info = { |
261 | static cmd_info_t tasks_info = { |
259 | .name = "tasks", |
262 | .name = "tasks", |
260 | .description = "List all tasks", |
263 | .description = "List all tasks", |
261 | .func = cmd_tasks, |
264 | .func = cmd_tasks, |
262 | .argc = 0 |
265 | .argc = 0 |
263 | }; |
266 | }; |
264 | 267 | ||
265 | 268 | ||
266 | static int cmd_sched(cmd_arg_t *argv); |
269 | static int cmd_sched(cmd_arg_t *argv); |
267 | static cmd_info_t sched_info = { |
270 | static cmd_info_t sched_info = { |
268 | .name = "scheduler", |
271 | .name = "scheduler", |
269 | .description = "List all scheduler information", |
272 | .description = "List all scheduler information", |
270 | .func = cmd_sched, |
273 | .func = cmd_sched, |
271 | .argc = 0 |
274 | .argc = 0 |
272 | }; |
275 | }; |
273 | 276 | ||
274 | static int cmd_slabs(cmd_arg_t *argv); |
277 | static int cmd_slabs(cmd_arg_t *argv); |
275 | static cmd_info_t slabs_info = { |
278 | static cmd_info_t slabs_info = { |
276 | .name = "slabs", |
279 | .name = "slabs", |
277 | .description = "List SLAB caches.", |
280 | .description = "List SLAB caches.", |
278 | .func = cmd_slabs, |
281 | .func = cmd_slabs, |
279 | .argc = 0 |
282 | .argc = 0 |
280 | }; |
283 | }; |
281 | 284 | ||
282 | /** Data and methods for 'zones' command */ |
285 | /** Data and methods for 'zones' command */ |
283 | static int cmd_zones(cmd_arg_t *argv); |
286 | static int cmd_zones(cmd_arg_t *argv); |
284 | static cmd_info_t zones_info = { |
287 | static cmd_info_t zones_info = { |
285 | .name = "zones", |
288 | .name = "zones", |
286 | .description = "List of memory zones.", |
289 | .description = "List of memory zones.", |
287 | .func = cmd_zones, |
290 | .func = cmd_zones, |
288 | .argc = 0 |
291 | .argc = 0 |
289 | }; |
292 | }; |
290 | 293 | ||
291 | /** Data and methods for 'zone' command */ |
294 | /** Data and methods for 'zone' command */ |
292 | static int cmd_zone(cmd_arg_t *argv); |
295 | static int cmd_zone(cmd_arg_t *argv); |
293 | static cmd_arg_t zone_argv = { |
296 | static cmd_arg_t zone_argv = { |
294 | .type = ARG_TYPE_INT, |
297 | .type = ARG_TYPE_INT, |
295 | }; |
298 | }; |
296 | 299 | ||
297 | static cmd_info_t zone_info = { |
300 | static cmd_info_t zone_info = { |
298 | .name = "zone", |
301 | .name = "zone", |
299 | .description = "Show memory zone structure.", |
302 | .description = "Show memory zone structure.", |
300 | .func = cmd_zone, |
303 | .func = cmd_zone, |
301 | .argc = 1, |
304 | .argc = 1, |
302 | .argv = &zone_argv |
305 | .argv = &zone_argv |
303 | }; |
306 | }; |
304 | 307 | ||
305 | /** Data and methods for 'cpus' command. */ |
308 | /** Data and methods for 'cpus' command. */ |
306 | static int cmd_cpus(cmd_arg_t *argv); |
309 | static int cmd_cpus(cmd_arg_t *argv); |
307 | cmd_info_t cpus_info = { |
310 | cmd_info_t cpus_info = { |
308 | .name = "cpus", |
311 | .name = "cpus", |
309 | .description = "List all processors.", |
312 | .description = "List all processors.", |
310 | .help = NULL, |
313 | .help = NULL, |
311 | .func = cmd_cpus, |
314 | .func = cmd_cpus, |
312 | .argc = 0, |
315 | .argc = 0, |
313 | .argv = NULL |
316 | .argv = NULL |
314 | }; |
317 | }; |
315 | 318 | ||
316 | /** Data and methods for 'version' command. */ |
319 | /** Data and methods for 'version' command. */ |
317 | static int cmd_version(cmd_arg_t *argv); |
320 | static int cmd_version(cmd_arg_t *argv); |
318 | cmd_info_t version_info = { |
321 | cmd_info_t version_info = { |
319 | .name = "version", |
322 | .name = "version", |
320 | .description = "Print version information.", |
323 | .description = "Print version information.", |
321 | .help = NULL, |
324 | .help = NULL, |
322 | .func = cmd_version, |
325 | .func = cmd_version, |
323 | .argc = 0, |
326 | .argc = 0, |
324 | .argv = NULL |
327 | .argv = NULL |
325 | }; |
328 | }; |
326 | 329 | ||
327 | static cmd_info_t *basic_commands[] = { |
330 | static cmd_info_t *basic_commands[] = { |
328 | &call0_info, |
331 | &call0_info, |
329 | &call1_info, |
332 | &call1_info, |
330 | &call2_info, |
333 | &call2_info, |
331 | &call3_info, |
334 | &call3_info, |
332 | &cpus_info, |
335 | &cpus_info, |
333 | &desc_info, |
336 | &desc_info, |
334 | &exit_info, |
337 | &exit_info, |
335 | &halt_info, |
338 | &halt_info, |
336 | &help_info, |
339 | &help_info, |
337 | &set4_info, |
340 | &set4_info, |
338 | &slabs_info, |
341 | &slabs_info, |
339 | &symaddr_info, |
342 | &symaddr_info, |
340 | &sched_info, |
343 | &sched_info, |
341 | &threads_info, |
344 | &threads_info, |
342 | &tasks_info, |
345 | &tasks_info, |
343 | &tlb_info, |
346 | &tlb_info, |
344 | &version_info, |
347 | &version_info, |
345 | &zones_info, |
348 | &zones_info, |
346 | &zone_info, |
349 | &zone_info, |
347 | NULL |
350 | NULL |
348 | }; |
351 | }; |
349 | 352 | ||
350 | 353 | ||
351 | /** Initialize command info structure. |
354 | /** Initialize command info structure. |
352 | * |
355 | * |
353 | * @param cmd Command info structure. |
356 | * @param cmd Command info structure. |
354 | * |
357 | * |
355 | */ |
358 | */ |
356 | void cmd_initialize(cmd_info_t *cmd) |
359 | void cmd_initialize(cmd_info_t *cmd) |
357 | { |
360 | { |
358 | spinlock_initialize(&cmd->lock, "cmd"); |
361 | spinlock_initialize(&cmd->lock, "cmd"); |
359 | link_initialize(&cmd->link); |
362 | link_initialize(&cmd->link); |
360 | } |
363 | } |
361 | 364 | ||
362 | /** Initialize and register commands. */ |
365 | /** Initialize and register commands. */ |
363 | void cmd_init(void) |
366 | void cmd_init(void) |
364 | { |
367 | { |
365 | int i; |
368 | int i; |
366 | 369 | ||
367 | for (i=0;basic_commands[i]; i++) { |
370 | for (i=0;basic_commands[i]; i++) { |
368 | cmd_initialize(basic_commands[i]); |
371 | cmd_initialize(basic_commands[i]); |
369 | if (!cmd_register(basic_commands[i])) |
372 | if (!cmd_register(basic_commands[i])) |
370 | panic("could not register command %s\n", |
373 | panic("could not register command %s\n", |
371 | basic_commands[i]->name); |
374 | basic_commands[i]->name); |
372 | } |
375 | } |
373 | } |
376 | } |
374 | 377 | ||
375 | 378 | ||
376 | /** List supported commands. |
379 | /** List supported commands. |
377 | * |
380 | * |
378 | * @param argv Argument vector. |
381 | * @param argv Argument vector. |
379 | * |
382 | * |
380 | * @return 0 on failure, 1 on success. |
383 | * @return 0 on failure, 1 on success. |
381 | */ |
384 | */ |
382 | int cmd_help(cmd_arg_t *argv) |
385 | int cmd_help(cmd_arg_t *argv) |
383 | { |
386 | { |
384 | link_t *cur; |
387 | link_t *cur; |
385 | 388 | ||
386 | spinlock_lock(&cmd_lock); |
389 | spinlock_lock(&cmd_lock); |
387 | 390 | ||
388 | for (cur = cmd_head.next; cur != &cmd_head; cur = cur->next) { |
391 | for (cur = cmd_head.next; cur != &cmd_head; cur = cur->next) { |
389 | cmd_info_t *hlp; |
392 | cmd_info_t *hlp; |
390 | 393 | ||
391 | hlp = list_get_instance(cur, cmd_info_t, link); |
394 | hlp = list_get_instance(cur, cmd_info_t, link); |
392 | spinlock_lock(&hlp->lock); |
395 | spinlock_lock(&hlp->lock); |
393 | 396 | ||
394 | printf("%s - %s\n", hlp->name, hlp->description); |
397 | printf("%s - %s\n", hlp->name, hlp->description); |
395 | 398 | ||
396 | spinlock_unlock(&hlp->lock); |
399 | spinlock_unlock(&hlp->lock); |
397 | } |
400 | } |
398 | 401 | ||
399 | spinlock_unlock(&cmd_lock); |
402 | spinlock_unlock(&cmd_lock); |
400 | 403 | ||
401 | return 1; |
404 | return 1; |
402 | } |
405 | } |
403 | 406 | ||
404 | /** Describe specified command. |
407 | /** Describe specified command. |
405 | * |
408 | * |
406 | * @param argv Argument vector. |
409 | * @param argv Argument vector. |
407 | * |
410 | * |
408 | * @return 0 on failure, 1 on success. |
411 | * @return 0 on failure, 1 on success. |
409 | */ |
412 | */ |
410 | int cmd_desc(cmd_arg_t *argv) |
413 | int cmd_desc(cmd_arg_t *argv) |
411 | { |
414 | { |
412 | link_t *cur; |
415 | link_t *cur; |
413 | 416 | ||
414 | spinlock_lock(&cmd_lock); |
417 | spinlock_lock(&cmd_lock); |
415 | 418 | ||
416 | for (cur = cmd_head.next; cur != &cmd_head; cur = cur->next) { |
419 | for (cur = cmd_head.next; cur != &cmd_head; cur = cur->next) { |
417 | cmd_info_t *hlp; |
420 | cmd_info_t *hlp; |
418 | 421 | ||
419 | hlp = list_get_instance(cur, cmd_info_t, link); |
422 | hlp = list_get_instance(cur, cmd_info_t, link); |
420 | spinlock_lock(&hlp->lock); |
423 | spinlock_lock(&hlp->lock); |
421 | 424 | ||
422 | if (strncmp(hlp->name, (const char *) argv->buffer, strlen(hlp->name)) == 0) { |
425 | if (strncmp(hlp->name, (const char *) argv->buffer, strlen(hlp->name)) == 0) { |
423 | printf("%s - %s\n", hlp->name, hlp->description); |
426 | printf("%s - %s\n", hlp->name, hlp->description); |
424 | if (hlp->help) |
427 | if (hlp->help) |
425 | hlp->help(); |
428 | hlp->help(); |
426 | spinlock_unlock(&hlp->lock); |
429 | spinlock_unlock(&hlp->lock); |
427 | break; |
430 | break; |
428 | } |
431 | } |
429 | 432 | ||
430 | spinlock_unlock(&hlp->lock); |
433 | spinlock_unlock(&hlp->lock); |
431 | } |
434 | } |
432 | 435 | ||
433 | spinlock_unlock(&cmd_lock); |
436 | spinlock_unlock(&cmd_lock); |
434 | 437 | ||
435 | return 1; |
438 | return 1; |
436 | } |
439 | } |
437 | 440 | ||
438 | /** Search symbol table */ |
441 | /** Search symbol table */ |
439 | int cmd_symaddr(cmd_arg_t *argv) |
442 | int cmd_symaddr(cmd_arg_t *argv) |
440 | { |
443 | { |
441 | symtab_print_search(argv->buffer); |
444 | symtab_print_search(argv->buffer); |
442 | 445 | ||
443 | return 1; |
446 | return 1; |
444 | } |
447 | } |
445 | 448 | ||
446 | /** Call function with zero parameters */ |
449 | /** Call function with zero parameters */ |
447 | int cmd_call0(cmd_arg_t *argv) |
450 | int cmd_call0(cmd_arg_t *argv) |
448 | { |
451 | { |
449 | __address symaddr; |
452 | __address symaddr; |
450 | char *symbol; |
453 | char *symbol; |
451 | __native (*f)(void); |
454 | __native (*f)(void); |
452 | 455 | ||
453 | symaddr = get_symbol_addr(argv->buffer); |
456 | symaddr = get_symbol_addr(argv->buffer); |
454 | if (!symaddr) |
457 | if (!symaddr) |
455 | printf("Symbol %s not found.\n", argv->buffer); |
458 | printf("Symbol %s not found.\n", argv->buffer); |
456 | else if (symaddr == (__address) -1) { |
459 | else if (symaddr == (__address) -1) { |
457 | symtab_print_search(argv->buffer); |
460 | symtab_print_search(argv->buffer); |
458 | printf("Duplicate symbol, be more specific.\n"); |
461 | printf("Duplicate symbol, be more specific.\n"); |
459 | } else { |
462 | } else { |
460 | symbol = get_symtab_entry(symaddr); |
463 | symbol = get_symtab_entry(symaddr); |
461 | printf("Calling f(): %.*p: %s\n", sizeof(__address) * 2, symaddr, symbol); |
464 | printf("Calling f(): %.*p: %s\n", sizeof(__address) * 2, symaddr, symbol); |
462 | f = (__native (*)(void)) symaddr; |
465 | f = (__native (*)(void)) symaddr; |
463 | printf("Result: %#zx\n", f()); |
466 | printf("Result: %#zx\n", f()); |
464 | } |
467 | } |
465 | 468 | ||
466 | return 1; |
469 | return 1; |
467 | } |
470 | } |
468 | 471 | ||
469 | /** Call function with one parameter */ |
472 | /** Call function with one parameter */ |
470 | int cmd_call1(cmd_arg_t *argv) |
473 | int cmd_call1(cmd_arg_t *argv) |
471 | { |
474 | { |
472 | __address symaddr; |
475 | __address symaddr; |
473 | char *symbol; |
476 | char *symbol; |
474 | __native (*f)(__native,...); |
477 | __native (*f)(__native,...); |
475 | __native arg1 = argv[1].intval; |
478 | __native arg1 = argv[1].intval; |
476 | 479 | ||
477 | symaddr = get_symbol_addr(argv->buffer); |
480 | symaddr = get_symbol_addr(argv->buffer); |
478 | if (!symaddr) |
481 | if (!symaddr) |
479 | printf("Symbol %s not found.\n", argv->buffer); |
482 | printf("Symbol %s not found.\n", argv->buffer); |
480 | else if (symaddr == (__address) -1) { |
483 | else if (symaddr == (__address) -1) { |
481 | symtab_print_search(argv->buffer); |
484 | symtab_print_search(argv->buffer); |
482 | printf("Duplicate symbol, be more specific.\n"); |
485 | printf("Duplicate symbol, be more specific.\n"); |
483 | } else { |
486 | } else { |
484 | symbol = get_symtab_entry(symaddr); |
487 | symbol = get_symtab_entry(symaddr); |
485 | printf("Calling f(0x%zX): %.*p: %s\n", arg1, sizeof(__address) * 2, symaddr, symbol); |
488 | printf("Calling f(0x%zX): %.*p: %s\n", arg1, sizeof(__address) * 2, symaddr, symbol); |
486 | f = (__native (*)(__native,...)) symaddr; |
489 | f = (__native (*)(__native,...)) symaddr; |
487 | printf("Result: %#zx\n", f(arg1)); |
490 | printf("Result: %#zx\n", f(arg1)); |
488 | } |
491 | } |
489 | 492 | ||
490 | return 1; |
493 | return 1; |
491 | } |
494 | } |
492 | 495 | ||
493 | /** Call function with two parameters */ |
496 | /** Call function with two parameters */ |
494 | int cmd_call2(cmd_arg_t *argv) |
497 | int cmd_call2(cmd_arg_t *argv) |
495 | { |
498 | { |
496 | __address symaddr; |
499 | __address symaddr; |
497 | char *symbol; |
500 | char *symbol; |
498 | __native (*f)(__native,__native,...); |
501 | __native (*f)(__native,__native,...); |
499 | __native arg1 = argv[1].intval; |
502 | __native arg1 = argv[1].intval; |
500 | __native arg2 = argv[2].intval; |
503 | __native arg2 = argv[2].intval; |
501 | 504 | ||
502 | symaddr = get_symbol_addr(argv->buffer); |
505 | symaddr = get_symbol_addr(argv->buffer); |
503 | if (!symaddr) |
506 | if (!symaddr) |
504 | printf("Symbol %s not found.\n", argv->buffer); |
507 | printf("Symbol %s not found.\n", argv->buffer); |
505 | else if (symaddr == (__address) -1) { |
508 | else if (symaddr == (__address) -1) { |
506 | symtab_print_search(argv->buffer); |
509 | symtab_print_search(argv->buffer); |
507 | printf("Duplicate symbol, be more specific.\n"); |
510 | printf("Duplicate symbol, be more specific.\n"); |
508 | } else { |
511 | } else { |
509 | symbol = get_symtab_entry(symaddr); |
512 | symbol = get_symtab_entry(symaddr); |
510 | printf("Calling f(0x%zx,0x%zx): %.*p: %s\n", |
513 | printf("Calling f(0x%zx,0x%zx): %.*p: %s\n", |
511 | arg1, arg2, sizeof(__address) * 2, symaddr, symbol); |
514 | arg1, arg2, sizeof(__address) * 2, symaddr, symbol); |
512 | f = (__native (*)(__native,__native,...)) symaddr; |
515 | f = (__native (*)(__native,__native,...)) symaddr; |
513 | printf("Result: %#zx\n", f(arg1, arg2)); |
516 | printf("Result: %#zx\n", f(arg1, arg2)); |
514 | } |
517 | } |
515 | 518 | ||
516 | return 1; |
519 | return 1; |
517 | } |
520 | } |
518 | 521 | ||
519 | /** Call function with three parameters */ |
522 | /** Call function with three parameters */ |
520 | int cmd_call3(cmd_arg_t *argv) |
523 | int cmd_call3(cmd_arg_t *argv) |
521 | { |
524 | { |
522 | __address symaddr; |
525 | __address symaddr; |
523 | char *symbol; |
526 | char *symbol; |
524 | __native (*f)(__native,__native,__native,...); |
527 | __native (*f)(__native,__native,__native,...); |
525 | __native arg1 = argv[1].intval; |
528 | __native arg1 = argv[1].intval; |
526 | __native arg2 = argv[2].intval; |
529 | __native arg2 = argv[2].intval; |
527 | __native arg3 = argv[3].intval; |
530 | __native arg3 = argv[3].intval; |
528 | 531 | ||
529 | symaddr = get_symbol_addr(argv->buffer); |
532 | symaddr = get_symbol_addr(argv->buffer); |
530 | if (!symaddr) |
533 | if (!symaddr) |
531 | printf("Symbol %s not found.\n", argv->buffer); |
534 | printf("Symbol %s not found.\n", argv->buffer); |
532 | else if (symaddr == (__address) -1) { |
535 | else if (symaddr == (__address) -1) { |
533 | symtab_print_search(argv->buffer); |
536 | symtab_print_search(argv->buffer); |
534 | printf("Duplicate symbol, be more specific.\n"); |
537 | printf("Duplicate symbol, be more specific.\n"); |
535 | } else { |
538 | } else { |
536 | symbol = get_symtab_entry(symaddr); |
539 | symbol = get_symtab_entry(symaddr); |
537 | printf("Calling f(0x%zx,0x%zx, 0x%zx): %.*p: %s\n", |
540 | printf("Calling f(0x%zx,0x%zx, 0x%zx): %.*p: %s\n", |
538 | arg1, arg2, arg3, sizeof(__address) * 2, symaddr, symbol); |
541 | arg1, arg2, arg3, sizeof(__address) * 2, symaddr, symbol); |
539 | f = (__native (*)(__native,__native,__native,...)) symaddr; |
542 | f = (__native (*)(__native,__native,__native,...)) symaddr; |
540 | printf("Result: %#zx\n", f(arg1, arg2, arg3)); |
543 | printf("Result: %#zx\n", f(arg1, arg2, arg3)); |
541 | } |
544 | } |
542 | 545 | ||
543 | return 1; |
546 | return 1; |
544 | } |
547 | } |
545 | 548 | ||
546 | 549 | ||
547 | /** Print detailed description of 'describe' command. */ |
550 | /** Print detailed description of 'describe' command. */ |
548 | void desc_help(void) |
551 | void desc_help(void) |
549 | { |
552 | { |
550 | printf("Syntax: describe command_name\n"); |
553 | printf("Syntax: describe command_name\n"); |
551 | } |
554 | } |
552 | 555 | ||
553 | /** Halt the kernel. |
556 | /** Halt the kernel. |
554 | * |
557 | * |
555 | * @param argv Argument vector (ignored). |
558 | * @param argv Argument vector (ignored). |
556 | * |
559 | * |
557 | * @return 0 on failure, 1 on success (never returns). |
560 | * @return 0 on failure, 1 on success (never returns). |
558 | */ |
561 | */ |
559 | int cmd_halt(cmd_arg_t *argv) |
562 | int cmd_halt(cmd_arg_t *argv) |
560 | { |
563 | { |
561 | halt(); |
564 | halt(); |
562 | return 1; |
565 | return 1; |
563 | } |
566 | } |
564 | 567 | ||
565 | /** Command for printing TLB contents. |
568 | /** Command for printing TLB contents. |
566 | * |
569 | * |
567 | * @param argv Not used. |
570 | * @param argv Not used. |
568 | * |
571 | * |
569 | * @return Always returns 1. |
572 | * @return Always returns 1. |
570 | */ |
573 | */ |
571 | int cmd_tlb(cmd_arg_t *argv) |
574 | int cmd_tlb(cmd_arg_t *argv) |
572 | { |
575 | { |
573 | tlb_print(); |
576 | tlb_print(); |
574 | return 1; |
577 | return 1; |
575 | } |
578 | } |
576 | 579 | ||
577 | /** Write 4 byte value to address */ |
580 | /** Write 4 byte value to address */ |
578 | int cmd_set4(cmd_arg_t *argv) |
581 | int cmd_set4(cmd_arg_t *argv) |
579 | { |
582 | { |
580 | __u32 *addr ; |
583 | __u32 *addr ; |
581 | __u32 arg1 = argv[1].intval; |
584 | __u32 arg1 = argv[1].intval; |
582 | bool pointer = false; |
585 | bool pointer = false; |
583 | 586 | ||
584 | if (((char *)argv->buffer)[0] == '*') { |
587 | if (((char *)argv->buffer)[0] == '*') { |
585 | addr = (__u32 *) get_symbol_addr(argv->buffer+1); |
588 | addr = (__u32 *) get_symbol_addr(argv->buffer+1); |
586 | pointer = true; |
589 | pointer = true; |
587 | } else if (((char *)argv->buffer)[0] >= '0' && |
590 | } else if (((char *)argv->buffer)[0] >= '0' && |
588 | ((char *)argv->buffer)[0] <= '9') |
591 | ((char *)argv->buffer)[0] <= '9') |
589 | addr = (__u32 *)atoi((char *)argv->buffer); |
592 | addr = (__u32 *)atoi((char *)argv->buffer); |
590 | else |
593 | else |
591 | addr = (__u32 *)get_symbol_addr(argv->buffer); |
594 | addr = (__u32 *)get_symbol_addr(argv->buffer); |
592 | 595 | ||
593 | if (!addr) |
596 | if (!addr) |
594 | printf("Symbol %s not found.\n", argv->buffer); |
597 | printf("Symbol %s not found.\n", argv->buffer); |
595 | else if (addr == (__u32 *) -1) { |
598 | else if (addr == (__u32 *) -1) { |
596 | symtab_print_search(argv->buffer); |
599 | symtab_print_search(argv->buffer); |
597 | printf("Duplicate symbol, be more specific.\n"); |
600 | printf("Duplicate symbol, be more specific.\n"); |
598 | } else { |
601 | } else { |
599 | if (pointer) |
602 | if (pointer) |
600 | addr = (__u32 *)(*(__native *)addr); |
603 | addr = (__u32 *)(*(__native *)addr); |
601 | printf("Writing 0x%x -> %.*p\n", arg1, sizeof(__address) * 2, addr); |
604 | printf("Writing 0x%x -> %.*p\n", arg1, sizeof(__address) * 2, addr); |
602 | *addr = arg1; |
605 | *addr = arg1; |
603 | 606 | ||
604 | } |
607 | } |
605 | 608 | ||
606 | return 1; |
609 | return 1; |
607 | } |
610 | } |
608 | 611 | ||
609 | /** Command for listings SLAB caches |
612 | /** Command for listings SLAB caches |
610 | * |
613 | * |
611 | * @param argv Ignores |
614 | * @param argv Ignores |
612 | * |
615 | * |
613 | * @return Always 1 |
616 | * @return Always 1 |
614 | */ |
617 | */ |
615 | int cmd_slabs(cmd_arg_t * argv) { |
618 | int cmd_slabs(cmd_arg_t * argv) { |
616 | slab_print_list(); |
619 | slab_print_list(); |
617 | return 1; |
620 | return 1; |
618 | } |
621 | } |
619 | 622 | ||
620 | 623 | ||
621 | /** Command for listings Thread information |
624 | /** Command for listings Thread information |
622 | * |
625 | * |
623 | * @param argv Ignores |
626 | * @param argv Ignores |
624 | * |
627 | * |
625 | * @return Always 1 |
628 | * @return Always 1 |
626 | */ |
629 | */ |
627 | int cmd_threads(cmd_arg_t * argv) { |
630 | int cmd_threads(cmd_arg_t * argv) { |
628 | thread_print_list(); |
631 | thread_print_list(); |
629 | return 1; |
632 | return 1; |
630 | } |
633 | } |
631 | 634 | ||
632 | /** Command for listings Task information |
635 | /** Command for listings Task information |
633 | * |
636 | * |
634 | * @param argv Ignores |
637 | * @param argv Ignores |
635 | * |
638 | * |
636 | * @return Always 1 |
639 | * @return Always 1 |
637 | */ |
640 | */ |
638 | int cmd_tasks(cmd_arg_t * argv) { |
641 | int cmd_tasks(cmd_arg_t * argv) { |
639 | task_print_list(); |
642 | task_print_list(); |
640 | return 1; |
643 | return 1; |
641 | } |
644 | } |
642 | 645 | ||
643 | /** Command for listings Thread information |
646 | /** Command for listings Thread information |
644 | * |
647 | * |
645 | * @param argv Ignores |
648 | * @param argv Ignores |
646 | * |
649 | * |
647 | * @return Always 1 |
650 | * @return Always 1 |
648 | */ |
651 | */ |
649 | int cmd_sched(cmd_arg_t * argv) { |
652 | int cmd_sched(cmd_arg_t * argv) { |
650 | sched_print_list(); |
653 | sched_print_list(); |
651 | return 1; |
654 | return 1; |
652 | } |
655 | } |
653 | 656 | ||
654 | /** Command for listing memory zones |
657 | /** Command for listing memory zones |
655 | * |
658 | * |
656 | * @param argv Ignored |
659 | * @param argv Ignored |
657 | * |
660 | * |
658 | * return Always 1 |
661 | * return Always 1 |
659 | */ |
662 | */ |
660 | int cmd_zones(cmd_arg_t * argv) { |
663 | int cmd_zones(cmd_arg_t * argv) { |
661 | zone_print_list(); |
664 | zone_print_list(); |
662 | return 1; |
665 | return 1; |
663 | } |
666 | } |
664 | 667 | ||
665 | /** Command for memory zone details |
668 | /** Command for memory zone details |
666 | * |
669 | * |
667 | * @param argv Integer argument from cmdline expected |
670 | * @param argv Integer argument from cmdline expected |
668 | * |
671 | * |
669 | * return Always 1 |
672 | * return Always 1 |
670 | */ |
673 | */ |
671 | int cmd_zone(cmd_arg_t * argv) { |
674 | int cmd_zone(cmd_arg_t * argv) { |
672 | zone_print_one(argv[0].intval); |
675 | zone_print_one(argv[0].intval); |
673 | return 1; |
676 | return 1; |
674 | } |
677 | } |
675 | 678 | ||
676 | /** Command for listing processors. |
679 | /** Command for listing processors. |
677 | * |
680 | * |
678 | * @param argv Ignored. |
681 | * @param argv Ignored. |
679 | * |
682 | * |
680 | * return Always 1. |
683 | * return Always 1. |
681 | */ |
684 | */ |
682 | int cmd_cpus(cmd_arg_t *argv) |
685 | int cmd_cpus(cmd_arg_t *argv) |
683 | { |
686 | { |
684 | cpu_list(); |
687 | cpu_list(); |
685 | return 1; |
688 | return 1; |
686 | } |
689 | } |
687 | 690 | ||
688 | /** Command for printing kernel version. |
691 | /** Command for printing kernel version. |
689 | * |
692 | * |
690 | * @param argv Ignored. |
693 | * @param argv Ignored. |
691 | * |
694 | * |
692 | * return Always 1. |
695 | * return Always 1. |
693 | */ |
696 | */ |
694 | int cmd_version(cmd_arg_t *argv) |
697 | int cmd_version(cmd_arg_t *argv) |
695 | { |
698 | { |
696 | version_print(); |
699 | version_print(); |
697 | return 1; |
700 | return 1; |
698 | } |
701 | } |
699 | 702 |