Repository navigation
Conversation
garethpotter
left a comment
There was a problem hiding this comment.
Mostly wading through the excessively florid (and so not very helpful) comments. I think I need to review a prior PR to make more sense of this one as it is diffing against something I haven't seen yet.
| * - A transport has to be made in supervisor mode: it asks the network stack for the | ||
| * address of its interface, which a user thread may not. |
There was a problem hiding this comment.
If this is a blocker at any point, perhaps it can be passed in instead.
| * | ||
| * It does nothing else: no thread is started, and no memory is made accessible. | ||
| * |
| * To be called in supervisor mode, for a thread that exists and has yet to make its | ||
| * first call to the transport: typically one that was created not to start by itself |
There was a problem hiding this comment.
"This function should be called in supervisor mode with a thread that exists..."
| * (a delay of K_FOREVER), and is started after this call. A thread defined with | ||
| * K_THREAD_DEFINE does not exist until the kernel has run the initialisation functions | ||
| * of the application, so main() is the earliest place for the call. What is given ends | ||
| * with the thread: for a thread that is started anew, call it anew. |
There was a problem hiding this comment.
We are not writing poetry here.
| * The resource pool is small, and sized for the transports alone. A thread that has | ||
| * been assigned a pool already keeps it, and the threads of the transport use that one: | ||
| * it then needs room for a copy of what they wait on at all times, eight bytes for each | ||
| * of the clients that a server takes at once and eight more for each of the two other | ||
| * threads. |
There was a problem hiding this comment.
I have no idea what the second sentence here means.
| * IP transport on sockets, with poll(). For a user thread the kernel works on a copy of | ||
| * what is waited on, which it takes from the resource pool of the thread for as long as | ||
| * the call lasts. This is that pool. It has room for one such call by each of the | ||
| * threads, which is all that is ever asked of it: none of them makes a second call |
There was a problem hiding this comment.
...again with the overly dramatic phrasing: "all I ever ask of thee is that my request for a kernel object might be granted, that I may poll it in perpetuity like an unrequited lover pines for his heart's desire...".
| #ifdef CONFIG_USERSPACE | ||
| #include <zephyr/internal/syscall_handler.h> | ||
|
|
||
| /* A copy of so many bytes, the reference to the pool that the kernel keeps with it, and |
There was a problem hiding this comment.
So many bytes, bytes innumerable...
| * works on a copy of the sockets that are waited on. It does the same with the value of | ||
| * an option that is set on a socket, which is an integer when a server is told to | ||
| * listen. */ |
There was a problem hiding this comment.
I don't quite understand this last sentence.
| #endif | ||
|
|
||
| /* What the heap needs for itself, with a little to spare */ | ||
| #define RESOURCE_HEAP_OVERHEAD 96 |
There was a problem hiding this comment.
How is this calculated?
There was a problem hiding this comment.
Nice to have tests for this.
ca9546d to
0ad8440
Compare
da5a6cd to
af0752e
Compare
af0752e to
6efd300
Compare
6efd300 to
bd9e716
Compare
bd9e716 to
baaa069
Compare
No description provided.