generic
[Libc]


Files

file  align.h
file  as.h
file  assert.h
file  async.h
file  include/atomic.h
file  cap.h
file  ctype.h
file  ddi.h
file  include/endian.h
file  err.h
file  errno.h
file  futex.h
file  io.h
file  printf_core.h
file  stream.h
file  fifo.h
file  hash_table.h
file  list.h
file  libc.h
file  include/limits.h
file  include/psthread.h
file  stdarg.h
file  stddef.h
file  stdint.h
file  stdio.h
file  stdlib.h
file  string.h
file  mman.h
file  sys/time.h
file  include/sys/types.h
file  sysinfo.h
file  task.h
file  include/thread.h
file  time.h
file  unistd.h
file  as.c
file  async.c
file  cap.c
 Functions to grant/revoke capabilities to/from a task.
file  ddi.c
file  err.c
file  futex.c
file  io.c
file  printf.c
file  printf_core.c
 Printing functions.
file  snprintf.c
file  sprintf.c
file  stream.c
file  vprintf.c
file  vsnprintf.c
file  vsprintf.c
file  hash_table.c
file  list.c
file  libc.c
file  mmap.c
file  psthread.c
file  stdlib.c
file  string.c
file  sysinfo.c
file  task.c
file  generic/thread.c
file  time.c

Modules

 IPC
 HelenOS uspace IPC.
 malloc
 Malloc originally written by Doug Lea and ported to HelenOS.

Data Structures

struct  atomic
struct  printf_spec
struct  hash_table
struct  hash_table_operations
struct  link
struct  psthread_data
struct  timeval
struct  timezone
struct  awaiter_t
struct  amsg_t
struct  msg_t
struct  connection_t
struct  stream_t
struct  vsnprintf_data
struct  along

Defines

#define ALIGN_DOWN(s, a)   ((s) & ~((a) - 1))
#define ALIGN_UP(s, a)   ((long)((s) + ((a) - 1)) & ~((long) (a) - 1))
#define USER_ADDRESS_SPACE_SIZE_ARCH   (USER_ADDRESS_SPACE_END_ARCH-USER_ADDRESS_SPACE_START_ARCH+1)
#define assert(expr)   if (!(expr)) { printf("Assertion failed (%s) at file '%s', line %d.\n", #expr, __FILE__, __LINE__); abort();}
#define async_req(phoneid, method, arg1, r1)   async_req_2(phoneid, method, arg1, 0, r1, 0)
#define async_msg(ph, m, a1)   async_msg_2(ph,m,a1,0)
#define __LITTLE_ENDIAN   1234
#define __BIG_ENDIAN   4321
#define __PDP_ENDIAN   3412
#define errx(status, fmt,)
#define FUTEX_INITIALIZER   {1}
#define EMFILE   -17
#define FIFO_CREATE_STATIC(name, t, itms)
#define FIFO_INITIALIZE_STATIC(name, t, itms)
#define FIFO_INITIALIZE_DYNAMIC(name, t, itms)
#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)
#define fifo_create(name)   name.fifo = malloc(sizeof(*name.fifo) * name.items)
#define hash_table_get_instance(item, type, member)   list_get_instance((item), type, member)
#define true   1
#define false   0
#define LIST_INITIALIZE(name)   link_t name = { .prev = &name, .next = &name }
#define list_get_instance(link, type, member)   (type *)(((char *)(link))-((char *)&(((type *)NULL)->member)))
#define __SYSCALL0(id)   __syscall(0, 0, 0, 0, id)
#define __SYSCALL1(id, p1)   __syscall(p1, 0, 0, 0, id)
#define __SYSCALL2(id, p1, p2)   __syscall(p1, p2, 0, 0, id)
#define __SYSCALL3(id, p1, p2, p3)   __syscall(p1, p2, p3, 0, id)
#define __SYSCALL4(id, p1, p2, p3, p4)   __syscall(p1, p2, p3, p4, id)
#define SCHAR_MIN   MIN_INT8
#define SCHAR_MAX   MAX_INT8
#define UCHAR_MIN   MIN_UINT8
#define UCHAR_MAX   MAX_UINT8
#define CHAR_MIN   SCHAR_MIN
#define CHAR_MAX   SCHAR_MAX
#define SHRT_MIN   MIN_INT16
#define SHRT_MAX   MAX_INT16
#define USHRT_MIN   MIN_UINT16
#define USHRT_MAX   MAX_UINT16
#define INT_MIN   MIN_INT32
#define INT_MAX   MAX_INT32
#define UINT_MIN   MIN_UINT32
#define UINT_MAX   MAX_UINT32
#define LLONG_MIN   MIN_INT64
#define LLONG_MAX   MAX_INT64
#define ULLONG_MIN   MIN_UINT64
#define ULLONG_MAX   MAX_UINT64
#define context_set(c, _pc, stack, size, ptls)
#define PSTHREAD_SERIALIZED   1
#define va_start(ap, last)   __builtin_va_start(ap, last)
#define va_arg(ap, type)   __builtin_va_arg(ap, type)
#define va_end(ap)   __builtin_va_end(ap)
#define MAX_INT8   (0x7F)
#define MIN_INT8   (0x80)
#define MAX_UINT8   (0xFFu)
#define MIN_UINT8   (0u)
#define MAX_INT16   (0x7FFF)
#define MIN_INT16   (0x8000)
#define MAX_UINT16   (0xFFFFu)
#define MIN_UINT16   (0u)
#define MAX_INT32   (0x7FFFFFFF)
#define MIN_INT32   (0x80000000)
#define MAX_UINT32   (0xFFFFFFFFu)
#define MIN_UINT32   (0u)
#define MAX_INT64   (0x7FFFFFFFFFFFFFFFll)
#define MIN_INT64   (0x8000000000000000ll)
#define MAX_UINT64   (0xFFFFFFFFFFFFFFFFull)
#define MIN_UINT64   (0ull)
#define EOF   (-1)
#define fprintf(f, fmt,)   printf(fmt, ##__VA_ARGS__)
#define abort()   _exit(1)
#define exit(status)   _exit((status))
#define RAND_MAX   714025
#define bzero(ptr, len)   memset((ptr), 0, (len))
#define MAP_FAILED   ((void *) -1)
#define MAP_SHARED   (1 << 0)
#define MAP_PRIVATE   (1 << 1)
#define MAP_FIXED   (1 << 2)
#define MAP_ANONYMOUS   (1 << 3)
#define PROTO_READ   AS_AREA_READ
#define PROTO_WRITE   AS_AREA_WRITE
#define PROTO_EXEC   AS_AREA_EXEC
#define DST_NONE   0
#define NULL   0
#define getpagesize()   (PAGE_SIZE)
#define CONN_HASH_TABLE_CHAINS   32
#define __PRINTF_FLAG_PREFIX   0x00000001
#define __PRINTF_FLAG_SIGNED   0x00000002
#define __PRINTF_FLAG_ZEROPADDED   0x00000004
#define __PRINTF_FLAG_LEFTALIGNED   0x00000010
#define __PRINTF_FLAG_SHOWPLUS   0x00000020
#define __PRINTF_FLAG_SPACESIGN   0x00000040
#define __PRINTF_FLAG_BIGCHARS   0x00000080
#define __PRINTF_FLAG_NEGATIVE   0x00000100
#define PRINT_NUMBER_BUFFER_SIZE   (64+5)
#define FDS   32
#define PSTHREAD_INITIAL_STACK_PAGES_NO   1
#define THREAD_INITIAL_STACK_PAGES_NO   1

Typedefs

typedef ipc_callid_t aid_t
typedef void(* async_client_conn_t )(ipc_callid_t callid, ipc_call_t *call)
typedef atomic atomic_t
typedef int fd_t
typedef ssize_t(* pwritefn_t )(void *, const void *, size_t)
typedef ssize_t(* preadfn_t )(void *, void *, size_t)
typedef unsigned long fifo_count_t
typedef unsigned long fifo_index_t
typedef unsigned long hash_count_t
typedef unsigned long hash_index_t
typedef hash_table hash_table_t
typedef hash_table_operations hash_table_operations_t
typedef link link_t
typedef sysarg_t pstid_t
typedef psthread_data psthread_data_t
typedef __builtin_va_list va_list
typedef long time_t
typedef long suseconds_t
typedef uint64_t task_id_t

Enumerations

enum  pschange_type { PS_TO_MANAGER, PS_FROM_MANAGER, PS_PREEMPT, PS_FROM_DEAD }
enum  qualifier_t {
  PrintfQualifierByte = 0, PrintfQualifierShort, PrintfQualifierInt, PrintfQualifierLong,
  PrintfQualifierLongLong, PrintfQualifierSizeT, PrintfQualifierPointer
}

Functions

