summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Sapountzis <gsap7@yahoo.gr>2007-03-18 16:40:07 +0200
committerGeorge Sapountzis <gsap7@yahoo.gr>2007-03-21 20:18:56 +0200
commit3dfdba195f1ff794ab00585ab80e7ea6ac92fcf4 (patch)
tree01cbfdc7ad2009066811cceba1cea48a62b3a256
parent321db6d87c9110654ab386e5ec270116eca1e04f (diff)
[mach64] Make mapping code friendlier to pci-rework source-code compatibility.
-rw-r--r--src/atividmem.c54
1 files changed, 18 insertions, 36 deletions
diff --git a/src/atividmem.c b/src/atividmem.c
index 947f2659..7ab203e9 100644
--- a/src/atividmem.c
+++ b/src/atividmem.c
@@ -182,7 +182,7 @@ ATIMapApertures
PCI_CFG_TAG(pVideo), 0x000A0000U, 0x00010000U);
if (!pATI->pBank)
- return FALSE;
+ goto bail;
pATI->Mapped = TRUE;
}
@@ -205,17 +205,7 @@ ATIMapApertures
(1U << pVideo->size[0]));
if (!pATI->pMemoryLE)
- {
-
-#ifndef AVOID_CPIO
-
- ATIUnmapVGA(iScreen, pATI);
-
-#endif /* AVOID_CPIO */
-
- pATI->Mapped = FALSE;
- return FALSE;
- }
+ goto bail;
pATI->Mapped = TRUE;
@@ -246,18 +236,7 @@ ATIMapApertures
getpagesize());
if (!pATI->pMMIO)
- {
- ATIUnmapLinear(iScreen, pATI);
-
-#ifndef AVOID_CPIO
-
- ATIUnmapVGA(iScreen, pATI);
-
-#endif /* AVOID_CPIO */
-
- pATI->Mapped = FALSE;
- return FALSE;
- }
+ goto bail;
pATI->Mapped = TRUE;
@@ -282,18 +261,7 @@ ATIMapApertures
* extended BE aperture which would give a size of 8MB).
*/
if (mmio_offset + 0x00000400U > linear_size)
- {
- ATIUnmapLinear(iScreen, pATI);
-
-#ifndef AVOID_CPIO
-
- ATIUnmapVGA(iScreen, pATI);
-
-#endif /* AVOID_CPIO */
-
- pATI->Mapped = FALSE;
- return FALSE;
- }
+ goto bail;
pATI->Mapped = TRUE;
@@ -304,6 +272,20 @@ ATIMapApertures
}
return TRUE;
+
+bail:
+
+ ATIUnmapLinear(iScreen, pATI);
+
+#ifndef AVOID_CPIO
+
+ ATIUnmapVGA(iScreen, pATI);
+
+#endif /* AVOID_CPIO */
+
+ pATI->Mapped = FALSE;
+
+ return FALSE;
}
/*