#define XENO_TTY_MINOR 123
-/*** useful function for console debugging -- goes straight to Xen ****/
-
+/*** Useful function for console debugging -- goes straight to Xen ****/
asmlinkage int xprintk(const char *fmt, ...)
{
- va_list args;
- unsigned long flags;
- int printed_len;
- static char printk_buf[1024];
-
- /* Emit the output into the temporary buffer */
- va_start(args, fmt);
- printed_len = vsnprintf(printk_buf, sizeof(printk_buf), fmt, args);
- va_end(args);
-
- // Useful Hack if things are going wrong very early in the day
- (void)HYPERVISOR_console_write(printk_buf, sizeof(printk_buf));
+ va_list args;
+ int printk_len;
+ static char printk_buf[1024];
+
+ /* Emit the output into the temporary buffer */
+ va_start(args, fmt);
+ printk_len = vsnprintf(printk_buf, sizeof(printk_buf), fmt, args);
+ va_end(args);
+
+ /* Send the processed output directly to Xen. */
+ (void)HYPERVISOR_console_write(printk_buf, printk_len);
+
+ return 0;
}
(*(unsigned long *)kpte)&~_PAGE_RW);
set_pmd(pmd, __pmd(_KERNPG_TABLE + __pa(pte)));
-
- // XXX Xen below reqd ?
- //if (pte != pte_offset(pmd, 0))
- // BUG();
}
vaddr += PMD_SIZE;
}
va_end(args);
#if 0
-// Useful Hack if things are going wrong very early in the day
-(void)HYPERVISOR_console_write(printk_buf, sizeof(printk_buf));
+ /* Useful if things are going wrong very early in the day. */
+ (void)HYPERVISOR_console_write(printk_buf, printed_len);
#endif
+
/*
* Copy the output into log_buf. If the caller didn't provide
* appropriate log level tags, we insert them here