Subversion Repositories HelenOS-historic

Rev

Rev 1582 | Rev 1695 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1582 Rev 1666
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
30
 * @file    cmd.c
31
 * @brief   Kernel console command wrappers.
31
 * @brief   Kernel console command wrappers.
32
 *
32
 *
33
 * This file is meant to contain all wrapper functions for
33
 * This file is meant to contain all wrapper functions for
34
 * all kconsole commands. The point is in separating
34
 * all kconsole commands. The point is in separating
35
 * kconsole specific wrappers from kconsole-unaware functions
35
 * kconsole specific wrappers from kconsole-unaware functions
36
 * from other subsystems.
36
 * from other subsystems.
37
 */
37
 */
38
 
38
 
39
#include <console/cmd.h>
39
#include <console/cmd.h>
40
#include <console/console.h>
40
#include <console/console.h>
41
#include <console/kconsole.h>
41
#include <console/kconsole.h>
42
#include <print.h>
42
#include <print.h>
43
#include <panic.h>
43
#include <panic.h>
44
#include <typedefs.h>
44
#include <typedefs.h>
45
#include <arch/types.h>
45
#include <arch/types.h>
46
#include <adt/list.h>
46
#include <adt/list.h>
47
#include <arch.h>
47
#include <arch.h>
48
#include <func.h>
48
#include <func.h>
49
#include <macros.h>
49
#include <macros.h>
50
#include <debug.h>
50
#include <debug.h>
51
#include <symtab.h>
51
#include <symtab.h>
52
#include <cpu.h>
52
#include <cpu.h>
53
#include <mm/tlb.h>
53
#include <mm/tlb.h>
54
#include <arch/mm/tlb.h>
54
#include <arch/mm/tlb.h>
55
#include <mm/frame.h>
55
#include <mm/frame.h>
56
#include <main/version.h>
56
#include <main/version.h>
57
#include <mm/slab.h>
57
#include <mm/slab.h>
58
#include <proc/scheduler.h>
58
#include <proc/scheduler.h>
59
#include <proc/thread.h>
59
#include <proc/thread.h>
60
#include <proc/task.h>
60
#include <proc/task.h>
61
#include <ipc/ipc.h>
61
#include <ipc/ipc.h>
62
 
62
 
63
/** Data and methods for 'help' command. */
63
/** Data and methods for 'help' command. */
64
static int cmd_help(cmd_arg_t *argv);
64
static int cmd_help(cmd_arg_t *argv);
65
static cmd_info_t help_info = {
65
static cmd_info_t help_info = {
66
    .name = "help",
66
    .name = "help",
67
    .description = "List of supported commands.",
67
    .description = "List of supported commands.",
68
    .func = cmd_help,
68
    .func = cmd_help,
69
    .argc = 0
69
    .argc = 0
70
};
70
};
71
 
71
 
72
static cmd_info_t exit_info = {
72
static cmd_info_t exit_info = {
73
    .name = "exit",
73
    .name = "exit",
74
    .description ="Exit kconsole",
74
    .description ="Exit kconsole",
75
    .argc = 0
75
    .argc = 0
76
};
76
};
77
 
77
 
78
static int cmd_continue(cmd_arg_t *argv);
78
static int cmd_continue(cmd_arg_t *argv);
79
static cmd_info_t continue_info = {
79
static cmd_info_t continue_info = {
80
    .name = "continue",
80
    .name = "continue",
81
    .description ="Return console back to userspace",
81
    .description ="Return console back to userspace",
82
    .func = cmd_continue,
82
    .func = cmd_continue,
83
    .argc = 0
83
    .argc = 0
84
};
84
};
85
 
85
 
86
/** Data and methods for 'description' command. */
86
/** Data and methods for 'description' command. */
87
static int cmd_desc(cmd_arg_t *argv);
87
static int cmd_desc(cmd_arg_t *argv);
88
static void desc_help(void);
88
static void desc_help(void);
89
static char desc_buf[MAX_CMDLINE+1];
89
static char desc_buf[MAX_CMDLINE+1];
90
static cmd_arg_t desc_argv = {
90
static cmd_arg_t desc_argv = {
91
    .type = ARG_TYPE_STRING,
91
    .type = ARG_TYPE_STRING,
92
    .buffer = desc_buf,
92
    .buffer = desc_buf,
93
    .len = sizeof(desc_buf)
93
    .len = sizeof(desc_buf)
94
};
94
};
95
static cmd_info_t desc_info = {
95
static cmd_info_t desc_info = {
96
    .name = "describe",
96
    .name = "describe",
97
    .description = "Describe specified command.",
97
    .description = "Describe specified command.",
98
    .help = desc_help,
98
    .help = desc_help,
99
    .func = cmd_desc,
99
    .func = cmd_desc,
100
    .argc = 1,
100
    .argc = 1,
101
    .argv = &desc_argv
101
    .argv = &desc_argv
102
};
102
};
103
 
103
 
104
/** Data and methods for 'symaddr' command. */
104
/** Data and methods for 'symaddr' command. */
105
static int cmd_symaddr(cmd_arg_t *argv);
105
static int cmd_symaddr(cmd_arg_t *argv);
106
static char symaddr_buf[MAX_CMDLINE+1];
106
static char symaddr_buf[MAX_CMDLINE+1];
107
static cmd_arg_t symaddr_argv = {
107
static cmd_arg_t symaddr_argv = {
108
    .type = ARG_TYPE_STRING,
108
    .type = ARG_TYPE_STRING,
109
    .buffer = symaddr_buf,
109
    .buffer = symaddr_buf,
110
    .len = sizeof(symaddr_buf)
110
    .len = sizeof(symaddr_buf)
111
};
111
};
112
static cmd_info_t symaddr_info = {
112
static cmd_info_t symaddr_info = {
113
    .name = "symaddr",
113
    .name = "symaddr",
114
    .description = "Return symbol address.",
114
    .description = "Return symbol address.",
115
    .func = cmd_symaddr,
115
    .func = cmd_symaddr,
116
    .argc = 1,
116
    .argc = 1,
117
    .argv = &symaddr_argv
117
    .argv = &symaddr_argv
118
};
118
};
119
 
