Files | |
file | align.h |
file | arg_parse.h |
file | arp.h |
ARP module messages. | |
file | as.c |
file | as.h |
file | asprintf.c |
file | assert.h |
file | async.c |
file | async.h |
file | async.h |
file | async_sess.c |
file | async_sess.h |
file | async_sess.h |
file | atomic.h |
file | atomicdflt.h |
file | bool.h |
file | byteorder.h |
file | canonify.c |
file | canonify.h |
file | cap.c |
Functions to grant/revoke capabilities to/from a task. | |
file | cap.h |
file | char_dev.c |
file | char_dev.h |
file | char_map.c |
Character string to integer map implementation. | |
file | char_map.h |
Character string to integer map. | |
file | clipboard.c |
System clipboard API. | |
file | clipboard.h |
file | color.h |
file | console.c |
file | console.h |
file | ctype.h |
file | ddi.c |
file | ddi.h |
file | device.h |
Device identifier, state and usage statistics. | |
file | devman.c |
file | devman.h |
file | devmap.h |
file | dirent.h |
file | dynamic.h |
file | dynamic_fifo.c |
Dynamic first in first out positive integer queue implementation. | |
file | dynamic_fifo.h |
Dynamic first in first out positive integer queue. | |
file | elf_dyn.h |
file | entry.h |
file | entry_point.h |
file | err.h |
file | errno.c |
file | errno.h |
file | event.h |
file | fcntl.h |
file | fibril.c |
file | fibril.h |
file | fibril_synch.c |
file | fibril_synch.h |
file | fifo.h |
file | futex.c |
file | futex.h |
file | gcdlcm.h |
file | generic_char_map.h |
Character string to generic type map. | |
file | generic_field.h |
Generic type field. | |
file | hash_table.c |
file | hash_table.h |
file | hw_res.c |
file | hw_res.h |
file | icmp.h |
ICMP module messages. | |
file | icmp_api.c |
ICMP application interface implementation. | |
file | icmp_api.h |
ICMP module application interface. | |
file | icmp_codes.h |
ICMP types and codes according to the on-line IANA - ICMP Type Numbers. | |
file | icmp_common.c |
ICMP common interface implementation. | |
file | icmp_common.h |
ICMP module common interface. | |
file | il.h |
Internetwork layer modules messages. | |
file | in.h |
INET family common definitions. | |
file | in6.h |
INET6 family common definitions. | |
file | inet.c |
Internet protocol address conversion functions implementation. | |
file | inet.h |
Internet common definitions. | |
file | int_map.h |
Integer to generic type map. | |
file | inttypes.h |
file | io.c |
file | io.h |
file | ip.h |
IP module messages. | |
file | ip_codes.h |
IP codes and definitions. | |
file | ip_protocols.h |
Internet protocol numbers according to the on-line IANA - Assigned Protocol numbers:. | |
file | keycode.h |
file | klog.c |
file | klog.h |
file | langs.c |
Language and locale ids. | |
file | langs.h |
Language and locale ids. | |
file | libc.c |
file | libc.h |
file | libc.h |
file | list.c |
file | list.h |
file | loader.c |
file | macros.h |
file | malloc.c |
file | malloc.h |
file | malloc.h |
file | measured_strings.c |
Character string with measured length implementation. | |
file | measured_strings.h |
Character string with measured length. | |
file | mem.c |
file | mem.h |
file | mman.c |
file | mman.h |
file | module.h |
file | modules.c |
Generic module functions implementation. | |
file | modules.h |
Generic module functions. | |
file | net_net.h |
Networking subsystem central module messages. | |
file | netif.h |
Network interface common module messages. | |
file | nil.h |
Network interface layer module messages. | |
file | ns.c |
file | packet.c |
Packet map and queue implementation. | |
file | packet.h |
Packet map and queue. | |
file | packet.h |
Packet server module messages. | |
file | packet_header.h |
Packet header. | |
file | pcb.c |
file | printf.c |
file | printf_core.h |
file | prodcons.c |
file | prodcons.h |
file | rtld.h |
file | rtld_arch.h |
file | rtld_debug.h |
file | rwlock.h |
This file contains rwlock API and provides its fake implementation based on futexes. | |
file | setjmp.h |
file | smc.c |
file | smc.h |
file | snprintf.c |
file | socket.h |
Socket application program interface (API). | |
file | socket.h |
Socket messages. | |
file | socket_client.c |
Socket application program interface (API) implementation. | |
file | socket_codes.h |
Socket codes and definitions. | |
file | sort.c |
Sorting functions. | |
file | sort.h |
file | stacktrace.c |
file | stacktrace.h |
file | stat.h |
file | stats.c |
file | stats.h |
file | stdarg.h |
file | stddef.h |
file | stdint.h |
file | stdio.h |
file | stdlib.c |
file | stdlib.h |
file | str.c |
file | str.h |
file | str_error.c |
file | str_error.h |
file | style.h |
file | symbol.h |
file | syscall.h |
Syscall function declaration for architectures that don't inline syscalls or architectures that handle syscalls according to the number of arguments. | |
file | syscall.h |
file | syscall.h |
file | syscall.h |
file | syscall.h |
file | syscall.h |
file | syscall.h |
file | sysinfo.c |
file | sysinfo.h |
file | task.c |
file | task.h |
file | thread.c |
file | thread.h |
file | thread.h |
file | time.c |
file | time.h |
file | time.h |
file | tl.h |
Transport layer modules messages. | |
file | tls.c |
Support for thread-local storage, as described in: Drepper U. | |
file | tls.h |
file | trace.h |
file | types.h |
file | udebug.c |
file | udebug.h |
file | unistd.h |
file | vfs.c |
file | vfs.h |
file | vprintf.c |
file | vsnprintf.c |
Modules | |
IPC | |
HelenOS uspace IPC. | |
Data Structures | |
struct | along |
struct | amsg_t |
struct | async_sess_t |
struct | atomic |
struct | awaiter_t |
Structures of this type represent a waiting fibril. More... | |
struct | change_state_t |
struct | char_map |
Character string to integer map item. More... | |
struct | client_t |
struct | conn_node_t |
An inactive open connection. More... | |
struct | connection_t |
struct | console_event_t |
Console event structure. More... | |
struct | device_stats |
Device usage statistics. More... | |
struct | DIR |
struct | dirent |
struct | dyn_fifo |
Dynamic first in first out positive integer queue. More... | |
struct | dyn_info |
Holds the data extracted from an ELF Dynamic section. More... | |
struct | elf32_dyn |
struct | elf32_rel |
struct | elf32_rela |
struct | fdi_node_t |
This type is a libc version of the VFS triplet. More... | |
struct | fibril |
struct | fibril_condvar_t |
struct | fibril_mutex_t |
struct | fibril_owner_info_t |
struct | fibril_rwlock_t |
struct | FILE |
struct | hash_table_operations_t |
Set of operations for hash table. More... | |
struct | hash_table_t |
Hash table structure. More... | |
struct | heap_area |
Heap area. More... | |
struct | heap_block_foot_t |
Footer of a heap block. More... | |
struct | heap_block_head_t |
Header of a heap block. More... | |
struct | hw_resource_list_t |
struct | hw_resource_t |
HW resource (e.g. More... | |
struct | in6_addr |
INET6 address. More... | |
struct | in_addr |
INET address. More... | |
struct | link |
Doubly linked list head and link type. More... | |
struct | measured_string |
Character string with measured length. More... | |
struct | module |
struct | msg_t |
Structures of this type are used to group information about a call and about a message queue link. More... | |
struct | packet |
Packet header. More... | |
struct | packet_dimension |
Packet dimension. More... | |
struct | printf_spec_t |
Structure for specifying output methods for different printf clones. More... | |
struct | prodcons_t |
struct | runtime_env_t |
struct | sockaddr |
Socket address. More... | |
struct | sockaddr_in |
INET socket address. More... | |
struct | sockaddr_in6 |
INET6 socket address. More... | |
struct | socket |
Socket specific data. More... | |
struct | socket_client_globals |
Socket client library global data. More... | |
struct | stacktrace_t |
struct | stat |
struct | timeval |
struct | timezone |
struct | to_event_t |
Structures of this type are used to track the timeout events. More... | |
struct | token_t |
struct | vsnprintf_data_t |
struct | wu_event_t |
Structures of this type are used to track the wakeup events. More... | |
ARP specific message parameters definitions | |
#define | ARP_GET_NETIF(call) ((services_t) IPC_GET_ARG2(call)) |
Return the protocol service message parameter. | |
ICMP types definitions | |
#define | ICMP_ADDRESS 17 |
Address Mask Request. | |
#define | ICMP_ADDRESSREPLY 18 |
Address Mask Reply. | |
#define | ICMP_ALTERNATE_ADDR 6 |
Alternate Host Address. | |
#define | ICMP_CONVERSION_ERROR 31 |
Datagram Conversion Error. | |
#define | ICMP_DEST_UNREACH 3 |
Destination Unreachable. | |
#define | ICMP_DN_REPLY 38 |
Domain name reply. | |
#define | ICMP_DN_REQUEST 37 |
Domain name request. | |
#define | ICMP_ECHO 8 |
Echo Request. | |
#define | ICMP_ECHOREPLY 0 |
Echo Reply. | |
#define | ICMP_INFO_REPLY 16 |
Information Reply. | |
#define | ICMP_INFO_REQUEST 15 |
Information Request. | |
#define | ICMP_IPV6_I_AM_HERE 34 |
IPv6 I-Am-Here. | |
#define | ICMP_IPV6_WHERE_ARE_YOU 33 |
IPv6 Where-Are-You. | |
#define | ICMP_MOBILE_REPLY 36 |
Mobile Registration Reply. | |
#define | ICMP_MOBILE_REQUEST 35 |
Mobile Registration Request. | |
#define | ICMP_PARAMETERPROB 12 |
Parameter Problem. | |
#define | ICMP_PHOTURIS 40 |
Photuris. | |
#define | ICMP_REDIRECT 5 |
Redirect. | |
#define | ICMP_REDIRECT_MOBILE 32 |
Mobile Host Redirect. | |
#define | ICMP_ROUTER_ADV 9 |
Router Advertisement. | |
#define | ICMP_ROUTER_SOL 10 |
Router solicitation. | |
#define | ICMP_SKIP 39 |
SKIP. | |
#define | ICMP_SOURCE_QUENCH 4 |
Source Quench. | |
#define | ICMP_TIME_EXCEEDED 11 |
Time Exceeded. | |
#define | ICMP_TIMESTAMP 13 |
Timestamp Request. | |
#define | ICMP_TIMESTAMPREPLY 14 |
Timestamp Reply. | |
#define | ICMP_TRACEROUTE 30 |
Traceroute. | |
ICMP_ALTERNATE_ADDRESS codes definitions | |
#define | ICMP_ALTERNATE_HOST 0 |
Alternate address for host. | |
ICMP_TIME_EXCEEDED codes definitions | |
#define | ICMP_EXC_FRAGTIME 1 |
Reassembly TTL exceeded. | |
#define | ICMP_EXC_TTL 0 |
Transit TTL exceeded. | |
ICMP_DEST_UNREACH codes definitions | |
#define | ICMP_FRAG_NEEDED 4 |
Fragmentation needed but the Do Not Fragment bit was set. | |
#define | ICMP_HOST_ANO 10 |
Destination host administratively prohibited. | |
#define | ICMP_HOST_ISOLATED 8 |
Source host isolated (obsolete). | |
#define | ICMP_HOST_UNKNOWN 7 |
Destination host unknown. | |
#define | ICMP_HOST_UNR_TOS 12 |
Host unreachable for this type of service. | |
#define | ICMP_HOST_UNREACH 1 |
Host Unreachable. | |
#define | ICMP_NET_ANO 9 |
Destination network administratively prohibited. | |
#define | ICMP_NET_UNKNOWN 6 |
Destination network unknown. | |
#define | ICMP_NET_UNR_TOS 11 |
Network unreachable for this type of service. | |
#define | ICMP_NET_UNREACH 0 |
Network Unreachable. | |
#define | ICMP_PKT_FILTERED 13 |
Communication administratively prohibited by filtering. | |
#define | ICMP_PORT_UNREACH 3 |
Port Unreachable. | |
#define | ICMP_PREC_CUTOFF 15 |
Precedence cutoff in effect. | |
#define | ICMP_PREC_VIOLATION 14 |
Host precedence violation. | |
#define | ICMP_PROT_UNREACH 2 |
Protocol Unreachable. | |
#define | ICMP_SR_FAILED 5 |
Source Route failed. | |
ICMP specific message parameters definitions | |
#define | ICMP_GET_CODE(call) ((icmp_code_t) IPC_GET_ARG1(call)) |
Return the ICMP code message parameter. | |
#define | ICMP_GET_DONT_FRAGMENT(call) ((int) IPC_GET_ARG5(call)) |
Return the dont fragment message parameter. | |
#define | ICMP_GET_MTU(call) ((icmp_param_t) IPC_GET_ARG3(call)) |
Return the ICMP link MTU message parameter. | |
#define | ICMP_GET_POINTER(call) ((icmp_param_t) IPC_GET_ARG3(call)) |
Return the pointer message parameter. | |
#define | ICMP_GET_SIZE(call) ((size_t) IPC_GET_ARG1(call)) |
Return the size message parameter. | |
#define | ICMP_GET_TIMEOUT(call) ((suseconds_t) IPC_GET_ARG2(call)) |
Return the timeout message parameter. | |
#define | ICMP_GET_TOS(call) ((ip_tos_t) IPC_GET_ARG4(call)) |
Return the type of service message parameter. | |
#define | ICMP_GET_TTL(call) ((ip_ttl_t) IPC_GET_ARG3(call)) |
Return the time to live message parameter. | |
ICMP_PARAMETERPROB codes definitions | |
#define | ICMP_PARAM_LENGTH 2 |
Bad length. | |
#define | ICMP_PARAM_MISSING 1 |
Missing required option. | |
#define | ICMP_PARAM_POINTER 0 |
Pointer indicates the error. | |
ICMP_PHOTURIS codes definitions | |
#define | ICMP_PHOTURIS_AUTHENTICATION 1 |
Authentication failed. | |
#define | ICMP_PHOTURIS_BAD_SPI 0 |
Bad SPI. | |
#define | ICMP_PHOTURIS_DECOMPRESSION 2 |
Decompression failed. | |
#define | ICMP_PHOTURIS_DECRYPTION 3 |
Decryption failed. | |
#define | ICMP_PHOTURIS_NEED_AUTHENTICATION 4 |
Need authentication. | |
#define | ICMP_PHOTURIS_NEED_AUTHORIZATION 5 |
Need authorization. | |
ICMP_REDIRECT codes definitions | |
#define | ICMP_REDIR_HOST 1 |
Host redirect. | |
#define | ICMP_REDIR_HOSTTOS 3 |
Host redirect for this type of service. | |
#define | ICMP_REDIR_NET 0 |
Network redirect (or subnet). | |
#define | ICMP_REDIR_NETTOS 2 |
Network redirect for this type of service. | |
ICMP_ROUTER_ADV codes definitions | |
#define | ICMP_ROUTER_NO_NORMAL_TRAFFIC 16 |
Does not route common traffic. | |
#define | ICMP_ROUTER_NORMAL 0 |
Normal router advertisement. | |
Internetwork layer specific message parameters definitions | |
#define | IL_GET_PROTO(call) ((int) IPC_GET_ARG1(call)) |
Return the protocol number message parameter. | |
#define | IL_GET_SERVICE(call) ((services_t) IPC_GET_ARG2(call)) |
Return the registering service message parameter. | |
IP specific message parameters definitions | |
#define | IP_GET_ADDRESS(call) |
Return the address message parameter. | |
#define | IP_GET_GATEWAY(call) |
Return the gateway message parameter. | |
#define | IP_GET_NETMASK(call) |
Return the network mask message parameter. | |
#define | IP_GET_PROTOCOL(call) ((ip_protocol_t) IPC_GET_ARG1(call)) |
Return the protocol message parameter. | |
#define | IP_SET_HEADERLEN(answer, value) IPC_SET_ARG2(answer, (sysarg_t) (value)) |
Set the header length in the message answer. | |
IP options definitions | |
#define | IPOPT_CLASS_MASK 0x60 |
Class mask. | |
#define | IPOPT_CLASS_SHIFT 5 |
Class shift. | |
#define | IPOPT_COPIED(o) ((o) & IPOPT_COPY) |
Returns a value indicating whether the IP option should be copied. | |
#define | IPOPT_COPY (1 << IPOPT_COPY_SHIFT) |
Copy flag. | |
#define | IPOPT_COPY_SHIFT 7 |
Copy shift. | |
#define | IPOPT_NUMBER_MASK 0x1f |
Number mask. | |
#define | IPOPT_NUMBER_SHIFT 0 |
Number shift. | |
#define | IPOPT_TYPE(copy, class, number) |
Returns IP option type. | |
IP option class definitions | |
#define | IPOPT_CONTROL (0 << IPOPT_CLASS_SHIFT) |
Control class. | |
IP option type definitions | |
#define | IPOPT_END IPOPT_TYPE(0, IPOPT_CONTROL, 0) |
End of list. | |
#define | IPOPT_NOOP IPOPT_TYPE(0, IPOPT_CONTROL, 1) |
No operation. | |
IP protocols definitions | |
#define | IPPROTO_ICMP 1 |
#define | IPPROTO_TCP 6 |
#define | IPPROTO_UDP 17 |
Network interface specific message parameters definitions | |
#define | NETIF_GET_IO(call) ((void *) IPC_GET_ARG3(call)) |
Return the input/output address message parameter. | |
#define | NETIF_GET_IRQ(call) ((int) IPC_GET_ARG2(call)) |
Return the interrupt number message parameter. | |
Network interface layer specific message parameters definitions | |
#define | NIL_GET_PROTO(call) ((services_t) IPC_GET_ARG2(call)) |
Return the protocol service message parameter. | |
Protocol families definitions | |
Same as address families. | |
#define | PF_INET AF_INET |
#define | PF_INET6 AF_INET6 |
Socket specific message parameters definitions | |
#define | SOCKET_GET_ADDRESS_LENGTH(call) |
Returns the address length message parameter. | |
#define | SOCKET_GET_BACKLOG(call) |
Returns the backlog message parameter. | |
#define | SOCKET_GET_DATA_FRAGMENT_SIZE(call) |
Returns the data fragment size message parameter. | |
#define | SOCKET_GET_DATA_FRAGMENTS(call) |
Returns the data fragments message parameter. | |
#define | SOCKET_GET_FLAGS(call) |
Returns the flags message parameter. | |
#define | SOCKET_GET_HEADER_SIZE(call) |
Returns the header size message parameter. | |
#define | SOCKET_GET_NEW_SOCKET_ID(call) |
Returns the new socket identifier message parameter. | |
#define | SOCKET_GET_OPT_LEVEL(call) |
Returns the option level message parameter. | |
#define | SOCKET_GET_OPT_NAME(call) |
Returns the option name message parameter. | |
#define | SOCKET_GET_READ_DATA_LENGTH(call) |
Returns the read data length message parameter. | |
#define | SOCKET_GET_SOCKET_ID(call) |
Returns the socket identifier message parameter. | |
#define | SOCKET_SET_ADDRESS_LENGTH(answer, value) |
Sets the address length in the message answer. | |
#define | SOCKET_SET_DATA_FRAGMENT_SIZE(answer, value) |
Sets the data fragment size in the message answer. | |
#define | SOCKET_SET_HEADER_SIZE(answer, value) |
Sets the header size in the message answer. | |
#define | SOCKET_SET_READ_DATA_LENGTH(answer, value) |
Sets the read data length in the message answer. | |
#define | SOCKET_SET_SOCKET_ID(answer, value) |
Sets the socket identifier in the message answer. | |
Address families definitions | |
enum | |
Socket application programming interface | |
int | accept (int socket_id, struct sockaddr *cliaddr, socklen_t *addrlen) |
Accepts waiting socket. | |
int | bind (int socket_id, const struct sockaddr *my_addr, socklen_t addrlen) |
Binds the socket to a port address. | |
int | closesocket (int socket_id) |
Closes the socket. | |
int | connect (int socket_id, const struct sockaddr *serv_addr, socklen_t addrlen) |
Connects socket to the remote server. | |
int | getsockopt (int socket_id, int level, int optname, void *value, size_t *optlen) |
Gets socket option. | |
int | listen (int socket_id, int backlog) |
Sets the number of connections waiting to be accepted. | |
ssize_t | recv (int socket_id, void *data, size_t datalength, int flags) |
Receives data via the socket. | |
ssize_t | recvfrom (int socket_id, void *data, size_t datalength, int flags, struct sockaddr *fromaddr, socklen_t *addrlen) |
Receives data via the socket. | |
int | send (int socket_id, void *data, size_t datalength, int flags) |
Sends data via the socket. | |
int | sendto (int socket_id, const void *data, size_t datalength, int flags, const struct sockaddr *toaddr, socklen_t addrlen) |
Sends data via the socket to the remote address. | |
int | setsockopt (int socket_id, int level, int optname, const void *value, size_t optlen) |
Sets socket option. | |
int | socket (int domain, int type, int protocol) |
Creates a new socket. | |
ICMP module application interface | |
This interface is used by other application modules. | |
int | icmp_echo_msg (int icmp_phone, size_t size, mseconds_t timeout, ip_ttl_t ttl, ip_tos_t tos, int dont_fragment, const struct sockaddr *addr, socklen_t addrlen) |
Requests an echo message. | |
Packet management system interface | |
int | pm_add (packet_t *packet) |
Adds the packet mapping. | |
void | pm_destroy (void) |
Releases the packet map. | |
packet_t * | pm_find (packet_id_t packet_id) |
Finds the packet mapping. | |
int | pm_init (void) |
Initializes the packet map. | |
int | pq_add (packet_t **first, packet_t *packet, size_t order, size_t metric) |
Add packet to the sorted queue. | |
packet_t * | pq_detach (packet_t *packet) |
Detach the packet from the queue. | |
packet_t * | pq_find (packet_t *packet, size_t order) |
Finds the packet with the given order. | |
int | pq_get_order (packet_t *packet, size_t *order, size_t *metric) |
Sets the packet order and metric attributes. | |
int | pq_insert_after (packet_t *packet, packet_t *new_packet) |
Inserts packet after the given one. | |
packet_t * | pq_next (packet_t *packet) |
Returns the next packet in the queue. | |
packet_t * | pq_previous (packet_t *packet) |
Returns the previous packet in the queue. | |
int | pq_set_order (packet_t *packet, size_t order, size_t metric) |
Sets the packet order and metric attributes. | |
Defines | |
#define | __syscall0 __syscall |
#define | __SYSCALL0(id) __syscall0(0, 0, 0, 0, 0, 0, id) |
#define | __syscall0 __syscall_fast_func |
#define | __syscall0 __syscall |
#define | __syscall1 __syscall |
#define | __SYSCALL1(id, p1) __syscall1(p1, 0, 0, 0, 0, 0, id) |
#define | __syscall1 __syscall_fast_func |
#define | __syscall1 __syscall |
#define | __syscall2 __syscall |
#define | __SYSCALL2(id, p1, p2) __syscall2(p1, p2, 0, 0, 0, 0, id) |
#define | __syscall2 __syscall_fast_func |
#define | __syscall2 __syscall |
#define | __syscall3 __syscall |
#define | __SYSCALL3(id, p1, p2, p3) __syscall3(p1, p2, p3, 0, 0, 0, id) |
#define | __syscall3 __syscall_fast_func |
#define | __syscall3 __syscall |
#define | __syscall4 __syscall |
#define | __SYSCALL4(id, p1, p2, p3, p4) __syscall4(p1, p2, p3, p4, 0, 0, id) |
#define | __syscall4 __syscall_fast_func |
#define | __syscall4 __syscall |
#define | __syscall5 __syscall |
#define | __SYSCALL5(id, p1, p2, p3, p4, p5) __syscall5(p1, p2, p3, p4, p5, 0, id) |
#define | __syscall5 __syscall_slow |
#define | __syscall5 __syscall |
#define | __syscall6 __syscall |
#define | __SYSCALL6(id, p1, p2, p3, p4, p5, p6) __syscall6(p1, p2, p3, p4, p5, p6, id) |
#define | __syscall6 __syscall_slow |
#define | __syscall6 __syscall |
#define | ALIGN_DOWN(s, a) ((s) & ~((a) - 1)) |
Align to the nearest lower address which is a power of two. | |
#define | ALIGN_UP(s, a) ((long)((s) + ((a) - 1)) & ~((long) (a) - 1)) |
Align to the nearest higher address which is a power of two. | |
#define | AOFF64_MAX UINT64_MAX |
#define | AOFF64_MIN UINT64_MIN |
#define | AREA_FIRST_BLOCK_HEAD(area) (ALIGN_UP(((uintptr_t) (area)) + sizeof(heap_area_t), BASE_ALIGN)) |
Get first block in heap area. | |
#define | AREA_LAST_BLOCK_FOOT(area) (((uintptr_t) (area)->end) - sizeof(heap_block_foot_t)) |
Get last block in heap area. | |
#define | AREA_OVERHEAD(size) (ALIGN_UP(size + sizeof(heap_area_t), BASE_ALIGN)) |
Overhead of each area. | |
#define | ARP_GET_PROTO(call) ((services_t) IPC_GET_ARG2(call)) |
Return the protocol service message parameter. | |
#define | assert(expr) |
Debugging assert macro. | |
#define | async_data_read_forward_0_0(phoneid, method, answer) async_data_read_forward_fast((phoneid), (method), 0, 0, 0, 0, NULL) |
#define | async_data_read_forward_0_1(phoneid, method, answer) async_data_read_forward_fast((phoneid), (method), 0, 0, 0, 0, (answer)) |
#define | async_data_read_forward_1_0(phoneid, method, arg1, answer) async_data_read_forward_fast((phoneid), (method), (arg1), 0, 0, 0, NULL) |
#define | async_data_read_forward_1_1(phoneid, method, arg1, answer) async_data_read_forward_fast((phoneid), (method), (arg1), 0, 0, 0, (answer)) |
#define | async_data_read_forward_2_0(phoneid, method, arg1, arg2, answer) async_data_read_forward_fast((phoneid), (method), (arg1), (arg2), 0, 0, NULL) |
#define | async_data_read_forward_2_1(phoneid, method, arg1, arg2, answer) |
#define | async_data_read_forward_3_0(phoneid, method, arg1, arg2, arg3, answer) |
#define | async_data_read_forward_3_1(phoneid, method, arg1, arg2, arg3, answer) |
#define | async_data_read_forward_4_0(phoneid, method, arg1, arg2, arg3, arg4, answer) |
#define | async_data_read_forward_4_1(phoneid, method, arg1, arg2, arg3, arg4, answer) |
#define | async_data_read_start(p, buf, len) async_data_read_start_generic((p), (buf), (len), IPC_XF_NONE) |
#define | async_data_write_forward_0_0(phoneid, method, answer) async_data_write_forward_fast((phoneid), (method), 0, 0, 0, 0, NULL) |
#define | async_data_write_forward_0_1(phoneid, method, answer) async_data_write_forward_fast((phoneid), (method), 0, 0, 0, 0, (answer)) |
#define | async_data_write_forward_1_0(phoneid, method, arg1, answer) async_data_write_forward_fast((phoneid), (method), (arg1), 0, 0, 0, NULL) |
#define | async_data_write_forward_1_1(phoneid, method, arg1, answer) |
#define | async_data_write_forward_2_0(phoneid, method, arg1, arg2, answer) |
#define | async_data_write_forward_2_1(phoneid, method, arg1, arg2, answer) |
#define | async_data_write_forward_3_0(phoneid, method, arg1, arg2, arg3, answer) |
#define | async_data_write_forward_3_1(phoneid, method, arg1, arg2, arg3, answer) |
#define | async_data_write_forward_4_0(phoneid, method, arg1, arg2, arg3, arg4, answer) |
#define | async_data_write_forward_4_1(phoneid, method, arg1, arg2, arg3, arg4, answer) |
#define | async_data_write_start(p, buf, len) async_data_write_start_generic((p), (buf), (len), IPC_XF_NONE) |
#define | async_get_call(data) async_get_call_timeout(data, 0) |
#define | async_manager() fibril_switch(FIBRIL_TO_MANAGER) |
#define | async_req_0_0(phoneid, method) |
#define | async_req_0_1(phoneid, method, r1) |
#define | async_req_0_2(phoneid, method, r1, r2) |
#define | async_req_0_3(phoneid, method, r1, r2, r3) |
#define | async_req_0_4(phoneid, method, r1, r2, r3, r4) |
#define | async_req_0_5(phoneid, method, r1, r2, r3, r4, r5) |
#define | async_req_1_0(phoneid, method, arg1) |
#define | async_req_1_1(phoneid, method, arg1, rc1) |
#define | async_req_1_2(phoneid, method, arg1, rc1, rc2) |
#define | async_req_1_3(phoneid, method, arg1, rc1, rc2, rc3) |
#define | async_req_1_4(phoneid, method, arg1, rc1, rc2, rc3, rc4) |
#define | async_req_1_5(phoneid, method, arg1, rc1, rc2, rc3, rc4, rc5) |
#define | async_req_2_0(phoneid, method, arg1, arg2) |
#define | async_req_2_1(phoneid, method, arg1, arg2, rc1) |
#define | async_req_2_2(phoneid, method, arg1, arg2, rc1, rc2) |
#define | async_req_2_3(phoneid, method, arg1, arg2, rc1, rc2, rc3) |
#define | async_req_2_4(phoneid, method, arg1, arg2, rc1, rc2, rc3, rc4) |
#define | async_req_2_5(phoneid, method, arg1, arg2, rc1, rc2, rc3, rc4, rc5) |
#define | async_req_3_0(phoneid, method, arg1, arg2, arg3) |
#define | async_req_3_1(phoneid, method, arg1, arg2, arg3, rc1) |
#define | async_req_3_2(phoneid, method, arg1, arg2, arg3, rc1, rc2) |
#define | async_req_3_3(phoneid, method, arg1, arg2, arg3, rc1, rc2, rc3) |
#define | async_req_3_4(phoneid, method, arg1, arg2, arg3, rc1, rc2, rc3, rc4) |
#define | async_req_3_5(phoneid, method, arg1, arg2, arg3, rc1, rc2, rc3, rc4, rc5) |
#define | async_req_4_0(phoneid, method, arg1, arg2, arg3, arg4) |
#define | async_req_4_1(phoneid, method, arg1, arg2, arg3, arg4, rc1) |
#define | async_req_4_2(phoneid, method, arg1, arg2, arg3, arg4, rc1, rc2) |
#define | async_req_4_3(phoneid, method, arg1, arg2, arg3, arg4, rc1, rc2, rc3) |
#define | async_req_4_4(phoneid, method, arg1, arg2, arg3, arg4, rc1, rc2, rc3, rc4) |
#define | async_req_4_5(phoneid, method, arg1, arg2, arg3, arg4, rc1, rc2, rc3, rc4, rc5) |
#define | async_req_5_0(phoneid, method, arg1, arg2, arg3, arg4, arg5) |
#define | async_req_5_1(phoneid, method, arg1, arg2, arg3, arg4, arg5, rc1) |
#define | async_req_5_2(phoneid, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2) |
#define | async_req_5_3(phoneid, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, rc3) |
#define | async_req_5_4(phoneid, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, rc3, rc4) |
#define | async_req_5_5(phoneid, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, rc3, rc4, rc5) |
#define | async_send_0(phoneid, method, dataptr) async_send_fast((phoneid), (method), 0, 0, 0, 0, (dataptr)) |
#define | async_send_1(phoneid, method, arg1, dataptr) async_send_fast((phoneid), (method), (arg1), 0, 0, 0, (dataptr)) |
#define | async_send_2(phoneid, method, arg1, arg2, dataptr) async_send_fast((phoneid), (method), (arg1), (arg2), 0, 0, (dataptr)) |
#define | async_send_3(phoneid, method, arg1, arg2, arg3, dataptr) async_send_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, (dataptr)) |
#define | async_send_4(phoneid, method, arg1, arg2, arg3, arg4, dataptr) |
#define | async_send_5(phoneid, method, arg1, arg2, arg3, arg4, arg5, dataptr) |
#define | async_share_in_start_0_0(phoneid, dst, size) async_share_in_start((phoneid), (dst), (size), 0, NULL) |
#define | async_share_in_start_0_1(phoneid, dst, size, flags) async_share_in_start((phoneid), (dst), (size), 0, (flags)) |
#define | async_share_in_start_1_0(phoneid, dst, size, arg) async_share_in_start((phoneid), (dst), (size), (arg), NULL) |
#define | async_share_in_start_1_1(phoneid, dst, size, arg, flags) async_share_in_start((phoneid), (dst), (size), (arg), (flags)) |
#define | BASE_ALIGN 16 |
Allocation alignment. | |
#define | BLOCK_FOOT(head) |
Get footer in heap block. | |
#define | BLOCK_HEAD(foot) |
Get header in heap block. | |
#define | BUFSIZ 4096 |
Default size for stream I/O buffers. | |
#define | bzero(ptr, len) memset((ptr), 0, (len)) |
#define | CHAR_MAP_MAGIC_VALUE 0x12345611 |
Internal magic value for a consistency check. | |
#define | CHAR_MAP_NULL (-1) |
Invalid assigned value used also if an entry does not exist. | |
#define | CLIENT_HASH_TABLE_BUCKETS 32 |
#define | CONN_HASH_TABLE_BUCKETS 32 |
#define | CONT_BITS 6 |
Number of data bits in a UTF-8 continuation byte. | |
#define | context_set_generic(c, _pc, stack, size, ptls) |
#define | DEBUG(fmt,) |
#define | DECLARE_GCD(type, name) |
#define | DECLARE_LCM(type, name, gcd) |
#define | DEVICE_INVALID_ID (-1) |
Invalid device identifier. | |
#define | DEVICE_MAP_DECLARE INT_MAP_DECLARE |
Device identifier to generic type map declaration. | |
#define | DEVICE_MAP_IMPLEMENT INT_MAP_IMPLEMENT |
Device identifier to generic type map implementation. | |
#define | DPRINTF(format,) if (0) printf(format, ##__VA_ARGS__) |
#define | DST_NONE 0 |
#define | DT_BIND_NOW 24 |
#define | DT_DEBUG 21 |
#define | DT_FINI 13 |
#define | DT_HASH 4 |
#define | DT_HIPROC 0x7fffffff |
#define | DT_INIT 12 |
#define | DT_JMPREL 23 |
#define | DT_LOPROC 0x70000000 |
#define | DT_NEEDED 1 |
#define | DT_NULL 0 |
#define | DT_PLTGOT 3 |
#define | DT_PLTREL 20 |
#define | DT_PLTRELSZ 2 |
#define | DT_REL 17 |
#define | DT_RELA 7 |
#define | DT_RELAENT 9 |
#define | DT_RELASZ 8 |
#define | DT_RELENT 19 |
#define | DT_RELSZ 18 |
#define | DT_RPATH 15 |
#define | DT_SONAME 14 |
#define | DT_STRSZ 10 |
#define | DT_STRTAB 5 |
#define | DT_SYMBOLIC 16 |
#define | DT_SYMENT 11 |
#define | DT_SYMTAB 6 |
#define | DT_TEXTREL 22 |
#define | DTOR_T(identifier) void (*identifier)(const void *) |
Generic destructor function pointer. | |
#define | DTOR_T(identifier) void (*identifier)(const void *) |
Generic destructor function pointer. | |
#define | DTOR_T(identifier) void (*identifier)(const void *) |
Generic destructor function pointer. | |
#define | DYN_FIFO_MAGIC_VALUE 0x58627659 |
Internal magic value for a consistency check. | |
#define | EADDRINUSE (-10048) |
Address is already in use. | |
#define | EAFNOSUPPORT (-10047) |
Address family is not supported. | |
#define | EAGAIN (-11002) |
The requested operation was not performed. | |
#define | EBADCHECKSUM (-300) |
Bad checksum. | |
#define | EBADF (-262) |
#define | EDESTADDRREQ (-10039) |
The destination address required. | |
#define | EEMPTY (-302) |
Empty resource (no data). | |
#define | EEXIST (-260) |
#define | EINPROGRESS (-10036) |
An API function is called while another blocking function is in progress. | |
#define | EIO (-265) |
#define | EISDIR (-257) |
#define | ELF32_R_SYM(i) ((i)>>8) |
#define | ELF32_R_TYPE(i) ((unsigned char)(i)) |
#define | EMFILE (-18) |
#define | EMLINK (-266) |
#define | ENAK (-303) |
Negative acknowledgment. | |
#define | ENAMETOOLONG (-256) |
#define | ENOSPC (-259) |
#define | ENOTCONN (-10057) |
The socket is not connected or bound. | |
#define | ENOTDIR (-258) |
#define | ENOTEMPTY (-261) |
#define | ENOTSOCK (-10038) |
The socket identifier is not valid. | |
#define | EOF (-1) |
#define | EPFNOSUPPORT (-10046) |
Protocol family is not supported. | |
#define | EPROTONOSUPPORT (-10043) |
Protocol is not supported. | |
#define | ERANGE (-263) |
#define | errno (*(__errno())) |
#define | errx(status, fmt,) |
#define | ESOCKTNOSUPPORT (-10044) |
Socket type is not supported. | |
#define | ESTALL (-301) |
USB: stalled operation. | |
#define | EXDEV (-264) |
#define | false 0 |
#define | FIBRIL_CONDVAR_INITIALIZE(name) fibril_condvar_t name = FIBRIL_CONDVAR_INITIALIZER(name) |
#define | FIBRIL_CONDVAR_INITIALIZER(name) |
#define | FIBRIL_INITIAL_STACK_PAGES_NO 1 |
#define | fibril_local __thread |
Fibril-local variable specifier. | |
#define | FIBRIL_MUTEX_INITIALIZE(name) fibril_mutex_t name = FIBRIL_MUTEX_INITIALIZER(name) |
#define | FIBRIL_MUTEX_INITIALIZER(name) |
#define | FIBRIL_RWLOCK_INITIALIZE(name) fibril_rwlock_t name = FIBRIL_RWLOCK_INITIALIZER(name) |
#define | FIBRIL_RWLOCK_INITIALIZER(name) |
#define | FIBRIL_SERIALIZED 1 |
#define | FIBRIL_WRITER 2 |
#define | fifo_create(name) name.fifo = malloc(sizeof(*name.fifo) * name.items) |
Allocate memory for dynamic FIFO. | |
#define | FIFO_CREATE_STATIC(name, t, itms) |
#define | FIFO_INITIALIZE_DYNAMIC(name, t, itms) |
Create and prepare dynamic FIFO. | |
#define | FIFO_INITIALIZE_STATIC(name, t, itms) |
Create and initialize static FIFO. | |
#define | fifo_pop(name) name.fifo[name.head = (name.head + 1) < name.items ? (name.head + 1) : 0] |
Pop value from head of FIFO. | |
#define | fifo_push(name, value) name.fifo[name.tail = (name.tail + 1) < name.items ? (name.tail + 1) : 0] = (value) |
Push value to tail of FIFO. | |
#define | FUTEX_INITIALIZER {1} |
#define | GENERIC_CHAR_MAP_DECLARE(name, type) |
Character string to generic type map declaration. | |
#define | GENERIC_CHAR_MAP_IMPLEMENT(name, type) |
Character string to generic type map implementation. | |
#define | GENERIC_CHAR_MAP_MAGIC_VALUE 0x12345622 |
Internal magic value for a map consistency check. | |
#define | GENERIC_FIELD_DECLARE(name, type) |
Generic type field declaration. | |
#define | GENERIC_FIELD_IMPLEMENT(name, type) |
Generic type field implementation. | |
#define | GENERIC_FIELD_MAGIC_VALUE 0x55667788 |
Internal magic value for a field consistency check. | |
#define | getpagesize() (PAGE_SIZE) |
#define | GROSS_SIZE(size) ((size) + STRUCT_OVERHEAD) |
Calculate real size of a heap block. | |
#define | hash_table_get_instance(item, type, member) list_get_instance((item), type, member) |
#define | HEAP_AREA_MAGIC UINT32_C(0xBEEFCAFE) |
Magic used in heap descriptor. | |
#define | HEAP_BLOCK_FOOT_MAGIC UINT32_C(0xBEEF0202) |
Magic used in heap footers. | |
#define | HEAP_BLOCK_HEAD_MAGIC UINT32_C(0xBEEF0101) |
Magic used in heap headers. | |
#define | HI_MASK_8(n) (~LO_MASK_8(8 - (n))) |
Byte mask consisting of highest bits (out of 8). | |
#define | host2uint16_t_be(n) (uint16_t_byteorder_swap(n)) |
#define | host2uint16_t_le(n) (n) |
#define | host2uint32_t_be(n) (uint32_t_byteorder_swap(n)) |
#define | host2uint32_t_le(n) (n) |
#define | host2uint64_t_be(n) (uint64_t_byteorder_swap(n)) |
#define | host2uint64_t_le(n) (n) |
#define | htonl(n) host2uint32_t_be((n)) |
#define | htons(n) host2uint16_t_be((n)) |
#define | IBUF_SIZE 32 |
Immediate buffer size. | |
#define | ICMP_CONNECT_TIMEOUT 1000000 |
Default timeout for incoming connections in microseconds (1 sec). | |
#define | INDEX(buf, i, elem_size) ((buf) + (i) * (elem_size)) |
Array accessor. | |
#define | INET6_ADDRSTRLEN (8 * 4 + 7 + 1) |
INET6 string address maximum length. | |
#define | INET_ADDRSTRLEN (4 * 3 + 3 + 1) |
INET string address maximum length. | |
#define | INT16_MAX INT16_C(0x7FFF) |
#define | INT16_MIN INT16_C(0x8000) |
#define | INT32_MAX INT32_C(0x7FFFFFFF) |
#define | INT32_MIN INT32_C(0x80000000) |
#define | INT64_MAX INT64_C(0x7FFFFFFFFFFFFFFF) |
#define | INT64_MIN INT64_C(0x8000000000000000) |
#define | INT8_MAX INT8_C(0x7F) |
#define | INT8_MIN INT8_C(0x80) |
#define | INT_MAP_DECLARE(name, type) |
Integer to generic type map declaration. | |
#define | INT_MAP_IMPLEMENT(name, type) |
Integer to generic type map implementation. | |
#define | INT_MAP_ITEM_MAGIC_VALUE 0x55667788 |
Internal magic value for an item consistency check. | |
#define | INT_MAP_MAGIC_VALUE 0x11223344 |
Internal magic value for a map consistency check. | |
#define | IPC_GET_ADDR_LEN(call) ((size_t) IPC_GET_ARG2(call)) |
Return the maximal address length message parameter. | |
#define | IPC_GET_CONTENT(call) ((size_t) IPC_GET_ARG1(call)) |
Return the maximal content length message parameter. | |
#define | IPC_GET_ID(call) ((packet_id_t) IPC_GET_ARG1(call)) |
Return the packet identifier message parameter. | |
#define | IPC_GET_PREFIX(call) ((size_t) IPC_GET_ARG3(call)) |
Return the maximal prefix length message parameter. | |
#define | IPC_GET_SUFFIX(call) ((size_t) IPC_GET_ARG4(call)) |
Return the maximal suffix length message parameter. | |
#define | IPDEFTTL 64 |
Default time to live counter. | |
#define | IPVERSION 4 |
Default IPVERSION. | |
#define | KiB2SIZE(kb) ((kb) << 10) |
#define | LIBARCH_SYSCALL_GENERIC |
#define | LIBARCH_SYSCALL_GENERIC |
#define | LIBARCH_SYSCALL_GENERIC |
#define | LIBARCH_SYSCALL_GENERIC |
#define | LIBC_ASYNC_C_ |
Asynchronous library. | |
#define | list_foreach(list, iterator) |
#define | list_get_instance(link, type, member) ((type *) (((void *)(link)) - ((void *) &(((type *) NULL)->member)))) |
#define | LIST_INITIALIZE(name) |
Declare and initialize statically allocated list. | |
#define | LO_MASK_32(n) ((uint32_t) ((1 << (n)) - 1)) |
Byte mask consisting of lowest bits (out of 32). | |
#define | LO_MASK_8(n) ((uint8_t) ((1 << (n)) - 1)) |
Byte mask consisting of lowest bits (out of 8). | |
#define | LOWER32(arg) (((uint64_t) (arg)) & 0xffffffff) |
#define | malloc_assert(expr) |
#define | MAP_ANONYMOUS (1 << 3) |
#define | MAP_FAILED ((void *) -1) |
#define | MAP_FIXED (1 << 2) |
#define | MAP_PRIVATE (1 << 1) |
#define | MAP_SHARED (1 << 0) |
#define | max(a, b) ((a) > (b) ? (a) : (b)) |
#define | MERGE_LOUP32(lo, up) |
#define | MiB2SIZE(mb) ((mb) << 20) |
#define | min(a, b) ((a) < (b) ? (a) : (b)) |
#define | MIN_ERRNO -17 |
#define | MODULE_WAIT_TIME (10 * 1000) |
The time between connect requests in microseconds. | |
#define | NAME_MAX 256 |
#define | NET_SIZE(size) ((size) - STRUCT_OVERHEAD) |
Calculate net size of a heap block. | |
#define | NEXT_INDEX(fifo, index) (((index) + 1) % ((fifo)->size + 1)) |
Returns the next queue index. | |
#define | NO_DATA (-11004) |
No data. | |
#define | NO_TRACE __attribute__((no_instrument_function)) |
#define | NOERR_LEN 64 |
#define | ntohl(n) uint32_t_be2host((n)) |
#define | ntohs(n) uint16_t_be2host((n)) |
#define | NULL ((void *) 0) |
#define | O_APPEND 8 |
#define | O_CREAT 1 |
#define | O_DESC 128 |
#define | O_EXCL 2 |
#define | O_RDONLY 16 |
#define | O_RDWR 32 |
#define | O_TRUNC 4 |
#define | O_WRONLY 64 |
#define | OFF64_MAX INT64_MAX |
#define | OFF64_MIN INT64_MIN |
#define | PACKET_DATA_LENGTH(header) ((header)->data_end - (header)->data_start) |
Returns the actual packet data length. | |
#define | PACKET_MAGIC_VALUE 0x11227788 |
Packet integrity check magic value. | |
#define | PACKET_MAP_INDEX(packet_id) (((packet_id) - 1) % PACKET_MAP_SIZE) |
Returns the packet index in the corresponding packet map page. | |
#define | PACKET_MAP_PAGE(packet_id) (((packet_id) - 1) / PACKET_MAP_SIZE) |
Returns the packet map page index. | |
#define | PACKET_MAP_SIZE 100 |
Packet map page size. | |
#define | PACKET_MAX_ADDRESS_LENGTH(header) ((header)->dest_addr - (header)->src_addr) |
Returns the maximum packet address length. | |
#define | PACKET_MIN_SUFFIX(header) ((header)->length - (header)->data_start - (header)->max_content) |
Returns the minimum packet suffix. | |
#define | PRIdOFF64 PRId64 |
#define | PRINTF_ATTRIBUTE(start, end) __attribute__((format(gnu_printf, start, end))) |
#define | PRIuOFF64 PRIu64 |
#define | PRIXOFF64 PRIX64 |
#define | PRIxOFF64 PRIx64 |
#define | PROTO_EXEC AS_AREA_EXEC |
#define | PROTO_READ AS_AREA_READ |
#define | PROTO_WRITE AS_AREA_WRITE |
#define | rand() random() |
#define | RAND_MAX 714025 |
#define | ROUND_UP(n, b) (((n) / (b) + ((n) % (b) != 0)) * (b)) |
Round up to the nearest higher boundary. | |
#define | rwlock_initialize(rwlock) futex_initialize((rwlock), 1) |
#define | RWLOCK_INITIALIZE(rwlock) rwlock_t rwlock = FUTEX_INITIALIZER |
#define | rwlock_read_lock(rwlock) futex_down((rwlock)) |
#define | rwlock_read_unlock(rwlock) futex_up((rwlock)) |
#define | rwlock_write_lock(rwlock) futex_down((rwlock)) |
#define | rwlock_write_unlock(rwlock) futex_up((rwlock)) |
#define | SEEK_CUR 1 |
#define | SEEK_CUR 1 |
#define | SEEK_END 2 |
#define | SEEK_END 2 |
#define | SEEK_SET 0 |
#define | SEEK_SET 0 |
#define | SHN_ABS 0xfff1 |
#define | SHN_COMMON 0xfff2 |
#define | SHN_HIPROC 0xff1f |
#define | SHN_HIRESERVE 0xffff |
#define | SHN_LOPROC 0xff00 |
#define | SHN_LORESERVE 0xff00 |
#define | SHN_UNDEF 0 |
#define | SHRINK_GRANULARITY (64 * PAGE_SIZE) |
Heap shrink granularity. | |
#define | SOCKET_CONNECT_TIMEOUT (1 * 1000 * 1000) |
Default timeout for connections in microseconds. | |
#define | SOCKET_ID_TRIES 100 |
Maximum number of random attempts to find a new socket identifier before switching to the sequence. | |
#define | SOCKET_INITIAL_ACCEPTED_SIZE 1 |
Initial waiting sockets queue size. | |
#define | SOCKET_INITIAL_RECEIVED_SIZE 4 |
Initial received packet queue size. | |
#define | SOCKET_MAX_ACCEPTED_SIZE 0 |
Maximum waiting sockets queue size. | |
#define | SOCKET_MAX_RECEIVED_SIZE 0 |
Maximum received packet queue size. | |
#define | srand(seed) srandom(seed) |
#define | STN_UNDEF 0 |
#define | STR_BOUNDS(length) ((length) << 2) |
Maximum size of a string containing length characters. | |
#define | STR_NO_LIMIT ((size_t) -1) |
No size limit constant. | |
#define | STRING(arg) STRING_ARG(arg) |
#define | STRING_ARG(arg) #arg |
#define | STRUCT_OVERHEAD (sizeof(heap_block_head_t) + sizeof(heap_block_foot_t)) |
Overhead of each heap block. | |
#define | SYSINFO_STATS_MAX_PATH 64 |
#define | THREAD_INITIAL_STACK_PAGES_NO 2 |
#define | true 1 |
#define | U_SPECIAL '?' |
#define | UINT16_MAX UINT16_C(0xFFFF) |
#define | UINT16_MIN UINT16_C(0) |
#define | uint16_t_be2host(n) (uint16_t_byteorder_swap(n)) |
#define | uint16_t_le2host(n) (n) |
#define | UINT32_MAX UINT32_C(0xFFFFFFFF) |
#define | UINT32_MIN UINT32_C(0) |
#define | uint32_t_be2host(n) (uint32_t_byteorder_swap(n)) |
#define | uint32_t_le2host(n) (n) |
#define | UINT64_MAX UINT64_C(0xFFFFFFFFFFFFFFFF) |
#define | UINT64_MIN UINT64_C(0) |
#define | uint64_t_be2host(n) (uint64_t_byteorder_swap(n)) |
#define | uint64_t_le2host(n) (n) |
#define | UINT8_MAX UINT8_C(0xFF) |
#define | UINT8_MIN UINT8_C(0) |
#define | UNKNOWN_LOCALE_LEN 64 |
#define | UPPER32(arg) (((((uint64_t) arg)) >> 32) & 0xffffffff) |
#define | va_arg(ap, type) __builtin_va_arg(ap, type) |
#define | va_end(ap) __builtin_va_end(ap) |
#define | va_start(ap, last) __builtin_va_start(ap, last) |
Typedefs | |
typedef addrinfo | addrinfo_t |
Type definition of the address information. | |
typedef ipc_callid_t | aid_t |
typedef uint64_t | aoff64_t |
Absolute offset. | |
typedef int(*) | arg_parser (const char *, int *) |
typedef void(*) | async_client_conn_t (ipc_callid_t, ipc_call_t *) |
typedef void *(*) | async_client_data_ctor_t (void) |
typedef void(*) | async_client_data_dtor_t (void *) |
typedef uint8_t | bool |
typedef char_map | char_map_t |
Type definition of the character string to integer map. | |
typedef int | connect_module_t (services_t need) |
Connect to the needed module function type definition. | |
typedef int | device_id_t |
Device identifier type. | |
typedef enum device_state | device_state_t |
Device state type. | |
typedef device_stats | device_stats_t |
Type definition of the device usage statistics. | |
typedef dyn_fifo | dyn_fifo_t |
Type definition of the dynamic fifo queue. | |
typedef dyn_info | dyn_info_t |
Holds the data extracted from an ELF Dynamic section. | |
typedef sysarg_t | fid_t |
typedef unsigned long | fifo_count_t |
typedef unsigned long | fifo_index_t |
typedef atomic_t | futex_t |
typedef unsigned long | hash_count_t |
typedef unsigned long | hash_index_t |
typedef heap_area | heap_area_t |
Heap area. | |
typedef uint8_t | icmp_code_t |
ICMP code type definition. | |
typedef uint16_t | icmp_param_t |
ICMP parameter type definition. | |
typedef uint8_t | icmp_type_t |
ICMP type type definition. | |
typedef in6_addr | in6_addr_t |
Type definition of the INET6 address. | |
typedef in_addr | in_addr_t |
Type definition of the INET address. | |
typedef volatile uint16_t | ioport16_t |
typedef volatile uint32_t | ioport32_t |
typedef volatile uint8_t | ioport8_t |
typedef uint8_t | ip_protocol_t |
IP transport protocol type definition. | |
typedef uint8_t | ip_tos_t |
IP type of service type definition. | |
typedef uint8_t | ip_ttl_t |
IP time to live counter type definition. | |
typedef context_t | jmp_buf |
typedef link | link_t |
Doubly linked list head and link type. | |
typedef measured_string | measured_string_t |
Type definition of the character string with measured length. | |
typedef unsigned int | mode_t |
typedef uint32_t | mseconds_t |
typedef int64_t | off64_t |
Relative offset. | |
typedef packet_dimension | packet_dimension_t |
Type definition of the packet dimension. | |
typedef int | packet_id_t |
Packet identifier type. | |
typedef packet_t * | packet_map_t [PACKET_MAP_SIZE] |
Type definition of the packet map page. | |
typedef packet | packet_t |
Type definition of the packet. | |
typedef atomic_t | rwlock_t |
typedef enum sock_type | sock_type_t |
Socket types. | |
typedef sockaddr_in6 | sockaddr_in6_t |
Type definition of the INET6 socket address. | |
typedef sockaddr_in | sockaddr_in_t |
Type definition of the INET socket address. | |
typedef sockaddr | sockaddr_t |
Type definition of the socket address. | |
typedef socket | socket_t |
Type definition of the socket specific data. | |
typedef int32_t | socklen_t |
Type definition of the socket length. | |
typedef int(*) | sort_cmp_t (void *, void *, void *) |
typedef long | suseconds_t |
typedef uint64_t | task_id_t |
typedef sysarg_t | thash_t |
typedef uint64_t | thread_id_t |
typedef long | time_t |
typedef uint32_t | useconds_t |
typedef __builtin_va_list | va_list |
Enumerations | |
enum | _buffer_state { _bs_empty, _bs_write, _bs_read } |
enum | _buffer_type { _IONBF, _IOLBF, _IOFBF } |
enum | arp_messages { NET_ARP_CLEAN_CACHE = NET_ARP_FIRST, NET_ARP_CLEAR_ADDRESS, NET_ARP_CLEAR_DEVICE, NET_ARP_DEVICE, NET_ARP_TRANSLATE } |
ARP module messages. More... | |
enum | char_dev_method_t |
enum | console_caps_t |
enum | console_color_t |
enum | console_ev_type_t |
enum | console_style_t |
enum | device_state { NETIF_NULL = 0, NETIF_STOPPED, NETIF_ACTIVE, NETIF_CARRIER_LOST } |
Device state. More... | |
enum | endianness_t |
enum | fibril_switch_type_t |
enum | hw_res_method_t |
HW resource provider interface. | |
enum | hw_res_type_t |
HW resource types. | |
enum | icmp_messages_t { NET_ICMP_ECHO = NET_ICMP_FIRST, NET_ICMP_DEST_UNREACH, NET_ICMP_SOURCE_QUENCH, NET_ICMP_TIME_EXCEEDED, NET_ICMP_PARAMETERPROB } |
ICMP module messages. More... | |
enum | il_messages { NET_IL_DEVICE_STATE = NET_IL_FIRST, NET_IL_MTU_CHANGED, NET_IL_RECEIVED } |
Internet layer modules messages. More... | |
enum | ip_messages { NET_IP_DEVICE = NET_IP_FIRST, NET_IP_ADD_ROUTE, NET_IP_GET_ROUTE, NET_IP_RECEIVED_ERROR, NET_IP_SET_GATEWAY, NET_IP_PACKET_SPACE, NET_IP_SEND } |
IP module messages. More... | |
enum | keycode_t |
Keycode definitions. More... | |
enum | keymod_t |
enum | l18_win_locales_t |
Windows locale IDs. More... | |
enum | log_level_t { , LVL_LIMIT } |
enum | net_messages { NET_NET_GET_CONF = NET_FIRST, NET_NET_GET_DEVICE_CONF, NET_NET_STARTUP } |
Networking subsystem central module messages. More... | |
enum | netif_messages { NET_NETIF_PROBE = NET_NETIF_FIRST, NET_NETIF_SEND, NET_NETIF_START, NET_NETIF_STATS, NET_NETIF_STOP, NET_NETIF_GET_ADDR } |
Network interface common module messages. More... | |
enum | nil_messages { NET_NIL_DEVICE = NET_NIL_FIRST, NET_NIL_DEVICE_STATE, NET_NIL_RECEIVED, NET_NIL_SEND, NET_NIL_PACKET_SPACE, NET_NIL_ADDR, NET_NIL_BROADCAST_ADDR } |
Network interface layer module messages. More... | |
enum | packet_messages { NET_PACKET_CREATE_1 = NET_PACKET_FIRST, NET_PACKET_CREATE_4, NET_PACKET_GET, NET_PACKET_GET_SIZE, NET_PACKET_RELEASE } |
Packet server module messages. More... | |
enum | sock_type { SOCK_STREAM = 1, SOCK_DGRAM = 2, SOCK_RAW = 3 } |
Socket types. More... | |
enum | socket_messages { NET_SOCKET = NET_SOCKET_FIRST, NET_SOCKET_BIND, NET_SOCKET_LISTEN, NET_SOCKET_ACCEPT, NET_SOCKET_CONNECT, NET_SOCKET_CLOSE, NET_SOCKET_SEND, NET_SOCKET_SENDTO, NET_SOCKET_RECV, NET_SOCKET_RECVFROM, NET_SOCKET_GETSOCKOPT, NET_SOCKET_SETSOCKOPT, NET_SOCKET_ACCEPTED, NET_SOCKET_RECEIVED, NET_SOCKET_DATA_FRAGMENT_SIZE } |
Socket client messages. More... | |
enum | state_t |
States used by canonify(). | |
enum | sysinfo_item_tag_t |
Sysinfo value types. | |
enum | task_exit_t |
enum | tl_messages { NET_TL_RECEIVED = NET_TL_FIRST } |
Transport layer modules messages. More... | |
enum | tokval_t |
Token types used for tokenization of path. | |
Functions | |
tcb_t * | __alloc_tls (void **, size_t) |
void | __async_init (void) |
Initialize the async framework. | |
void | __async_sess_init (void) |
Initialize the async_sess subsystem. | |
void | __entry (void) |
int * | __errno (void) |
void | __free_tls (tcb_t *tcb) |
void | __free_tls_arch (tcb_t *, size_t) |
void | __main (void *pcb_ptr) |
tcb_t * | __make_tls (void) |
Create TLS (Thread Local Storage) data structures. | |
void | __malloc_init (void) |
Initialize the heap allocator. | |
void | __stdio_done (void) |
void | __stdio_init (int filc, fdi_node_t *filv[]) |
sysarg_t | __syscall (const sysarg_t, const sysarg_t, const sysarg_t, const sysarg_t, const sysarg_t, const sysarg_t, const syscall_t) |
Syscall routine. | |
void | __thread_entry (void) |
void | __thread_main (uspace_arg_t *uarg) |
Main thread function. | |
static int | _fallocbuf (FILE *stream) |
Allocate stream buffer. | |
static void | _ffillbuf (FILE *stream) |
Read some data in stream buffer. | |
static void | _fflushbuf (FILE *stream) |
Write out stream buffer, do not sync stream. | |
static void | _fibril_condvar_wakeup_common (fibril_condvar_t *fcv, bool once) |
static void | _fibril_mutex_unlock_unsafe (fibril_mutex_t *fm) |
static void | _fibril_rwlock_common_unlock (fibril_rwlock_t *frw) |
static size_t | _fread (void *buf, size_t size, size_t nmemb, FILE *stream) |
Read from a stream (unbuffered). | |
static size_t | _fwrite (const void *buf, size_t size, size_t nmemb, FILE *stream) |
Write to a stream (unbuffered). | |
static void | _gsort (void *data, size_t cnt, size_t elem_size, sort_cmp_t cmp, void *arg, void *slot) |
Gnome sort. | |
static void | _qsort (void *data, size_t cnt, size_t elem_size, sort_cmp_t cmp, void *arg, void *slot, void *pivot) |
Quicksort. | |
static void | _setvbuf (FILE *stream) |
static unsigned long | _strtoul (const char *nptr, char **endptr, int base, char *sgn) |
Convert string to a number. | |
static int | _unlink (const char *path, int lflag) |
void | abort (void) |
char * | absolutize (const char *path, size_t *retlen) |
void | answer_call (ipc_callid_t callid, int result, ipc_call_t *answer, size_t count) |
Answer a call. | |
static void | area_check (void *addr) |
Check a heap area structure. | |
static bool | area_create (size_t size) |
Create new heap area. | |
static bool | area_grow (heap_area_t *area, size_t size) |
Try to enlarge a heap area. | |
int | arg_parse_short_long (const char *, const char *, const char *) |
int | arg_parse_string (int, char **, int *, char **, int) |
Parse the next argument as a character string. | |
int | as_area_change_flags (void *address, unsigned int flags) |
Change address-space area flags. | |
void * | as_area_create (void *address, size_t size, unsigned int flags) |
Create address space area. | |
int | as_area_destroy (void *address) |
Destroy address space area. | |
int | as_area_resize (void *address, size_t size, unsigned int flags) |
Resize address space area. | |
void * | as_get_mappable_page (size_t size) |
Return pointer to unmapped address space area. | |
int | as_get_physical_mapping (void *address, uintptr_t *frame) |
Find mapping to physical address. | |
bool | ascii_check (wchar_t ch) |
Check whether character is plain ASCII. | |
int | asprintf (char **strp, const char *fmt,...) |
Allocate and print to string. | |
static int | asprintf_str_write (const char *str, size_t count, void *unused) |
static int | asprintf_wstr_write (const wchar_t *str, size_t count, void *unused) |
void | assert_abort (const char *cond, const char *file, unsigned int line) |
sysarg_t | async_answer_0 (ipc_callid_t callid, sysarg_t retval) |
sysarg_t | async_answer_1 (ipc_callid_t callid, sysarg_t retval, sysarg_t arg1) |
sysarg_t | async_answer_2 (ipc_callid_t callid, sysarg_t retval, sysarg_t arg1, sysarg_t arg2) |
sysarg_t | async_answer_3 (ipc_callid_t callid, sysarg_t retval, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3) |
sysarg_t | async_answer_4 (ipc_callid_t callid, sysarg_t retval, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, sysarg_t arg4) |
sysarg_t | async_answer_5 (ipc_callid_t callid, sysarg_t retval, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, sysarg_t arg5) |
void * | async_client_data_get (void) |
int | async_connect_kbox (task_id_t id) |
Connect to a task specified by id. | |
int | async_connect_me_to (int phone, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3) |
Wrapper for making IPC_M_CONNECT_ME_TO calls using the async framework. | |
int | async_connect_me_to_blocking (int phoneid, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3) |
Wrapper for making IPC_M_CONNECT_ME_TO calls using the async framework. | |
int | async_connect_to_me (int phone, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, async_client_conn_t client_receiver) |
Wrapper for making IPC_M_CONNECT_TO_ME calls using the async framework. | |
void | async_create_manager (void) |
Add one manager to manager list. | |
aid_t | async_data_read (int phoneid, void *dst, size_t size, ipc_call_t *dataptr) |
Start IPC_M_DATA_READ using the async framework. | |
int | async_data_read_finalize (ipc_callid_t callid, const void *src, size_t size) |
Wrapper for answering the IPC_M_DATA_READ calls using the async framework. | |
int | async_data_read_forward_fast (int phoneid, sysarg_t method, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, ipc_call_t *dataptr) |
Wrapper for forwarding any read request. | |
bool | async_data_read_receive (ipc_callid_t *callid, size_t *size) |
Wrapper for receiving the IPC_M_DATA_READ calls using the async framework. | |
int | async_data_read_start_generic (int phoneid, void *dst, size_t size, int flags) |
Wrapper for IPC_M_DATA_READ calls using the async framework. | |
int | async_data_write_accept (void **data, const bool nullterm, const size_t min_size, const size_t max_size, const size_t granularity, size_t *received) |
Wrapper for receiving binary data or strings. | |
int | async_data_write_finalize (ipc_callid_t callid, void *dst, size_t size) |
Wrapper for answering the IPC_M_DATA_WRITE calls using the async framework. | |
int | async_data_write_forward_fast (int phoneid, sysarg_t method, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, ipc_call_t *dataptr) |
Wrapper for forwarding any data that is about to be received. | |
bool | async_data_write_receive (ipc_callid_t *callid, size_t *size) |
Wrapper for receiving the IPC_M_DATA_WRITE calls using the async framework. | |
int | async_data_write_start_generic (int phoneid, const void *src, size_t size, int flags) |
Wrapper for IPC_M_DATA_WRITE calls using the async framework. | |
void | async_data_write_void (sysarg_t retval) |
Wrapper for voiding any data that is about to be received. | |
void | async_destroy_manager (void) |
Remove one manager from manager list. | |
int | async_exchange_begin (async_sess_t *sess) |
Start new exchange in a session. | |
void | async_exchange_end (async_sess_t *sess, int data_phone) |
Finish an exchange. | |
int | async_forward_fast (ipc_callid_t callid, int phoneid, sysarg_t imethod, sysarg_t arg1, sysarg_t arg2, unsigned int mode) |
int | async_forward_slow (ipc_callid_t callid, int phoneid, sysarg_t imethod, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, sysarg_t arg5, unsigned int mode) |
ipc_callid_t | async_get_call_timeout (ipc_call_t *call, suseconds_t usecs) |
Return new incoming message for the current (fibril-local) connection. | |
int | async_hangup (int phone) |
Wrapper for ipc_hangup. | |
void | async_insert_timeout (awaiter_t *wd) |
Sort in current fibril's timeout request. | |
static int | async_manager_fibril (void *arg) |
Function to start async_manager as a standalone fibril. | |
static int | async_manager_worker (void) |
Endless loop dispatching incoming calls and answers. | |
void | async_msg_0 (int phone, sysarg_t imethod) |
void | async_msg_1 (int phone, sysarg_t imethod, sysarg_t arg1) |
void | async_msg_2 (int phone, sysarg_t imethod, sysarg_t arg1, sysarg_t arg2) |
void | async_msg_3 (int phone, sysarg_t imethod, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3) |
void | async_msg_4 (int phone, sysarg_t imethod, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, sysarg_t arg4) |
void | async_msg_5 (int phone, sysarg_t imethod, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, sysarg_t arg5) |
fid_t | async_new_connection (sysarg_t in_task_hash, sysarg_t in_phone_hash, ipc_callid_t callid, ipc_call_t *call, void(*cfibril)(ipc_callid_t, ipc_call_t *)) |
Create a new fibril for a new connection. | |
void | async_poke (void) |
Interrupt one thread of this task from waiting for IPC. | |
sysarg_t | async_req_fast (int phoneid, sysarg_t method, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, sysarg_t *r1, sysarg_t *r2, sysarg_t *r3, sysarg_t *r4, sysarg_t *r5) |
Pseudo-synchronous message sending - fast version. | |
sysarg_t | async_req_slow (int phoneid, sysarg_t method, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, sysarg_t arg5, sysarg_t *r1, sysarg_t *r2, sysarg_t *r3, sysarg_t *r4, sysarg_t *r5) |
Pseudo-synchronous message sending - slow version. | |
aid_t | async_send_fast (int phoneid, sysarg_t method, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, ipc_call_t *dataptr) |
Send message and return id of the sent message. | |
aid_t | async_send_slow (int phoneid, sysarg_t method, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, sysarg_t arg5, ipc_call_t *dataptr) |
Send message and return id of the sent message. | |
static void | async_serialize_end (void) |
static void | async_serialize_start (void) |
void | async_session_create (async_sess_t *sess, int phone, sysarg_t arg1) |
Create a session. | |
void | async_session_destroy (async_sess_t *sess) |
Destroy a session. | |
void | async_set_client_connection (async_client_conn_t conn) |
Setter for client_connection function pointer. | |
void | async_set_client_data_constructor (async_client_data_ctor_t ctor) |
void | async_set_client_data_destructor (async_client_data_dtor_t dtor) |
void | async_set_interrupt_received (async_client_conn_t intr) |
Setter for interrupt_received function pointer. | |
int | async_share_in_finalize (ipc_callid_t callid, void *src, unsigned int flags) |
Wrapper for answering the IPC_M_SHARE_IN calls using the async framework. | |
bool | async_share_in_receive (ipc_callid_t *callid, size_t *size) |
Wrapper for receiving the IPC_M_SHARE_IN calls using the async framework. | |
int | async_share_in_start (int phoneid, void *dst, size_t size, sysarg_t arg, unsigned int *flags) |
Wrapper for IPC_M_SHARE_IN calls using the async framework. | |
int | async_share_out_finalize (ipc_callid_t callid, void *dst) |
Wrapper for answering the IPC_M_SHARE_OUT calls using the async framework. | |
bool | async_share_out_receive (ipc_callid_t *callid, size_t *size, unsigned int *flags) |
Wrapper for receiving the IPC_M_SHARE_OUT calls using the async framework. | |
int | async_share_out_start (int phoneid, void *src, unsigned int flags) |
Wrapper for IPC_M_SHARE_OUT calls using the async framework. | |
void | async_usleep (suseconds_t timeout) |
Wait for specified time. | |
void | async_wait_for (aid_t amsgid, sysarg_t *retval) |
Wait for a message sent by the async framework. | |
int | async_wait_timeout (aid_t amsgid, sysarg_t *retval, suseconds_t timeout) |
Wait for a message sent by the async framework, timeout variant. | |
static atomic_count_t | atomic_get (atomic_t *val) |
static void | atomic_set (atomic_t *val, atomic_count_t i) |
int | bcmp (const void *s1, const void *s2, size_t len) |
Compare two memory areas. | |
void | bin_order_suffix (const uint64_t val, uint64_t *rv, const char **suffix, bool fixed) |
int | bind_service (services_t need, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, async_client_conn_t client_receiver) |
Create bidirectional connection with the needed module service and registers the message receiver. | |
int | bind_service_timeout (services_t need, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, async_client_conn_t client_receiver, suseconds_t timeout) |
Create bidirectional connection with the needed module service and registers the message receiver. | |
static void | block_check (void *addr) |
Check a heap block. | |
static void | block_init (void *addr, size_t size, bool free, heap_area_t *area) |
Initialize a heap block. | |
void * | calloc (const size_t nmemb, const size_t size) |
Allocate memory by number of elements. | |
char * | canonify (char *path, size_t *lenp) |
Canonify a file system path. | |
int | cap_grant (task_id_t id, unsigned int caps) |
Grant capabilities to a task. | |
int | cap_revoke (task_id_t id, unsigned int caps) |
Revoke capabilities from a task. | |
static bool | cas (atomic_t *val, atomic_count_t ov, atomic_count_t nv) |
ssize_t | char_dev_read (int dev_phone, void *buf, size_t size) |
Read from character device. | |
static ssize_t | char_dev_rw (int dev_phone, void *buf, size_t size, bool read) |
Read to or write from device. | |
ssize_t | char_dev_write (int dev_phone, void *buf, size_t size) |
Write to character device. | |
int | char_map_add (char_map_t *map, const uint8_t *identifier, size_t length, const int value) |
Adds the value with the key to the map. | |
static int | char_map_add_item (char_map_t *map, const uint8_t *identifier, size_t length, const int value) |
Adds the value with the key to the map. | |
void | char_map_destroy (char_map_t *map) |
Clears and destroys the map. | |
int | char_map_exclude (char_map_t *map, const uint8_t *identifier, size_t length) |
Excludes the value assigned to the key from the map. | |
int | char_map_find (const char_map_t *map, const uint8_t *identifier, size_t length) |
Returns the value assigned to the key from the map. | |
static char_map_t * | char_map_find_node (const char_map_t *map, const uint8_t *identifier, size_t length) |
Returns the node assigned to the key from the map. | |
int | char_map_initialize (char_map_t *map) |
Initializes the map. | |
static int | char_map_is_valid (const char_map_t *map) |
Checks if the map is valid. | |
int | char_map_update (char_map_t *map, const uint8_t *identifier, const size_t length, const int value) |
Adds or updates the value with the key to the map. | |
int | chdir (const char *path) |
static void | check_for_deadlock (fibril_owner_info_t *oi) |
bool | chr_check (wchar_t ch) |
Check whether character is valid. | |
int | chr_encode (const wchar_t ch, char *str, size_t *offset, size_t size) |
Encode a single character to string representation. | |
void | clearerr (FILE *stream) |
static int | client_compare (unsigned long key[], hash_count_t keys, link_t *item) |
static hash_index_t | client_hash (unsigned long key[]) |
static void | client_remove (link_t *item) |
static void | clip_connect (void) |
Connect to clipboard server. | |
int | clipboard_get_str (char **str) |
Get a copy of clipboard contents. | |
int | clipboard_put_str (const char *str) |
Copy string to clipboard. | |
int | close (int fildes) |
int | closedir (DIR *dirp) |
static int | conn_compare (unsigned long key[], hash_count_t keys, link_t *item) |
Compare hash table item with a key. | |
static hash_index_t | conn_hash (unsigned long key[]) |
Compute hash into the connection hash table based on the source phone hash. | |
static void | conn_node_initialize (conn_node_t *conn) |
static void | conn_remove (link_t *item) |
int | connect_to_service (services_t need) |
Connects to the needed module. | |
int | connect_to_service_timeout (services_t need, suseconds_t timeout) |
Connects to the needed module. | |
static int | connection_fibril (void *arg) |
Wrapper for client connection fibril. | |
void | console_clear (int phone) |
void | console_cursor_visibility (int phone, bool show) |
int | console_get_color_cap (int phone, sysarg_t *ccap) |
bool | console_get_event (int phone, console_event_t *event) |
int | console_get_pos (int phone, sysarg_t *col, sysarg_t *row) |
int | console_get_size (int phone, sysarg_t *cols, sysarg_t *rows) |
void | console_kcon_enable (int phone) |
void | console_set_color (int phone, uint8_t fg_color, uint8_t bg_color, uint8_t flags) |
void | console_set_pos (int phone, sysarg_t col, sysarg_t row) |
void | console_set_rgb_color (int phone, uint32_t fg_color, uint32_t bg_color) |
void | console_set_style (int phone, uint8_t style) |
void | context_restore (context_t *ctx) |
int | context_save (context_t *ctx) |
int | data_reply (void *data, size_t data_length) |
Replies the data to the other party. | |
static void | default_client_connection (ipc_callid_t callid, ipc_call_t *call) |
Default fibril function that gets called to handle new connection. | |
static void * | default_client_data_constructor (void) |
static void | default_client_data_destructor (void *data) |
static void | default_interrupt_received (ipc_callid_t callid, ipc_call_t *call) |
Default fibril function that gets called to handle interrupt notifications. | |
int | device_assign_devno (void) |
Return unique device number. | |
int | devman_add_device_to_class (devman_handle_t devman_handle, const char *class_name) |
int | devman_add_function (const char *name, fun_type_t ftype, match_id_list_t *match_ids, devman_handle_t devh, devman_handle_t *funh) |
Add function to a device. | |
int | devman_device_connect (devman_handle_t handle, unsigned int flags) |
int | devman_device_get_handle (const char *pathname, devman_handle_t *handle, unsigned int flags) |
int | devman_device_get_handle_by_class (const char *classname, const char *devname, devman_handle_t *handle, unsigned int flags) |
int | devman_driver_register (const char *name, async_client_conn_t conn) |
Register running driver with device manager. | |
int | devman_get_device_path (devman_handle_t handle, char *path, size_t path_size) |
int | devman_get_phone (devman_interface_t iface, unsigned int flags) |
void | devman_hangup_phone (devman_interface_t iface) |
int | devman_parent_device_connect (devman_handle_t handle, unsigned int flags) |
static int | devman_send_match_id (int phone, match_id_t *match_id) |
static int | devman_send_match_ids (int phone, match_id_list_t *match_ids) |
size_t | devmap_count_devices (devmap_handle_t) |
size_t | devmap_count_namespaces (void) |
int | devmap_device_connect (devmap_handle_t, unsigned int) |
int | devmap_device_get_handle (const char *, devmap_handle_t *, unsigned int) |
int | devmap_device_register (const char *, devmap_handle_t *) |
Register new device. | |
int | devmap_device_register_with_iface (const char *, devmap_handle_t *, sysarg_t) |
Register new device. | |
int | devmap_driver_register (const char *, async_client_conn_t) |
Register new driver with devmap. | |
size_t | devmap_get_devices (devmap_handle_t, dev_desc_t **) |
size_t | devmap_get_namespaces (dev_desc_t **) |
int | devmap_get_phone (devmap_interface_t, unsigned int) |
Get phone to device mapper task. | |
devmap_handle_type_t | devmap_handle_probe (devmap_handle_t) |
void | devmap_hangup_phone (devmap_interface_t iface) |
int | devmap_namespace_get_handle (const char *, devmap_handle_t *, unsigned int) |
int | devmap_null_create (void) |
void | devmap_null_destroy (int) |
int | dup2 (int oldfd, int newfd) |
int | dyn_fifo_destroy (dyn_fifo_t *fifo) |
Clears and destroys the queue. | |
int | dyn_fifo_initialize (dyn_fifo_t *fifo, int size) |
Initializes the dynamic queue. | |
static int | dyn_fifo_is_valid (dyn_fifo_t *fifo) |
Checks if the queue is valid. | |
int | dyn_fifo_pop (dyn_fifo_t *fifo) |
Returns and excludes the first item in the queue. | |
int | dyn_fifo_push (dyn_fifo_t *fifo, int value, int max_size) |
Appends a new item to the queue end. | |
int | dyn_fifo_value (dyn_fifo_t *fifo) |
Returns and keeps the first item in the queue. | |
void | dyn_parse_arch (elf_dyn_t *dp, size_t bias, dyn_info_t *info) |
void | dynamic_parse (elf_dyn_t *dyn_ptr, size_t bias, dyn_info_t *info) |
void | entry_point_jmp (void *, void *) |
Jump to program entry point. | |
int | event_subscribe (event_type_t, sysarg_t) |
Subscribe event notifications. | |
int | event_unmask (event_type_t) |
Unmask event notifications. | |
void | exit (int status) |
int | fclose (FILE *stream) |
int | fd_node (int fildes, fdi_node_t *node) |
int | fd_phone (int fildes) |
FILE * | fdopen (int fd, const char *mode) |
int | feof (FILE *stream) |
int | ferror (FILE *stream) |
int | fflush (FILE *stream) |
int | fgetc (FILE *stream) |
char * | fgets (char *str, int size, FILE *stream) |
void | fibril_add_manager (fid_t fid) |
Add a fibril to the manager list. | |
void | fibril_add_ready (fid_t fid) |
Add a fibril to the ready list. | |
void | fibril_condvar_broadcast (fibril_condvar_t *fcv) |
void | fibril_condvar_initialize (fibril_condvar_t *fcv) |
static | FIBRIL_CONDVAR_INITIALIZE (avail_phone_cv) |
Condition variable used to wait for a phone to become available. | |
void | fibril_condvar_signal (fibril_condvar_t *fcv) |
void | fibril_condvar_wait (fibril_condvar_t *fcv, fibril_mutex_t *fm) |
int | fibril_condvar_wait_timeout (fibril_condvar_t *fcv, fibril_mutex_t *fm, suseconds_t timeout) |
fid_t | fibril_create (int(*func)(void *), void *arg) |
Create a new fibril. | |
void | fibril_dec_sercount (void) |
Restore the preemption counter to the previous state. | |
fid_t | fibril_get_id (void) |
Return fibril id of the currently running fibril. | |
int | fibril_get_sercount (void) |
void | fibril_inc_sercount (void) |
Disable preemption. | |
static void | fibril_main (void) |
Function that spans the whole life-cycle of a fibril. | |
static | FIBRIL_MUTEX_INITIALIZE (log_serializer) |
Serialization mutex for logging functions. | |
void | fibril_mutex_initialize (fibril_mutex_t *fm) |
bool | fibril_mutex_is_locked (fibril_mutex_t *fm) |
void | fibril_mutex_lock (fibril_mutex_t *fm) |
bool | fibril_mutex_trylock (fibril_mutex_t *fm) |
void | fibril_mutex_unlock (fibril_mutex_t *fm) |
void | fibril_remove_manager (void) |
Remove one manager from the manager list. | |
void | fibril_rwlock_initialize (fibril_rwlock_t *frw) |
bool | fibril_rwlock_is_locked (fibril_rwlock_t *frw) |
bool | fibril_rwlock_is_read_locked (fibril_rwlock_t *frw) |
bool | fibril_rwlock_is_write_locked (fibril_rwlock_t *frw) |
void | fibril_rwlock_read_lock (fibril_rwlock_t *frw) |
void | fibril_rwlock_read_unlock (fibril_rwlock_t *frw) |
void | fibril_rwlock_write_lock (fibril_rwlock_t *frw) |
void | fibril_rwlock_write_unlock (fibril_rwlock_t *frw) |
fibril_t * | fibril_setup (void) |
Setup fibril information into TCB structure. | |
int | fibril_switch (fibril_switch_type_t stype) |
Switch from the current fibril. | |
void | fibril_teardown (fibril_t *fibril) |
static int | fibril_yield (void) |
int | fileno (FILE *stream) |
int | fnode (FILE *stream, fdi_node_t *node) |
FILE * | fopen (const char *path, const char *mode) |
Open a stream. | |
FILE * | fopen_node (fdi_node_t *node, const char *mode) |
int | fphone (FILE *stream) |
int | fprintf (FILE *stream, const char *fmt,...) |
Print formatted text. | |
int | fputc (wchar_t c, FILE *stream) |
int | fputs (const char *str, FILE *stream) |
size_t | fread (void *dest, size_t size, size_t nmemb, FILE *stream) |
Read from a stream. | |
void | free (const void *addr) |
Free a memory block. | |
int | fseek (FILE *stream, off64_t offset, int whence) |
int | fstat (int fildes, struct stat *stat) |
int | fsync (int fildes) |
off64_t | ftell (FILE *stream) |
int | ftruncate (int fildes, aoff64_t length) |
int | futex_down (futex_t *futex) |
Down the futex. | |
void | futex_initialize (futex_t *futex, int val) |
Initialize futex counter. | |
int | futex_trydown (futex_t *futex) |
Try to down the futex. | |
int | futex_up (futex_t *futex) |
Up the futex. | |
size_t | fwrite (const void *buf, size_t size, size_t nmemb, FILE *stream) |
Write to a stream. | |
GENERIC_FIELD_DECLARE (gpm, packet_map_t) | |
Packet map. | |
int | getchar (void) |
char * | getcwd (char *buf, size_t size) |
int | gettimeofday (struct timeval *tv, struct timezone *tz) |
Get time of day. | |
bool | gsort (void *data, size_t cnt, size_t elem_size, sort_cmp_t cmp, void *arg) |
Gnome sort wrapper. | |
static void | handle_call (ipc_callid_t callid, ipc_call_t *call) |
Handle a call that was received. | |
static void | handle_expired_timeouts (void) |
Fire all timeouts that expired. | |
void | hash_table_apply (hash_table_t *h, void(*f)(link_t *, void *), void *arg) |
Apply fucntion to all items in hash table. | |
bool | hash_table_create (hash_table_t *h, hash_count_t m, hash_count_t max_keys, hash_table_operations_t *op) |
Create chained hash table. | |
void | hash_table_destroy (hash_table_t *h) |
Destroy a hash table instance. | |
link_t * | hash_table_find (hash_table_t *h, unsigned long key[]) |
Search hash table for an item matching keys. | |
void | hash_table_insert (hash_table_t *h, unsigned long key[], link_t *item) |
Insert item into a hash table. | |
void | hash_table_remove (hash_table_t *h, unsigned long key[], hash_count_t keys) |
Remove all matching items from hash table. | |
static void | headless_list_concat (link_t *part1, link_t *part2) |
Concatenate two headless doubly-linked circular lists. | |
static void | headless_list_split (link_t *part1, link_t *part2) |
Split headless doubly-linked circular list. | |
static void | headless_list_split_or_concat (link_t *part1, link_t *part2) |
Split or concatenate headless doubly-linked circular list. | |
void * | heap_check (void) |
static bool | heap_grow (size_t size) |
Try to enlarge any of the heap areas. | |
static void | heap_shrink (heap_area_t *area) |
Try to shrink heap. | |
static void | hw_res_clean_resource_list (hw_resource_list_t *hw_res) |
bool | hw_res_enable_interrupt (int dev_phone) |
int | hw_res_get_resource_list (int dev_phone, hw_resource_list_t *hw_resources) |
int | icmp_connect_module (suseconds_t timeout) |
Connect to the ICMP module. | |
int | inet_ntop (uint16_t family, const uint8_t *data, char *address, size_t length) |
Prints the address into the character buffer. | |
int | inet_pton (uint16_t family, const char *address, uint8_t *data) |
Parses the character string into the address. | |
INT_MAP_DECLARE (sockets, socket_t) | |
Sockets map. | |
int | iospace_enable (task_id_t id, void *ioaddr, unsigned long size) |
Enable I/O space range to task. | |
static int | isalnum (int c) |
static int | isalpha (int c) |
static int | isdigit (int c) |
static int | islower (int c) |
static int | isspace (int c) |
static int | isupper (int c) |
int | klog_printf (const char *fmt,...) |
Print formatted text to klog. | |
void | klog_update (void) |
int | klog_vprintf (const char *fmt, va_list ap) |
Print formatted text to klog. | |
static int | klog_vprintf_str_write (const char *str, size_t size, void *data) |
static int | klog_vprintf_wstr_write (const wchar_t *str, size_t size, void *data) |
size_t | klog_write (const void *buf, size_t size) |
static void | link_initialize (link_t *link) |
Initialize doubly-linked circular list link. | |
static void | list_append (link_t *link, link_t *list) |
Add item to the end of doubly-linked circular list. | |
void | list_concat (link_t *head1, link_t *head2) |
Concatenate two lists. | |
unsigned int | list_count (const link_t *link) |
Count list items. | |
static int | list_empty (link_t *list) |
Query emptiness of doubly-linked circular list. | |
static link_t * | list_head (link_t *list) |
Get head item of a list. | |
static void | list_initialize (link_t *list) |
Initialize doubly-linked circular list. | |
static | LIST_INITIALIZE (session_list_head) |
List of all open sessions. | |
static | LIST_INITIALIZE (inactive_conn_head) |
List of all currently inactive connections. | |
static void | list_insert_after (link_t *link, link_t *list) |
Insert item after another item in doubly-linked circular list. | |
static void | list_insert_before (link_t *link, link_t *list) |
Insert item before another item in doubly-linked circular list. | |
int | list_member (const link_t *link, const link_t *head) |
Check for membership. | |
static link_t * | list_nth (link_t *list, unsigned int n) |
Get n-th item of a list. | |
static void | list_prepend (link_t *link, link_t *list) |
Add item to the beginning of doubly-linked circular list. | |
static void | list_remove (link_t *link) |
Remove item from doubly-linked circular list. | |
void | loader_abort (loader_t *ldr) |
Cancel the loader session. | |
loader_t * | loader_connect (void) |
int | loader_get_task_id (loader_t *ldr, task_id_t *task_id) |
Get ID of the new task. | |
int | loader_load_program (loader_t *ldr) |
Instruct loader to load the program. | |
int | loader_run (loader_t *ldr) |
Instruct loader to execute the program. | |
int | loader_set_args (loader_t *ldr, const char *const argv[]) |
Set command-line arguments for the program. | |
int | loader_set_cwd (loader_t *ldr) |
Set current working directory for the loaded task. | |
int | loader_set_files (loader_t *ldr, fdi_node_t *const files[]) |
Set preset files for the program. | |
int | loader_set_pathname (loader_t *ldr, const char *path) |
Set pathname of the program to load. | |
int | loader_spawn (const char *name) |
Connect to a new program loader. | |
int | log_init (const char *prog_name, log_level_t level) |
Initialize the logging system. | |
void | log_msg (log_level_t level, const char *fmt,...) |
Write an entry to the log. | |
void | log_msgv (log_level_t level, const char *fmt, va_list args) |
Write an entry to the log (va_list variant). | |
off64_t | lseek (int fildes, off64_t offset, int whence) |
int | main (int, char *[]) |
Main entry point. | |
void * | malloc (const size_t size) |
Allocate memory. | |
static void * | malloc_area (heap_area_t *area, heap_block_head_t *first_block, heap_block_head_t *final_block, size_t real_size, size_t falign) |
Allocate memory from heap area starting from given block. | |
static void * | malloc_internal (const size_t size, const size_t align) |
Allocate a memory block. | |
measured_string_t * | measured_string_copy (measured_string_t *source) |
Copies the given measured string with separated header and data parts. | |
measured_string_t * | measured_string_create_bulk (const uint8_t *string, size_t length) |
Creates a new measured string bundled with a copy of the given string itself as one memory block. | |
int | measured_strings_receive (measured_string_t **strings, uint8_t **data, size_t count) |
Receives a measured strings array from a calling module. | |
int | measured_strings_reply (const measured_string_t *strings, size_t count) |
Replies the given measured strings array to a calling module. | |
int | measured_strings_return (int phone, measured_string_t **strings, uint8_t **data, size_t count) |
Receives a measured strings array from another module. | |
int | measured_strings_send (int phone, const measured_string_t *strings, size_t count) |
Sends the given measured strings array to another module. | |
void * | memalign (const size_t align, const size_t size) |
Allocate memory with specified alignment. | |
void * | memcpy (void *dst, const void *src, size_t n) |
Copy memory block. | |
void * | memmove (void *dst, const void *src, size_t n) |
Move memory block with possible overlapping. | |
void * | memset (void *dest, int b, size_t n) |
Fill memory block with a constant value. | |
int | mkdir (const char *path, mode_t mode) |
void * | mmap (void *start, size_t length, int prot, int flags, int fd, aoff64_t offset) |
module_t * | module_find (const char *name) |
Find module structure by soname/pathname. | |
module_t * | module_load (const char *name) |
Load a module. | |
void | module_load_deps (module_t *m) |
Load all modules on which m (transitively) depends. | |
void | module_process_pre_arch (module_t *m) |
void | module_process_relocs (module_t *m) |
(Eagerly) process all relocation tables in a module. | |
void | modules_process_relocs (module_t *start) |
Process relocations in modules. | |
void | modules_untag (void) |
Clear BFS tags of all modules. | |
int | mount (const char *fs_name, const char *mp, const char *fqdn, const char *opts, unsigned int flags) |
int | munmap (void *start, size_t length) |
static token_t | next_token (token_t *cur) |
Given a token, return the next token. | |
static int | notification_fibril (void *arg) |
Notification fibril. | |
int | open (const char *path, int oflag,...) |
static int | open_internal (const char *abs, size_t abs_size, int lflag, int oflag) |
int | open_node (fdi_node_t *node, int oflag) |
DIR * | opendir (const char *dirname) |
static void | optimize_execution_power (void) |
void | order_suffix (const uint64_t val, uint64_t *rv, char *suffix) |
static int | packet_is_valid (const packet_t *packet) |
Returns whether the packet is valid. | |
static size_t | PAGES2SIZE (size_t pages) |
static bool | parse_mode (const char *mode, int *flags) |
int | physmem_map (void *pf, void *vp, unsigned long pages, int flags) |
Map piece of physical memory to task. | |
int | pio_enable (void *pio_addr, size_t size, void **use_addr) |
Enable PIO for specified I/O range. | |
void | pq_destroy (packet_t *first, void(*packet_release)(packet_t *packet)) |
Releases the whole queue. | |
static size_t * | prepare_lengths (const measured_string_t *strings, size_t count) |
Computes the lengths of the measured strings in the given array. | |
static void | print_deadlock (fibril_owner_info_t *oi) |
int | printf (const char *fmt,...) |
Print formatted text to stdout. | |
int | printf_core (const char *, printf_spec_t *, va_list) |
Print formatted string. | |
static bool | process_notification (ipc_callid_t callid, ipc_call_t *call) |
Process interrupt notification. | |
link_t * | prodcons_consume (prodcons_t *pc) |
void | prodcons_initialize (prodcons_t *pc) |
void | prodcons_produce (prodcons_t *pc, link_t *item) |
int | putchar (wchar_t c) |
int | puts (const char *str) |
bool | qsort (void *data, size_t cnt, size_t elem_size, sort_cmp_t cmp, void *arg) |
Quicksort wrapper. | |
long int | random (void) |
ssize_t | read (int fildes, void *buf, size_t nbyte) |
dirent * | readdir (DIR *dirp) |
void * | realloc (const void *addr, const size_t size) |
Reallocate memory block. | |
static ssize_t | recvfrom_core (sysarg_t message, int socket_id, void *data, size_t datalength, int flags, struct sockaddr *fromaddr, socklen_t *addrlen) |
Receives data via the socket. | |
void | refresh_answer (ipc_call_t *answer, size_t *count) |
Refresh answer structure and argument count. | |
int | register_irq (int inr, int devno, int method, irq_code_t *ucode) |
Register IRQ notification. | |
void | rel_table_process (module_t *m, elf_rel_t *rt, size_t rt_size) |
Process (fixup) all relocations in a relocation table. | |
void | rela_table_process (module_t *m, elf_rela_t *rt, size_t rt_size) |
static void | remove_trailing_slash (token_t *t, token_t *tfsl, token_t *tlcomp) |
int | rename (const char *old, const char *new) |
static void | reply_received (void *arg, int retval, ipc_call_t *data) |
Reply received callback. | |
void | rewind (FILE *stream) |
void | rewinddir (DIR *dirp) |
int | rmdir (const char *path) |
static bool | route_call (ipc_callid_t callid, ipc_call_t *call) |
Try to route a call to an appropriate connection fibril. | |
void | rtld_init_static (void) |
Initialize the loder for use in a statically-linked binary. | |
static void | save_component (token_t *t, token_t *tfsl, token_t *tlcomp) |
static int | sendto_core (sysarg_t message, int socket_id, const void *data, size_t datalength, int flags, const struct sockaddr *toaddr, socklen_t addrlen) |
Sends data via the socket to the remote address. | |
int | service_connect (sysarg_t service, sysarg_t arg2, sysarg_t arg3) |
int | service_connect_blocking (sysarg_t service, sysarg_t arg2, sysarg_t arg3) |
int | service_register (sysarg_t service) |
static void | set_first_slash (token_t *t, token_t *tfsl, token_t *tlcomp) |
void | setvbuf (FILE *stream, void *buf, int mode, size_t size) |
Set stream buffer. | |
static void | shift_dot (token_t *t, token_t *tfsl, token_t *tlcomp) |
Eat the extra '. | |
static void | shift_dotdot (token_t *t, token_t *tfsl, token_t *tlcomp) |
Collapse the TK_COMP TK_SLASH TK_DOTDOT pattern. | |
static void | shift_slash (token_t *t, token_t *tfsl, token_t *tlcomp) |
Eat the extra '/'. | |
static size_t | SIZE2PAGES (size_t size) |
static token_t | slash_token (char *start) |
Fake up the TK_SLASH token. | |
unsigned int | sleep (unsigned int sec) |
Wait unconditionally for specified number of seconds. | |
int | smc_coherence (void *address, size_t size) |
int | snprintf (char *str, size_t size, const char *fmt,...) |
Print formatted to the given buffer with limited size. | |
static void | socket_connection (ipc_callid_t iid, ipc_call_t *icall) |
Default thread for new connections. | |
static void | socket_destroy (socket_t *socket) |
Clears and destroys the socket. | |
static int | socket_generate_new_id (void) |
Tries to find a new free socket identifier. | |
static sockets_t * | socket_get_sockets (void) |
Returns the active sockets. | |
static int | socket_get_tcp_phone (void) |
Returns the TCP module phone. | |
static int | socket_get_udp_phone (void) |
Returns the UDP module phone. | |
static void | socket_initialize (socket_t *socket, int socket_id, int phone, services_t service) |
Initializes a new socket specific data. | |
static int | socket_send_data (int socket_id, sysarg_t message, sysarg_t arg2, const void *data, size_t datalength) |
Sends message to the socket parent module with specified data. | |
static void | split_mark (heap_block_head_t *cur, const size_t size) |
Split heap block and mark it as used. | |
void | srandom (unsigned int seed) |
uintptr_t | stacktrace_fp_get (void) |
int | stacktrace_fp_prev (stacktrace_t *, uintptr_t, uintptr_t *) |
bool | stacktrace_fp_valid (stacktrace_t *, uintptr_t) |
uintptr_t | stacktrace_pc_get (void) |
void | stacktrace_prepare (void) |
void | stacktrace_print (void) |
void | stacktrace_print_fp_pc (uintptr_t fp, uintptr_t pc) |
int | stacktrace_ra_get (stacktrace_t *, uintptr_t, uintptr_t *) |
static int | stacktrace_read_uintptr (void *arg, uintptr_t addr, uintptr_t *data) |
int | stat (const char *path, struct stat *stat) |
stats_cpu_t * | stats_get_cpus (size_t *count) |
Get CPUs statistics. | |
stats_exc_t * | stats_get_exception (unsigned int excn) |
Get single exception statistics. | |
stats_exc_t * | stats_get_exceptions (size_t *count) |
Get exception statistics. | |
load_t * | stats_get_load (size_t *count) |
Get system load. | |
stats_physmem_t * | stats_get_physmem (void) |
Get physical memory statistics. | |
stats_task_t * | stats_get_task (task_id_t task_id) |
Get single task statistics. | |
stats_task_t * | stats_get_tasks (size_t *count) |
Get task statistics. | |
stats_thread_t * | stats_get_thread (thread_id_t thread_id) |
Get single thread statistics. | |
stats_thread_t * | stats_get_threads (size_t *count) |
Get thread statistics. | |
sysarg_t | stats_get_uptime (void) |
Get system uptime. | |
void | stats_print_load_fragment (load_t upper, unsigned int dec_length) |
Print load fixed-point value. | |
void | str_append (char *dest, size_t size, const char *src) |
Append one string to another. | |
char * | str_chr (const char *str, wchar_t ch) |
Find first occurence of character in string. | |
int | str_cmp (const char *s1, const char *s2) |
Compare two NULL terminated strings. | |
void | str_cpy (char *dest, size_t size, const char *src) |
Copy string. | |
wchar_t | str_decode (const char *str, size_t *offset, size_t size) |
Decode a single character from a string. | |
char * | str_dup (const char *src) |
Duplicate string. | |
const char * | str_error (const int e) |
const char * | str_l18_win_locale (l18_win_locales_t locale) |
Get string representation of a given locale. | |
int | str_lcmp (const char *s1, const char *s2, size_t max_len) |
Compare two NULL terminated strings with length limit. | |
size_t | str_length (const char *str) |
Get number of characters in a string. | |
size_t | str_lsize (const char *str, size_t max_len) |
Get size of string with length limit. | |
void | str_ncpy (char *dest, size_t size, const char *src, size_t n) |
Copy size-limited substring. | |
char * | str_ndup (const char *src, size_t n) |
Duplicate string with size limit. | |
size_t | str_nlength (const char *str, size_t size) |
Get number of characters in a string with size limit. | |
char * | str_rchr (const char *str, wchar_t ch) |
Find last occurence of character in string. | |
size_t | str_size (const char *str) |
Get size of string. | |
int | str_size_t (const char *nptr, char **endptr, unsigned int base, bool strict, size_t *result) |
Convert string to size_t. | |
void | str_to_wstr (wchar_t *dest, size_t dlen, const char *src) |
Convert string to wide string. | |
static int | str_uint (const char *nptr, char **endptr, unsigned int base, bool *neg, uint64_t *result) |
Convert string to uint64_t (internal variant). | |
int | str_uint64 (const char *nptr, char **endptr, unsigned int base, bool strict, uint64_t *result) |
Convert string to uint64_t. | |
int | stricmp (const char *a, const char *b) |
char * | strtok (char *s, const char *delim) |
char * | strtok_r (char *s, const char *delim, char **next) |
long int | strtol (const char *nptr, char **endptr, int base) |
Convert initial part of string to long int according to given base. | |
unsigned long | strtoul (const char *nptr, char **endptr, int base) |
Convert initial part of string to unsigned long according to given base. | |
elf_symbol_t * | symbol_bfs_find (const char *name, module_t *start, module_t **mod) |
Find the definition of a symbol in a module and its deps. | |
elf_symbol_t * | symbol_def_find (const char *name, module_t *origin, module_t **mod) |
Find the definition of a symbol. | |
void * | symbol_get_addr (elf_symbol_t *sym, module_t *m) |
void * | sysinfo_get_data (const char *path, size_t *size) |
Get sysinfo binary data. | |
static int | sysinfo_get_data_size (const char *path, size_t *size) |
Get sysinfo binary data size. | |
sysinfo_item_tag_t | sysinfo_get_tag (const char *path) |
Get sysinfo item type. | |
int | sysinfo_get_value (const char *path, sysarg_t *value) |
Get sysinfo numerical value. | |
task_id_t | task_get_id (void) |
int | task_kill (task_id_t task_id) |
Kill a task. | |
int | task_retval (int val) |
int | task_set_name (const char *name) |
Set the task name. | |
int | task_spawnl (task_id_t *task_id, const char *path,...) |
Create a new task by running an executable from the filesystem. | |
int | task_spawnv (task_id_t *id, const char *path, const char *const args[]) |
Create a new task by running an executable from the filesystem. | |
int | task_wait (task_id_t id, task_exit_t *texit, int *retval) |
static void | terminate_slash (token_t *t, token_t *tfsl, token_t *tlcomp) |
int | thread_create (void(*function)(void *), void *arg, const char *name, thread_id_t *tid) |
Create userspace thread. | |
void | thread_detach (thread_id_t thread) |
Detach thread. | |
void | thread_exit (int status) |
Terminate current thread. | |
thread_id_t | thread_get_id (void) |
Get current thread ID. | |
const char * | thread_get_state (state_t state) |
int | thread_join (thread_id_t thread) |
Join thread. | |
time_t | time (time_t *tloc) |
static int | tolower (int c) |
static int | toupper (int c) |
void | tv_add (struct timeval *tv, suseconds_t usecs) |
Add microseconds to given timeval. | |
int | tv_gt (struct timeval *tv1, struct timeval *tv2) |
Decide if one timeval is greater than the other. | |
int | tv_gteq (struct timeval *tv1, struct timeval *tv2) |
Decide if one timeval is greater than or equal to the other. | |
suseconds_t | tv_sub (struct timeval *tv1, struct timeval *tv2) |
Subtract two timevals. | |
int | udebug_areas_read (int phoneid, void *buffer, size_t n, size_t *copied, size_t *needed) |
int | udebug_args_read (int phoneid, thash_t tid, sysarg_t *buffer) |
int | udebug_begin (int phoneid) |
int | udebug_end (int phoneid) |
int | udebug_go (int phoneid, thash_t tid, udebug_event_t *ev_type, sysarg_t *val0, sysarg_t *val1) |
int | udebug_mem_read (int phoneid, void *buffer, uintptr_t addr, size_t n) |
int | udebug_name_read (int phoneid, void *buffer, size_t n, size_t *copied, size_t *needed) |
int | udebug_regs_read (int phoneid, thash_t tid, void *buffer) |
int | udebug_set_evmask (int phoneid, udebug_evmask_t mask) |
int | udebug_stop (int phoneid, thash_t tid) |
int | udebug_thread_read (int phoneid, void *buffer, size_t n, size_t *copied, size_t *needed) |
void | udelay (useconds_t time) |
static uint16_t | uint16_t_byteorder_swap (uint16_t n) |
static uint32_t | uint32_t_byteorder_swap (uint32_t n) |
static uint64_t | uint64_t_byteorder_swap (uint64_t n) |
static void * | unaligned_memcpy (void *dst, const void *src, size_t n) |
int | unlink (const char *path) |
int | unmount (const char *mp) |
int | unregister_irq (int inr, int devno) |
Unregister IRQ notification. | |
int | usleep (useconds_t usec) |
Wait unconditionally for specified number of microseconds. | |
int | vfprintf (FILE *stream, const char *fmt, va_list ap) |
Print formatted text. | |
static void | vfs_connect (void) |
Connect to VFS service and create session. | |
static int | vfs_exchange_begin (void) |
Start an async exchange on the VFS session. | |
static void | vfs_exchange_end (int phone) |
End an async exchange on the VFS session. | |
int | vprintf (const char *fmt, va_list ap) |
Print formatted text to stdout. | |
static int | vprintf_str_write (const char *str, size_t size, void *stream) |
static int | vprintf_wstr_write (const wchar_t *str, size_t size, void *stream) |
int | vsnprintf (char *str, size_t size, const char *fmt, va_list ap) |
static int | vsnprintf_str_write (const char *str, size_t size, vsnprintf_data_t *data) |
Write string to given buffer. | |
static int | vsnprintf_wstr_write (const wchar_t *str, size_t size, vsnprintf_data_t *data) |
Write wide string to given buffer. | |
ssize_t | write (int fildes, const void *buf, size_t nbyte) |
size_t | wstr_length (const wchar_t *wstr) |
Get number of characters in a wide string. | |
bool | wstr_linsert (wchar_t *str, wchar_t ch, size_t pos, size_t max_pos) |
Insert a wide character into a wide string. | |
size_t | wstr_lsize (const wchar_t *str, size_t max_len) |
Get size of wide string with length limit. | |
size_t | wstr_nlength (const wchar_t *str, size_t size) |
Get number of characters in a string with size limit. | |
bool | wstr_remove (wchar_t *str, size_t pos) |
Remove a wide character from a wide string. | |
size_t | wstr_size (const wchar_t *str) |
Get size of wide string. | |
char * | wstr_to_astr (const wchar_t *src) |
Convert wide string to new string. | |
void | wstr_to_str (char *dest, size_t size, const wchar_t *src) |
Convert wide string to string. | |
Variables | |
pcb_t * | __pcb |
A pointer to the program control block. | |
static async_client_data_ctor_t | async_client_data_create |
static async_client_data_dtor_t | async_client_data_destroy |
atomic_t | async_futex = FUTEX_INITIALIZER |
static fibril_mutex_t | async_sess_mutex |
Mutex protecting the inactive_conn_head list, the session list and the avail_phone condition variable. | |
static async_client_conn_t | client_connection = default_client_connection |
Pointer to a fibril function that will be used to handle connections. | |
static hash_table_t | client_hash_table |
static hash_table_operations_t | client_hash_table_ops |
Operations for the client hash table. | |
static int | clip_phone = -1 |
static hash_table_t | conn_hash_table |
static hash_table_operations_t | conn_hash_table_ops |
Operations for the connection hash table. | |
static int | cwd_fd = -1 |
static char * | cwd_path = NULL |
static size_t | cwd_size = 0 |
static int | devman_phone_client = -1 |
static int | devman_phone_driver = -1 |
static bool | env_setup = false |
static const char * | err_desc [] |
static atomic_t | failed_asserts = {0} |
static fibril_local connection_t * | FIBRIL_connection |
Identifier of the incoming connection handled by the current fibril. | |
static fibril_local int | fibril_errno |
static atomic_t | fibril_futex = FUTEX_INITIALIZER |
This futex serializes access to ready_list, serialized_list and manager_list. | |
static heap_area_t * | first_heap_area = NULL |
First heap area. | |
static long | glbl_seed = 1 |
static async_client_conn_t | interrupt_received = default_interrupt_received |
Pointer to a fibril function that will be used to handle interrupt notifications. | |
struct { | |
volatile sysarg_t seconds1 | |
volatile sysarg_t seconds2 | |
volatile sysarg_t useconds | |
} | ktime |
Pointer to kernel shared variables with time. | |
static heap_area_t * | last_heap_area = NULL |
Last heap area. | |
static log_level_t | log_level |
Current log level. | |
static const char * | log_level_names [] |
Prefixes for individual logging levels. | |
static const char * | log_prog_name |
static FILE * | log_stream |
static futex_t | malloc_futex = FUTEX_INITIALIZER |
Futex for thread-safe heap manipulation. | |
static heap_block_head_t * | next_fit = NULL |
Next heap block to examine (next fit algorithm). | |
static fibril_local char | noerr [NOERR_LEN] |
struct { | |
fibril_rwlock_t lock | |
Safety lock. | |
gpm_t packet_map | |
Packet map. | |
} | pm_globals |
Packet map global data. | |
runtime_env_t * | runtime_env |
static fibril_local int | serialization_count |
Fibril-local count of serialization. | |
static int | serialized_threads |
Number of threads that are executing a manager fibril and are serialized. | |
static struct socket_client_globals | socket_globals |
Socket client library global data. | |
FILE * | stderr |
FILE * | stderr = NULL |
static FILE | stderr_klog |
FILE * | stdin |
FILE * | stdin = NULL |
static FILE | stdin_null |
FILE * | stdout |
FILE * | stdout = NULL |
static FILE | stdout_klog |
static const char * | thread_states [] |
Thread states. | |
atomic_t | threads_in_ipc_wait |
Number of threads waiting for IPC in the kernel. | |
atomic_t | threads_in_ipc_wait = { 0 } |
Number of threads waiting for IPC in the kernel. | |
static int | threads_in_manager |
Number of threads that are executing a manager fibril. | |
static change_state_t | trans [4][6] |
Transition function for canonify(). | |
static fibril_local char | unknown_locale [UNKNOWN_LOCALE_LEN] |
static int | vfs_phone = -1 |
static async_sess_t | vfs_session |
#define ALIGN_DOWN | ( | s, | |||
a | ) | ((s) & ~((a) - 1)) |
#define ALIGN_UP | ( | s, | |||
a | ) | ((long)((s) + ((a) - 1)) & ~((long) (a) - 1)) |
#define ARP_GET_NETIF | ( | call | ) | ((services_t) IPC_GET_ARG2(call)) |
#define assert | ( | expr | ) |
Value:
do { \ if (!(expr)) \ assert_abort(#expr, __FILE__, __LINE__); \ } while (0)
If NDEBUG is not set, the assert() macro evaluates expr and if it is false prints error message and terminate program.
expr | Expression which is expected to be true. |
#define BASE_ALIGN 16 |
#define EAGAIN (-11002) |
#define fifo_create | ( | name | ) | name.fifo = malloc(sizeof(*name.fifo) * name.items) |
Value:
struct { \ t *fifo; \ fifo_count_t items; \ fifo_index_t head; \ fifo_index_t tail; \ } name = { \ .fifo = NULL, \ .items = (itms), \ .head = 0, \ .tail = 0 \ }
FIFO is allocated dynamically. This macro is suitable for creating larger FIFOs.
name | Name of FIFO. | |
t | Type of values stored in FIFO. | |
itms | Number of items that can be stored in FIFO. |
Value:
FIFO_CREATE_STATIC(name, t, itms) = { \ .items = (itms), \ .head = 0, \ .tail = 0 \ }
FIFO is allocated statically. This macro is suitable for creating smaller FIFOs.
name | Name of FIFO. | |
t | Type of values stored in FIFO. | |
itms | Number of items that can be stored in FIFO. |
#define fifo_pop | ( | name | ) | name.fifo[name.head = (name.head + 1) < name.items ? (name.head + 1) : 0] |
#define fifo_push | ( | name, | |||
value | ) | name.fifo[name.tail = (name.tail + 1) < name.items ? (name.tail + 1) : 0] = (value) |
Value:
GENERIC_FIELD_DECLARE(name##_items, type) \ \ typedef struct name name##_t; \ \ struct name { \ char_map_t names; \ name##_items_t values; \ int magic; \ }; \ \ int name##_add(name##_t *, const uint8_t *, const size_t, type *); \ int name##_count(name##_t *); \ void name##_destroy(name##_t *, DTOR_T()); \ void name##_exclude(name##_t *, const uint8_t *, const size_t, DTOR_T()); \ type *name##_find(name##_t *, const uint8_t *, const size_t); \ int name##_initialize(name##_t *); \ int name##_is_valid(name##_t *);
[in] | name | Name of the map. |
[in] | type | Inner object type. |
Definition at line 57 of file generic_char_map.h.
Character string to generic type map implementation.
Should follow declaration with the same parameters.
[in] | name | Name of the map. |
[in] | type | Inner object type. |
Definition at line 84 of file generic_char_map.h.
Value:
typedef struct name name##_t; \ \ struct name { \ int size; \ int next; \ type **items; \ int magic; \ }; \ \ int name##_add(name##_t *, type *); \ int name##_count(name##_t *); \ void name##_destroy(name##_t *, DTOR_T()); \ void name##_exclude_index(name##_t *, int, DTOR_T()); \ type **name##_get_field(name##_t *); \ type *name##_get_index(name##_t *, int); \ int name##_initialize(name##_t *); \ int name##_is_valid(name##_t *);
[in] | name | Name of the field. |
[in] | type | Inner object type. |
Definition at line 57 of file generic_field.h.
Generic type field implementation.
Should follow declaration with the same parameters.
[in] | name | Name of the field. |
[in] | type | Inner object type. |
Definition at line 83 of file generic_field.h.
#define IBUF_SIZE 32 |
#define ICMP_GET_CODE | ( | call | ) | ((icmp_code_t) IPC_GET_ARG1(call)) |
#define ICMP_GET_DONT_FRAGMENT | ( | call | ) | ((int) IPC_GET_ARG5(call)) |
#define ICMP_GET_MTU | ( | call | ) | ((icmp_param_t) IPC_GET_ARG3(call)) |
#define ICMP_GET_POINTER | ( | call | ) | ((icmp_param_t) IPC_GET_ARG3(call)) |
#define ICMP_GET_SIZE | ( | call | ) | ((size_t) IPC_GET_ARG1(call)) |
#define ICMP_GET_TIMEOUT | ( | call | ) | ((suseconds_t) IPC_GET_ARG2(call)) |
#define ICMP_GET_TOS | ( | call | ) | ((ip_tos_t) IPC_GET_ARG4(call)) |
#define ICMP_GET_TTL | ( | call | ) | ((ip_ttl_t) IPC_GET_ARG3(call)) |
#define IL_GET_PROTO | ( | call | ) | ((int) IPC_GET_ARG1(call)) |
#define IL_GET_SERVICE | ( | call | ) | ((services_t) IPC_GET_ARG2(call)) |
Value:
typedef struct name name##_t; \ typedef struct name##_item name##_item_t; \ \ struct name##_item { \ int key; \ type *value; \ int magic; \ }; \ \ struct name { \ int size; \ int next; \ name##_item_t *items; \ int magic; \ }; \ \ int name##_add(name##_t *, int, type *); \ void name##_clear(name##_t *, DTOR_T()); \ int name##_count(name##_t *); \ void name##_destroy(name##_t *, DTOR_T()); \ void name##_exclude(name##_t *, int, DTOR_T()); \ void name##_exclude_index(name##_t *, int, DTOR_T()); \ type *name##_find(name##_t *, int); \ int name##_update(name##_t *, int, int); \ type *name##_get_index(name##_t *, int); \ int name##_initialize(name##_t *); \ int name##_is_valid(name##_t *); \ void name##_item_destroy(name##_item_t *, DTOR_T()); \ int name##_item_is_valid(name##_item_t *);
[in] | name | Name of the map. |
[in] | type | Inner object type. |
#define IP_GET_ADDRESS | ( | call | ) |
#define IP_GET_GATEWAY | ( | call | ) |
#define IP_GET_NETMASK | ( | call | ) |
#define IP_GET_PROTOCOL | ( | call | ) | ((ip_protocol_t) IPC_GET_ARG1(call)) |
#define IP_SET_HEADERLEN | ( | answer, | |||
value | ) | IPC_SET_ARG2(answer, (sysarg_t) (value)) |
#define IPOPT_COPIED | ( | o | ) | ((o) & IPOPT_COPY) |
Returns a value indicating whether the IP option should be copied.
[in] | o | The IP option. |
Definition at line 92 of file ip_codes.h.
#define IPOPT_TYPE | ( | copy, | |||
class, | |||||
number | ) |
Value:
(((copy) & IPOPT_COPY) | ((class) & IPOPT_CLASS_MASK) | \ (((number) << IPOPT_NUMBER_SHIFT) & IPOPT_NUMBER_MASK))
[in] | copy | The value indication whether the IP option should be copied. |
[in] | class | The IP option class. |
[in] | number | The IP option number. |
Definition at line 85 of file ip_codes.h.
#define LIBC_ASYNC_C_ |
Asynchronous library.
The aim of this library is to provide a facility for writing programs which utilize the asynchronous nature of HelenOS IPC, yet using a normal way of programming.
You should be able to write very simple multithreaded programs, the async framework will automatically take care of most synchronization problems.
Example of use (pseudo C):
1) Multithreaded client application
fibril_create(fibril1, ...); fibril_create(fibril2, ...); ...
int fibril1(void *arg) { conn = async_connect_me_to(); c1 = async_send(conn); c2 = async_send(conn); async_wait_for(c1); async_wait_for(c2); ... }
2) Multithreaded server application
main() { async_manager(); }
my_client_connection(icallid, *icall) { if (want_refuse) { async_answer_0(icallid, ELIMIT); return; } async_answer_0(icallid, EOK);
callid = async_get_call(&call); somehow_handle_the_call(callid, call); async_answer_2(callid, 1, 2, 3);
callid = async_get_call(&call); ... }
#define LIST_INITIALIZE | ( | name | ) |
#define NETIF_GET_IO | ( | call | ) | ((void *) IPC_GET_ARG3(call)) |
#define NETIF_GET_IRQ | ( | call | ) | ((int) IPC_GET_ARG2(call)) |
#define NEXT_INDEX | ( | fifo, | |||
index | ) | (((index) + 1) % ((fifo)->size + 1)) |
Returns the next queue index.
The queue field is circular.
[in] | fifo | The dynamic queue. |
[in] | index | The actual index to be shifted. |
Definition at line 53 of file dynamic_fifo.c.
#define PACKET_DATA_LENGTH | ( | header | ) | ((header)->data_end - (header)->data_start) |
Returns the actual packet data length.
[in] | header | The packet header. |
Definition at line 45 of file packet_header.h.
#define PACKET_MAP_INDEX | ( | packet_id | ) | (((packet_id) - 1) % PACKET_MAP_SIZE) |
#define PACKET_MAP_PAGE | ( | packet_id | ) | (((packet_id) - 1) / PACKET_MAP_SIZE) |
#define PACKET_MAX_ADDRESS_LENGTH | ( | header | ) | ((header)->dest_addr - (header)->src_addr) |
Returns the maximum packet address length.
[in] | header | The packet header. |
Definition at line 51 of file packet_header.h.
#define PACKET_MIN_SUFFIX | ( | header | ) | ((header)->length - (header)->data_start - (header)->max_content) |
Returns the minimum packet suffix.
[in] | header | The packet header. |
Definition at line 57 of file packet_header.h.
#define SHRINK_GRANULARITY (64 * PAGE_SIZE) |
#define SOCKET_GET_ADDRESS_LENGTH | ( | call | ) |
#define SOCKET_GET_BACKLOG | ( | call | ) |
#define SOCKET_GET_DATA_FRAGMENT_SIZE | ( | call | ) |
#define SOCKET_GET_DATA_FRAGMENTS | ( | call | ) |
#define SOCKET_GET_FLAGS | ( | call | ) |
#define SOCKET_GET_HEADER_SIZE | ( | call | ) |
#define SOCKET_GET_NEW_SOCKET_ID | ( | call | ) |
#define SOCKET_GET_OPT_LEVEL | ( | call | ) |
#define SOCKET_GET_OPT_NAME | ( | call | ) |
#define SOCKET_GET_READ_DATA_LENGTH | ( | call | ) |
#define SOCKET_GET_SOCKET_ID | ( | call | ) |
#define SOCKET_SET_ADDRESS_LENGTH | ( | answer, | |||
value | ) |
#define SOCKET_SET_DATA_FRAGMENT_SIZE | ( | answer, | |||
value | ) |
#define SOCKET_SET_HEADER_SIZE | ( | answer, | |||
value | ) |
#define SOCKET_SET_READ_DATA_LENGTH | ( | answer, | |||
value | ) |
#define SOCKET_SET_SOCKET_ID | ( | answer, | |||
value | ) |
typedef struct addrinfo addrinfo_t |
typedef struct char_map char_map_t |
Type definition of the character string to integer map.
Definition at line 48 of file char_map.h.
typedef int connect_module_t(services_t need) |
typedef struct device_stats device_stats_t |
typedef struct dyn_fifo dyn_fifo_t |
Type definition of the dynamic fifo queue.
Definition at line 44 of file dynamic_fifo.h.
typedef struct dyn_info dyn_info_t |
Holds the data extracted from an ELF Dynamic section.
The data is already pre-processed: Pointers are adjusted to their final run-time values by adding the load bias and indices into the symbol table are converted to pointers.
typedef struct heap_area heap_area_t |
Heap area.
The memory managed by the heap allocator is divided into multiple discontinuous heaps. Each heap is represented by a separate address space area which has this structure at its very beginning.
typedef struct in6_addr in6_addr_t |
typedef struct measured_string measured_string_t |
Type definition of the character string with measured length.
Definition at line 47 of file measured_strings.h.
typedef struct packet_dimension packet_dimension_t |
typedef int packet_id_t |
typedef struct sockaddr_in6 sockaddr_in6_t |
typedef struct sockaddr_in sockaddr_in_t |
typedef struct sockaddr sockaddr_t |
Type definition of the socket specific data.
Definition at line 78 of file socket_client.c.
enum _buffer_state |
enum _buffer_type |
enum arp_messages |
ARP module messages.
NET_ARP_CLEAN_CACHE |
Clean cache message.
|
NET_ARP_CLEAR_ADDRESS |
Clear address cache message.
|
NET_ARP_CLEAR_DEVICE |
Clear device cache message.
|
NET_ARP_DEVICE |
New device message.
|
NET_ARP_TRANSLATE |
Address translation message.
|
enum device_state |
enum icmp_messages_t |
ICMP module messages.
NET_ICMP_ECHO |
Send echo request.
|
NET_ICMP_DEST_UNREACH |
Send destination unreachable error message.
|
NET_ICMP_SOURCE_QUENCH |
Send source quench error message.
|
NET_ICMP_TIME_EXCEEDED |
Send time exceeded error message.
|
NET_ICMP_PARAMETERPROB |
Send parameter problem error message.
|
enum il_messages |
Internet layer modules messages.
NET_IL_DEVICE_STATE |
Device state changed message.
|
NET_IL_MTU_CHANGED |
Device MTU changed message.
|
NET_IL_RECEIVED |
Packet received message.
|
enum ip_messages |
IP module messages.
NET_IP_DEVICE |
New device message.
|
NET_IP_ADD_ROUTE |
Adds the routing entry.
|
NET_IP_GET_ROUTE |
Gets the actual route information.
|
NET_IP_RECEIVED_ERROR |
Processes the received error notification.
|
NET_IP_SET_GATEWAY |
Sets the default gateway.
|
NET_IP_PACKET_SPACE |
Packet size message.
|
NET_IP_SEND |
Packet send message.
|
enum keycode_t |
Keycode definitions.
A keycode identifies a key by its position on the keyboard, rather than by its label. For human readability, key positions are noted with the key label on a keyboard with US layout. This label has nothing to do with the character, that the key produces -- this is determined by the keymap.
The keyboard model reflects a standard PC keyboard layout. Non-standard keyboards need to be mapped to this model in some logical way. Scancodes are mapped to keycodes with a scanmap.
For easier mapping to the model and to emphasize the nature of keycodes, they really are organized here by position, rather than by label.
enum l18_win_locales_t |
enum log_level_t |
enum net_messages |
Networking subsystem central module messages.
NET_NET_GET_CONF |
Returns the general configuration.
|
NET_NET_GET_DEVICE_CONF |
Returns the device specific configuration.
|
NET_NET_STARTUP | Starts the networking stack. |
enum netif_messages |
Network interface common module messages.
NET_NETIF_PROBE |
Probe device message.
|
NET_NETIF_SEND |
Send packet message.
|
NET_NETIF_START |
Start device message.
|
NET_NETIF_STATS |
Get device usage statistics message.
|
NET_NETIF_STOP |
Stop device message.
|
NET_NETIF_GET_ADDR |
Get device address message.
|
enum nil_messages |
Network interface layer module messages.
NET_NIL_DEVICE |
New device or update MTU message.
|
NET_NIL_DEVICE_STATE |
New device state message.
|
NET_NIL_RECEIVED |
Received packet queue message.
|
NET_NIL_SEND |
Send packet queue message.
|
NET_NIL_PACKET_SPACE |
Packet size message.
|
NET_NIL_ADDR |
Device local hardware address message.
|
NET_NIL_BROADCAST_ADDR |
Device broadcast hardware address message.
|
enum packet_messages |
Packet server module messages.
NET_PACKET_CREATE_1 |
Create packet message with specified content length.
|
NET_PACKET_CREATE_4 |
Create packet message with specified address length, prefix, content and suffix.
|
NET_PACKET_GET |
Get packet message.
|
NET_PACKET_GET_SIZE |
Get packet size message.
|
NET_PACKET_RELEASE |
Release packet message.
|
enum sock_type |
Socket types.
SOCK_STREAM | Stream (connection oriented) socket. |
SOCK_DGRAM | Datagram (connectionless oriented) socket. |
SOCK_RAW | Raw socket. |
Definition at line 65 of file socket_codes.h.
enum socket_messages |
Socket client messages.
NET_SOCKET |
Creates a new socket.
|
NET_SOCKET_BIND |
Binds the socket.
|
NET_SOCKET_LISTEN |
Creates a new socket.
|
NET_SOCKET_ACCEPT |
Accepts an incomming connection.
|
NET_SOCKET_CONNECT |
Connects the socket.
|
NET_SOCKET_CLOSE |
Closes the socket.
|
NET_SOCKET_SEND |
Sends data via the stream socket.
|
NET_SOCKET_SENDTO |
Sends data via the datagram socket.
|
NET_SOCKET_RECV |
Receives data from the stream socket.
|
NET_SOCKET_RECVFROM |
Receives data from the datagram socket.
|
NET_SOCKET_GETSOCKOPT |
Gets the socket option.
|
NET_SOCKET_SETSOCKOPT |
Sets the socket option.
|
NET_SOCKET_ACCEPTED | New socket for acceptence notification message. |
NET_SOCKET_RECEIVED | New data received notification message. |
NET_SOCKET_DATA_FRAGMENT_SIZE | New socket data fragment size notification message. |
enum tl_messages |
Transport layer modules messages.
NET_TL_RECEIVED |
Packet received message.
|
void __async_sess_init | ( | void | ) |
Initialize the async_sess subsystem.
Needs to be called prior to any other interface in this file.
Definition at line 143 of file async_sess.c.
tcb_t * __make_tls | ( | void | ) |
void __malloc_init | ( | void | ) |
void __thread_main | ( | uspace_arg_t * | uarg | ) |
Main thread function.
This function is called from __thread_entry() and is used to call the thread's implementing function and perform cleanup and exit when thread returns back.
uarg | Pointer to userspace argument structure. |
static void _gsort | ( | void * | data, | |
size_t | cnt, | |||
size_t | elem_size, | |||
sort_cmp_t | cmp, | |||
void * | arg, | |||
void * | slot | |||
) | [static] |
Gnome sort.
Apply generic gnome sort algorithm on supplied data, using pre-allocated buffer.
data | Pointer to data to be sorted. | |
cnt | Number of elements to be sorted. | |
elem_size | Size of one element. | |
cmp | Comparator function. | |
arg | 3rd argument passed to cmp. | |
slot | Pointer to scratch memory buffer elem_size bytes long. |
static void _qsort | ( | void * | data, | |
size_t | cnt, | |||
size_t | elem_size, | |||
sort_cmp_t | cmp, | |||
void * | arg, | |||
void * | slot, | |||
void * | pivot | |||
) | [static] |
Quicksort.
Apply generic quicksort algorithm on supplied data, using pre-allocated buffers.
data | Pointer to data to be sorted. | |
cnt | Number of elements to be sorted. | |
elem_size | Size of one element. | |
cmp | Comparator function. | |
arg | 3rd argument passed to cmp. | |
slot | Pointer to scratch memory buffer elem_size bytes long. | |
pivot | Pointer to scratch memory buffer elem_size bytes long. |
static unsigned long _strtoul | ( | const char * | nptr, | |
char ** | endptr, | |||
int | base, | |||
char * | sgn | |||
) | [static] |
Convert string to a number.
Core of strtol and strtoul functions.
nptr | Pointer to string. | |
endptr | If not NULL, function stores here pointer to the first invalid character. | |
base | Zero or number between 2 and 36 inclusive. | |
sgn | It's set to 1 if minus found. |
Accepts waiting socket.
Blocks until such a socket exists.
[in] | socket_id | Socket identifier. |
[out] | cliaddr | The remote client address. |
[in] | addrlen | The address length. |
EBADMEM if the cliaddr or addrlen parameter is NULL.
EINVAL if the backlog parameter is not positive (<=0).
ENOTSOCK if the socket is not found.
Other error codes as defined for the NET_SOCKET_ACCEPT message.
Definition at line 621 of file socket_client.c.
void answer_call | ( | ipc_callid_t | callid, | |
int | result, | |||
ipc_call_t * | answer, | |||
size_t | count | |||
) |
static void area_check | ( | void * | addr | ) | [static] |
static bool area_grow | ( | heap_area_t * | area, | |
size_t | size | |||
) | [static] |
int arg_parse_string | ( | int | argc, | |
char ** | argv, | |||
int * | index, | |||
char ** | value, | |||
int | offset | |||
) |
Parse the next argument as a character string.
The actual argument is pointed by the index. Parse the offseted actual argument value if the offset is set or the next one if not. Increment the actual index by the number of processed arguments.
[in] | argc | The total number of arguments. |
[in] | argv | The arguments. |
[in,out] | index | The actual argument index. The index is incremented by the number of processed arguments. |
[out] | value | The parsed argument value. |
[in] | offset | The value offset in the actual argument. If not set, the next argument is parsed instead. |
ENOENT if the parameter is missing.
Definition at line 137 of file arg_parse.c.
int as_area_change_flags | ( | void * | address, | |
unsigned int | flags | |||
) |
void * as_area_create | ( | void * | address, | |
size_t | size, | |||
unsigned int | flags | |||
) |
int as_area_destroy | ( | void * | address | ) |
int as_area_resize | ( | void * | address, | |
size_t | size, | |||
unsigned int | flags | |||
) |
void * as_get_mappable_page | ( | size_t | size | ) |
int as_get_physical_mapping | ( | void * | address, | |
uintptr_t * | frame | |||
) |
bool ascii_check | ( | wchar_t | ch | ) |
int int asprintf | ( | char ** | strp, | |
const char * | fmt, | |||
... | ||||
) |
Allocate and print to string.
strp | Address of the pointer where to store the address of the newly allocated string. Format string. |
Definition at line 61 of file asprintf.c.
Wrapper for making IPC_M_CONNECT_ME_TO calls using the async framework.
Ask through phone for a new connection to some service.
phone | Phone handle used for contacting the other side. | |
arg1 | User defined argument. | |
arg2 | User defined argument. | |
arg3 | User defined argument. |
Wrapper for making IPC_M_CONNECT_ME_TO calls using the async framework.
Ask through phone for a new connection to some service and block until success.
phoneid | Phone handle used for contacting the other side. | |
arg1 | User defined argument. | |
arg2 | User defined argument. | |
arg3 | User defined argument. |
int async_connect_to_me | ( | int | phone, | |
sysarg_t | arg1, | |||
sysarg_t | arg2, | |||
sysarg_t | arg3, | |||
async_client_conn_t | client_receiver | |||
) |
Wrapper for making IPC_M_CONNECT_TO_ME calls using the async framework.
Ask through phone for a new connection to some service.
phone | Phone handle used for contacting the other side. | |
arg1 | User defined argument. | |
arg2 | User defined argument. | |
arg3 | User defined argument. | |
client_receiver | Connection handing routine. |
aid_t async_data_read | ( | int | phoneid, | |
void * | dst, | |||
size_t | size, | |||
ipc_call_t * | dataptr | |||
) |
Start IPC_M_DATA_READ using the async framework.
phoneid | Phone that will be used to contact the receiving side. | |
dst | Address of the beginning of the destination buffer. | |
size | Size of the destination buffer (in bytes). | |
dataptr | Storage of call data (arg 2 holds actual data size). |
int async_data_read_finalize | ( | ipc_callid_t | callid, | |
const void * | src, | |||
size_t | size | |||
) |
Wrapper for answering the IPC_M_DATA_READ calls using the async framework.
This wrapper only makes it more comfortable to answer IPC_M_DATA_READ calls so that the user doesn't have to remember the meaning of each IPC argument.
callid | Hash of the IPC_M_DATA_READ call to answer. | |
src | Source address for the IPC_M_DATA_READ call. | |
size | Size for the IPC_M_DATA_READ call. Can be smaller than the maximum size announced by the sender. |
bool async_data_read_receive | ( | ipc_callid_t * | callid, | |
size_t * | size | |||
) |
Wrapper for receiving the IPC_M_DATA_READ calls using the async framework.
This wrapper only makes it more comfortable to receive IPC_M_DATA_READ calls so that the user doesn't have to remember the meaning of each IPC argument.
So far, this wrapper is to be used from within a connection fibril.
callid | Storage for the hash of the IPC_M_DATA_READ. | |
size | Storage for the maximum size. Can be NULL. |
int async_data_read_start_generic | ( | int | phoneid, | |
void * | dst, | |||
size_t | size, | |||
int | flags | |||
) |
Wrapper for IPC_M_DATA_READ calls using the async framework.
phoneid | Phone that will be used to contact the receiving side. | |
dst | Address of the beginning of the destination buffer. | |
size | Size of the destination buffer. | |
flags | Flags to control the data transfer. |
int async_data_write_accept | ( | void ** | data, | |
const bool | nullterm, | |||
const size_t | min_size, | |||
const size_t | max_size, | |||
const size_t | granularity, | |||
size_t * | received | |||
) |
Wrapper for receiving binary data or strings.
This wrapper only makes it more comfortable to use async_data_write_* functions to receive binary data or strings.
data | Pointer to data pointer (which should be later disposed by free()). If the operation fails, the pointer is not touched. | |
nullterm | If true then the received data is always zero terminated. This also causes to allocate one extra byte beyond the raw transmitted data. | |
min_size | Minimum size (in bytes) of the data to receive. | |
max_size | Maximum size (in bytes) of the data to receive. 0 means no limit. | |
granulariy | If non-zero then the size of the received data has to be divisible by this value. | |
received | If not NULL, the size of the received data is stored here. |
int async_data_write_finalize | ( | ipc_callid_t | callid, | |
void * | dst, | |||
size_t | size | |||
) |
Wrapper for answering the IPC_M_DATA_WRITE calls using the async framework.
This wrapper only makes it more comfortable to answer IPC_M_DATA_WRITE calls so that the user doesn't have to remember the meaning of each IPC argument.
callid | Hash of the IPC_M_DATA_WRITE call to answer. | |
dst | Final destination address for the IPC_M_DATA_WRITE call. | |
size | Final size for the IPC_M_DATA_WRITE call. |
bool async_data_write_receive | ( | ipc_callid_t * | callid, | |
size_t * | size | |||
) |
Wrapper for receiving the IPC_M_DATA_WRITE calls using the async framework.
This wrapper only makes it more comfortable to receive IPC_M_DATA_WRITE calls so that the user doesn't have to remember the meaning of each IPC argument.
So far, this wrapper is to be used from within a connection fibril.
callid | Storage for the hash of the IPC_M_DATA_WRITE. | |
size | Storage for the suggested size. May be NULL. |
int async_data_write_start_generic | ( | int | phoneid, | |
const void * | src, | |||
size_t | size, | |||
int | flags | |||
) |
Wrapper for IPC_M_DATA_WRITE calls using the async framework.
phoneid | Phone that will be used to contact the receiving side. | |
src | Address of the beginning of the source buffer. | |
size | Size of the source buffer. | |
flags | Flags to control the data transfer. |
void async_data_write_void | ( | sysarg_t | retval | ) |
int async_exchange_begin | ( | async_sess_t * | sess | ) |
Start new exchange in a session.
sess_phone | Session. |
Definition at line 224 of file async_sess.c.
void async_exchange_end | ( | async_sess_t * | sess, | |
int | data_phone | |||
) |
Finish an exchange.
sess | Session. | |
data_phone | Phone representing the exchange within the session. |
Definition at line 284 of file async_sess.c.
ipc_callid_t async_get_call_timeout | ( | ipc_call_t * | call, | |
suseconds_t | usecs | |||
) |
Return new incoming message for the current (fibril-local) connection.
call | Storage where the incoming call data will be stored. | |
usecs | Timeout in microseconds. Zero denotes no timeout. |
int async_hangup | ( | int | phone | ) |
void async_insert_timeout | ( | awaiter_t * | wd | ) |
static int async_manager_fibril | ( | void * | arg | ) | [static] |
static int async_manager_worker | ( | void | ) | [static] |
fid_t async_new_connection | ( | sysarg_t | in_task_hash, | |
sysarg_t | in_phone_hash, | |||
ipc_callid_t | callid, | |||
ipc_call_t * | call, | |||
void(*)(ipc_callid_t, ipc_call_t *) | cfibril | |||
) |
Create a new fibril for a new connection.
Create new fibril for connection, fill in connection structures and inserts it into the hash table, so that later we can easily do routing of messages to particular fibrils.
in_task_hash | Identification of the incoming connection. | |
in_phone_hash | Identification of the incoming connection. | |
callid | Hash of the opening IPC_M_CONNECT_ME_TO call. If callid is zero, the connection was opened by accepting the IPC_M_CONNECT_TO_ME call and this function is called directly by the server. | |
call | Call data of the opening call. | |
cfibril | Fibril function that should be called upon opening the connection. |
sysarg_t async_req_fast | ( | int | phoneid, | |
sysarg_t | method, | |||
sysarg_t | arg1, | |||
sysarg_t | arg2, | |||
sysarg_t | arg3, | |||
sysarg_t | arg4, | |||
sysarg_t * | r1, | |||
sysarg_t * | r2, | |||
sysarg_t * | r3, | |||
sysarg_t * | r4, | |||
sysarg_t * | r5 | |||
) |
Pseudo-synchronous message sending - fast version.
Send message asynchronously and return only after the reply arrives.
This function can only transfer 4 register payload arguments. For transferring more arguments, see the slower async_req_slow().
phoneid | Hash of the phone through which to make the call. | |
method | Method of the call. | |
arg1 | Service-defined payload argument. | |
arg2 | Service-defined payload argument. | |
arg3 | Service-defined payload argument. | |
arg4 | Service-defined payload argument. | |
r1 | If non-NULL, storage for the 1st reply argument. | |
r2 | If non-NULL, storage for the 2nd reply argument. | |
r3 | If non-NULL, storage for the 3rd reply argument. | |
r4 | If non-NULL, storage for the 4th reply argument. | |
r5 | If non-NULL, storage for the 5th reply argument. |
sysarg_t async_req_slow | ( | int | phoneid, | |
sysarg_t | method, | |||
sysarg_t | arg1, | |||
sysarg_t | arg2, | |||
sysarg_t | arg3, | |||
sysarg_t | arg4, | |||
sysarg_t | arg5, | |||
sysarg_t * | r1, | |||
sysarg_t * | r2, | |||
sysarg_t * | r3, | |||
sysarg_t * | r4, | |||
sysarg_t * | r5 | |||
) |
Pseudo-synchronous message sending - slow version.
Send message asynchronously and return only after the reply arrives.
phoneid | Hash of the phone through which to make the call. | |
method | Method of the call. | |
arg1 | Service-defined payload argument. | |
arg2 | Service-defined payload argument. | |
arg3 | Service-defined payload argument. | |
arg4 | Service-defined payload argument. | |
arg5 | Service-defined payload argument. | |
r1 | If non-NULL, storage for the 1st reply argument. | |
r2 | If non-NULL, storage for the 2nd reply argument. | |
r3 | If non-NULL, storage for the 3rd reply argument. | |
r4 | If non-NULL, storage for the 4th reply argument. | |
r5 | If non-NULL, storage for the 5th reply argument. |
aid_t async_send_fast | ( | int | phoneid, | |
sysarg_t | method, | |||
sysarg_t | arg1, | |||
sysarg_t | arg2, | |||
sysarg_t | arg3, | |||
sysarg_t | arg4, | |||
ipc_call_t * | dataptr | |||
) |
Send message and return id of the sent message.
The return value can be used as input for async_wait() to wait for completion.
phoneid | Handle of the phone that will be used for the send. | |
method | Service-defined method. | |
arg1 | Service-defined payload argument. | |
arg2 | Service-defined payload argument. | |
arg3 | Service-defined payload argument. | |
arg4 | Service-defined payload argument. | |
dataptr | If non-NULL, storage where the reply data will be stored. |
aid_t async_send_slow | ( | int | phoneid, | |
sysarg_t | method, | |||
sysarg_t | arg1, | |||
sysarg_t | arg2, | |||
sysarg_t | arg3, | |||
sysarg_t | arg4, | |||
sysarg_t | arg5, | |||
ipc_call_t * | dataptr | |||
) |
Send message and return id of the sent message.
The return value can be used as input for async_wait() to wait for completion.
phoneid | Handle of the phone that will be used for the send. | |
method | Service-defined method. | |
arg1 | Service-defined payload argument. | |
arg2 | Service-defined payload argument. | |
arg3 | Service-defined payload argument. | |
arg4 | Service-defined payload argument. | |
arg5 | Service-defined payload argument. | |
dataptr | If non-NULL, storage where the reply data will be stored. |
void async_session_create | ( | async_sess_t * | sess, | |
int | phone, | |||
sysarg_t | arg1 | |||
) |
Create a session.
Session is a logical datapath from a client task to a server task. One session can accomodate multiple concurrent exchanges. Here phone is a phone connected to the desired server task.
This function always succeeds.
sess | Session structure provided by caller, will be filled in. | |
phone | Phone connected to the desired server task. | |
arg1 | Value to pass as first argument upon creating a new connection. Typical use is to identify a resource within the server that the caller wants to access (port ID, interface ID, device ID, etc.). |
Definition at line 165 of file async_sess.c.
void async_session_destroy | ( | async_sess_t * | sess | ) |
Destroy a session.
Dismantle session structure sess and release any resources (connections) held by the session.
sess | Session to destroy. |
Definition at line 184 of file async_sess.c.
void async_set_client_connection | ( | async_client_conn_t | conn | ) |
void async_set_interrupt_received | ( | async_client_conn_t | intr | ) |
int async_share_in_finalize | ( | ipc_callid_t | callid, | |
void * | src, | |||
unsigned int | flags | |||
) |
Wrapper for answering the IPC_M_SHARE_IN calls using the async framework.
This wrapper only makes it more comfortable to answer IPC_M_DATA_READ calls so that the user doesn't have to remember the meaning of each IPC argument.
callid | Hash of the IPC_M_DATA_READ call to answer. | |
src | Source address space base. | |
flags | Flags to be used for sharing. Bits can be only cleared. |
bool async_share_in_receive | ( | ipc_callid_t * | callid, | |
size_t * | size | |||
) |
Wrapper for receiving the IPC_M_SHARE_IN calls using the async framework.
This wrapper only makes it more comfortable to receive IPC_M_SHARE_IN calls so that the user doesn't have to remember the meaning of each IPC argument.
So far, this wrapper is to be used from within a connection fibril.
callid | Storage for the hash of the IPC_M_SHARE_IN call. | |
size | Destination address space area size. |
int async_share_in_start | ( | int | phoneid, | |
void * | dst, | |||
size_t | size, | |||
sysarg_t | arg, | |||
unsigned int * | flags | |||
) |
Wrapper for IPC_M_SHARE_IN calls using the async framework.
phoneid | Phone that will be used to contact the receiving side. | |
dst | Destination address space area base. | |
size | Size of the destination address space area. | |
arg | User defined argument. | |
flags | Storage for the received flags. Can be NULL. |
int async_share_out_finalize | ( | ipc_callid_t | callid, | |
void * | dst | |||
) |
Wrapper for answering the IPC_M_SHARE_OUT calls using the async framework.
This wrapper only makes it more comfortable to answer IPC_M_SHARE_OUT calls so that the user doesn't have to remember the meaning of each IPC argument.
callid | Hash of the IPC_M_DATA_WRITE call to answer. | |
dst | Destination address space area base address. |
bool async_share_out_receive | ( | ipc_callid_t * | callid, | |
size_t * | size, | |||
unsigned int * | flags | |||
) |
Wrapper for receiving the IPC_M_SHARE_OUT calls using the async framework.
This wrapper only makes it more comfortable to receive IPC_M_SHARE_OUT calls so that the user doesn't have to remember the meaning of each IPC argument.
So far, this wrapper is to be used from within a connection fibril.
callid | Storage for the hash of the IPC_M_SHARE_OUT call. | |
size | Storage for the source address space area size. | |
flags | Storage for the sharing flags. |
int async_share_out_start | ( | int | phoneid, | |
void * | src, | |||
unsigned int | flags | |||
) |
Wrapper for IPC_M_SHARE_OUT calls using the async framework.
phoneid | Phone that will be used to contact the receiving side. | |
src | Source address space area base address. | |
flags | Flags to be used for sharing. Bits can be only cleared. |
void async_usleep | ( | suseconds_t | timeout | ) |
int async_wait_timeout | ( | aid_t | amsgid, | |
sysarg_t * | retval, | |||
suseconds_t | timeout | |||
) |
Wait for a message sent by the async framework, timeout variant.
amsgid | Hash of the message to wait for. | |
retval | Pointer to storage where the retval of the answer will be stored. | |
timeout | Timeout in microseconds. |
int bcmp | ( | const void * | s1, | |
const void * | s2, | |||
size_t | len | |||
) |
Compare two memory areas.
s1 | Pointer to the first area to compare. | |
s2 | Pointer to the second area to compare. | |
len | Size of the first area in bytes. Both areas must have the same length. |
Binds the socket to a port address.
[in] | socket_id | Socket identifier. |
[in] | my_addr | The port address. |
[in] | addrlen | The address length. |
ENOTSOCK if the socket is not found.
EBADMEM if the my_addr parameter is NULL.
NO_DATA if the addlen parameter is zero.
Other error codes as defined for the NET_SOCKET_BIND message.
Definition at line 562 of file socket_client.c.
int bind_service | ( | services_t | need, | |
sysarg_t | arg1, | |||
sysarg_t | arg2, | |||
sysarg_t | arg3, | |||
async_client_conn_t | client_receiver | |||
) |
Create bidirectional connection with the needed module service and registers the message receiver.
[in] | need | The needed module service. |
[in] | arg1 | The first parameter. |
[in] | arg2 | The second parameter. |
[in] | arg3 | The third parameter. |
[in] | client_receiver | The message receiver. |
Other error codes as defined for the ipc_connect_to_me() function.
int bind_service_timeout | ( | services_t | need, | |
sysarg_t | arg1, | |||
sysarg_t | arg2, | |||
sysarg_t | arg3, | |||
async_client_conn_t | client_receiver, | |||
suseconds_t | timeout | |||
) |
Create bidirectional connection with the needed module service and registers the message receiver.
[in] | need | The needed module service. |
[in] | arg1 | The first parameter. |
[in] | arg2 | The second parameter. |
[in] | arg3 | The third parameter. |
[in] | client_receiver | The message receiver. |
[in] | timeout | The connection timeout in microseconds. No timeout if set to zero (0). |
ETIMEOUT if the connection timeouted.
Other error codes as defined for the ipc_connect_to_me() function.
static void block_check | ( | void * | addr | ) | [static] |
static void block_init | ( | void * | addr, | |
size_t | size, | |||
bool | free, | |||
heap_area_t * | area | |||
) | [static] |
Initialize a heap block.
Fill in the structures related to a heap block. Should be called only inside the critical section.
addr | Address of the block. | |
size | Size of the block including the header and the footer. | |
free | Indication of a free block. | |
area | Heap area the block belongs to. |
char * canonify | ( | char * | path, | |
size_t * | lenp | |||
) |
Canonify a file system path.
A file system path is canonical, if the following holds:
1) the path is absolute (i.e. a/b/c is not canonical) 2) there is no trailing slash in the path if it has components (i.e. /a/b/c/ is not canonical) 3) there is no extra slash in the path (i.e. /a//b/c is not canonical) 4) there is no '.' component in the path (i.e. /a/./b/c is not canonical) 5) there is no '..' component in the path (i.e. /a/b/../c is not canonical)
This function makes a potentially non-canonical file system path canonical. It works in-place and requires a NULL-terminated input string.
path | Path to be canonified. | |
lenp | Pointer where the length of the final path will be stored. Can be NULL. |
Definition at line 311 of file canonify.c.
int cap_grant | ( | task_id_t | id, | |
unsigned int | caps | |||
) |
int cap_revoke | ( | task_id_t | id, | |
unsigned int | caps | |||
) |
Read from character device.
dev_phone | Phone to the device. | |
buf | Output buffer for the data read from the device. | |
size | Maximum size (in bytes) of the data to be read. |
Definition at line 103 of file char_dev.c.
Read to or write from device.
Helper function to read to or write from a device using its character interface.
dev_phone | Phone to the device. | |
buf | Buffer for the data read from or written to the device. | |
size | Maximum size of data (in bytes) to be read or written. | |
read | Read from the device if true, write to it otherwise. |
Definition at line 56 of file char_dev.c.
Write to character device.
dev_phone | Phone to the device. | |
buf | Input buffer containg the data to be written to the device. | |
size | Maximum size (in bytes) of the data to be written. |
Definition at line 118 of file char_dev.c.
int char_map_add | ( | char_map_t * | map, | |
const uint8_t * | identifier, | |||
size_t | length, | |||
const int | value | |||
) |
Adds the value with the key to the map.
[in,out] | map | The character string to integer map. |
[in] | identifier | The key zero ('') terminated character string. The key character string is processed until the first terminating zero ('') character after the given length is found. |
[in] | length | The key character string length. The parameter may be zero (0) which means that the string is processed until the terminating zero ('\0') character is found. |
[in] | value | The integral value to be stored for the key character string. |
EINVAL if the map is not valid.
EINVAL if the identifier parameter is NULL.
EINVAL if the length parameter zero (0) and the identifier parameter is an empty character string (the first character is the terminating zero ('') character.
EEXIST if the key character string is already used.
Other error codes as defined for the char_map_add_item() function.
Definition at line 141 of file char_map.c.
static int char_map_add_item | ( | char_map_t * | map, | |
const uint8_t * | identifier, | |||
size_t | length, | |||
const int | value | |||
) | [static] |
Adds the value with the key to the map.
Creates new nodes to map the key.
[in,out] | map | The character string to integer map. |
[in] | identifier | The key zero ('') terminated character string. The key character string is processed until the first terminating zero ('') character after the given length is found. |
[in] | length | The key character string length. The parameter may be zero (0) which means that the string is processed until the terminating zero ('') character is found. |
[in] | value | The integral value to be stored for the key character string. |
ENOMEM if there is not enough memory left.
EEXIST if the key character string is already used.
Definition at line 67 of file char_map.c.
void char_map_destroy | ( | char_map_t * | map | ) |
Clears and destroys the map.
[in,out] | map | The character string to integer map. |
Definition at line 173 of file char_map.c.
int char_map_exclude | ( | char_map_t * | map, | |
const uint8_t * | identifier, | |||
size_t | length | |||
) |
Excludes the value assigned to the key from the map.
The entry is cleared from the map.
[in,out] | map | The character string to integer map. |
[in] | identifier | The key zero ('') terminated character string. The key character string is processed until the first terminating zero ('') character after the given length is found. |
[in] | length | The key character string length. The parameter may be zero (0) which means that the string is processed until the terminating zero ('') character is found. |
CHAR_MAP_NULL if the key is not assigned a value.
Definition at line 243 of file char_map.c.
int char_map_find | ( | const char_map_t * | map, | |
const uint8_t * | identifier, | |||
size_t | length | |||
) |
Returns the value assigned to the key from the map.
[in] | map | The character string to integer map. |
[in] | identifier | The key zero ('') terminated character string. The key character string is processed until the first terminating zero ('') character after the given length is found. |
[in] | length | The key character string length. The parameter may be zero (0) which means that the string is processed until the terminating zero ('') character is found. |
CHAR_MAP_NULL if the key is not assigned a value.
Definition at line 271 of file char_map.c.
static char_map_t* char_map_find_node | ( | const char_map_t * | map, | |
const uint8_t * | identifier, | |||
size_t | length | |||
) | [static] |
Returns the node assigned to the key from the map.
[in] | map | The character string to integer map. |
[in] | identifier | The key zero ('') terminated character string. The key character string is processed until the first terminating zero ('') character after the given length is found. |
[in] | length | The key character string length. The parameter may be zero (0) which means that the string is processed until the terminating zero ('') character is found. |
NULL if the key is not assigned a node.
Definition at line 202 of file char_map.c.
int char_map_initialize | ( | char_map_t * | map | ) |
Initializes the map.
[in,out] | map | The character string to integer map. |
EINVAL if the map parameter is NULL.
ENOMEM if there is not enough memory left.
Definition at line 286 of file char_map.c.
static int char_map_is_valid | ( | const char_map_t * | map | ) | [static] |
Checks if the map is valid.
[in] | map | The character string to integer map. |
FALSE otherwise.
Definition at line 112 of file char_map.c.
int char_map_update | ( | char_map_t * | map, | |
const uint8_t * | identifier, | |||
const size_t | length, | |||
const int | value | |||
) |
Adds or updates the value with the key to the map.
[in,out] | map | The character string to integer map. |
[in] | identifier | The key zero ('') terminated character string. The key character string is processed until the first terminating zero ('') character after the given length is found. |
[in] | length | The key character string length. The parameter may be zero (0) which means that the string is processed until the terminating zero ('') character is found. |
[in] | value | The integral value to be stored for the key character string. |
EINVAL if the map is not valid.
EINVAL if the identifier parameter is NULL.
EINVAL if the length parameter zero (0) and the identifier parameter is an empty character string (the first character is the terminating zero (') character.
EEXIST if the key character string is already used.
Other error codes as defined for the char_map_add_item() function.
Definition at line 331 of file char_map.c.
bool chr_check | ( | wchar_t | ch | ) |
Encode a single character to string representation.
Encode a single character to string representation (i.e. UTF-8) and store it into a buffer at offset. Encoding starts at offset and this offset is moved to the position where the next character can be written to.
ch | Input character. | |
str | Output buffer. | |
offset | Byte offset where to start writing. | |
size | Size of the output buffer (in bytes). |
int clipboard_get_str | ( | char ** | str | ) |
Get a copy of clipboard contents.
Returns a new string that can be deallocated with free().
str | Here pointer to the newly allocated string is stored. |
Definition at line 115 of file clipboard.c.
int clipboard_put_str | ( | const char * | str | ) |
Copy string to clipboard.
Sets the clipboard contents to str. Passing an empty string or NULL makes the clipboard empty.
str | String to put to clipboard or NULL. |
Definition at line 70 of file clipboard.c.
int closesocket | ( | int | socket_id | ) |
Closes the socket.
[in] | socket_id | Socket identifier. |
ENOTSOCK if the socket is not found.
EINPROGRESS if there is another blocking function in progress.
Other error codes as defined for the NET_SOCKET_CLOSE message.
Definition at line 764 of file socket_client.c.
static int conn_compare | ( | unsigned long | key[], | |
hash_count_t | keys, | |||
link_t * | item | |||
) | [static] |
static hash_index_t conn_hash | ( | unsigned long | key[] | ) | [static] |
Connects socket to the remote server.
[in] | socket_id | Socket identifier. |
[in] | serv_addr | The remote server address. |
[in] | addrlen | The address length. |
EBADMEM if the serv_addr parameter is NULL.
NO_DATA if the addlen parameter is zero.
ENOTSOCK if the socket is not found.
Other error codes as defined for the NET_SOCKET_CONNECT message.
Definition at line 724 of file socket_client.c.
int connect_to_service | ( | services_t | need | ) |
int connect_to_service_timeout | ( | services_t | need, | |
suseconds_t | timeout | |||
) |
static int connection_fibril | ( | void * | arg | ) | [static] |
Wrapper for client connection fibril.
When a new connection arrives, a fibril with this implementing function is created. It calls client_connection() and does the final cleanup.
arg | Connection structure pointer. |
int data_reply | ( | void * | data, | |
size_t | data_length | |||
) |
Replies the data to the other party.
[in] | data | The data buffer to be sent. |
[in] | data_length | The buffer length. |
EINVAL if the client does not expect the data.
EOVERFLOW if the client does not expect all the data. Only partial data are transfered.
Other error codes as defined for the async_data_read_finalize() function.
static void default_client_connection | ( | ipc_callid_t | callid, | |
ipc_call_t * | call | |||
) | [static] |
static void default_interrupt_received | ( | ipc_callid_t | callid, | |
ipc_call_t * | call | |||
) | [static] |
int device_assign_devno | ( | void | ) |
int devman_add_function | ( | const char * | name, | |
fun_type_t | ftype, | |||
match_id_list_t * | match_ids, | |||
devman_handle_t | devh, | |||
devman_handle_t * | funh | |||
) |
Add function to a device.
Request devman to add a new function to the specified device owned by this driver task.
name | Name of the new function | |
ftype | Function type, fun_inner or fun_exposed | |
match_ids | Match IDs (should be empty for fun_exposed) | |
devh | Devman handle of the device | |
funh | Place to store handle of the new function |
int devmap_device_register | ( | const char * | fqdn, | |
devmap_handle_t * | handle | |||
) |
int devmap_device_register_with_iface | ( | const char * | fqdn, | |
devmap_handle_t * | handle, | |||
sysarg_t | interface | |||
) |
Register new device.
The interface
is used when forwarding connection to the driver. If not 0, the first argument is the interface and the second argument is the devmap handle of the device. When the interface is zero (default), the first argument is directly the handle (to ensure backward compatibility).
fqdn | Fully qualified device name. | |
[out] | handle | Handle to the created instance of device. |
interface | Interface when forwarding. |
int dyn_fifo_destroy | ( | dyn_fifo_t * | fifo | ) |
Clears and destroys the queue.
[in,out] | fifo | The dynamic queue. |
EINVAL if the queue is not valid.
Definition at line 195 of file dynamic_fifo.c.
int dyn_fifo_initialize | ( | dyn_fifo_t * | fifo, | |
int | size | |||
) |
Initializes the dynamic queue.
[in,out] | fifo | The dynamic queue. |
[in] | size | The initial queue size. |
EINVAL if the queue is not valid.
EBADMEM if the fifo parameter is NULL.
ENOMEM if there is not enough memory left.
Definition at line 75 of file dynamic_fifo.c.
static int dyn_fifo_is_valid | ( | dyn_fifo_t * | fifo | ) | [static] |
Checks if the queue is valid.
[in] | fifo | The dynamic queue. |
FALSE otherwise.
Definition at line 61 of file dynamic_fifo.c.
int dyn_fifo_pop | ( | dyn_fifo_t * | fifo | ) |
Returns and excludes the first item in the queue.
[in,out] | fifo | The dynamic queue. |
EINVAL if the queue is not valid.
ENOENT if the queue is empty.
Definition at line 156 of file dynamic_fifo.c.
int dyn_fifo_push | ( | dyn_fifo_t * | fifo, | |
int | value, | |||
int | max_size | |||
) |
Appends a new item to the queue end.
[in,out] | fifo | The dynamic queue. |
[in] | value | The new item value. Should be positive. |
[in] | max_size | The maximum queue size. The queue is not resized beyound this limit. May be zero or negative to indicate no limit. |
EINVAL if the queue is not valid.
ENOMEM if there is not enough memory left.
Definition at line 106 of file dynamic_fifo.c.
int dyn_fifo_value | ( | dyn_fifo_t * | fifo | ) |
Returns and keeps the first item in the queue.
[in,out] | fifo | The dynamic queue. |
EINVAL if the queue is not valid.
ENOENT if the queue is empty.
Definition at line 178 of file dynamic_fifo.c.
int event_subscribe | ( | event_type_t | evno, | |
sysarg_t | imethod | |||
) |
int event_unmask | ( | event_type_t | evno | ) |
void fibril_add_manager | ( | fid_t | fid | ) |
void fibril_add_ready | ( | fid_t | fid | ) |
fid_t fibril_create | ( | int(*)(void *) | func, | |
void * | arg | |||
) |
fid_t fibril_get_id | ( | void | ) |
void fibril_inc_sercount | ( | void | ) |
Disable preemption.
If the fibril wants to send several message in a row and does not want to be preempted, it should start async_serialize_start() in the beginning of communication and async_serialize_end() in the end. If it is a true multithreaded application, it should protect the communication channel by a futex as well.
static void fibril_main | ( | void | ) | [static] |
Function that spans the whole life-cycle of a fibril.
Each fibril begins execution in this function. Then the function implementing the fibril logic is called. After its return, the return value is saved. The fibril then switches to another fibril, which cleans up after it.
int fibril_switch | ( | fibril_switch_type_t | stype | ) |
Switch from the current fibril.
If calling with FIBRIL_TO_MANAGER parameter, the async_futex should be held.
stype | Switch type. One of FIBRIL_PREEMPT, FIBRIL_TO_MANAGER, FIBRIL_FROM_MANAGER, FIBRIL_FROM_DEAD. The parameter describes the circumstances of the switch. |
1 otherwise.
FILE * fopen | ( | const char * | path, | |
const char * | mode | |||
) |
int fprintf | ( | FILE * | stream, | |
const char * | fmt, | |||
... | ||||
) |
Print formatted text.
stream | Output stream | |
fmt | Format string |
void free | ( | const void * | addr | ) |
int futex_down | ( | futex_t * | futex | ) |
void futex_initialize | ( | futex_t * | futex, | |
int | val | |||
) |
int futex_trydown | ( | futex_t * | futex | ) |
int futex_up | ( | futex_t * | futex | ) |
GENERIC_FIELD_DECLARE | ( | gpm | , | |
packet_map_t | ||||
) |
int getsockopt | ( | int | socket_id, | |
int | level, | |||
int | optname, | |||
void * | value, | |||
size_t * | optlen | |||
) |
Gets socket option.
[in] | socket_id | Socket identifier. |
[in] | level | The socket options level. |
[in] | optname | The socket option to be get. |
[out] | value | The value buffer to be filled. |
[in,out] | optlen | The value buffer length. The maximum length is read. The actual length is set. |
ENOTSOCK if the socket is not found.
EBADMEM if the value or optlen parameter is NULL.
NO_DATA if the optlen parameter is zero.
Other error codes as defined for the NET_SOCKET_GETSOCKOPT message.
Definition at line 1170 of file socket_client.c.
Get time of day.
The time variables are memory mapped (read-only) from kernel which updates them periodically.
As it is impossible to read 2 values atomically, we use a trick: First we read the seconds, then we read the microseconds, then we read the seconds again. If a second elapsed in the meantime, set the microseconds to zero.
This assures that the values returned by two subsequent calls to gettimeofday() are monotonous.
bool gsort | ( | void * | data, | |
size_t | cnt, | |||
size_t | elem_size, | |||
sort_cmp_t | cmp, | |||
void * | arg | |||
) |
Gnome sort wrapper.
This is only a wrapper that takes care of memory allocations for storing the slot element for generic gnome sort algorithm.
data | Pointer to data to be sorted. | |
cnt | Number of elements to be sorted. | |
elem_size | Size of one element. | |
cmp | Comparator function. | |
arg | 3rd argument passed to cmp. |
static void handle_call | ( | ipc_callid_t | callid, | |
ipc_call_t * | call | |||
) | [static] |
void hash_table_apply | ( | hash_table_t * | h, | |
void(*)(link_t *, void *) | f, | |||
void * | arg | |||
) |
Apply fucntion to all items in hash table.
h | Hash table. | |
f | Function to be applied. | |
arg | Argument to be passed to the function. |
Definition at line 202 of file hash_table.c.
bool hash_table_create | ( | hash_table_t * | h, | |
hash_count_t | m, | |||
hash_count_t | max_keys, | |||
hash_table_operations_t * | op | |||
) |
Create chained hash table.
h | Hash table structure. Will be initialized by this call. | |
m | Number of hash table buckets. | |
max_keys | Maximal number of keys needed to identify an item. | |
op | Hash table operations structure. |
Definition at line 56 of file hash_table.c.
void hash_table_destroy | ( | hash_table_t * | h | ) |
Destroy a hash table instance.
h | Hash table to be destroyed. |
Definition at line 85 of file hash_table.c.
link_t * hash_table_find | ( | hash_table_t * | h, | |
unsigned long | key[] | |||
) |
Search hash table for an item matching keys.
h | Hash table. | |
key | Array of all keys needed to compute hash index. |
Definition at line 118 of file hash_table.c.
void hash_table_insert | ( | hash_table_t * | h, | |
unsigned long | key[], | |||
link_t * | item | |||
) |
Insert item into a hash table.
h | Hash table. | |
key | Array of all keys necessary to compute hash index. | |
item | Item to be inserted into the hash table. |
Definition at line 99 of file hash_table.c.
void hash_table_remove | ( | hash_table_t * | h, | |
unsigned long | key[], | |||
hash_count_t | keys | |||
) |
Remove all matching items from hash table.
For each removed item, h->remove_callback() is called.
h | Hash table. | |
key | Array of keys that will be compared against items of the hash table. | |
keys | Number of keys in the 'key' array. |
Definition at line 149 of file hash_table.c.
Split or concatenate headless doubly-linked circular list.
Split or concatenate headless doubly-linked circular list.
Note that the algorithm works both directions: concatenates splitted lists and splits concatenated lists.
part1 | Pointer to link_t structure leading the first (half of the headless) list. | |
part2 | Pointer to link_t structure leading the second (half of the headless) list. |
static void heap_shrink | ( | heap_area_t * | area | ) | [static] |
int icmp_connect_module | ( | suseconds_t | timeout | ) |
Connect to the ICMP module.
[in] | timeout | Connection timeout in microseconds, zero for no timeout. |
ETIMEOUT if the connection timeouted.
Definition at line 54 of file icmp_common.c.
int icmp_echo_msg | ( | int | icmp_phone, | |
size_t | size, | |||
mseconds_t | timeout, | |||
ip_ttl_t | ttl, | |||
ip_tos_t | tos, | |||
int | dont_fragment, | |||
const struct sockaddr * | addr, | |||
socklen_t | addrlen | |||
) |
Requests an echo message.
Sends a packet with specified parameters to the target host and waits for the reply upto the given timeout. Blocks the caller until the reply or the timeout occurs.
[in] | icmp_phone | The ICMP module phone used for (semi)remote calls. |
[in] | size | The message data length in bytes. |
[in] | timeout | The timeout in milliseconds. |
[in] | ttl | The time to live. |
[in] | tos | The type of service. |
[in] | dont_fragment | The value indicating whether the datagram must not be fragmented. Is used as a MTU discovery. |
[in] | addr | The target host address. |
[in] | addrlen | The torget host address length. |
ETIMEOUT if the reply has not arrived before the timeout.
ICMP type of the received error notification.
EINVAL if the addrlen parameter is less or equal to zero.
ENOMEM if there is not enough memory left.
EPARTY if there was an internal error.
Definition at line 75 of file icmp_api.c.
int inet_ntop | ( | uint16_t | family, | |
const uint8_t * | data, | |||
char * | address, | |||
size_t | length | |||
) |
Prints the address into the character buffer.
[in] | family | The address family. |
[in] | data | The address data. |
[out] | address | The character buffer to be filled. |
[in] | length | The buffer length. |
EINVAL if the data or address parameter is NULL.
ENOMEM if the character buffer is not long enough.
ENOTSUP if the address family is not supported.
int inet_pton | ( | uint16_t | family, | |
const char * | address, | |||
uint8_t * | data | |||
) |
Parses the character string into the address.
If the string is shorter than the full address, zero bytes are added.
[in] | family | The address family. |
[in] | address | The character buffer to be parsed. |
[out] | data | The address data to be filled. |
EINVAL if the data parameter is NULL.
ENOENT if the address parameter is NULL.
ENOTSUP if the address family is not supported.
The base number of the values.
The number of bytes per a section.
The number of bytes of the address data.
int iospace_enable | ( | task_id_t | id, | |
void * | ioaddr, | |||
unsigned long | size | |||
) |
Enable I/O space range to task.
Caller of this function must have the IO_MEM_MANAGER capability.
id | Task ID. | |
ioaddr | Starting address of the I/O range. | |
size | Size of the range. |
int klog_printf | ( | const char * | fmt, | |
... | ||||
) |
Print formatted text to klog.
fmt | Format string |
int klog_vprintf | ( | const char * | fmt, | |
va_list | ap | |||
) |
Print formatted text to klog.
fmt | Format string | |
ap | Format parameters |
static void link_initialize | ( | link_t * | link | ) | [inline, static] |
unsigned int list_count | ( | const link_t * | link | ) |
static int list_empty | ( | link_t * | list | ) | [inline, static] |
static void list_initialize | ( | link_t * | list | ) | [inline, static] |
static void list_remove | ( | link_t * | link | ) | [inline, static] |
int listen | ( | int | socket_id, | |
int | backlog | |||
) |
Sets the number of connections waiting to be accepted.
[in] | socket_id | Socket identifier. |
[in] | backlog | The maximum number of waiting sockets to be accepted. |
EINVAL if the backlog parameter is not positive (<=0).
ENOTSOCK if the socket is not found.
Other error codes as defined for the NET_SOCKET_LISTEN message.
Definition at line 582 of file socket_client.c.
void loader_abort | ( | loader_t * | ldr | ) |
Cancel the loader session.
Tells the loader not to load any program and terminate. After using this function, no further operations must be performed on the loader structure. It should be de-allocated using free().
ldr | Loader connection structure. |
int loader_load_program | ( | loader_t * | ldr | ) |
int loader_run | ( | loader_t * | ldr | ) |
Instruct loader to execute the program.
Note that this function blocks until the loader actually replies so you cannot expect this function to return if you are debugging the task and its thread is stopped.
After using this function, no further operations must be performed on the loader structure. It should be de-allocated using free().
ldr | Loader connection structure. |
int loader_set_args | ( | loader_t * | ldr, | |
const char *const | argv[] | |||
) |
Set command-line arguments for the program.
Sets the vector of command-line arguments to be passed to the loaded program. By convention, the very first argument is typically the same as the command used to execute the program.
ldr | Loader connection structure. | |
argv | NULL-terminated array of pointers to arguments. |
int loader_set_cwd | ( | loader_t * | ldr | ) |
int loader_set_files | ( | loader_t * | ldr, | |
fdi_node_t *const | files[] | |||
) |
Set preset files for the program.
Sets the vector of preset files to be passed to the loaded program. By convention, the first three files represent stdin, stdout and stderr respectively.
ldr | Loader connection structure. | |
files | NULL-terminated array of pointers to files. |
int loader_set_pathname | ( | loader_t * | ldr, | |
const char * | path | |||
) |
Set pathname of the program to load.
Sets the name of the program file to load. The name can be relative to the current working directory (it will be absolutized before sending to the loader).
ldr | Loader connection structure. | |
path | Pathname of the program file. |
int loader_spawn | ( | const char * | name | ) |
Connect to a new program loader.
Spawns a new program loader task and returns the connection structure.
name | Symbolic name to set on the newly created task. |
int log_init | ( | const char * | prog_name, | |
log_level_t | level | |||
) |
void log_msg | ( | log_level_t | level, | |
const char * | fmt, | |||
... | ||||
) |
void log_msgv | ( | log_level_t | level, | |
const char * | fmt, | |||
va_list | args | |||
) |
int main | ( | int | argc, | |
char * | argv[] | |||
) |
void * malloc | ( | const size_t | size | ) |
static void* malloc_area | ( | heap_area_t * | area, | |
heap_block_head_t * | first_block, | |||
heap_block_head_t * | final_block, | |||
size_t | real_size, | |||
size_t | falign | |||
) | [static] |
Allocate memory from heap area starting from given block.
Should be called only inside the critical section. As a side effect this function also sets the current pointer on successful allocation.
area | Heap area where to allocate from. | |
first_block | Starting heap block. | |
final_block | Heap block where to finish the search (may be NULL). | |
real_size | Gross number of bytes to allocate. | |
falign | Physical alignment of the block. |
measured_string_t * measured_string_copy | ( | measured_string_t * | source | ) |
Copies the given measured string with separated header and data parts.
[in] | source | The source measured string to be copied. |
NULL if the source parameter is NULL.
NULL if there is not enough memory left.
Definition at line 90 of file measured_strings.c.
measured_string_t * measured_string_create_bulk | ( | const uint8_t * | string, | |
size_t | length | |||
) |
Creates a new measured string bundled with a copy of the given string itself as one memory block.
If the measured string is being freed, whole memory block is freed. The measured string should be used only as a constant.
[in] | string | The initial character string to be stored. |
[in] | length | The length of the given string without the terminating zero ('') character. If the length is zero, the actual length is computed. The given length is used and appended with the terminating zero ('') character otherwise. |
NULL if there is not enough memory left.
Definition at line 61 of file measured_strings.c.
int measured_strings_receive | ( | measured_string_t ** | strings, | |
uint8_t ** | data, | |||
size_t | count | |||
) |
Receives a measured strings array from a calling module.
Creates the array and the data memory blocks. This method should be used only while processing IPC messages as the array size has to be negotiated in advance.
[out] | strings | The received measured strings array. |
[out] | data | The measured strings data. This memory block stores the actual character strings. |
[in] | count | The size of the measured strings array. |
EINVAL if the strings or data parameter is NULL.
EINVAL if the count parameter is zero (0).
EINVAL if the sent array differs in size.
EINVAL if there is inconsistency in sent measured strings' lengths (should not occur).
ENOMEM if there is not enough memory left.
Other error codes as defined for the async_data_write_finalize() function.
Definition at line 133 of file measured_strings.c.
int measured_strings_reply | ( | const measured_string_t * | strings, | |
size_t | count | |||
) |
Replies the given measured strings array to a calling module.
This method should be used only while processing IPC messages as the array size has to be negotiated in advance.
[in] | strings | The measured strings array to be transferred. |
[in] | count | The measured strings array size. |
EINVAL if the strings parameter is NULL.
EINVAL if the count parameter is zero (0).
EINVAL if the calling module does not accept the given array size.
EINVAL if there is inconsistency in sent measured strings' lengths (should not occur).
Other error codes as defined for the async_data_read_finalize() function.
Definition at line 250 of file measured_strings.c.
int measured_strings_return | ( | int | phone, | |
measured_string_t ** | strings, | |||
uint8_t ** | data, | |||
size_t | count | |||
) |
Receives a measured strings array from another module.
Creates the array and the data memory blocks. This method should be used only following other IPC messages as the array size has to be negotiated in advance.
[in] | phone | The other module phone. |
[out] | strings | The returned measured strings array. |
[out] | data | The measured strings data. This memory block stores the actual character strings. |
[in] | count | The size of the measured strings array. |
EINVAL if the strings or data parameter is NULL.
EINVAL if the phone or count parameter is not positive.
EINVAL if the sent array differs in size.
ENOMEM if there is not enough memory left.
Other error codes as defined for the async_data_read_start() function.
Definition at line 313 of file measured_strings.c.
int measured_strings_send | ( | int | phone, | |
const measured_string_t * | strings, | |||
size_t | count | |||
) |
Sends the given measured strings array to another module.
This method should be used only following other IPC messages as the array size has to be negotiated in advance.
[in] | phone | The other module phone. |
[in] | strings | The measured strings array to be transferred. |
[in] | count | The measured strings array size. |
EINVAL if the strings parameter is NULL.
EINVAL if the phone or count parameter is not positive.
Other error codes as defined for the async_data_write_start() function.
Definition at line 387 of file measured_strings.c.
module_t* module_find | ( | const char * | name | ) |
module_t* module_load | ( | const char * | name | ) |
void module_process_relocs | ( | module_t * | m | ) |
void modules_process_relocs | ( | module_t * | start | ) |
static int notification_fibril | ( | void * | arg | ) | [static] |
Notification fibril.
When a notification arrives, a fibril with this implementing function is created. It calls interrupt_received() and does the final cleanup.
arg | Message structure pointer. |
static int packet_is_valid | ( | const packet_t * | packet | ) | [inline, static] |
Returns whether the packet is valid.
[in] | packet | The packet to be checked. |
False otherwise.
Definition at line 130 of file packet_header.h.
int physmem_map | ( | void * | pf, | |
void * | vp, | |||
unsigned long | pages, | |||
int | flags | |||
) |
Map piece of physical memory to task.
Caller of this function must have the CAP_MEM_MANAGER capability.
pf | Physical address of the starting frame. | |
vp | Virtual address of the starting page. | |
pages | Number of pages to map. | |
flags | Flags for the new address space area. |
int pio_enable | ( | void * | pio_addr, | |
size_t | size, | |||
void ** | use_addr | |||
) |
int pm_add | ( | packet_t * | packet | ) |
packet_t * pm_find | ( | packet_id_t | packet_id | ) |
int pm_init | ( | void | ) |
Add packet to the sorted queue.
The queue is sorted in the ascending order. The packet is inserted right before the packets of the same order value.
[in,out] | first | The first packet of the queue. Sets the first packet of the queue. The original first packet may be shifted by the new packet. |
[in] | packet | The packet to be added. |
[in] | order | The packet order value. |
[in] | metric | The metric value of the packet. |
EINVAL if the first parameter is NULL.
EINVAL if the packet is not valid.
Releases the whole queue.
Detaches all packets of the queue and calls the packet_release() for each of them.
[in] | first | The first packet of the queue. |
[in] | packet_release | The releasing function called for each of the packets after its detachment. |
Detach the packet from the queue.
[in] | packet | The packet to be detached. |
NULL if there is no packet left.
NULL if the packet is not valid.
static size_t* prepare_lengths | ( | const measured_string_t * | strings, | |
size_t | count | |||
) | [static] |
Computes the lengths of the measured strings in the given array.
[in] | strings | The measured strings array to be processed. |
[in] | count | The measured strings array size. |
NULL if there is not enough memory left.
Definition at line 214 of file measured_strings.c.
int printf | ( | const char * | fmt, | |
... | ||||
) |
Print formatted text to stdout.
fmt | Format string |
int printf_core | ( | const char * | fmt, | |
printf_spec_t * | ps, | |||
va_list | ap | |||
) |
Print formatted string.
Print string formatted according to the fmt parameter and variadic arguments. Each formatting directive must have the following form:
% [ FLAGS ] [ WIDTH ] [ .PRECISION ] [ TYPE ] CONVERSION
FLAGS:
WIDTH:
PRECISION:
TYPE:
CONVERSION:
All other characters from fmt except the formatting directives are printed verbatim.
fmt | Format NULL-terminated string. |
Definition at line 599 of file printf_core.c.
static bool process_notification | ( | ipc_callid_t | callid, | |
ipc_call_t * | call | |||
) | [static] |
Process interrupt notification.
A new fibril is created which would process the notification.
callid | Hash of the incoming call. | |
call | Data of the incoming call. |
bool qsort | ( | void * | data, | |
size_t | cnt, | |||
size_t | elem_size, | |||
sort_cmp_t | cmp, | |||
void * | arg | |||
) |
Quicksort wrapper.
This is only a wrapper that takes care of memory allocations for storing the pivot and temporary elements for generic quicksort algorithm.
data | Pointer to data to be sorted. | |
cnt | Number of elements to be sorted. | |
elem_size | Size of one element. | |
cmp | Comparator function. | |
arg | 3rd argument passed to cmp. |
void * realloc | ( | const void * | addr, | |
const size_t | size | |||
) |
Receives data via the socket.
[in] | socket_id | Socket identifier. |
[out] | data | The data buffer to be filled. |
[in] | datalength | The data length. |
[in] | flags | Various receive flags. |
Zero if no more data (other side closed the connection).
ENOTSOCK if the socket is not found.
EBADMEM if the data parameter is NULL.
NO_DATA if the datalength parameter is zero.
Other error codes as defined for the NET_SOCKET_RECV message.
Definition at line 1115 of file socket_client.c.
ssize_t recvfrom | ( | int | socket_id, | |
void * | data, | |||
size_t | datalength, | |||
int | flags, | |||
struct sockaddr * | fromaddr, | |||
socklen_t * | addrlen | |||
) |
Receives data via the socket.
[in] | socket_id | Socket identifier. |
[out] | data | The data buffer to be filled. |
[in] | datalength | The data length. |
[in] | flags | Various receive flags. |
[out] | fromaddr | The source address. |
[in,out] | addrlen | The address length. The maximum address length is read. The actual address length is set. |
Zero if no more data (other side closed the connection).
ENOTSOCK if the socket is not found.
EBADMEM if the data or fromaddr parameter is NULL.
NO_DATA if the datalength or addrlen parameter is zero.
Other error codes as defined for the NET_SOCKET_RECVFROM message.
Definition at line 1140 of file socket_client.c.
static ssize_t recvfrom_core | ( | sysarg_t | message, | |
int | socket_id, | |||
void * | data, | |||
size_t | datalength, | |||
int | flags, | |||
struct sockaddr * | fromaddr, | |||
socklen_t * | addrlen | |||
) | [static] |
Receives data via the socket.
[in] | message | The action message. |
[in] | socket_id | Socket identifier. |
[out] | data | The data buffer to be filled. |
[in] | datalength | The data length. |
[in] | flags | Various receive flags. |
[out] | fromaddr | The source address. May be NULL for connected sockets. |
[in,out] | addrlen | The address length. The maximum address length is read. The actual address length is set. Used only if fromaddr is not NULL. |
Zero if no more data (other side closed the connection).
ENOTSOCK if the socket is not found.
EBADMEM if the data parameter is NULL.
NO_DATA if the datalength or addrlen parameter is zero.
Other error codes as defined for the spcific message.
Definition at line 975 of file socket_client.c.
void refresh_answer | ( | ipc_call_t * | answer, | |
size_t * | count | |||
) |
int register_irq | ( | int | inr, | |
int | devno, | |||
int | method, | |||
irq_code_t * | ucode | |||
) |
static void reply_received | ( | void * | arg, | |
int | retval, | |||
ipc_call_t * | data | |||
) | [static] |
Reply received callback.
This function is called whenever a reply for an asynchronous message sent out by the asynchronous framework is received.
Notify the fibril which is waiting for this message that it has arrived.
arg | Pointer to the asynchronous message record. | |
retval | Value returned in the answer. | |
data | Call data of the answer. |
static bool route_call | ( | ipc_callid_t | callid, | |
ipc_call_t * | call | |||
) | [static] |
Try to route a call to an appropriate connection fibril.
If the proper connection fibril is found, a message with the call is added to its message queue. If the fibril was not active, it is activated and all timeouts are unregistered.
callid | Hash of the incoming call. | |
call | Data of the incoming call. |
True if the call was passed to the respective connection fibril.
int send | ( | int | socket_id, | |
void * | data, | |||
size_t | datalength, | |||
int | flags | |||
) |
Sends data via the socket.
[in] | socket_id | Socket identifier. |
[in] | data | The data to be sent. |
[in] | datalength | The data length. |
[in] | flags | Various send flags. |
ENOTSOCK if the socket is not found.
EBADMEM if the data parameter is NULL.
NO_DATA if the datalength parameter is zero.
Other error codes as defined for the NET_SOCKET_SEND message.
Definition at line 916 of file socket_client.c.
int sendto | ( | int | socket_id, | |
const void * | data, | |||
size_t | datalength, | |||
int | flags, | |||
const struct sockaddr * | toaddr, | |||
socklen_t | addrlen | |||
) |
Sends data via the socket to the remote address.
Binds the socket to a free port if not already connected/bound.
[in] | socket_id | Socket identifier. |
[in] | data | The data to be sent. |
[in] | datalength | The data length. |
[in] | flags | Various send flags. |
[in] | toaddr | The destination address. |
[in] | addrlen | The address length. |
ENOTSOCK if the socket is not found.
EBADMEM if the data or toaddr parameter is NULL.
NO_DATA if the datalength or the addrlen parameter is zero.
Other error codes as defined for the NET_SOCKET_SENDTO message.
Definition at line 942 of file socket_client.c.
static int sendto_core | ( | sysarg_t | message, | |
int | socket_id, | |||
const void * | data, | |||
size_t | datalength, | |||
int | flags, | |||
const struct sockaddr * | toaddr, | |||
socklen_t | addrlen | |||
) | [static] |
Sends data via the socket to the remote address.
Binds the socket to a free port if not already connected/bound.
[in] | message | The action message. |
[in] | socket_id | Socket identifier. |
[in] | data | The data to be sent. |
[in] | datalength | The data length. |
[in] | flags | Various send flags. |
[in] | toaddr | The destination address. May be NULL for connected sockets. |
[in] | addrlen | The address length. Used only if toaddr is not NULL. |
ENOTSOCK if the socket is not found.
EBADMEM if the data or toaddr parameter is NULL.
NO_DATA if the datalength or the addrlen parameter is zero (0).
Other error codes as defined for the NET_SOCKET_SENDTO message.
Definition at line 816 of file socket_client.c.
int setsockopt | ( | int | socket_id, | |
int | level, | |||
int | optname, | |||
const void * | value, | |||
size_t | optlen | |||
) |
Sets socket option.
[in] | socket_id | Socket identifier. |
[in] | level | The socket options level. |
[in] | optname | The socket option to be set. |
[in] | value | The value to be set. |
[in] | optlen | The value length. |
ENOTSOCK if the socket is not found.
EBADMEM if the value parameter is NULL.
NO_DATA if the optlen parameter is zero.
Other error codes as defined for the NET_SOCKET_SETSOCKOPT message.
Definition at line 1223 of file socket_client.c.
Eat the extra '.
'.
t | The current TK_DOT token. |
Definition at line 159 of file canonify.c.
Collapse the TK_COMP TK_SLASH TK_DOTDOT pattern.
t | The current TK_DOTDOT token. | |
tlcomp | The last TK_COMP token. |
Definition at line 171 of file canonify.c.
Eat the extra '/'.
t | The current TK_SLASH token. |
Definition at line 148 of file canonify.c.
int snprintf | ( | char * | str, | |
size_t | size, | |||
const char * | fmt, | |||
... | ||||
) |
Print formatted to the given buffer with limited size.
str | Buffer | |
size | Buffer size | |
fmt | Format string |
Definition at line 48 of file snprintf.c.
int socket | ( | int | domain, | |
int | type, | |||
int | protocol | |||
) |
Creates a new socket.
[in] | domain | The socket protocol family. |
[in] | type | Socket type. |
[in] | protocol | Socket protocol. |
EPFNOTSUPPORT if the protocol family is not supported.
ESOCKNOTSUPPORT if the socket type is not supported.
EPROTONOSUPPORT if the protocol is not supported.
ENOMEM if there is not enough memory left.
ELIMIT if there was not a free socket identifier found this time.
Other error codes as defined for the NET_SOCKET message.
Other error codes as defined for the bind_service_timeout() function.
Definition at line 399 of file socket_client.c.
static void socket_connection | ( | ipc_callid_t | iid, | |
ipc_call_t * | icall | |||
) | [static] |
Default thread for new connections.
[in] | iid | The initial message identifier. |
[in] | icall | The initial message call structure. |
Definition at line 205 of file socket_client.c.
static void socket_destroy | ( | socket_t * | socket | ) | [static] |
Clears and destroys the socket.
[in] | socket | The socket to be destroyed. |
Definition at line 741 of file socket_client.c.
static int socket_generate_new_id | ( | void | ) | [static] |
Tries to find a new free socket identifier.
ELIMIT if there is no socket identifier available.
Definition at line 326 of file socket_client.c.
static sockets_t* socket_get_sockets | ( | void | ) | [static] |
Returns the active sockets.
Definition at line 181 of file socket_client.c.
static int socket_get_tcp_phone | ( | void | ) | [static] |
Returns the TCP module phone.
Connects to the TCP module if necessary.
Other error codes as defined for the bind_service_timeout() function.
Definition at line 291 of file socket_client.c.
static int socket_get_udp_phone | ( | void | ) | [static] |
Returns the UDP module phone.
Connects to the UDP module if necessary.
Other error codes as defined for the bind_service_timeout() function.
Definition at line 310 of file socket_client.c.
static void socket_initialize | ( | socket_t * | socket, | |
int | socket_id, | |||
int | phone, | |||
services_t | service | |||
) | [static] |
Initializes a new socket specific data.
[in,out] | socket | The socket to be initialized. |
[in] | socket_id | The new socket identifier. |
[in] | phone | The parent module phone. |
[in] | service | The parent module service. |
Definition at line 368 of file socket_client.c.
static int socket_send_data | ( | int | socket_id, | |
sysarg_t | message, | |||
sysarg_t | arg2, | |||
const void * | data, | |||
size_t | datalength | |||
) | [static] |
Sends message to the socket parent module with specified data.
[in] | socket_id | Socket identifier. |
[in] | message | The action message. |
[in] | arg2 | The second message parameter. |
[in] | data | The data to be sent. |
[in] | datalength | The data length. |
ENOTSOCK if the socket is not found.
EBADMEM if the data parameter is NULL.
NO_DATA if the datalength parameter is zero (0).
Other error codes as defined for the spcific message.
Definition at line 517 of file socket_client.c.
static void split_mark | ( | heap_block_head_t * | cur, | |
const size_t | size | |||
) | [static] |
stats_cpu_t * stats_get_cpus | ( | size_t * | count | ) |
stats_exc_t * stats_get_exception | ( | unsigned int | excn | ) |
stats_exc_t * stats_get_exceptions | ( | size_t * | count | ) |
load_t * stats_get_load | ( | size_t * | count | ) |
stats_physmem_t * stats_get_physmem | ( | void | ) |
stats_task_t * stats_get_task | ( | task_id_t | task_id | ) |
stats_task_t * stats_get_tasks | ( | size_t * | count | ) |
stats_thread_t * stats_get_thread | ( | thread_id_t | thread_id | ) |
stats_thread_t * stats_get_threads | ( | size_t * | count | ) |
sysarg_t stats_get_uptime | ( | void | ) |
void stats_print_load_fragment | ( | load_t | upper, | |
unsigned int | dec_length | |||
) |
void str_append | ( | char * | dest, | |
size_t | size, | |||
const char * | src | |||
) |
Append one string to another.
Append source string src to string in destination buffer dest. Size of the destination buffer is dest. If the size of the output buffer is at least one byte, the output string will always be well-formed, i.e. null-terminated and containing only complete characters.
dest | Destination buffer. | |
count | Size of the destination buffer. | |
src | Source string. |
char * str_chr | ( | const char * | str, | |
wchar_t | ch | |||
) |
int str_cmp | ( | const char * | s1, | |
const char * | s2 | |||
) |
Compare two NULL terminated strings.
Do a char-by-char comparison of two NULL-terminated strings. The strings are considered equal iff they consist of the same characters on the minimum of their lengths.
s1 | First string to compare. | |
s2 | Second string to compare. |
void str_cpy | ( | char * | dest, | |
size_t | size, | |||
const char * | src | |||
) |
Copy string.
Copy source string src to destination buffer dest. No more than size bytes are written. If the size of the output buffer is at least one byte, the output string will always be well-formed, i.e. null-terminated and containing only complete characters.
dest | Destination buffer. | |
count | Size of the destination buffer (must be > 0). | |
src | Source string. |
Decode a single character from a string.
Decode a single character from a string of size size. Decoding starts at offset and this offset is moved to the beginning of the next character. In case of decoding error, offset generally advances at least by one. However, offset is never moved beyond size.
str | String (not necessarily NULL-terminated). | |
offset | Byte offset in string where to start decoding. | |
size | Size of the string (in bytes). |
char * str_dup | ( | const char * | src | ) |
Duplicate string.
Allocate a new string and copy characters from the source string into it. The duplicate string is allocated via sleeping malloc(), thus this function can sleep in no memory conditions.
The allocation cannot fail and the return value is always a valid pointer. The duplicate string is always a well-formed null-terminated UTF-8 string, but it can differ from the source string on the byte level.
src | Source string. |
const char * str_l18_win_locale | ( | l18_win_locales_t | locale | ) |
int str_lcmp | ( | const char * | s1, | |
const char * | s2, | |||
size_t | max_len | |||
) |
Compare two NULL terminated strings with length limit.
Do a char-by-char comparison of two NULL-terminated strings. The strings are considered equal iff they consist of the same characters on the minimum of their lengths and the length limit.
s1 | First string to compare. | |
s2 | Second string to compare. | |
max_len | Maximum number of characters to consider. |
size_t str_length | ( | const char * | str | ) |
Get size of string with length limit.
Get the number of bytes which are used by up to max_len first characters in the string str. If max_len is greater than the length of str, the entire string is measured (excluding the NULL-terminator).
str | String to consider. | |
max_len | Maximum number of characters to measure. |
Copy size-limited substring.
Copy prefix of string src of max. size size to destination buffer dest. No more than size bytes are written. The output string will always be well-formed, i.e. null-terminated and containing only complete characters.
No more than n bytes are read from the input string, so it does not have to be null-terminated.
dest | Destination buffer. | |
count | Size of the destination buffer (must be > 0). | |
src | Source string. | |
n | Maximum number of bytes to read from src. |
char * str_ndup | ( | const char * | src, | |
size_t | n | |||
) |
Duplicate string with size limit.
Allocate a new string and copy up to bytes from the source string into it. The duplicate string is allocated via sleeping malloc(), thus this function can sleep in no memory conditions. No more than + 1 bytes is allocated, but if the size occupied by the source string is smaller than + 1, less is allocated.
The allocation cannot fail and the return value is always a valid pointer. The duplicate string is always a well-formed null-terminated UTF-8 string, but it can differ from the source string on the byte level.
src | Source string. | |
n | Maximum number of bytes to duplicate. |
char * str_rchr | ( | const char * | str, | |
wchar_t | ch | |||
) |
size_t str_size | ( | const char * | str | ) |
int str_size_t | ( | const char * | nptr, | |
char ** | endptr, | |||
unsigned int | base, | |||
bool | strict, | |||
size_t * | result | |||
) |
Convert string to size_t.
nptr | Pointer to string. | |
endptr | If not NULL, pointer to the first invalid character is stored here. | |
base | Zero or number between 2 and 36 inclusive. | |
strict | Do not allow any trailing characters. | |
result | Result of the conversion. |
void str_to_wstr | ( | wchar_t * | dest, | |
size_t | dlen, | |||
const char * | src | |||
) |
Convert string to wide string.
Convert string src to wide string. The output is written to the buffer specified by dest and dlen. dlen must be non-zero and the wide string written will always be null-terminated.
dest | Destination buffer. | |
dlen | Length of destination buffer (number of wchars). | |
src | Source string. |
static int str_uint | ( | const char * | nptr, | |
char ** | endptr, | |||
unsigned int | base, | |||
bool * | neg, | |||
uint64_t * | result | |||
) | [static] |
Convert string to uint64_t (internal variant).
nptr | Pointer to string. | |
endptr | Pointer to the first invalid character is stored here. | |
base | Zero or number between 2 and 36 inclusive. | |
neg | Indication of unary minus is stored here. result Result of the conversion. |
int str_uint64 | ( | const char * | nptr, | |
char ** | endptr, | |||
unsigned int | base, | |||
bool | strict, | |||
uint64_t * | result | |||
) |
Convert string to uint64_t.
nptr | Pointer to string. | |
endptr | If not NULL, pointer to the first invalid character is stored here. | |
base | Zero or number between 2 and 36 inclusive. | |
strict | Do not allow any trailing characters. | |
result | Result of the conversion. |
long int strtol | ( | const char * | nptr, | |
char ** | endptr, | |||
int | base | |||
) |
Convert initial part of string to long int according to given base.
The number may begin with an arbitrary number of whitespaces followed by optional sign (`+' or `-'). If the base is 0 or 16, the prefix `0x' may be inserted and the number will be taken as hexadecimal one. If the base is 0 and the number begin with a zero, number will be taken as octal one (as with base 8). Otherwise the base 0 is taken as decimal.
nptr | Pointer to string. | |
endptr | If not NULL, function stores here pointer to the first invalid character. | |
base | Zero or number between 2 and 36 inclusive. |
unsigned long strtoul | ( | const char * | nptr, | |
char ** | endptr, | |||
int | base | |||
) |
Convert initial part of string to unsigned long according to given base.
The number may begin with an arbitrary number of whitespaces followed by optional sign (`+' or `-'). If the base is 0 or 16, the prefix `0x' may be inserted and the number will be taken as hexadecimal one. If the base is 0 and the number begin with a zero, number will be taken as octal one (as with base 8). Otherwise the base 0 is taken as decimal.
nptr | Pointer to string. | |
endptr | If not NULL, function stores here pointer to the first invalid character | |
base | Zero or number between 2 and 36 inclusive. |
Find the definition of a symbol in a module and its deps.
Search the module dependency graph is breadth-first, beginning from the module start. Thus, and all its dependencies get searched.
name | Name of the symbol to search for. | |
start | Module in which to start the search.. | |
mod | (output) Will be filled with a pointer to the module that contains the symbol. |
Find the definition of a symbol.
By definition in System V ABI, if module origin has the flag DT_SYMBOLIC, origin is searched first. Otherwise, or if the symbol hasn't been found, the module dependency graph is searched breadth-first, beginning from the executable program.
name | Name of the symbol to search for. | |
origin | Module in which the dependency originates. | |
mod | (output) Will be filled with a pointer to the module that contains the symbol. |
void * sysinfo_get_data | ( | const char * | path, | |
size_t * | size | |||
) |
static int sysinfo_get_data_size | ( | const char * | path, | |
size_t * | size | |||
) | [static] |
sysinfo_item_tag_t sysinfo_get_tag | ( | const char * | path | ) |
int sysinfo_get_value | ( | const char * | path, | |
sysarg_t * | value | |||
) |
int task_kill | ( | task_id_t | task_id | ) |
int task_set_name | ( | const char * | name | ) |
int task_spawnl | ( | task_id_t * | task_id, | |
const char * | path, | |||
... | ||||
) |
Create a new task by running an executable from the filesystem.
This is really just a convenience wrapper over the more complicated loader API. Arguments are passed as a null-terminated list of arguments.
id | If not NULL, the ID of the task is stored here on success. | |
path | Pathname of the binary to execute. | |
... | Command-line arguments. |
int task_spawnv | ( | task_id_t * | id, | |
const char * | path, | |||
const char *const | args[] | |||
) |
Create a new task by running an executable from the filesystem.
This is really just a convenience wrapper over the more complicated loader API. Arguments are passed as a null-terminated array of strings.
id | If not NULL, the ID of the task is stored here on success. | |
path | Pathname of the binary to execute. | |
argv | Command-line arguments. |
int thread_create | ( | void(*)(void *) | function, | |
void * | arg, | |||
const char * | name, | |||
thread_id_t * | tid | |||
) |
Create userspace thread.
This function creates new userspace thread and allocates userspace stack and userspace argument structure for it.
function | Function implementing the thread. | |
arg | Argument to be passed to thread. | |
name | Symbolic name of the thread. | |
tid | Thread ID of the newly created thread. |
void thread_detach | ( | thread_id_t | thread | ) |
void thread_exit | ( | int | status | ) |
thread_id_t thread_get_id | ( | void | ) |
int thread_join | ( | thread_id_t | thread | ) |
void tv_add | ( | struct timeval * | tv, | |
suseconds_t | usecs | |||
) |
suseconds_t tv_sub | ( | struct timeval * | tv1, | |
struct timeval * | tv2 | |||
) |
int unregister_irq | ( | int | inr, | |
int | devno | |||
) |
Print formatted text.
stream | Output stream | |
fmt | Format string | |
ap | Format parameters |
static int vfs_exchange_begin | ( | void | ) | [static] |
static void vfs_exchange_end | ( | int | phone | ) | [static] |
int int vprintf | ( | const char * | fmt, | |
va_list | ap | |||
) |
Print formatted text to stdout.
fmt | Format string | |
ap | Format parameters |
static int vsnprintf_str_write | ( | const char * | str, | |
size_t | size, | |||
vsnprintf_data_t * | data | |||
) | [static] |
Write string to given buffer.
Write at most data->size plain characters including trailing zero. According to C99, snprintf() has to return number of characters that would have been written if enough space had been available. Hence the return value is not the number of actually printed characters but size of the input string.
str | Source string to print. | |
size | Number of plain characters in str. | |
data | Structure describing destination string, counter of used space and total string size. |
Definition at line 64 of file vsnprintf.c.
static int vsnprintf_wstr_write | ( | const wchar_t * | str, | |
size_t | size, | |||
vsnprintf_data_t * | data | |||
) | [static] |
Write wide string to given buffer.
Write at most data->size plain characters including trailing zero. According to C99, snprintf() has to return number of characters that would have been written if enough space had been available. Hence the return value is not the number of actually printed characters but size of the input string.
str | Source wide string to print. | |
size | Number of bytes in str. | |
data | Structure describing destination string, counter of used space and total string size. |
Definition at line 131 of file vsnprintf.c.
size_t wstr_length | ( | const wchar_t * | wstr | ) |
Insert a wide character into a wide string.
Insert a wide character into a wide string at position pos. The characters after the position are shifted.
str | String to insert to. | |
ch | Character to insert to. | |
pos | Character index where to insert. @param max_pos Characters in the buffer. |
Get size of wide string with length limit.
Get the number of bytes which are used by up to max_len first wide characters in the wide string str. If max_len is greater than the length of str, the entire wide string is measured (excluding the NULL-terminator).
str | Wide string to consider. | |
max_len | Maximum number of wide characters to measure. |
Remove a wide character from a wide string.
Remove a wide character from a wide string at position pos. The characters after the position are shifted.
str | String to remove from. | |
pos | Character index to remove. |
size_t wstr_size | ( | const wchar_t * | str | ) |
char * wstr_to_astr | ( | const wchar_t * | src | ) |
void wstr_to_str | ( | char * | dest, | |
size_t | size, | |||
const wchar_t * | src | |||
) |
Convert wide string to string.
Convert wide string src to string. The output is written to the buffer specified by dest and size. size must be non-zero and the string written will always be well-formed.
dest | Destination buffer. | |
size | Size of the destination buffer. | |
src | Source wide string. |
fibril_local int serialization_count [static] |
int serialized_threads [static] |