-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
ser_print.c
76 lines (69 loc) · 1.19 KB
/
ser_print.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/interrupt.h>
#include <linux/cdev.h>
#include <linux/uaccess.h>
#include <linux/device.h>
#include <linux/types.h>
#include <linux/proc_fs.h>
#include <linux/mm.h>
#include <linux/timex.h>
#include <linux/cpufreq.h>
#include "services.h"
#include "kernel_helper.h"
/*
* Module name function
*/
const char *service_modname(void)
{
return myname;
}
/*
* Throw a bug
*/
void service_bug(void)
{
BUG();
}
/*
* A printing function. This function supports var args.
*/
int service_printk(const char *fmt, ...)
{
va_list args;
int ret;
va_start(args, fmt);
ret = vprintk(fmt, args);
va_end(args);
return ret;
}
/*
* A var arg printk version
*/
int service_vprintk(const char *fmt, va_list list)
{
return vprintk(fmt, list);
}
/*
* A simple string printing function
*/
int service_puts(const char *str)
{
return pr_info("%s", str);
}
/*
* A stack trace service
*/
void service_stacktrace(void)
{
/*
* #ifdef CONFIG_STACKTRACE
* struct stack_trace my_trace;
* save_stack_trace(&my_trace);
* print_stack_trace(&my_trace,0);
* #endif // CONFIG_STACKTRACE
*/
}