119
 
120
static char set_buf[MAX_CMDLINE+1];
120
static char set_buf[MAX_CMDLINE+1];
121
static int cmd_set4(cmd_arg_t *argv);
121
static int cmd_set4(cmd_arg_t *argv);
122
static cmd_arg_t set4_argv[] = {
122
static cmd_arg_t set4_argv[] = {
123
    {
123
    {
124
        .type = ARG_TYPE_STRING,
124
        .type = ARG_TYPE_STRING,
125
        .buffer = set_buf,
125
        .buffer = set_buf,
126
        .len = sizeof(set_buf)
126
        .len = sizeof(set_buf)
127
    },
127
    },
128
    {
128
    {
129
        .type = ARG_TYPE_INT
129
        .type = ARG_TYPE_INT
130
    }
130
    }
131
};
131
};
132
static cmd_info_t set4_info = {
132
static cmd_info_t set4_info = {
133
    .name = "set4",
133
    .name = "set4",
134
    .description = "set <dest_addr> <value> - 4byte version",
134
    .description = "set <dest_addr> <value> - 4byte version",
135
    .func = cmd_set4,
135
    .func = cmd_set4,
136
    .argc = 2,
136
    .argc = 2,
137
    .argv = set4_argv
137
    .argv = set4_argv
138
};
138
};
139
 
139
 
140
/** Data and methods for 'call0' command. */
140
/** Data and methods for 'call0' command. */
141
static char call0_buf[MAX_CMDLINE+1];
141
static char call0_buf[MAX_CMDLINE+1];
142
static char carg1_buf[MAX_CMDLINE+1];
142
static char carg1_buf[MAX_CMDLINE+1];
143
static char carg2_buf[MAX_CMDLINE+1];
143
static char carg2_buf[MAX_CMDLINE+1];
144
static char carg3_buf[MAX_CMDLINE+1];
144
static char carg3_buf[MAX_CMDLINE+1];
145
 
145
 
146
static int cmd_call0(cmd_arg_t *argv);
146
static int cmd_call0(cmd_arg_t *argv);
147
static cmd_arg_t call0_argv = {
147
static cmd_arg_t call0_argv = {
148
    .type = ARG_TYPE_STRING,
148
    .type = ARG_TYPE_STRING,
149
    .buffer = call0_buf,
149
    .buffer = call0_buf,
150
    .len = sizeof(call0_buf)
150
    .len = sizeof(call0_buf)
151
};
151
};
152
static cmd_info_t call0_info = {
152
static cmd_info_t call0_info = {
153
    .name = "call0",
153
    .name = "call0",
154
    .description = "call0 <function> -> call function().",
154
    .description = "call0 <function> -> call function().",
155
    .func = cmd_call0,
155
    .func = cmd_call0,
156
    .argc = 1,
156
    .argc = 1,
157
    .argv = &call0_argv
157
    .argv = &call0_argv
158
};
158
};
159
 
159
 
160
/** Data and methods for 'call1' command. */
160
/** Data and methods for 'call1' command. */
161
static int cmd_call1(cmd_arg_t *argv);
161
static int cmd_call1(cmd_arg_t *argv);
162
static cmd_arg_t call1_argv[] = {
162
static cmd_arg_t call1_argv[] = {
163
    {
163
    {
164
        .type = ARG_TYPE_STRING,
164
        .type = ARG_TYPE_STRING,
165
        .buffer = call0_buf,
165
        .buffer = call0_buf,
166
        .len = sizeof(call0_buf)
166
        .len = sizeof(call0_buf)
167
    },
167
    },
168
    {
168
    {
169
        .type = ARG_TYPE_VAR,
169
        .type = ARG_TYPE_VAR,
170
        .buffer = carg1_buf,
170
        .buffer = carg1_buf,
171
        .len = sizeof(carg1_buf)
171
        .len = sizeof(carg1_buf)
172
    }
172
    }
173
};
173
};
174
static cmd_info_t call1_info = {
174
static cmd_info_t call1_info = {
175
    .name = "call1",
175
    .name = "call1",
176
    .description = "call1 <function> <arg1> -> call function(arg1).",
176
    .description = "call1 <function> <arg1> -> call function(arg1).",
177
    .func = cmd_call1,
177
    .func = cmd_call1,
178
    .argc = 2,
178
    .argc = 2,
179
    .argv = call1_argv
179
    .argv = call1_argv
180
};
180
};
181
 
181
 
182
/** Data and methods for 'call2' command. */
182
/** Data and methods for 'call2' command. */
183
static int cmd_call2(cmd_arg_t *argv);
183
static int cmd_call2(cmd_arg_t *argv);
184
static cmd_arg_t call2_argv[] = {
184
static cmd_arg_t call2_argv[] = {
185
    {
185
    {
186
        .type = ARG_TYPE_STRING,
186
        .type = ARG_TYPE_STRING,
187
        .buffer = call0_buf,
187
        .buffer = call0_buf,
188
        .len = sizeof(call0_buf)
188
        .len = sizeof(call0_buf)
189
    },
189
    },
190
    {
190
    {
191
        .type = ARG_TYPE_VAR,
191
        .type = ARG_TYPE_VAR,
192
        .buffer = carg1_buf,
192
        .buffer = carg1_buf,
193
        .len = sizeof(carg1_buf)
193
        .len = sizeof(carg1_buf)
194
    },
194
    },
195
    {
195
    {
196
        .type = ARG_TYPE_VAR,
196
        .type = ARG_TYPE_VAR,
197
        .buffer = carg2_buf,
197
        .buffer = carg2_buf,
198
        .len = sizeof(carg2_buf)
198
        .len = sizeof(carg2_buf)
199
    }
199
    }
200
};
200
};
201
static cmd_info_t call2_info = {
201
static cmd_info_t call2_info = {
202
    .name = "call2",
202
    .name = "call2",
203
    .description = "call2 <function> <arg1> <arg2> -> call function(arg1,arg2).",
203
    .description = "call2 <function> <arg1> <arg2> -> call function(arg1,arg2).",
204
    .func = cmd_call2,
204
    .func = cmd_call2,
205
    .argc = 3,
205
    .argc = 3,
206
    .argv = call2_argv
206
    .argv = call2_argv
207
};
207
};
208
 
