Commit 612ae966 authored by kaf24's avatar kaf24

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: default avatarDietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
parent c4d4878d
......@@ -35,8 +35,8 @@
void do_hypervisor_callback(struct pt_regs *regs)
{
u32 l1, l2;
unsigned int l1i, l2i, port;
unsigned long l1, l2, l1i, l2i;
unsigned int port;
int cpu = 0;
shared_info_t *s = HYPERVISOR_shared_info;
vcpu_info_t *vcpu_info = &s->vcpu_info[cpu];
......
......@@ -74,6 +74,13 @@ static inline void wake_up(struct wait_queue_head *head)
local_irq_restore(flags); \
} while (0)
#define remove_waiter(w) do { \
unsigned long flags; \
local_irq_save(flags); \
remove_wait_queue(&w); \
local_irq_restore(flags); \
} while (0)
#define wait_event(wq, condition) do{ \
unsigned long flags; \
if(condition) \
......
......@@ -13,6 +13,7 @@ void init_xenbus(void);
char *xenbus_read(xenbus_transaction_t xbt, const char *path, char **value);
char *xenbus_watch_path(xenbus_transaction_t xbt, const char *path);
void wait_for_watch(void);
char* xenbus_wait_for_value(const char*,const char*);
/* Associates a value with a path. Returns a malloc'd error string on
......
......@@ -72,11 +72,12 @@ static void memcpy_from_ring(const void *Ring,
memcpy(dest + c1, ring, c2);
}
static inline void wait_for_watch(void)
void wait_for_watch(void)
{
DEFINE_WAIT(w);
add_waiter(w,watch_queue);
schedule();
remove_waiter(w);
wake(current);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment