From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LFVbq-0002z1-KY for qemu-devel@nongnu.org; Wed, 24 Dec 2008 10:25:18 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LFVbn-0002xx-GW for qemu-devel@nongnu.org; Wed, 24 Dec 2008 10:25:16 -0500 Received: from [199.232.76.173] (port=38186 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LFVbn-0002xu-8O for qemu-devel@nongnu.org; Wed, 24 Dec 2008 10:25:15 -0500 Received: from pop-siberian.atl.sa.earthlink.net ([207.69.195.71]:61605) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LFVbm-0006Da-SX for qemu-devel@nongnu.org; Wed, 24 Dec 2008 10:25:15 -0500 Received: from user-142h2k8.cable.mindspring.com ([72.40.138.136] helo=[192.168.0.90]) by pop-siberian.atl.sa.earthlink.net with esmtp (Exim 3.36 #1) id 1LFVbj-0003wz-00 for qemu-devel@nongnu.org; Wed, 24 Dec 2008 10:25:11 -0500 Message-ID: <49525455.60704@earthlink.net> Date: Wed, 24 Dec 2008 10:25:09 -0500 From: Robert Reif MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------090003040608030107040402" Subject: [Qemu-devel] [PATCH] sun4m use 0 for nonexistent devices Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------090003040608030107040402 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Since we are using c99 initialization for sun4m_hwdef, use 0 rather than -1 for nonexistent devices. --------------090003040608030107040402 Content-Type: text/plain; name="zero.diff.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="zero.diff.txt" --- hw/sun4m.c (revision 6126) +++ hw/sun4m.c (working copy) @@ -505,7 +505,7 @@ cpu_irqs, hwdef->clock_irq); - if (hwdef->idreg_base != (target_phys_addr_t)-1) { + if (hwdef->idreg_base) { static const uint8_t idreg_data[] = { 0xfe, 0x81, 0x01, 0x03 }; idreg_offset = qemu_ram_alloc(sizeof(idreg_data)); @@ -563,7 +563,7 @@ slavio_irq[hwdef->me_irq], cpu_halt[0], &fdc_tc); - if (hwdef->fd_base != (target_phys_addr_t)-1) { + if (hwdef->fd_base) { /* there is zero or one floppy drive */ memset(fd, 0, sizeof(fd)); drive_index = drive_get_index(IF_FLOPPY, 0, 0); @@ -590,7 +590,7 @@ esp_scsi_attach(main_esp, drives_table[drive_index].bdrv, i); } - if (hwdef->cs_base != (target_phys_addr_t)-1) + if (hwdef->cs_base) cs_init(hwdef->cs_base, hwdef->cs_irq, slavio_intctl); kernel_size = sun4m_load_kernel(kernel_filename, initrd_filename, @@ -601,7 +601,7 @@ graphic_height, graphic_depth, hwdef->nvram_machine_id, "Sun4m"); - if (hwdef->ecc_base != (target_phys_addr_t)-1) + if (hwdef->ecc_base) ecc_init(hwdef->ecc_base, slavio_irq[hwdef->ecc_irq], hwdef->ecc_version); @@ -647,7 +647,6 @@ .apc_base = 0x6a000000, .aux1_base = 0x71900000, .aux2_base = 0x71910000, - .ecc_base = -1, .vram_size = 0x00100000, .nvram_size = 0x2000, .esp_irq = 18, @@ -673,7 +672,6 @@ { .iommu_base = 0xfe0000000ULL, .tcx_base = 0xe20000000ULL, - .cs_base = -1, .slavio_base = 0xff0000000ULL, .ms_kb_base = 0xff1000000ULL, .serial_base = 0xff1100000ULL, @@ -700,7 +698,6 @@ .ser_irq = 15, .fd_irq = 22, .me_irq = 30, - .cs_irq = -1, .ecc_irq = 28, .nvram_machine_id = 0x72, .machine_id = ss10_id, @@ -716,15 +713,12 @@ { .iommu_base = 0xfe0000000ULL, .tcx_base = 0xe20000000ULL, - .cs_base = -1, .slavio_base = 0xff0000000ULL, .ms_kb_base = 0xff1000000ULL, .serial_base = 0xff1100000ULL, .nvram_base = 0xff1200000ULL, - .fd_base = -1, .counter_base = 0xff1300000ULL, .intctl_base = 0xff1400000ULL, - .idreg_base = -1, .dma_base = 0xef0081000ULL, .esp_base = 0xef0080000ULL, .le_base = 0xef0060000ULL, @@ -743,7 +737,6 @@ .ser_irq = 15, .fd_irq = 22, .me_irq = 30, - .cs_irq = -1, .ecc_irq = 28, .nvram_machine_id = 0x71, .machine_id = ss600mp_id, @@ -759,7 +752,6 @@ { .iommu_base = 0xfe0000000ULL, .tcx_base = 0xe20000000ULL, - .cs_base = -1, .slavio_base = 0xff0000000ULL, .ms_kb_base = 0xff1000000ULL, .serial_base = 0xff1100000ULL, @@ -786,7 +778,6 @@ .ser_irq = 15, .fd_irq = 22, .me_irq = 30, - .cs_irq = -1, .ecc_irq = 28, .nvram_machine_id = 0x72, .machine_id = ss20_id, @@ -802,7 +793,6 @@ { .iommu_base = 0x10000000, .tcx_base = 0x50000000, - .cs_base = -1, .slavio_base = 0x70000000, .ms_kb_base = 0x71000000, .serial_base = 0x71100000, @@ -817,7 +807,6 @@ .apc_base = 0x71300000, // pmc .aux1_base = 0x71900000, .aux2_base = 0x71910000, - .ecc_base = -1, .vram_size = 0x00100000, .nvram_size = 0x2000, .esp_irq = 18, @@ -828,7 +817,6 @@ .ser_irq = 15, .fd_irq = 22, .me_irq = 30, - .cs_irq = -1, .nvram_machine_id = 0x80, .machine_id = vger_id, .iommu_version = 0x05000000, @@ -843,7 +831,6 @@ { .iommu_base = 0x10000000, .tcx_base = 0x50000000, - .cs_base = -1, .slavio_base = 0x70000000, .ms_kb_base = 0x71000000, .serial_base = 0x71100000, @@ -855,10 +842,8 @@ .dma_base = 0x78400000, .esp_base = 0x78800000, .le_base = 0x78c00000, - .apc_base = -1, .aux1_base = 0x71900000, .aux2_base = 0x71910000, - .ecc_base = -1, .vram_size = 0x00100000, .nvram_size = 0x2000, .esp_irq = 18, @@ -869,7 +854,6 @@ .ser_irq = 15, .fd_irq = 22, .me_irq = 30, - .cs_irq = -1, .nvram_machine_id = 0x80, .machine_id = lx_id, .iommu_version = 0x04000000, @@ -899,7 +883,6 @@ .apc_base = 0x6a000000, .aux1_base = 0x71900000, .aux2_base = 0x71910000, - .ecc_base = -1, .vram_size = 0x00100000, .nvram_size = 0x2000, .esp_irq = 18, @@ -925,7 +908,6 @@ { .iommu_base = 0x10000000, .tcx_base = 0x50000000, - .cs_base = -1, .slavio_base = 0x70000000, .ms_kb_base = 0x71000000, .serial_base = 0x71100000, @@ -940,7 +922,6 @@ .apc_base = 0x6a000000, .aux1_base = 0x71900000, .aux2_base = 0x71910000, - .ecc_base = -1, .vram_size = 0x00100000, .nvram_size = 0x2000, .esp_irq = 18, @@ -951,7 +932,6 @@ .ser_irq = 15, .fd_irq = 22, .me_irq = 30, - .cs_irq = -1, .nvram_machine_id = 0x80, .machine_id = scls_id, .iommu_version = 0x05000000, @@ -966,7 +946,6 @@ { .iommu_base = 0x10000000, .tcx_base = 0x50000000, // XXX - .cs_base = -1, .slavio_base = 0x70000000, .ms_kb_base = 0x71000000, .serial_base = 0x71100000, @@ -981,7 +960,6 @@ .apc_base = 0x6a000000, .aux1_base = 0x71900000, .aux2_base = 0x71910000, - .ecc_base = -1, .vram_size = 0x00100000, .nvram_size = 0x2000, .esp_irq = 18, @@ -992,7 +970,6 @@ .ser_irq = 15, .fd_irq = 22, .me_irq = 30, - .cs_irq = -1, .nvram_machine_id = 0x80, .machine_id = sbook_id, .iommu_version = 0x05000000, @@ -1584,7 +1561,7 @@ slavio_serial_init(hwdef->serial_base, slavio_irq[hwdef->ser_irq], serial_hds[1], serial_hds[0]); - slavio_misc = slavio_misc_init(0, -1, hwdef->aux1_base, -1, + slavio_misc = slavio_misc_init(0, 0, hwdef->aux1_base, 0, slavio_irq[hwdef->me_irq], NULL, &fdc_tc); if (hwdef->fd_base != (target_phys_addr_t)-1) { --------------090003040608030107040402--