# HG changeset patch # User anatofuz # Date 1576722760 -32400 # Node ID 343f8f3c8f18a9ec0f06c7bbf2b0a374a77293b3 # Parent 49d8aba0002a57b48a4141eceadb16b4d9c50d9b add pipe.h diff -r 49d8aba0002a -r 343f8f3c8f18 src/CMakeLists.txt --- a/src/CMakeLists.txt Wed Dec 18 15:55:22 2019 +0900 +++ b/src/CMakeLists.txt Thu Dec 19 11:32:40 2019 +0900 @@ -126,8 +126,8 @@ SOURCES string.c arm.c asm.S bio.c buddy.c console.cbc exec.c file.cbc fs.c log.c main.c memide.c pipe.cbc proc.cbc spinlock.cbc start.c swtch.S syscall.cbc sysfile.cbc sysproc.c trap_asm.S trap.c vm.c device/picirq.c device/timer.c device/uart.c - SingleLinkedStack.cbc sys_open_impl.cbc + SingleLinkedStack.cbc sys_open_impl.cbc sys_pipe_read.cbc file_read.cbc entry.S ) -# sys_read_impl.cbc \ No newline at end of file +# sys_read_impl.cbc diff -r 49d8aba0002a -r 343f8f3c8f18 src/gearsTools/lib/Gears/Context.pm --- a/src/gearsTools/lib/Gears/Context.pm Wed Dec 18 15:55:22 2019 +0900 +++ b/src/gearsTools/lib/Gears/Context.pm Thu Dec 19 11:32:40 2019 +0900 @@ -41,15 +41,15 @@ next; } - if ($line =~ /^(\w+)(\*)+ *create(\w+)\(([^]]*)\)/) { - my $interface = $1; - my $implementation = $3; - $self->{data_gears_with_count}->{$interface}->{caller}->{$cbc_file}++; - $self->{data_gears_with_count}->{$implementation}->{caller}->{$cbc_file}++; - $counter{interfaces}->{$interface}++; - $counter{impl}->{$implementation}++; - next; - } + #if ($line =~ /^(\w+)(\*)+ *create(\w+)\(([^]]*)\)/) { + # my $interface = $1; + # my $implementation = $3; + # $self->{data_gears_with_count}->{$interface}->{caller}->{$cbc_file}++; + # $self->{data_gears_with_count}->{$implementation}->{caller}->{$cbc_file}++; + # $counter{interfaces}->{$interface}++; + # $counter{impl}->{$implementation}++; + # next; + #} if ($line =~ /Gearef\(context,\s*(\w+)\)/) { my $implementation = $1; diff -r 49d8aba0002a -r 343f8f3c8f18 src/move_data_gears/pipe.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/move_data_gears/pipe.h Thu Dec 19 11:32:40 2019 +0900 @@ -0,0 +1,9 @@ +typedef struct pipe { + #define PIPESIZE 512 + struct spinlock lock; + char data[PIPESIZE]; + uint nread; // number of bytes read + uint nwrite; // number of bytes written + int readopen; // read fd is still open + int writeopen; // write fd is still open +} pipe; diff -r 49d8aba0002a -r 343f8f3c8f18 src/pipe.cbc --- a/src/pipe.cbc Wed Dec 18 15:55:22 2019 +0900 +++ b/src/pipe.cbc Thu Dec 19 11:32:40 2019 +0900 @@ -11,6 +11,7 @@ #define __ncode __code # +/* struct pipe { struct spinlock lock; char data[PIPESIZE]; @@ -19,6 +20,7 @@ int readopen; // read fd is still open int writeopen; // write fd is still open }; +*/ int pipealloc(struct file **f0, struct file **f1) { diff -r 49d8aba0002a -r 343f8f3c8f18 src/sys_pipe_read.cbc --- a/src/sys_pipe_read.cbc Wed Dec 18 15:55:22 2019 +0900 +++ b/src/sys_pipe_read.cbc Thu Dec 19 11:32:40 2019 +0900 @@ -35,10 +35,9 @@ release(&p->lock); goto next(); } - proc->cbc_arg.cbc_console_arg.p = p; goto cbc_sleep(&p->nread, &p->lock, cbc_piperead1); } - goto cbc_piperead2SysReadImpl(sys_read,0,sys_read->n,sys_read->p); + goto next(sys_read,0,sys_read->n,sys_read->p,cbc_piperead2SysReadImpl); } __code cbc_piperead2PipeRead(struct PipeRead* sys_read, int i, int n, struct pipe* p, __code next(...)) {