void * as_area_create (void *address, size_t size, int flags)
int as_area_resize (void *address, size_t size, int flags)
int as_area_destroy (void *address)
void * set_maxheapsize (size_t mhs)
void * as_get_mappable_page (size_t sz)
static void async_manager (void)
ipc_callid_t async_get_call_timeout (ipc_call_t *call, suseconds_t usecs)
static ipc_callid_t async_get_call (ipc_call_t *data)
aid_t async_send_2 (int phoneid, ipcarg_t method, ipcarg_t arg1, ipcarg_t arg2, ipc_call_t *dataptr)
aid_t async_send_3 (int phoneid, ipcarg_t method, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, ipc_call_t *dataptr)
void async_wait_for (aid_t amsgid, ipcarg_t *result)
int async_wait_timeout (aid_t amsgid, ipcarg_t *retval, suseconds_t timeout)
static ipcarg_t async_req_2 (int phoneid, ipcarg_t method, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t *r1, ipcarg_t *r2)
static ipcarg_t async_req_3 (int phoneid, ipcarg_t method, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, ipcarg_t *r1, ipcarg_t *r2, ipcarg_t *r3)
pstid_t async_new_connection (ipcarg_t in_phone_hash, ipc_callid_t callid, ipc_call_t *call, void(*cthread)(ipc_callid_t, ipc_call_t *))
void async_usleep (suseconds_t timeout)
void async_create_manager (void)
void async_destroy_manager (void)
void async_set_client_connection (async_client_conn_t conn)
void async_set_interrupt_received (async_client_conn_t conn)
int _async_init (void)
void async_msg_3 (int phoneid, ipcarg_t method, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3)
void async_msg_2 (int phoneid, ipcarg_t method, ipcarg_t arg1, ipcarg_t arg2)
static void async_serialize_start (void)
static void async_serialize_end (void)
static void atomic_set (atomic_t *val, long i)
static long atomic_get (atomic_t *val)
int cap_grant (task_id_t id, unsigned int caps)
int cap_revoke (task_id_t id, unsigned int caps)
static int isdigit (int c)
static int isspace (int c)
int map_physmem (void *pf, void *vp, unsigned long pages, int flags)
int iospace_enable (task_id_t id, void *ioaddr, unsigned long size)
int preemption_control (int enable)
void futex_initialize (atomic_t *futex, int value)
int futex_down (atomic_t *futex)
int futex_trydown (atomic_t *futex)
int futex_down_timeout (atomic_t *futex, uint32_t usec, int flags)
int futex_up (atomic_t *futex)
int putnchars (const char *buf, size_t count)
int putstr (const char *str)
int putchar (int c)
int getchar (void)
int printf_core (const char *fmt, struct printf_spec *ps, va_list ap)
fd_t open (const char *fname, int flags)
int get_fd_phone (int fd)
int hash_table_create (hash_table_t *h, hash_count_t m, hash_count_t max_keys, hash_table_operations_t *op)
void hash_table_insert (hash_table_t *h, unsigned long key[], link_t *item)
link_thash_table_find (hash_table_t *h, unsigned long key[])
void hash_table_remove (hash_table_t *h, unsigned long key[], hash_count_t keys)
static void link_initialize (link_t *link)
static void list_initialize (link_t *head)
static void list_prepend (link_t *link, link_t *head)
static void list_append (link_t *link, link_t *head)
static void list_remove (link_t *link)
static int list_empty (link_t *head)
static void headless_list_split_or_concat (link_t *part1, link_t *part2)
static void headless_list_split (link_t *part1, link_t *part2)
static void headless_list_concat (link_t *part1, link_t *part2)
int list_member (const link_t *link, const link_t *head)
void list_concat (link_t *head1, link_t *head2)
void __main (void)
void __io_init (void)
void __exit (void)
sysarg_t __syscall (const sysarg_t p1, const sysarg_t p2, const sysarg_t p3, const sysarg_t p4, const syscall_t id)
int context_save (context_t *c)
void context_restore (context_t *c) __attribute__((noreturn))
pstid_t psthread_create (int(*func)(void *), void *arg)
int psthread_join (pstid_t psthrid)
psthread_data_tpsthread_setup (void)
void psthread_teardown (psthread_data_t *pt)
int psthread_schedule_next_adv (pschange_type ctype)
void psthread_add_ready (pstid_t ptid)
void psthread_add_manager (pstid_t psthrid)
void psthread_remove_manager (void)
pstid_t psthread_get_id (void)
void psthread_inc_sercount (void)
void psthread_dec_sercount (void)
static int psthread_schedule_next ()
int puts (const char *str)
int printf (const char *fmt,...)
int sprintf (char *str, const char *fmt,...)
int snprintf (char *str, size_t size, const char *fmt,...)
int vprintf (const char *fmt, va_list ap)
int vsprintf (char *str, const char *fmt, va_list ap)
int vsnprintf (char *str, size_t size, const char *fmt, va_list ap)
long int random (void)
void srandom (unsigned int seed)
static int rand (void)
static void srand (unsigned int seed)
void * memset (void *s, int c, size_t n)
void * memcpy (void *dest, const void *src, size_t n)
void * memmove (void *dest, const void *src, size_t n)
int strcmp (const char *, const char *)
char * strcpy (char *dest, const char *src)
char * strncpy (char *dest, const char *src, size_t n)
size_t strlen (const char *str)
char * strchr (const char *str, int c)
char * strrchr (const char *str, int c)
long int strtol (const char *nptr, char **endptr, int base)
unsigned long strtoul (const char *nptr, char **endptr, int base)
void * mmap (void *start, size_t length, int prot, int flags, int fd, off_t offset)
int munmap (void *start, size_t length)
int gettimeofday (struct timeval *tv, struct timezone *tz)
sysarg_t sysinfo_value (char *name)
task_id_t task_get_id (void)
void __thread_entry (void)
void __thread_main (uspace_arg_t *uarg)
int thread_create (void(*function)(void *arg), void *arg, char *name)
void thread_exit (int status)
tcb_t__make_tls (void)
tcb_t__alloc_tls (void **data, size_t size)
void __free_tls (tcb_t *)
void __free_tls_arch (tcb_t *, size_t size)
ssize_t write (int fd, const void *buf, size_t count)
ssize_t read (int fd, void *buf, size_t count)
void _exit (int status)
void * sbrk (ssize_t incr)
void usleep (unsigned long usec)
static LIST_INITIALIZE (timeout_list)
static void default_client_connection (ipc_callid_t callid, ipc_call_t *call)
static void default_interrupt_received (ipc_callid_t callid, ipc_call_t *call)
static void tv_add (struct timeval *tv, suseconds_t usecs)
static suseconds_t tv_sub (struct timeval *tv1, struct timeval *tv2)
static int tv_gt (struct timeval *tv1, struct timeval *tv2)
static int tv_gteq (struct timeval *tv1, struct timeval *tv2)
static hash_index_t conn_hash (unsigned long *key)
static int conn_compare (unsigned long key[], hash_count_t keys, link_t *item)
static void conn_remove (link_t *item)
static void insert_timeout (awaiter_t *wd)
static int route_call (ipc_callid_t callid, ipc_call_t *call)
static int connection_thread (void *arg)
static void handle_call (ipc_callid_t callid, ipc_call_t *call)
static void handle_expired_timeouts (void)
static int async_manager_worker (void)
static int async_manager_thread (void *arg)
static void reply_received (void *private, int retval, ipc_call_t *data)
static int printf_putnchars (const char *buf, size_t count, struct printf_spec *ps)
static int printf_putstr (const char *str, struct printf_spec *ps)
static int printf_putchar (int c, struct printf_spec *ps)
static int print_char (char c, int width, uint64_t flags, struct printf_spec *ps)
static int print_string (char *s, int width, int precision, uint64_t flags, struct printf_spec *ps)
static int print_number (uint64_t num, int width, int precision, int base, uint64_t flags, struct printf_spec *ps)
static ssize_t write_stderr (void *param, const void *buf, size_t count)
static ssize_t read_stdin (void *param, void *buf, size_t count)
static ssize_t write_stdout (void *param, const void *buf, size_t count)
static stream_t open_stdin (void)
static stream_t open_stdout (void)
static ssize_t write_null (void *param, const void *buf, size_t count)
int vprintf_write (const char *str, size_t count, void *unused)
int vsnprintf_write (const char *str, size_t count, struct vsnprintf_data *data)
static LIST_INITIALIZE (ready_list)
static LIST_INITIALIZE (serialized_list)
static LIST_INITIALIZE (manager_list)
static void psthread_main (void)
static void * unaligned_memcpy (void *dst, const void *src, size_t n)
static unsigned long _strtoul (const char *nptr, char **endptr, int base, char *sgn)
static LIST_INITIALIZE (thread_garbage)
int thread_create (void(*function)(void *), void *arg, char *name)

Variables

atomic_t async_futex
static size_t heapsize = 0
static size_t maxheapsize = (size_t) (-1)
static void * last_allocated = 0
char _heap
atomic_t async_futex = FUTEX_INITIALIZER
static hash_table_t conn_hash_table
__thread connection_tPS_connection
__thread int in_interrupt_handler
static async_client_conn_t client_connection = default_client_connection
static async_client_conn_t interrupt_received = default_interrupt_received
static hash_table_operations_t conn_hash_table_ops
static char nl = '\n'
static char digits_small [] = "0123456789abcdef"
static char digits_big [] = "0123456789ABCDEF"
static int console_phone = -1
static stream_t streams [FDS]
char _heap
static atomic_t psthread_futex = FUTEX_INITIALIZER
static int serialized_threads
static __thread int serialization_count
static int threads_in_manager
static long glbl_seed = 1
along packed
char _tdata_start
char _tdata_end
char _tbss_start
char _tbss_end
struct {
   int   phone
   ipcarg_t   rows
   ipcarg_t   cols
   volatile sysarg_t   seconds1
   volatile sysarg_t   useconds
   volatile sysarg_t   seconds2
ktime

Define Documentation

#define ALIGN_DOWN s,
 )     ((s) & ~((a) - 1))
 

Align to the nearest lower address.

Parameters:
s Address or size to be aligned.
a Size of alignment, must be power of 2.

Definition at line 43 of file align.h.

Referenced by gcons_init().

#define ALIGN_UP s,
 )     ((long)((s) + ((a) - 1)) & ~((long) (a) - 1))
 

Align to the nearest higher address.

Parameters:
s Address or size to be aligned.
a Size of alignment, must be power of 2.

Definition at line 51 of file align.h.

Referenced by as_get_mappable_page().

#define USER_ADDRESS_SPACE_SIZE_ARCH   (USER_ADDRESS_SPACE_END_ARCH-USER_ADDRESS_SPACE_START_ARCH+1)
 

Definition at line 43 of file as.h.

Referenced by as_get_mappable_page().

#define assert expr   )     if (!(expr)) { printf("Assertion failed (%s) at file '%s', line %d.\n", #expr, __FILE__, __LINE__); abort();}
 

Debugging assert macro

If NDEBUG is not set, the assert() macro evaluates expr and if it is false prints error message and terminate program.

Parameters:
expr Expression which is expected to be true.

Definition at line 51 of file assert.h.

Referenced by add_segment(), async_get_call_timeout(), conn_hash(), dlmalloc(), hash_table_create(), hash_table_find(), hash_table_insert(), hash_table_remove(), ialloc(), internal_memalign(), mmap_alloc(), ns_compare(), ns_hash(), ns_remove(), prepend_alloc(), release_unused_segments(), and tmalloc_small().

#define async_req phoneid,
method,
arg1,
r1   )     async_req_2(phoneid, method, arg1, 0, r1, 0)
 

Definition at line 83 of file async.h.

Referenced by main(), make_anim(), make_pixmap(), and switch_screens().

#define async_msg ph,
m,
a1   )     async_msg_2(ph,m,a1,0)
 

Definition at line 119 of file async.h.

Referenced by clear(), client_connection(), clrscr(), curs_visibility(), draw_pixmap(), gcons_change_console(), gcons_in_kernel(), irq_handler(), make_anim(), make_pixmap(), switch_screens(), vp_switch(), write_char(), and write_stdout().

#define __LITTLE_ENDIAN   1234
 

Definition at line 38 of file include/endian.h.

#define __BIG_ENDIAN   4321
 

Definition at line 39 of file include/endian.h.

#define __PDP_ENDIAN   3412
 

Definition at line 40 of file include/endian.h.

#define errx status,
fmt   ) 
 

Value:

{ \
        printf((fmt), ##__VA_ARGS__); \
        _exit(status); \
}

Definition at line 38 of file err.h.

#define FUTEX_INITIALIZER   {1}
 

Definition at line 41 of file futex.h.

Referenced by usleep().

#define EMFILE   -17
 

Definition at line 40 of file stream.h.

Referenced by open().

#define FIFO_CREATE_STATIC name,
t,
itms   ) 
 

Value:

struct {                                        \
                t fifo[(itms)];                         \
                fifo_count_t items;                     \
                fifo_index_t head;                      \
                fifo_index_t tail;                      \
        } name

Definition at line 53 of file fifo.h.

#define FIFO_INITIALIZE_STATIC name,
t,
itms   ) 
 

Value:

FIFO_CREATE_STATIC(name, t, itms) = {           \
                .items = (itms),                        \
                .head = 0,                              \
                .tail = 0                               \
        }
Create and initialize static FIFO.

FIFO is allocated statically. This macro is suitable for creating smaller FIFOs.

Parameters:
name Name of FIFO.
t Type of values stored in FIFO.
itms Number of items that can be stored in FIFO.

Definition at line 70 of file fifo.h.

#define FIFO_INITIALIZE_DYNAMIC name,
t,
itms   ) 
 

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                               \
        }
Create and prepare dynamic FIFO.

FIFO is allocated dynamically. This macro is suitable for creating larger FIFOs.

Parameters:
name Name of FIFO.
t Type of values stored in FIFO.
itms Number of items that can be stored in FIFO.

Definition at line 86 of file fifo.h.

#define fifo_pop name   )     name.fifo[name.head = (name.head + 1) < name.items ? (name.head + 1) : 0]
 

Pop value from head of FIFO.

Parameters:
name FIFO name.
Returns:
Leading value in FIFO.

Definition at line 105 of file fifo.h.

Referenced by client_connection(), and keyboard_events().

#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.

Parameters:
name FIFO name.
value Value to be appended to FIFO.

Definition at line 114 of file fifo.h.

Referenced by client_connection().

#define fifo_create name   )     name.fifo = malloc(sizeof(*name.fifo) * name.items)
 

Allocate memory for dynamic FIFO.

Parameters:
name FIFO name.

Definition at line 121 of file fifo.h.

#define hash_table_get_instance item,
type,
member   )     list_get_instance((item), type, member)
 

Definition at line 79 of file hash_table.h.

Referenced by conn_compare(), conn_remove(), connect_to_service(), ns_compare(), ns_remove(), and route_call().

#define true   1
 

Definition at line 41 of file list.h.

#define false   0
 

Definition at line 44 of file list.h.

#define LIST_INITIALIZE name   )     link_t name = { .prev = &name, .next = &name }
 

Declare and initialize statically allocated list.

Parameters:
name Name of the new statically allocated list.

Definition at line 59 of file list.h.

#define list_get_instance link,
type,
member   )     (type *)(((char *)(link))-((char *)&(((type *)NULL)->member)))
 

Definition at line 186 of file list.h.