208
 
209
/** Data and methods for 'call3' command. */
209
/** Data and methods for 'call3' command. */
210
static int cmd_call3(cmd_arg_t *argv);
210
static int cmd_call3(cmd_arg_t *argv);
211
static cmd_arg_t call3_argv[] = {
211
static cmd_arg_t call3_argv[] = {
212
    {
212
    {
213
        .type = ARG_TYPE_STRING,
213
        .type = ARG_TYPE_STRING,
214
        .buffer = call0_buf,
214
        .buffer = call0_buf,
215
        .len = sizeof(call0_buf)
215
        .len = sizeof(call0_buf)
216
    },
216
    },
217
    {
217
    {
218
        .type = ARG_TYPE_VAR,
218
        .type = ARG_TYPE_VAR,
219
        .buffer = carg1_buf,
219
        .buffer = carg1_buf,
220
        .len = sizeof(carg1_buf)
220
        .len = sizeof(carg1_buf)
221
    },
221
    },
222
    {
222
    {
223
        .type = ARG_TYPE_VAR,
223
        .type = ARG_TYPE_VAR,
224
        .buffer = carg2_buf,
224
        .buffer = carg2_buf,
225
        .len = sizeof(carg2_buf)
225
        .len = sizeof(carg2_buf)
226
    },
226
    },
227
    {
227
    {
228
        .type = ARG_TYPE_VAR,
228
        .type = ARG_TYPE_VAR,
229
        .buffer = carg3_buf,
229
        .buffer = carg3_buf,
230
        .len = sizeof(carg3_buf)
230
        .len = sizeof(carg3_buf)
231
    }
231
    }
232
 
232
 
233
};
233
};
234
static cmd_info_t call3_info = {
234
static cmd_info_t call3_info = {
235
    .name = "call3",
235
    .name = "call3",
236
    .description = "call3 <function> <arg1> <arg2> <arg3> -> call function(arg1,arg2,arg3).",
236
    .description = "call3 <function> <arg1> <arg2> <arg3> -> call function(arg1,arg2,arg3).",
237
    .func = cmd_call3,
237
    .func = cmd_call3,
238
    .argc = 4,
238
    .argc = 4,
239
    .argv = call3_argv
239
    .argv = call3_argv
240
};
240
};
241
 
241
 
242
/** Data and methods for 'halt' command. */
242
/** Data and methods for 'halt' command. */
243
static int cmd_halt(cmd_arg_t *argv);
243
static int cmd_halt(cmd_arg_t *argv);
244
static cmd_info_t halt_info = {
244
static cmd_info_t halt_info = {
245
    .name = "halt",
245
    .name = "halt",
246
    .description = "Halt the kernel.",
246
    .description = "Halt the kernel.",
247
    .func = cmd_halt,
247
    .func = cmd_halt,
248
    .argc = 0
248
    .argc = 0
249
};
249
};
250
 
250
 
251
/** Data and methods for 'tlb' command. */
251
/** Data and methods for 'tlb' command. */
252
static int cmd_tlb(cmd_arg_t *argv);
252
static int cmd_tlb(cmd_arg_t *argv);
253
cmd_info_t tlb_info = {
253
cmd_info_t tlb_info = {
254
    .name = "tlb",
254
    .name = "tlb",
255
    .description = "Print TLB of current processor.",
255
    .description = "Print TLB of current processor.",
256
    .help = NULL,
256
    .help = NULL,
257
    .func = cmd_tlb,
257
    .func = cmd_tlb,
258
    .argc = 0,
258
    .argc = 0,
259
    .argv = NULL
259
    .argv = NULL
260
};
260
};
261
 
261
 
262
static int cmd_threads(cmd_arg_t *argv);
262
static int cmd_threads(cmd_arg_t *argv);
263
static cmd_info_t threads_info = {
263
static cmd_info_t threads_info = {
264
    .name = "threads",
264
    .name = "threads",
265
    .description = "List all threads",
265
    .description = "List all threads",
266
    .func = cmd_threads,
266
    .func = cmd_threads,
267
    .argc = 0
267
    .argc = 0
268
};
268
};
269
 
269
 
270
static int cmd_tasks(cmd_arg_t *argv);
270
static int cmd_tasks(cmd_arg_t *argv);
271
static cmd_info_t tasks_info = {
271
static cmd_info_t tasks_info = {
272
    .name = "tasks",
272
    .name = "tasks",
273
    .description = "List all tasks",
273
    .description = "List all tasks",
274
    .func = cmd_tasks,
274
    .func = cmd_tasks,
275
    .argc = 0
275
    .argc = 0
276
};
276
};
277
 
277
 
278
 
278
 
279
static int cmd_sched(cmd_arg_t *argv);
279
static int cmd_sched(cmd_arg_t *argv);
280
static cmd_info_t sched_info = {
280
static cmd_info_t sched_info = {
281
    .name = "scheduler",
281
    .name = "scheduler",
282
    .description = "List all scheduler information",
282
    .description = "List all scheduler information",
283
    .func = cmd_sched,
283
    .func = cmd_sched,
284
    .argc = 0
284
    .argc = 0
285
};
285
};
286
 
286
 
287
static int cmd_slabs(cmd_arg_t *argv);
287
static int cmd_slabs(cmd_arg_t *argv);
288
static cmd_info_t slabs_info = {
288
static cmd_info_t slabs_info = {
289
    .name = "slabs",
289
    .name = "slabs",
290
    .description = "List SLAB caches.",
290
    .description = "List SLAB caches.",
291
    .func = cmd_slabs,
291
    .func = cmd_slabs,
292
    .argc = 0
292
    .argc = 0
293
};
293
};
294
 
294
 
