Mercurial > hg > Members > menikon > CbC_xv6
changeset 27:1a64b5645cdd
fix
author | mir3636 |
---|---|
date | Thu, 17 Jan 2019 19:55:30 +0900 |
parents | a146855e16eb |
children | 68de775c3a29 |
files | src/console.c src/defs.h src/file.c src/file.h src/fs.c src/proc.h |
diffstat | 6 files changed, 13 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/console.c Thu Jan 17 19:43:22 2019 +0900 +++ b/src/console.c Thu Jan 17 19:55:30 2019 +0900 @@ -356,7 +356,7 @@ devsw[CONSOLE].write = consolewrite; devsw[CONSOLE].read = consoleread; - cbc_devsw[CONSOLE].write = cbc_consolewrite; + //cbc_devsw[CONSOLE].write = cbc_consolewrite; cbc_devsw[CONSOLE].read = cbc_consoleread; cons.locking = 1;
--- a/src/defs.h Thu Jan 17 19:43:22 2019 +0900 +++ b/src/defs.h Thu Jan 17 19:55:30 2019 +0900 @@ -131,6 +131,7 @@ void procdump(void); void scheduler(void) __attribute__((noreturn)); void sched(void); +__code cbc_sleep(void*, struct spinlock*, __code(*next1)()); void sleep(void*, struct spinlock*); void userinit(void); int wait(void);
--- a/src/file.c Thu Jan 17 19:43:22 2019 +0900 +++ b/src/file.c Thu Jan 17 19:55:30 2019 +0900 @@ -10,6 +10,8 @@ #include "spinlock.h" struct devsw devsw[NDEV]; +struct cbc_devsw cbc_devsw[NDEV]; + struct { struct spinlock lock; struct file file[NFILE];
--- a/src/file.h Thu Jan 17 19:43:22 2019 +0900 +++ b/src/file.h Thu Jan 17 19:55:30 2019 +0900 @@ -33,6 +33,12 @@ int (*write)(struct inode*, char*, int); }; +struct cbc_devsw { + int (*read) (struct inode*, char*, int, __code (*)(int)); + //int (*write)(struct inode*, char*, int, __code (*)(int)); +}; + extern struct devsw devsw[]; +extern struct cbc_devsw cbc_devsw[]; #define CONSOLE 1
--- a/src/fs.c Thu Jan 17 19:43:22 2019 +0900 +++ b/src/fs.c Thu Jan 17 19:55:30 2019 +0900 @@ -459,11 +459,11 @@ struct buf *bp; if (ip->type == T_DEV) { - if (ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read) { + if (ip->major < 0 || ip->major >= NDEV || !cbc_devsw[ip->major].read) { goto next(-1); } - goto cbc_devsw[ip->major].read(ip, dst, n); + goto cbc_devsw[ip->major].read(ip, dst, n, next); } if (off > ip->size || off + n < off) {