Referenced by async_get_call_timeout(), async_manager_worker(), connection_thread(), handle_answer(), handle_expired_timeouts(), insert_timeout(), psthread_schedule_next_adv(), and try_dispatch_queued_calls().

#define __SYSCALL0 id   )     __syscall(0, 0, 0, 0, id)
 

Definition at line 41 of file libc.h.

Referenced by change_console(), and kbd_arch_process().

#define __SYSCALL1 id,
p1   )     __syscall(p1, 0, 0, 0, id)
 

Definition at line 42 of file libc.h.

Referenced by as_area_destroy(), futex_up(), iospace_enable(), ipc_hangup(), ipc_unregister_irq(), preemption_control(), task_get_id(), and thread_exit().

#define __SYSCALL2 id,
p1,
p2   )     __syscall(p1, p2, 0, 0, id)
 

Definition at line 43 of file libc.h.

Referenced by _ipc_call_async(), cap_grant(), cap_revoke(), ipc_answer(), ipc_register_irq(), sysinfo_value(), and thread_create().

#define __SYSCALL3 id,
p1,
p2,
p3   )     __syscall(p1, p2, p3, 0, id)
 

Definition at line 44 of file libc.h.

Referenced by as_area_create(), as_area_resize(), futex_down_timeout(), ipc_call_sync_3(), ipc_wait_cycle(), and sysput().

#define __SYSCALL4 id,
p1,
p2,
p3,
p4   )     __syscall(p1, p2, p3, p4, id)
 

Definition at line 45 of file libc.h.

Referenced by ipc_answer_fast(), ipc_call_async_2(), ipc_call_sync(), ipc_forward_fast(), and map_physmem().

#define SCHAR_MIN   MIN_INT8
 

Definition at line 42 of file include/limits.h.

#define SCHAR_MAX   MAX_INT8
 

Definition at line 43 of file include/limits.h.

#define UCHAR_MIN   MIN_UINT8
 

Definition at line 44 of file include/limits.h.

#define UCHAR_MAX   MAX_UINT8
 

Definition at line 45 of file include/limits.h.

#define CHAR_MIN   SCHAR_MIN
 

Definition at line 51 of file include/limits.h.

#define CHAR_MAX   SCHAR_MAX
 

Definition at line 52 of file include/limits.h.

#define SHRT_MIN   MIN_INT16
 

Definition at line 56 of file include/limits.h.

#define SHRT_MAX   MAX_INT16
 

Definition at line 57 of file include/limits.h.

#define USHRT_MIN   MIN_UINT16
 

Definition at line 58 of file include/limits.h.

#define USHRT_MAX   MAX_UINT16
 

Definition at line 59 of file include/limits.h.

#define INT_MIN   MIN_INT32
 

Definition at line 61 of file include/limits.h.

#define INT_MAX   MAX_INT32
 

Definition at line 62 of file include/limits.h.

#define UINT_MIN   MIN_UINT32
 

Definition at line 63 of file include/limits.h.

#define UINT_MAX   MAX_UINT32
 

Definition at line 64 of file include/limits.h.

#define LLONG_MIN   MIN_INT64
 

Definition at line 66 of file include/limits.h.

#define LLONG_MAX   MAX_INT64
 

Definition at line 67 of file include/limits.h.

#define ULLONG_MIN   MIN_UINT64
 

Definition at line 68 of file include/limits.h.

#define ULLONG_MAX   MAX_UINT64
 

Definition at line 69 of file include/limits.h.

#define context_set c,
_pc,
stack,
size,
ptls   ) 
 

Value:

(c)->pc = (sysarg_t) (_pc);                             \
        (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA;     \
        (c)->tls = (sysarg_t) (ptls);

Definition at line 43 of file include/psthread.h.

#define PSTHREAD_SERIALIZED   1
 

Definition at line 49 of file include/psthread.h.

Referenced by psthread_add_ready(), and psthread_schedule_next_adv().

#define va_start ap,
last   )     __builtin_va_start(ap, last)
 

Definition at line 46 of file stdarg.h.

Referenced by printf(), snprintf(), and sprintf().

#define va_arg ap,
type   )     __builtin_va_arg(ap, type)
 

Definition at line 47 of file stdarg.h.

Referenced by printf_core().

#define va_end ap   )     __builtin_va_end(ap)
 

Definition at line 48 of file stdarg.h.

Referenced by printf(), snprintf(), and sprintf().

#define MAX_INT8   (0x7F)
 

Definition at line 41 of file stdint.h.

#define MIN_INT8   (0x80)
 

Definition at line 42 of file stdint.h.

#define MAX_UINT8   (0xFFu)
 

Definition at line 43 of file stdint.h.

#define MIN_UINT8   (0u)
 

Definition at line 44 of file stdint.h.

#define MAX_INT16   (0x7FFF)
 

Definition at line 46 of file stdint.h.

#define MIN_INT16   (0x8000)
 

Definition at line 47 of file stdint.h.

#define MAX_UINT16   (0xFFFFu)
 

Definition at line 48 of file stdint.h.

#define MIN_UINT16   (0u)
 

Definition at line 49 of file stdint.h.

#define MAX_INT32   (0x7FFFFFFF)
 

Definition at line 51 of file stdint.h.

Referenced by float32_to_int32(), and float64_to_int32().

#define MIN_INT32   (0x80000000)
 

Definition at line 52 of file stdint.h.

Referenced by float32_to_int32(), and float64_to_int32().

#define MAX_UINT32   (0xFFFFFFFFu)
 

Definition at line 53 of file stdint.h.

Referenced by float32_to_uint32(), and float64_to_uint32().

#define MIN_UINT32   (0u)
 

Definition at line 54 of file stdint.h.

Referenced by float32_to_uint32(), and float64_to_uint32().

#define MAX_INT64   (0x7FFFFFFFFFFFFFFFll)
 

Definition at line 56 of file stdint.h.

Referenced by float32_to_int64(), and float64_to_int64().

#define MIN_INT64   (0x8000000000000000ll)
 

Definition at line 57 of file stdint.h.

Referenced by float32_to_int64(), and float64_to_int64().

#define MAX_UINT64   (0xFFFFFFFFFFFFFFFFull)
 

Definition at line 58 of file stdint.h.

Referenced by float32_to_uint64(), and float64_to_uint64().

#define MIN_UINT64   (0ull)
 

Definition at line 59 of file stdint.h.

Referenced by float32_to_uint64(), and float64_to_uint64().

#define EOF   (-1)
 

Definition at line 41 of file stdio.h.

Referenced by getchar(), putchar(), and putnchars().

#define fprintf f,
fmt   )     printf(fmt, ##__VA_ARGS__)
 

Definition at line 58 of file stdio.h.

Referenced by internal_malloc_stats().

 
#define abort  )     _exit(1)
 

Definition at line 41 of file stdlib.h.

#define exit status   )     _exit((status))
 

Definition at line 42 of file stdlib.h.

Referenced by draw_pixmap(), and make_pixmap().

#define RAND_MAX   714025
 

Definition at line 44 of file stdlib.h.

Referenced by random().

#define bzero ptr,
len   )     memset((ptr), 0, (len))
 

Definition at line 41 of file string.h.

#define MAP_FAILED   ((void *) -1)
 

Definition at line 40 of file mman.h.

Referenced by draw_pixmap(), make_pixmap(), and mmap().

#define MAP_SHARED   (1 << 0)
 

Definition at line 42 of file mman.h.

Referenced by draw_pixmap(), and make_pixmap().

#define MAP_PRIVATE   (1 << 1)
 

Definition at line 43 of file mman.h.

#define MAP_FIXED   (1 << 2)
 

Definition at line 44 of file mman.h.

#define MAP_ANONYMOUS   (1 << 3)
 

Definition at line 45 of file mman.h.

Referenced by draw_pixmap(), make_pixmap(), and mmap().

#define PROTO_READ   AS_AREA_READ
 

Definition at line 47 of file mman.h.

Referenced by draw_pixmap(), and make_pixmap().

#define PROTO_WRITE   AS_AREA_WRITE
 

Definition at line 48 of file mman.h.

Referenced by draw_pixmap(), and make_pixmap().

#define PROTO_EXEC   AS_AREA_EXEC
 

Definition at line 49 of file mman.h.

#define DST_NONE   0
 

Definition at line 40 of file sys/time.h.

Referenced by gettimeofday().

#define NULL   0
 

Definition at line 41 of file unistd.h.

Referenced by async_create_manager(), async_get_call_timeout(), async_manager_worker(), async_msg_2(), async_msg_3(), async_new_connection(), async_usleep(), async_wait_timeout(), change_console(), client_connection(), do_send_msg(), draw_pixmap(), gettimeofday(), handle_expired_timeouts(), ipc_finish_async(), ipc_prepare_async(), link_initialize(), main(), make_anim(), make_pixmap(), open_stdin(), open_stdout(), print_string(), printf_putstr(), psthread_create(), psthread_schedule_next_adv(), psthread_setup(), puts(), putstr(), sbrk(), screenbuffer_init(), strchr(), strrchr(), switch_screens(), try_dispatch_queued_calls(), vp_create(), and vprintf().

 
#define getpagesize  )     (PAGE_SIZE)
 

Definition at line 42 of file unistd.h.

Referenced by psthread_create(), and thread_create().

#define CONN_HASH_TABLE_CHAINS   32
 

Definition at line 199 of file async.c.

Referenced by _async_init(), and conn_hash().

#define __PRINTF_FLAG_PREFIX   0x00000001
 

show prefixes 0x or 0

Definition at line 46 of file printf_core.c.

Referenced by print_number(), and printf_core().

#define __PRINTF_FLAG_SIGNED   0x00000002
 

signed / unsigned number

Definition at line 47 of file printf_core.c.

Referenced by print_number(), and printf_core().

#define __PRINTF_FLAG_ZEROPADDED   0x00000004
 

print leading zeroes

Definition at line 48 of file printf_core.c.

Referenced by print_number(), and printf_core().

#define __PRINTF_FLAG_LEFTALIGNED   0x00000010
 

align to left

Definition at line 49 of file printf_core.c.

Referenced by print_char(), print_number(), print_string(), and printf_core().

#define __PRINTF_FLAG_SHOWPLUS   0x00000020
 

always show + sign

Definition at line 50 of file printf_core.c.

Referenced by print_number(), and printf_core().

#define __PRINTF_FLAG_SPACESIGN   0x00000040
 

print space instead of plus

Definition at line 51 of file printf_core.c.

Referenced by print_number(), and printf_core().

#define __PRINTF_FLAG_BIGCHARS   0x00000080
 

show big characters

Definition at line 52 of file printf_core.c.

Referenced by print_number(), and printf_core().

#define __PRINTF_FLAG_NEGATIVE   0x00000100
 

number has - sign

Definition at line 53 of file printf_core.c.

Referenced by print_number(), and printf_core().

#define PRINT_NUMBER_BUFFER_SIZE   (64+5)
 

Buffer big enought for 64 bit number printed in base 2, sign, prefix and 0 to terminate string.. (last one is only for better testing end of buffer by zero-filling subroutine)

Definition at line 55 of file printf_core.c.

Referenced by print_number().

#define FDS   32
 

Definition at line 50 of file stream.c.

Referenced by get_fd_phone(), open(), read(), and write().

#define PSTHREAD_INITIAL_STACK_PAGES_NO   1
 

Definition at line 47 of file psthread.c.

#define THREAD_INITIAL_STACK_PAGES_NO   1
 

Definition at line 48 of file generic/thread.c.


Typedef Documentation

typedef ipc_callid_t aid_t
 

Definition at line 43 of file async.h.

typedef void(* async_client_conn_t)(ipc_callid_t callid, ipc_call_t *call)
 

Definition at line 44 of file async.h.

typedef struct atomic atomic_t
 

typedef int fd_t
 

Definition at line 42 of file stream.h.

typedef ssize_t(* pwritefn_t)(void *, const void *, size_t)
 

Definition at line 45 of file stream.h.

typedef ssize_t(* preadfn_t)(void *, void *, size_t)
 

Definition at line 46 of file stream.h.

typedef unsigned long fifo_count_t
 

Definition at line 50 of file fifo.h.

typedef unsigned long fifo_index_t
 