295
/** Data and methods for 'zones' command */
295
/** Data and methods for 'zones' command */
296
static int cmd_zones(cmd_arg_t *argv);
296
static int cmd_zones(cmd_arg_t *argv);
297
static cmd_info_t zones_info = {
297
static cmd_info_t zones_info = {
298
    .name = "zones",
298
    .name = "zones",
299
    .description = "List of memory zones.",
299
    .description = "List of memory zones.",
300
    .func = cmd_zones,
300
    .func = cmd_zones,
301
    .argc = 0
301
    .argc = 0
302
};
302
};
303
 
303
 
304
/** Data and methods for 'ipc_task' command */
304
/** Data and methods for 'ipc_task' command */
305
static int cmd_ipc_task(cmd_arg_t *argv);
305
static int cmd_ipc_task(cmd_arg_t *argv);
306
static cmd_arg_t ipc_task_argv = {
306
static cmd_arg_t ipc_task_argv = {
307
    .type = ARG_TYPE_INT,
307
    .type = ARG_TYPE_INT,
308
};
308
};
309
static cmd_info_t ipc_task_info = {
309
static cmd_info_t ipc_task_info = {
310
    .name = "ipc_task",
310
    .name = "ipc_task",
311
    .description = "ipc_task <taskid> Show IPC information of given task",
311
    .description = "ipc_task <taskid> Show IPC information of given task",
312
    .func = cmd_ipc_task,
312
    .func = cmd_ipc_task,
313
    .argc = 1,
313
    .argc = 1,
314
    .argv = &ipc_task_argv
314
    .argv = &ipc_task_argv
315
};
315
};
316
 
316
 
317
/** Data and methods for 'zone' command */
317
/** Data and methods for 'zone' command */
318
static int cmd_zone(cmd_arg_t *argv);
318
static int cmd_zone(cmd_arg_t *argv);
319
static cmd_arg_t zone_argv = {
319
static cmd_arg_t zone_argv = {
320
    .type = ARG_TYPE_INT,
320
    .type = ARG_TYPE_INT,
321
};
321
};
322
 
322
 
323
static cmd_info_t zone_info = {
323
static cmd_info_t zone_info = {
324
    .name = "zone",
324
    .name = "zone",
325
    .description = "Show memory zone structure.",
325
    .description = "Show memory zone structure.",
326
    .func = cmd_zone,
326
    .func = cmd_zone,
327
    .argc = 1,
327
    .argc = 1,
328
    .argv = &zone_argv
328
    .argv = &zone_argv
329
};
329
};
330
 
330
 
331
/** Data and methods for 'cpus' command. */
331
/** Data and methods for 'cpus' command. */
332
static int cmd_cpus(cmd_arg_t *argv);
332
static int cmd_cpus(cmd_arg_t *argv);
333
cmd_info_t cpus_info = {
333
cmd_info_t cpus_info = {
334
    .name = "cpus",
334
    .name = "cpus",
335
    .description = "List all processors.",
335
    .description = "List all processors.",
336
    .help = NULL,
336
    .help = NULL,
337
    .func = cmd_cpus,
337
    .func = cmd_cpus,
338
    .argc = 0,
338
    .argc = 0,
339
    .argv = NULL
339
    .argv = NULL
340
};
340
};
341
 
341
 
342
/** Data and methods for 'version' command. */
342
/** Data and methods for 'version' command. */
343
static int cmd_version(cmd_arg_t *argv);
343
static int cmd_version(cmd_arg_t *argv);
344
cmd_info_t version_info = {
344
cmd_info_t version_info = {
345
    .name = "version",
345
    .name = "version",
346
    .description = "Print version information.",
346
    .description = "Print version information.",
347
    .help = NULL,
347
    .help = NULL,
348
    .func = cmd_version,
348
    .func = cmd_version,
349
    .argc = 0,
349
    .argc = 0,
350
    .argv = NULL
350
    .argv = NULL
351
};
351
};
352
 
352
 
353
static cmd_info_t *basic_commands[] = {
353
static cmd_info_t *basic_commands[] = {
354
    &call0_info,
354
    &call0_info,
355
    &call1_info,
355
    &call1_info,
356
    &call2_info,
356
    &call2_info,
357
    &call3_info,
357
    &call3_info,
358
    &continue_info,
358
    &continue_info,
359
    &cpus_info,
359
    &cpus_info,
360
    &desc_info,
360
    &desc_info,
361
    &exit_info,
361
    &exit_info,
362
    &halt_info,
362
    &halt_info,
363
    &help_info,
363
    &help_info,
364
    &ipc_task_info,
364
    &ipc_task_info,
365
    &set4_info,
365
    &set4_info,
366
    &slabs_info,
366
    &slabs_info,
367
    &symaddr_info,
367
    &symaddr_info,
368
    &sched_info,
368
    &sched_info,
369
    &threads_info,
369
    &threads_info,
370
    &tasks_info,
370
    &tasks_info,
371
    &tlb_info,
371
    &tlb_info,
372
    &version_info,
372
    &version_info,
373
    &zones_info,
373
    &zones_info,
374
    &zone_info,
374
    &zone_info,
375
    NULL
375
    NULL
376
};
376
};
377
 
377
 
378
 
378
 
379
/** Initialize command info structure.
379
/** Initialize command info structure.
380
 *
380
 *
381
 * @param cmd Command info structure.
381
 * @param cmd Command info structure.
382
 *
382
 *
383
 */
383
 */
384
void cmd_initialize(cmd_info_t *cmd)
384
void cmd_initialize(cmd_info_t *cmd)
385
{
385
{
386
    spinlock_initialize(&cmd->lock, "cmd");
386
    spinlock_initialize(&cmd->lock, "cmd");
387
    link_initialize(&cmd->link);
387
    link_initialize(&cmd->link);
388
}
388
}
389
 
389
 
