Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


checkpoint changes to get "reset to BIOS" working.
[palacios.git] / palacios / include / devices / pci.h
index bfa9052..ff2e27d 100644 (file)
 
 #include <devices/pci_types.h>
 
+
 struct vm_device;
 
 
 typedef enum { PCI_BAR_IO, 
               PCI_BAR_MEM24, 
               PCI_BAR_MEM32, 
-              PCI_BAR_MEM64_LOW, 
-              PCI_BAR_MEM64_HIGH, 
+              PCI_BAR_MEM64_LO, 
+              PCI_BAR_MEM64_HI, 
               PCI_BAR_PASSTHROUGH,
               PCI_BAR_NONE } pci_bar_type_t;
 
@@ -50,6 +51,8 @@ typedef enum {PCI_STD_DEVICE, PCI_TO_PCI_BRIDGE, PCI_CARDBUS, PCI_MULTIFUNCTION,
 
 #define PCI_AUTO_DEV_NUM (-1)
 
+struct guest_info;
+
 struct pci_device;
 
 struct v3_pci_bar {
@@ -66,8 +69,8 @@ struct v3_pci_bar {
        struct {
            int num_ports;
            uint16_t default_base_port;
-           int (*io_read)(struct guest_info * core, ushort_t port, void * dst, uint_t length, void * private_data);
-           int (*io_write)(struct guest_info * core, ushort_t port, void * src, uint_t length, void * private_data);
+           int (*io_read)(struct guest_info * core, uint16_t port, void * src, uint_t length, void * private_data);
+           int (*io_write)(struct guest_info * core, uint16_t port, void * src, uint_t length, void * private_data);
        };
        
        struct {
@@ -80,18 +83,27 @@ struct v3_pci_bar {
 
     // Internal PCI data
     uint32_t val;
-    int updated;
+    uint8_t updated;
     uint32_t mask;
 };
 
 
 #define PCI_IO_MASK 0xfffffffc
-#define PCI_MEM_MASK 0xfffffff0
 #define PCI_MEM24_MASK 0x000ffff0
+#define PCI_MEM_MASK 0xfffffff0
+#define PCI_MEM64_MASK_HI 0xffffffff
+#define PCI_MEM64_MASK_LO 0xfffffff0
+#define PCI_EXP_ROM_MASK 0xfffff800
+
+
 
 #define PCI_IO_BASE(bar_val) (bar_val & PCI_IO_MASK)
-#define PCI_MEM32_BASE(bar_val) (bar_val & PCI_MEM_MASK)
 #define PCI_MEM24_BASE(bar_val) (bar_val & PCI_MEM24_MASK)
+#define PCI_MEM32_BASE(bar_val) (bar_val & PCI_MEM_MASK)
+#define PCI_MEM64_BASE_HI(bar_val) (bar_val & PCI_MEM64_MASK_HI)
+#define PCI_MEM64_BASE_LO(bar_val) (bar_val & PCI_MEM64_MASK_LO)
+#define PCI_EXP_ROM_BASE(rom_val) (rom_val & PCI_EXP_ROM_MASK)
+
 
 struct pci_device {
 
@@ -125,13 +137,13 @@ struct pci_device {
     int (*config_update)(uint_t reg_num, void * src, uint_t length, void * priv_data);
 
     int (*cmd_update)(struct pci_device * pci_dev, uchar_t io_enabled, uchar_t mem_enabled);
-    int (*ext_rom_update)(struct pci_device * pci_dev);
+    int (*exp_rom_update)(struct pci_device * pci_dev, uint32_t * src, void * private_data);
 
     int (*config_write)(uint_t reg_num, void * src, uint_t length, void * private_data);
     int (*config_read)(uint_t reg_num, void * dst, uint_t length, void * private_data);
 
 
-    int ext_rom_update_flag;
+    int exp_rom_update_flag;
     int bar_update_flag;
 
     void * priv_data;
@@ -139,9 +151,9 @@ struct pci_device {
 
 
 int v3_pci_set_irq_bridge(struct vm_device * pci_bus, int bus_num,
-                         int (*raise_pci_irq)(struct vm_device * dev, struct pci_device * pci_dev), 
-                         int (*lower_pci_irq)(struct vm_device * dev, struct pci_device * pci_dev), 
-                         struct vm_device * bridge_dev);
+                         int (*raise_pci_irq)(struct pci_device * pci_dev, void * dev_data), 
+                         int (*lower_pci_irq)(struct pci_device * pci_dev, void * dev_data), 
+                         void * dev_data);
 
 
 int v3_pci_raise_irq(struct vm_device * pci_bus, int bus_num, struct pci_device * dev);
@@ -157,7 +169,7 @@ v3_pci_register_device(struct vm_device * pci,
                       struct v3_pci_bar * bars,
                       int (*config_update)(uint_t reg_num, void * src, uint_t length, void * private_data),
                       int (*cmd_update)(struct pci_device *pci_dev, uchar_t io_enabled, uchar_t mem_enabled),
-                      int (*ext_rom_update)(struct pci_device *pci_dev),
+                      int (*exp_rom_update)(struct pci_device * pci_dev, uint32_t * src, void * private_data),
                       void * priv_data);