direct-io.hg

changeset 14432:f40079acf646

minios: Various small fixes.

- Fixed type of variables in hypervisor.c.
- Fixed not removing a waiter from watch_queue.
- Make wait_for_watch() global accessible.

Signed-off-by: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
author kaf24@firebug.cl.cam.ac.uk
date Mon Mar 19 09:34:42 2007 +0000 (2007-03-19)
parents b795b90e4ff6
children 066b66ce1f98
files extras/mini-os/hypervisor.c extras/mini-os/include/wait.h extras/mini-os/include/xenbus.h extras/mini-os/xenbus/xenbus.c
line diff
     1.1 --- a/extras/mini-os/hypervisor.c	Mon Mar 19 09:32:52 2007 +0000
     1.2 +++ b/extras/mini-os/hypervisor.c	Mon Mar 19 09:34:42 2007 +0000
     1.3 @@ -35,8 +35,8 @@
     1.4  
     1.5  void do_hypervisor_callback(struct pt_regs *regs)
     1.6  {
     1.7 -    u32 	       l1, l2;
     1.8 -    unsigned int   l1i, l2i, port;
     1.9 +    unsigned long  l1, l2, l1i, l2i;
    1.10 +    unsigned int   port;
    1.11      int            cpu = 0;
    1.12      shared_info_t *s = HYPERVISOR_shared_info;
    1.13      vcpu_info_t   *vcpu_info = &s->vcpu_info[cpu];
     2.1 --- a/extras/mini-os/include/wait.h	Mon Mar 19 09:32:52 2007 +0000
     2.2 +++ b/extras/mini-os/include/wait.h	Mon Mar 19 09:34:42 2007 +0000
     2.3 @@ -74,6 +74,13 @@ static inline void wake_up(struct wait_q
     2.4      local_irq_restore(flags);   \
     2.5  } while (0)
     2.6  
     2.7 +#define remove_waiter(w) do {   \
     2.8 +    unsigned long flags;        \
     2.9 +    local_irq_save(flags);      \
    2.10 +    remove_wait_queue(&w);      \
    2.11 +    local_irq_restore(flags);   \
    2.12 +} while (0)
    2.13 +
    2.14  #define wait_event(wq, condition) do{             \
    2.15      unsigned long flags;                          \
    2.16      if(condition)                                 \
     3.1 --- a/extras/mini-os/include/xenbus.h	Mon Mar 19 09:32:52 2007 +0000
     3.2 +++ b/extras/mini-os/include/xenbus.h	Mon Mar 19 09:34:42 2007 +0000
     3.3 @@ -13,6 +13,7 @@ void init_xenbus(void);
     3.4  char *xenbus_read(xenbus_transaction_t xbt, const char *path, char **value);
     3.5  
     3.6  char *xenbus_watch_path(xenbus_transaction_t xbt, const char *path);
     3.7 +void wait_for_watch(void);
     3.8  char* xenbus_wait_for_value(const char*,const char*);
     3.9  
    3.10  /* Associates a value with a path.  Returns a malloc'd error string on
     4.1 --- a/extras/mini-os/xenbus/xenbus.c	Mon Mar 19 09:32:52 2007 +0000
     4.2 +++ b/extras/mini-os/xenbus/xenbus.c	Mon Mar 19 09:34:42 2007 +0000
     4.3 @@ -72,11 +72,12 @@ static void memcpy_from_ring(const void 
     4.4      memcpy(dest + c1, ring, c2);
     4.5  }
     4.6  
     4.7 -static inline void wait_for_watch(void)
     4.8 +void wait_for_watch(void)
     4.9  {
    4.10      DEFINE_WAIT(w);
    4.11      add_waiter(w,watch_queue);
    4.12      schedule();
    4.13 +    remove_waiter(w);
    4.14      wake(current);
    4.15  }
    4.16