From bbbf0308acc598cfc802196019ac47118a28a459 Mon Sep 17 00:00:00 2001 From: Amelia Coutard Date: Tue, 1 Aug 2023 04:55:19 +0200 Subject: [PATCH] Changed doc a bit --- doc.txt | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/doc.txt b/doc.txt index dcc0dd1..75829d0 100644 --- a/doc.txt +++ b/doc.txt @@ -45,10 +45,6 @@ Input and output registers in order: %rdi, %rsi, %rdx, %r10, %r8, %r9. In %rax, the syscall id is specified. If the operation succeeds, %rax contains the result (think SystemV ABI) (≥ 0). If it fails, %rax contains the opposite of the error code. (< 0) -Error codes: - 0: ERR_NONE: no error - 0: ERR_USER: server-defined error - sport_t make_sport(); Creates a server port, with no associated clients. cport_t make_cport(sport_t); @@ -57,7 +53,7 @@ cport_t copy_cport(cport_t); Takes a client port, and returns a new client port that points to the same server port. bool has_cports(sport_t); - Takes a server port, and returns the number of clients linked to it. + Takes a server port, and returns whether or not it has any client ports. void close(port_t); Close a port. It no longer exists in this process. If it was a server port, any use of any of its client ports for the purpose @@ -72,7 +68,7 @@ sport_t wait(); Returns the server port in question. {int64_t out_s, uint64_t user_error_code} call(cport_t p, int64_t in_s, const void* in, cport_t* io_p, int64_t out_s, void* out); - Blocks until the server refered to by p replies, or reports an error. + Blocks until the server refered to by p replies. //, or reports an error. handler receive(sport_t p); Block until any client sends a message to the port p. int64_t receive_size(handler client); @@ -85,11 +81,11 @@ void reply(handler caller, int64_t in_s, const void* in, cport_t in_p); Invalidates caller. Replies to the caller with the data of length in_s in `in`. If in_p is non-0, a copy of it is sent as well. -void forward(cport_t to, handler caller, int64_t sub_begin, int64_t sub_len); - Invalidates caller. - Transfers message to `to` (reply will go to the original client still). - 0 ≤ sub_begin ≤ receive_size(client) and 0 ≤ sub_len ≤ receive_size(client) - sub_begin. - The data transferred will only be that in data[sub_begin; sub_begin + sub_len[, ∅ if sub_len == 0. -void error(handler caller, uint64_t error_code); - Invalidates caller. - Call gets ERR_USER, with the second value set to error_code. +// void forward(cport_t to, handler caller, int64_t sub_begin, int64_t sub_len); + // Invalidates caller. + // Transfers message to `to` (reply will go to the original client still). + // 0 ≤ sub_begin ≤ receive_size(client) and 0 ≤ sub_len ≤ receive_size(client) - sub_begin. + // The data transferred will only be that in data[sub_begin; sub_begin + sub_len[, ∅ if sub_len == 0. +// void error(handler caller, uint64_t error_code); + // Invalidates caller. + // Call gets ERR_USER, with the second value set to error_code. -- 2.47.0