Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 177323
b: refs/heads/master
c: 397b761
h: refs/heads/master
i:
  177321: 7327a81
  177319: 67cfe2e
v: v3
  • Loading branch information
Alexey Dobriyan authored and Mike Frysinger committed Dec 15, 2009
1 parent 74a4af4 commit a3319fb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 28 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c768a943fd8f41f5f7ed33c91d50818b301f5635
refs/heads/master: 397b761cc42e2c56f8de07de680486892448b628
39 changes: 12 additions & 27 deletions trunk/arch/blackfin/kernel/kgdb_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <asm/blackfin.h>

static char cmdline[256];
static unsigned long len;
static size_t len;

#ifndef CONFIG_SMP
static int num1 __attribute__((l1_data));
Expand Down Expand Up @@ -59,7 +59,8 @@ int kgdb_test(char *name, int len, int count, int z)
return count;
}

static int test_proc_output(char *buf)
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
Expand All @@ -72,25 +73,8 @@ static int test_proc_output(char *buf)
return 0;
}

static int test_read_proc(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
int len;

len = test_proc_output(page);
if (len <= off+count)
*eof = 1;
*start = page + off;
len -= off;
if (len > count)
len = count;
if (len < 0)
len = 0;
return len;
}

static int test_write_proc(struct file *file, const char *buffer,
unsigned long count, void *data)
static ssize_t kgdb_test_proc_write(struct file *file,
const char __user *buffer, size_t count, loff_t *pos)
{
if (count >= 256)
len = 255;
Expand All @@ -103,18 +87,19 @@ static int test_write_proc(struct file *file, const char *buffer,
return len;
}

static const struct file_operations kgdb_test_proc_fops = {
.owner = THIS_MODULE,
.read = kgdb_test_proc_read,
.write = kgdb_test_proc_write,
};

static int __init kgdbtest_init(void)
{
struct proc_dir_entry *entry;

entry = create_proc_entry("kgdbtest", 0, NULL);
entry = proc_create("kgdbtest", 0, NULL, &kgdb_test_proc_fops);
if (entry == NULL)
return -ENOMEM;

entry->read_proc = test_read_proc;
entry->write_proc = test_write_proc;
entry->data = NULL;

return 0;
}

Expand Down

0 comments on commit a3319fb

Please sign in to comment.