This source file includes following definitions.
- srm_printk
1
2
3
4
5
6 #include <linux/kernel.h>
7 #include <asm/console.h>
8
9 long
10 srm_printk(const char *fmt, ...)
11 {
12 static char buf[1024];
13 va_list args;
14 long len, num_lf;
15 char *src, *dst;
16
17 va_start(args, fmt);
18 len = vsprintf(buf, fmt, args);
19 va_end(args);
20
21
22
23 num_lf = 0;
24 for (src = buf; *src; ++src) {
25 if (*src == '\n') {
26 ++num_lf;
27 }
28 }
29
30 if (num_lf) {
31
32 for (dst = src + num_lf; src >= buf; ) {
33 if (*src == '\n') {
34 *dst-- = '\r';
35 }
36 *dst-- = *src--;
37 }
38 }
39
40 srm_puts(buf, num_lf+len);
41 return len;
42 }