Lines Matching +full:em +full:- +full:sti
8 * Copyright (C) 1999-2004 Silicon Graphics, Inc. All Rights Reserved.
71 int kdb_initial_cpu = -1; /* cpu number that owns kdb */
135 * mechanisms in the kernel, so we use a very limited allocate-only
167 * the user on first-time debugger entry.
198 /* De-compose KDB_ENABLE_ALL if required */ in kdb_check_for_lockdown()
231 * kdbgetenv - This function will return the character string value of
262 * kdballocenv - This function is used to allocate bytes for
283 if ((KDB_ENVBUFSIZE - envbufsize) >= bytes) { in kdballocenv()
291 * kdbgetulenv - This function will return the value of an unsigned
292 * long-valued environment variable.
316 * kdbgetintenv - This function will return the value of an
317 * integer-valued environment variable.
319 * match A character string representing an integer-valued env variable
337 * kdb_setenv() - Alter an existing environment variable or create a new one.
370 for (i = 0; i < __nenv-1; i++) { in kdb_setenv()
381 * kdb_printenv() - Display the current environment variables.
394 * kdbgetularg - This function will convert a numeric string into an
418 * kdb_set - This function implements the 'set' command. Alter an
427 * - if the latter, shift 'em down. in kdb_set()
431 argc--; in kdb_set()
481 * kdbgetaddrarg - This function is responsible for parsing an
482 * address-expression and returning the value of the expression,
489 * consisting of a symbol name, +/-, and a numeric constant value
492 * argc - count of arguments in argv
493 * argv - argument vector
494 * *nextarg - index to next unparsed argument in argv[]
495 * regs - Register state at time of KDB entry
497 * *value - receives the value of the address-expression
498 * *offset - receives the offset specified, if any
499 * *name - receives the symbol name, if any
500 * *nextarg - index to next unparsed argument in argv[]
531 * symbol | numeric-address [+/- numeric-offset] in kdbgetaddrarg()
533 * $environment-variable in kdbgetaddrarg()
543 * or address and the '+' or '-' symbols, we in kdbgetaddrarg()
547 cp = strpbrk(symname, "+-"); in kdbgetaddrarg()
586 *offset = addr - symtab.sym_start; in kdbgetaddrarg()
593 * check for +/- and offset in kdbgetaddrarg()
598 && (argv[*nextarg][0] != '-')) { in kdbgetaddrarg()
628 off = -off; in kdbgetaddrarg()
655 kdb_printf("Unknown diag %d\n", -diag); in kdb_cmderror()
659 * kdb_defcmd, kdb_defcmd2 - This function implements the 'defcmd'
695 if (!list_empty(&kdb_macro->statements)) in kdb_defcmd2()
696 kdb_register(&kdb_macro->cmd); in kdb_defcmd2()
707 kms->statement = kdb_strdup(cmdstr, GFP_KDB); in kdb_defcmd2()
708 list_add_tail(&kms->list_node, &kdb_macro->statements); in kdb_defcmd2()
728 if (kp->func == kdb_exec_defcmd) { in kdb_defcmd()
730 kp->name, kp->usage, kp->help); in kdb_defcmd()
732 list_for_each_entry(kms, &kmp->statements, in kdb_defcmd()
734 kdb_printf("%s", kms->statement); in kdb_defcmd()
750 mp = &kdb_macro->cmd; in kdb_defcmd()
751 mp->func = kdb_exec_defcmd; in kdb_defcmd()
752 mp->minlen = 0; in kdb_defcmd()
753 mp->flags = KDB_ENABLE_ALWAYS_SAFE; in kdb_defcmd()
754 mp->name = kdb_strdup(argv[1], GFP_KDB); in kdb_defcmd()
755 if (!mp->name) in kdb_defcmd()
757 mp->usage = kdb_strdup(argv[2], GFP_KDB); in kdb_defcmd()
758 if (!mp->usage) in kdb_defcmd()
760 mp->help = kdb_strdup(argv[3], GFP_KDB); in kdb_defcmd()
761 if (!mp->help) in kdb_defcmd()
763 if (mp->usage[0] == '"') { in kdb_defcmd()
764 strcpy(mp->usage, argv[2]+1); in kdb_defcmd()
765 mp->usage[strlen(mp->usage)-1] = '\0'; in kdb_defcmd()
767 if (mp->help[0] == '"') { in kdb_defcmd()
768 strcpy(mp->help, argv[3]+1); in kdb_defcmd()
769 mp->help[strlen(mp->help)-1] = '\0'; in kdb_defcmd()
772 INIT_LIST_HEAD(&kdb_macro->statements); in kdb_defcmd()
776 kfree(mp->usage); in kdb_defcmd()
778 kfree(mp->name); in kdb_defcmd()
787 * kdb_exec_defcmd - Execute the set of commands associated with this
806 if (strcmp(kp->name, argv[0]) == 0) in kdb_exec_defcmd()
815 list_for_each_entry(kms, &kmp->statements, list_node) { in kdb_exec_defcmd()
820 kdb_printf("[%s]kdb> %s\n", kmp->cmd.name, kms->statement); in kdb_exec_defcmd()
821 ret = kdb_parse(kms->statement); in kdb_exec_defcmd()
868 /* allow it be "x y z" by removing the "'s - there must in parse_grep()
885 if (*(cp+len-1) == '$') { in parse_grep()
887 *(cp+len-1) = '\0'; in parse_grep()
902 * kdb_parse - Parse the command line, search the command table for a
923 * the token is altered in-place to a null-byte to terminate the
973 if (argc >= MAXARGC - 1) { in kdb_parse()
1021 if (argv[0][0] == '-' && argv[0][1] && in kdb_parse()
1032 if (tp->minlen && (strlen(argv[0]) <= tp->minlen) && in kdb_parse()
1033 (strncmp(argv[0], tp->name, tp->minlen) == 0)) in kdb_parse()
1036 if (strcmp(argv[0], tp->name) == 0) in kdb_parse()
1047 if (strncmp(argv[0], tp->name, strlen(tp->name)) == 0) in kdb_parse()
1055 if (!kdb_check_flags(tp->flags, kdb_cmd_enabled, argc <= 1)) in kdb_parse()
1059 result = (*tp->func)(argc-1, (const char **)argv); in kdb_parse()
1064 if (tp->flags & KDB_REPEAT_WITH_ARGS) in kdb_parse()
1067 argc = tp->flags & KDB_REPEAT_NO_ARGS ? 1 : 0; in kdb_parse()
1110 cmdptr = (cmdptr + KDB_CMD_HISTORY_COUNT - 1) % in handle_ctrl_cmd()
1124 * kdb_reboot - This function implements the 'reboot' command. Reboot
1143 kdb_trap_printk--; in kdb_dumpregs()
1165 if (*(buf + len - 1) == '\n') in drop_newline()
1166 *(buf + len - 1) = '\0'; in drop_newline()
1170 * kdb_local - The main code for kdb. This routine is invoked on a
1178 * error The hardware-defined error code
1205 kdb_current, kdb_current ? kdb_current->pid : 0); in kdb_local()
1215 * If re-entering kdb after a single step in kdb_local()
1221 kdb_current, kdb_current->pid); in kdb_local()
1325 strlen(cmd_hist[cmd_head])-1) = '\0'; in kdb_local()
1328 *(cmd_cur+strlen(cmd_cur)-1) = '\0'; in kdb_local()
1363 * kdb_print_state - Print the state data for the current processor
1377 * kdb_main_loop - After initial setup and assignment of the
1390 * error The hardware-defined error code
1459 * kdb_mdr - This function implements the guts of the 'mdr', memory
1471 while (count--) { in kdb_mdr()
1482 * kdb_md - This function implements the 'md', 'md1', 'md2', 'md4',
1509 for (i = 0; i < num && repeat--; i++) { in kdb_md_line()
1539 cp = wc.c + 8 - bytesperword; in kdb_md_line()
1552 kdb_printf("%*s %s\n", (int)((num-i)*(2*bytesperword + 1)+1), in kdb_md_line()
1584 bytesperword = (int)(argv[0][2] - '0'); in kdb_md()
1712 addr &= ~(bytesperword-1); in kdb_md()
1732 repeat -= n; in kdb_md()
1733 z = (z + num - 1) / num; in kdb_md()
1735 int s = num * (z-2); in kdb_md()
1736 kdb_printf(kdb_machreg_fmt0 "-" kdb_machreg_fmt0 in kdb_md()
1738 addr, addr + bytesperword * s - 1); in kdb_md()
1740 repeat -= s; in kdb_md()
1749 * kdb_mm - This function implements the 'mm' command.
1750 * mm address-expression new-value
1783 width = argv[0][2] ? (argv[0][2] - '0') : (KDB_WORD_SIZE); in kdb_mm()
1794 * kdb_go - This function implements the 'go' command.
1795 * go [address-expression]
1840 * kdb_rd - This function implements the 'rd' command.
1907 * kdb_rm - This function implements the 'rm' (register modify) command.
1908 * rm register-name new-contents
1975 * kdb_sr - This function implements the 'sr' (SYSRQ key) command
1976 * which interfaces to the soi-disant MAGIC SYSRQ functionality.
1977 * sr <magic-sysrq-code>
1989 kdb_trap_printk--; in kdb_sr()
1996 * kdb_ef - This function implements the 'regs' (display exception
2000 * regs address-expression
2023 * kdb_env - This function implements the 'env' command. Display the
2040 * kdb_dmesg - This function implements the 'dmesg' command to display
2080 else if (adjust - lines >= n) in kdb_dmesg()
2082 "lines printed\n", n, n - adjust); in kdb_dmesg()
2086 skip = n - lines - adjust; in kdb_dmesg()
2108 skip--; in kdb_dmesg()
2111 if (!lines--) in kdb_dmesg()
2116 kdb_printf("%.*s\n", (int)len - 1, buf); in kdb_dmesg()
2137 if (!atomic_add_unless(&kdb_nmi_disabled, -1, 0)) in kdb_param_enable_nmi()
2138 return -EINVAL; in kdb_param_enable_nmi()
2149 * kdb_cpu - This function implements the 'cpu' command.
2161 for (start_cpu = -1, i = 0; i < NR_CPUS; i++) { in kdb_cpu_status()
2168 if (kdb_task_state_char(KDB_TSK(i)) == '-') in kdb_cpu_status()
2169 state = '-'; /* idle task */ in kdb_cpu_status()
2177 if (start_cpu < i-1) in kdb_cpu_status()
2178 kdb_printf("-%d", i-1); in kdb_cpu_status()
2191 if (start_cpu < i-1) in kdb_cpu_status()
2192 kdb_printf("-%d", i-1); in kdb_cpu_status()
2240 if (kdb_task_state(p, "-")) in kdb_ps_suppressed()
2249 kdb_printf("%d idle process%s (state -)%s\n", in kdb_ps_suppressed()
2271 (void *)p, p->pid, p->parent->pid, in kdb_ps1()
2274 (void *)(&p->thread), in kdb_ps1()
2276 p->comm); in kdb_ps1()
2289 * kdb_ps - This function implements the 'ps' command which shows a
2303 kdb_printf("%-*s Pid Parent [*] cpu State %-*s Command\n", in kdb_ps()
2328 * kdb_pid - This function implements the 'pid' command which switches
2358 kdb_current_task->comm, in kdb_pid()
2359 kdb_current_task->pid); in kdb_pid()
2370 * kdb_help - This function implements the 'help' and '?' commands.
2376 kdb_printf("%-15.15s %-20.20s %s\n", "Command", "Usage", "Description"); in kdb_help()
2377 kdb_printf("-----------------------------" in kdb_help()
2378 "-----------------------------\n"); in kdb_help()
2383 if (!kdb_check_flags(kt->flags, kdb_cmd_enabled, true)) in kdb_help()
2385 if (strlen(kt->usage) > 20) in kdb_help()
2387 kdb_printf("%-15.15s %-20s%s%s\n", kt->name, in kdb_help()
2388 kt->usage, space, kt->help); in kdb_help()
2394 * kdb_kill - This function implements the 'kill' commands.
2406 if ((sig >= 0) || !valid_signal(-sig)) { in kdb_kill()
2407 kdb_printf("Invalid signal parameter.<-signal>\n"); in kdb_kill()
2410 sig = -sig; in kdb_kill()
2425 p = p->group_leader; in kdb_kill()
2433 * cli()/sti() and calls routines that take locks which can stop the debugger.
2440 val->uptime = div_u64(uptime, NSEC_PER_SEC); in kdb_sysinfo()
2441 val->loads[0] = avenrun[0]; in kdb_sysinfo()
2442 val->loads[1] = avenrun[1]; in kdb_sysinfo()
2443 val->loads[2] = avenrun[2]; in kdb_sysinfo()
2444 val->procs = nr_threads-1; in kdb_sysinfo()
2451 * kdb_summary - This function implements the 'summary' command.
2485 #define K(x) ((x) << (PAGE_SHIFT - 10)) in kdb_summary()
2493 * kdb_per_cpu - This function implements the 'per_cpu' command.
2549 kdb_printf("%5d " kdb_bfd_vma_fmt0 " - unable to " in kdb_per_cpu()
2582 * kdb_register() - This function is used to register a kernel debugger
2594 if (strcmp(kp->name, cmd->name) == 0) { in kdb_register()
2596 cmd->name, cmd->func, cmd->help); in kdb_register()
2601 list_add_tail(&cmd->list_node, &kdb_cmds_head); in kdb_register()
2607 * kdb_register_table() - This function is used to register a kdb command
2614 while (len--) { in kdb_register_table()
2615 list_add_tail(&kp->list_node, &kdb_cmds_head); in kdb_register_table()
2621 * kdb_unregister() - This function is used to unregister a kernel debugger
2628 list_del(&cmd->list_node); in kdb_unregister()
2806 * internal command re-enters kdb_parse() and is safety
2813 .usage = "<-signal> <pid>",