Displaying 2 results from an estimated 2 matches for "net_sem".
Did you mean:
net_sam
2012 Nov 28
4
[minios] Add xenbus shutdown control support
...ain(&start_info);
diff -r fdf241ea6ff4 extras/mini-os/test.c
--- a/extras/mini-os/test.c Wed Nov 28 21:29:18 2012 +0100
+++ b/extras/mini-os/test.c Wed Nov 28 22:53:42 2012 +0100
@@ -46,6 +46,7 @@
#include <xen/version.h>
static struct netfront_dev *net_dev;
+static struct semaphore net_sem = __SEMAPHORE_INITIALIZER(net_sem, 0);
void test_xenbus(void);
@@ -70,12 +71,14 @@
static void netfront_thread(void *p)
{
net_dev = init_netfront(NULL, NULL, NULL, NULL);
+ up(&net_sem);
}
static struct blkfront_dev *blk_dev;
static struct blkfront_info blk_info;
static uin...
2012 Dec 21
0
mini-os: Notify shutdown through weak function call instead of wake queue
...21 02:01:46 2012 +0100
@@ -45,6 +45,10 @@
#include <xen/features.h>
#include <xen/version.h>
+static unsigned int do_shutdown = 0;
+static unsigned int shutdown_reason;
+static DECLARE_WAIT_QUEUE_HEAD(shutdown_queue);
+
static struct netfront_dev *net_dev;
static struct semaphore net_sem = __SEMAPHORE_INITIALIZER(net_sem, 0);
@@ -487,6 +491,15 @@
#endif
}
+void app_shutdown(unsigned reason)
+{
+ shutdown_reason = reason;
+ wmb();
+ do_shutdown = 1;
+ wmb();
+ wake_up(&shutdown_queue);
+}
+
static void shutdown_thread(void *p)
{
DEFINE_WAIT(w);