commit 0c50c9b1b8f124d83ab152ad0240b801f992b370
parent 9f6f0b55d119588fc9cf7c7672eb05ae49fc10ee
Author: Dimitris Papastamos <dimitris.papastamos@arm.com>
Date: Mon, 10 Dec 2018 16:59:41 +0000
Merge "[drivers] Small fixes in the driver model"
Diffstat:
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/dev.c b/drivers/dev.c
@@ -12,9 +12,6 @@ struct devdata {
Chan dot;
};
-/*
- * FIXME: NODEV has the same type than rootdir
- */
static Chan *
newchan(void)
{
@@ -241,6 +238,10 @@ devdirread(Chan *c, char *buf, int nbytes, const Dirtab *tab, int ntab, Devgen *
break;
case 1:
memcpy(buf + cnt, &dir, DIRLEN);
+ /*
+ * TODO: n is not initialized here. We still have to
+ * consider using 9p
+ */
nbytes -= n;
cnt += n;
}
diff --git a/drivers/dev.h b/drivers/dev.h
@@ -1,7 +1,7 @@
#include <stddef.h>
#define NR_CHANS 4
-#define NODEV 0
+#define NODEV -1
#define NAMELEN 8
#define DIRLEN sizeof(Dir)
#define CHDIR (1 << 15)
@@ -11,7 +11,7 @@ typedef struct chan Chan;
typedef struct dirtab Dirtab;
typedef struct dir Dir;
typedef int Devgen(Chan *, const Dirtab *, int, int, Dir *);
-typedef short Qid;
+typedef unsigned short Qid;
struct dir {
char name[NAMELEN];