390
/** Initialize and register commands. */
390
/** Initialize and register commands. */
391
void cmd_init(void)
391
void cmd_init(void)
392
{
392
{
393
    int i;
393
    int i;
394
 
394
 
395
    for (i=0;basic_commands[i]; i++) {
395
    for (i=0;basic_commands[i]; i++) {
396
        cmd_initialize(basic_commands[i]);
396
        cmd_initialize(basic_commands[i]);
397
        if (!cmd_register(basic_commands[i]))
397
        if (!cmd_register(basic_commands[i]))
398
            panic("could not register command %s\n",
398
            panic("could not register command %s\n",
399
                  basic_commands[i]->name);
399
                  basic_commands[i]->name);
400
    }
400
    }
401
}
401
}
402
 
402
 
403
 
403
 
404
/** List supported commands.
404
/** List supported commands.
405
 *
405
 *
406
 * @param argv Argument vector.
406
 * @param argv Argument vector.
407
 *
407
 *
408
 * @return 0 on failure, 1 on success.
408
 * @return 0 on failure, 1 on success.
409
 */
409
 */
410
int cmd_help(cmd_arg_t *argv)
410
int cmd_help(cmd_arg_t *argv)
411
{
411
{
412
    link_t *cur;
412
    link_t *cur;
413
 
413
 
414
    spinlock_lock(&cmd_lock);
414
    spinlock_lock(&cmd_lock);
415
   
415
   
416
    for (cur = cmd_head.next; cur != &cmd_head; cur = cur->next) {
416
    for (cur = cmd_head.next; cur != &cmd_head; cur = cur->next) {
417
        cmd_info_t *hlp;
417
        cmd_info_t *hlp;
418
       
418
       
419
        hlp = list_get_instance(cur, cmd_info_t, link);
419
        hlp = list_get_instance(cur, cmd_info_t, link);
420
        spinlock_lock(&hlp->lock);
420
        spinlock_lock(&hlp->lock);
421
       
421
       
422
        printf("%s - %s\n", hlp->name, hlp->description);
422
        printf("%s - %s\n", hlp->name, hlp->description);
423
 
423
 
424
        spinlock_unlock(&hlp->lock);
424
        spinlock_unlock(&hlp->lock);
425
    }
425
    }
426
   
426
   
427
    spinlock_unlock(&cmd_lock);
427
    spinlock_unlock(&cmd_lock);
428
 
428
 
429
    return 1;
429
    return 1;
430
}
430
}
431
 
431
 
432
/** Describe specified command.
432
/** Describe specified command.
433
 *
433
 *
434
 * @param argv Argument vector.
434
 * @param argv Argument vector.
435
 *
435
 *
436
 * @return 0 on failure, 1 on success.
436
 * @return 0 on failure, 1 on success.
437
 */
437
 */
438
int cmd_desc(cmd_arg_t *argv)
438
int cmd_desc(cmd_arg_t *argv)
439
{
439
{
440
    link_t *cur;
440
    link_t *cur;
441
 
441
 
442
    spinlock_lock(&cmd_lock);
442
    spinlock_lock(&cmd_lock);
443
   
443
   
444
    for (cur = cmd_head.next; cur != &cmd_head; cur = cur->next) {
444
    for (cur = cmd_head.next; cur != &cmd_head; cur = cur->next) {
445
        cmd_info_t *hlp;
445
        cmd_info_t *hlp;
446
       
446
       
447
        hlp = list_get_instance(cur, cmd_info_t, link);
447
        hlp = list_get_instance(cur, cmd_info_t, link);
448
        spinlock_lock(&hlp->lock);
448
        spinlock_lock(&hlp->lock);
449
 
449
 
450
        if (strncmp(hlp->name, (const char *) argv->buffer, strlen(hlp->name)) == 0) {
450
        if (strncmp(hlp->name, (const char *) argv->buffer, strlen(hlp->name)) == 0) {
451
            printf("%s - %s\n", hlp->name, hlp->description);
451
            printf("%s - %s\n", hlp->name, hlp->description);
452
            if (hlp->help)
452
            if (hlp->help)
453
                hlp->help();
453
                hlp->help();
454
            spinlock_unlock(&hlp->lock);
454
            spinlock_unlock(&hlp->lock);
455
            break;
455
            break;
456
        }
456
        }
457
 
457
 
458
        spinlock_unlock(&hlp->lock);
458
        spinlock_unlock(&hlp->lock);
459
    }
459
    }
460
   
460
   
461
    spinlock_unlock(&cmd_lock);
461
    spinlock_unlock(&cmd_lock);
462
 
462
 
463
    return 1;
463
    return 1;
464
}
464
}
465
 
465
 
466
/** Search symbol table */
466
/** Search symbol table */
467
int cmd_symaddr(cmd_arg_t *argv)
467
int cmd_symaddr(cmd_arg_t *argv)
468
{
468
{
469
    symtab_print_search(argv->buffer);
469
    symtab_print_search(argv->buffer);
470
   
470
   
471
    return 1;
471
    return 1;
472
}
472
}
473
 
473
 
474
/** Call function with zero parameters */
474
/** Call function with zero parameters */
475
int cmd_call0(cmd_arg_t *argv)
475
int cmd_call0(cmd_arg_t *argv)
476
{
476
{
477
    __address symaddr;
477
    __address symaddr;
478
    char *symbol;
478
    char *symbol;
479
    __native (*f)(void);
479
    __native (*f)(void);
-
 
480
#ifdef ia64
-
 
481
    struct {
-
 
482
        __native f;
-
 
483
        __native gp;
-
 
484
    }fptr;
-
 
485
#endif
480
 
486
 
481
    symaddr = get_symbol_addr(argv->buffer);
487
    symaddr = get_symbol_addr(argv->buffer);
482
    if (!symaddr)
488
    if (!symaddr)
483
        printf("Symbol %s not found.\n", argv->buffer);
489
        printf("Symbol %s not found.\n", argv->buffer);
484
    else if (symaddr == (__address) -1) {
490
    else if (symaddr == (__address) -1) {
485
        symtab_print_search(argv->buffer);
491
        symtab_print_search(argv->buffer);
486
        printf("Duplicate symbol, be more specific.\n");
492
        printf("Duplicate symbol, be more specific.\n");
487
    } else {
493
    } else {
488
        symbol = get_symtab_entry(symaddr);
494
        symbol = get_symtab_entry(symaddr);
489
        printf("Calling f(): %.*p: %s\n", sizeof(__address) * 2, symaddr, symbol);
495
        printf("Calling f(): %.*p: %s\n", sizeof(__address) * 2, symaddr, symbol);
-
 
496
#ifdef ia64
-
 
497
        fptr.f = symaddr;
-
 
498
        fptr.gp = ((__native *)cmd_call2)[1];
-
 
499
        f =  (__native (*)(void)) &fptr;
-
 
500
#else
490
        f =  (__native (*)(void)) symaddr;
501
        f =  (__native (*)(void)) symaddr;
-
 
502
#endif
491
        printf("Result: %#zx\n", f());
503
        printf("Result: %#zx\n", f());
492
    }
504
    }
493
   
505
   
494
    return 1;
506
    return 1;
495
}
507
}
496
 
