Lines Matching +full:tp +full:- +full:sensitive +full:- +full:adjust

8  * Copyright (C) 1999-2004 Silicon Graphics, Inc.  All Rights Reserved.
71 int kdb_initial_cpu = -1; /* cpu number that owns kdb */
142 * mechanisms in the kernel, so we use a very limited allocate-only
193 if ((task_thread_info(p)->flags & _TIF_MCA_INIT) && KDB_TSK(cpu)) in kdb_curr_task()
194 p = krp->p; in kdb_curr_task()
220 * kdbgetenv - This function will return the character string value of
251 * kdballocenv - This function is used to allocate bytes for
273 if ((KDB_ENVBUFSIZE - envbufsize) >= bytes) { in kdballocenv()
281 * kdbgetulenv - This function will return the value of an unsigned
282 * long-valued environment variable.
306 * kdbgetintenv - This function will return the value of an
307 * integer-valued environment variable.
309 * match A character string representing an integer-valued env variable
327 * kdbgetularg - This function will convert a numeric string into an
378 * kdb_set - This function implements the 'set' command. Alter an
391 * - if the latter, shift 'em down. in kdb_set()
395 argc--; in kdb_set()
402 * Censor sensitive variables in kdb_set()
454 for (i = 0; i < __nenv-1; i++) { in kdb_set()
475 * kdbgetaddrarg - This function is responsible for parsing an
476 * address-expression and returning the value of the expression,
483 * consisting of a symbol name, +/-, and a numeric constant value
486 * argc - count of arguments in argv
487 * argv - argument vector
488 * *nextarg - index to next unparsed argument in argv[]
489 * regs - Register state at time of KDB entry
491 * *value - receives the value of the address-expression
492 * *offset - receives the offset specified, if any
493 * *name - receives the symbol name, if any
494 * *nextarg - index to next unparsed argument in argv[]
525 * symbol | numeric-address [+/- numeric-offset] in kdbgetaddrarg()
527 * $environment-variable in kdbgetaddrarg()
537 * or address and the '+' or '-' symbols, we in kdbgetaddrarg()
541 cp = strpbrk(symname, "+-"); in kdbgetaddrarg()
580 *offset = addr - symtab.sym_start; in kdbgetaddrarg()
587 * check for +/- and offset in kdbgetaddrarg()
592 && (argv[*nextarg][0] != '-')) { in kdbgetaddrarg()
622 off = -off; in kdbgetaddrarg()
649 kdb_printf("Unknown diag %d\n", -diag); in kdb_cmderror()
653 * kdb_defcmd, kdb_defcmd2 - This function implements the 'defcmd'
681 struct defcmd_set *s = defcmd_set + defcmd_set_count - 1; in kdb_defcmd2()
682 char **save_command = s->command; in kdb_defcmd2()
685 if (!s->count) in kdb_defcmd2()
686 s->usable = false; in kdb_defcmd2()
687 if (s->usable) in kdb_defcmd2()
689 * internal command re-enters kdb_parse() and is in kdb_defcmd2()
692 kdb_register_flags(s->name, kdb_exec_defcmd, s->usage, in kdb_defcmd2()
693 s->help, 0, in kdb_defcmd2()
697 if (!s->usable) in kdb_defcmd2()
699 s->command = kcalloc(s->count + 1, sizeof(*(s->command)), GFP_KDB); in kdb_defcmd2()
700 if (!s->command) { in kdb_defcmd2()
703 s->usable = false; in kdb_defcmd2()
706 memcpy(s->command, save_command, s->count * sizeof(*(s->command))); in kdb_defcmd2()
707 s->command[s->count++] = kdb_strdup(cmdstr, GFP_KDB); in kdb_defcmd2()
723 kdb_printf("defcmd %s \"%s\" \"%s\"\n", s->name, in kdb_defcmd()
724 s->usage, s->help); in kdb_defcmd()
725 for (i = 0; i < s->count; ++i) in kdb_defcmd()
726 kdb_printf("%s", s->command[i]); in kdb_defcmd()
745 s->usable = true; in kdb_defcmd()
746 s->name = kdb_strdup(argv[1], GFP_KDB); in kdb_defcmd()
747 if (!s->name) in kdb_defcmd()
749 s->usage = kdb_strdup(argv[2], GFP_KDB); in kdb_defcmd()
750 if (!s->usage) in kdb_defcmd()
752 s->help = kdb_strdup(argv[3], GFP_KDB); in kdb_defcmd()
753 if (!s->help) in kdb_defcmd()
755 if (s->usage[0] == '"') { in kdb_defcmd()
756 strcpy(s->usage, argv[2]+1); in kdb_defcmd()
757 s->usage[strlen(s->usage)-1] = '\0'; in kdb_defcmd()
759 if (s->help[0] == '"') { in kdb_defcmd()
760 strcpy(s->help, argv[3]+1); in kdb_defcmd()
761 s->help[strlen(s->help)-1] = '\0'; in kdb_defcmd()
768 kfree(s->usage); in kdb_defcmd()
770 kfree(s->name); in kdb_defcmd()
780 * kdb_exec_defcmd - Execute the set of commands associated with this
795 if (strcmp(s->name, argv[0]) == 0) in kdb_exec_defcmd()
803 for (i = 0; i < s->count; ++i) { in kdb_exec_defcmd()
807 kdb_printf("[%s]kdb> %s\n", s->name, s->command[i]); in kdb_exec_defcmd()
808 ret = kdb_parse(s->command[i]); in kdb_exec_defcmd()
855 /* allow it be "x y z" by removing the "'s - there must in parse_grep()
872 if (*(cp+len-1) == '$') { in parse_grep()
874 *(cp+len-1) = '\0'; in parse_grep()
889 * kdb_parse - Parse the command line, search the command table for a
910 * the token is altered in-place to a null-byte to terminate the
923 kdbtab_t *tp; in kdb_parse() local
960 if (argc >= MAXARGC - 1) { in kdb_parse()
1008 if (argv[0][0] == '-' && argv[0][1] && in kdb_parse()
1014 for_each_kdbcmd(tp, i) { in kdb_parse()
1015 if (tp->cmd_name) { in kdb_parse()
1021 if (tp->cmd_minlen in kdb_parse()
1022 && (strlen(argv[0]) <= tp->cmd_minlen)) { in kdb_parse()
1024 tp->cmd_name, in kdb_parse()
1025 tp->cmd_minlen) == 0) { in kdb_parse()
1030 if (strcmp(argv[0], tp->cmd_name) == 0) in kdb_parse()
1041 for_each_kdbcmd(tp, i) { in kdb_parse()
1042 if (tp->cmd_name) { in kdb_parse()
1044 tp->cmd_name, in kdb_parse()
1045 strlen(tp->cmd_name)) == 0) { in kdb_parse()
1055 if (!kdb_check_flags(tp->cmd_flags, kdb_cmd_enabled, argc <= 1)) in kdb_parse()
1059 result = (*tp->cmd_func)(argc-1, (const char **)argv); in kdb_parse()
1064 if (tp->cmd_flags & KDB_REPEAT_WITH_ARGS) in kdb_parse()
1067 argc = tp->cmd_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
1202 kdb_current, kdb_current ? kdb_current->pid : 0); in kdb_local()
1212 * If re-entering kdb after a single step in kdb_local()
1218 kdb_current, kdb_current->pid); in kdb_local()
1324 strlen(cmd_hist[cmd_head])-1) = '\0'; in kdb_local()
1327 *(cmd_cur+strlen(cmd_cur)-1) = '\0'; in kdb_local()
1362 * kdb_print_state - Print the state data for the current processor
1376 * kdb_main_loop - After initial setup and assignment of the
1389 * error The hardware-defined error code
1458 * kdb_mdr - This function implements the guts of the 'mdr', memory
1470 while (count--) { in kdb_mdr()
1481 * kdb_md - This function implements the 'md', 'md1', 'md2', 'md4',
1508 for (i = 0; i < num && repeat--; i++) { in kdb_md_line()
1538 cp = wc.c + 8 - bytesperword; in kdb_md_line()
1551 kdb_printf("%*s %s\n", (int)((num-i)*(2*bytesperword + 1)+1), in kdb_md_line()
1583 bytesperword = (int)(argv[0][2] - '0'); in kdb_md()
1711 addr &= ~(bytesperword-1); in kdb_md()
1731 repeat -= n; in kdb_md()
1732 z = (z + num - 1) / num; in kdb_md()
1734 int s = num * (z-2); in kdb_md()
1735 kdb_printf(kdb_machreg_fmt0 "-" kdb_machreg_fmt0 in kdb_md()
1737 addr, addr + bytesperword * s - 1); in kdb_md()
1739 repeat -= s; in kdb_md()
1748 * kdb_mm - This function implements the 'mm' command.
1749 * mm address-expression new-value
1782 width = argv[0][2] ? (argv[0][2] - '0') : (KDB_WORD_SIZE); in kdb_mm()
1793 * kdb_go - This function implements the 'go' command.
1794 * go [address-expression]
1839 * kdb_rd - This function implements the 'rd' command.
1906 * kdb_rm - This function implements the 'rm' (register modify) command.
1907 * rm register-name new-contents
1974 * kdb_sr - This function implements the 'sr' (SYSRQ key) command
1975 * which interfaces to the soi-disant MAGIC SYSRQ functionality.
1976 * sr <magic-sysrq-code>
1988 kdb_trap_printk--; in kdb_sr()
1995 * kdb_ef - This function implements the 'regs' (display exception
1999 * regs address-expression
2023 * kdb_lsmod - This function implements the 'lsmod' command. Lists
2036 if (mod->state == MODULE_STATE_UNFORMED) in kdb_lsmod()
2039 kdb_printf("%-20s%8u 0x%px ", mod->name, in kdb_lsmod()
2040 mod->core_layout.size, (void *)mod); in kdb_lsmod()
2044 if (mod->state == MODULE_STATE_GOING) in kdb_lsmod()
2046 else if (mod->state == MODULE_STATE_COMING) in kdb_lsmod()
2050 kdb_printf(" 0x%px", mod->core_layout.base); in kdb_lsmod()
2056 list_for_each_entry(use, &mod->source_list, in kdb_lsmod()
2058 kdb_printf("%s ", use->target->name); in kdb_lsmod()
2070 * kdb_env - This function implements the 'env' command. Display the
2092 * kdb_dmesg - This function implements the 'dmesg' command to display
2094 * dmesg [lines] [adjust]
2101 int adjust = 0; in kdb_dmesg() local
2116 adjust = simple_strtoul(argv[2], &cp, 0); in kdb_dmesg()
2117 if (*cp || adjust < 0) in kdb_dmesg()
2118 adjust = 0; in kdb_dmesg()
2134 if (adjust >= n) in kdb_dmesg()
2137 else if (adjust - lines >= n) in kdb_dmesg()
2139 "lines printed\n", n, n - adjust); in kdb_dmesg()
2140 skip = adjust; in kdb_dmesg()
2143 skip = n - lines - adjust; in kdb_dmesg()
2145 if (adjust >= n) { in kdb_dmesg()
2165 skip--; in kdb_dmesg()
2168 if (!lines--) in kdb_dmesg()
2173 kdb_printf("%.*s\n", (int)len - 1, buf); in kdb_dmesg()
2194 if (!atomic_add_unless(&kdb_nmi_disabled, -1, 0)) in kdb_param_enable_nmi()
2195 return -EINVAL; in kdb_param_enable_nmi()
2206 * kdb_cpu - This function implements the 'cpu' command.
2218 for (start_cpu = -1, i = 0; i < NR_CPUS; i++) { in kdb_cpu_status()
2234 if (start_cpu < i-1) in kdb_cpu_status()
2235 kdb_printf("-%d", i-1); in kdb_cpu_status()
2248 if (start_cpu < i-1) in kdb_cpu_status()
2249 kdb_printf("-%d", i-1); in kdb_cpu_status()
2320 * kdb_ps - This function implements the 'ps' command which shows a
2335 (void *)p, p->pid, p->parent->pid, in kdb_ps1()
2338 (void *)(&p->thread), in kdb_ps1()
2340 p->comm); in kdb_ps1()
2359 kdb_printf("%-*s Pid Parent [*] cpu State %-*s Command\n", in kdb_ps()
2384 * kdb_pid - This function implements the 'pid' command which switches
2414 kdb_current_task->comm, in kdb_pid()
2415 kdb_current_task->pid); in kdb_pid()
2426 * kdb_help - This function implements the 'help' and '?' commands.
2433 kdb_printf("%-15.15s %-20.20s %s\n", "Command", "Usage", "Description"); in kdb_help()
2434 kdb_printf("-----------------------------" in kdb_help()
2435 "-----------------------------\n"); in kdb_help()
2440 if (!kt->cmd_name) in kdb_help()
2442 if (!kdb_check_flags(kt->cmd_flags, kdb_cmd_enabled, true)) in kdb_help()
2444 if (strlen(kt->cmd_usage) > 20) in kdb_help()
2446 kdb_printf("%-15.15s %-20s%s%s\n", kt->cmd_name, in kdb_help()
2447 kt->cmd_usage, space, kt->cmd_help); in kdb_help()
2453 * kdb_kill - This function implements the 'kill' commands.
2467 if ((sig >= 0) || !valid_signal(-sig)) { in kdb_kill()
2468 kdb_printf("Invalid signal parameter.<-signal>\n"); in kdb_kill()
2471 sig = -sig; in kdb_kill()
2487 p = p->group_leader; in kdb_kill()
2502 val->uptime = div_u64(uptime, NSEC_PER_SEC); in kdb_sysinfo()
2503 val->loads[0] = avenrun[0]; in kdb_sysinfo()
2504 val->loads[1] = avenrun[1]; in kdb_sysinfo()
2505 val->loads[2] = avenrun[2]; in kdb_sysinfo()
2506 val->procs = nr_threads-1; in kdb_sysinfo()
2513 * kdb_summary - This function implements the 'summary' command.
2533 kdb_printf("date %04ld-%02d-%02d %02d:%02d:%02d " in kdb_summary()
2554 #define K(x) ((x) << (PAGE_SHIFT - 10)) in kdb_summary()
2562 * kdb_per_cpu - This function implements the 'per_cpu' command.
2618 kdb_printf("%5d " kdb_bfd_vma_fmt0 " - unable to " in kdb_per_cpu()
2651 * kdb_register_flags - This function is used to register a kernel
2677 if (kp->cmd_name && (strcmp(kp->cmd_name, cmd) == 0)) { in kdb_register_flags()
2688 if (kp->cmd_name == NULL) in kdb_register_flags()
2693 kdbtab_t *new = kmalloc_array(kdb_max_commands - in kdb_register_flags()
2705 (kdb_max_commands - KDB_BASE_CMD_MAX) * sizeof(*new)); in kdb_register_flags()
2708 memset(new + kdb_max_commands - KDB_BASE_CMD_MAX, 0, in kdb_register_flags()
2711 kp = kdb_commands + kdb_max_commands - KDB_BASE_CMD_MAX; in kdb_register_flags()
2715 kp->cmd_name = cmd; in kdb_register_flags()
2716 kp->cmd_func = func; in kdb_register_flags()
2717 kp->cmd_usage = usage; in kdb_register_flags()
2718 kp->cmd_help = help; in kdb_register_flags()
2719 kp->cmd_minlen = minlen; in kdb_register_flags()
2720 kp->cmd_flags = flags; in kdb_register_flags()
2728 * kdb_register - Compatibility register function for commands that do
2750 * kdb_unregister - This function is used to unregister a kernel
2767 if (kp->cmd_name && (strcmp(kp->cmd_name, cmd) == 0)) { in kdb_unregister()
2768 kp->cmd_name = NULL; in kdb_unregister()
2785 kp->cmd_name = NULL; in kdb_inittab()
2878 kdb_register_flags("kill", kdb_kill, "<-signal> <pid>", in kdb_inittab()