]> Git Repo - qemu.git/blobdiff - hw/tc58128.c
mcf5206: convert to memory API
[qemu.git] / hw / tc58128.c
index 21e808547e54ac3a48c35d31a224dd3a9f177ca0..4ce80b18f3f6bc7fd618d64434673c52b1a9c825 100644 (file)
@@ -1,6 +1,6 @@
 #include "hw.h"
 #include "sh.h"
-#include "sysemu.h"
+#include "loader.h"
 
 #define CE1  0x0100
 #define CE2  0x0200
@@ -30,12 +30,8 @@ static void init_dev(tc58128_dev * dev, const char *filename)
     int ret, blocks;
 
     dev->state = WAIT;
-    dev->flash_contents = qemu_mallocz(FLASH_SIZE);
+    dev->flash_contents = g_malloc(FLASH_SIZE);
     memset(dev->flash_contents, 0xff, FLASH_SIZE);
-    if (!dev->flash_contents) {
-       fprintf(stderr, "could not alloc memory for flash\n");
-       exit(1);
-    }
     if (filename) {
        /* Load flash image skipping the first block */
        ret = load_image(filename, dev->flash_contents + 528 * 32);
@@ -81,7 +77,7 @@ static void handle_command(tc58128_dev * dev, uint8_t command)
        break;
     default:
        fprintf(stderr, "unknown flash command 0x%02x\n", command);
-       assert(0);
+        abort();
     }
 }
 
@@ -109,12 +105,12 @@ static void handle_address(tc58128_dev * dev, uint8_t data)
            break;
        default:
            /* Invalid data */
-           assert(0);
+            abort();
        }
        dev->address_cycle++;
        break;
     default:
-       assert(0);
+        abort();
     }
 }
 
@@ -163,7 +159,7 @@ static int tc58128_cb(uint16_t porta, uint16_t portb,
        *periph_pdtra &= 0xff00;
        *periph_pdtra |= handle_read(&tc58128_devs[dev]);
     } else {
-       assert(0);
+        abort();
     }
     return 1;
 }
This page took 0.026235 seconds and 4 git commands to generate.