508
 
497
/** Call function with one parameter */
509
/** Call function with one parameter */
498
int cmd_call1(cmd_arg_t *argv)
510
int cmd_call1(cmd_arg_t *argv)
499
{
511
{
500
    __address symaddr;
512
    __address symaddr;
501
    char *symbol;
513
    char *symbol;
502
    __native (*f)(__native,...);
514
    __native (*f)(__native,...);
503
    __native arg1 = argv[1].intval;
515
    __native arg1 = argv[1].intval;
-
 
516
#ifdef ia64
-
 
517
    struct {
-
 
518
        __native f;
-
 
519
        __native gp;
-
 
520
    }fptr;
-
 
521
#endif
504
 
522
 
505
    symaddr = get_symbol_addr(argv->buffer);
523
    symaddr = get_symbol_addr(argv->buffer);
506
    if (!symaddr)
524
    if (!symaddr)
507
        printf("Symbol %s not found.\n", argv->buffer);
525
        printf("Symbol %s not found.\n", argv->buffer);
508
    else if (symaddr == (__address) -1) {
526
    else if (symaddr == (__address) -1) {
509
        symtab_print_search(argv->buffer);
527
        symtab_print_search(argv->buffer);
510
        printf("Duplicate symbol, be more specific.\n");
528
        printf("Duplicate symbol, be more specific.\n");
511
    } else {
529
    } else {
512
        symbol = get_symtab_entry(symaddr);
530
        symbol = get_symtab_entry(symaddr);
-
 
531
 
513
        printf("Calling f(0x%zX): %.*p: %s\n", arg1, sizeof(__address) * 2, symaddr, symbol);
532
        printf("Calling f(0x%zX): %.*p: %s\n", arg1, sizeof(__address) * 2, symaddr, symbol);
-
 
533
#ifdef ia64
-
 
534
        fptr.f = symaddr;
-
 
535
        fptr.gp = ((__native *)cmd_call2)[1];
-
 
536
        f =  (__native (*)(__native,...)) &fptr;
-
 
537
#else
514
        f =  (__native (*)(__native,...)) symaddr;
538
        f =  (__native (*)(__native,...)) symaddr;
-
 
539
#endif
515
        printf("Result: %#zx\n", f(arg1));
540
        printf("Result: %#zx\n", f(arg1));
516
    }
541
    }
517
   
542
   
518
    return 1;
543
    return 1;
519
}
544
}
520
 
545
 
521
/** Call function with two parameters */
546
/** Call function with two parameters */
522
int cmd_call2(cmd_arg_t *argv)
547
int cmd_call2(cmd_arg_t *argv)
523
{
548
{
524
    __address symaddr;
549
    __address symaddr;
525
    char *symbol;
550
    char *symbol;
526
    __native (*f)(__native,__native,...);
551
    __native (*f)(__native,__native,...);
527
    __native arg1 = argv[1].intval;
552
    __native arg1 = argv[1].intval;
528
    __native arg2 = argv[2].intval;
553
    __native arg2 = argv[2].intval;
-
 
554
#ifdef ia64
-
 
555
    struct {
-
 
556
        __native f;
-
 
557
        __native gp;
-
 
558
    }fptr;
-
 
559
#endif
529
 
560
 
530
    symaddr = get_symbol_addr(argv->buffer);
561
    symaddr = get_symbol_addr(argv->buffer);
531
    if (!symaddr)
562
    if (!symaddr)
532
        printf("Symbol %s not found.\n", argv->buffer);
563
        printf("Symbol %s not found.\n", argv->buffer);
533
    else if (symaddr == (__address) -1) {
564
    else if (symaddr == (__address) -1) {
534
        symtab_print_search(argv->buffer);
565
        symtab_print_search(argv->buffer);
535
        printf("Duplicate symbol, be more specific.\n");
566
        printf("Duplicate symbol, be more specific.\n");
536
    } else {
567
    } else {
537
        symbol = get_symtab_entry(symaddr);
568
        symbol = get_symtab_entry(symaddr);
538
        printf("Calling f(0x%zx,0x%zx): %.*p: %s\n",
569
        printf("Calling f(0x%zx,0x%zx): %.*p: %s\n",
539
               arg1, arg2, sizeof(__address) * 2, symaddr, symbol);
570
               arg1, arg2, sizeof(__address) * 2, symaddr, symbol);
-
 
571
#ifdef ia64
-
 
572
        fptr.f = symaddr;
-
 
573
        fptr.gp = ((__native *)cmd_call2)[1];
-
 
574
        f =  (__native (*)(__native,__native,...)) &fptr;
-
 
575
#else
540
        f =  (__native (*)(__native,__native,...)) symaddr;
576
        f =  (__native (*)(__native,__native,...)) symaddr;
-
 
577
#endif
541
        printf("Result: %#zx\n", f(arg1, arg2));
578
        printf("Result: %#zx\n", f(arg1, arg2));
542
    }
579
    }
543
   
580
   
544
    return 1;
581
    return 1;
545
}
582
}
546
 
583
 
