Changeset 37970 in vbox for trunk/src/VBox/HostDrivers/Support
- Timestamp:
- Jul 14, 2011 2:37:23 PM (13 years ago)
- Location:
- trunk/src/VBox/HostDrivers/Support
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp
r37249 r37970 815 815 816 816 817 /** @todo move this to assembly where a simple "jmp printf" will to the trick. */818 817 RTDECL(int) SUPR0Printf(const char *pszFormat, ...) 819 818 { 820 va_list args;819 va_list va; 821 820 char szMsg[512]; 822 821 823 va_start(args, pszFormat); 824 vsnprintf(szMsg, sizeof(szMsg) - 1, pszFormat, args); 825 va_end(args); 826 822 va_start(va, pszFormat); 823 RTStrPrintfV(szMsg, sizeof(szMsg) - 1, pszFormat, va); 824 va_end(va); 827 825 szMsg[sizeof(szMsg) - 1] = '\0'; 826 828 827 printf("%s", szMsg); 829 828 return 0; -
trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
r37249 r37970 782 782 RTDECL(int) SUPR0Printf(const char *pszFormat, ...) 783 783 { 784 #if 1 785 va_list args; 784 va_list va; 786 785 char szMsg[512]; 787 786 788 va_start(args, pszFormat); 789 vsnprintf(szMsg, sizeof(szMsg) - 1, pszFormat, args); 787 va_start(va, pszFormat); 788 SUPR0Printf(szMsg, sizeof(szMsg) - 1, pszFormat, va); 789 va_end(va); 790 790 szMsg[sizeof(szMsg) - 1] = '\0'; 791 791 792 printk("%s", szMsg); 792 va_end(args);793 #else794 /* forward to printf - needs some more GCC hacking to fix ebp... */795 __asm__ __volatile__ ("mov %0, %esp\n\t"796 "jmp %1\n\t",797 :: "r" ((uintptr_t)&pszFormat - 4),798 "m" (printk));799 #endif800 793 return 0; 801 794 }
Note:
See TracChangeset
for help on using the changeset viewer.