Rev 4263 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4263 | Rev 4327 | ||
---|---|---|---|
Line 36... | Line 36... | ||
36 | #include <stdio.h> |
36 | #include <stdio.h> |
37 | #include <unistd.h> |
37 | #include <unistd.h> |
38 | #include <io/printf_core.h> |
38 | #include <io/printf_core.h> |
39 | #include <futex.h> |
39 | #include <futex.h> |
40 | #include <async.h> |
40 | #include <async.h> |
- | 41 | #include <console.h> |
|
41 | 42 | ||
42 | static atomic_t printf_futex = FUTEX_INITIALIZER; |
43 | static atomic_t printf_futex = FUTEX_INITIALIZER; |
43 | 44 | ||
44 | static int vprintf_str_write(const char *str, size_t size, void *data) |
45 | static int vprintf_str_write(const char *str, size_t size, void *data) |
45 | { |
46 | { |
Line 48... | Line 49... | ||
48 | count_t chars = 0; |
49 | count_t chars = 0; |
49 | 50 | ||
50 | while (offset < size) { |
51 | while (offset < size) { |
51 | prev = offset; |
52 | prev = offset; |
52 | str_decode(str, &offset, size); |
53 | str_decode(str, &offset, size); |
53 | write_stdout(str + prev, offset - prev); |
54 | console_write(str + prev, offset - prev); |
54 | chars++; |
55 | chars++; |
55 | } |
56 | } |
56 | 57 | ||
57 | return chars; |
58 | return chars; |
58 | } |
59 | } |
Line 65... | Line 66... | ||
65 | char buf[4]; |
66 | char buf[4]; |
66 | 67 | ||
67 | while (offset < size) { |
68 | while (offset < size) { |
68 | boff = 0; |
69 | boff = 0; |
69 | chr_encode(str[chars], buf, &boff, 4); |
70 | chr_encode(str[chars], buf, &boff, 4); |
70 | write_stdout(buf, boff); |
71 | console_write(buf, boff); |
71 | chars++; |
72 | chars++; |
72 | offset += sizeof(wchar_t); |
73 | offset += sizeof(wchar_t); |
73 | } |
74 | } |
74 | 75 | ||
75 | return chars; |
76 | return chars; |