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.


fixed stupid errors
Jack Lange [Mon, 28 Apr 2008 23:19:30 +0000 (23:19 +0000)]
palacios/include/palacios/vmm_intr.h
palacios/src/devices/8259a.c
palacios/src/geekos/vm.c

index 5430848..7223cd4 100644 (file)
@@ -63,6 +63,8 @@ int intr_pending(struct vm_intr * intr);
 uint_t get_intr_number(struct vm_intr * intr);
 intr_types_t get_intr_type(struct vm_intr * intr);
 
+/*
 int start_irq(struct vm_intr * intr);
 int end_irq(struct vm_intr * intr, int irq);
+*/
 #endif
index efa14e4..c674d74 100644 (file)
@@ -158,11 +158,13 @@ static int pic_get_intr_number(void * private_data) {
   for (i = 0; i < 16; i++) {
     if (i <= 7) {
       if (((state->master_irr & ~(state->master_imr)) >> i) == 0x01) {
-       return i;
+       state->master_isr |= (0x1 << i);
+       return i + state->master_icw2;
       }
     } else {
       if (((state->slave_irr & ~(state->slave_imr)) >> i) == 0x01) {
-       return i;
+       state->slave_isr |= (0x1 << i);
+       return i + state->slave_icw2;
       }
     }
   }
@@ -171,22 +173,23 @@ static int pic_get_intr_number(void * private_data) {
 }
 
 
-static int begin_irq(void * private_data, int irq) {
+static int pic_begin_irq(void * private_data, int irq) {
 
   return 0;
 }
 
-static int end_irq(void * private_data, int irq) {
+/*
+static int pic_end_irq(void * private_data, int irq) {
 
   return 0;
 }
-
+*/
 
 static struct intr_ctrl_ops intr_ops = {
   .intr_pending = pic_intr_pending,
   .get_intr_number = pic_get_intr_number,
   .raise_intr = pic_raise_intr,
-  .begin_irq = begin_irq,
+  .begin_irq = pic_begin_irq,
 };
 
 
@@ -267,11 +270,14 @@ int write_master_port1(ushort_t port, void * src, uint_t length, struct vm_devic
   } else if (state->master_state == READY) {
     if (IS_OCW2(cw)) {
       // handle the EOI here
-      struct ocw2 * cw2 =  (struct ocw2 *)cw;
+      struct ocw2 * cw2 =  (struct ocw2*)&cw;
       
       if ((cw2->EOI) && (!cw2->R) && (cw2->SL)) {
        // specific EOI;
        state->master_isr &= ~(0x01 << cw2->level);
+      } else if ((cw2->EOI) & (!cw2->R) && (!cw2->SL)) {
+       // Non-specific EOI
+       
       } else {
        // error;
       }
@@ -347,11 +353,13 @@ int write_slave_port1(ushort_t port, void * src, uint_t length, struct vm_device
   } else if (state->slave_state == READY) {
     if (IS_OCW2(cw)) {
       // handle the EOI here
-      struct ocw2 * cw2 =  (struct ocw2 *)cw;
+      struct ocw2 * cw2 =  (struct ocw2 *)&cw;
       
       if ((cw2->EOI) && (!cw2->R) && (cw2->SL)) {
        // specific EOI;
        state->slave_isr &= ~(0x01 << cw2->level);
+      } else if ((cw2->EOI) & (!cw2->R) && (!cw2->SL)) {
+       // non specific EOI
       } else {
        // error;
       }
index 75714c4..02bbd28 100644 (file)
@@ -176,7 +176,8 @@ int RunVMM(struct Boot_Info * bootInfo) {
     os_hooks.free = &VMM_Free;
     os_hooks.vaddr_to_paddr = &Identity;
     os_hooks.paddr_to_vaddr = &Identity;
-
+    os_hooks.hook_interrupt = &hook_irq_stub;
+    os_hooks.ack_irq = &ack_irq;
  
     //   DumpGDT();
     Init_VMM(&os_hooks, &vmm_ops);