Definition at line 51 of file fifo.h.

typedef unsigned long hash_count_t
 

Definition at line 41 of file hash_table.h.

typedef unsigned long hash_index_t
 

Definition at line 42 of file hash_table.h.

typedef struct hash_table hash_table_t
 

Definition at line 43 of file hash_table.h.

typedef struct hash_table_operations hash_table_operations_t
 

Definition at line 44 of file hash_table.h.

typedef struct link link_t
 

Definition at line 47 of file list.h.

typedef sysarg_t pstid_t
 

Definition at line 58 of file include/psthread.h.

typedef struct psthread_data psthread_data_t
 

Definition at line 73 of file include/psthread.h.

typedef __builtin_va_list va_list
 

Definition at line 44 of file stdarg.h.

typedef long time_t
 

Definition at line 42 of file sys/time.h.

typedef long suseconds_t
 

Definition at line 43 of file sys/time.h.

typedef uint64_t task_id_t
 

Definition at line 40 of file task.h.


Enumeration Type Documentation

enum pschange_type
 

Enumerator:
PS_TO_MANAGER 
PS_FROM_MANAGER 
PS_PREEMPT 
PS_FROM_DEAD 

Definition at line 51 of file include/psthread.h.

enum qualifier_t
 

Enumeration of possible arguments types.

Enumerator:
PrintfQualifierByte 
PrintfQualifierShort 
PrintfQualifierInt 
PrintfQualifierLong 
PrintfQualifierLongLong 
PrintfQualifierSizeT 
PrintfQualifierPointer 

Definition at line 62 of file printf_core.c.


Function Documentation

void * as_area_create void *  address,
size_t  size,
int  flags
 

Create address space area.

Parameters:
address Virtual address where to place new address space area.
size Size of the area.
flags Flags describing type of the area.
Returns:
address on success, (void *) -1 otherwise.

Definition at line 48 of file as.c.

References __SYSCALL3.

Referenced by __main(), and mmap().

int as_area_resize void *  address,
size_t  size,
int  flags
 

Resize address space area.

Parameters:
address Virtual address pointing into already existing address space area.
size New requested size of the area.
flags Currently unused.
Returns:
Zero on success or a code from errno.h on failure.

Definition at line 61 of file as.c.

References __SYSCALL3.

Referenced by sbrk().

int as_area_destroy void *  address  ) 
 

Destroy address space area.

Parameters:
address Virtual address pointing into the address space area being destroyed.
Returns:
Zero on success or a code from errno.h on failure.

Definition at line 72 of file as.c.

References __SYSCALL1.

Referenced by gettimeofday(), munmap(), and receive_comm_area().

void * set_maxheapsize size_t  mhs  ) 
 

Set maximum heap size and return pointer just after the heap

Definition at line 125 of file as.c.

References maxheapsize.

Referenced by as_get_mappable_page().

void * as_get_mappable_page size_t  sz  ) 
 

Return pointer to some unmapped area, where fits new as_area

TODO: make some first_fit/... algorithm, we are now just incrementing the pointer to last area

Definition at line 138 of file as.c.

References ALIGN_UP, maxheapsize, set_maxheapsize(), and USER_ADDRESS_SPACE_SIZE_ARCH.

Referenced by get_as(), gettimeofday(), main(), mmap(), and receive_comm_area().

Here is the call graph for this function:

static void async_manager void   )  [static]
 

Definition at line 46 of file async.h.

References PS_TO_MANAGER, and psthread_schedule_next_adv().

Referenced by main().

Here is the call graph for this function:

ipc_callid_t async_get_call_timeout ipc_call_t call,
suseconds_t  usecs
 

Return new incoming message for current(thread-local) connection

Definition at line 297 of file async.c.

References awaiter_t::active, assert, async_futex, msg_t::call, msg_t::callid, awaiter_t::expires, futex_down(), futex_up(), gettimeofday(), awaiter_t::inlist, insert_timeout(), msg_t::link, list_empty(), list_get_instance, list_remove(), connection_t::msg_queue, link::next, NULL, PS_connection, PS_TO_MANAGER, psthread_schedule_next_adv(), awaiter_t::timedout, tv_add(), and connection_t::wdata.

Referenced by async_get_call().

Here is the call graph for this function:

static ipc_callid_t async_get_call ipc_call_t data  )  [static]
 

Definition at line 52 of file async.h.

References async_get_call_timeout().

Referenced by client_connection(), console_connection(), keyboard_events(), and sysio_client_connection().

Here is the call graph for this function:

aid_t async_send_2 int  phoneid,
ipcarg_t  method,
ipcarg_t  arg1,
ipcarg_t  arg2,
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.

Definition at line 633 of file async.c.

References _exit(), in_interrupt_handler, ipc_call_async_2(), printf(), and reply_received().

Referenced by async_req_2().

Here is the call graph for this function:

aid_t async_send_3 int  phoneid,
ipcarg_t  method,
ipcarg_t  arg1,
ipcarg_t  arg2,
ipcarg_t  arg3,
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.

Definition at line 659 of file async.c.

References _exit(), in_interrupt_handler, ipc_call_async_3(), printf(), and reply_received().

Referenced by async_req_3().

Here is the call graph for this function:

void async_wait_for aid_t  amsgid,
ipcarg_t retval
 

Wait for a message sent by async framework

Parameters:
amsgid Message ID to wait for
retval Pointer to variable where will be stored retval of the answered message. If NULL, it is ignored.

Definition at line 687 of file async.c.

References awaiter_t::active, async_futex, amsg_t::done, futex_down(), futex_up(), awaiter_t::inlist, PS_TO_MANAGER, psthread_get_id(), psthread_schedule_next_adv(), awaiter_t::ptid, amsg_t::retval, and amsg_t::wdata.

Referenced by async_req_2(), and async_req_3().

Here is the call graph for this function:

int async_wait_timeout aid_t  amsgid,
ipcarg_t retval,
suseconds_t  timeout
 

Wait for a message sent by async framework with timeout

Parameters:
amsgid Message ID to wait for
retval Pointer to variable where will be stored retval of the answered message. If NULL, it is ignored.
timeout Timeout in usecs
Returns:
0 on success, ETIMEOUT if timeout expired

Definition at line 718 of file async.c.

References awaiter_t::active, async_futex, amsg_t::done, awaiter_t::expires, futex_down(), futex_up(), gettimeofday(), insert_timeout(), NULL, PS_TO_MANAGER, psthread_get_id(), psthread_schedule_next_adv(), awaiter_t::ptid, amsg_t::retval, tv_add(), and amsg_t::wdata.

Here is the call graph for this function:

static ipcarg_t async_req_2 int  phoneid,
ipcarg_t  method,
ipcarg_t  arg1,
ipcarg_t  arg2,
ipcarg_t r1,
ipcarg_t r2
[static]
 

Pseudo-synchronous message sending

Send message through IPC, wait in the event loop, until it is received

Returns:
Return code of message

Definition at line 70 of file async.h.

References async_send_2(), and async_wait_for().

Referenced by change_console(), client_connection(), draw_pixmap(), gcons_init(), main(), make_pixmap(), read_stdin(), and vp_create().

Here is the call graph for this function:

static ipcarg_t async_req_3 int  phoneid,
ipcarg_t  method,
ipcarg_t  arg1,
ipcarg_t  arg2,
ipcarg_t  arg3,
ipcarg_t r1,
ipcarg_t r2,
ipcarg_t r3
[static]
 

Definition at line 85 of file async.h.

References async_send_3(), and async_wait_for().

Referenced by draw_pixmap(), and make_pixmap().

Here is the call graph for this function:

pstid_t async_new_connection ipcarg_t  in_phone_hash,
ipc_callid_t  callid,
ipc_call_t call,
void(*)(ipc_callid_t, ipc_call_t *)  cthread
 

Create new thread for a new connection

Creates new thread for connection, fills in connection structures and inserts it into the hash table, so that later we can easily do routing of messages to particular threads.

Parameters:
in_phone_hash Identification of the incoming connection
callid Callid of the IPC_M_CONNECT_ME_TO packet
call Call data of the opening packet
cthread Thread function that should be called upon opening the connection
Returns:
New thread id

Definition at line 412 of file async.c.

References async_futex, conn_hash_table, connection_thread(), futex_down(), futex_up(), hash_table_insert(), ipc_answer_fast(), list_initialize(), NULL, psthread_add_ready(), and psthread_create().

Referenced by handle_call(), and main().

Here is the call graph for this function:

void async_usleep suseconds_t  timeout  ) 
 

Wait specified time, but in the meantime handle incoming events

Parameters:
timeout Time in microseconds to wait

Definition at line 758 of file async.c.

References _exit(), async_futex, futex_down(), gettimeofday(), in_interrupt_handler, insert_timeout(), NULL, printf(), PS_TO_MANAGER, psthread_get_id(), psthread_schedule_next_adv(), and tv_add().

Here is the call graph for this function:

void async_create_manager void   ) 
 

Add one manager to manager list

Definition at line 573 of file async.c.

References async_manager_thread(), NULL, psthread_add_manager(), and psthread_create().

Referenced by psthread_schedule_next_adv().

Here is the call graph for this function:

void async_destroy_manager void   ) 
 

Remove one manager from manager list

Definition at line 582 of file async.c.

References psthread_remove_manager().

Referenced by __thread_main().

Here is the call graph for this function:

void async_set_client_connection async_client_conn_t  conn  ) 
 

Set function that is called, IPC_M_CONNECT_ME_TO is received

Parameters:
conn Function that will form new psthread.

Definition at line 789 of file async.c.

References client_connection.

Referenced by main(), and sysio_init().

void async_set_interrupt_received async_client_conn_t  conn  ) 
 

Definition at line 793 of file async.c.

References interrupt_received.

Referenced by main().

int _async_init void   ) 
 

Initialize internal structures needed for async manager

Definition at line 588 of file async.c.

References conn_hash_table, CONN_HASH_TABLE_CHAINS, conn_hash_table_ops, hash_table_create(), and printf().

Referenced by __main().

Here is the call graph for this function:

void async_msg_3 int  phoneid,
ipcarg_t  method,
ipcarg_t  arg1,
ipcarg_t  arg2,
ipcarg_t  arg3
 

Definition at line 799 of file async.c.

References in_interrupt_handler, ipc_call_async_3(), and NULL.

Referenced by prtchr(), and tran_putch().

Here is the call graph for this function:

void async_msg_2 int  phoneid,
ipcarg_t  method,
ipcarg_t  arg1,
ipcarg_t  arg2
 

Definition at line 805 of file async.c.

References in_interrupt_handler, ipc_call_async_2(), and NULL.

Referenced by curs_goto(), draw_pixmap(), gcons_mouse_move(), main(), make_anim(), redraw_state(), set_style(), set_style_col(), and switch_screens().

Here is the call graph for this function:

static void async_serialize_start void   )  [static]
 

Definition at line 121 of file async.h.

References psthread_inc_sercount().

Referenced by change_console(), client_connection(), interrupt_received(), and printf_core().

Here is the call graph for this function:

static void async_serialize_end void   )  [static]
 

Definition at line 125 of file async.h.

References psthread_dec_sercount().

Referenced by change_console(), client_connection(), and interrupt_received().

Here is the call graph for this function:

static void atomic_set atomic_t val,
long  i
[static]
 

Definition at line 44 of file include/atomic.h.

References atomic::count.

Referenced by futex_initialize().

static long atomic_get atomic_t val  )  [static]
 

Definition at line 49 of file include/atomic.h.

References atomic::count.

int cap_grant task_id_t  id,
unsigned int  caps
 

Grant capabilities to a task.

Parameters:
id Destination task ID.
caps Capabilities to grant.
Returns:
Zero on success or a value from errno.h on failure.

Definition at line 49 of file cap.c.

References __SYSCALL2.

int cap_revoke task_id_t  id,
unsigned int  caps
 

Revoke capabilities from a task.

Parameters:
id Destination task ID.
caps Capabilities to revoke.
Returns:
Zero on success or a value from errno.h on failure.

Definition at line 65 of file cap.c.

References __SYSCALL2.

static int isdigit int  c  )  [static]
 

