Saket Sinha | af8d55f | 2015-08-22 12:20:57 +0530 | [diff] [blame] | 1 | /* Debugging */ |
| 2 | |
| 3 | Scope(\) { |
| 4 | /* Debug Output */ |
| 5 | OperationRegion(DBG, SystemIO, 0x0402, 0x01) |
| 6 | Field(DBG, ByteAcc, NoLock, Preserve) { |
| 7 | DBGB, 8, |
| 8 | } |
| 9 | /* |
| 10 | * Debug method - use this method to send output to the QEMU |
| 11 | * BIOS debug port. This method handles strings, integers, |
| 12 | * and buffers. For example: DBUG("abc") DBUG(0x123) |
| 13 | */ |
| 14 | Method(DBUG, 1) { |
| 15 | ToHexString(Arg0, Local0) |
| 16 | ToBuffer(Local0, Local0) |
| 17 | Subtract(SizeOf(Local0), 1, Local1) |
| 18 | Store(Zero, Local2) |
| 19 | While (LLess(Local2, Local1)) { |
| 20 | Store(DerefOf(Index(Local0, Local2)), DBGB) |
| 21 | Increment(Local2) |
| 22 | } |
| 23 | Store(0x0a, dbgb) |
| 24 | } |
| 25 | } |