[ARMLLB]: Make DbgPrint compatible so we can use debug.h.
[reactos.git] / reactos / boot / armllb / crtsupp.c
index 9f70b17..f535a17 100644 (file)
 int
 putchar(int c)
 {
-    /* Write to the serial port */
-    LlbSerialPutChar(c);
-    
-    /* Write to the screen too */
+    /* Write to the screen */
     LlbVideoPutChar(c);
+
+    /* For DEBUGGING ONLY */
+    LlbSerialPutChar(c);
     return 0;
 }
 
@@ -32,16 +32,27 @@ int printf(const char *fmt, ...)
     unsigned int i;
     char printbuffer[1024];
 
-    va_start (args, fmt);
-
-    /* For this to work, printbuffer must be larger than
-     * anything we ever want to print.
-     */
-    i = vsprintf (printbuffer, fmt, args);
-    va_end (args);
+    va_start(args, fmt);
+    i = vsprintf(printbuffer, fmt, args);
+    va_end(args);
 
     /* Print the string */
     return puts(printbuffer);
 }
 
+ULONG
+DbgPrint(const char *fmt, ...)
+{
+    va_list args;
+    unsigned int i, j;
+    char Buffer[1024];
+
+    va_start(args, fmt);
+    i = vsprintf(Buffer, fmt, args);
+    va_end(args);
+    
+    for (j = 0; j < i; j++) LlbSerialPutChar(Buffer[j]);
+    return 0;
+}
+
 /* EOF */