Changeset 1787e527 in mainline for uspace/lib/libc/include


Ignore:
Timestamp:
2009-11-16T21:22:54Z (16 years ago)
Author:
Lenka Trochtova <trochtova.lenka@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5ebdf94
Parents:
fcbd1be (diff), 9c70ed6 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merged with head (unstable)

Location:
uspace/lib/libc/include
Files:
13 edited
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/include/async.h

    rfcbd1be r1787e527  
    4747extern atomic_t async_futex;
    4848
     49extern atomic_t threads_in_ipc_wait;
     50
    4951extern int __async_init(void);
    5052extern ipc_callid_t async_get_call_timeout(ipc_call_t *call, suseconds_t usecs);
     
    257259}
    258260
     261/*
     262 * User-friendly wrappers for async_share_in_start().
     263 */
     264#define async_share_in_start_0_0(phoneid, dst, size) \
     265        async_share_in_start((phoneid), (dst), (size), 0, NULL)
     266#define async_share_in_start_0_1(phoneid, dst, size, flags) \
     267        async_share_in_start((phoneid), (dst), (size), 0, (flags))
     268#define async_share_in_start_1_0(phoneid, dst, size, arg) \
     269        async_share_in_start((phoneid), (dst), (size), (arg), NULL)
     270#define async_share_in_start_1_1(phoneid, dst, size, arg, flags) \
     271        async_share_in_start((phoneid), (dst), (size), (arg), (flags))
     272
     273extern int async_share_in_start(int, void *, size_t, ipcarg_t, int *);
     274extern int async_share_in_receive(ipc_callid_t *, size_t *);
     275extern int async_share_in_finalize(ipc_callid_t, void *, int );
     276extern int async_share_out_start(int, void *, int);
     277extern int async_share_out_receive(ipc_callid_t *, size_t *, int *);
     278extern int async_share_out_finalize(ipc_callid_t, void *);
     279extern int async_data_read_start(int, void *, size_t);
     280extern int async_data_read_receive(ipc_callid_t *, size_t *);
     281extern int async_data_read_finalize(ipc_callid_t, const void *, size_t);
     282extern int async_data_write_start(int, const void *, size_t);
     283extern int async_data_write_receive(ipc_callid_t *, size_t *);
     284extern int async_data_write_finalize(ipc_callid_t, void *, size_t);
     285
    259286#endif
    260287
  • uspace/lib/libc/include/async_priv.h

    rfcbd1be r1787e527  
    11/*
    2  * Copyright (c) 2005 Jakub Jermar
     2 * Copyright (c) 2006 Ondrej Palkovsky
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup libcia32
     29/** @addtogroup libc
    3030 * @{
    3131 */
     
    3333 */
    3434
    35 /*
    36  * Variable argument list manipulation macros
    37  * for architectures using stack to pass arguments.
    38  */
    39  
    40 #ifndef LIBC_ia32_STACKARG_H_
    41 #define LIBC_ia32_STACKARG_H_
     35#ifndef LIBC_ASYNC_PRIV_H_
     36#define LIBC_ASYNC_PRIV_H_
    4237
    43 #include <sys/types.h>
     38#include <adt/list.h>
     39#include <fibril.h>
     40#include <sys/time.h>
     41#include <bool.h>
    4442
    45 /* dont allow to define it second time in stdarg.h */
    46 #define __VARARGS_DEFINED
     43/** Structures of this type are used to track the timeout events. */
     44typedef struct {
     45        /** If true, this struct is in the timeout list. */
     46        bool inlist;
     47       
     48        /** Timeout list link. */
     49        link_t link;
     50       
     51        /** If true, we have timed out. */
     52        bool occurred;
    4753
    48 typedef struct va_list {
    49         int pos;
    50         uint8_t *last;
    51 } va_list;
     54        /** Expiration time. */
     55        struct timeval expires;
     56} to_event_t;
    5257
    53 #define va_start(ap, lst) \
    54         (ap).pos = sizeof(lst);                         \
    55         (ap).last = (uint8_t *) &(lst)
     58/** Structures of this type are used to track the wakeup events. */
     59typedef struct {
     60        /** If true, this struct is in a synchronization object wait queue. */
     61        bool inlist;
     62       
     63        /** Wait queue linkage. */
     64        link_t link;
     65} wu_event_t;
    5666
    57 #define va_arg(ap, type)                \
    58         (*((type *)((ap).last + ((ap).pos  += sizeof(type) ) - sizeof(type))))
    5967
    60 #define va_end(ap)
     68/** Structures of this type represent a waiting fibril. */
     69typedef struct {
     70        /** Identification of and link to the waiting fibril. */
     71        fid_t fid;
     72       
     73        /** If true, this fibril is currently active. */
     74        bool active;
    6175
     76        /** Timeout wait data. */
     77        to_event_t to_event;
     78        /** Wakeup wait data. */
     79        wu_event_t wu_event;
     80} awaiter_t;
     81
     82extern void async_insert_timeout(awaiter_t *wd);
    6283
    6384#endif
  • uspace/lib/libc/include/fcntl.h

    rfcbd1be r1787e527  
    4343#define O_RDWR    32
    4444#define O_WRONLY  64
     45#define O_DESC    128
    4546
    4647extern int open(const char *, int, ...);
  • uspace/lib/libc/include/fibril_sync.h

    rfcbd1be r1787e527  
    4040#include <adt/list.h>
    4141#include <libarch/tls.h>
     42#include <sys/time.h>
    4243
    4344typedef struct {
     
    9596
    9697extern void fibril_condvar_initialize(fibril_condvar_t *);
     98extern int fibril_condvar_wait_timeout(fibril_condvar_t *, fibril_mutex_t *,
     99    suseconds_t);
    97100extern void fibril_condvar_wait(fibril_condvar_t *, fibril_mutex_t *);
    98101extern void fibril_condvar_signal(fibril_condvar_t *);
  • uspace/lib/libc/include/io/console.h

    rfcbd1be r1787e527  
    6868extern void console_clear(int phone);
    6969
    70 extern int console_get_size(int phone, ipcarg_t *rows, ipcarg_t *cols);
    71 extern void console_goto(int phone, ipcarg_t row, ipcarg_t col);
     70extern int console_get_size(int phone, int *cols, int *rows);
     71extern void console_goto(int phone, int col, int row);
    7272
    7373extern void console_set_style(int phone, int style);
  • uspace/lib/libc/include/ipc/bd.h

    rfcbd1be r1787e527  
    3939
    4040typedef enum {
    41         BD_READ_BLOCK = IPC_FIRST_USER_METHOD,
    42         BD_WRITE_BLOCK
     41        BD_GET_BLOCK_SIZE = IPC_FIRST_USER_METHOD,
     42        BD_READ_BLOCKS,
     43        BD_WRITE_BLOCKS
    4344} bd_request_t;
    4445
  • uspace/lib/libc/include/ipc/ipc.h

    rfcbd1be r1787e527  
    192192extern ipc_callid_t ipc_wait_cycle(ipc_call_t *, uint32_t, int);
    193193extern ipc_callid_t ipc_wait_for_call_timeout(ipc_call_t *, uint32_t);
     194extern void ipc_poke(void);
    194195
    195196static inline ipc_callid_t ipc_wait_for_call(ipc_call_t *data)
     
    282283
    283284extern int ipc_share_in_start(int, void *, size_t, ipcarg_t, int *);
    284 extern int ipc_share_in_receive(ipc_callid_t *, size_t *);
    285285extern int ipc_share_in_finalize(ipc_callid_t, void *, int );
    286286extern int ipc_share_out_start(int, void *, int);
    287 extern int ipc_share_out_receive(ipc_callid_t *, size_t *, int *);
    288287extern int ipc_share_out_finalize(ipc_callid_t, void *);
    289288extern int ipc_data_read_start(int, void *, size_t);
    290 extern int ipc_data_read_receive(ipc_callid_t *, size_t *);
    291289extern int ipc_data_read_finalize(ipc_callid_t, const void *, size_t);
    292290extern int ipc_data_write_start(int, const void *, size_t);
    293 extern int ipc_data_write_receive(ipc_callid_t *, size_t *);
    294291extern int ipc_data_write_finalize(ipc_callid_t, void *, size_t);
    295292
  • uspace/lib/libc/include/ipc/loader.h

    rfcbd1be r1787e527  
    4141        LOADER_HELLO = IPC_FIRST_USER_METHOD,
    4242        LOADER_GET_TASKID,
     43        LOADER_SET_CWD,
    4344        LOADER_SET_PATHNAME,
    4445        LOADER_SET_ARGS,
  • uspace/lib/libc/include/ipc/vfs.h

    rfcbd1be r1787e527  
    7373        VFS_IN_UNLINK,
    7474        VFS_IN_RENAME,
    75         VFS_IN_STAT
     75        VFS_IN_STAT,
     76        VFS_IN_DUP
    7677} vfs_in_request_t;
    7778
  • uspace/lib/libc/include/loader/loader.h

    rfcbd1be r1787e527  
    4949extern loader_t *loader_connect(void);
    5050extern int loader_get_task_id(loader_t *, task_id_t *);
     51extern int loader_set_cwd(loader_t *);
    5152extern int loader_set_pathname(loader_t *, const char *);
    5253extern int loader_set_args(loader_t *, char *const[]);
  • uspace/lib/libc/include/loader/pcb.h

    rfcbd1be r1787e527  
    5252        /** Program entry point. */
    5353        entry_point_t entry;
     54
     55        /** Current working directory. */
     56        char *cwd;
    5457       
    5558        /** Number of command-line arguments. */
  • uspace/lib/libc/include/malloc.h

    rfcbd1be r1787e527  
    4242
    4343extern void *malloc(const size_t size);
     44extern void *calloc(const size_t nmemb, const size_t size);
    4445extern void *memalign(const size_t align, const size_t size);
    4546extern void *realloc(const void *addr, const size_t size);
  • uspace/lib/libc/include/stdarg.h

    rfcbd1be r1787e527  
    3737
    3838#include <sys/types.h>
    39 #include <libarch/stackarg.h>
    40 
    41 #ifndef __VARARGS_DEFINED
    42 # define __VARARGS_DEFINED
    4339
    4440typedef __builtin_va_list va_list;
    4541
    46 # define va_start(ap, last)             __builtin_va_start(ap, last)
    47 # define va_arg(ap, type)               __builtin_va_arg(ap, type)
    48 # define va_end(ap)                     __builtin_va_end(ap)
    49 
    50 # endif
     42#define va_start(ap, last)  __builtin_va_start(ap, last)
     43#define va_arg(ap, type)    __builtin_va_arg(ap, type)
     44#define va_end(ap)          __builtin_va_end(ap)
    5145
    5246#endif
  • uspace/lib/libc/include/unistd.h

    rfcbd1be r1787e527  
    5151#endif
    5252
     53extern int dup2(int oldfd, int newfd);
     54
    5355extern ssize_t write(int, const void *, size_t);
    5456extern ssize_t read(int, void *, size_t);
Note: See TracChangeset for help on using the changeset viewer.