Definition at line 38 of file ctype.h.

Referenced by printf_core().

static int isspace int  c  )  [static]
 

Definition at line 43 of file ctype.h.

Referenced by _strtoul().

int map_physmem 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.

Parameters:
pf Physical address of the starting frame.
vp Virtual address of the sterting page.
pages Number of pages to map.
flags Flags for the new address space area.
Returns:
0 on success, EPERM if the caller lacks the CAP_MEM_MANAGER capability, ENOENT if there is no task with specified ID and ENOMEM if there was some problem in creating address space area.

Definition at line 53 of file ddi.c.

References __SYSCALL4.

Referenced by get_as().

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.

Parameters:
id Task ID.
ioaddr Starting address of the I/O range.
size Size of the range.
Returns:
0 on success, EPERM if the caller lacks the CAP_IO_MANAGER capability, ENOENT if there is no task with specified ID and ENOMEM if there was some problem in allocating memory.

Definition at line 70 of file ddi.c.

References __SYSCALL1.

int preemption_control int  enable  ) 
 

Interrupt control

Parameters:
enable 1 - enable interrupts, 0 - disable interrupts

Definition at line 85 of file ddi.c.

References __SYSCALL1.

void futex_initialize atomic_t futex,
int  val
 

Initialize futex counter.

Parameters:
futex Futex.
val Initialization value.

Definition at line 83 of file futex.c.

References atomic_set().

Referenced by usleep().

Here is the call graph for this function:

int futex_down atomic_t futex  ) 
 

Definition at line 88 of file futex.c.

References futex_down_timeout().

Referenced by async_get_call_timeout(), async_manager_worker(), async_new_connection(), async_usleep(), async_wait_for(), async_wait_timeout(), connection_thread(), handle_answer(), handle_expired_timeouts(), ipc_call_async_2(), ipc_call_async_3(), ipc_finish_async(), keybuffer_free(), keybuffer_pop(), keybuffer_push(), psthread_add_manager(), psthread_add_ready(), psthread_remove_manager(), psthread_schedule_next_adv(), reply_received(), route_call(), and try_dispatch_queued_calls().

Here is the call graph for this function:

int futex_trydown atomic_t futex  ) 
 

Definition at line 93 of file futex.c.

References futex_down_timeout().

Here is the call graph for this function:

int futex_down_timeout atomic_t futex,
uint32_t  usec,
int  flags
 

Try to down the futex.

Parameters:
futex Futex.
usec Microseconds to wait. Zero value means sleep without timeout.
flags Select mode of operation. See comment for waitq_sleep_timeout().
Returns:
ENOENT if there is no such virtual address. One of ESYNCH_OK_ATOMIC and ESYNCH_OK_BLOCKED on success or ESYNCH_TIMEOUT if the lock was not acquired because of a timeout or ESYNCH_WOULD_BLOCK if the operation could not be carried out atomically (if requested so).

Definition at line 109 of file futex.c.

References __SYSCALL3, atomic_inc(), atomic_predec(), and atomic::count.

Referenced by futex_down(), futex_trydown(), and usleep().

Here is the call graph for this function:

int futex_up atomic_t futex  ) 
 

Up the futex.

Parameters:
futex Futex.
Returns:
ENOENT if there is no such virtual address. Otherwise zero.

Definition at line 165 of file futex.c.

References __SYSCALL1, atomic_postinc(), and atomic::count.

Referenced by async_get_call_timeout(), async_manager_thread(), async_manager_worker(), async_new_connection(), async_wait_for(), async_wait_timeout(), connection_thread(), handle_answer(), handle_expired_timeouts(), ipc_finish_async(), keybuffer_free(), keybuffer_pop(), keybuffer_push(), psthread_add_manager(), psthread_add_ready(), psthread_remove_manager(), psthread_schedule_next_adv(), reply_received(), route_call(), and try_dispatch_queued_calls().

Here is the call graph for this function:

int putnchars const char *  buf,
size_t  count
 

Put count chars from buffer to stdout without adding newline

Parameters:
buf Buffer with size at least count bytes - NULL pointer NOT allowed!
count 
Returns:
0 on succes, EOF on fail

Definition at line 64 of file io.c.

References EOF, and write().

Referenced by puts(), and putstr().

Here is the call graph for this function:

int putstr const char *  str  ) 
 

Same as puts, but does not print newline at end

Definition at line 76 of file io.c.

References NULL, putnchars(), and write().

Here is the call graph for this function:

int putchar int  c  ) 
 

Definition at line 92 of file io.c.

References EOF, and write().

Referenced by interrupt_received().

Here is the call graph for this function:

int getchar void   ) 
 

Definition at line 102 of file io.c.

References EOF, and read().

Referenced by do_connect(), do_hangup(), and do_send_msg().

Here is the call graph for this function:

int printf_core const char *  fmt,
struct printf_spec 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:

  • "#" Force to print prefix. For conversion %o the prefix is 0, for x and %X prefixes are 0x and 0X and for conversion %b the prefix is 0b.

  • "-" Align to left.

  • "+" Print positive sign just as negative.

  • " " If the printed number is positive and "+" flag is not set, print space in place of sign.

  • "0" Print 0 as padding instead of spaces. Zeroes are placed between sign and the rest of the number. This flag is ignored if "-" flag is specified.

WIDTH:

  • Specify minimal width of printed argument. If it is bigger, width is ignored. If width is specified with a "*" character instead of number, width is taken from parameter list. And integer parameter is expected before parameter for processed conversion specification. If this value is negative its absolute value is taken and the "-" flag is set.

PRECISION:

  • Value precision. For numbers it specifies minimum valid numbers. Smaller numbers are printed with leading zeroes. Bigger numbers are not affected. Strings with more than precision characters are cut off. Just as with width, an "*" can be used used instead of a number. An integer value is then expected in parameters. When both width and precision are specified using "*", the first parameter is used for width and the second one for precision.

TYPE:

  • "hh" Signed or unsigned char.
  • "h" Signed or usigned short.
  • "" Signed or usigned int (default value).
  • "l" Signed or usigned long int.
  • "ll" Signed or usigned long long int.
  • "z" Type size_t.

CONVERSION:

  • % Print percentile character itself.

  • c Print single character.

  • s Print zero terminated string. If a NULL value is passed as value, "(NULL)" is printed instead.

  • P, p Print value of a pointer. Void * value is expected and it is printed in hexadecimal notation with prefix (as with '%X' or '%x' for 32bit or '%X' or '%x' for 64bit long pointers).

  • b Print value as unsigned binary number. Prefix is not printed by default. (Nonstandard extension.)

  • o Print value as unsigned octal number. Prefix is not printed by default.

  • d,i Print signed decimal number. There is no difference between d and i conversion.

  • u Print unsigned decimal number.

  • X, x Print hexadecimal number with upper- or lower-case. Prefix is not printed by default.

All other characters from fmt except the formatting directives are printed in verbatim.

Parameters:
fmt Formatting NULL terminated string.
Returns:
Number of printed characters or negative value on failure.
TODO: unimplemented qualifiers: t ptrdiff_t - ISO C 99

Definition at line 436 of file printf_core.c.

References __PRINTF_FLAG_BIGCHARS, __PRINTF_FLAG_LEFTALIGNED, __PRINTF_FLAG_NEGATIVE, __PRINTF_FLAG_PREFIX, __PRINTF_FLAG_SHOWPLUS, __PRINTF_FLAG_SIGNED, __PRINTF_FLAG_SPACESIGN, __PRINTF_FLAG_ZEROPADDED, async_serialize_start(), isdigit(), print_char(), print_number(), print_string(), printf_putnchars(), PrintfQualifierByte, PrintfQualifierInt, PrintfQualifierLong, PrintfQualifierLongLong, PrintfQualifierPointer, PrintfQualifierShort, PrintfQualifierSizeT, and va_arg.

Referenced by vprintf(), and vsnprintf().

Here is the call graph for this function:

fd_t open const char *  fname,
int  flags
 

Definition at line 134 of file stream.c.

References EMFILE, FDS, open_stdin(), open_stdout(), strcmp(), streams, stream_t::w, write_null(), and write_stderr().

Referenced by __io_init(), and init_mparams().

Here is the call graph for this function:

int get_fd_phone int  fd  ) 
 

Definition at line 186 of file stream.c.

References FDS, stream_t::phone, and streams.

int 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.

Parameters:
h Hash table structure. Will be initialized by this call.
m Number of slots in the hash table.
max_keys Maximal number of keys needed to identify an item.
op Hash table operations structure.
Returns:
true on success

Definition at line 55 of file hash_table.c.

References assert, hash_table_operations::compare, hash_table::entries, hash_table::entry, hash_table_operations::hash, list_initialize(), hash_table::max_keys, memset(), hash_table::op, and printf().

Referenced by _async_init(), and main().

Here is the call graph for this function:

void hash_table_insert hash_table_t h,
unsigned long  key[],
link_t item
 

Insert item into hash table.

Parameters:
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 85 of file hash_table.c.

References assert, hash_table_operations::compare, hash_table::entry, hash_table_operations::hash, list_append(), and hash_table::op.

Referenced by async_new_connection(), and register_service().

Here is the call graph for this function:

link_t * hash_table_find hash_table_t h,
unsigned long  key[]
 

Search hash table for an item matching keys.

Parameters:
h Hash table.
key Array of all keys needed to compute hash index.
Returns:
Matching item on success, NULL if there is no such item.

Definition at line 105 of file hash_table.c.

References assert, hash_table_operations::compare, hash_table::entry, hash_table_operations::hash, hash_table::max_keys, link::next, and hash_table::op.

Referenced by connect_to_service(), hash_table_remove(), register_service(), and route_call().

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.

Parameters:
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 135 of file hash_table.c.

References assert, hash_table_operations::compare, hash_table::entries, hash_table::entry, hash_table_operations::hash, hash_table_find(), list_remove(), hash_table::max_keys, link::next, hash_table::op, link::prev, and hash_table_operations::remove_callback.

Referenced by connection_thread().

Here is the call graph for this function:

static void link_initialize link_t link  )  [static]
 

Initialize doubly-linked circular list link

Initialize doubly-linked list link.

Parameters:
link Pointer to link_t structure to be initialized.

Definition at line 67 of file list.h.

References link::next, NULL, and link::prev.

Referenced by list_remove(), and register_service().

static void list_initialize link_t head  )  [static]
 

Initialize doubly-linked circular list

Initialize doubly-linked circular list.

Parameters:
head Pointer to link_t structure representing head of the list.

Definition at line 79 of file list.h.

References link::next, and link::prev.

Referenced by async_new_connection(), hash_table_create(), and list_concat().

static void list_prepend link_t link,
link_t head
[static]
 

Add item to the beginning of doubly-linked circular list

Add item to the beginning of doubly-linked circular list.

Parameters:
link Pointer to link_t structure to be added.
head Pointer to link_t structure representing head of the list.

Definition at line 92 of file list.h.

References link::next, and link::prev.

static void list_append link_t link,
link_t head
[static]
 

Add item to the end of doubly-linked circular list

Add item to the end of doubly-linked circular list.

Parameters:
link Pointer to link_t structure to be added.
head Pointer to link_t structure representing head of the list.

Definition at line 107 of file list.h.

References link::next, and link::prev.

Referenced by hash_table_insert(), insert_timeout(), ipc_finish_async(), psthread_add_manager(), psthread_add_ready(), psthread_main(), psthread_schedule_next_adv(), route_call(), and try_dispatch_queued_calls().

static void list_remove link_t link  )  [static]
 

Remove item from doubly-linked circular list

Remove item from doubly-linked circular list.

Parameters:
link Pointer to link_t structure to be removed from the list it is contained in.

Definition at line 121 of file list.h.

References link_initialize(), link::next, and link::prev.

Referenced by async_get_call_timeout(), connection_thread(), handle_answer(), handle_expired_timeouts(), hash_table_remove(), psthread_remove_manager(), psthread_schedule_next_adv(), reply_received(), route_call(), and try_dispatch_queued_calls().

Here is the call graph for this function:

static int list_empty link_t head  )  [static]
 

Query emptiness of doubly-linked circular list

