| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Port on Texas Instruments TMS320C6x architecture |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2004, 2006, 2009, 2010, 2011 Texas Instruments Incorporated |
|---|
| 5 | 6 | * Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com) |
|---|
| 6 | | - * |
|---|
| 7 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 8 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 9 | | - * published by the Free Software Foundation. |
|---|
| 10 | 7 | */ |
|---|
| 11 | 8 | #include <linux/module.h> |
|---|
| 12 | 9 | #include <linux/ptrace.h> |
|---|
| .. | .. |
|---|
| 253 | 250 | die_if_kernel(except_info->kernel_str, regs, addr); |
|---|
| 254 | 251 | |
|---|
| 255 | 252 | force_sig_fault(except_info->signo, except_info->code, |
|---|
| 256 | | - (void __user *)addr, current); |
|---|
| 253 | + (void __user *)addr); |
|---|
| 257 | 254 | } |
|---|
| 258 | 255 | |
|---|
| 259 | 256 | /* |
|---|
| .. | .. |
|---|
| 347 | 344 | |
|---|
| 348 | 345 | static int kstack_depth_to_print = 48; |
|---|
| 349 | 346 | |
|---|
| 350 | | -static void show_trace(unsigned long *stack, unsigned long *endstack) |
|---|
| 347 | +static void show_trace(unsigned long *stack, unsigned long *endstack, |
|---|
| 348 | + const char *loglvl) |
|---|
| 351 | 349 | { |
|---|
| 352 | 350 | unsigned long addr; |
|---|
| 353 | 351 | int i; |
|---|
| 354 | 352 | |
|---|
| 355 | | - pr_debug("Call trace:"); |
|---|
| 353 | + printk("%sCall trace:", loglvl); |
|---|
| 356 | 354 | i = 0; |
|---|
| 357 | 355 | while (stack + 1 <= endstack) { |
|---|
| 358 | 356 | addr = *stack++; |
|---|
| .. | .. |
|---|
| 367 | 365 | if (__kernel_text_address(addr)) { |
|---|
| 368 | 366 | #ifndef CONFIG_KALLSYMS |
|---|
| 369 | 367 | if (i % 5 == 0) |
|---|
| 370 | | - pr_debug("\n "); |
|---|
| 368 | + printk("%s\n ", loglvl); |
|---|
| 371 | 369 | #endif |
|---|
| 372 | | - pr_debug(" [<%08lx>] %pS\n", addr, (void *)addr); |
|---|
| 370 | + printk("%s [<%08lx>] %pS\n", loglvl, addr, (void *)addr); |
|---|
| 373 | 371 | i++; |
|---|
| 374 | 372 | } |
|---|
| 375 | 373 | } |
|---|
| 376 | | - pr_debug("\n"); |
|---|
| 374 | + printk("%s\n", loglvl); |
|---|
| 377 | 375 | } |
|---|
| 378 | 376 | |
|---|
| 379 | | -void show_stack(struct task_struct *task, unsigned long *stack) |
|---|
| 377 | +void show_stack(struct task_struct *task, unsigned long *stack, |
|---|
| 378 | + const char *loglvl) |
|---|
| 380 | 379 | { |
|---|
| 381 | 380 | unsigned long *p, *endstack; |
|---|
| 382 | 381 | int i; |
|---|
| .. | .. |
|---|
| 401 | 400 | pr_cont(" %08lx", *p++); |
|---|
| 402 | 401 | } |
|---|
| 403 | 402 | pr_cont("\n"); |
|---|
| 404 | | - show_trace(stack, endstack); |
|---|
| 403 | + show_trace(stack, endstack, loglvl); |
|---|
| 405 | 404 | } |
|---|
| 406 | 405 | |
|---|
| 407 | 406 | int is_valid_bugaddr(unsigned long addr) |
|---|