]> git.proxmox.com Git - mirror_qemu.git/commitdiff
cmd646: add constants for CNTRL register access
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Fri, 8 Aug 2014 16:23:32 +0000 (17:23 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Fri, 15 Aug 2014 17:03:13 +0000 (18:03 +0100)
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
hw/ide/cmd646.c

index a8e35fe38f3b200ef17c363dfe9bc3d3a1ce7b07..d8395ef248c1e265bfdb870db7b1b1d091d91cc0 100644 (file)
@@ -33,6 +33,9 @@
 #include <hw/ide/pci.h>
 
 /* CMD646 specific */
+#define CNTRL          0x51
+#define   CNTRL_EN_CH0 0x04
+#define   CNTRL_EN_CH1 0x08
 #define MRDMODE                0x71
 #define   MRDMODE_INTR_CH0     0x04
 #define   MRDMODE_INTR_CH1     0x08
@@ -269,10 +272,10 @@ static int pci_cmd646_ide_initfn(PCIDevice *dev)
 
     pci_conf[PCI_CLASS_PROG] = 0x8f;
 
-    pci_conf[0x51] = 0x04; // enable IDE0
+    pci_conf[CNTRL] = CNTRL_EN_CH0; // enable IDE0
     if (d->secondary) {
         /* XXX: if not enabled, really disable the seconday IDE controller */
-        pci_conf[0x51] |= 0x08; /* enable IDE1 */
+        pci_conf[CNTRL] |= CNTRL_EN_CH1; /* enable IDE1 */
     }
 
     setup_cmd646_bar(d, 0);