9os

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 8a925b295f53d5412f99972b8dc18c43455c52b7
parent 0a919a418ee333967f6009fa15c06f55ac0be44b
Author: Ambroise Vincent <ambroise.vincent@arm.com>
Date:   Fri, 17 May 2019 09:54:50 +0100

Merge changes from topics 'rv/block', 'rv/io'

* changes:
  [dev] Move NR_UARTS to devuart.c
  [dev] Remove redundant directory checks
  [lib9p] Add comments to macros in io.h

Diffstat:
Mdrivers/dev.h | 1-
Mdrivers/devcons.c | 3---
Mdrivers/devuart.c | 4+---
Minclude/rcode/io.h | 8++++----
4 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/dev.h b/drivers/dev.h @@ -1,7 +1,6 @@ #include <stddef.h> #define NR_CHANS 20 -#define NR_UARTS 2 #define NR_CONSS 1 #define NR_BINDS 4 #define NR_FILES 20 diff --git a/drivers/devcons.c b/drivers/devcons.c @@ -207,9 +207,6 @@ conswrite(Chan *c, void *buf, int n) }; switch (c->qid & ~CHDIR) { - case Qconsfs: - errno = EISDIR; - return -1; case Qraw: return conswriteraw(buf, n); case Qctl: diff --git a/drivers/devuart.c b/drivers/devuart.c @@ -10,6 +10,7 @@ #include "uart.h" #define UARTSTATUS 128 +#define NR_UARTS 2 enum Ouartqid { Quartfs, @@ -199,9 +200,6 @@ uartwrite(Chan *c, void *buf, int n) Uart *up; switch (c->qid & ~CHDIR) { - case Quartfs: - errno = EISDIR; - return -1; case Qraw: up = getuart(c); return (*up->phy->write)(up, buf, n); diff --git a/include/rcode/io.h b/include/rcode/io.h @@ -3,10 +3,10 @@ #define NAMELEN 14 /* Maximum length of a file name */ #define PATHLEN 41 /* Maximum length of a path */ -#define STATLEN 41 -#define ROOTLEN (2 + 4) -#define FILNAMLEN (2 + NAMELEN) -#define DIRLEN (STATLEN + FILNAMLEN + 3*ROOTLEN) +#define STATLEN 41 /* Size of static part of dir format */ +#define ROOTLEN (2 + 4) /* Size needed to encode root string */ +#define FILNAMLEN (2 + NAMELEN) /* Size needed to encode filename */ +#define DIRLEN (STATLEN + FILNAMLEN + 3*ROOTLEN) /* Size of dir entry */ #define KSEEK_SET 0 #define KSEEK_CUR 1