Query emptiness of doubly-linked circular list.

Parameters:
head Pointer to link_t structure representing head of the list.

Definition at line 134 of file list.h.

References link::next.

Referenced by async_get_call_timeout(), async_manager_worker(), connection_thread(), list_concat(), psthread_remove_manager(), psthread_schedule_next_adv(), and try_dispatch_queued_calls().

static void headless_list_split_or_concat link_t part1,
link_t part2
[static]
 

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.

Parameters:
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.

Definition at line 150 of file list.h.

References link::next, and link::prev.

Referenced by headless_list_concat(), and headless_list_split().

static void headless_list_split link_t part1,
link_t part2
[static]
 

Split headless doubly-linked circular list

Split headless doubly-linked circular list.

Parameters:
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.

Definition at line 169 of file list.h.

References headless_list_split_or_concat().

Here is the call graph for this function:

static void headless_list_concat link_t part1,
link_t part2
[static]
 

Concatenate two headless doubly-linked circular lists

Concatenate two headless doubly-linked circular lists.

Parameters:
part1 Pointer to link_t structure leading the first headless list.
part2 Pointer to link_t structure leading the second headless list.

Definition at line 181 of file list.h.

References headless_list_split_or_concat().

Here is the call graph for this function:

int list_member const link_t link,
const link_t head
 

Check for membership

Check whether link is contained in the list head. The membership is defined as pointer equivalence.

Parameters:
link Item to look for.
head List to look in.
Returns:
true if link is contained in head, false otherwise.

Definition at line 49 of file list.c.

References link::next.

void list_concat link_t head1,
link_t head2
 

Concatenate two lists

Concatenate lists head1 and head2, producing a single list head1 containing items from both (in head1, head2 order) and empty list head2.

Parameters:
head1 First list and concatenated output
head2 Second list and empty output.

Definition at line 76 of file list.c.

References list_empty(), list_initialize(), link::next, and link::prev.

Here is the call graph for this function:

void __main void   ) 
 

Definition at line 58 of file libc.c.

References __tcb_set(), _async_init(), _heap, as_area_create(), psthread_setup(), and psthread_data::tcb.

Here is the call graph for this function:

void __io_init void   ) 
 

Definition at line 68 of file libc.c.

References open().

Here is the call graph for this function:

void __exit void   ) 
 

Definition at line 75 of file libc.c.

References __tcb_get(), _exit(), and psthread_teardown().

Here is the call graph for this function:

sysarg_t __syscall const sysarg_t  p1,
const sysarg_t  p2,
const sysarg_t  p3,
const sysarg_t  p4,
const syscall_t  id
 

int context_save context_t c  ) 
 

Referenced by psthread_create(), and psthread_schedule_next_adv().

void context_restore context_t c  ) 
 

Referenced by psthread_schedule_next_adv().

pstid_t psthread_create int(*)(void *)  func,
void *  arg
 

Create a userspace thread

Parameters:
func Pseudo thread function.
arg Argument to pass to func.
Returns:
0 on failure, TLS of the new pseudo thread.

Definition at line 220 of file psthread.c.

References psthread_data::arg, context_save(), context_set, psthread_data::ctx, psthread_data::finished, psthread_data::flags, psthread_data::func, getpagesize, NULL, PSTHREAD_INITIAL_STACK_PAGES_NO, psthread_main(), psthread_setup(), psthread_teardown(), psthread_data::stack, psthread_data::tcb, and psthread_data::waiter.

Referenced by async_create_manager(), and async_new_connection().

Here is the call graph for this function:

int psthread_join pstid_t  psthrid  ) 
 

Wait for uspace pseudo thread to finish.

Parameters:
psthrid Pseudo thread to wait for.
Returns:
Value returned by the finished thread.

Definition at line 192 of file psthread.c.

References _exit(), printf(), psthread_teardown(), psthread_data::retval, and psthread_data::stack.

Here is the call graph for this function:

psthread_data_t * psthread_setup void   ) 
 

Setup PSthread information into TCB structure

Definition at line 65 of file psthread.c.

References __free_tls(), __make_tls(), NULL, and tcb_t::pst_data.

Referenced by __main(), __thread_main(), and psthread_create().

Here is the call graph for this function:

void psthread_teardown psthread_data_t pt  ) 
 

Definition at line 86 of file psthread.c.

References __free_tls(), and psthread_data::tcb.

Referenced by __exit(), __thread_main(), psthread_create(), and psthread_join().

Here is the call graph for this function:

int psthread_schedule_next_adv pschange_type  ctype  ) 
 

Schedule next userspace pseudo thread.

If calling with PS_TO_MANAGER parameter, the async_futex should be held.

Parameters:
ctype Type of switch.
Returns:
0 if there is no ready pseudo thread, 1 otherwise.

Definition at line 114 of file psthread.c.

References __tcb_get(), async_create_manager(), context_restore(), context_save(), psthread_data::ctx, psthread_data::flags, futex_down(), futex_up(), psthread_data::link, list_append(), list_empty(), list_get_instance, list_remove(), NULL, PS_FROM_DEAD, PS_FROM_MANAGER, PS_PREEMPT, PS_TO_MANAGER, tcb_t::pst_data, psthread_futex, PSTHREAD_SERIALIZED, serialization_count, serialized_threads, and threads_in_manager.

Referenced by async_get_call_timeout(), async_manager(), async_manager_worker(), async_usleep(), async_wait_for(), async_wait_timeout(), ipc_finish_async(), psthread_main(), and psthread_schedule_next().

Here is the call graph for this function:

void psthread_add_ready pstid_t  psthrid  ) 
 

Add a thread to ready list

Definition at line 247 of file psthread.c.

References psthread_data::flags, futex_down(), futex_up(), psthread_data::link, list_append(), psthread_futex, and PSTHREAD_SERIALIZED.

Referenced by async_new_connection(), handle_expired_timeouts(), reply_received(), route_call(), and try_dispatch_queued_calls().

Here is the call graph for this function:

void psthread_add_manager pstid_t  psthrid  ) 
 

Add a thread to manager list

Definition at line 261 of file psthread.c.

References futex_down(), futex_up(), psthread_data::link, list_append(), and psthread_futex.

Referenced by async_create_manager().

Here is the call graph for this function:

void psthread_remove_manager void   ) 
 

Remove one manager from manager list

Definition at line 273 of file psthread.c.

References futex_down(), futex_up(), list_empty(), list_remove(), and psthread_futex.

Referenced by async_destroy_manager().

Here is the call graph for this function:

pstid_t psthread_get_id void   ) 
 

Return thread id of current running thread

Definition at line 285 of file psthread.c.

References __tcb_get(), and tcb_t::pst_data.

Referenced by async_usleep(), async_wait_for(), async_wait_timeout(), and ipc_finish_async().

Here is the call graph for this function:

void psthread_inc_sercount void   ) 
 

Disable preemption

If the thread wants to send several message in 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. Interrupt messages will can still be preempted.

Definition at line 298 of file psthread.c.

References serialization_count.

Referenced by async_serialize_start().

void psthread_dec_sercount void   ) 
 

Definition at line 303 of file psthread.c.

References serialization_count.

Referenced by async_serialize_end().

static int psthread_schedule_next  )  [static]
 

Definition at line 90 of file include/psthread.h.

References PS_PREEMPT, and psthread_schedule_next_adv().

Here is the call graph for this function:

int puts const char *  str  ) 
 

Definition at line 42 of file io.c.

References nl, NULL, putnchars(), and write().

Here is the call graph for this function:

int printf const char *  fmt,
  ...
 

Print formatted text.

Parameters:
fmt format string
See also:
For more details about format string see printf_core.

Definition at line 43 of file printf.c.

References va_end, va_start, and vprintf().

Referenced by _async_init(), async_send_2(), async_send_3(), async_usleep(), callback(), client_connection(), do_answer_msg(), do_connect(), do_hangup(), do_send_msg(), gettimeofday(), handle_answer(), hash_table_create(), main(), printhelp(), and psthread_join().

Here is the call graph for this function:

int sprintf char *  str,
const char *  fmt,
  ...
 

Print formatted to the given buffer.

Parameters:
str buffer
fmt format string
See also:
For more details about format string see printf_core.

Definition at line 44 of file sprintf.c.

References va_end, va_start, and vsprintf().

Here is the call graph for this function:

int snprintf char *  str,
size_t  size,
const char *  fmt,
  ...
 

Print formatted to the given buffer with limited size.

Parameters:
str buffer
size buffer size
fmt format string
See also:
For more details about format string see printf_core.

Definition at line 45 of file snprintf.c.

References va_end, va_start, and vsnprintf().

Referenced by curs_goto(), redraw_state(), and set_style().

Here is the call graph for this function:

int vprintf const char *  fmt,
va_list  ap
 

Print formatted text.

Parameters:
fmt format string
ap format parameters
See also:
For more details about format string see printf_core.

Definition at line 52 of file vprintf.c.

References NULL, printf_core(), and vprintf_write().

Referenced by printf().

Here is the call graph for this function:

int vsprintf char *  str,
const char *  fmt,
va_list  ap
 

Print formatted to the given buffer.

Parameters:
str buffer
fmt format string
ap argument list
See also:
For more details about format string see printf_core.

Definition at line 45 of file vsprintf.c.

References vsnprintf().

Referenced by sprintf().

Here is the call graph for this function:

int vsnprintf char *  str,
size_t  size,
const char *  fmt,
va_list  ap
 

Print formatted to the given buffer with limited size.

Parameters:
str buffer
size buffer size
fmt format string
See also:
For more details about format string see printf_core.

Definition at line 98 of file vsnprintf.c.

References printf_spec::data, printf_core(), and vsnprintf_write().

Referenced by snprintf(), and vsprintf().

Here is the call graph for this function:

long int random void   ) 
 

Definition at line 39 of file stdlib.c.

References glbl_seed, and RAND_MAX.

Referenced by rand().

void srandom unsigned int  seed  ) 
 

Definition at line 44 of file stdlib.c.

References glbl_seed.

Referenced by srand().

static int rand void   )  [static]
 

Definition at line 49 of file stdlib.h.

References random().

Here is the call graph for this function:

static void srand unsigned int  seed  )  [static]
 

Definition at line 53 of file stdlib.h.

References srandom().

Here is the call graph for this function:

void * memset void *  s,
int  c,
size_t  n
 

Definition at line 44 of file string.c.

Referenced by __make_tls(), dlcalloc(), hash_table_create(), and ialloc().

void * memcpy void *  dest,
const void *  src,
size_t  n
 

Definition at line 73 of file string.c.

References unaligned_memcpy().

Referenced by __make_tls(), draw_pixmap(), internal_realloc(), make_pixmap(), memmove(), and vsnprintf_write().

Here is the call graph for this function:

void * memmove void *  dest,
const void *  src,
size_t  n
 

Definition at line 89 of file string.c.

References memcpy().

Here is the call graph for this function:

int strcmp const char *  ,
const char * 
 

Definition at line 120 of file string.c.

Referenced by open().

char * strcpy char *  dest,
const char *  src
 

Definition at line 301 of file string.c.

char * strncpy char *  dest,
const char *  src,
size_t  n
 

Definition at line 309 of file string.c.

size_t strlen const char *  str  ) 
 

Count the number of characters in the string, not including terminating 0.

Parameters:
str string
Returns:
number of characters in string.

Definition at line 110 of file string.c.

Referenced by print_string(), and sysinfo_value().

char * strchr const char *  str,
int  c
 

Return pointer to the first occurence of character c in string

Parameters:
str scanned string
c searched character (taken as one byte)
Returns:
pointer to the matched character or NULL if it is not found in given string.

Definition at line 137 of file string.c.

References NULL.

char * strrchr const char *  str,
int  c
 

Return pointer to the last occurence of character c in string

Parameters:
str scanned string
c searched character (taken as one byte)
Returns:
pointer to the matched character or NULL if it is not found in given string.

Definition at line 153 of file string.c.

References NULL.

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.

Parameters:
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
Returns:
result of conversion.

Definition at line 261 of file string.c.

References _strtoul(), LONG_MAX, and LONG_MIN.

Here is the call graph for this function:

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.

