Updated PCI IDs to latest snapshot.
[tangerine.git] / arch / all-mingw32 / kernel / host_debug.h
blob3ed1cd6350267d7abd510932008e19b2c022958a
1 /*
2 * Console output in Windows seems to be protected via semaphores. SuspendThread() at the moment
3 * of writing something to console leaves it in locked state. Attempt to write something to it from
4 * timer interrupt thread leads to a deadlock. So we have to do this.
5 */
7 /* Be careful again - with this i was able to debug scheduler, but often this causes lockups. Looks like console
8 doesn't like concurrent output from several threads in some conditions (too fast maybe?)
9 */
10 #define bug printf
12 #if DEBUG
13 #define D(x) x
15 static inline void bug(char *format, ...)
17 va_list args;
18 char buf[256];
20 va_start(args, format);
21 vsnprintf(buf, sizeof(buf), format, args);
22 OutputDebugString(buf);
23 va_end(args);
27 static inline void PrintCPUContext(CONTEXT *ctx)
29 bug("ContextFlags=0x%08lX\n", ctx->ContextFlags);
30 bug("ESP=%08lx EFP=%08lx EIP =%08lx\n", ctx->Esp, ctx->Ebp, ctx->Eip);
31 bug("EAX=%08lx EBX=%08lx ECX =%08lx EDX=%08lx\n", ctx->Eax, ctx->Ebx, ctx->Ecx, ctx->Edx);
32 bug("EDI=%08lx ESI=%08lx EFLAGS=%08lx\n", ctx->Edi, ctx->Esi, ctx->EFlags);
35 #else
36 #define D(x)
37 #endif