]> xenbits.xensource.com Git - rumpuser-xen.git/commitdiff
update to latest src-netbsd
authorAntti Kantee <pooka@iki.fi>
Wed, 17 Dec 2014 01:13:56 +0000 (01:13 +0000)
committerAntti Kantee <pooka@iki.fi>
Wed, 17 Dec 2014 01:13:56 +0000 (01:13 +0000)
Shuffle _lwp a bit to accommodate to latest source, also add
some stubs we need now.

buildrump.sh
buildxen.sh
lib/_lwp.c
lib/emul.c
lib/libc_stubs.c
pthread_makelwp_rumprunxen.c [new file with mode: 0644]
rumprunxen_makelwp.h [new file with mode: 0644]
rumpsrc

index 5528a488ccd42d1900c4cb577f34a50ad7171e0f..1b5a8f026a0192809b58666d9961da92c5c21762 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 5528a488ccd42d1900c4cb577f34a50ad7171e0f
+Subproject commit 1b5a8f026a0192809b58666d9961da92c5c21762
index 7224ab0197f47ef2d121b2634ecee0d66d83c325..bd2eafe503c7c53bee46e59d03a25d8185133588 100755 (executable)
@@ -21,16 +21,15 @@ fi
 ./buildrump.sh/buildrump.sh -${BUILDXEN_QUIET:-q} ${STDJ} -k \
     -V MKPIC=no -s rumpsrc -T rumptools -o rumpobj -N \
     -V RUMP_KERNEL_IS_LIBC=1 tools
-# FIXME to be able to specify this as part of previous cmdline
-echo 'CPPFLAGS+=-DMAXPHYS=32768' >> rumptools/mk.conf
 
-# set some special variables currently required by libpthread.  Doing
-# it this way preserves the ability to compile libpthread during development
-# cycles with just "rumpmake"
+# set some special variables.
 cat >> rumptools/mk.conf << EOF
+# maxphys = 32k is a Xen limitation (64k - overhead)
+CPPFLAGS+=-DMAXPHYS=32768
 .if defined(LIB) && \${LIB} == "pthread"
-CPPFLAGS+=      -D_PLATFORM_MAKECONTEXT=_lwp_rumpxen_makecontext
-CPPFLAGS+=      -D_PLATFORM_GETTCB=_lwp_rumpxen_gettcb
+.PATH: $(pwd)
+PTHREAD_MAKELWP=pthread_makelwp_rumprunxen.c
+CPPFLAGS+=      -D_PTHREAD_GETTCB_EXT=_lwp_rumpxen_gettcb
 .endif  # LIB == pthread
 EOF
 
index a5bf226a80a0155e43681c7d77794d225d217a6c..dd6f75e0ab2175aae18612bb82b5b2ae33fefaf4 100644 (file)
@@ -71,25 +71,25 @@ _lwp_ctl(int ctl, struct lwpctl **data)
        return 0;
 }
 
-void _lwp_rumpxen_makecontext(ucontext_t *, void (*)(void *),
-    void *, void *, void *, size_t);
 void
-_lwp_rumpxen_makecontext(ucontext_t *nbuctx, void (*start)(void *),
-    void *arg, void *private, void *stack_base, size_t stack_size)
+rumprunxen_makelwp(void (*start)(void *), void *arg, void *private,
+       void *stack_base, size_t stack_size, unsigned long flag, lwpid_t *lid)
 {
        struct schedulable *scd = private;
        unsigned long thestack = (unsigned long)stack_base;
-
-       scd->scd_start = start;
-       scd->scd_arg = arg;
+       scd->scd_lwpid = ++curlwpid;
 
        /* XXX: stack_base is not guaranteed to be aligned */
        thestack = (thestack & ~(STACK_SIZE-1)) + STACK_SIZE;
-       scd->scd_stack = (void *)thestack;
        assert(stack_size == 2*STACK_SIZE);
 
-       /* thread uctx -> schedulable mapping this way */
-       *(struct schedulable **)nbuctx = scd;
+       scd->scd_thread = minios_create_thread("lwp", scd,
+           start, arg, (void *)thestack);
+       if (scd->scd_thread == NULL)
+               return EBUSY; /* ??? */
+       *lid = scd->scd_lwpid;
+       TAILQ_INSERT_TAIL(&scheds, scd, entries);
+       return 0;
 }
 
 static struct schedulable *
@@ -104,22 +104,6 @@ lwpid2scd(lwpid_t lid)
        return NULL;
 }
 
-int
-_lwp_create(const ucontext_t *ucp, unsigned long flags, lwpid_t *lid)
-{
-       struct schedulable *scd = *(struct schedulable **)ucp;
-       *lid = ++curlwpid;
-
-       scd->scd_lwpid = *lid;
-       scd->scd_thread = minios_create_thread("lwp", scd,
-           scd->scd_start, scd->scd_arg, scd->scd_stack);
-       if (scd->scd_thread == NULL)
-               return EBUSY; /* ??? */
-       TAILQ_INSERT_TAIL(&scheds, scd, entries);
-
-       return 0;
-}
-
 int
 _lwp_unpark(lwpid_t lid, const void *hint)
 {
index fc4690949de0824e1326a85e26c5fdd586008888..a5424f40399fe24b0ed3cbed61dd6f6cbcd5c832 100644 (file)
@@ -69,6 +69,13 @@ mprotect(void *addr, size_t len, int prot)
        return 0;
 }
 
+int
+minherit(void *addr, size_t len, int inherit)
+{
+       /* nothing to inherit */
+       return 0;
+}
+
 int
 munmap(void *addr, size_t len)
 {
index b8528e9d44616f400d4568a748abe945c625a6c0..7c7f69f86adb0f5ff5b21048fdf4d3bc246d8c85 100644 (file)
@@ -11,6 +11,7 @@
        return ENOTSUP;}
 
 STUB(__sigaction14);
+STUB(__sigaction_sigtramp);
 STUB(__getrusage50);
 
 STUB(__wait450);
diff --git a/pthread_makelwp_rumprunxen.c b/pthread_makelwp_rumprunxen.c
new file mode 100644 (file)
index 0000000..3c395e7
--- /dev/null
@@ -0,0 +1,11 @@
+#include "pthread_makelwp.h"
+#include "rumprunxen_makelwp.h"
+
+int
+pthread__makelwp(void (*start)(void *), void *arg, void *private,
+       void *stack_base, size_t stack_size, unsigned long flags, lwpid_t *lid)
+{
+
+       return rumprunxen_makelwp(start, arg, private,
+           stack_base, stack_size, flags, lid);
+}
diff --git a/rumprunxen_makelwp.h b/rumprunxen_makelwp.h
new file mode 100644 (file)
index 0000000..8901902
--- /dev/null
@@ -0,0 +1,2 @@
+int rumprunxen_makelwp(void (*)(void *), void *,
+       void *, void *, size_t, unsigned long, lwpid_t *);
diff --git a/rumpsrc b/rumpsrc
index 5caf54991c7b84d1e7957892afd48ae3dd6645b7..2353b15380a4a50a846061cc99a4cccf2c8ec2c0 160000 (submodule)
--- a/rumpsrc
+++ b/rumpsrc
@@ -1 +1 @@
-Subproject commit 5caf54991c7b84d1e7957892afd48ae3dd6645b7
+Subproject commit 2353b15380a4a50a846061cc99a4cccf2c8ec2c0