[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bochs-cvs
Subject:    [Bochs-cvs] [12558] trunk/bochs
From:       sshwarts () users ! sourceforge ! net
Date:       2014-11-30 21:26:35
Message-ID: E1XvC0s-0002zw-7F () sfs-ml-1 ! v29 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Revision: 12558
Author:   sshwarts
Date:     2014-11-30 21:26:33 +0000 (Sun, 30 Nov 2014)
Log Message:
-----------
remove debug prints from param tree dump in xml format, small code reorg

Modified Paths:
--------------
    trunk/bochs/cpu/cpuid.cc
    trunk/bochs/cpu/cpuid.h
    trunk/bochs/main.cc

Modified: trunk/bochs/cpu/cpuid.cc
===================================================================
--- trunk/bochs/cpu/cpuid.cc	2014-11-24 18:25:14 UTC (rev 12557)
+++ trunk/bochs/cpu/cpuid.cc	2014-11-30 21:26:33 UTC (rev 12558)
@@ -122,6 +122,39 @@
 
 #endif
 
+void bx_cpuid_t::get_ext_cpuid_brand_string_leaf(const char *brand_string, Bit32u \
function, cpuid_function_t *leaf) const +{
+  switch(function) {
+  case 0x80000002:
+    memcpy(&(leaf->eax), brand_string     , 4);
+    memcpy(&(leaf->ebx), brand_string +  4, 4);
+    memcpy(&(leaf->ecx), brand_string +  8, 4);
+    memcpy(&(leaf->edx), brand_string + 12, 4);
+    break;
+  case 0x80000003:
+    memcpy(&(leaf->eax), brand_string + 16, 4);
+    memcpy(&(leaf->ebx), brand_string + 20, 4);
+    memcpy(&(leaf->ecx), brand_string + 24, 4);
+    memcpy(&(leaf->edx), brand_string + 28, 4);
+    break;
+  case 0x80000004:
+    memcpy(&(leaf->eax), brand_string + 32, 4);
+    memcpy(&(leaf->ebx), brand_string + 36, 4);
+    memcpy(&(leaf->ecx), brand_string + 40, 4);
+    memcpy(&(leaf->edx), brand_string + 44, 4);
+    break;
+  default:
+    break;
+  }
+
+#ifdef BX_BIG_ENDIAN
+  leaf->eax = bx_bswap32(leaf->eax);
+  leaf->ebx = bx_bswap32(leaf->ebx);
+  leaf->ecx = bx_bswap32(leaf->ecx);
+  leaf->edx = bx_bswap32(leaf->edx);
+#endif
+}
+
 void bx_cpuid_t::dump_cpuid(unsigned max_std_leaf, unsigned max_ext_leaf) const
 {
   struct cpuid_function_t leaf;

Modified: trunk/bochs/cpu/cpuid.h
===================================================================
--- trunk/bochs/cpu/cpuid.h	2014-11-24 18:25:14 UTC (rev 12557)
+++ trunk/bochs/cpu/cpuid.h	2014-11-30 21:26:33 UTC (rev 12558)
@@ -188,6 +188,12 @@
     }
   }
 
+#if BX_SUPPORT_APIC
+  void get_std_cpuid_extended_topology_leaf(Bit32u subfunction, cpuid_function_t \
*leaf) const; +#endif
+
+  void get_ext_cpuid_brand_string_leaf(const char *brand_string, Bit32u function, \
cpuid_function_t *leaf) const; +
   BX_CPP_INLINE void get_reserved_leaf(cpuid_function_t *leaf) const
   {
     leaf->eax = 0;
@@ -196,45 +202,7 @@
     leaf->edx = 0;
   }
 
-#if BX_SUPPORT_APIC
-  void get_std_cpuid_extended_topology_leaf(Bit32u subfunction, cpuid_function_t \
                *leaf) const;
-#endif
-
-  BX_CPP_INLINE void get_ext_cpuid_brand_string_leaf(const char *brand_string, \
                Bit32u function, cpuid_function_t *leaf) const
