tcp: md5: using remote adress for md5 lookup in rst packet
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / blackfin / kernel / kgdb_test.c
blob4a7dcfea98af82e5408ee80939ae66d3c4c91c15
1 /*
2 * arch/blackfin/kernel/kgdb_test.c - Blackfin kgdb tests
4 * Copyright 2005-2008 Analog Devices Inc.
6 * Licensed under the GPL-2 or later.
7 */
9 #include <linux/module.h>
10 #include <linux/kernel.h>
11 #include <linux/init.h>
12 #include <linux/proc_fs.h>
14 #include <asm/current.h>
15 #include <asm/uaccess.h>
16 #include <asm/system.h>
18 #include <asm/blackfin.h>
20 /* Symbols are here for kgdb test to poke directly */
21 static char cmdline[256];
22 static size_t len;
24 #ifndef CONFIG_SMP
25 static int num1 __attribute__((l1_data));
27 void kgdb_l1_test(void) __attribute__((l1_text));
29 void kgdb_l1_test(void)
31 pr_alert("L1(before change) : data variable addr = 0x%p, data value is %d\n", &num1, num1);
32 pr_alert("L1 : code function addr = 0x%p\n", kgdb_l1_test);
33 num1 = num1 + 10;
34 pr_alert("L1(after change) : data variable addr = 0x%p, data value is %d\n", &num1, num1);
36 #endif
38 #if L2_LENGTH
40 static int num2 __attribute__((l2));
41 void kgdb_l2_test(void) __attribute__((l2));
43 void kgdb_l2_test(void)
45 pr_alert("L2(before change) : data variable addr = 0x%p, data value is %d\n", &num2, num2);
46 pr_alert("L2 : code function addr = 0x%p\n", kgdb_l2_test);
47 num2 = num2 + 20;
48 pr_alert("L2(after change) : data variable addr = 0x%p, data value is %d\n", &num2, num2);
51 #endif
53 noinline int kgdb_test(char *name, int len, int count, int z)
55 pr_alert("kgdb name(%d): %s, %d, %d\n", len, name, count, z);
56 count = z;
57 return count;
60 static ssize_t
61 kgdb_test_proc_read(struct file *file, char __user *buf,
62 size_t count, loff_t *ppos)
64 kgdb_test("hello world!", 12, 0x55, 0x10);
65 #ifndef CONFIG_SMP
66 kgdb_l1_test();
67 #endif
68 #if L2_LENGTH
69 kgdb_l2_test();
70 #endif
72 return 0;
75 static ssize_t
76 kgdb_test_proc_write(struct file *file, const char __user *buffer,
77 size_t count, loff_t *pos)
79 len = min_t(size_t, 255, count);
80 memcpy(cmdline, buffer, count);
81 cmdline[len] = 0;
83 return len;
86 static const struct file_operations kgdb_test_proc_fops = {
87 .owner = THIS_MODULE,
88 .read = kgdb_test_proc_read,
89 .write = kgdb_test_proc_write,
90 .llseek = noop_llseek,
93 static int __init kgdbtest_init(void)
95 struct proc_dir_entry *entry;
97 #if L2_LENGTH
98 num2 = 0;
99 #endif
101 entry = proc_create("kgdbtest", 0, NULL, &kgdb_test_proc_fops);
102 if (entry == NULL)
103 return -ENOMEM;
105 return 0;
108 static void __exit kgdbtest_exit(void)
110 remove_proc_entry("kgdbtest", NULL);
113 module_init(kgdbtest_init);
114 module_exit(kgdbtest_exit);
115 MODULE_LICENSE("GPL");