Changeset 06b0211b in mainline for uspace/lib


Ignore:
Timestamp:
2013-04-29T11:29:45Z (12 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
aa2b32c
Parents:
ba4799a (diff), df956b9b (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:

Merge mainline changes

Location:
uspace/lib
Files:
64 added
64 deleted
31 edited
109 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/Makefile

    rba4799a r06b0211b  
    3131ROOT_PATH = $(USPACE_PREFIX)/..
    3232
    33 INCLUDE_ABI = include/abi
    34 INCLUDE_LIBARCH = include/libarch
    35 
    3633COMMON_MAKEFILE = $(ROOT_PATH)/Makefile.common
    3734COMMON_HEADER = $(ROOT_PATH)/common.h
    38 COMMON_HEADER_ARCH = arch/$(UARCH)/include/common.h
     35COMMON_HEADER_ARCH = arch/$(UARCH)/include/libarch/common.h
    3936
    4037CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config
     
    4643        $(LIBC_PREFIX)/arch/$(UARCH)/_link-dlexe.ld
    4744
    48 PRE_DEPEND = $(INCLUDE_ABI) $(INCLUDE_LIBARCH) $(COMMON_HEADER_ARCH)
     45PRE_DEPEND = $(COMMON_HEADER_ARCH)
    4946EXTRA_OUTPUT = $(LINKER_SCRIPTS)
    50 EXTRA_CLEAN = $(INCLUDE_ABI) $(INCLUDE_LIBARCH) $(COMMON_HEADER_ARCH) $(LINKER_SCRIPTS)
     47EXTRA_CLEAN = $(COMMON_HEADER_ARCH) $(LINKER_SCRIPTS)
    5148LIBRARY = libc
    5249SLIBRARY = libc.so.0.0
     
    162159include $(USPACE_PREFIX)/Makefile.common
    163160
    164 $(INCLUDE_LIBARCH): arch/$(UARCH)/include
    165         ln -sfn ../$< $@
    166 
    167 $(INCLUDE_ABI): ../../../abi/include/
    168         ln -sfn ../$< $@
    169161
    170162$(LIBC_PREFIX)/arch/$(UARCH)/_link.ld: $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld.in
     
    181173
    182174$(COMMON_HEADER_ARCH): $(COMMON_HEADER)
    183         ln -sfn ../../../$< $@
     175        ln -sfn ../../../../$< $@
  • uspace/lib/c/arch/abs32le/src/tls.c

    rba4799a r06b0211b  
    3434#include <unistd.h>
    3535
    36 tcb_t * __alloc_tls(void **data, size_t size)
     36tcb_t * tls_alloc_arch(void **data, size_t size)
    3737{
    3838        return tls_alloc_variant_2(data, size);
    3939}
    4040
    41 void __free_tls_arch(tcb_t *tcb, size_t size)
     41void tls_free_arch(tcb_t *tcb, size_t size)
    4242{
    4343        tls_free_variant_2(tcb, size);
  • uspace/lib/c/arch/amd64/src/tls.c

    rba4799a r06b0211b  
    3838#include <sys/types.h>
    3939
    40 tcb_t * __alloc_tls(void **data, size_t size)
     40tcb_t *tls_alloc_arch(void **data, size_t size)
    4141{
    4242        return tls_alloc_variant_2(data, size);
    4343}
    4444
    45 void __free_tls_arch(tcb_t *tcb, size_t size)
     45void tls_free_arch(tcb_t *tcb, size_t size)
    4646{
    4747        tls_free_variant_2(tcb, size);
  • uspace/lib/c/arch/arm32/src/tls.c

    rba4799a r06b0211b  
    3838#include <sys/types.h>
    3939
    40 tcb_t * __alloc_tls(void **data, size_t size)
     40tcb_t *tls_alloc_arch(void **data, size_t size)
    4141{
    4242        return tls_alloc_variant_1(data, size);
    4343}
    4444
    45 void __free_tls_arch(tcb_t *tcb, size_t size)
     45void tls_free_arch(tcb_t *tcb, size_t size)
    4646{
    4747        tls_free_variant_1(tcb, size);
  • uspace/lib/c/arch/ia32/src/setjmp.S

    rba4799a r06b0211b  
    3535.type setjmp,@function
    3636setjmp:
    37         movl 0(%esp),%eax       # save pc value into eax       
    38         movl 4(%esp),%edx       # address of the jmp_buf structure to save context to
    39 
    40                 # save registers to the jmp_buf structure
     37        movl 0(%esp),%eax  # save pc value into eax
     38        movl 4(%esp),%edx  # address of the jmp_buf structure to save context to
     39       
     40        # save registers to the jmp_buf structure
    4141        CONTEXT_SAVE_ARCH_CORE %edx %eax
    42 
    43         xorl %eax,%eax          # set_jmp returns 0
     42       
     43        xorl %eax,%eax  # set_jmp returns 0
    4444        ret
    4545
    4646.type longjmp,@function
    4747longjmp:
    48 
    49         movl 4(%esp), %ecx      # put address of jmp_buf into ecx
    50         movl 8(%esp), %eax      # put return value into eax     
    51 
    52                 # restore registers from the jmp_buf structure
     48        movl 4(%esp), %ecx  # put address of jmp_buf into ecx
     49        movl 8(%esp), %eax  # put return value into eax
     50       
     51        # restore registers from the jmp_buf structure
    5352        CONTEXT_RESTORE_ARCH_CORE %ecx %edx
    54 
    55         movl %edx,0(%esp)       # put saved pc on stack
     53       
     54        movl %edx,0(%esp)  # put saved pc on stack
    5655        ret
    57 
  • uspace/lib/c/arch/ia32/src/tls.c

    rba4799a r06b0211b  
    3939#include <align.h>
    4040
    41 tcb_t * __alloc_tls(void **data, size_t size)
     41tcb_t *tls_alloc_arch(void **data, size_t size)
    4242{
    4343        return tls_alloc_variant_2(data, size);
    4444}
    4545
    46 void __free_tls_arch(tcb_t *tcb, size_t size)
     46void tls_free_arch(tcb_t *tcb, size_t size)
    4747{
    4848        tls_free_variant_2(tcb, size);
  • uspace/lib/c/arch/ia64/src/tls.c

    rba4799a r06b0211b  
    3838#include <malloc.h>
    3939
    40 tcb_t * __alloc_tls(void **data, size_t size)
     40tcb_t *tls_alloc_arch(void **data, size_t size)
    4141{
    4242        return tls_alloc_variant_1(data, size);
    4343}
    4444
    45 void __free_tls_arch(tcb_t *tcb, size_t size)
     45void tls_free_arch(tcb_t *tcb, size_t size)
    4646{
    4747        tls_free_variant_1(tcb, size);
  • uspace/lib/c/arch/mips32/Makefile.common

    rba4799a r06b0211b  
    2727#
    2828
    29 GCC_CFLAGS += -msoft-float -mips3 -mabi=32
     29GCC_CFLAGS += -msoft-float -mabi=32
    3030BASE_LIBS += $(LIBSOFTFLOAT_PREFIX)/libsoftfloat.a
    3131
     
    3434BFD_ARCH = mips
    3535BFD_NAME = elf32-tradlittlemips
     36
     37ifeq ($(MACHINE),msim)
     38        GCC_CFLAGS += -march=r4000
     39endif
     40
     41ifeq ($(MACHINE),lmalta)
     42        GCC_CFLAGS += -march=4kc
     43endif
     44
  • uspace/lib/c/arch/mips32/src/tls.c

    rba4799a r06b0211b  
    3737#include <sys/types.h>
    3838
    39 tcb_t * __alloc_tls(void **data, size_t size)
     39tcb_t * tls_alloc_arch(void **data, size_t size)
    4040{
    4141        return tls_alloc_variant_1(data, size);
    4242}
    4343
    44 void __free_tls_arch(tcb_t *tcb, size_t size)
     44void tls_free_arch(tcb_t *tcb, size_t size)
    4545{
    4646        tls_free_variant_1(tcb, size);
  • uspace/lib/c/arch/mips32eb/Makefile.common

    rba4799a r06b0211b  
    2727#
    2828
    29 GCC_CFLAGS += -msoft-float -mips3 -mabi=32
     29GCC_CFLAGS += -msoft-float -mabi=32
    3030BASE_LIBS += $(LIBSOFTFLOAT_PREFIX)/libsoftfloat.a
    3131
     
    3434BFD_ARCH = mips
    3535BFD_NAME = elf32-tradbigmips
     36
     37ifeq ($(MACHINE),bmalta)
     38        GCC_CFLAGS += -march=4kc
     39endif
     40
  • uspace/lib/c/arch/mips64/src/tls.c

    rba4799a r06b0211b  
    3737#include <sys/types.h>
    3838
    39 tcb_t * __alloc_tls(void **data, size_t size)
     39tcb_t *tls_alloc_arch(void **data, size_t size)
    4040{
    4141        return tls_alloc_variant_1(data, size);
    4242}
    4343
    44 void __free_tls_arch(tcb_t *tcb, size_t size)
     44void tls_free_arch(tcb_t *tcb, size_t size)
    4545{
    4646        tls_free_variant_1(tcb, size);
  • uspace/lib/c/arch/ppc32/src/tls.c

    rba4799a r06b0211b  
    3636#include <sys/types.h>
    3737
    38 tcb_t * __alloc_tls(void **data, size_t size)
     38tcb_t *tls_alloc_arch(void **data, size_t size)
    3939{
    4040        return tls_alloc_variant_1(data, size);
    4141}
    4242
    43 void __free_tls_arch(tcb_t *tcb, size_t size)
     43void tls_free_arch(tcb_t *tcb, size_t size)
    4444{
    4545        tls_free_variant_1(tcb, size);
  • uspace/lib/c/arch/sparc64/src/tls.c

    rba4799a r06b0211b  
    3838#include <sys/types.h>
    3939
    40 tcb_t * __alloc_tls(void **data, size_t size)
     40tcb_t *tls_alloc_arch(void **data, size_t size)
    4141{
    4242        return tls_alloc_variant_2(data, size);
    4343}
    4444
    45 void __free_tls_arch(tcb_t *tcb, size_t size)
     45void tls_free_arch(tcb_t *tcb, size_t size)
    4646{
    4747        tls_free_variant_2(tcb, size);
  • uspace/lib/c/generic/adt/hash_table.c

    rba4799a r06b0211b  
    8181 * @param init_size Initial desired number of hash table buckets. Pass zero
    8282 *                 if you want the default initial size.
    83  * @param max_keys Maximal number of keys needed to identify an item.
     83 * @param max_load The table is resized when the average load per bucket
     84 *                 exceeds this number. Pass zero if you want the default.
    8485 * @param op       Hash table operations structure. remove_callback()
    8586 *                 is optional and can be NULL if no action is to be taken
  • uspace/lib/c/generic/async.c

    rba4799a r06b0211b  
    350350static async_client_conn_t client_connection = default_client_connection;
    351351static async_interrupt_handler_t interrupt_received = default_interrupt_received;
     352static size_t interrupt_handler_stksz = FIBRIL_DFLT_STK_SIZE;
    352353
    353354/** Setter for client_connection function pointer.
     
    370371{
    371372        interrupt_received = intr;
     373}
     374
     375/** Set the stack size for the interrupt handler notification fibrils.
     376 *
     377 * @param size Stack size in bytes.
     378 */
     379void async_set_interrupt_handler_stack_size(size_t size)
     380{
     381        interrupt_handler_stksz = size;
    372382}
    373383
     
    587597        msg->call = *call;
    588598       
    589         fid_t fid = fibril_create(notification_fibril, msg);
     599        fid_t fid = fibril_create_generic(notification_fibril, msg,
     600            interrupt_handler_stksz);
    590601        if (fid == 0) {
    591602                free(msg);
     
    20572068       
    20582069        async_sess_t *sess = exch->sess;
     2070        assert(sess != NULL);
    20592071       
    20602072        atomic_dec(&sess->refcnt);
     
    20782090 * @param arg   User defined argument.
    20792091 * @param flags Storage for the received flags. Can be NULL.
    2080  * @param dst   Destination address space area base. Cannot be NULL.
     2092 * @param dst   Address of the storage for the destination address space area
     2093 *              base address. Cannot be NULL.
    20812094 *
    20822095 * @return Zero on success or a negative error code from errno.h.
     
    22062219 *
    22072220 * @param callid Hash of the IPC_M_DATA_WRITE call to answer.
    2208  * @param dst    Destination address space area base address.
     2221 * @param dst    Address of the storage for the destination address space area
     2222 *               base address.
    22092223 *
    22102224 * @return Zero on success or a value from @ref errno.h on failure.
  • uspace/lib/c/generic/fibril.c

    rba4799a r06b0211b  
    9595fibril_t *fibril_setup(void)
    9696{
    97         tcb_t *tcb = __make_tls();
     97        tcb_t *tcb = tls_make();
    9898        if (!tcb)
    9999                return NULL;
     
    101101        fibril_t *fibril = malloc(sizeof(fibril_t));
    102102        if (!fibril) {
    103                 __free_tls(tcb);
     103                tls_free(tcb);
    104104                return NULL;
    105105        }
     
    122122void fibril_teardown(fibril_t *fibril)
    123123{
    124         __free_tls(fibril->tcb);
     124        tls_free(fibril->tcb);
    125125        free(fibril);
    126126}
     
    256256 * @param func Implementing function of the new fibril.
    257257 * @param arg Argument to pass to func.
     258 * @param stksz Stack size in bytes.
    258259 *
    259260 * @return 0 on failure or TLS of the new fibril.
    260261 *
    261262 */
    262 fid_t fibril_create(int (*func)(void *), void *arg)
     263fid_t fibril_create_generic(int (*func)(void *), void *arg, size_t stksz)
    263264{
    264265        fibril_t *fibril;
     
    268269                return 0;
    269270       
    270         size_t stack_size = stack_size_get();
     271        size_t stack_size = (stksz == FIBRIL_DFLT_STK_SIZE) ?
     272            stack_size_get() : stksz;
    271273        fibril->stack = as_area_create((void *) -1, stack_size,
    272274            AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE | AS_AREA_GUARD |
  • uspace/lib/c/generic/net/socket_client.c

    rba4799a r06b0211b  
    192192/** Default thread for new connections.
    193193 *
    194  * @param[in] iid       The initial message identifier.
    195  * @param[in] icall     The initial message call structure.
    196  * @param[in] arg       Local argument.
     194 * @param[in] iid   The initial message identifier.
     195 * @param[in] icall The initial message call structure.
     196 * @param[in] arg   Local argument.
     197 *
    197198 */
    198199static void socket_connection(ipc_callid_t iid, ipc_call_t * icall, void *arg)
    199200{
    200         ipc_callid_t callid;
    201         ipc_call_t call;
    202         socket_t *socket;
    203         int rc;
    204 
    205 loop:
    206         callid = async_get_call(&call);
    207 
    208         switch (IPC_GET_IMETHOD(call)) {
    209         case NET_SOCKET_RECEIVED:
    210         case NET_SOCKET_ACCEPTED:
    211         case NET_SOCKET_DATA_FRAGMENT_SIZE:
    212                 fibril_rwlock_read_lock(&socket_globals.lock);
    213 
    214                 /* Find the socket */
    215                 socket = sockets_find(socket_get_sockets(),
    216                     SOCKET_GET_SOCKET_ID(call));
    217                 if (!socket) {
    218                         rc = ENOTSOCK;
    219                         fibril_rwlock_read_unlock(&socket_globals.lock);
    220                         break;
     201        while (true) {
     202                ipc_call_t call;
     203                ipc_callid_t callid = async_get_call(&call);
     204               
     205                if (!IPC_GET_IMETHOD(call)) {
     206                        async_answer_0(callid, 0);
     207                        return;
    221208                }
     209               
     210                int rc;
    222211               
    223212                switch (IPC_GET_IMETHOD(call)) {
    224213                case NET_SOCKET_RECEIVED:
    225                         fibril_mutex_lock(&socket->receive_lock);
    226                         /* Push the number of received packet fragments */
    227                         rc = dyn_fifo_push(&socket->received,
    228                             SOCKET_GET_DATA_FRAGMENTS(call),
    229                             SOCKET_MAX_RECEIVED_SIZE);
    230                         if (rc == EOK) {
    231                                 /* Signal the received packet */
    232                                 fibril_condvar_signal(&socket->receive_signal);
     214                case NET_SOCKET_ACCEPTED:
     215                case NET_SOCKET_DATA_FRAGMENT_SIZE:
     216                        fibril_rwlock_read_lock(&socket_globals.lock);
     217                       
     218                        /* Find the socket */
     219                        socket_t *socket = sockets_find(socket_get_sockets(),
     220                            SOCKET_GET_SOCKET_ID(call));
     221                        if (!socket) {
     222                                rc = ENOTSOCK;
     223                                fibril_rwlock_read_unlock(&socket_globals.lock);
     224                                break;
    233225                        }
    234                         fibril_mutex_unlock(&socket->receive_lock);
     226                       
     227                        switch (IPC_GET_IMETHOD(call)) {
     228                        case NET_SOCKET_RECEIVED:
     229                                fibril_mutex_lock(&socket->receive_lock);
     230                                /* Push the number of received packet fragments */
     231                                rc = dyn_fifo_push(&socket->received,
     232                                    SOCKET_GET_DATA_FRAGMENTS(call),
     233                                    SOCKET_MAX_RECEIVED_SIZE);
     234                                if (rc == EOK) {
     235                                        /* Signal the received packet */
     236                                        fibril_condvar_signal(&socket->receive_signal);
     237                                }
     238                                fibril_mutex_unlock(&socket->receive_lock);
     239                                break;
     240                               
     241                        case NET_SOCKET_ACCEPTED:
     242                                /* Push the new socket identifier */
     243                                fibril_mutex_lock(&socket->accept_lock);
     244                                rc = dyn_fifo_push(&socket->accepted, 1,
     245                                    SOCKET_MAX_ACCEPTED_SIZE);
     246                                if (rc == EOK) {
     247                                        /* Signal the accepted socket */
     248                                        fibril_condvar_signal(&socket->accept_signal);
     249                                }
     250                                fibril_mutex_unlock(&socket->accept_lock);
     251                                break;
     252                       
     253                        default:
     254                                rc = ENOTSUP;
     255                        }
     256                       
     257                        if ((SOCKET_GET_DATA_FRAGMENT_SIZE(call) > 0) &&
     258                            (SOCKET_GET_DATA_FRAGMENT_SIZE(call) !=
     259                            socket->data_fragment_size)) {
     260                                fibril_rwlock_write_lock(&socket->sending_lock);
     261                               
     262                                /* Set the data fragment size */
     263                                socket->data_fragment_size =
     264                                    SOCKET_GET_DATA_FRAGMENT_SIZE(call);
     265                               
     266                                fibril_rwlock_write_unlock(&socket->sending_lock);
     267                        }
     268                       
     269                        fibril_rwlock_read_unlock(&socket_globals.lock);
    235270                        break;
    236 
    237                 case NET_SOCKET_ACCEPTED:
    238                         /* Push the new socket identifier */
    239                         fibril_mutex_lock(&socket->accept_lock);
    240                         rc = dyn_fifo_push(&socket->accepted, 1,
    241                             SOCKET_MAX_ACCEPTED_SIZE);
    242                         if (rc == EOK) {
    243                                 /* Signal the accepted socket */
    244                                 fibril_condvar_signal(&socket->accept_signal);
    245                         }
    246                         fibril_mutex_unlock(&socket->accept_lock);
    247                         break;
    248 
     271                       
    249272                default:
    250273                        rc = ENOTSUP;
    251274                }
    252 
    253                 if ((SOCKET_GET_DATA_FRAGMENT_SIZE(call) > 0) &&
    254                     (SOCKET_GET_DATA_FRAGMENT_SIZE(call) !=
    255                     socket->data_fragment_size)) {
    256                         fibril_rwlock_write_lock(&socket->sending_lock);
    257 
    258                         /* Set the data fragment size */
    259                         socket->data_fragment_size =
    260                             SOCKET_GET_DATA_FRAGMENT_SIZE(call);
    261 
    262                         fibril_rwlock_write_unlock(&socket->sending_lock);
    263                 }
    264 
    265                 fibril_rwlock_read_unlock(&socket_globals.lock);
    266                 break;
    267 
    268         default:
    269                 rc = ENOTSUP;
    270         }
    271 
    272         async_answer_0(callid, (sysarg_t) rc);
    273         goto loop;
     275               
     276                async_answer_0(callid, (sysarg_t) rc);
     277        }
    274278}
    275279
  • uspace/lib/c/generic/tls.c

    rba4799a r06b0211b  
    5151 * @return Pointer to TCB.
    5252 */
    53 tcb_t *__make_tls(void)
     53tcb_t *tls_make(void)
    5454{
    5555        void *data;
     
    5757        size_t tls_size = &_tbss_end - &_tdata_start;
    5858       
    59         tcb = __alloc_tls(&data, tls_size);
     59        tcb = tls_alloc_arch(&data, tls_size);
    6060        if (!tcb)
    6161                return NULL;
     
    7474}
    7575
    76 void __free_tls(tcb_t *tcb)
     76void tls_free(tcb_t *tcb)
    7777{
    7878        size_t tls_size = &_tbss_end - &_tdata_start;
    79         __free_tls_arch(tcb, tls_size);
     79        tls_free_arch(tcb, tls_size);
    8080}
    8181
  • uspace/lib/c/include/async.h

    rba4799a r06b0211b  
    156156extern void async_set_client_connection(async_client_conn_t);
    157157extern void async_set_interrupt_received(async_interrupt_handler_t);
     158extern void async_set_interrupt_handler_stack_size(size_t);
    158159
    159160/*
  • uspace/lib/c/include/fibril.h

    rba4799a r06b0211b  
    8686extern void context_restore(context_t *ctx) __attribute__((noreturn));
    8787
    88 extern fid_t fibril_create(int (*func)(void *), void *arg);
     88#define FIBRIL_DFLT_STK_SIZE    0
     89
     90#define fibril_create(func, arg) \
     91        fibril_create_generic((func), (arg), FIBRIL_DFLT_STK_SIZE)
     92extern fid_t fibril_create_generic(int (*func)(void *), void *arg, size_t);
    8993extern void fibril_destroy(fid_t fid);
    9094extern fibril_t *fibril_setup(void);
  • uspace/lib/c/include/macros.h

    rba4799a r06b0211b  
    3838#define min(a, b)  ((a) < (b) ? (a) : (b))
    3939#define max(a, b)  ((a) > (b) ? (a) : (b))
    40 #define abs(a)     ((a) >= 0 ? (a) : (-a))
     40#define abs(a)     ((a) >= 0 ? (a) : -(a))
    4141
    4242
  • uspace/lib/c/include/mem.h

    rba4799a r06b0211b  
    4040#define bzero(ptr, len)  memset((ptr), 0, (len))
    4141
    42 extern void *memset(void *, int, size_t);
    43 extern void *memcpy(void *, const void *, size_t);
     42extern void *memset(void *, int, size_t)
     43    __attribute__ ((optimize("-fno-tree-loop-distribute-patterns")));
     44extern void *memcpy(void *, const void *, size_t)
     45    __attribute__ ((optimize("-fno-tree-loop-distribute-patterns")));
    4446extern void *memmove(void *, const void *, size_t);
    4547
  • uspace/lib/c/include/setjmp.h

    rba4799a r06b0211b  
    3838#include <libarch/fibril.h>
    3939
    40 typedef context_t jmp_buf;
     40typedef context_t jmp_buf[1];
    4141
    4242extern int setjmp(jmp_buf env);
     
    4747/** @}
    4848 */
    49 
  • uspace/lib/c/include/sys/types.h

    rba4799a r06b0211b  
    5050typedef volatile uint32_t ioport32_t;
    5151
     52typedef int16_t unaligned_int16_t __attribute__ ((aligned(1)));
     53typedef int32_t unaligned_int32_t __attribute__ ((aligned(1)));
     54typedef int64_t unaligned_int64_t __attribute__ ((aligned(1)));
     55
     56typedef uint16_t unaligned_uint16_t __attribute__ ((aligned(1)));
     57typedef uint32_t unaligned_uint32_t __attribute__ ((aligned(1)));
     58typedef uint64_t unaligned_uint64_t __attribute__ ((aligned(1)));
     59
    5260#endif
    5361
  • uspace/lib/c/include/tls.h

    rba4799a r06b0211b  
    4848extern char _tbss_end;
    4949
    50 extern tcb_t *__make_tls(void);
    51 extern tcb_t *__alloc_tls(void **, size_t);
    52 extern void __free_tls(tcb_t *);
    53 extern void __free_tls_arch(tcb_t *, size_t);
     50extern tcb_t *tls_make(void);
     51extern tcb_t *tls_alloc_arch(void **, size_t);
     52extern void tls_free(tcb_t *);
     53extern void tls_free_arch(tcb_t *, size_t);
    5454
    5555#ifdef CONFIG_TLS_VARIANT_1
  • uspace/lib/posix/include/posix/fcntl.h

    rba4799a r06b0211b  
    4848#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
    4949
     50/* Dummy compatibility flag */
     51#undef O_NOCTTY
     52#define O_NOCTTY 0
     53
    5054/* fcntl commands */
    5155#undef F_DUPFD
  • uspace/lib/posix/include/posix/float.h

    rba4799a r06b0211b  
    3636#define POSIX_FLOAT_H_
    3737
    38 /*
    39  * The macros defined below are needed for compilation of MPFR
    40  * (http://www.mpfr.org/). Probably, they should be provided by GCC
    41  * itself but that does not work for cross-compilation.
    42  *
     38/* Rouding direction -1 - unknown */
     39#define FLT_ROUNDS (-1)
     40
     41/* define some standard C constants in terms of GCC built-ins */
     42#ifdef __GNUC__
     43        #undef DBL_MANT_DIG
     44        #define DBL_MANT_DIG __DBL_MANT_DIG__
     45        #undef DBL_MIN_EXP
     46        #define DBL_MIN_EXP __DBL_MIN_EXP__
     47        #undef DBL_MAX_EXP
     48        #define DBL_MAX_EXP __DBL_MAX_EXP__
     49        #undef DBL_MAX
     50        #define DBL_MAX __DBL_MAX__
     51        #undef DBL_MAX_10_EXP
     52        #define DBL_MAX_10_EXP __DBL_MAX_10_EXP__
     53        #undef DBL_MIN_10_EXP
     54        #define DBL_MIN_10_EXP __DBL_MIN_10_EXP__
     55        #undef DBL_MIN
     56        #define DBL_MIN __DBL_MIN__
     57        #undef DBL_DIG
     58        #define DBL_DIG __DBL_DIG__
     59        #undef DBL_EPSILON
     60        #define DBL_EPSILON __DBL_EPSILON__
     61        #undef FLT_RADIX
     62        #define FLT_RADIX __FLT_RADIX__
     63#else
     64/* For something else than GCC, following definitions are provided.
    4365 * They are intentionally guarded by the given macro to ensure that anyone
    4466 * who wants them states this explicitly.
     
    5072 */
    5173#ifdef FLOAT_H_YES_I_REALLY_WANT_LIMITS
    52 
    5374/* float limits */
    5475#define FLT_MIN 1.1754943508222875079687365372222456778186655567720875215087517062784172594547271728515625e-38
     
    82103#endif
    83104
     105#endif /* __GNUC__ */
     106
    84107#endif /* POSIX_FLOAT_H_ */
    85108
  • uspace/lib/posix/include/posix/limits.h

    rba4799a r06b0211b  
    4949#define PATH_MAX 256
    5050
     51/* it's probably a safe assumption */
     52#undef CHAR_BIT
     53#define CHAR_BIT 8
     54
    5155#endif /* POSIX_LIMITS_H_ */
    5256
  • uspace/lib/posix/include/posix/math.h

    rba4799a r06b0211b  
    4040#endif
    4141
     42#ifdef __GNUC__
     43        #define HUGE_VAL (__builtin_huge_val())
     44#endif
     45
    4246/* Normalization Functions */
    4347extern double __POSIX_DEF__(ldexp)(double x, int exp);
    4448extern double __POSIX_DEF__(frexp)(double num, int *exp);
    4549
     50double __POSIX_DEF__(fabs)(double x);
     51double __POSIX_DEF__(floor)(double x);
     52double __POSIX_DEF__(modf)(double x, double *iptr);
     53double __POSIX_DEF__(fmod)(double x, double y);
     54double __POSIX_DEF__(pow)(double x, double y);
     55double __POSIX_DEF__(exp)(double x);
     56double __POSIX_DEF__(sqrt)(double x);
     57double __POSIX_DEF__(log)(double x);
     58double __POSIX_DEF__(sin)(double x);
     59double __POSIX_DEF__(cos)(double x);
     60double __POSIX_DEF__(atan2)(double y, double x);
    4661
    4762#endif /* POSIX_MATH_H_ */
  • uspace/lib/posix/include/posix/stdio.h

    rba4799a r06b0211b  
    7070
    7171typedef struct _IO_FILE FILE;
     72
     73#ifndef LIBPOSIX_INTERNAL
     74        enum _buffer_type {
     75                /** No buffering */
     76                _IONBF,
     77                /** Line buffering */
     78                _IOLBF,
     79                /** Full buffering */
     80                _IOFBF
     81        };
     82#endif
    7283
    7384extern FILE *stdin;
  • uspace/lib/posix/source/math.c

    rba4799a r06b0211b  
    6363}
    6464
     65/**
     66 *
     67 * @param x
     68 * @return
     69 */
     70double posix_cos(double x)
     71{
     72        // TODO: Python dependency
     73        not_implemented();
     74}
     75
     76/**
     77 *
     78 * @param x
     79 * @param y
     80 * @return
     81 */
     82double posix_pow(double x, double y)
     83{
     84        // TODO: Python dependency
     85        not_implemented();
     86}
     87
     88/**
     89 *
     90 * @param x
     91 * @return
     92 */
     93double posix_floor(double x)
     94{
     95        // TODO: Python dependency
     96        not_implemented();
     97}
     98
     99/**
     100 *
     101 * @param x
     102 * @return
     103 */
     104double posix_fabs(double x)
     105{
     106        // TODO: Python dependency
     107        not_implemented();
     108}
     109
     110/**
     111 *
     112 * @param x
     113 * @param iptr
     114 * @return
     115 */
     116double posix_modf(double x, double *iptr)
     117{
     118        // TODO: Python dependency
     119        not_implemented();
     120}
     121
     122/**
     123 *
     124 * @param x
     125 * @param y
     126 * @return
     127 */
     128double posix_fmod(double x, double y)
     129{
     130        // TODO: Python dependency
     131        not_implemented();
     132}
     133
     134/**
     135 *
     136 * @param x
     137 * @return
     138 */
     139double posix_log(double x)
     140{
     141        // TODO: Python dependency
     142        not_implemented();
     143}
     144
     145/**
     146 *
     147 * @param x
     148 * @param y
     149 * @return
     150 */
     151double posix_atan2(double y, double x)
     152{
     153        // TODO: Python dependency
     154        not_implemented();
     155}
     156
     157/**
     158 *
     159 * @param x
     160 * @return
     161 */
     162double posix_sin(double x)
     163{
     164        // TODO: Python dependency
     165        not_implemented();
     166}
     167
     168/**
     169 *
     170 * @param x
     171 * @return
     172 */
     173double posix_exp(double x)
     174{
     175        // TODO: Python dependency
     176        not_implemented();
     177}
     178
     179/**
     180 *
     181 * @param x
     182 * @return
     183 */
     184double posix_sqrt(double x)
     185{
     186        // TODO: Python dependency
     187        not_implemented();
     188}
     189
    65190/** @}
    66191 */
Note: See TracChangeset for help on using the changeset viewer.