x86: use qemu_log_mask on triple faults (Chris Wright)
[qemu] / console.c
index 4bcdac1..3f2794e 100644 (file)
--- a/console.c
+++ b/console.c
@@ -1246,9 +1246,6 @@ static TextConsole *new_console(DisplayState *ds, console_type_t console_type)
     if (nb_consoles >= MAX_CONSOLES)
         return NULL;
     s = qemu_mallocz(sizeof(TextConsole));
-    if (!s) {
-        return NULL;
-    }
     if (!active_console || ((active_console->console_type != GRAPHIC_CONSOLE) &&
         (console_type == GRAPHIC_CONSOLE))) {
         active_console = s;
@@ -1280,8 +1277,6 @@ DisplayState *graphic_console_init(vga_hw_update_ptr update,
     DisplayState *ds;
 
     ds = (DisplayState *) qemu_mallocz(sizeof(DisplayState));
-    if (ds == NULL)
-        return NULL;
     ds->surface = qemu_create_displaysurface(640, 480, 32, 640 * 4);
 
     s = new_console(ds, GRAPHIC_CONSOLE);
@@ -1402,8 +1397,6 @@ CharDriverState *text_console_init(const char *p)
     CharDriverState *chr;
 
     chr = qemu_mallocz(sizeof(CharDriverState));
-    if (!chr)
-        return NULL;
 
     if (n_text_consoles == 128) {
         fprintf(stderr, "Too many text consoles\n");
@@ -1470,6 +1463,9 @@ PixelFormat qemu_different_endianness_pixelformat(int bpp)
             pf.rshift = 0;
             pf.gshift = 8;
             pf.bshift = 16;
+            pf.rbits = 8;
+            pf.gbits = 8;
+            pf.bbits = 8;
             break;
         case 32:
             pf.rmask = 0x0000FF00;
@@ -1484,6 +1480,10 @@ PixelFormat qemu_different_endianness_pixelformat(int bpp)
             pf.rshift = 8;
             pf.gshift = 16;
             pf.bshift = 24;
+            pf.rbits = 8;
+            pf.gbits = 8;
+            pf.bbits = 8;
+            pf.abits = 8;
             break;
         default:
             break;
@@ -1512,6 +1512,9 @@ PixelFormat qemu_default_pixelformat(int bpp)
             pf.rshift = 11;
             pf.gshift = 5;
             pf.bshift = 0;
+            pf.rbits = 5;
+            pf.gbits = 6;
+            pf.bbits = 5;
             break;
         case 24:
             pf.rmask = 0x00FF0000;
@@ -1523,6 +1526,9 @@ PixelFormat qemu_default_pixelformat(int bpp)
             pf.rshift = 16;
             pf.gshift = 8;
             pf.bshift = 0;
+            pf.rbits = 8;
+            pf.gbits = 8;
+            pf.bbits = 8;
         case 32:
             pf.rmask = 0x00FF0000;
             pf.gmask = 0x0000FF00;
@@ -1535,6 +1541,10 @@ PixelFormat qemu_default_pixelformat(int bpp)
             pf.rshift = 16;
             pf.gshift = 8;
             pf.bshift = 0;
+            pf.rbits = 8;
+            pf.gbits = 8;
+            pf.bbits = 8;
+            pf.abits = 8;
             break;
         default:
             break;
@@ -1545,10 +1555,6 @@ PixelFormat qemu_default_pixelformat(int bpp)
 DisplaySurface* qemu_create_displaysurface(int width, int height, int bpp, int linesize)
 {
     DisplaySurface *surface = (DisplaySurface*) qemu_mallocz(sizeof(DisplaySurface));
-    if (surface == NULL) {
-        fprintf(stderr, "qemu_create_displaysurface: malloc failed\n");
-        exit(1);
-    }
 
     surface->width = width;
     surface->height = height;
@@ -1560,10 +1566,6 @@ DisplaySurface* qemu_create_displaysurface(int width, int height, int bpp, int l
     surface->flags = QEMU_ALLOCATED_FLAG;
 #endif
     surface->data = (uint8_t*) qemu_mallocz(surface->linesize * surface->height);
-    if (surface->data == NULL) {
-        fprintf(stderr, "qemu_create_displaysurface: malloc failed\n");
-        exit(1);
-    }
 
     return surface;
 }
@@ -1579,10 +1581,6 @@ DisplaySurface* qemu_resize_displaysurface(DisplaySurface *surface,
         surface->data = (uint8_t*) qemu_realloc(surface->data, surface->linesize * surface->height);
     else
         surface->data = (uint8_t*) qemu_malloc(surface->linesize * surface->height);
-    if (surface->data == NULL) {
-        fprintf(stderr, "qemu_resize_displaysurface: malloc failed\n");
-        exit(1);
-    }
 #ifdef WORDS_BIGENDIAN
     surface->flags = QEMU_ALLOCATED_FLAG | QEMU_BIG_ENDIAN_FLAG;
 #else
@@ -1596,10 +1594,6 @@ DisplaySurface* qemu_create_displaysurface_from(int width, int height, int bpp,
                                               int linesize, uint8_t *data)
 {
     DisplaySurface *surface = (DisplaySurface*) qemu_mallocz(sizeof(DisplaySurface));
-    if (surface == NULL) {
-        fprintf(stderr, "qemu_create_displaysurface_from: malloc failed\n");
-        exit(1);
-    }
 
     surface->width = width;
     surface->height = height;