Subversion Repositories HelenOS-historic

Rev

Rev 1695 | Rev 1712 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1695 Rev 1702
Line 24... Line 24...
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
 /** @addtogroup genericconsole
-
 
30
 * @{
-
 
31
 */
-
 
32
 
29
/**
33
/**
30
 * @file    cmd.c
34
 * @file    cmd.c
31
 * @brief   Kernel console command wrappers.
35
 * @brief   Kernel console command wrappers.
32
 *
36
 *
33
 * This file is meant to contain all wrapper functions for
37
 * This file is meant to contain all wrapper functions for
Line 58... Line 62...
58
#include <proc/scheduler.h>
62
#include <proc/scheduler.h>
59
#include <proc/thread.h>
63
#include <proc/thread.h>
60
#include <proc/task.h>
64
#include <proc/task.h>
61
#include <ipc/ipc.h>
65
#include <ipc/ipc.h>
62
 
66
 
63
/** Data and methods for 'help' command. */
67
/* Data and methods for 'help' command. */
64
static int cmd_help(cmd_arg_t *argv);
68
static int cmd_help(cmd_arg_t *argv);
65
static cmd_info_t help_info = {
69
static cmd_info_t help_info = {
66
    .name = "help",
70
    .name = "help",
67
    .description = "List of supported commands.",
71
    .description = "List of supported commands.",
68
    .func = cmd_help,
72
    .func = cmd_help,
Line 81... Line 85...
81
    .description ="Return console back to userspace.",
85
    .description ="Return console back to userspace.",
82
    .func = cmd_continue,
86
    .func = cmd_continue,
83
    .argc = 0
87
    .argc = 0
84
};
88
};
85
 
89
 
86
/** Data and methods for 'description' command. */
90
/* Data and methods for 'description' command. */
87
static int cmd_desc(cmd_arg_t *argv);
91
static int cmd_desc(cmd_arg_t *argv);
88
static void desc_help(void);
92
static void desc_help(void);
89
static char desc_buf[MAX_CMDLINE+1];
93
static char desc_buf[MAX_CMDLINE+1];
90
static cmd_arg_t desc_argv = {
94
static cmd_arg_t desc_argv = {
91
    .type = ARG_TYPE_STRING,
95
    .type = ARG_TYPE_STRING,
Line 99... Line 103...
99
    .func = cmd_desc,
103
    .func = cmd_desc,
100
    .argc = 1,
104
    .argc = 1,
101
    .argv = &desc_argv
105
    .argv = &desc_argv
102
};
106
};
103
 
107
 
104
/** Data and methods for 'symaddr' command. */
108
/* Data and methods for 'symaddr' command. */
105
static int cmd_symaddr(cmd_arg_t *argv);
109
static int cmd_symaddr(cmd_arg_t *argv);
106
static char symaddr_buf[MAX_CMDLINE+1];
110
static char symaddr_buf[MAX_CMDLINE+1];
107
static cmd_arg_t symaddr_argv = {
111
static cmd_arg_t symaddr_argv = {
108
    .type = ARG_TYPE_STRING,
112
    .type = ARG_TYPE_STRING,
109
    .buffer = symaddr_buf,
113
    .buffer = symaddr_buf,
Line 135... Line 139...
135
    .func = cmd_set4,
139
    .func = cmd_set4,
136
    .argc = 2,
140
    .argc = 2,
137
    .argv = set4_argv
141
    .argv = set4_argv
138
};
142
};
139
 
143
 
140
/** Data and methods for 'call0' command. */
144
/* Data and methods for 'call0' command. */
141
static char call0_buf[MAX_CMDLINE+1];
145
static char call0_buf[MAX_CMDLINE+1];
142
static char carg1_buf[MAX_CMDLINE+1];
146
static char carg1_buf[MAX_CMDLINE+1];
143
static char carg2_buf[MAX_CMDLINE+1];
147
static char carg2_buf[MAX_CMDLINE+1];
144
static char carg3_buf[MAX_CMDLINE+1];
148
static char carg3_buf[MAX_CMDLINE+1];
145
 