547
/** Call function with three parameters */
584
/** Call function with three parameters */
548
int cmd_call3(cmd_arg_t *argv)
585
int cmd_call3(cmd_arg_t *argv)
549
{
586
{
550
    __address symaddr;
587
    __address symaddr;
551
    char *symbol;
588
    char *symbol;
552
    __native (*f)(__native,__native,__native,...);
589
    __native (*f)(__native,__native,__native,...);
553
    __native arg1 = argv[1].intval;
590
    __native arg1 = argv[1].intval;
554
    __native arg2 = argv[2].intval;
591
    __native arg2 = argv[2].intval;
555
    __native arg3 = argv[3].intval;
592
    __native arg3 = argv[3].intval;
-
 
593
#ifdef ia64
-
 
594
    struct {
-
 
595
        __native f;
-
 
596
        __native gp;
-
 
597
    }fptr;
-
 
598
#endif
556
 
599
 
557
    symaddr = get_symbol_addr(argv->buffer);
600
    symaddr = get_symbol_addr(argv->buffer);
558
    if (!symaddr)
601
    if (!symaddr)
559
        printf("Symbol %s not found.\n", argv->buffer);
602
        printf("Symbol %s not found.\n", argv->buffer);
560
    else if (symaddr == (__address) -1) {
603
    else if (symaddr == (__address) -1) {
561
        symtab_print_search(argv->buffer);
604
        symtab_print_search(argv->buffer);
562
        printf("Duplicate symbol, be more specific.\n");
605
        printf("Duplicate symbol, be more specific.\n");
563
    } else {
606
    } else {
564
        symbol = get_symtab_entry(symaddr);
607
        symbol = get_symtab_entry(symaddr);
565
        printf("Calling f(0x%zx,0x%zx, 0x%zx): %.*p: %s\n",
608
        printf("Calling f(0x%zx,0x%zx, 0x%zx): %.*p: %s\n",
566
               arg1, arg2, arg3, sizeof(__address) * 2, symaddr, symbol);
609
               arg1, arg2, arg3, sizeof(__address) * 2, symaddr, symbol);
-
 
610
#ifdef ia64
-
 
611
        fptr.f = symaddr;
-
 
612
        fptr.gp = ((__native *)cmd_call2)[1];
-
 
613
        f =  (__native (*)(__native,__native,__native,...)) &fptr;
-
 
614
#else
567
        f =  (__native (*)(__native,__native,__native,...)) symaddr;
615
        f =  (__native (*)(__native,__native,__native,...)) symaddr;
-
 
616
#endif
568
        printf("Result: %#zx\n", f(arg1, arg2, arg3));
617
        printf("Result: %#zx\n", f(arg1, arg2, arg3));
569
    }
618
    }
570
   
619
   
571
    return 1;
620
    return 1;
572
}
621
}
573
 
622
 
574
 
623
 
575
/** Print detailed description of 'describe' command. */
624
/** Print detailed description of 'describe' command. */
576
void desc_help(void)
625
void desc_help(void)
577
{
626
{
578
    printf("Syntax: describe command_name\n");
627
    printf("Syntax: describe command_name\n");
579
}
628
}
580
 
629
 
581
/** Halt the kernel.
630
/** Halt the kernel.
582
 *
631
 *
583
 * @param argv Argument vector (ignored).
632
 * @param argv Argument vector (ignored).
584
 *
633
 *
585
 * @return 0 on failure, 1 on success (never returns).
634
 * @return 0 on failure, 1 on success (never returns).
586
 */
635
 */
587
int cmd_halt(cmd_arg_t *argv)
636
int cmd_halt(cmd_arg_t *argv)
588
{
637
{
589
    halt();
638
    halt();
590
    return 1;
639
    return 1;
591
}
640
}
592
 
641
 
593
/** Command for printing TLB contents.
642
/** Command for printing TLB contents.
594
 *
643
 *
595
 * @param argv Not used.
644
 * @param argv Not used.
596
 *
645
 *
597
 * @return Always returns 1.
646
 * @return Always returns 1.
598
 */
647
 */
599
int cmd_tlb(cmd_arg_t *argv)
648
int cmd_tlb(cmd_arg_t *argv)
600
{
649
{
601
    tlb_print();
650
    tlb_print();
602
    return 1;
651
    return 1;
603
}
652
}
604
 
653
 
605
/** Write 4 byte value to address */
654
/** Write 4 byte value to address */
606
int cmd_set4(cmd_arg_t *argv)
655
int cmd_set4(cmd_arg_t *argv)
607
{
656
{
608
    __u32 *addr ;
657
    __u32 *addr ;
609
    __u32 arg1 = argv[1].intval;
658
    __u32 arg1 = argv[1].intval;
610
    bool pointer = false;
659
    bool pointer = false;
611
 
660
 
612
    if (((char *)argv->buffer)[0] == '*') {
661
    if (((char *)argv->buffer)[0] == '*') {
613
        addr = (__u32 *) get_symbol_addr(argv->buffer+1);
662
        addr = (__u32 *) get_symbol_addr(argv->buffer+1);
614
        pointer = true;
663
        pointer = true;
615
    } else if (((char *)argv->buffer)[0] >= '0' &&
664
    } else if (((char *)argv->buffer)[0] >= '0' &&
616
           ((char *)argv->buffer)[0] <= '9')
665
           ((char *)argv->buffer)[0] <= '9')
617
        addr = (__u32 *)atoi((char *)argv->buffer);
666
        addr = (__u32 *)atoi((char *)argv->buffer);
618
    else
667
    else
619
        addr = (__u32 *)get_symbol_addr(argv->buffer);
668
        addr = (__u32 *)get_symbol_addr(argv->buffer);
620
 
669
 
621
    if (!addr)
670
    if (!addr)
622
        printf("Symbol %s not found.\n", argv->buffer);
671
        printf("Symbol %s not found.\n", argv->buffer);
623
    else if (addr == (__u32 *) -1) {
672
    else if (addr == (__u32 *) -1) {
624
        symtab_print_search(argv->buffer);
673
        symtab_print_search(argv->buffer);
625
        printf("Duplicate symbol, be more specific.\n");
674
        printf("Duplicate symbol, be more specific.\n");
626
    } else {
675
    } else {
627
        if (pointer)
676
        if (pointer)
628
            addr = (__u32 *)(*(__native *)addr);
677
            addr = (__u32 *)(*(__native *)addr);
629
        printf("Writing 0x%x -> %.*p\n", arg1, sizeof(__address) * 2, addr);
678
        printf("Writing 0x%x -> %.*p\n", arg1, sizeof(__address) * 2, addr);
630
        *addr = arg1;
679
        *addr = arg1;
631
       
680
       
632
    }
681
    }
633
   
682
   
634
    return 1;
683
    return 1;
635
}
684
}
636
 