Parameters:
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
Returns:
result of conversion.

Definition at line 291 of file string.c.

References _strtoul().

Here is the call graph for this function:

void * mmap void *  start,
size_t  length,
int  prot,
int  flags,
int  fd,
off_t  offset
 

Definition at line 39 of file mmap.c.

References as_area_create(), as_get_mappable_page(), MAP_ANONYMOUS, and MAP_FAILED.

Referenced by draw_pixmap(), and make_pixmap().

Here is the call graph for this function:

int munmap void *  start,
size_t  length
 

Definition at line 52 of file mmap.c.

References as_area_destroy().

Referenced by draw_pixmap(), and make_pixmap().

Here is the call graph for this function:

int gettimeofday struct timeval tv,
struct timezone tz
 

POSIX gettimeofday

The time variables are memory mapped(RO) from kernel, which updates them periodically. As it is impossible to read 2 values atomically, we use a trick: First read a seconds, then read microseconds, then read seconds again. If a second elapsed in the meantime, set it to zero. This provides assurance, that at least the sequence of subsequent gettimeofday calls is ordered.

Definition at line 66 of file time.c.

References _exit(), as_area_destroy(), as_get_mappable_page(), DST_NONE, ipc_call_sync_3(), ktime, NULL, printf(), SERVICE_MEM_REALTIME, timeval::tv_sec, timeval::tv_usec, timezone::tz_dsttime, and timezone::tz_minuteswest.

Referenced by async_get_call_timeout(), async_manager_worker(), async_usleep(), async_wait_timeout(), and handle_expired_timeouts().

Here is the call graph for this function:

sysarg_t sysinfo_value char *  name  ) 
 

Definition at line 39 of file sysinfo.c.

References __SYSCALL2, and strlen().

Referenced by get_as(), kbd_arch_init(), and main().

Here is the call graph for this function:

task_id_t task_get_id void   ) 
 

Definition at line 38 of file task.c.

References __SYSCALL1.

void __thread_entry void   ) 
 

Referenced by thread_create().

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. Do not call this function directly.

Parameters:
uarg Pointer to userspace argument structure.
TODO: Thread stack pages memory leak

Definition at line 93 of file generic/thread.c.

References __tcb_set(), async_destroy_manager(), psthread_setup(), psthread_teardown(), psthread_data::tcb, and thread_exit().

Here is the call graph for this function:

int thread_create void(*)(void *arg)  function,
void *  arg,
char *  name
 

void thread_exit int  status  ) 
 

Terminate current thread.

Parameters:
status Exit status. Currently not used.

Definition at line 150 of file generic/thread.c.

References __SYSCALL1.

Referenced by __thread_main(), and _exit().

tcb_t * __make_tls void   ) 
 

Create Thread Local storage area, return pointer to TCB(ThreadControlBlock)

!! The code requires, that sections .tdata and .tbss are adjacent. It may be changed in the future.

Definition at line 63 of file generic/thread.c.

References __alloc_tls(), _tbss_end, _tbss_start, _tdata_end, _tdata_start, memcpy(), and memset().

Referenced by psthread_setup().

Here is the call graph for this function:

tcb_t* __alloc_tls void **  data,
size_t  size
 

Definition at line 47 of file arch/ia64/src/thread.c.

Referenced by __make_tls().

void __free_tls tcb_t  ) 
 

Definition at line 76 of file generic/thread.c.

References __free_tls_arch(), _tbss_end, and _tdata_start.

Referenced by psthread_setup(), and psthread_teardown().

Here is the call graph for this function:

void __free_tls_arch tcb_t ,
size_t  size
 

Definition at line 59 of file arch/ia64/src/thread.c.

Referenced by __free_tls().

ssize_t write int  fd,
const void *  buf,
size_t  count
 

Definition at line 168 of file stream.c.

References FDS, streams, and stream_t::w.

Referenced by putchar(), putnchars(), puts(), putstr(), and vprintf_write().

ssize_t read int  fd,
void *  buf,
size_t  count
 

Definition at line 178 of file stream.c.

References FDS, stream_t::r, and streams.

Referenced by getchar(), and init_mparams().

void _exit int  status  ) 
 

Definition at line 53 of file libc.c.

References thread_exit().

Referenced by __exit(), async_send_2(), async_send_3(), async_usleep(), gettimeofday(), main(), and psthread_join().

Here is the call graph for this function:

void * sbrk ssize_t  incr  ) 
 

Sbrk emulation

Parameters:
incr New area that should be allocated or negative, if it should be shrinked
Returns:
Pointer to newly allocated area

Definition at line 91 of file as.c.

References as_area_resize(), heapsize, maxheapsize, and NULL.

Here is the call graph for this function:

void usleep unsigned long  usec  ) 
 

Wait unconditionally for specified microseconds

Definition at line 109 of file time.c.

References futex_down_timeout(), futex_initialize(), and FUTEX_INITIALIZER.

Referenced by main(), open_stdin(), and open_stdout().

Here is the call graph for this function:

static LIST_INITIALIZE timeout_list   )  [static]
 

static void default_client_connection ipc_callid_t  callid,
ipc_call_t call
[static]
 

Thread function that gets created on new connection

This function is defined as a weak symbol - to be redefined in user code.

Definition at line 352 of file async.c.

References ipc_answer_fast().

Here is the call graph for this function:

static void default_interrupt_received ipc_callid_t  callid,
ipc_call_t call
[static]
 

Definition at line 356 of file async.c.

static void tv_add struct timeval tv,
suseconds_t  usecs
[static]
 

Add microseconds to give timeval

Definition at line 156 of file async.c.

References timeval::tv_sec, and timeval::tv_usec.

Referenced by async_get_call_timeout(), async_usleep(), and async_wait_timeout().

static suseconds_t tv_sub struct timeval tv1,
struct timeval tv2
[static]
 

Subtract 2 timevals, return microseconds difference

Definition at line 167 of file async.c.

References timeval::tv_sec, and timeval::tv_usec.

Referenced by async_manager_worker().

static int tv_gt struct timeval tv1,
struct timeval tv2
[static]
 

Compare timeval

Returns:
1 if tv1 > tv2, otherwise 0

Definition at line 181 of file async.c.

References timeval::tv_sec, and timeval::tv_usec.

Referenced by handle_expired_timeouts().

static int tv_gteq struct timeval tv1,
struct timeval tv2
[static]
 

Definition at line 189 of file async.c.

References timeval::tv_sec, and timeval::tv_usec.

Referenced by async_manager_worker(), and insert_timeout().

static hash_index_t conn_hash unsigned long *  key  )  [static]
 

Definition at line 201 of file async.c.

References assert, and CONN_HASH_TABLE_CHAINS.

static int conn_compare unsigned long  key[],
hash_count_t  keys,
link_t item
[static]
 

Definition at line 207 of file async.c.

References hash_table_get_instance, and connection_t::in_phone_hash.

static void conn_remove link_t item  )  [static]
 

Definition at line 216 of file async.c.

References hash_table_get_instance.

static void insert_timeout awaiter_t wd  )  [static]
 

Insert sort timeout msg into timeouts list

Definition at line 232 of file async.c.

References awaiter_t::expires, awaiter_t::inlist, awaiter_t::link, list_append(), list_get_instance, link::next, awaiter_t::timedout, and tv_gteq().

Referenced by async_get_call_timeout(), async_usleep(), and async_wait_timeout().

Here is the call graph for this function:

static int route_call ipc_callid_t  callid,
ipc_call_t call
[static]
 

Try to route a call to an appropriate connection thread

Definition at line 255 of file async.c.

References awaiter_t::active, async_futex, connection_t::close_callid, conn_hash_table, futex_down(), futex_up(), hash_table_find(), hash_table_get_instance, ipc_call_t::in_phone_hash, awaiter_t::inlist, awaiter_t::link, list_append(), list_remove(), connection_t::msg_queue, psthread_add_ready(), awaiter_t::ptid, and connection_t::wdata.

Referenced by handle_call().

Here is the call graph for this function:

static int connection_thread void *  arg  )  [static]
 

Wrapper for client connection thread

When new connection arrives, thread with this function is created. It calls client_connection and does final cleanup.

Parameters:
arg Connection structure pointer

Definition at line 367 of file async.c.

References async_futex, connection_t::call, msg_t::callid, connection_t::callid, connection_t::close_callid, conn_hash_table, connection_t::cthread, futex_down(), futex_up(), hash_table_remove(), connection_t::in_phone_hash, ipc_answer_fast(), msg_t::link, list_empty(), list_get_instance, list_remove(), connection_t::msg_queue, link::next, and PS_connection.

Referenced by async_new_connection().

Here is the call graph for this function:

static void handle_call ipc_callid_t  callid,
ipc_call_t call
[static]
 

Handle call that was received

Definition at line 449 of file async.c.

References async_new_connection(), client_connection, in_interrupt_handler, ipc_answer_fast(), and route_call().

Referenced by async_manager_worker().

Here is the call graph for this function:

static void handle_expired_timeouts void   )  [static]
 

Fire all timeouts that expired

Definition at line 477 of file async.c.

References async_futex, futex_down(), futex_up(), gettimeofday(), list_get_instance, list_remove(), link::next, NULL, psthread_add_ready(), and tv_gt().

Referenced by async_manager_worker().

Here is the call graph for this function:

static int async_manager_worker void   )  [static]
 

Endless loop dispatching incoming calls and answers

Definition at line 508 of file async.c.

References async_futex, awaiter_t::expires, futex_down(), futex_up(), gettimeofday(), handle_call(), handle_expired_timeouts(), ipc_wait_cycle(), list_empty(), list_get_instance, NULL, PS_FROM_MANAGER, psthread_schedule_next_adv(), tv_gteq(), and tv_sub().

Referenced by async_manager_thread().

Here is the call graph for this function:

static int async_manager_thread void *  arg  )  [static]
 

Function to start async_manager as a standalone thread

When more kernel threads are used, one async manager should exist per thread. The particular implementation may change, currently one async_manager is started automatically per kernel thread except main thread.

Definition at line 562 of file async.c.

References async_futex, async_manager_worker(), and futex_up().

Referenced by async_create_manager().

Here is the call graph for this function:

static void reply_received void *  private,
int  retval,
ipc_call_t data
[static]
 

IPC handler for messages in async framework

Notify thread that is waiting for this message, that it arrived

Definition at line 602 of file async.c.

References awaiter_t::active, async_futex, amsg_t::dataptr, amsg_t::done, futex_down(), futex_up(), awaiter_t::inlist, awaiter_t::link, list_remove(), psthread_add_ready(), awaiter_t::ptid, amsg_t::retval, and amsg_t::wdata.

Referenced by async_send_2(), and async_send_3().

Here is the call graph for this function:

static int printf_putnchars const char *  buf,
size_t  count,
struct printf_spec ps
[static]
 

Print count chars from buffer without adding newline

Parameters:
buf Buffer with size at least count bytes - NULL pointer NOT allowed!
count 
ps output method and its data
Returns:
number of printed characters

Definition at line 81 of file printf_core.c.

References printf_spec::data, and printf_spec::write.

Referenced by print_string(), printf_core(), and printf_putstr().

static int printf_putstr const char *  str,
struct printf_spec ps
[static]
 

Print string without added newline

Parameters:
str string to print
ps write function specification and support data
Returns:
number of printed characters

Definition at line 91 of file printf_core.c.

References printf_spec::data, NULL, printf_putnchars(), and printf_spec::write.

Referenced by print_number(), and print_string().

Here is the call graph for this function:

static int printf_putchar int  c,
struct printf_spec ps
[static]
 

Print one character to output

Parameters:
c one character
ps output method
Returns:
number of printed characters

Definition at line 113 of file printf_core.c.

References printf_spec::data, and printf_spec::write.

Referenced by print_char(), print_number(), and print_string().

static int print_char char  c,
int  width,
uint64_t  flags,
struct printf_spec ps
[static]
 

Print one formatted character

Parameters:
c character to print
width 
flags 
Returns:
number of printed characters

Definition at line 126 of file printf_core.c.

References __PRINTF_FLAG_LEFTALIGNED, and printf_putchar().

