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.


Bug fixes in 8259: now handles irqs>=8
[palacios.git] / palacios / src / devices / generic.c
index 4f3ae7a..8d329f5 100644 (file)
@@ -316,14 +316,38 @@ static struct vm_device_ops dev_ops = {
 
 
 struct vm_device *create_generic(generic_port_range_type    port_ranges[], 
-                                uint_t                     num_port_ranges,
                                 generic_address_range_type address_ranges[],
-                                uint_t                     num_address_ranges,
-                                generic_irq_range_type     irq_ranges[],
-                                uint_t                     num_irq_ranges)
+                                generic_irq_range_type     irq_ranges[])
 {
   struct generic_internal * generic_state = (struct generic_internal *)V3_Malloc(sizeof(struct generic_internal));
+  int i;
+  uint_t num_port_ranges, num_address_ranges, num_irq_ranges;
+
+  num_port_ranges=0;
+  if (port_ranges!=NULL) { 
+    i=0;
+    while (port_ranges[i]!=NULL && 
+          !(port_ranges[i][0]==0 && port_ranges[i][1]==0 && port_ranges[i][2]==0)) 
+      { num_port_ranges++; i++; }
+  }
+
+  
+  num_address_ranges=0;
+  if (address_ranges!=NULL) { 
+    i=0;
+    while (address_ranges[i]!=NULL  && 
+          !(address_ranges[i][0]==0 && address_ranges[i][1]==0 && address_ranges[i][2]==0)) 
+      { num_address_ranges++; i++; }
+  }
 
+  num_irq_ranges=0;
+  if (irq_ranges!=NULL) { 
+    i=0;
+    while (irq_ranges[i]!=NULL && 
+          !(irq_ranges[i][0]==0 && irq_ranges[i][1]==0 && irq_ranges[i][2]==0) ) 
+      { num_irq_ranges++; i++; }
+  }
+    
 
   generic_state->num_port_ranges = num_port_ranges;