Sync with trunk (r48545)
[reactos.git] / boot / armllb / crtsupp.c
1 /*
2 * PROJECT: ReactOS Boot Loader
3 * LICENSE: BSD - See COPYING.ARM in the top level directory
4 * FILE: boot/armllb/crtsupp.c
5 * PURPOSE: CRT Support Code
6 * PROGRAMMERS: ReactOS Portable Systems Group
7 */
8
9 #include "precomp.h"
10
11 int
12 putchar(int c)
13 {
14 /* Write to the screen */
15 LlbVideoPutChar(c);
16
17 /* For DEBUGGING ONLY */
18 LlbSerialPutChar(c);
19 return 0;
20 }
21
22 int
23 puts(const char* string)
24 {
25 while (*string) putchar(*string++);
26 return 0;
27 }
28
29 int printf(const char *fmt, ...)
30 {
31 va_list args;
32 unsigned int i;
33 char printbuffer[1024];
34
35 va_start(args, fmt);
36 i = vsprintf(printbuffer, fmt, args);
37 va_end(args);
38
39 /* Print the string */
40 return puts(printbuffer);
41 }
42
43 VOID
44 DbgPrint(const char *fmt, ...)
45 {
46 va_list args;
47 unsigned int i, j;
48 char Buffer[1024];
49
50 va_start(args, fmt);
51 i = vsprintf(Buffer, fmt, args);
52 va_end(args);
53
54 for (j = 0; j < i; j++) LlbSerialPutChar(Buffer[j]);
55 }
56
57 /* EOF */