685
 
637
/** Command for listings SLAB caches
686
/** Command for listings SLAB caches
638
 *
687
 *
639
 * @param argv Ignores
688
 * @param argv Ignores
640
 *
689
 *
641
 * @return Always 1
690
 * @return Always 1
642
 */
691
 */
643
int cmd_slabs(cmd_arg_t * argv) {
692
int cmd_slabs(cmd_arg_t * argv) {
644
    slab_print_list();
693
    slab_print_list();
645
    return 1;
694
    return 1;
646
}
695
}
647
 
696
 
648
 
697
 
649
/** Command for listings Thread information
698
/** Command for listings Thread information
650
 *
699
 *
651
 * @param argv Ignores
700
 * @param argv Ignores
652
 *
701
 *
653
 * @return Always 1
702
 * @return Always 1
654
 */
703
 */
655
int cmd_threads(cmd_arg_t * argv) {
704
int cmd_threads(cmd_arg_t * argv) {
656
    thread_print_list();
705
    thread_print_list();
657
    return 1;
706
    return 1;
658
}
707
}
659
 
708
 
660
/** Command for listings Task information
709
/** Command for listings Task information
661
 *
710
 *
662
 * @param argv Ignores
711
 * @param argv Ignores
663
 *
712
 *
664
 * @return Always 1
713
 * @return Always 1
665
 */
714
 */
666
int cmd_tasks(cmd_arg_t * argv) {
715
int cmd_tasks(cmd_arg_t * argv) {
667
    task_print_list();
716
    task_print_list();
668
    return 1;
717
    return 1;
669
}
718
}
670
 
719
 
671
/** Command for listings Thread information
720
/** Command for listings Thread information
672
 *
721
 *
673
 * @param argv Ignores
722
 * @param argv Ignores
674
 *
723
 *
675
 * @return Always 1
724
 * @return Always 1
676
 */
725
 */
677
int cmd_sched(cmd_arg_t * argv) {
726
int cmd_sched(cmd_arg_t * argv) {
678
    sched_print_list();
727
    sched_print_list();
679
    return 1;
728
    return 1;
680
}
729
}
681
 
730
 
682
/** Command for listing memory zones
731
/** Command for listing memory zones
683
 *
732
 *
684
 * @param argv Ignored
733
 * @param argv Ignored
685
 *
734
 *
686
 * return Always 1
735
 * return Always 1
687
 */
736
 */
688
int cmd_zones(cmd_arg_t * argv) {
737
int cmd_zones(cmd_arg_t * argv) {
689
    zone_print_list();
738
    zone_print_list();
690
    return 1;
739
    return 1;
691
}
740
}
692
 
741
 
693
/** Command for memory zone details
742
/** Command for memory zone details
694
 *
743
 *
695
 * @param argv Integer argument from cmdline expected
744
 * @param argv Integer argument from cmdline expected
696
 *
745
 *
697
 * return Always 1
746
 * return Always 1
698
 */
747
 */
699
int cmd_zone(cmd_arg_t * argv) {
748
int cmd_zone(cmd_arg_t * argv) {
700
    zone_print_one(argv[0].intval);
749
    zone_print_one(argv[0].intval);
701
    return 1;
750
    return 1;
702
}
751
}
703
 
752
 
704
/** Command for printing task ipc details
753
/** Command for printing task ipc details
705
 *
754
 *
706
 * @param argv Integer argument from cmdline expected
755
 * @param argv Integer argument from cmdline expected
707
 *
756
 *
708
 * return Always 1
757
 * return Always 1
709
 */
758
 */
710
int cmd_ipc_task(cmd_arg_t * argv) {
759
int cmd_ipc_task(cmd_arg_t * argv) {
711
    ipc_print_task(argv[0].intval);
760
    ipc_print_task(argv[0].intval);
712
    return 1;
761
    return 1;
713
}
762
}
714
 
763
 
715
 
764
 
716
/** Command for listing processors.
765
/** Command for listing processors.
717
 *
766
 *
718
 * @param argv Ignored.
767
 * @param argv Ignored.
719
 *
768
 *
720
 * return Always 1.
769
 * return Always 1.
721
 */
770
 */
722
int cmd_cpus(cmd_arg_t *argv)
771
int cmd_cpus(cmd_arg_t *argv)
723
{
772
{
724
    cpu_list();
773
    cpu_list();
725
    return 1;
774
    return 1;
726
}
775
}
727
 
776
 
728
/** Command for printing kernel version.
777
/** Command for printing kernel version.
729
 *
778
 *
730
 * @param argv Ignored.
779
 * @param argv Ignored.
731
 *
780
 *
732
 * return Always 1.
781
 * return Always 1.
733
 */
782
 */
734
int cmd_version(cmd_arg_t *argv)
783
int cmd_version(cmd_arg_t *argv)
735
{
784
{
736
    version_print();
785
    version_print();
737
    return 1;
786
    return 1;
738
}
787
}
739
 
788
 
740
/** Command for returning console back to userspace.
789
/** Command for returning console back to userspace.
741
 *
790
 *
742
 * @param argv Ignored.
791
 * @param argv Ignored.
743
 *
792
 *
744
 * return Always 1.
793
 * return Always 1.
745
 */
794
 */
746
int cmd_continue(cmd_arg_t *argv)
795
int cmd_continue(cmd_arg_t *argv)
747
{
796
{
748
    arch_release_console();
797
    arch_release_console();
749
    return 1;
798
    return 1;
750
}
799
}
751
 
800