annotate src/impl/pipe.h @ 185:7fc3c3da2159

bump pipe.h
author anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Tue, 21 Jan 2020 14:50:15 +0900
parents 21e83548d738
children 9d385a07dbfc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
161
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents: 160
diff changeset
1 typedef struct pipe<Impl, Isa> impl file {
154
343f8f3c8f18 add pipe.h
anatofuz
parents:
diff changeset
2 #define PIPESIZE 512
185
7fc3c3da2159 bump pipe.h
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents: 165
diff changeset
3 union Data* file;
154
343f8f3c8f18 add pipe.h
anatofuz
parents:
diff changeset
4 struct spinlock lock;
343f8f3c8f18 add pipe.h
anatofuz
parents:
diff changeset
5 char data[PIPESIZE];
343f8f3c8f18 add pipe.h
anatofuz
parents:
diff changeset
6 uint nread; // number of bytes read
343f8f3c8f18 add pipe.h
anatofuz
parents:
diff changeset
7 uint nwrite; // number of bytes written
343f8f3c8f18 add pipe.h
anatofuz
parents:
diff changeset
8 int readopen; // read fd is still open
343f8f3c8f18 add pipe.h
anatofuz
parents:
diff changeset
9 int writeopen; // write fd is still open
165
21e83548d738 def file_impl_pipe.cbc private code gears
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents: 161
diff changeset
10
21e83548d738 def file_impl_pipe.cbc private code gears
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents: 161
diff changeset
11 // interface field
21e83548d738 def file_impl_pipe.cbc private code gears
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents: 161
diff changeset
12 int n;
21e83548d738 def file_impl_pipe.cbc private code gears
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents: 161
diff changeset
13 char* addr;
21e83548d738 def file_impl_pipe.cbc private code gears
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents: 161
diff changeset
14
21e83548d738 def file_impl_pipe.cbc private code gears
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents: 161
diff changeset
15 // private code gear
21e83548d738 def file_impl_pipe.cbc private code gears
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents: 161
diff changeset
16 __code piperead1(Impl* pipe, char* addr, int n, __code next(...));
21e83548d738 def file_impl_pipe.cbc private code gears
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents: 161
diff changeset
17 __code piperead2(Impl* pipe, char* addr, int n, __code next(...));
185
7fc3c3da2159 bump pipe.h
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents: 165
diff changeset
18 __code cbc_fileclose(Impl* pipe, Isa* file, __code next(...));
7fc3c3da2159 bump pipe.h
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents: 165
diff changeset
19 __code cbc_fileclose2(Impl* pipe, Isa* file,struct file* ff, __code next(...));
7fc3c3da2159 bump pipe.h
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents: 165
diff changeset
20 __code cbc_fileclose3(Impl* pipe, Isa* file,struct file* ff, __code next(...));
7fc3c3da2159 bump pipe.h
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents: 165
diff changeset
21 __code cbc_pipe_close(Impl* p, int writable, __code next(...));
7fc3c3da2159 bump pipe.h
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents: 165
diff changeset
22 __code cbc_pipe_close_writeopen(Impl* p, __code next(...));
7fc3c3da2159 bump pipe.h
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents: 165
diff changeset
23 __code cbc_pipe_close_readopen(Impl* p, __code next(...));
154
343f8f3c8f18 add pipe.h
anatofuz
parents:
diff changeset
24 } pipe;