149
 
Line 155... Line 159...
155
    .func = cmd_call0,
159
    .func = cmd_call0,
156
    .argc = 1,
160
    .argc = 1,
157
    .argv = &call0_argv
161
    .argv = &call0_argv
158
};
162
};
159
 
163
 
160
/** Data and methods for 'call1' command. */
164
/* Data and methods for 'call1' command. */
161
static int cmd_call1(cmd_arg_t *argv);
165
static int cmd_call1(cmd_arg_t *argv);
162
static cmd_arg_t call1_argv[] = {
166
static cmd_arg_t call1_argv[] = {
163
    {
167
    {
164
        .type = ARG_TYPE_STRING,
168
        .type = ARG_TYPE_STRING,
165
        .buffer = call0_buf,
169
        .buffer = call0_buf,
Line 177... Line 181...
177
    .func = cmd_call1,
181
    .func = cmd_call1,
178
    .argc = 2,
182
    .argc = 2,
179
    .argv = call1_argv
183
    .argv = call1_argv
180
};
184
};
181
 
185
 
182
/** Data and methods for 'call2' command. */
186
/* Data and methods for 'call2' command. */
183
static int cmd_call2(cmd_arg_t *argv);
187
static int cmd_call2(cmd_arg_t *argv);
184
static cmd_arg_t call2_argv[] = {
188
static cmd_arg_t call2_argv[] = {
185
    {
189
    {
186
        .type = ARG_TYPE_STRING,
190
        .type = ARG_TYPE_STRING,
187
        .buffer = call0_buf,
191
        .buffer = call0_buf,
Line 204... Line 208...
204
    .func = cmd_call2,
208
    .func = cmd_call2,
205
    .argc = 3,
209
    .argc = 3,
206
    .argv = call2_argv
210
    .argv = call2_argv
207
};
211
};
208
 
212
 
209
/** Data and methods for 'call3' command. */
213
/* Data and methods for 'call3' command. */
210
static int cmd_call3(cmd_arg_t *argv);
214
static int cmd_call3(cmd_arg_t *argv);
211
static cmd_arg_t call3_argv[] = {
215
static cmd_arg_t call3_argv[] = {
212
    {
216
    {
213
        .type = ARG_TYPE_STRING,
217
        .type = ARG_TYPE_STRING,
214
        .buffer = call0_buf,
218
        .buffer = call0_buf,
Line 237... Line 241...
237
    .func = cmd_call3,
241
    .func = cmd_call3,
238
    .argc = 4,
242
    .argc = 4,
239
    .argv = call3_argv
243
    .argv = call3_argv
240
};
244
};
241
 
245
 
242
/** Data and methods for 'halt' command. */
246
/* Data and methods for 'halt' command. */
243
static int cmd_halt(cmd_arg_t *argv);
247
static int cmd_halt(cmd_arg_t *argv);
244
static cmd_info_t halt_info = {
248
static cmd_info_t halt_info = {
245
    .name = "halt",
249
    .name = "halt",
246
    .description = "Halt the kernel.",
250
    .description = "Halt the kernel.",
247
    .func = cmd_halt,
251
    .func = cmd_halt,
248
    .argc = 0
252
    .argc = 0
249
};
253
};
250
 
254
 
251
/** Data and methods for 'tlb' command. */
255
/* Data and methods for 'tlb' command. */
252
static int cmd_tlb(cmd_arg_t *argv);
256
static int cmd_tlb(cmd_arg_t *argv);
253
cmd_info_t tlb_info = {
257
cmd_info_t tlb_info = {
254
    .name = "tlb",
258
    .name = "tlb",
255
    .description = "Print TLB of current processor.",
259
    .description = "Print TLB of current processor.",
256
    .help = NULL,
260
    .help = NULL,
Line 290... Line 294...
290
    .description = "List slab caches.",
294
    .description = "List slab caches.",
291
    .func = cmd_slabs,
295
    .func = cmd_slabs,
292
    .argc = 0
296
    .argc = 0
293
};
297
};
294
 
298
 
295
/** Data and methods for 'zones' command */
299
/* Data and methods for 'zones' command */
296
static int cmd_zones(cmd_arg_t *argv);
300
static int cmd_zones(cmd_arg_t *argv);
297
static cmd_info_t zones_info = {
301
static cmd_info_t zones_info = {
298
    .name = "zones",
302
    .name = "zones",
299
    .description = "List of memory zones.",
303
    .description = "List of memory zones.",
300
    .func = cmd_zones,
304
    .func = cmd_zones,
301
    .argc = 0
305
    .argc = 0
302
};
306
};
303
 
307
 
304
/** Data and methods for 'ipc_task' command */
308
/* Data and methods for 'ipc_task' command */
305
static int cmd_ipc_task(cmd_arg_t *argv);
309
static int cmd_ipc_task(cmd_arg_t *argv);
306
static cmd_arg_t ipc_task_argv = {
310
static cmd_arg_t ipc_task_argv = {
307
    .type = ARG_TYPE_INT,
311
    .type = ARG_TYPE_INT,
308
};
312
};
309
static cmd_info_t ipc_task_info = {
313
static cmd_info_t ipc_task_info = {
Line 312... Line 316...
312
    .func = cmd_ipc_task,
316
    .func = cmd_ipc_task,
313
    .argc = 1,
317
    .argc = 1,
314
    .argv = &ipc_task_argv
318
    .argv = &ipc_task_argv
315
};
319
};
316
 
320
 
317
/** Data and methods for 'zone' command */
321
/* Data and methods for 'zone' command */
318
static int cmd_zone(cmd_arg_t *argv);
322
static int cmd_zone(cmd_arg_t *argv);
319
static cmd_arg_t zone_argv = {
323
static cmd_arg_t zone_argv = {
320
    .type = ARG_TYPE_INT,
324
    .type = ARG_TYPE_INT,
321
};
325
};
322
 
326
 
Line 326... Line 330...
326
    .func = cmd_zone,
330
    .func = cmd_zone,
327
    .argc = 1,
331
    .argc = 1,
328
    .argv = &zone_argv
332
    .argv = &zone_argv
329
};
333
};
330
 
334
 
331
/** Data and methods for 'cpus' command. */
335
/* Data and methods for 'cpus' command. */
332
static int cmd_cpus(cmd_arg_t *argv);
336
static int cmd_cpus(cmd_arg_t *argv);
333
cmd_info_t cpus_info = {
337
cmd_info_t cpus_info = {
334
    .name = "cpus",
338
    .name = "cpus",
335
    .description = "List all processors.",
339
    .description = "List all processors.",
336
    .help = NULL,
340
    .help = NULL,
337
    .func = cmd_cpus,
341
    .func = cmd_cpus,
338
    .argc = 0,
342
    .argc = 0,
339
    .argv = NULL
343
    .argv = NULL
340
};
344
};
341
 
345
 
342
/** Data and methods for 'version' command. */
346
/* Data and methods for 'version' command. */
343
static int cmd_version(cmd_arg_t *argv);
347
static int cmd_version(cmd_arg_t *argv);
344
cmd_info_t version_info = {
348
cmd_info_t version_info = {
345
    .name = "version",
349
    .name = "version",
346
    .description = "Print version information.",
350
    .description = "Print version information.",
347
    .help = NULL,
351
    .help = NULL,
Line 797... Line 801...
797
    printf("The kernel will now relinquish the console.\n");
801
    printf("The kernel will now relinquish the console.\n");
798
    printf("Use userspace controls to redraw the screen.\n");
802
    printf("Use userspace controls to redraw the screen.\n");
799
    arch_release_console();
803
    arch_release_console();
800
    return 1;
804
    return 1;
801
}
805
}
-
 
806
 
-
 
807
 /** @}
-
 
808
 */
-
 
809