#include <palacios/vmm.h>
-void PrintDebugHex(unsigned char x)
+void PrintDebugHex(uchar_t x)
{
unsigned char z;
- z = (x>>4) & 0xf ;
+ z = (x >> 4) & 0xf ;
PrintDebug("%x", z);
z = x & 0xf;
PrintDebug("%x", z);
}
-void PrintDebugMemDump(unsigned char *start, int n)
+void PrintDebugMemDump(uchar_t *start, int n)
{
int i, j;
- for (i=0;i<n;i+=16) {
- PrintDebug("%8x", (unsigned)(start+i));
- for (j=i; j<i+16 && j<n; j+=2) {
+ for (i = 0; i < n; i += 16) {
+ PrintDebug("%8x", (start + i));
+
+ for (j = i; (j < (i + 16)) && (j < n); j += 2) {
PrintDebug(" ");
- PrintDebugHex(*((unsigned char *)(start+j)));
- if ((j+1)<n) {
- PrintDebugHex(*((unsigned char *)(start+j+1)));
+ PrintDebugHex(*((uchar_t *)(start + j)));
+
+ if ((j + 1) < n) {
+ PrintDebugHex(*((uchar_t *)(start + j + 1)));
}
+
}
+
PrintDebug(" ");
- for (j=i; j<i+16 && j<n;j++) {
- PrintDebug("%c", ((start[j]>=32) && (start[j]<=126)) ? start[j] : '.');
+
+ for (j = i; (j < (i + 16)) && (j < n); j++) {
+ PrintDebug("%c", ((start[j] >= 32) && (start[j] <= 126)) ? start[j] : '.');
}
+
PrintDebug("\n");
}
}