Index: /trunk/src/VBox/Devices/PC/DevACPI.cpp
===================================================================
--- /trunk/src/VBox/Devices/PC/DevACPI.cpp	(revision 12430)
+++ /trunk/src/VBox/Devices/PC/DevACPI.cpp	(revision 12431)
@@ -189,5 +189,5 @@
     uint8_t             u8UseFdc;
     bool                fPowerButtonHandled;
-   
+
     /** ACPI port base interface. */
     PDMIBASE            IBase;
@@ -399,27 +399,29 @@
 AssertCompileSize(ACPITBLIOAPIC, 12);
 
-/** Multiple APIC Description Table */
 #ifdef VBOX_WITH_SMP_GUESTS
-
-#define PCAT_COMPAT     0x1                     /**< system has also a dual-8259 setup */
-
-/*
+#ifdef IN_RING3 /**@todo r=bird: Move this down to where it's used. */
+
+# define PCAT_COMPAT     0x1                     /**< system has also a dual-8259 setup */
+
+/**
+ * Multiple APIC Description Table.
+ *
  * This structure looks somewhat convoluted due layout of MADT table in MP case.
- * There extpected to be multiple LAPIC records for each CPU, thus we cannot 
+ * There extpected to be multiple LAPIC records for each CPU, thus we cannot
  * use regular C structure and proxy to raw memory instead.
  */
-class ACPITBLMADT
-{
-    /*
+class AcpiTableMADT
+{
+    /**
      * All actual data stored in dynamically allocated memory pointed by this field.
      */
     uint8_t*            pData;
-    /*
+    /**
      * Number of CPU entries in this MADT.
      */
     uint32_t            cCpus;
-    
+
  public:
-    /*
+    /**
      * Address of ACPI header
      */
@@ -428,6 +430,6 @@
         return (ACPITBLHEADER*)pData;
     }
-    
-    /*
+
+    /**
      * Address of local APIC for each CPU. Note that different CPUs address different LAPICs,
      * although address is the same for all of them.
@@ -437,6 +439,6 @@
         return  (uint32_t*)(header_addr() + 1);
     }
-    
-    /*
+
+    /**
      * Address of APIC flags
      */
@@ -445,6 +447,6 @@
         return (uint32_t*)(u32LAPIC_addr() + 1);
     }
-    
-    /*
+
+    /**
      * Address of per-CPU LAPIC descriptions
      */
@@ -454,5 +456,5 @@
     }
 
-    /*
+    /**
      * Address of IO APIC description
      */
@@ -462,5 +464,5 @@
     }
 
-    /*
+    /**
      * Size of MADT.
      * Note that this function assumes IOApic to be the last field in structure.
@@ -471,5 +473,5 @@
     }
 
-    /*
+    /**
      * Raw data of MADT.
      */
@@ -479,10 +481,10 @@
     }
 
-    /*
+    /**
      * Size of MADT for given ACPI config, useful to compute layout.
      */
     static uint32_t sizeFor(ACPIState *s)
     {
-        return ACPITBLMADT(s->cCpus).size();
+        return AcpiTableMADT(s->cCpus).size();
     }
 
@@ -490,26 +492,21 @@
      * Constructor, only works in Ring 3, doesn't look like a big deal.
      */
-    ACPITBLMADT(uint16_t cpus)
+    AcpiTableMADT(uint16_t cpus)
     {
         cCpus = cpus;
         pData = 0;
-#ifdef IN_RING3
         uint32_t sSize = size();
         pData = (uint8_t*)RTMemAllocZ(sSize);
-#else
-        AssertMsgFailed(("cannot use in inner rings"));
-#endif
-    }
-
-    ~ACPITBLMADT()
-    {
-#ifdef IN_RING3
+    }
+
+    ~AcpiTableMADT()
+    {
         RTMemFree(pData);
-#else
-        AssertMsgFailed(("cannot use in inner rings"));
-#endif
     }
 };
-#else 
+#endif /* IN_RING3 */
+
+#else  /* !VBOX_WITH_SMP_GUESTS */
+/** Multiple APIC Description Table */
 struct ACPITBLMADT
 {
@@ -522,5 +519,5 @@
 };
 AssertCompileSize(ACPITBLMADT, 64);
-#endif
+#endif /* !VBOX_WITH_SMP_GUESTS */
 
 #pragma pack()
@@ -754,13 +751,13 @@
 static void acpiSetupMADT (ACPIState *s, RTGCPHYS32 addr)
 {
-#if VBOX_WITH_SMP_GUESTS
+#ifdef VBOX_WITH_SMP_GUESTS
     uint16_t cpus = s->cCpus;
-    ACPITBLMADT madt(cpus);
+    AcpiTableMADT madt(cpus);
 
     acpiPrepareHeader(madt.header_addr(), "APIC", madt.size(), 2);
-    
+
     *madt.u32LAPIC_addr()          = RT_H2LE_U32(0xfee00000);
     *madt.u32Flags_addr()          = RT_H2LE_U32(PCAT_COMPAT);
-    
+
     ACPITBLLAPIC* lapic = madt.LApics_addr();
     for (uint16_t i = 0; i < cpus; i++)
@@ -786,5 +783,5 @@
     acpiPhyscpy (s, addr, madt.data(), madt.size());
 
-#else
+#else  /* !VBOX_WITH_SMP_GUESTS */
     ACPITBLMADT madt;
 
@@ -813,5 +810,5 @@
     madt.header.u8Checksum = acpiChecksum ((uint8_t*)&madt, sizeof(madt));
     acpiPhyscpy (s, addr, &madt, sizeof(madt));
-#endif
+#endif /* !VBOX_WITH_SMP_GUESTS */
 }
 
@@ -1664,9 +1661,9 @@
         apic_addr = RT_ALIGN_32 (facs_addr + sizeof(ACPITBLFACS), 16);
 #ifdef VBOX_WITH_SMP_GUESTS
-        /* 
-         * @todo r=nike maybe some refactoring needed to compute tables layout, 
+        /**
+         * @todo nike: maybe some refactoring needed to compute tables layout,
          * but as this code is executed only once it doesn't make sense to optimize much
          */
-        dsdt_addr = RT_ALIGN_32 (apic_addr + ACPITBLMADT::sizeFor(s), 16);
+        dsdt_addr = RT_ALIGN_32 (apic_addr + AcpiTableMADT::sizeFor(s), 16);
 #else
         dsdt_addr = RT_ALIGN_32 (apic_addr + sizeof(ACPITBLMADT), 16);
@@ -1729,5 +1726,5 @@
 
     /* Validate and read the configuration. */
-    if (!CFGMR3AreValuesValid (pCfgHandle, 
+    if (!CFGMR3AreValuesValid (pCfgHandle,
                                "RamSize\0"
                                "IOAPIC\0"
