From: Jack Lange <jarusl@cs.northwestern.edu>
Date: Tue, 14 Oct 2008 19:22:04 +0000 (-0500)
Subject: General fixes and clean up
X-Git-Tag: 1.0^2~53
X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=f2c976eb850d2633d2bc05011a66bbc91a432204;p=palacios.git

General fixes and clean up
---

diff --git a/palacios/build/Makefile b/palacios/build/Makefile
index 0cfd820..7a4c23d 100644
--- a/palacios/build/Makefile
+++ b/palacios/build/Makefile
@@ -78,7 +78,7 @@ endif
 ifeq ($(DEBUG_INTERRUPTS),1)
 DEBUG_SECTIONS := $(DEBUG_SECTIONS) -DDEBUG_INTERRUPTS
 else 
-ifeq ($(DEBUG_DEBUG_INTERRUPTS),0) 
+ifeq ($(DEBUG_INTERRUPTS),0) 
 DEBUG_SECTIONS := $(DEBUG_SECTIONS) -UDEBUG_INTERRUPTS
 endif
 endif
@@ -147,6 +147,15 @@ DEBUG_SECTIONS := $(DEBUG_SECTIONS) -UDEBUG_RAMDISK
 endif
 endif
 
+ifeq ($(TRACE_RAMDISK),1)
+DEBUG_SECTIONS := $(DEBUG_SECTIONS -DTRACE_RAMDISK
+else
+ifeq ($(TRACE_RAMDSK),0)
+DEBUG_SECTIONS := $(DEBUG_SECTIONS) -UTRACE_RAMDISK
+endif
+endif
+
+
 
 #DEBUG_SECTIONS := $(DEBUG_SECTIONS) -DTEST_NE2K
 
@@ -330,7 +339,7 @@ FD_SECTORS_PER_TRACK := $(PERL) $(PROJECT_ROOT)/scripts/numsecs_per_track
 
 # Flags used for all C source files
 #GENERAL_OPTS := -O -Wall $(EXTRA_C_OPTS) $(VMM_FLAGS) -fPIC #-fvisibility=hidden
-GENERAL_OPTS :=  -Wall $(EXTRA_C_OPTS) $(VMM_FLAGS) -fPIC #-fvisibility=hidden
+GENERAL_OPTS :=  -O -Wall  $(EXTRA_C_OPTS) $(VMM_FLAGS) -fPIC #-fvisibility=hidden
 CC_GENERAL_OPTS := $(GENERAL_OPTS) -Werror 
 
 # Flags used for VMM C source files
diff --git a/palacios/include/geekos/socket.h b/palacios/include/geekos/socket.h
deleted file mode 100644
index fbc47ed..0000000
--- a/palacios/include/geekos/socket.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* (c) 2008, Jack Lange <jarusl@cs.northwestern.edu> */
-/* (c) 2008, The V3VEE Project <http://www.v3vee.org> */
-
-#ifndef GEEKOS_SOCKET_H
-#define GEEKOS_SOCKET_H
-
-#include <geekos/ring_buffer.h>
-#include <geekos/kthread.h>
-
-#ifdef UIP
-#include <uip/uip.h>
-
-
-typedef enum {WAITING, CLOSED, LISTEN, ESTABLISHED} sock_state_t;
-
-struct socket {
-  int in_use;
-  struct Thread_Queue recv_wait_queue;
-  struct ring_buffer *send_buf;
-  struct ring_buffer *recv_buf;
-  struct uip_conn *con;
-
-  sock_state_t state;
-
-};
-
-
-void init_socket_layer();
-
-int connect(const uchar_t ip_addr[4], ushort_t port);
-int close(const int sockfd);
-int recv(int sockfd, void * buf, uint_t len);
-int send(int sockfd, void * buf, uint_t len);
-
-void set_ip_addr(uchar_t addr[4]);
-
-#endif /* UIP */
-
-
-#endif
diff --git a/palacios/src/devices/8259a.c b/palacios/src/devices/8259a.c
index b14bfe5..44c73d1 100644
--- a/palacios/src/devices/8259a.c
+++ b/palacios/src/devices/8259a.c
@@ -203,22 +203,20 @@ static int pic_raise_intr(void * private_data, int irq) {
 }
 
 
-/*Zheng 07/30/2008*/
-
-static int pic_lower_intr(void *private_data, int irq_no) {
+static int pic_lower_intr(void *private_data, int irq) {
 
   struct pic_internal *state = (struct pic_internal*)private_data;
 
-  PrintDebug("[pic_lower_intr] IRQ line %d now low\n", (unsigned) irq_no);
-  if (irq_no <= 7) {
+  PrintDebug("[pic_lower_intr] IRQ line %d now low\n", irq);
+  if (irq <= 7) {
 
-    state->master_irr &= ~(1 << irq_no);
+    state->master_irr &= ~(1 << irq);
     if ((state->master_irr & ~(state->master_imr)) == 0) {
       PrintDebug("\t\tFIXME: Master maybe should do sth\n");
     }
-  } else if ((irq_no > 7) && (irq_no <= 15)) {
+  } else if ((irq > 7) && (irq < 16)) {
 
-    state->slave_irr &= ~(1 << (irq_no - 8));
+    state->slave_irr &= ~(1 << (irq - 8));
     if ((state->slave_irr & (~(state->slave_imr))) == 0) {
       PrintDebug("\t\tFIXME: Slave maybe should do sth\n");
     }
@@ -316,13 +314,13 @@ static int pic_end_irq(void * private_data, int irq) {
 */
 
 
-/*Zheng 07/30/2008*/
+
 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 = pic_begin_irq,
-  .lower_intr = pic_lower_intr, //Zheng added
+  .lower_intr = pic_lower_intr, 
 
 };
 
diff --git a/palacios/src/palacios/vmm_config.c b/palacios/src/palacios/vmm_config.c
index fa4fe80..ba2529a 100644
--- a/palacios/src/palacios/vmm_config.c
+++ b/palacios/src/palacios/vmm_config.c
@@ -364,6 +364,8 @@ int config_guest(struct guest_info * info, struct v3_vm_config * config_ptr) {
   
 
   if (!use_ramdisk) {
+    PrintDebug("Hooking IDE IRQs\n");
+
     //primary ide
     v3_hook_passthrough_irq(info, 14);
   
diff --git a/palacios/src/palacios/vmm_intr.c b/palacios/src/palacios/vmm_intr.c
index 6bdca1a..84a645b 100644
--- a/palacios/src/palacios/vmm_intr.c
+++ b/palacios/src/palacios/vmm_intr.c
@@ -183,7 +183,7 @@ int v3_lower_irq(struct guest_info * info, int irq) {
       (info->intr_state.controller->lower_intr)) {
     info->intr_state.controller->lower_intr(info->intr_state.controller_state, irq);
   } else {
-    PrintDebug("There is no registered Interrupt Controller... (NULL POINTER)\n");
+    PrintError("There is no registered Interrupt Controller... (NULL POINTER)\n");
     return -1;
   }
 
@@ -202,7 +202,7 @@ int v3_raise_irq(struct guest_info * info, int irq) {
       (info->intr_state.controller->raise_intr)) {
     info->intr_state.controller->raise_intr(info->intr_state.controller_state, irq);
   } else {
-    PrintDebug("There is no registered Interrupt Controller... (NULL POINTER)\n");
+    PrintError("There is no registered Interrupt Controller... (NULL POINTER)\n");
     return -1;
   }