-  {
-    switch(function) {
-    case 0x80000002:
-      memcpy(&(leaf->eax), brand_string     , 4);
-      memcpy(&(leaf->ebx), brand_string +  4, 4);
-      memcpy(&(leaf->ecx), brand_string +  8, 4);
-      memcpy(&(leaf->edx), brand_string + 12, 4);
-      break;
-    case 0x80000003:
-      memcpy(&(leaf->eax), brand_string + 16, 4);
-      memcpy(&(leaf->ebx), brand_string + 20, 4);
-      memcpy(&(leaf->ecx), brand_string + 24, 4);
-      memcpy(&(leaf->edx), brand_string + 28, 4);
-      break;
-    case 0x80000004:
-      memcpy(&(leaf->eax), brand_string + 32, 4);
-      memcpy(&(leaf->ebx), brand_string + 36, 4);
-      memcpy(&(leaf->ecx), brand_string + 40, 4);
-      memcpy(&(leaf->edx), brand_string + 44, 4);
-      break;
-    default:
-      break;
-    }
-
-#ifdef BX_BIG_ENDIAN
-    leaf->eax = bx_bswap32(leaf->eax);
-    leaf->ebx = bx_bswap32(leaf->ebx);
-    leaf->ecx = bx_bswap32(leaf->ecx);
-    leaf->edx = bx_bswap32(leaf->edx);
-#endif
-  }
-
   void dump_cpuid(unsigned max_std_leaf, unsigned max_ext_leaf) const;
-
 };
 
 typedef bx_cpuid_t* (*bx_create_cpuid_method)(BX_CPU_C *cpu);

Modified: trunk/bochs/main.cc
===================================================================
--- trunk/bochs/main.cc	2014-11-24 18:25:14 UTC (rev 12557)
+++ trunk/bochs/main.cc	2014-11-30 21:26:33 UTC (rev 12558)
@@ -203,23 +203,29 @@
   switch (node->get_type()) {
     case BXT_PARAM_NUM:
       if (((bx_param_num_c*)node)->get_base() == BASE_DEC) {
-        dbg_printf("" FMT_LL "d (number)", ((bx_param_num_c*)node)->get64());
+        dbg_printf("" FMT_LL "d", ((bx_param_num_c*)node)->get64());
+        if (! xml) dbg_printf(" (number)");
       } else {
-        dbg_printf("0x" FMT_LL "x (hex number)", ((bx_param_num_c*)node)->get64());
+        dbg_printf("0x" FMT_LL "x", ((bx_param_num_c*)node)->get64());
+        if (! xml) dbg_printf(" (hex number)");
       }
       break;
     case BXT_PARAM_BOOL:
-      dbg_printf("%s (boolean)", ((bx_param_bool_c*)node)->get()?"true":"false");
+      dbg_printf("%s", ((bx_param_bool_c*)node)->get()?"true":"false");
+      if (! xml) dbg_printf(" (boolean)");
       break;
     case BXT_PARAM_ENUM:
-      dbg_printf("'%s' (enum)", ((bx_param_enum_c*)node)->get_selected());
+      dbg_printf("'%s'", ((bx_param_enum_c*)node)->get_selected());
+      if (! xml) dbg_printf(" (enum)");
       break;
     case BXT_PARAM_STRING:
       ((bx_param_string_c*)node)->sprint(tmpstr, BX_PATHNAME_LEN, 0);
       if (((bx_param_string_c*)node)->get_options() & bx_param_string_c::RAW_BYTES) \
                {
-        dbg_printf("'%s' (raw byte string)", tmpstr);
+        dbg_printf("'%s'", tmpstr);
+        if (! xml) dbg_printf(" (raw byte string)");
       } else {
-        dbg_printf("'%s' (string)", tmpstr);
+        dbg_printf("'%s'", tmpstr);
+        if (! xml) dbg_printf(" (string)");
       }
       break;
     case BXT_LIST:
@@ -236,7 +242,7 @@
         break;
       }
     case BXT_PARAM_DATA:
-      dbg_printf("'size=%d' (binary data)", ((bx_shadow_data_c*)node)->get_size());
+      dbg_printf("'binary data size=%d'", ((bx_shadow_data_c*)node)->get_size());
       break;
     default:
       dbg_printf("(unknown parameter type)");


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Bochs-cvs mailing list
Bochs-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bochs-cvs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic