devcapability: initialize the qlock
authorRonald G. Minnich <rminnich@gmail.com>
Thu, 5 Jan 2017 18:24:44 +0000 (10:24 -0800)
committerBarret Rhoden <brho@cs.berkeley.edu>
Wed, 18 Jan 2017 18:27:54 +0000 (13:27 -0500)
This was not needed in the original since plan 9 qlocks
zero value is usable. In Akaros they must be initialized.

Change-Id: I16def7b5b90c9e05212204df27e3819857b9a4dd
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/drivers/dev/capability.c

index 39013aa..ca7fbfb 100644 (file)
@@ -60,6 +60,11 @@ struct dirtab capdir[] = {
 };
 int ncapdir = ARRAY_SIZE(capdir);
 
+static void capinit(void)
+{
+       qlock_init(&capalloc.qlock);
+}
+
 static struct chan *capattach(char *spec)
 {
        return devattach("capability", spec);
@@ -285,7 +290,7 @@ struct dev capdevtab __devtab = {
        .name = "capability",
 
        .reset = devreset,
-       .init = devinit,
+       .init = capinit,
        .shutdown = devshutdown,
        .attach = capattach,
        .walk = capwalk,