Referenced by printf_core().

Here is the call graph for this function:

static int print_string char *  s,
int  width,
int  precision,
uint64_t  flags,
struct printf_spec ps
[static]
 

Print one string

Parameters:
s string
width 
precision 
flags 
Returns:
number of printed characters

Definition at line 156 of file printf_core.c.

References __PRINTF_FLAG_LEFTALIGNED, NULL, printf_putchar(), printf_putnchars(), printf_putstr(), and strlen().

Referenced by printf_core().

Here is the call graph for this function:

static int print_number uint64_t  num,
int  width,
int  precision,
int  base,
uint64_t  flags,
struct printf_spec ps
[static]
 

Print number in given base

Print significant digits of a number in given base.

Parameters:
num Number to print.
width 
precision 
base Base to print the number in (should be in range 2 .. 16).
flags output modifiers
Returns:
number of printed characters

Definition at line 217 of file printf_core.c.

References __PRINTF_FLAG_BIGCHARS, __PRINTF_FLAG_LEFTALIGNED, __PRINTF_FLAG_NEGATIVE, __PRINTF_FLAG_PREFIX, __PRINTF_FLAG_SHOWPLUS, __PRINTF_FLAG_SIGNED, __PRINTF_FLAG_SPACESIGN, __PRINTF_FLAG_ZEROPADDED, digits_big, digits_small, PRINT_NUMBER_BUFFER_SIZE, printf_putchar(), and printf_putstr().

Referenced by printf_core().

Here is the call graph for this function:

static ssize_t write_stderr void *  param,
const void *  buf,
size_t  count
[static]
 

Definition at line 62 of file stream.c.

Referenced by open().

static ssize_t read_stdin void *  param,
void *  buf,
size_t  count
[static]
 

Definition at line 67 of file stream.c.

References async_req_2(), CONSOLE_GETCHAR, phone, and streams.

Referenced by open_stdin().

Here is the call graph for this function:

static ssize_t write_stdout void *  param,
const void *  buf,
size_t  count
[static]
 

Definition at line 81 of file stream.c.

References async_msg, CONSOLE_PUTCHAR, phone, and streams.

Referenced by open_stdout().

static stream_t open_stdin void   )  [static]
 

Definition at line 92 of file stream.c.

References console_phone, ipc_connect_me_to(), NULL, stream_t::param, stream_t::phone, stream_t::r, read_stdin(), SERVICE_CONSOLE, usleep(), and stream_t::w.

Referenced by open().

Here is the call graph for this function:

static stream_t open_stdout void   )  [static]
 

Definition at line 110 of file stream.c.

References console_phone, ipc_connect_me_to(), NULL, stream_t::param, stream_t::phone, stream_t::r, SERVICE_CONSOLE, usleep(), stream_t::w, and write_stdout().

Referenced by open().

Here is the call graph for this function:

static ssize_t write_null void *  param,
const void *  buf,
size_t  count
[static]
 

Definition at line 128 of file stream.c.

Referenced by open().

int vprintf_write const char *  str,
size_t  count,
void *  unused
 

Definition at line 42 of file vprintf.c.

References write().

Referenced by vprintf().

Here is the call graph for this function:

int vsnprintf_write const char *  str,
size_t  count,
struct vsnprintf_data data
 

Write string to given buffer. Write at most data->size characters including trailing zero. According to C99 has snprintf to return number of characters that would have been written if enough space had been available. Hence the return value is not number of really printed characters but size of input string. Number of really used characters is stored in data->len.

Parameters:
str source string to print
count size of source string
data structure with destination string, counter of used space and total string size.
Returns:
number of characters to print (not characters really printed!)

Definition at line 59 of file vsnprintf.c.

References vsnprintf_data::len, memcpy(), vsnprintf_data::size, and vsnprintf_data::string.

Referenced by vsnprintf().

Here is the call graph for this function:

static LIST_INITIALIZE ready_list   )  [static]
 

static LIST_INITIALIZE serialized_list   )  [static]
 

static LIST_INITIALIZE manager_list   )  [static]
 

void psthread_main void   )  [static]
 

Function that is called on entry to new uspace thread

Definition at line 93 of file psthread.c.

References __tcb_get(), psthread_data::arg, psthread_data::finished, psthread_data::func, psthread_data::link, list_append(), PS_FROM_DEAD, tcb_t::pst_data, psthread_schedule_next_adv(), psthread_data::retval, and psthread_data::waiter.

Referenced by psthread_create().

Here is the call graph for this function:

static void* unaligned_memcpy void *  dst,
const void *  src,
size_t  n
[static]
 

Definition at line 58 of file string.c.

Referenced by memcpy().

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.

Parameters:
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 its set to 1 if minus found
Returns:
result of conversion.

Definition at line 174 of file string.c.

References isspace(), and ULONG_MAX.

Referenced by strtol(), and strtoul().

Here is the call graph for this function:

static LIST_INITIALIZE thread_garbage   )  [static]
 

int thread_create void(*)(void *)  function,
void *  arg,
char *  name
 

Create userspace thread.

This function creates new userspace thread and allocates userspace stack and userspace argument structure for it.

Parameters:
function Function implementing the thread.
arg Argument to be passed to thread.
name Symbolic name of the thread.
Returns:
TID of the new thread on success or -1 on failure.

Definition at line 122 of file generic/thread.c.

References __SYSCALL2, __thread_entry(), getpagesize, and THREAD_INITIAL_STACK_PAGES_NO.

Here is the call graph for this function:


Variable Documentation

atomic_t async_futex
 

Asynchronous library

The aim of this library is facilitating writing programs utilizing 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.

Default semantics:

  • send() - send asynchronously. If the kernel refuses to send more messages, [ try to get responses from kernel, if nothing found, might try synchronous ]

Example of use:

1) Multithreaded client application create_thread(thread1); create_thread(thread2); ...

thread1() { conn = ipc_connect_me_to(); c1 = send(conn); c2 = send(conn); wait_for(c1); wait_for(c2); }

2) Multithreaded server application main() { async_manager(); }

client_connection(icallid, *icall) { if (want_refuse) { ipc_answer_fast(icallid, ELIMIT, 0, 0); return; } ipc_answer_fast(icallid, 0, 0, 0);

callid = async_get_call(&call); handle(callid, call); ipc_answer_fast(callid, 1,2,3);

callid = async_get_call(&call); .... }

TODO: Detaching/joining dead psthreads?

Definition at line 102 of file async.c.

Referenced by async_get_call_timeout(), async_manager_thread(), async_manager_worker(), async_new_connection(), async_usleep(), async_wait_for(), async_wait_timeout(), connection_thread(), handle_expired_timeouts(), ipc_finish_async(), reply_received(), route_call(), and try_dispatch_queued_calls().

size_t heapsize = 0 [static]
 

Definition at line 77 of file as.c.

Referenced by sbrk().

size_t maxheapsize = (size_t) (-1) [static]
 

Definition at line 78 of file as.c.

Referenced by as_get_mappable_page(), sbrk(), and set_maxheapsize().

void* last_allocated = 0 [static]
 

Definition at line 80 of file as.c.

char _heap
 

Referenced by __main().

atomic_t async_futex = FUTEX_INITIALIZER
 

Asynchronous library

The aim of this library is facilitating writing programs utilizing 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.

Default semantics:

  • send() - send asynchronously. If the kernel refuses to send more messages, [ try to get responses from kernel, if nothing found, might try synchronous ]

Example of use:

1) Multithreaded client application create_thread(thread1); create_thread(thread2); ...

thread1() { conn = ipc_connect_me_to(); c1 = send(conn); c2 = send(conn); wait_for(c1); wait_for(c2); }

2) Multithreaded server application main() { async_manager(); }

client_connection(icallid, *icall) { if (want_refuse) { ipc_answer_fast(icallid, ELIMIT, 0, 0); return; } ipc_answer_fast(icallid, 0, 0, 0);

callid = async_get_call(&call); handle(callid, call); ipc_answer_fast(callid, 1,2,3);

callid = async_get_call(&call); .... }

TODO: Detaching/joining dead psthreads?

Definition at line 102 of file async.c.

Referenced by async_get_call_timeout(), async_manager_thread(), async_manager_worker(), async_new_connection(), async_usleep(), async_wait_for(), async_wait_timeout(), connection_thread(), handle_expired_timeouts(), ipc_finish_async(), reply_received(), route_call(), and try_dispatch_queued_calls().

hash_table_t conn_hash_table [static]
 

Definition at line 103 of file async.c.

Referenced by _async_init(), async_new_connection(), connection_thread(), and route_call().

__thread connection_t* PS_connection
 

Identifier of incoming connection handled by current thread

Definition at line 145 of file async.c.

Referenced by async_get_call_timeout(), and connection_thread().

__thread int in_interrupt_handler
 

If true, it is forbidden to use async_req functions and all preemption is disabled

Definition at line 148 of file async.c.

Referenced by async_msg_2(), async_msg_3(), async_send_2(), async_send_3(), async_usleep(), and handle_call().

async_client_conn_t client_connection = default_client_connection [static]
 

Definition at line 152 of file async.c.

Referenced by async_set_client_connection(), handle_call(), and main().

async_client_conn_t interrupt_received = default_interrupt_received [static]
 

Definition at line 153 of file async.c.

Referenced by async_set_interrupt_received(), and main().

hash_table_operations_t conn_hash_table_ops [static]
 

Initial value:

 {
        .hash = conn_hash,
        .compare = conn_compare,
        .remove_callback = conn_remove
}
Operations for NS hash table.

Definition at line 223 of file async.c.

Referenced by _async_init().

char nl = '\n' [static]
 

Definition at line 40 of file io.c.

Referenced by puts().

char digits_small[] = "0123456789abcdef" [static]
 

Small hexadecimal characters

Definition at line 72 of file printf_core.c.

Referenced by print_number().

char digits_big[] = "0123456789ABCDEF" [static]
 

Big hexadecimal characters

Definition at line 73 of file printf_core.c.

Referenced by print_number().

int console_phone = -1 [static]
 

Definition at line 59 of file stream.c.

Referenced by open_stdin(), and open_stdout().

stream_t streams[FDS] [static]
 

Definition at line 60 of file stream.c.

Referenced by get_fd_phone(), open(), read(), read_stdin(), write(), and write_stdout().

char _heap
 

atomic_t psthread_futex = FUTEX_INITIALIZER [static]
 

Definition at line 56 of file psthread.c.

Referenced by psthread_add_manager(), psthread_add_ready(), psthread_remove_manager(), and psthread_schedule_next_adv().

int serialized_threads [static]
 

Count of real threads that are in async_serialized mode

Definition at line 58 of file psthread.c.

Referenced by psthread_schedule_next_adv().

__thread int serialization_count [static]
 

Thread-local count of serialization. If >0, we must not preempt

Definition at line 60 of file psthread.c.

Referenced by psthread_dec_sercount(), psthread_inc_sercount(), and psthread_schedule_next_adv().

int threads_in_manager [static]
 

Counter of threads residing in async_manager

Definition at line 62 of file psthread.c.

Referenced by psthread_schedule_next_adv().

long glbl_seed = 1 [static]
 

Definition at line 37 of file stdlib.c.

Referenced by random(), and srandom().

struct along packed
 

char _tdata_start
 

char _tdata_end
 

Referenced by __make_tls().

char _tbss_start
 

Referenced by __make_tls().

char _tbss_end
 

struct { ... } * ktime
 

Referenced by gettimeofday().

int phone [inherited]
 

Framebuffer phone

Definition at line 65 of file console.c.

ipcarg_t rows [inherited]
 

Framebuffer rows

Definition at line 66 of file console.c.

ipcarg_t cols [inherited]
 

Framebuffer columns

Definition at line 67 of file console.c.

volatile sysarg_t seconds1 [inherited]
 

Definition at line 51 of file time.c.

volatile sysarg_t useconds [inherited]
 

Definition at line 52 of file time.c.

volatile sysarg_t seconds2 [inherited]
 

Definition at line 53 of file time.c.


Generated on Sun Jun 18 18:04:29 2006 for HelenOS Userspace (ia64) by  doxygen 1.4.6