Index: /trunk/src/VBox/Devices/PC/DevPIC.cpp
===================================================================
--- /trunk/src/VBox/Devices/PC/DevPIC.cpp	(revision 11261)
+++ /trunk/src/VBox/Devices/PC/DevPIC.cpp	(revision 11262)
@@ -153,5 +153,5 @@
 static inline void DumpPICState(PicState *s, const char *szFn)
 {
-    PDEVPIC pData = PDMINS2DATA(s->CTX_SUFF(pDevIns), PDEVPIC);
+    PDEVPIC pData = PDMINS_2_DATA(s->CTX_SUFF(pDevIns), PDEVPIC);
 
     Log2(("%s: pic%d: elcr=%x last_irr=%x irr=%x imr=%x isr=%x irq_base=%x\n",
@@ -212,5 +212,5 @@
 static int pic_get_irq(PicState *s)
 {
-    PicState *pics = &(PDMINS2DATA(s->CTX_SUFF(pDevIns), PDEVPIC))->aPics[0];
+    PicState *pics = &(PDMINS_2_DATA(s->CTX_SUFF(pDevIns), PDEVPIC))->aPics[0];
     int mask, cur_priority, priority;
     Log(("pic_get_irq%d: mask=%x\n", (s == pics) ? 0 : 1, s->irr & ~s->imr));
@@ -352,5 +352,5 @@
 PDMBOTHCBDECL(void) picSetIrq(PPDMDEVINS pDevIns, int iIrq, int iLevel)
 {
-    PDEVPIC     pData = PDMINS2DATA(pDevIns, PDEVPIC);
+    PDEVPIC     pData = PDMINS_2_DATA(pDevIns, PDEVPIC);
     Assert(pData->CTX_SUFF(pDevIns) == pDevIns);
     Assert(pData->aPics[0].CTX_SUFF(pDevIns) == pDevIns);
@@ -398,5 +398,5 @@
 PDMBOTHCBDECL(int) picGetInterrupt(PPDMDEVINS pDevIns)
 {
-    PDEVPIC     pData = PDMINS2DATA(pDevIns, PDEVPIC);
+    PDEVPIC     pData = PDMINS_2_DATA(pDevIns, PDEVPIC);
     int         irq;
     int         irq2;
@@ -467,5 +467,5 @@
 {
     PicState *s = (PicState*)opaque;
-    PDEVPIC     pData = PDMINS2DATA(s->CTX_SUFF(pDevIns), PDEVPIC);
+    PDEVPIC     pData = PDMINS_2_DATA(s->CTX_SUFF(pDevIns), PDEVPIC);
     int         rc = VINF_SUCCESS;
     int priority, cmd, irq;
@@ -587,5 +587,5 @@
 static uint32_t pic_poll_read (PicState *s, uint32_t addr1)
 {
-    PDEVPIC     pData = PDMINS2DATA(s->CTX_SUFF(pDevIns), PDEVPIC);
+    PDEVPIC     pData = PDMINS_2_DATA(s->CTX_SUFF(pDevIns), PDEVPIC);
     PicState   *pics = &pData->aPics[0];
     int ret;
@@ -706,5 +706,5 @@
 PDMBOTHCBDECL(int) picIOPortRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t *pu32, unsigned cb)
 {
-    PDEVPIC     pData = PDMINS2DATA(pDevIns, PDEVPIC);
+    PDEVPIC     pData = PDMINS_2_DATA(pDevIns, PDEVPIC);
     uint32_t    iPic  = (uint32_t)(uintptr_t)pvUser;
 
@@ -734,5 +734,5 @@
 PDMBOTHCBDECL(int) picIOPortWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb)
 {
-    PDEVPIC     pData = PDMINS2DATA(pDevIns, PDEVPIC);
+    PDEVPIC     pData = PDMINS_2_DATA(pDevIns, PDEVPIC);
     uint32_t    iPic  = (uint32_t)(uintptr_t)pvUser;
 
@@ -767,7 +767,7 @@
     {
         PicState *s = (PicState*)pvUser;
-        PIC_LOCK(PDMINS2DATA(pDevIns, PDEVPIC), VINF_IOM_HC_IOPORT_READ);
+        PIC_LOCK(PDMINS_2_DATA(pDevIns, PDEVPIC), VINF_IOM_HC_IOPORT_READ);
         *pu32 = s->elcr;
-        PIC_UNLOCK(PDMINS2DATA(pDevIns, PDEVPIC));
+        PIC_UNLOCK(PDMINS_2_DATA(pDevIns, PDEVPIC));
         return VINF_SUCCESS;
     }
@@ -791,7 +791,7 @@
     {
         PicState *s = (PicState*)pvUser;
-        PIC_LOCK(PDMINS2DATA(pDevIns, PDEVPIC), VINF_IOM_HC_IOPORT_WRITE);
+        PIC_LOCK(PDMINS_2_DATA(pDevIns, PDEVPIC), VINF_IOM_HC_IOPORT_WRITE);
         s->elcr = u32 & s->elcr_mask;
-        PIC_UNLOCK(PDMINS2DATA(pDevIns, PDEVPIC));
+        PIC_UNLOCK(PDMINS_2_DATA(pDevIns, PDEVPIC));
     }
     return VINF_SUCCESS;
@@ -811,5 +811,5 @@
 static DECLCALLBACK(void) picInfo(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
 {
-    PDEVPIC pData = PDMINS2DATA(pDevIns, PDEVPIC);
+    PDEVPIC pData = PDMINS_2_DATA(pDevIns, PDEVPIC);
 
     /*
@@ -848,5 +848,5 @@
 static DECLCALLBACK(int) picSaveExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle)
 {
-    PDEVPIC     pData = PDMINS2DATA(pDevIns, PDEVPIC);
+    PDEVPIC     pData = PDMINS_2_DATA(pDevIns, PDEVPIC);
     pic_save(pSSMHandle, &pData->aPics[0]);
     pic_save(pSSMHandle, &pData->aPics[1]);
@@ -865,7 +865,7 @@
 static DECLCALLBACK(int) picLoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle, uint32_t u32Version)
 {
-    PDEVPIC     pData = PDMINS2DATA(pDevIns, PDEVPIC);
+    PDEVPIC     pData = PDMINS_2_DATA(pDevIns, PDEVPIC);
     int rc = pic_load(pSSMHandle, &pData->aPics[0], u32Version);
-    if (VBOX_SUCCESS(rc))
+    if (RT_SUCCESS(rc))
         rc = pic_load(pSSMHandle, &pData->aPics[1], u32Version);
     return rc;
@@ -883,10 +883,10 @@
 static DECLCALLBACK(void)  picReset(PPDMDEVINS pDevIns)
 {
-    PDEVPIC     pData = PDMINS2DATA(pDevIns, PDEVPIC);
+    PDEVPIC     pData = PDMINS_2_DATA(pDevIns, PDEVPIC);
     unsigned    i;
     LogFlow(("picReset:\n"));
     pData->pPicHlpR3->pfnLock(pDevIns, VERR_INTERNAL_ERROR);
 
-    for (i = 0; i < ELEMENTS(pData->aPics); i++)
+    for (i = 0; i < RT_ELEMENTS(pData->aPics); i++)
         pic_reset(&pData->aPics[i]);
 
@@ -900,5 +900,5 @@
 static DECLCALLBACK(void) picRelocate(PPDMDEVINS pDevIns, RTGCINTPTR offDelta)
 {
-    PDEVPIC         pData = PDMINS2DATA(pDevIns, PDEVPIC);
+    PDEVPIC         pData = PDMINS_2_DATA(pDevIns, PDEVPIC);
     unsigned        i;
 
@@ -915,5 +915,5 @@
 static DECLCALLBACK(int)  picConstruct(PPDMDEVINS pDevIns, int iInstance, PCFGMNODE pCfgHandle)
 {
-    PDEVPIC         pData = PDMINS2DATA(pDevIns, PDEVPIC);
+    PDEVPIC         pData = PDMINS_2_DATA(pDevIns, PDEVPIC);
     PDMPICREG       PicReg;
     int             rc;
@@ -931,5 +931,5 @@
     if (rc == VERR_CFGM_VALUE_NOT_FOUND)
         fGCEnabled = true;
-    else if (VBOX_FAILURE(rc))
+    else if (RT_FAILURE(rc))
         return PDMDEV_SET_ERROR(pDevIns, rc,
                                 N_("Configuration error: failed to read GCEnabled as boolean"));
@@ -938,5 +938,5 @@
     if (rc == VERR_CFGM_VALUE_NOT_FOUND)
         fR0Enabled = true;
-    else if (VBOX_FAILURE(rc))
+    else if (RT_FAILURE(rc))
         return PDMDEV_SET_ERROR(pDevIns, rc,
                                 N_("Configuration error: failed to read R0Enabled as boolean"));
@@ -947,5 +947,5 @@
      * Init the data.
      */
-    Assert(ELEMENTS(pData->aPics) == 2);
+    Assert(RT_ELEMENTS(pData->aPics) == 2);
     pData->pDevInsR3 = pDevIns;
     pData->pDevInsR0 = PDMDEVINS_2_R0PTR(pDevIns);
@@ -1002,16 +1002,16 @@
      */
     rc = PDMDevHlpIOPortRegister(pDevIns,  0x20, 2, (void *)0, picIOPortWrite, picIOPortRead, NULL, NULL, "i8259 PIC #0");
-    if (VBOX_FAILURE(rc))
+    if (RT_FAILURE(rc))
         return rc;
     rc = PDMDevHlpIOPortRegister(pDevIns,  0xa0, 2, (void *)1, picIOPortWrite, picIOPortRead, NULL, NULL, "i8259 PIC #1");
-    if (VBOX_FAILURE(rc))
+    if (RT_FAILURE(rc))
         return rc;
     if (fGCEnabled)
     {
         rc = PDMDevHlpIOPortRegisterGC(pDevIns,  0x20, 2, 0, "picIOPortWrite", "picIOPortRead", NULL, NULL, "i8259 PIC #0");
-        if (VBOX_FAILURE(rc))
+        if (RT_FAILURE(rc))
             return rc;
         rc = PDMDevHlpIOPortRegisterGC(pDevIns,  0xa0, 2, 1, "picIOPortWrite", "picIOPortRead", NULL, NULL, "i8259 PIC #1");
-        if (VBOX_FAILURE(rc))
+        if (RT_FAILURE(rc))
             return rc;
     }
@@ -1019,8 +1019,8 @@
     {
         rc = PDMDevHlpIOPortRegisterR0(pDevIns,  0x20, 2, 0, "picIOPortWrite", "picIOPortRead", NULL, NULL, "i8259 PIC #0");
-        if (VBOX_FAILURE(rc))
+        if (RT_FAILURE(rc))
             return rc;
         rc = PDMDevHlpIOPortRegisterR0(pDevIns,  0xa0, 2, 1, "picIOPortWrite", "picIOPortRead", NULL, NULL, "i8259 PIC #1");
-        if (VBOX_FAILURE(rc))
+        if (RT_FAILURE(rc))
             return rc;
     }
@@ -1028,32 +1028,32 @@
     rc = PDMDevHlpIOPortRegister(pDevIns, 0x4d0, 1, &pData->aPics[0],
                                  picIOPortElcrWrite, picIOPortElcrRead, NULL, NULL, "i8259 PIC #0 - elcr");
-    if (VBOX_FAILURE(rc))
+    if (RT_FAILURE(rc))
         return rc;
     rc = PDMDevHlpIOPortRegister(pDevIns, 0x4d1, 1, &pData->aPics[1],
                                  picIOPortElcrWrite, picIOPortElcrRead, NULL, NULL, "i8259 PIC #1 - elcr");
-    if (VBOX_FAILURE(rc))
+    if (RT_FAILURE(rc))
         return rc;
     if (fGCEnabled)
     {
-        RTGCPTR pDataGC = PDMINS2DATA_GCPTR(pDevIns);
-        rc = PDMDevHlpIOPortRegisterGC(pDevIns, 0x4d0, 1, pDataGC + RT_OFFSETOF(DEVPIC, aPics[0]),
+        RTRCPTR pDataRC = PDMINS_2_DATA_RCPTR(pDevIns);
+        rc = PDMDevHlpIOPortRegisterGC(pDevIns, 0x4d0, 1, pDataRC + RT_OFFSETOF(DEVPIC, aPics[0]),
                                        "picIOPortElcrWrite", "picIOPortElcrRead", NULL, NULL, "i8259 PIC #0 - elcr");
-        if (VBOX_FAILURE(rc))
+        if (RT_FAILURE(rc))
             return rc;
-        rc = PDMDevHlpIOPortRegisterGC(pDevIns, 0x4d1, 1, pDataGC + RT_OFFSETOF(DEVPIC, aPics[1]),
+        rc = PDMDevHlpIOPortRegisterGC(pDevIns, 0x4d1, 1, pDataRC + RT_OFFSETOF(DEVPIC, aPics[1]),
                                        "picIOPortElcrWrite", "picIOPortElcrRead", NULL, NULL, "i8259 PIC #1 - elcr");
-        if (VBOX_FAILURE(rc))
+        if (RT_FAILURE(rc))
             return rc;
     }
     if (fR0Enabled)
     {
-        RTR0PTR pDataR0 = PDMINS2DATA_R0PTR(pDevIns);
+        RTR0PTR pDataR0 = PDMINS_2_DATA_R0PTR(pDevIns);
         rc = PDMDevHlpIOPortRegisterR0(pDevIns, 0x4d0, 1, pDataR0 + RT_OFFSETOF(DEVPIC, aPics[0]),
                                        "picIOPortElcrWrite", "picIOPortElcrRead", NULL, NULL, "i8259 PIC #0 - elcr");
-        if (VBOX_FAILURE(rc))
+        if (RT_FAILURE(rc))
             return rc;
         rc = PDMDevHlpIOPortRegisterR0(pDevIns, 0x4d1, 1, pDataR0 + RT_OFFSETOF(DEVPIC, aPics[1]),
                                        "picIOPortElcrWrite", "picIOPortElcrRead", NULL, NULL, "i8259 PIC #1 - elcr");
-        if (VBOX_FAILURE(rc))
+        if (RT_FAILURE(rc))
             return rc;
     }
@@ -1062,5 +1062,5 @@
                               NULL, picSaveExec, NULL,
                               NULL, picLoadExec, NULL);
-    if (VBOX_FAILURE(rc))
+    if (RT_FAILURE(rc))
         return rc;
 
