Changeset f9d0a86 in mainline for uspace/lib


Ignore:
Timestamp:
2017-11-14T12:24:42Z (8 years ago)
Author:
Aearsis <Hlavaty.Ondrej@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6cad776
Parents:
887c9de (diff), d2d142a (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.
git-author:
Aearsis <Hlavaty.Ondrej@…> (2017-11-14 01:04:19)
git-committer:
Aearsis <Hlavaty.Ondrej@…> (2017-11-14 12:24:42)
Message:

Merge tag '0.7.1'

The merge wasn't clean, because of changes in build system. The most
significant change was partial revert of usbhc callback refactoring,
which now does not take usb transfer batch, but few named fields again.

Location:
uspace/lib
Files:
3 added
30 deleted
105 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/bithenge/Makefile

    r887c9de rf9d0a86  
    2929USPACE_PREFIX = ../..
    3030LIBRARY = libbithenge
    31 EXTRA_CFLAGS = -I$(LIBBLOCK_PREFIX) -D__HELENOS__ -Iinclude
     31EXTRA_CFLAGS = -D__HELENOS__
     32LIBS = block
    3233
    3334SOURCES = \
  • uspace/lib/bithenge/src/print.c

    r887c9de rf9d0a86  
    4040#include <stdarg.h>
    4141#include <stdio.h>
     42#include <wchar.h>
    4243#include <bithenge/blob.h>
    4344#include <bithenge/print.h>
  • uspace/lib/c/Makefile

    r887c9de rf9d0a86  
    3232
    3333CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config
    34 COMMON_HEADER_ARCH = arch/$(UARCH)/include/libarch/common.h
    3534
    3635LINKER_SCRIPTS = \
     
    4039        $(LIBC_PREFIX)/arch/$(UARCH)/_link-dlexe.ld
    4140
    42 PRE_DEPEND = $(COMMON_HEADER_ARCH)
     41PRE_DEPEND =
    4342EXTRA_OUTPUT = $(LINKER_SCRIPTS)
    44 EXTRA_CLEAN = $(COMMON_HEADER_ARCH) $(LINKER_SCRIPTS)
     43EXTRA_CLEAN = $(LINKER_SCRIPTS)
    4544LIBRARY = libc
    46 SLIBRARY = libc.so.0.0
    47 LSONAME = libc.so.0
     45SOVERSION = 0.0
    4846
    4947-include $(CONFIG_MAKEFILE)
     
    208206$(LIBC_PREFIX)/arch/$(UARCH)/_link-dlexe.ld: $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld.in
    209207        $(CC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -DDLEXE -E -x c $< | grep -v "^\#" > $@
    210 
    211 $(COMMON_HEADER_ARCH): $(COMMON_HEADER)
    212         ln -sfn ../../../../$< $@
  • uspace/lib/c/arch/abs32le/Makefile.inc

    r887c9de rf9d0a86  
    2828
    2929ARCH_SOURCES = \
    30         arch/$(UARCH)/src/entry.c \
    3130        arch/$(UARCH)/src/entryjmp.c \
    3231        arch/$(UARCH)/src/thread_entry.c \
     
    3635        arch/$(UARCH)/src/stacktrace.c
    3736
    38 .PRECIOUS: arch/$(UARCH)/src/entry.o
     37EXTRA_OUTPUT += arch/$(UARCH)/src/entry.o
  • uspace/lib/c/arch/abs32le/include/libarch/ddi.h

    r887c9de rf9d0a86  
    5050}
    5151
     52static inline void arch_pio_write_64(ioport64_t *port, uint64_t v)
     53{
     54        *port = v;
     55}
     56
    5257static inline uint8_t arch_pio_read_8(const ioport8_t *port)
    5358{
     
    6570}
    6671
     72static inline uint64_t arch_pio_read_64(const ioport64_t *port)
     73{
     74        return *port;
     75}
     76
    6777#endif
  • uspace/lib/c/arch/amd64/Makefile.inc

    r887c9de rf9d0a86  
    2828
    2929ARCH_SOURCES = \
    30         arch/$(UARCH)/src/entry.S \
    3130        arch/$(UARCH)/src/entryjmp.S \
    3231        arch/$(UARCH)/src/thread_entry.S \
     
    4140        arch/$(UARCH)/include/libarch/fibril_context.ag
    4241
    43 .PRECIOUS: arch/$(UARCH)/src/entry.o
     42EXTRA_OUTPUT += arch/$(UARCH)/src/entry.o
    4443
  • uspace/lib/c/arch/arm32/Makefile.common

    r887c9de rf9d0a86  
    3535ifeq ($(CONFIG_FPU),y)
    3636        COMMON_CFLAGS += -mfloat-abi=hard
    37 else
    38         BASE_LIBS += $(LIBSOFTFLOAT_PREFIX)/libsoftfloat.a
    3937endif
    4038
  • uspace/lib/c/arch/arm32/Makefile.inc

    r887c9de rf9d0a86  
    2929
    3030ARCH_SOURCES = \
    31         arch/$(UARCH)/src/entry.S \
    3231        arch/$(UARCH)/src/entryjmp.S \
    3332        arch/$(UARCH)/src/thread_entry.S \
     
    4342        arch/$(UARCH)/include/libarch/fibril_context.ag
    4443
    45 .PRECIOUS: arch/$(UARCH)/src/entry.o
     44EXTRA_OUTPUT += arch/$(UARCH)/src/entry.o
    4645
  • uspace/lib/c/arch/arm32/include/libarch/ddi.h

    r887c9de rf9d0a86  
    5151}
    5252
     53static inline void arch_pio_write_64(ioport64_t *port, uint64_t v)
     54{
     55        *port = v;
     56}
     57
    5358static inline uint8_t arch_pio_read_8(const ioport8_t *port)
    5459{
     
    6671}
    6772
     73static inline uint64_t arch_pio_read_64(const ioport64_t *port)
     74{
     75        return *port;
     76}
     77
    6878#endif
  • uspace/lib/c/arch/ia32/Makefile.inc

    r887c9de rf9d0a86  
    2828
    2929ARCH_SOURCES = \
    30         arch/$(UARCH)/src/entry.S \
    3130        arch/$(UARCH)/src/entryjmp.S \
    3231        arch/$(UARCH)/src/thread_entry.S \
     
    4342        arch/$(UARCH)/include/libarch/fibril_context.ag
    4443
    45 .PRECIOUS: arch/$(UARCH)/src/entry.o
     44EXTRA_OUTPUT += arch/$(UARCH)/src/entry.o
  • uspace/lib/c/arch/ia32/include/libarch/ddi.h

    r887c9de rf9d0a86  
    8686}
    8787
     88static inline uint64_t arch_pio_read_64(const ioport64_t *port)
     89{
     90        return (uint64_t) *port;
     91}
     92
    8893static inline void arch_pio_write_8(ioport8_t *port, uint8_t val)
    8994{
     
    119124}
    120125
     126static inline void arch_pio_write_64(ioport64_t *port, uint64_t val)
     127{
     128        *port = val;
     129}
     130
    121131#endif
  • uspace/lib/c/arch/ia64/Makefile.inc

    r887c9de rf9d0a86  
    2828
    2929ARCH_SOURCES = \
    30         arch/$(UARCH)/src/entry.S \
    3130        arch/$(UARCH)/src/entryjmp.S \
    3231        arch/$(UARCH)/src/thread_entry.S \
     
    4241        arch/$(UARCH)/include/libarch/fibril_context.ag
    4342
    44 .PRECIOUS: arch/$(UARCH)/src/entry.o
     43EXTRA_OUTPUT += arch/$(UARCH)/src/entry.o
  • uspace/lib/c/arch/ia64/include/libarch/ddi.h

    r887c9de rf9d0a86  
    9494}
    9595
     96static inline void arch_pio_write_64(ioport64_t *port, uint64_t v)
     97{
     98        *port = v;
     99
     100        asm volatile ("mf\n" ::: "memory");
     101        asm volatile ("mf.a\n" ::: "memory");
     102}
     103
    96104static inline uint8_t arch_pio_read_8(const ioport8_t *port)
    97105{
     
    154162}
    155163
     164static inline uint64_t arch_pio_read_64(const ioport64_t *port)
     165{
     166        uint64_t v;
     167
     168        asm volatile ("mf\n" ::: "memory");
     169
     170        v = *port;
     171
     172        asm volatile ("mf.a\n" ::: "memory");
     173
     174        return v;
     175}
     176
    156177#endif
    157178
  • uspace/lib/c/arch/ia64/include/libarch/faddr.h

    r887c9de rf9d0a86  
    3838#include <types/common.h>
    3939
     40typedef struct {
     41        uintptr_t fnc;
     42        uintptr_t gp;
     43} __attribute__((may_alias)) fncptr_t;
     44
    4045/**
    4146 *
  • uspace/lib/c/arch/ia64/src/entry.S

    r887c9de rf9d0a86  
    4242       
    4343        # Pass PCB pointer as the first argument to __main
    44         mov out0 = r2
     44        mov out0 = r2 ;;
    4545        br.call.sptk.many b0 = __main
    4646
  • uspace/lib/c/arch/ia64/src/thread_entry.S

    r887c9de rf9d0a86  
    4343        #
    4444       
    45         mov out0 = r8
     45        mov out0 = r8 ;;
    4646        br.call.sptk.many b0 = __thread_main
    4747       
  • uspace/lib/c/arch/mips32/Makefile.common

    r887c9de rf9d0a86  
    2828
    2929COMMON_CFLAGS += -msoft-float -mabi=32
    30 BASE_LIBS += $(LIBSOFTFLOAT_PREFIX)/libsoftfloat.a
    3130AS_PROLOG = .module softfloat;.abicalls;
    3231LFLAGS += --gc-sections
  • uspace/lib/c/arch/mips32/Makefile.inc

    r887c9de rf9d0a86  
    2828
    2929ARCH_SOURCES = \
    30         arch/$(UARCH)/src/entry.S \
    3130        arch/$(UARCH)/src/entryjmp.S \
    3231        arch/$(UARCH)/src/thread_entry.S \
     
    4140        arch/$(UARCH)/include/libarch/fibril_context.ag
    4241
    43 .PRECIOUS: arch/$(UARCH)/src/entry.o
     42EXTRA_OUTPUT += arch/$(UARCH)/src/entry.o
  • uspace/lib/c/arch/mips32/include/libarch/ddi.h

    r887c9de rf9d0a86  
    5151}
    5252
     53static inline void arch_pio_write_64(ioport64_t *port, uint64_t v)
     54{
     55        *port = v;
     56}
     57
    5358static inline uint8_t arch_pio_read_8(const ioport8_t *port)
    5459{
     
    6671}
    6772
     73static inline uint64_t arch_pio_read_64(const ioport64_t *port)
     74{
     75        return *port;
     76}
     77
    6878#endif
  • uspace/lib/c/arch/mips32/src/entry.S

    r887c9de rf9d0a86  
    6262        #
    6363        addiu $sp, ABI_STACK_FRAME
     64        .end __entry
    6465FUNCTION_END(__entry)
  • uspace/lib/c/arch/mips32/src/thread_entry.S

    r887c9de rf9d0a86  
    6262        #
    6363        addiu $sp, ABI_STACK_FRAME
     64        .end __thread_entry
  • uspace/lib/c/arch/mips32eb/Makefile.common

    r887c9de rf9d0a86  
    2828
    2929COMMON_CFLAGS += -msoft-float -mabi=32
    30 BASE_LIBS += $(LIBSOFTFLOAT_PREFIX)/libsoftfloat.a
    3130AS_PROLOG = .module softfloat;.abicalls;
    3231LFLAGS += --gc-sections
  • uspace/lib/c/arch/mips32eb/Makefile.inc

    r887c9de rf9d0a86  
    2828
    2929ARCH_SOURCES = \
    30         arch/$(UARCH)/src/entry.S \
    3130        arch/$(UARCH)/src/entryjmp.S \
    3231        arch/$(UARCH)/src/thread_entry.S \
     
    4140        arch/$(UARCH)/include/libarch/fibril_context.ag
    4241
    43 .PRECIOUS: arch/$(UARCH)/src/entry.o
     42EXTRA_OUTPUT += arch/$(UARCH)/src/entry.o
  • uspace/lib/c/arch/ppc32/Makefile.common

    r887c9de rf9d0a86  
    3434
    3535COMMON_CFLAGS += -mcpu=powerpc -m$(FLOATS)-float -m32
    36 BASE_LIBS += $(LIBSOFTFLOAT_PREFIX)/libsoftfloat.a
    3736AFLAGS += -a32
    3837LFLAGS += --gc-sections
  • uspace/lib/c/arch/ppc32/Makefile.inc

    r887c9de rf9d0a86  
    2828
    2929ARCH_SOURCES = \
    30         arch/$(UARCH)/src/entry.S \
    3130        arch/$(UARCH)/src/entryjmp.S \
    3231        arch/$(UARCH)/src/thread_entry.S \
     
    4140        arch/$(UARCH)/include/libarch/fibril_context.ag
    4241
    43 .PRECIOUS: arch/$(UARCH)/src/entry.o
     42EXTRA_OUTPUT += arch/$(UARCH)/src/entry.o
  • uspace/lib/c/arch/ppc32/include/libarch/ddi.h

    r887c9de rf9d0a86  
    5151}
    5252
     53static inline void arch_pio_write_64(ioport64_t *port, uint64_t v)
     54{
     55        *port = v;
     56}
     57
    5358static inline uint8_t arch_pio_read_8(const ioport8_t *port)
    5459{
     
    6671}
    6772
     73static inline uint64_t arch_pio_read_64(const ioport64_t *port)
     74{
     75        return *port;
     76}
     77
    6878#endif
  • uspace/lib/c/arch/riscv64/Makefile.common

    r887c9de rf9d0a86  
    2727#
    2828
    29 BASE_LIBS += $(LIBSOFTFLOAT_PREFIX)/libsoftfloat.a
    30 
    3129ENDIANESS = LE
    3230
  • uspace/lib/c/arch/riscv64/Makefile.inc

    r887c9de rf9d0a86  
    2828
    2929ARCH_SOURCES = \
    30         arch/$(UARCH)/src/entry.c \
    3130        arch/$(UARCH)/src/entryjmp.c \
    3231        arch/$(UARCH)/src/thread_entry.c \
     
    4039        arch/$(UARCH)/include/libarch/fibril_context.ag
    4140
    42 .PRECIOUS: arch/$(UARCH)/src/entry.o
     41EXTRA_OUTPUT += arch/$(UARCH)/src/entry.o
  • uspace/lib/c/arch/riscv64/include/libarch/ddi.h

    r887c9de rf9d0a86  
    5050}
    5151
     52static inline void arch_pio_write_64(ioport64_t *port, uint64_t v)
     53{
     54        *port = v;
     55}
     56
    5257static inline uint8_t arch_pio_read_8(const ioport8_t *port)
    5358{
     
    6570}
    6671
     72static inline uint64_t arch_pio_read_64(const ioport64_t *port)
     73{
     74        return *port;
     75}
     76
    6777#endif
  • uspace/lib/c/arch/sparc64/Makefile.inc

    r887c9de rf9d0a86  
    2828
    2929ARCH_SOURCES = \
    30         arch/$(UARCH)/src/entry.S \
    3130        arch/$(UARCH)/src/entryjmp.S \
    3231        arch/$(UARCH)/src/thread_entry.S \
     
    4039        arch/$(UARCH)/include/libarch/fibril_context.ag
    4140
    42 .PRECIOUS: arch/$(UARCH)/src/entry.o
     41EXTRA_OUTPUT += arch/$(UARCH)/src/entry.o
  • uspace/lib/c/arch/sparc64/include/libarch/ddi.h

    r887c9de rf9d0a86  
    6262}
    6363
     64static inline void arch_pio_write_64(ioport64_t *port, uint64_t v)
     65{
     66        *port = v;
     67        memory_barrier();
     68}
     69
     70
    6471static inline uint8_t arch_pio_read_8(const ioport8_t *port)
    6572{
     
    9299}
    93100
     101static inline uint64_t arch_pio_read_64(const ioport64_t *port)
     102{
     103        uint64_t rv;
     104
     105        rv = *port;
     106        memory_barrier();
     107
     108        return rv;
     109}
     110
    94111#endif
  • uspace/lib/c/generic/ddi.c

    r887c9de rf9d0a86  
    338338}
    339339
     340void pio_write_64(ioport64_t *reg, uint64_t val)
     341{
     342        pio_trace_log(reg, val, true);
     343        arch_pio_write_64(reg, val);
     344}
     345
    340346uint8_t pio_read_8(const ioport8_t *reg)
    341347{
     
    359365}
    360366
     367uint64_t pio_read_64(const ioport64_t *reg)
     368{
     369        const uint64_t val = arch_pio_read_64(reg);
     370        pio_trace_log(reg, val, false);
     371        return val;
     372}
     373
    361374/** @}
    362375 */
  • uspace/lib/c/generic/double_to_str.c

    r887c9de rf9d0a86  
    3232#include <ieee_double.h>
    3333
     34#include <limits.h>
    3435#include <stdint.h>
    3536#include <stdbool.h>
  • uspace/lib/c/generic/gsort.c

    r887c9de rf9d0a86  
    4141
    4242#include <gsort.h>
     43#include <inttypes.h>
    4344#include <mem.h>
    4445#include <malloc.h>
  • uspace/lib/c/generic/inet/addr.c

    r887c9de rf9d0a86  
    4141#include <malloc.h>
    4242#include <bitops.h>
     43#include <inttypes.h>
    4344
    4445#define INET_PREFIXSTRSIZE  5
  • uspace/lib/c/generic/io/printf_core.c

    r887c9de rf9d0a86  
    4646#include <assert.h>
    4747#include <macros.h>
     48#include <wchar.h>
    4849
    4950
     
    114115        PrintfQualifierLongLong,
    115116        PrintfQualifierPointer,
    116         PrintfQualifierSize
     117        PrintfQualifierSize,
     118        PrintfQualifierMax
    117119} qualifier_t;
    118120
     
    14841486                                uc = str_decode(fmt, &nxt, STR_NO_LIMIT);
    14851487                                break;
     1488                        case 'j':
     1489                                qualifier = PrintfQualifierMax;
     1490                                i = nxt;
     1491                                uc = str_decode(fmt, &nxt, STR_NO_LIMIT);
     1492                                break;
    14861493                        default:
    14871494                                /* Default type */
     
    16291636                                number = (uint64_t) va_arg(ap, size_t);
    16301637                                break;
     1638                        case PrintfQualifierMax:
     1639                                size = sizeof(uintmax_t);
     1640                                number = (uint64_t) va_arg(ap, uintmax_t);
     1641                                break;
    16311642                        default:
    16321643                                /* Unknown qualifier */
  • uspace/lib/c/generic/ipc.c

    r887c9de rf9d0a86  
    148148        }
    149149       
    150         if (callid == (ipc_callid_t) IPC_CALLRET_TEMPORARY) {
    151                 futex_unlock(&ipc_futex);
    152                
    153                 call->u.msg.phoneid = phoneid;
    154                
    155                 futex_down(&async_futex);
    156                 list_append(&call->list, &queued_calls);
    157                
    158                 call->fid = fibril_get_id();
    159                 fibril_switch(FIBRIL_TO_MANAGER);
    160                 /* Async futex unlocked by previous call */
    161                
    162                 return;
    163         }
    164        
    165150        call->u.callid = callid;
    166151       
     
    210195        ipc_callid_t callid = __SYSCALL6(SYS_IPC_CALL_ASYNC_FAST, phoneid,
    211196            imethod, arg1, arg2, arg3, arg4);
    212        
    213         if (callid == (ipc_callid_t) IPC_CALLRET_TEMPORARY) {
    214                 if (!call) {
    215                         call = ipc_prepare_async(private, callback);
    216                         if (!call) {
    217                                 futex_unlock(&ipc_futex);
    218                                 return;
    219                         }
    220                 }
    221                
    222                 IPC_SET_IMETHOD(call->u.msg.data, imethod);
    223                 IPC_SET_ARG1(call->u.msg.data, arg1);
    224                 IPC_SET_ARG2(call->u.msg.data, arg2);
    225                 IPC_SET_ARG3(call->u.msg.data, arg3);
    226                 IPC_SET_ARG4(call->u.msg.data, arg4);
    227                
    228                 /*
    229                  * To achieve deterministic behavior, we always zero out the
    230                  * arguments that are beyond the limits of the fast version.
    231                  */
    232                
    233                 IPC_SET_ARG5(call->u.msg.data, 0);
    234         }
    235197       
    236198        ipc_finish_async(callid, phoneid, call);
     
    351313                ipc_callid_t callid =
    352314                    ipc_call_async_internal(call->u.msg.phoneid, &call->u.msg.data);
    353                
    354                 if (callid == (ipc_callid_t) IPC_CALLRET_TEMPORARY)
    355                         break;
    356315               
    357316                list_remove(&call->list);
  • uspace/lib/c/generic/loc.c

    r887c9de rf9d0a86  
    247247        sysarg_t retval = async_data_write_start(exch, name, str_size(name));
    248248       
    249         loc_exchange_end(exch);
    250        
    251249        if (retval != EOK) {
    252250                async_forget(req);
    253                 return retval;
    254         }
    255        
    256         exch = loc_exchange_begin(INTERFACE_LOC_SUPPLIER);
     251                loc_exchange_end(exch);
     252                return retval;
     253        }
     254       
    257255        async_connect_to_me(exch, 0, 0, 0);
    258         loc_exchange_end(exch);
    259        
     256
     257        /*
     258         * First wait for the answer and then end the exchange. The opposite
     259         * order is generally wrong because it may lead to a deadlock under
     260         * certain circumstances.
     261         */
    260262        async_wait_for(req, &retval);
     263        loc_exchange_end(exch);
     264       
    261265        return retval;
    262266}
     
    276280        sysarg_t retval = async_data_write_start(exch, fqsn, str_size(fqsn));
    277281       
    278        
    279282        if (retval != EOK) {
    280283                async_forget(req);
     
    283286        }
    284287       
     288        /*
     289         * First wait for the answer and then end the exchange. The opposite
     290         * order is generally wrong because it may lead to a deadlock under
     291         * certain circumstances.
     292         */
    285293        async_wait_for(req, &retval);
    286294        loc_exchange_end(exch);
  • uspace/lib/c/generic/pio_trace.c

    r887c9de rf9d0a86  
    9191
    9292
    93 void pio_trace_log(const volatile void *r, uint32_t val, bool write)
     93void pio_trace_log(const volatile void *r, uint64_t val, bool write)
    9494{
    9595        pio_regions_t *regions = get_regions();
  • uspace/lib/c/generic/str.c

    r887c9de rf9d0a86  
    4646#include <align.h>
    4747#include <mem.h>
     48#include <limits.h>
    4849
    4950/** Check the condition if wchar_t is signed */
    50 #ifdef WCHAR_IS_UNSIGNED
     51#ifdef __WCHAR_UNSIGNED__
    5152        #define WCHAR_SIGNED_CHECK(cond)  (true)
    5253#else
  • uspace/lib/c/include/ddi.h

    r887c9de rf9d0a86  
    5252typedef volatile uint16_t ioport16_t;
    5353typedef volatile uint32_t ioport32_t;
    54 
    55 extern int device_assign_devno(void);
     54typedef volatile uint64_t ioport64_t;
    5655
    5756extern int physmem_map(uintptr_t, size_t, unsigned int, void **);
     
    6968extern int pio_disable(void *, size_t);
    7069
    71 typedef void (*trace_fnc)(const volatile void *place, uint32_t val,
     70typedef void (*trace_fnc)(const volatile void *place, uint64_t val,
    7271    volatile void* base, size_t size, void *data, bool write);
    7372
    7473extern int pio_trace_enable(void *, size_t, trace_fnc, void *);
    75 extern void pio_trace_log(const volatile void *, uint32_t val, bool write);
     74extern void pio_trace_log(const volatile void *, uint64_t val, bool write);
    7675extern void pio_trace_disable(void *);
    7776
     
    7978extern void pio_write_16(ioport16_t *, uint16_t);
    8079extern void pio_write_32(ioport32_t *, uint32_t);
     80extern void pio_write_64(ioport64_t *, uint64_t);
    8181
    8282extern uint8_t pio_read_8(const ioport8_t *);
    8383extern uint16_t pio_read_16(const ioport16_t *);
    8484extern uint32_t pio_read_32(const ioport32_t *);
     85extern uint64_t pio_read_64(const ioport64_t *);
    8586
    8687static inline uint8_t pio_change_8(ioport8_t *reg, uint8_t val, uint8_t mask,
     
    111112}
    112113
     114static inline uint64_t pio_change_64(ioport64_t *reg, uint64_t val,
     115    uint64_t mask, useconds_t delay)
     116{
     117        uint64_t v = pio_read_64(reg);
     118        udelay(delay);
     119        pio_write_64(reg, (v & ~mask) | val);
     120        return v;
     121}
     122
    113123static inline uint8_t pio_set_8(ioport8_t *r, uint8_t v, useconds_t d)
    114124{
     
    122132{
    123133        return pio_change_32(r, v, 0, d);
     134}
     135static inline uint64_t pio_set_64(ioport64_t *r, uint64_t v, useconds_t d)
     136{
     137        return pio_change_64(r, v, 0, d);
    124138}
    125139
     
    136150        return pio_change_32(r, 0, v, d);
    137151}
     152static inline uint64_t pio_clear_64(ioport64_t *r, uint64_t v, useconds_t d)
     153{
     154        return pio_change_64(r, 0, v, d);
     155}
    138156
    139157#endif
  • uspace/lib/c/include/inttypes.h

    r887c9de rf9d0a86  
    3636#define LIBC_INTTYPES_H_
    3737
    38 #include <libarch/inttypes.h>
     38#include <_bits/inttypes.h>
    3939
    4040#endif
  • uspace/lib/c/include/io/charfield.h

    r887c9de rf9d0a86  
    3838
    3939#include <stdbool.h>
     40#include <wchar.h>
    4041#include <io/color.h>
    4142#include <io/style.h>
  • uspace/lib/c/include/limits.h

    r887c9de rf9d0a86  
    3636#define LIBC_LIMITS_H_
    3737
    38 /* XXX Make this more accurate */
    39 #include <stdint.h>
    40 #include <libarch/stdint.h>
     38#include <_bits/limits.h>
    4139
    4240#endif
  • uspace/lib/c/include/stddef.h

    r887c9de rf9d0a86  
    3636#define LIBC_STDDEF_H_
    3737
    38 #include <libarch/stddef.h>
     38#include <_bits/size_t.h>
     39#include <_bits/ptrdiff_t.h>
     40#include <_bits/wchar_t.h>
    3941
    40 #ifndef NULL
    41         #define NULL  ((void *) 0)
    42 #endif
     42#include <_bits/NULL.h>
    4343
    4444#define offsetof(type, member) \
  • uspace/lib/c/include/stdint.h

    r887c9de rf9d0a86  
    3636#define LIBC_STDINT_H_
    3737
    38 #define INT8_MIN  INT8_C(0x80)
    39 #define INT8_MAX  INT8_C(0x7F)
    40 
    41 #define UINT8_MIN  UINT8_C(0)
    42 #define UINT8_MAX  UINT8_C(0xFF)
    43 
    44 #define INT16_MIN  INT16_C(0x8000)
    45 #define INT16_MAX  INT16_C(0x7FFF)
    46 
    47 #define UINT16_MIN  UINT16_C(0)
    48 #define UINT16_MAX  UINT16_C(0xFFFF)
    49 
    50 #define INT32_MIN  INT32_C(0x80000000)
    51 #define INT32_MAX  INT32_C(0x7FFFFFFF)
    52 
    53 #define UINT32_MIN  UINT32_C(0)
    54 #define UINT32_MAX  UINT32_C(0xFFFFFFFF)
    55 
    56 #define INT64_MIN  INT64_C(0x8000000000000000)
    57 #define INT64_MAX  INT64_C(0x7FFFFFFFFFFFFFFF)
    58 
    59 #define UINT64_MIN  UINT64_C(0)
    60 #define UINT64_MAX  UINT64_C(0xFFFFFFFFFFFFFFFF)
    61 
    62 #include <libarch/stdint.h>
     38#include <_bits/stdint.h>
    6339
    6440#endif
  • uspace/lib/c/include/types/common.h

    r887c9de rf9d0a86  
    3636#define LIBC_TYPES_COMMON_H_
    3737
    38 #include <libarch/types.h>
     38#if __SIZEOF_POINTER__ == 4
     39#define __32_BITS__
     40#elif __SIZEOF_POINTER__ == 8
     41#define __64_BITS__
     42#else
     43#error __SIZEOF_POINTER__ is not defined.
     44#endif
     45
     46#include <_bits/all.h>
    3947
    4048#endif
  • uspace/lib/clui/Makefile

    r887c9de rf9d0a86  
    2828
    2929USPACE_PREFIX = ../..
    30 EXTRA_CFLAGS = -I.
    3130LIBRARY = libclui
    3231
  • uspace/lib/dltest/Makefile

    r887c9de rf9d0a86  
    2929USPACE_PREFIX = ../..
    3030LIBRARY = libdltest
    31 SLIBRARY = libdltest.so.0.0
    32 LSONAME = libdltest.so.0
     31SOVERSION = 0.0
    3332
    3433SOURCES = \
  • uspace/lib/draw/Makefile

    r887c9de rf9d0a86  
    2929USPACE_PREFIX = ../..
    3030LIBRARY = libdraw
    31 SLIBRARY = libdraw.so.0.0
    32 LSONAME = libdraw.so.0
    33 EXTRA_CFLAGS += -I$(LIBSOFTREND_PREFIX) -I$(LIBCOMPRESS_PREFIX)
     31LIBS = softrend compress
    3432
    3533SOURCES = \
  • uspace/lib/draw/gfx/font-8x16.h

    r887c9de rf9d0a86  
    3838#include <stdint.h>
    3939#include <stdbool.h>
     40#include <stddef.h>
    4041
    4142#define FONT_GLYPHS     2899
  • uspace/lib/drv/Makefile

    r887c9de rf9d0a86  
    2929
    3030USPACE_PREFIX = ../..
    31 EXTRA_CFLAGS = \
    32         -Iinclude \
    33         -Igeneric/private \
    34         -I$(LIBUSB_PREFIX)/include \
    35         -I$(LIBUSBHOST_PREFIX)/include \
    36         -I$(LIBPCM_PREFIX)/include
     31EXTRA_CFLAGS = -Igeneric/private
    3732LIBRARY = libdrv
     33LIBS = pcm
    3834
    3935SOURCES = \
  • uspace/lib/drv/generic/logbuf.c

    r887c9de rf9d0a86  
    3131 */
    3232
    33 #include <libarch/common.h>
    3433#include <stdio.h>
    3534#include <stddef.h>
  • uspace/lib/drv/generic/remote_usb.c

    r887c9de rf9d0a86  
    3535
    3636#include <async.h>
     37#include <assert.h>
    3738#include <macros.h>
    3839#include <errno.h>
    3940#include <devman.h>
    40 #include <usb/host/usb_transfer_batch.h>
    4141
    4242#include "usb_iface.h"
  • uspace/lib/drv/generic/remote_usbhc.c

    r887c9de rf9d0a86  
    3939#include <errno.h>
    4040#include <devman.h>
    41 #include <usb/host/usb_transfer_batch.h>
    4241
    4342#include "usbhc_iface.h"
     
    445444}
    446445
    447 static int callback_out(usb_transfer_batch_t *batch)
    448 {
    449         async_transaction_t *trans = batch->on_complete_data;
    450 
    451         const int err = async_answer_0(trans->caller, batch->error);
     446static int callback_out(void *arg, int error, size_t transfered_size)
     447{
     448        async_transaction_t *trans = arg;
     449
     450        const int err = async_answer_0(trans->caller, error);
    452451
    453452        async_transaction_destroy(trans);
     
    456455}
    457456
    458 static int callback_in(usb_transfer_batch_t *batch)
    459 {
    460         async_transaction_t *trans = batch->on_complete_data;
     457static int callback_in(void *arg, int error, size_t transfered_size)
     458{
     459        async_transaction_t *trans = arg;
    461460
    462461        if (trans->data_caller) {
    463                 if (batch->error == EOK) {
    464                         batch->error = async_data_read_finalize(trans->data_caller,
    465                             trans->buffer, batch->transfered_size);
     462                if (error == EOK) {
     463                        error = async_data_read_finalize(trans->data_caller,
     464                            trans->buffer, transfered_size);
    466465                } else {
    467466                        async_answer_0(trans->data_caller, EINTR);
     
    469468        }
    470469
    471         const int err = async_answer_0(trans->caller, batch->error);
     470        const int err = async_answer_0(trans->caller, error);
    472471        async_transaction_destroy(trans);
    473472        return err;
  • uspace/lib/drv/include/ddf/interrupt.h

    r887c9de rf9d0a86  
    3636#define DDF_INTERRUPT_H_
    3737
    38 #include <libarch/common.h>
    3938#include <types/common.h>
    4039#include <abi/ddi/irq.h>
  • uspace/lib/drv/include/usb_iface.h

    r887c9de rf9d0a86  
    4040#include "ddf/driver.h"
    4141#include <async.h>
    42 #include <usb/usb.h>
    4342
    4443typedef async_sess_t usb_dev_session_t;
     44
     45/** USB speeds. */
     46typedef enum {
     47        /** USB 1.1 low speed (1.5Mbits/s). */
     48        USB_SPEED_LOW,
     49        /** USB 1.1 full speed (12Mbits/s). */
     50        USB_SPEED_FULL,
     51        /** USB 2.0 high speed (480Mbits/s). */
     52        USB_SPEED_HIGH,
     53        /** USB 3.0 super speed (5Gbits/s). */
     54        USB_SPEED_SUPER,
     55        /** Psuedo-speed serving as a boundary. */
     56        USB_SPEED_MAX
     57} usb_speed_t;
     58
     59/** USB endpoint number type.
     60 * Negative values could be used to indicate error.
     61 */
     62typedef int16_t usb_endpoint_t;
     63
     64/** USB address type.
     65 * Negative values could be used to indicate error.
     66 */
     67typedef int16_t usb_address_t;
     68
     69/** USB address for the purposes of Transaction Translation.
     70 */
     71typedef struct {
     72        usb_address_t address;
     73        unsigned port;
     74} usb_tt_address_t;
     75
     76/** USB transfer type. */
     77typedef enum {
     78        USB_TRANSFER_CONTROL = 0,
     79        USB_TRANSFER_ISOCHRONOUS = 1,
     80        USB_TRANSFER_BULK = 2,
     81        USB_TRANSFER_INTERRUPT = 3
     82} usb_transfer_type_t;
     83
     84/** USB data transfer direction. */
     85typedef enum {
     86        USB_DIRECTION_IN,
     87        USB_DIRECTION_OUT,
     88        USB_DIRECTION_BOTH
     89} usb_direction_t;
     90
     91/** USB complete address type.
     92 * Pair address + endpoint is identification of transaction recipient.
     93 */
     94typedef union {
     95        struct {
     96                usb_address_t address;
     97                usb_endpoint_t endpoint;
     98        } __attribute__((packed));
     99        uint32_t packed;
     100} usb_target_t;
     101
     102/** Description of usb endpoint.
     103 */
     104typedef struct {
     105        /** Endpoint number. */
     106        usb_endpoint_t endpoint_no;
     107
     108        /** Endpoint transfer type. */
     109        usb_transfer_type_t transfer_type;
     110
     111        /** Endpoint direction. */
     112        usb_direction_t direction;
     113
     114        /** Maximum packet size for the endpoint. */
     115        size_t max_packet_size;
     116
     117        /** Number of packets per frame/uframe.
     118         * Only valid for HS INT and ISO transfers. All others should set to 1*/
     119        unsigned packets;
     120
     121        struct {
     122                unsigned polling_interval;
     123        } usb2;
     124
     125        struct {
     126                unsigned max_burst;
     127                unsigned max_streams;
     128        } usb3;
     129} usb_endpoint_desc_t;
     130
    45131
    46132extern usb_dev_session_t *usb_dev_connect(devman_handle_t);
  • uspace/lib/drv/include/usbhc_iface.h

    r887c9de rf9d0a86  
    4141
    4242#include "ddf/driver.h"
     43#include "usb_iface.h"
    4344#include <async.h>
    44 #include <usb/usb.h>
    4545
    4646extern int usbhc_reserve_default_address(async_exch_t *, usb_speed_t);
     
    5757    size_t);
    5858
    59 /** Defined in usb/host/usb_transfer_batch.h */
    60 typedef struct usb_transfer_batch usb_transfer_batch_t;
    61 
    62 /** Callback for outgoing transfer - clone of usb_transfer_batch_callback_t */
    63 typedef int (*usbhc_iface_transfer_callback_t)(usb_transfer_batch_t *);
     59/** Callback for outgoing transfer */
     60typedef int (*usbhc_iface_transfer_callback_t)(void *, int, size_t);
    6461
    6562/** USB device communication interface. */
  • uspace/lib/drv/include/usbhid_iface.h

    r887c9de rf9d0a86  
    3838
    3939#include "ddf/driver.h"
    40 #include <usb/usb.h>
    4140
    4241extern int usbhid_dev_get_event_length(async_sess_t *, size_t *);
  • uspace/lib/ext4/Makefile

    r887c9de rf9d0a86  
    2929USPACE_PREFIX = ../..
    3030LIBRARY = libext4
    31 EXTRA_CFLAGS = \
    32     -I$(LIBBLOCK_PREFIX) \
    33     -I$(LIBCRYPTO_PREFIX) \
    34     -I$(LIBFS_PREFIX) \
    35     -Iinclude
     31LIBS = block crypto fs
    3632
    3733SOURCES = \
  • uspace/lib/fdisk/Makefile

    r887c9de rf9d0a86  
    2828
    2929USPACE_PREFIX = ../..
    30 EXTRA_CFLAGS = -Iinclude
    3130
    3231LIBRARY = libfdisk
  • uspace/lib/fmtutil/Makefile

    r887c9de rf9d0a86  
    2828
    2929USPACE_PREFIX = ../..
    30 EXTRA_CFLAGS = -I.
    3130LIBRARY = libfmtutil
    3231
  • uspace/lib/graph/Makefile

    r887c9de rf9d0a86  
    2929USPACE_PREFIX = ../..
    3030LIBRARY = libgraph
    31 SLIBRARY = libgraph.so.0.0
    32 LSONAME = libgraph.so.0
    3331
    3432SOURCES = \
  • uspace/lib/gui/Makefile

    r887c9de rf9d0a86  
    2929USPACE_PREFIX = ../..
    3030LIBRARY = libgui
    31 SLIBRARY = libgui.so.0.0
    32 LSONAME = libgui.so.0
    33 EXTRA_CFLAGS += -I$(LIBDRAW_PREFIX) -I$(LIBSOFTREND_PREFIX) -I$(LIBGRAPH_PREFIX)
     31LIBS = draw softrend graph
    3432
    3533SOURCES = \
  • uspace/lib/hound/Makefile

    r887c9de rf9d0a86  
    2828
    2929USPACE_PREFIX = ../..
    30 EXTRA_CFLAGS = -Iinclude/hound -Iinclude -I$(LIBPCM_PREFIX)/include
     30EXTRA_CFLAGS = -Iinclude/hound
    3131LIBRARY = libhound
     32LIBS = pcm
    3233
    3334SOURCES = \
  • uspace/lib/http/Makefile

    r887c9de rf9d0a86  
    2929USPACE_PREFIX = ../..
    3030LIBRARY = libhttp
    31 SLIBRARY = libhttp.so.0.0
    32 LSONAME = libhttp.so.0
    3331EXTRA_CFLAGS += -Iinclude
    3432
  • uspace/lib/http/include/http/receive-buffer.h

    r887c9de rf9d0a86  
    3939#include <adt/list.h>
    4040#include <stddef.h>
     41#include <types/common.h>
    4142
    4243/** Receive data.
  • uspace/lib/ieee80211/Makefile

    r887c9de rf9d0a86  
    2929USPACE_PREFIX = ../..
    3030LIBRARY = libieee80211
    31 
    32 LIBS = \
    33         $(LIBDRV_PREFIX)/libdrv.a \
    34         $(LIBNIC_PREFIX)/libnic.a \
    35         $(LIBCRYPTO_PREFIX)/libcrypto.a
    36 
    37 EXTRA_CFLAGS += \
    38         -Iinclude \
    39         -I$(LIBDRV_PREFIX)/include \
    40         -I$(LIBNIC_PREFIX)/include \
    41         -I$(LIBCRYPTO_PREFIX)
     31LIBS = drv nic crypto
    4232
    4333SOURCES = \
  • uspace/lib/label/Makefile

    r887c9de rf9d0a86  
    2828
    2929USPACE_PREFIX = ../..
    30 EXTRA_CFLAGS = -Iinclude
    3130
    3231LIBRARY = liblabel
  • uspace/lib/math/Makefile

    r887c9de rf9d0a86  
    3333
    3434LIBRARY = libmath
    35 SLIBRARY = libmath.so.0.0
    36 LSONAME = libmath.so.0
    37 MATH = y
     35SOVERSION = 0.0
     36
     37EXTRA_CFLAGS += -Iarch/$(UARCH)/include
    3838
    3939-include $(CONFIG_MAKEFILE)
  • uspace/lib/math/include/mathtypes.h

    r887c9de rf9d0a86  
    191191#endif
    192192
    193 
    194 #if defined(FLOAT_SIZE_32)
    195 
    196 #ifndef float32_t
    197         #define float32_t  float
    198 #endif
    199 
    200 #elif defined(FLOAT_SIZE_64)
    201 
    202 #ifndef float64_t
    203         #define float64_t  float
    204 #endif
    205 
    206 #elif defined(FLOAT_SIZE_96)
    207 
    208 #ifndef float96_t
    209         #define float96_t  float
    210 #endif
    211 
    212 #elif defined(FLOAT_SIZE_128)
    213 
    214 #ifndef float128_t
    215         #define float128_t  float
    216 #endif
    217 
    218 #endif
    219 
    220 
    221 #if defined(DOUBLE_SIZE_32)
    222 
    223 #ifndef float32_t
    224         #define float32_t  double
    225 #endif
    226 
    227 #elif defined(DOUBLE_SIZE_64)
    228 
    229 #ifndef float64_t
    230         #define float64_t  double
    231 #endif
    232 
    233 #elif defined(DOUBLE_SIZE_96)
    234 
    235 #ifndef float96_t
    236         #define float96_t  double
    237 #endif
    238 
    239 #elif defined(DOUBLE_SIZE_128)
    240 
    241 #ifndef float128_t
    242         #define float128_t  double
    243 #endif
    244 
    245 #endif
    246 
    247 
    248 #if defined(LONG_DOUBLE_SIZE_32)
    249 
    250 #ifndef float32_t
    251         #define float32_t  long double
    252 #endif
    253 
    254 #elif defined(LONG_DOUBLE_SIZE_64)
    255 
    256 #ifndef float64_t
    257         #define float64_t  long double
    258 #endif
    259 
    260 #elif defined(LONG_DOUBLE_SIZE_96)
    261 
    262 #ifndef float96_t
    263         #define float96_t  long double
    264 #endif
    265 
    266 #elif defined(LONG_DOUBLE_SIZE_128)
    267 
    268 #ifndef float128_t
    269         #define float128_t  long double
    270 #endif
    271 
    272 #endif
    273 
     193#if __SIZEOF_FLOAT__ == 4
     194#define float32_t float
     195#elif __SIZEOF_DOUBLE__ == 4
     196#define float32_t double
     197#elif __SIZEOF_LONG_DOUBLE__ == 4
     198#define float32_t long double
     199#endif
     200
     201#if __SIZEOF_FLOAT__ == 8
     202#define float64_t float
     203#elif __SIZEOF_DOUBLE__ == 8
     204#define float64_t double
     205#elif __SIZEOF_LONG_DOUBLE__ == 8
     206#define float64_t long double
     207#endif
     208
     209#if __SIZEOF_FLOAT__ == 12
     210#define float96_t float
     211#elif __SIZEOF_DOUBLE__ == 12
     212#define float96_t double
     213#elif __SIZEOF_LONG_DOUBLE__ == 12
     214#define float96_t long double
     215#endif
     216
     217#if __SIZEOF_FLOAT__ == 16
     218#define float128_t float
     219#elif __SIZEOF_DOUBLE__ == 16
     220#define float128_t double
     221#elif __SIZEOF_LONG_DOUBLE__ == 16
     222#define float128_t long double
     223#endif
    274224
    275225#ifdef float32_t
  • uspace/lib/nettl/Makefile

    r887c9de rf9d0a86  
    2828
    2929USPACE_PREFIX = ../..
    30 EXTRA_CFLAGS = -Iinclude
    3130LIBRARY = libnettl
    3231
  • uspace/lib/nic/Makefile

    r887c9de rf9d0a86  
    2929USPACE_PREFIX = ../..
    3030LIBRARY = libnic
    31 EXTRA_CFLAGS += -DLIBNIC_INTERNAL -Iinclude -I$(LIBDRV_PREFIX)/include
     31EXTRA_CFLAGS += -DLIBNIC_INTERNAL
     32LIBS = drv
    3233
    3334SOURCES = \
  • uspace/lib/nic/include/nic_addr_db.h

    r887c9de rf9d0a86  
    4444
    4545#include <adt/hash_table.h>
     46#include <types/common.h>
    4647
    4748/**
  • uspace/lib/nic/src/nic_addr_db.c

    r887c9de rf9d0a86  
    3636 */
    3737#include "nic_addr_db.h"
    38 #include "libarch/common.h"
    3938#include <assert.h>
    4039#include <stdlib.h>
  • uspace/lib/pcm/Makefile

    r887c9de rf9d0a86  
    2828
    2929USPACE_PREFIX = ../..
    30 EXTRA_CFLAGS = -Iinclude/pcm -Iinclude
     30EXTRA_CFLAGS = -Iinclude/pcm
    3131LIBRARY = libpcm
    3232
  • uspace/lib/pcut/Makefile

    r887c9de rf9d0a86  
    3535all-test: $(SELF_TESTS)
    3636
    37 test-libpcut-%: $(OUTPUT)
    38         $(LD) -n $(LFLAGS) -T $(LINKER_SCRIPT) -o $@ $^ $(OUTPUT) $(BASE_LIBS)
     37test-libpcut-%: $(LIBRARY).a
     38        $(LD) -n $(LFLAGS) -T $(LINKER_SCRIPT) -o $@ $(STARTUP) $^ $(LIBRARY).a $(BASE_LIBS)
    3939
  • uspace/lib/pcut/helenos.mak

    r887c9de rf9d0a86  
    3737        src/report/xml.c \
    3838        src/run.c
    39 EXTRA_CFLAGS = -D__helenos__ -Iinclude
     39
     40EXTRA_CFLAGS = -D__helenos__
    4041LIBRARY = libpcut
  • uspace/lib/pcut/update-from-master.sh

    r887c9de rf9d0a86  
    7979all-test: $(SELF_TESTS)
    8080
    81 test-libpcut-%: $(OUTPUT)
    82         $(LD) -n $(LFLAGS) -T $(LINKER_SCRIPT) -o $@ $^ $(OUTPUT) $(BASE_LIBS)
     81test-libpcut-%: $(LIBRARY).a
     82        $(LD) -n $(LFLAGS) -T $(LINKER_SCRIPT) -o $@ $(STARTUP) $^ $(LIBRARY).a $(BASE_LIBS)
    8383
    8484EOF_MAKEFILE_TAIL
  • uspace/lib/posix/Makefile

    r887c9de rf9d0a86  
    3030USPACE_PREFIX = ../..
    3131LIBRARY = libposix
    32 SLIBRARY = libposix.so.0.0
    33 LSONAME = libposix.so.0
    3432
    3533EXTRA_CFLAGS = -Iinclude/
     
    4139FIXED_POSIX_LIBRARY = libposixaslibc.a
    4240FIXED_C_LIBRARY = libc4posix.a
     41MERGED_C_LIBRARY = libc.a
     42MERGE_LIBRARIES = \
     43        $(FIXED_C_LIBRARY) \
     44        $(FIXED_POSIX_LIBRARY) \
     45        $(LIBSOFTFLOAT_PREFIX)/libsoftfloat.a \
     46        $(LIBSOFTINT_PREFIX)/libsoftint.a
    4347
    4448REDEFS_HIDE_LIBC = redefs-hide-libc-symbols.list
     
    4953EXTRA_CLEAN = \
    5054        $(INCLUDE_LIBC) \
    51         $(REDEFS_HIDE_LIBC) $(REDEFS_SHOW_LIBPOSIX) \
    52         $(COLLISIONS_LIST)
    53 EXTRA_OUTPUT = $(FIXED_C_LIBRARY) $(FIXED_POSIX_LIBRARY)
     55        $(REDEFS_HIDE_LIBC) \
     56        $(REDEFS_SHOW_LIBPOSIX) \
     57        $(COLLISIONS_LIST) \
     58        libc.o
     59
     60EXTRA_OUTPUT = $(FIXED_C_LIBRARY) $(FIXED_POSIX_LIBRARY) $(MERGED_C_LIBRARY)
    5461
    5562SOURCES = \
     
    8996        ln -s -f -n ../$^ $@
    9097
    91 $(FIXED_C_LIBRARY): $(REDEFS_HIDE_LIBC) $(REDEFS_SHOW_LIBPOSIX)
     98$(FIXED_C_LIBRARY): $(LIBC_FILE) $(REDEFS_HIDE_LIBC) $(REDEFS_SHOW_LIBPOSIX)
    9299        $(OBJCOPY) --redefine-syms=$(REDEFS_HIDE_LIBC) $(LIBC_FILE) $@
    93100        $(OBJCOPY) --redefine-syms=$(REDEFS_SHOW_LIBPOSIX) $@ $@
     
    96103        $(OBJCOPY) --redefine-syms=$(REDEFS_HIDE_LIBC) $(LIBRARY).a $@
    97104        $(OBJCOPY) --redefine-syms=$(REDEFS_SHOW_LIBPOSIX) $@ $@
     105
     106$(MERGED_C_LIBRARY): $(MERGE_LIBRARIES)
     107        $(LD) --fatal-warnings -r -o libc.o --whole-archive $(MERGE_LIBRARIES) --no-whole-archive
     108        $(AR) rc $@ libc.o
    98109
    99110$(REDEFS_HIDE_LIBC): $(COLLISIONS_LIST)
  • uspace/lib/posix/include/posix/limits.h

    r887c9de rf9d0a86  
    4242#define PATH_MAX 256
    4343
    44 /* it's probably a safe assumption */
    45 #undef CHAR_BIT
    46 #define CHAR_BIT 8
    47 
    4844#endif /* POSIX_LIMITS_H_ */
    4945
  • uspace/lib/posix/include/posix/locale.h

    r887c9de rf9d0a86  
    4040#endif
    4141
    42 #ifndef NULL
    43         #define NULL ((void *) 0)
    44 #endif
     42#include <_bits/NULL.h>
    4543
    4644#ifndef __locale_t_defined
  • uspace/lib/posix/include/posix/stddef.h

    r887c9de rf9d0a86  
    4242#include "sys/types.h"
    4343
    44 #ifndef NULL
    45         #define NULL  ((void *) 0)
    46 #endif
     44#include <_bits/NULL.h>
    4745
    4846#define offsetof(type,member) ((size_t) &(((type *) 0)->member))
  • uspace/lib/posix/include/posix/stdint.h

    r887c9de rf9d0a86  
    4242#include "libc/stdint.h"
    4343
    44 #undef INT8_MAX
    45 #undef INT8_MIN
    46 #define INT8_MAX  127
    47 #define INT8_MIN  (-128)
    48 
    49 #undef UINT8_MAX
    50 #undef UINT8_MIN
    51 #define UINT8_MAX  255
    52 #define UINT8_MIN  0
    53 
    54 #undef INT16_MAX
    55 #undef INT16_MIN
    56 #define INT16_MAX  32767
    57 #define INT16_MIN  (-32768)
    58 
    59 #undef UINT16_MAX
    60 #undef UINT16_MIN
    61 #define UINT16_MAX  65535
    62 #define UINT16_MIN  0
    63 
    64 #undef INT32_MAX
    65 #undef INT32_MIN
    66 #define INT32_MAX  2147483647
    67 #define INT32_MIN  (-INT32_MAX - 1)
    68 
    69 #undef UINT32_MAX
    70 #undef UINT32_MIN
    71 #define UINT32_MAX  4294967295U
    72 #define UINT32_MIN  0U
    73 
    74 #undef INT64_MAX
    75 #undef INT64_MIN
    76 #define INT64_MAX  9223372036854775807LL
    77 #define INT64_MIN  (-INT64_MAX - 1LL)
    78 
    79 #undef UINT64_MAX
    80 #undef  UINT64_MIN
    81 #define UINT64_MAX  18446744073709551615ULL
    82 #define UINT64_MIN  0ULL
    83 
    8444#undef OFF64_MAX
    8545#undef OFF64_MIN
     
    9252#define AOFF64_MIN  UINT64_MIN
    9353
    94 #undef INTMAX_MIN
    95 #undef INTMAX_MAX
    96 #define INTMAX_MIN INT64_MIN
    97 #define INTMAX_MAX INT64_MAX
    98 
    99 #undef UINTMAX_MIN
    100 #undef UINTMAX_MAX
    101 #define UINTMAX_MIN UINT64_MIN
    102 #define UINTMAX_MAX UINT64_MAX
    103 
    104 /*
    105  * Fast* and least* integer types.
    106  *
    107  * The definitions below are correct as long as uint8/16/32/64_t are defined.
    108  * Considering the entire rest of the system would break down if they were not,
    109  * these definitions are just fine.
    110  */
    111 typedef uint8_t uint_least8_t;
    112 typedef uint16_t uint_least16_t;
    113 typedef uint32_t uint_least32_t;
    114 typedef uint64_t uint_least64_t;
    115 
    116 typedef int8_t int_least8_t;
    117 typedef int16_t int_least16_t;
    118 typedef int32_t int_least32_t;
    119 typedef int64_t int_least64_t;
    120 
    121 typedef uint8_t uint_fast8_t;
    122 typedef uint16_t uint_fast16_t;
    123 typedef uint32_t uint_fast32_t;
    124 typedef uint64_t uint_fast64_t;
    125 
    126 typedef int8_t int_fast8_t;
    127 typedef int16_t int_fast16_t;
    128 typedef int32_t int_fast32_t;
    129 typedef int64_t int_fast64_t;
    130 
    13154#endif /* POSIX_STDINT_H_ */
    13255
  • uspace/lib/posix/include/posix/stdlib.h

    r887c9de rf9d0a86  
    4343#include "sys/types.h"
    4444
    45 #ifndef NULL
    46         #define NULL  ((void *) 0)
    47 #endif
     45#include <_bits/NULL.h>
    4846
    4947#define RAND_MAX  714025
  • uspace/lib/posix/include/posix/string.h

    r887c9de rf9d0a86  
    5151 */
    5252
    53 #ifndef NULL
    54         #define NULL  ((void *) 0)
    55 #endif
     53#include <_bits/NULL.h>
    5654
    5755/*
  • uspace/lib/posix/include/posix/strings.h

    r887c9de rf9d0a86  
    4242
    4343
    44 #include <types/common.h>
     44#include "libc/types/common.h"
    4545
    4646/* Search Functions */
  • uspace/lib/posix/include/posix/time.h

    r887c9de rf9d0a86  
    4343#include "sys/types.h"
    4444
    45 #ifndef NULL
    46         #define NULL  ((void *) 0)
    47 #endif
     45#include <_bits/NULL.h>
    4846
    4947#ifndef CLOCKS_PER_SEC
  • uspace/lib/scsi/Makefile

    r887c9de rf9d0a86  
    2828
    2929USPACE_PREFIX = ../..
    30 EXTRA_CFLAGS = -Iinclude
    3130LIBRARY = libscsi
    3231
  • uspace/lib/softfloat/Makefile

    r887c9de rf9d0a86  
    3030USPACE_PREFIX = ../..
    3131LIBRARY = libsoftfloat
    32 MATH = y
     32EXTRA_CFLAGS += $(LIBMATH_INCLUDES_FLAGS)
    3333
    3434SOURCES = \
  • uspace/lib/softint/Makefile

    r887c9de rf9d0a86  
    3131EXTRA_CFLAGS = -Iinclude
    3232LIBRARY = libsoftint
    33 SLIBRARY = libsoftint.so.0.0
    34 LSONAME = libsoftint.so.0
    3533
    3634SOURCES = \
  • uspace/lib/softrend/Makefile

    r887c9de rf9d0a86  
    2929USPACE_PREFIX = ../..
    3030LIBRARY = libsoftrend
    31 SLIBRARY = libsoftrend.so.0.0
    32 LSONAME = libsoftrend.so.0
    33 MATH = y
     31LIBS = math
    3432
    3533SOURCES = \
  • uspace/lib/trackmod/xm.c

    r887c9de rf9d0a86  
    3838#include <stdlib.h>
    3939#include <mem.h>
     40#include <types/common.h>
    4041
    4142#include "byteorder.h"
  • uspace/lib/uri/Makefile

    r887c9de rf9d0a86  
    2929USPACE_PREFIX = ../..
    3030LIBRARY = liburi
    31 SLIBRARY = liburi.so.0.0
    32 LSONAME = liburi.so.0
    3331
    3432SOURCES = \
  • uspace/lib/usb/Makefile

    r887c9de rf9d0a86  
    2929USPACE_PREFIX = ../..
    3030LIBRARY = libusb
    31 EXTRA_CFLAGS += \
    32         -I$(LIBDRV_PREFIX)/include \
    33         -I$(LIBUSBDEV_PREFIX)/include \
    34         -Iinclude
     31LIBS = drv
    3532
    3633SOURCES = \
  • uspace/lib/usb/include/usb/request.h

    r887c9de rf9d0a86  
    3737
    3838#include <stdint.h>
     39#include <assert.h>
    3940
    4041/** Standard device request. */
     
    107108} __attribute__ ((packed)) usb_device_request_setup_packet_t;
    108109
    109 int assert[(sizeof(usb_device_request_setup_packet_t) == 8) ? 1: -1];
     110static_assert(sizeof(usb_device_request_setup_packet_t) == 8);
    110111
    111112/** How many toggles need to be reset */
  • uspace/lib/usb/include/usb/usb.h

    r887c9de rf9d0a86  
    3939#include <stdint.h>
    4040#include <types/common.h>
     41#include <usb_iface.h>
    4142
    4243/** Convert 16bit value from native (host) endianness to USB endianness. */
     
    5253#define uint32_usb2host(n) uint32_t_le2host((n))
    5354
    54 
    55 /** USB transfer type. */
    56 typedef enum {
    57         USB_TRANSFER_CONTROL = 0,
    58         USB_TRANSFER_ISOCHRONOUS = 1,
    59         USB_TRANSFER_BULK = 2,
    60         USB_TRANSFER_INTERRUPT = 3
    61 } usb_transfer_type_t;
    62 
    6355const char * usb_str_transfer_type(usb_transfer_type_t t);
    6456const char * usb_str_transfer_type_short(usb_transfer_type_t t);
    6557
    66 /** USB data transfer direction. */
    67 typedef enum {
    68         USB_DIRECTION_IN,
    69         USB_DIRECTION_OUT,
    70         USB_DIRECTION_BOTH
    71 } usb_direction_t;
    72 
    7358const char *usb_str_direction(usb_direction_t);
    74 
    75 /** USB speeds. */
    76 typedef enum {
    77         /** USB 1.1 low speed (1.5Mbits/s). */
    78         USB_SPEED_LOW,
    79         /** USB 1.1 full speed (12Mbits/s). */
    80         USB_SPEED_FULL,
    81         /** USB 2.0 high speed (480Mbits/s). */
    82         USB_SPEED_HIGH,
    83         /** USB 3.0 super speed (5Gbits/s). */
    84         USB_SPEED_SUPER,
    85         /** Psuedo-speed serving as a boundary. */
    86         USB_SPEED_MAX
    87 } usb_speed_t;
    8859
    8960static inline bool usb_speed_is_11(const usb_speed_t s)
     
    11081} usb_request_recipient_t;
    11182
    112 /** USB address type.
    113  * Negative values could be used to indicate error.
    114  */
    115 typedef int16_t usb_address_t;
    116 
    117 typedef struct {
    118         usb_address_t address;
    119         unsigned port;
    120 } usb_tt_address_t;
    121 
    12283/** Default USB address. */
    12384#define USB_ADDRESS_DEFAULT 0
     
    139100}
    140101
    141 /** USB endpoint number type.
    142  * Negative values could be used to indicate error.
    143  */
    144 typedef int16_t usb_endpoint_t;
    145 
    146102/** Default control endpoint */
    147103#define USB_ENDPOINT_DEFAULT_CONTROL 0
     
    162118            (ep < USB11_ENDPOINT_MAX);
    163119}
    164 
    165 
    166 /** USB complete address type.
    167  * Pair address + endpoint is identification of transaction recipient.
    168  */
    169 typedef union {
    170         struct {
    171                 usb_address_t address;
    172                 usb_endpoint_t endpoint;
    173         } __attribute__((packed));
    174         uint32_t packed;
    175 } usb_target_t;
    176 
    177 /** Description of usb endpoint.
    178  */
    179 typedef struct {
    180         /** Endpoint number. */
    181         usb_endpoint_t endpoint_no;
    182 
    183         /** Endpoint transfer type. */
    184         usb_transfer_type_t transfer_type;
    185 
    186         /** Endpoint direction. */
    187         usb_direction_t direction;
    188 
    189         /** Maximum packet size for the endpoint. */
    190         size_t max_packet_size;
    191 
    192         /** Number of packets per frame/uframe.
    193          * Only valid for HS INT and ISO transfers. All others should set to 1*/
    194         unsigned packets;
    195 
    196         struct {
    197                 unsigned polling_interval;
    198         } usb2;
    199 
    200         struct {
    201                 unsigned max_burst;
    202                 unsigned max_streams;
    203         } usb3;
    204 } usb_endpoint_desc_t;
    205120
    206121/** Check USB target for allowed values (address and endpoint).
  • uspace/lib/usbdev/Makefile

    r887c9de rf9d0a86  
    2929USPACE_PREFIX = ../..
    3030LIBRARY = libusbdev
    31 EXTRA_CFLAGS += \
    32         -I$(LIBUSB_PREFIX)/include \
    33         -I$(LIBDRV_PREFIX)/include \
    34         -Iinclude
     31LIBS = usb drv
    3532
    3633SOURCES = \
  • uspace/lib/usbhid/Makefile

    r887c9de rf9d0a86  
    2929USPACE_PREFIX = ../..
    3030LIBRARY = libusbhid
    31 EXTRA_CFLAGS += \
    32         -I$(LIBUSB_PREFIX)/include \
    33         -I$(LIBUSBDEV_PREFIX)/include \
    34         -I$(LIBDRV_PREFIX)/include \
    35         -Iinclude
     31LIBS = usb usbdev drv
    3632
    3733SOURCES = \
  • uspace/lib/usbhost/Makefile

    r887c9de rf9d0a86  
    3030LIBRARY = libusbhost
    3131EXTRA_CFLAGS += \
    32         -I$(LIBUSB_PREFIX)/include \
    33         -I$(LIBDRV_PREFIX)/include \
    34         -Iinclude/usb/host \
    35         -Iinclude
     32        -Iinclude/usb/host
     33LIBS = usb drv
    3634
    3735SOURCES = \
  • uspace/lib/usbhost/include/usb/host/hcd.h

    r887c9de rf9d0a86  
    4646#include <stddef.h>
    4747#include <stdint.h>
     48#include <usbhc_iface.h>
    4849
    4950typedef struct hcd hcd_t;
     
    110111extern int hcd_send_batch(hcd_t *, device_t *, usb_target_t,
    111112    usb_direction_t direction, char *, size_t, uint64_t,
    112     usb_transfer_batch_callback_t, void *, const char *);
     113    usbhc_iface_transfer_callback_t, void *, const char *);
    113114
    114115extern ssize_t hcd_send_batch_sync(hcd_t *, device_t *, usb_target_t,
  • uspace/lib/usbhost/include/usb/host/usb_transfer_batch.h

    r887c9de rf9d0a86  
    3939#include <usb/usb.h>
    4040#include <usb/request.h>
     41#include <usbhc_iface.h>
    4142
    4243#include <atomic.h>
     
    4950typedef struct endpoint endpoint_t;
    5051typedef struct bus bus_t;
    51 typedef struct usb_transfer_batch usb_transfer_batch_t;
    52 
    53 /** Callback to be called on transfer. */
    54 typedef int (*usb_transfer_batch_callback_t)(usb_transfer_batch_t *);
    5552
    5653/** Structure stores additional data needed for communication with EP */
     
    6966
    7067        /** Function called on completion */
    71         usb_transfer_batch_callback_t on_complete;
     68        usbhc_iface_transfer_callback_t on_complete;
    7269        /** Arbitrary data for the handler */
    7370        void *on_complete_data;
  • uspace/lib/usbhost/src/hcd.c

    r887c9de rf9d0a86  
    8282int hcd_send_batch(hcd_t *hcd, device_t *device, usb_target_t target,
    8383    usb_direction_t direction, char *data, size_t size, uint64_t setup_data,
    84     usb_transfer_batch_callback_t on_complete, void *arg, const char *name)
     84    usbhc_iface_transfer_callback_t on_complete, void *arg, const char *name)
    8585{
    8686        assert(hcd);
     
    153153} sync_data_t;
    154154
    155 static int sync_transfer_complete(usb_transfer_batch_t *batch)
     155static int sync_transfer_complete(void *arg, int error, size_t transfered_size)
    156156{
    157         sync_data_t *d = batch->on_complete_data;
     157        sync_data_t *d = arg;
    158158        assert(d);
    159         d->transfered_size = batch->transfered_size;
    160         d->error = batch->error;
     159        d->transfered_size = transfered_size;
     160        d->error = error;
    161161        fibril_mutex_lock(&d->done_mtx);
    162162        d->done = 1;
  • uspace/lib/usbhost/src/usb_transfer_batch.c

    r887c9de rf9d0a86  
    124124
    125125        if (batch->on_complete) {
    126                 const int err = batch->on_complete(batch);
     126                const int err = batch->on_complete(batch->on_complete_data, batch->error, batch->transfered_size);
    127127                if (err)
    128128                        usb_log_warning("batch %p failed to complete: %s",
  • uspace/lib/usbvirt/Makefile

    r887c9de rf9d0a86  
    2929USPACE_PREFIX = ../..
    3030LIBRARY = libusbvirt
    31 
    3231EXTRA_CFLAGS = \
    33         -I$(LIBDRV_PREFIX)/include \
    34         -I$(LIBUSB_PREFIX)/include \
    35         -I$(LIBUSBDEV_PREFIX)/include \
    36         -Iinclude \
    3732        -Iinclude/usbvirt
     33LIBS = drv usb usbdev
    3834
    3935SOURCES = \
Note: See TracChangeset for help on using the changeset viewer.