Release 4.14 arch/blackfin/kernel/kgdb_test.c
/*
* arch/blackfin/kernel/kgdb_test.c - Blackfin kgdb tests
*
* Copyright 2005-2008 Analog Devices Inc.
*
* Licensed under the GPL-2 or later.
*/
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/proc_fs.h>
#include <asm/current.h>
#include <linux/uaccess.h>
#include <asm/blackfin.h>
/* Symbols are here for kgdb test to poke directly */
static char cmdline[256];
static size_t len;
#ifndef CONFIG_SMP
static int num1 __attribute__((l1_data));
void kgdb_l1_test(void) __attribute__((l1_text));
void kgdb_l1_test(void)
{
pr_alert("L1(before change) : data variable addr = 0x%p, data value is %d\n", &num1, num1);
pr_alert("L1 : code function addr = 0x%p\n", kgdb_l1_test);
num1 = num1 + 10;
pr_alert("L1(after change) : data variable addr = 0x%p, data value is %d\n", &num1, num1);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Mike Frysinger | 40 | 100.00% | 2 | 100.00% |
Total | 40 | 100.00% | 2 | 100.00% |
#endif
#if L2_LENGTH
static int num2 __attribute__((l2));
void kgdb_l2_test(void) __attribute__((l2));
void kgdb_l2_test(void)
{
pr_alert("L2(before change) : data variable addr = 0x%p, data value is %d\n", &num2, num2);
pr_alert("L2 : code function addr = 0x%p\n", kgdb_l2_test);
num2 = num2 + 20;
pr_alert("L2(after change) : data variable addr = 0x%p, data value is %d\n", &num2, num2);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Mike Frysinger | 40 | 100.00% | 2 | 100.00% |
Total | 40 | 100.00% | 2 | 100.00% |
#endif
noinline int kgdb_test(char *name, int len, int count, int z)
{
pr_alert("kgdb name(%d): %s, %d, %d\n", len, name, count, z);
count = z;
return count;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Mike Frysinger | 38 | 97.44% | 2 | 66.67% |
Sonic Zhang | 1 | 2.56% | 1 | 33.33% |
Total | 39 | 100.00% | 3 | 100.00% |
static ssize_t
kgdb_test_proc_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
kgdb_test("hello world!", 12, 0x55, 0x10);
#ifndef CONFIG_SMP
kgdb_l1_test();
#endif
#if L2_LENGTH
kgdb_l2_test();
#endif
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Mike Frysinger | 33 | 62.26% | 1 | 33.33% |
Alexey Dobriyan | 15 | 28.30% | 1 | 33.33% |
Sonic Zhang | 5 | 9.43% | 1 | 33.33% |
Total | 53 | 100.00% | 3 | 100.00% |
static ssize_t
kgdb_test_proc_write(struct file *file, const char __user *buffer,
size_t count, loff_t *pos)
{
len = min_t(size_t, 255, count);
memcpy(cmdline, buffer, count);
cmdline[len] = 0;
return len;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Mike Frysinger | 48 | 88.89% | 2 | 66.67% |
Alexey Dobriyan | 6 | 11.11% | 1 | 33.33% |
Total | 54 | 100.00% | 3 | 100.00% |
static const struct file_operations kgdb_test_proc_fops = {
.owner = THIS_MODULE,
.read = kgdb_test_proc_read,
.write = kgdb_test_proc_write,
.llseek = noop_llseek,
};
static int __init kgdbtest_init(void)
{
struct proc_dir_entry *entry;
#if L2_LENGTH
num2 = 0;
#endif
entry = proc_create("kgdbtest", 0, NULL, &kgdb_test_proc_fops);
if (entry == NULL)
return -ENOMEM;
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Mike Frysinger | 37 | 74.00% | 1 | 33.33% |
Vivi Li | 9 | 18.00% | 1 | 33.33% |
Alexey Dobriyan | 4 | 8.00% | 1 | 33.33% |
Total | 50 | 100.00% | 3 | 100.00% |
static void __exit kgdbtest_exit(void)
{
remove_proc_entry("kgdbtest", NULL);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Mike Frysinger | 16 | 100.00% | 1 | 100.00% |
Total | 16 | 100.00% | 1 | 100.00% |
module_init(kgdbtest_init);
module_exit(kgdbtest_exit);
MODULE_LICENSE("GPL");
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Mike Frysinger | 344 | 82.10% | 2 | 25.00% |
Alexey Dobriyan | 49 | 11.69% | 1 | 12.50% |
Sonic Zhang | 11 | 2.63% | 2 | 25.00% |
Vivi Li | 9 | 2.15% | 1 | 12.50% |
Arnd Bergmann | 5 | 1.19% | 1 | 12.50% |
Linus Torvalds | 1 | 0.24% | 1 | 12.50% |
Total | 419 | 100.00% | 8 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.