interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / native / kernel / svc / courier.h

22 lines · 1103 bytes Raw Blame History
1/* courier.h -- A courier carries lines between Allen and a far-off worker
2 * (a language model on another computer), one line each way, newline ended.
3 * Allen never sees the wire: he hands the courier a job line
4 * (svc/allen_intent.h) and takes answers back when they come. Which wire is
5 * the machine's business: the test computer's x86 kernel offers a courier on
6 * its second serial port (x86/courier_x86.c) when one is there; Ethernet
7 * comes once the network card may receive (aienos#411). Without a courier
8 * Allen answers from this computer alone, as before. */
9#ifndef AIENOS_COURIER_H
10#define AIENOS_COURIER_H
11
12typedef struct ck_courier {
13 /* 1 once the far side has called, or answered our call, on this wire. */
14 int (*ready)(void);
15 /* Sends the line (n bytes, no newline) and a newline: 0, or -1 if it could not be sent. */
16 int (*send)(const char *line, unsigned n);
17 /* A whole line from the far side, newline removed, NUL-terminated, at
18 * most cap - 1 bytes: 1, or 0 when none has arrived yet. */
19 int (*take)(char *out, unsigned cap);
20} ck_courier;
21
22#endif