Virtual console for simple character based input and output.
More...
|
l4_msgtag_t | l4_vcon_send (l4_cap_idx_t vcon, char const *buf, unsigned size) L4_NOTHROW |
| Send data to virtual console. More...
|
|
l4_msgtag_t | l4_vcon_send_u (l4_cap_idx_t vcon, char const *buf, unsigned size, l4_utcb_t *utcb) L4_NOTHROW |
| Send data to this virtual console. More...
|
|
long | l4_vcon_write (l4_cap_idx_t vcon, char const *buf, unsigned size) L4_NOTHROW |
| Write data to virtual console. More...
|
|
long | l4_vcon_write_u (l4_cap_idx_t vcon, char const *buf, unsigned size, l4_utcb_t *utcb) L4_NOTHROW |
| Write data to this virtual console. More...
|
|
int | l4_vcon_read (l4_cap_idx_t vcon, char *buf, unsigned size) L4_NOTHROW |
| Read data from virtual console. More...
|
|
int | l4_vcon_read_u (l4_cap_idx_t vcon, char *buf, unsigned size, l4_utcb_t *utcb) L4_NOTHROW |
| Read data from this virtual console. More...
|
|
int | l4_vcon_read_with_flags (l4_cap_idx_t vcon, char *buf, unsigned size) L4_NOTHROW |
| Read data from virtual console, extended version including flags. More...
|
|
l4_msgtag_t | l4_vcon_set_attr (l4_cap_idx_t vcon, l4_vcon_attr_t const *attr) L4_NOTHROW |
| Set attributes of a Vcon. More...
|
|
l4_msgtag_t | l4_vcon_set_attr_u (l4_cap_idx_t vcon, l4_vcon_attr_t const *attr, l4_utcb_t *utcb) L4_NOTHROW |
| Set the attributes of this virtual console. More...
|
|
l4_msgtag_t | l4_vcon_get_attr (l4_cap_idx_t vcon, l4_vcon_attr_t *attr) L4_NOTHROW |
| Get attributes of a Vcon. More...
|
|
l4_msgtag_t | l4_vcon_get_attr_u (l4_cap_idx_t vcon, l4_vcon_attr_t *attr, l4_utcb_t *utcb) L4_NOTHROW |
| Get attributes of this virtual console. More...
|
|
Virtual console for simple character based input and output.
The interrupt for read events is provided by the virtual key interrupt.
- Include File
See L4::Vcon for the C++ interface.
◆ L4_vcon_i_flags
Input flags.
Enumerator |
---|
L4_VCON_INLCR | Translate NL to CR.
|
L4_VCON_IGNCR | Ignore CR.
|
L4_VCON_ICRNL | Translate CR to NL if L4_VCON_IGNCR is not set.
|
Definition at line 189 of file vcon.h.
◆ L4_vcon_l_flags
Local flags.
Enumerator |
---|
L4_VCON_ICANON | Canonical mode.
|
L4_VCON_ECHO | Echo input.
|
Definition at line 211 of file vcon.h.
◆ L4_vcon_o_flags
Output flags.
Enumerator |
---|
L4_VCON_ONLCR | Translate NL to CR-NL.
|
L4_VCON_OCRNL | Translate CR to NL.
|
L4_VCON_ONLRET | Do not output CR.
|
Definition at line 200 of file vcon.h.
◆ L4_vcon_size_consts
Size constants.
Enumerator |
---|
L4_VCON_WRITE_SIZE | Maximum size that can be written with one l4_vcon_write call.
|
L4_VCON_READ_SIZE | Maximum size that can be read with one l4_vcon_read* call.
|
Definition at line 95 of file vcon.h.
◆ l4_vcon_get_attr()
Get attributes of a Vcon.
- Parameters
-
| vcon | Vcon object. |
[out] | attr | Attribute structure. |
- Returns
- Syscall return tag
Definition at line 409 of file vcon.h.
References l4_utcb(), and l4_vcon_get_attr_u().
◆ l4_vcon_get_attr_u()
Get attributes of this
virtual console.
- Parameters
-
| vcon | Capability index of the vcon object. |
[out] | attr | Attribute structure. Contains the attributes after a successful call of this function. |
| utcb | UTCB pointer of the calling thread. |
- Returns
- Syscall return tag.
Definition at line 391 of file vcon.h.
Referenced by L4::Vcon::get_attr(), and l4_vcon_get_attr().
◆ l4_vcon_read()
int l4_vcon_read |
( |
l4_cap_idx_t |
vcon, |
|
|
char * |
buf, |
|
|
unsigned |
size |
|
) |
| |
|
inline |
Read data from virtual console.
- Parameters
-
| vcon | Vcon object. |
[out] | buf | Pointer to data buffer. |
| size | Size of buffer in bytes. |
- Return values
-
<0 | Error code. |
>size | If more bytes are to read, size bytes are in the buffer buf . |
<=size | Number of bytes read. |
- Note
- Size must not exceed L4_VCON_READ_SIZE.
Definition at line 365 of file vcon.h.
References l4_utcb(), and l4_vcon_read_u().
◆ l4_vcon_read_u()
Read data from this
virtual console.
- Parameters
-
| vcon | Capability index of the vcon object. |
[out] | buf | Pointer to data buffer. |
| size | Size of the data buffer in bytes. |
| utcb | UTCB pointer of the calling thread. |
- Return values
-
<0 | Error code. |
>size | More bytes to read, size bytes are in the buffer buf . |
<=size | Number of bytes read. |
- Note
- Size must not exceed L4_VCON_READ_SIZE.
Definition at line 355 of file vcon.h.
Referenced by l4_vcon_read(), and L4::Vcon::read().
◆ l4_vcon_read_with_flags()
int l4_vcon_read_with_flags |
( |
l4_cap_idx_t |
vcon, |
|
|
char * |
buf, |
|
|
unsigned |
size |
|
) |
| |
|
inline |
Read data from virtual console, extended version including flags.
- Parameters
-
| vcon | Vcon object. |
[out] | buf | Pointer to data buffer. |
| size | Size of buffer in bytes. |
If this function returns a positive value the caller can check the L4_VCON_READ_STAT_BREAK flag bit for a break condition. The bytes read can be obtained by masking the return value with L4_VCON_READ_SIZE_MASK.
If a break condition is signaled, it is always the first event in the transmitted content, i.e. all characters supplied by this read call follow the break condition.
buf
might be a NULL
, in this case the input data will be dropped.
- Note
- Size must not exceed L4_VCON_READ_SIZE.
- Return values
-
<0 | Error code. |
>size | More bytes to read, size bytes are in the buffer buf . |
<=size | Number of bytes read. |
Definition at line 349 of file vcon.h.
◆ l4_vcon_send()
Send data to virtual console.
- Parameters
-
vcon | Vcon object. |
buf | Pointer to data buffer. |
size | Size of buffer in bytes. |
- Returns
- Syscall return tag
- Note
- Size must not exceed L4_VCON_WRITE_SIZE, a proper value of the
size
parameter is NOT checked. Also, this function is a send only operation, this means there is no return value except for a failed send operation. Use l4_ipc_error() to check for send errors, do not use l4_error(), as l4_error() will always return an error.
Definition at line 289 of file vcon.h.
References l4_utcb(), and l4_vcon_send_u().
◆ l4_vcon_send_u()
Send data to this
virtual console.
- Parameters
-
vcon | Capability index of the Vcon object. |
buf | Pointer to the data buffer. |
size | Size of the data buffer in bytes. |
utcb | UTBC pointer of the calling thread. |
- Returns
- Syscall return tag
- Note
- Size must not exceed L4_VCON_WRITE_SIZE, a proper value of the
size
parameter is NOT checked. Also, this function is a send only operation, this means there is no return value except for a failed send operation. Use l4_ipc_error() to check for send errors, do not use l4_error(), as l4_error() will always return an error.
Definition at line 275 of file vcon.h.
Referenced by l4_vcon_send(), l4_vcon_write_u(), and L4::Vcon::send().
◆ l4_vcon_set_attr()
Set attributes of a Vcon.
- Parameters
-
vcon | Vcon object. |
attr | Attribute structure. |
- Returns
- Syscall return tag
Definition at line 385 of file vcon.h.
References l4_utcb(), and l4_vcon_set_attr_u().
◆ l4_vcon_set_attr_u()
Set the attributes of this
virtual console.
- Parameters
-
vcon | Capability index of the vcon object. |
attr | Attribute structure with the attributes for the virtual console. |
utcb | UTCB pointer of the calling thread. |
- Returns
- Syscall return tag.
Definition at line 371 of file vcon.h.
Referenced by l4_vcon_set_attr(), and L4::Vcon::set_attr().
◆ l4_vcon_write()
long l4_vcon_write |
( |
l4_cap_idx_t |
vcon, |
|
|
char const * |
buf, |
|
|
unsigned |
size |
|
) |
| |
|
inline |
Write data to virtual console.
- Parameters
-
vcon | Vcon object. |
buf | Pointer to data buffer. |
size | Size of buffer in bytes. |
- Return values
-
<0 | Error. |
>=0 | Number of bytes written to the virtual console |
Definition at line 310 of file vcon.h.
References l4_utcb(), and l4_vcon_write_u().
◆ l4_vcon_write_u()