Changes in / [42964a7:3b10ae36] in mainline


Ignore:
Location:
uspace
Files:
10 added
20 deleted
19 edited

Legend:

Unmodified
Added
Removed
  • uspace/Makefile

    r42964a7 r3b10ae36  
    6767        app/redir \
    6868        app/rcutest \
    69         app/rcubench \
    7069        app/sbi \
    7170        app/sportdmp \
  • uspace/Makefile.common

    r42964a7 r3b10ae36  
    3535#   DEFS               compiler defines
    3636#   EXTRA_CFLAGS       additional flags to pass to C compiler
    37 #   LINKER_SCRIPT      linker script
    3837#   PRE_DEPEND         targets required for dependency check
    3938#
     
    153152BASE_LIBS += $(LIBSOFTFLOAT_PREFIX)/libsoftfloat.a $(LIBSOFTINT_PREFIX)/libsoftint.a
    154153
    155 ifeq ($(LINK_DYNAMIC),y)
    156         LINKER_SCRIPT ?= $(LIBC_PREFIX)/arch/$(UARCH)/_link-dlexe.ld
    157 else
     154ifneq ($(LINK_DYNAMIC),y)
    158155        LDFLAGS += -static
    159         LINKER_SCRIPT ?= $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld
    160 endif
    161 
    162 LIB_LINKER_SCRIPT = $(LIBC_PREFIX)/arch/$(UARCH)/_link-shlib.ld
     156endif
    163157
    164158INCLUDES_FLAGS = $(LIBC_INCLUDES_FLAGS)
     
    261255endif
    262256
    263 COMMON_CXXFLAGS = $(COMMON_CFLAGS)
     257COMMON_CXXFLAGS = $(COMMON_CFLAGS) -fno-exceptions
    264258HELENOS_CXXFLAGS = \
    265259        -std=c++17 -frtti \
     
    351345
    352346ifneq ($(filter %.cpp %.cc %.cxx, $(SOURCES)),)
    353 $(BINARY): $(LINKER_SCRIPT) $(OBJECTS) $(LIBTAGS)
    354         $(CXX) $(CXXFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) -T $(LINKER_SCRIPT) -Wl,-Map,$@.map -o $@ $(START_FILES) $(OBJECTS) $(LIBARGS) $(CXX_BASE_LIBS)
     347$(BINARY): $(OBJECTS) $(LIBTAGS)
     348        $(CXX) $(CXXFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) -Wl,-Map,$@.map -o $@ $(START_FILES) $(OBJECTS) $(LIBARGS) $(CXX_BASE_LIBS)
    355349else
    356 $(BINARY): $(LINKER_SCRIPT) $(OBJECTS) $(LIBTAGS)
    357         $(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) -T $(LINKER_SCRIPT) -Wl,-Map,$@.map -o $@ $(START_FILES) $(OBJECTS) $(LIBARGS) $(BASE_LIBS)
     350$(BINARY): $(OBJECTS) $(LIBTAGS)
     351        $(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) -Wl,-Map,$@.map -o $@ $(START_FILES) $(OBJECTS) $(LIBARGS) $(BASE_LIBS)
    358352endif
    359353
     
    361355
    362356ifneq ($(TEST_BINARY),)
    363 $(TEST_BINARY): $(LINKER_SCRIPT) $(TEST_OBJECTS) $(TEST_BINARY_LIBS) $(LIBTAGS)
    364         $(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) -T $(LINKER_SCRIPT) -Wl,-Map,$@.map -o $@ $(START_FILES) $(TEST_OBJECTS) $(TEST_BINARY_LIBS) $(LIBARGS) $(BASE_LIBS)
     357$(TEST_BINARY): $(TEST_OBJECTS) $(TEST_BINARY_LIBS) $(LIBTAGS)
     358        $(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) -Wl,-Map,$@.map -o $@ $(START_FILES) $(TEST_OBJECTS) $(TEST_BINARY_LIBS) $(LIBARGS) $(BASE_LIBS)
    365359endif
    366360
     
    378372        $(AR) rc $@ $(LOBJECTS)
    379373
    380 $(SLIBRARY): $(LIB_LINKER_SCRIPT) $(LIBRARY).la
    381         $(CC) $(CFLAGS) $(LIB_LDFLAGS) $(EXTRA_LDFLAGS) -T $(LIB_LINKER_SCRIPT) -Wl,-Map,$@.map -o $@ -Wl,--whole-archive $(LIBRARY).la -Wl,--no-whole-archive $(LIBARGS) $(BASE_LIBS)
     374$(SLIBRARY): $(LIBRARY).la
     375        $(CC) $(CFLAGS) $(LIB_LDFLAGS) $(EXTRA_LDFLAGS) -Wl,-Map,$@.map -o $@ -Wl,--whole-archive $(LIBRARY).la -Wl,--no-whole-archive $(LIBARGS) $(BASE_LIBS)
    382376
    383377$(LSONAME):
  • uspace/app/rcutest/rcutest.c

    r42964a7 r3b10ae36  
    4646#include <fibril_synch.h>
    4747#include <compiler/barrier.h>
    48 #include <futex.h>
    4948#include <str.h>
    5049
  • uspace/lib/c/Makefile

    r42964a7 r3b10ae36  
    3333CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config
    3434
    35 LINKER_SCRIPTS = \
    36         $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld \
    37         $(LIBC_PREFIX)/arch/$(UARCH)/_link-shlib.ld \
    38         $(LIBC_PREFIX)/arch/$(UARCH)/_link-dlexe.ld
    39 
    40 PRE_DEPEND =
    41 EXTRA_OUTPUT = $(LINKER_SCRIPTS) $(START_FILES)
    42 EXTRA_CLEAN = $(LINKER_SCRIPTS)
     35EXTRA_OUTPUT = $(START_FILES)
    4336EXTRA_TEST_CFLAGS = -Wno-deprecated-declarations
    4437LIBRARY = libc
     
    5144        generic/libc.c \
    5245        generic/ddi.c \
    53         generic/atomic.c \
    5446        generic/as.c \
    5547        generic/bd.c \
     
    8577        generic/strtol.c \
    8678        generic/l18n/langs.c \
    87         generic/fibril.c \
    88         generic/fibril_synch.c \
    8979        generic/pcb.c \
    9080        generic/smc.c \
    9181        generic/smp_memory_barrier.c \
    92         generic/thread.c \
    93         generic/tls.c \
    9482        generic/task.c \
    95         generic/futex.c \
    9683        generic/imath.c \
    9784        generic/inet/addr.c \
     
    142129        generic/stdio/sstream.c \
    143130        generic/stdio/vsprintf.c \
     131        generic/thread/atomic.c \
     132        generic/thread/fibril.c \
     133        generic/thread/fibril_synch.c \
     134        generic/thread/thread.c \
     135        generic/thread/tls.c \
     136        generic/thread/futex.c \
     137        generic/thread/rcu.c \
     138        generic/thread/mpsc.c \
    144139        generic/sysinfo.c \
    145140        generic/ipc.c \
     
    165160        generic/vfs/mtab.c \
    166161        generic/vfs/vfs.c \
    167         generic/rcu.c \
    168162        generic/setjmp.c \
    169163        generic/stack.c \
     
    218212        cp $< $@
    219213
    220 $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld: $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld.in
    221         $(CC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -E -x c $< | grep -v "^\#" > $@
    222 
    223 $(LIBC_PREFIX)/arch/$(UARCH)/_link-shlib.ld: $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld.in
    224         $(CC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -DSHLIB -E -x c $< | grep -v "^\#" > $@
    225 
    226 $(LIBC_PREFIX)/arch/$(UARCH)/_link-dlexe.ld: $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld.in
    227         $(CC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -DDLEXE -E -x c $< | grep -v "^\#" > $@
    228 
    229214AUTOCHECK = $(realpath $(ROOT_PATH)/tools/autocheck.awk)
    230215
  • uspace/lib/c/generic/async/ports.c

    r42964a7 r3b10ae36  
    5151#include <abi/mm/as.h>
    5252#include "../private/libc.h"
     53#include "../private/fibril.h"
    5354
    5455/** Interface data */
  • uspace/lib/c/generic/async/server.c

    r42964a7 r3b10ae36  
    124124#define DPRINTF(...)  ((void) 0)
    125125
    126 /** Call data */
    127 typedef struct {
    128         link_t link;
    129         ipc_call_t call;
    130 } msg_t;
    131 
    132126/* Client connection data */
    133127typedef struct {
     
    156150        client_t *client;
    157151
    158         /** Message event. */
    159         fibril_event_t msg_arrived;
    160 
    161         /** Messages that should be delivered to this fibril. */
    162         list_t msg_queue;
     152        /** Channel for messages that should be delivered to this fibril. */
     153        mpsc_t *msg_channel;
    163154
    164155        /** Call data of the opening call. */
    165156        ipc_call_t call;
    166 
    167         /** Identification of the closing call. */
    168         cap_call_handle_t close_chandle;
    169157
    170158        /** Fibril function that will be used to handle the connection. */
     
    423411        async_client_put(client);
    424412
     413        fibril_rmutex_lock(&conn_mutex);
     414
    425415        /*
    426416         * Remove myself from the connection hash table.
    427417         */
    428         fibril_rmutex_lock(&conn_mutex);
    429418        hash_table_remove(&conn_hash_table, &(conn_key_t){
    430419                .task_id = fibril_connection->in_task_id,
    431420                .phone_hash = fibril_connection->in_phone_hash
    432421        });
     422
     423        /*
     424         * Close the channel, if it isn't closed already.
     425         */
     426        mpsc_t *c = fibril_connection->msg_channel;
     427        mpsc_close(c);
     428
    433429        fibril_rmutex_unlock(&conn_mutex);
    434430
     
    436432         * Answer all remaining messages with EHANGUP.
    437433         */
    438         while (!list_empty(&fibril_connection->msg_queue)) {
    439                 msg_t *msg =
    440                     list_get_instance(list_first(&fibril_connection->msg_queue),
    441                     msg_t, link);
    442 
    443                 list_remove(&msg->link);
    444                 ipc_answer_0(msg->call.cap_handle, EHANGUP);
    445                 free(msg);
    446         }
     434        ipc_call_t call;
     435        while (mpsc_receive(c, &call, NULL) == EOK)
     436                ipc_answer_0(call.cap_handle, EHANGUP);
    447437
    448438        /*
    449          * If the connection was hung-up, answer the last call,
    450          * i.e. IPC_M_PHONE_HUNGUP.
     439         * Clean up memory.
    451440         */
    452         if (fibril_connection->close_chandle)
    453                 ipc_answer_0(fibril_connection->close_chandle, EOK);
    454 
     441        mpsc_destroy(c);
    455442        free(fibril_connection);
    456443        return EOK;
     
    488475        conn->in_task_id = in_task_id;
    489476        conn->in_phone_hash = in_phone_hash;
    490         conn->msg_arrived = FIBRIL_EVENT_INIT;
    491         list_initialize(&conn->msg_queue);
    492         conn->close_chandle = CAP_NIL;
     477        conn->msg_channel = mpsc_create(sizeof(ipc_call_t));
    493478        conn->handler = handler;
    494479        conn->data = data;
     
    503488
    504489        if (conn->fid == 0) {
     490                mpsc_destroy(conn->msg_channel);
    505491                free(conn);
    506492
     
    606592 * @param call Data of the incoming call.
    607593 *
    608  * @return False if the call doesn't match any connection.
    609  * @return True if the call was passed to the respective connection fibril.
    610  *
    611  */
    612 static bool route_call(ipc_call_t *call)
     594 * @return EOK if the call was successfully passed to the respective fibril.
     595 * @return ENOENT if the call doesn't match any connection.
     596 * @return Other error code if routing failed for other reasons.
     597 *
     598 */
     599static errno_t route_call(ipc_call_t *call)
    613600{
    614601        assert(call);
     
    622609        if (!link) {
    623610                fibril_rmutex_unlock(&conn_mutex);
    624                 return false;
     611                return ENOENT;
    625612        }
    626613
    627614        connection_t *conn = hash_table_get_inst(link, connection_t, link);
    628615
    629         // FIXME: malloc in critical section
    630         msg_t *msg = malloc(sizeof(*msg));
    631         if (!msg) {
    632                 fibril_rmutex_unlock(&conn_mutex);
    633                 return false;
    634         }
    635 
    636         msg->call = *call;
    637         list_append(&msg->link, &conn->msg_queue);
    638 
    639         if (IPC_GET_IMETHOD(*call) == IPC_M_PHONE_HUNGUP)
    640                 conn->close_chandle = call->cap_handle;
     616        errno_t rc = mpsc_send(conn->msg_channel, call);
     617
     618        if (IPC_GET_IMETHOD(*call) == IPC_M_PHONE_HUNGUP) {
     619                /* Close the channel, but let the connection fibril answer. */
     620                mpsc_close(conn->msg_channel);
     621                // FIXME: Ideally, we should be able to discard/answer the
     622                //        hungup message here and just close the channel without
     623                //        passing it out. Unfortunatelly, somehow that breaks
     624                //        handling of CPU exceptions.
     625        }
    641626
    642627        fibril_rmutex_unlock(&conn_mutex);
    643 
    644         /* If the connection fibril is waiting for an event, activate it */
    645         fibril_notify(&conn->msg_arrived);
    646         return true;
     628        return rc;
    647629}
    648630
     
    939921        assert(fibril_connection);
    940922
    941         /*
    942          * Why doing this?
    943          * GCC 4.1.0 coughs on fibril_connection-> dereference.
    944          * GCC 4.1.1 happilly puts the rdhwr instruction in delay slot.
    945          *           I would never expect to find so many errors in
    946          *           a compiler.
    947          */
    948         connection_t *conn = fibril_connection;
    949 
    950923        struct timeval tv;
    951924        struct timeval *expires = NULL;
     
    956929        }
    957930
    958         fibril_rmutex_lock(&conn_mutex);
    959 
    960         /* If nothing in queue, wait until something arrives */
    961         while (list_empty(&conn->msg_queue)) {
    962                 if (conn->close_chandle) {
    963                         /*
    964                          * Handle the case when the connection was already
    965                          * closed by the client but the server did not notice
    966                          * the first IPC_M_PHONE_HUNGUP call and continues to
    967                          * call async_get_call_timeout(). Repeat
    968                          * IPC_M_PHONE_HUNGUP until the caller notices.
    969                          */
    970                         memset(call, 0, sizeof(ipc_call_t));
    971                         IPC_SET_IMETHOD(*call, IPC_M_PHONE_HUNGUP);
    972                         fibril_rmutex_unlock(&conn_mutex);
    973                         return true;
    974                 }
    975 
    976                 // TODO: replace with cvar
    977                 fibril_rmutex_unlock(&conn_mutex);
    978 
    979                 errno_t rc = fibril_wait_timeout(&conn->msg_arrived, expires);
    980                 if (rc == ETIMEOUT)
    981                         return false;
    982 
    983                 fibril_rmutex_lock(&conn_mutex);
    984         }
    985 
    986         msg_t *msg = list_get_instance(list_first(&conn->msg_queue),
    987             msg_t, link);
    988         list_remove(&msg->link);
    989 
    990         *call = msg->call;
    991         free(msg);
    992 
    993         fibril_rmutex_unlock(&conn_mutex);
     931        errno_t rc = mpsc_receive(fibril_connection->msg_channel,
     932            call, expires);
     933
     934        if (rc == ETIMEOUT)
     935                return false;
     936
     937        if (rc != EOK) {
     938                /*
     939                 * The async_get_call_timeout() interface doesn't support
     940                 * propagating errors. Return a null call instead.
     941                 */
     942
     943                memset(call, 0, sizeof(ipc_call_t));
     944        }
     945
    994946        return true;
    995947}
     
    10711023
    10721024        /* Try to route the call through the connection hash table */
    1073         if (route_call(call))
     1025        errno_t rc = route_call(call);
     1026        if (rc == EOK)
    10741027                return;
    10751028
    1076         /* Unknown call from unknown phone - hang it up */
    1077         ipc_answer_0(call->cap_handle, EHANGUP);
     1029        // TODO: Log the error.
     1030
     1031        if (call->cap_handle != CAP_NIL)
     1032                /* Unknown call from unknown phone - hang it up */
     1033                ipc_answer_0(call->cap_handle, EHANGUP);
    10781034}
    10791035
  • uspace/lib/c/generic/io/kio.c

    r42964a7 r3b10ae36  
    4444#include <macros.h>
    4545#include <libarch/config.h>
    46 #include <futex.h>
     46
     47#include "../private/futex.h"
    4748
    4849#define KIO_BUFFER_SIZE PAGE_SIZE
  • uspace/lib/c/generic/ipc.c

    r42964a7 r3b10ae36  
    4646#include <errno.h>
    4747#include <adt/list.h>
    48 #include <futex.h>
    4948#include <fibril.h>
    5049#include <macros.h>
  • uspace/lib/c/generic/malloc.c

    r42964a7 r3b10ae36  
    4444#include <bitops.h>
    4545#include <mem.h>
    46 #include <fibril_synch.h>
    4746#include <stdlib.h>
    4847#include <adt/gcdlcm.h>
     48
    4949#include "private/malloc.h"
     50#include "private/fibril.h"
    5051
    5152/** Magic used in heap headers. */
  • uspace/lib/c/generic/private/fibril.h

    r42964a7 r3b10ae36  
    3535#include <abi/proc/uarg.h>
    3636#include <atomic.h>
    37 #include <futex.h>
     37#include <fibril.h>
     38
     39#include "./futex.h"
     40
     41typedef struct {
     42        fibril_t *fibril;
     43} fibril_event_t;
     44
     45#define FIBRIL_EVENT_INIT ((fibril_event_t) {0})
    3846
    3947struct fibril {
     
    7381extern void __fibrils_init(void);
    7482
     83extern void fibril_wait_for(fibril_event_t *);
     84extern errno_t fibril_wait_timeout(fibril_event_t *, const struct timeval *);
     85extern void fibril_notify(fibril_event_t *);
     86
     87extern errno_t fibril_ipc_wait(ipc_call_t *, const struct timeval *);
     88extern void fibril_ipc_poke(void);
     89
     90/**
     91 * "Restricted" fibril mutex.
     92 *
     93 * Similar to `fibril_mutex_t`, but has a set of restrictions placed on its
     94 * use. Within a rmutex critical section, you
     95 *         - may not use any other synchronization primitive,
     96 *           save for another `fibril_rmutex_t`. This includes nonblocking
     97 *           operations like cvar signal and mutex unlock, unless otherwise
     98 *           specified.
     99 *         - may not read IPC messages
     100 *         - may not start a new thread/fibril
     101 *           (creating fibril without starting is fine)
     102 *
     103 * Additionally, locking with a timeout is not possible on this mutex,
     104 * and there is no associated condition variable type.
     105 * This is a design constraint, not a lack of implementation effort.
     106 */
     107typedef struct {
     108        // TODO: At this point, this is just silly handwaving to hide current
     109        //       futex use behind a fibril based abstraction. Later, the imple-
     110        //       mentation will change, but the restrictions placed on this type
     111        //       will allow it to be simpler and faster than a regular mutex.
     112        //       There might also be optional debug checking of the assumptions.
     113        //
     114        //       Note that a consequence of the restrictions is that if we are
     115        //       running on a single thread, no other fibril can ever get to run
     116        //       while a fibril has a rmutex locked. That means that for
     117        //       single-threaded programs, we can reduce all rmutex locks and
     118        //       unlocks to simple branches on a global bool variable.
     119
     120        futex_t futex;
     121} fibril_rmutex_t;
     122
     123#define FIBRIL_RMUTEX_INITIALIZER(name) \
     124        { .futex = FUTEX_INITIALIZE(1) }
     125
     126#define FIBRIL_RMUTEX_INITIALIZE(name) \
     127        fibril_rmutex_t name = FIBRIL_RMUTEX_INITIALIZER(name)
     128
     129extern void fibril_rmutex_initialize(fibril_rmutex_t *);
     130extern void fibril_rmutex_lock(fibril_rmutex_t *);
     131extern bool fibril_rmutex_trylock(fibril_rmutex_t *);
     132extern void fibril_rmutex_unlock(fibril_rmutex_t *);
     133
     134
    75135#endif
  • uspace/lib/c/include/fibril.h

    r42964a7 r3b10ae36  
    4949typedef fibril_t *fid_t;
    5050
    51 typedef struct {
    52         fibril_t *fibril;
    53 } fibril_event_t;
    54 
    55 #define FIBRIL_EVENT_INIT ((fibril_event_t) {0})
    56 
    5751/** Fibril-local variable specifier */
    5852#define fibril_local __thread
     
    8276extern __noreturn void fibril_exit(long);
    8377
    84 extern void fibril_wait_for(fibril_event_t *);
    85 extern errno_t fibril_wait_timeout(fibril_event_t *, const struct timeval *);
    86 extern void fibril_notify(fibril_event_t *);
    87 
    88 extern errno_t fibril_ipc_wait(ipc_call_t *, const struct timeval *);
    89 extern void fibril_ipc_poke(void);
    90 
    9178#endif
    9279
  • uspace/lib/c/include/fibril_synch.h

    r42964a7 r3b10ae36  
    4141#include <sys/time.h>
    4242#include <stdbool.h>
    43 #include <futex.h>
    44 
    45 /**
    46  * "Restricted" fibril mutex.
    47  *
    48  * Similar to `fibril_mutex_t`, but has a set of restrictions placed on its
    49  * use. Within a rmutex critical section, you
    50  *         - may not use any other synchronization primitive,
    51  *           save for another `fibril_rmutex_t`. This includes nonblocking
    52  *           operations like cvar signal and mutex unlock.
    53  *         - may not read IPC messages
    54  *         - may not start a new thread/fibril
    55  *           (creating fibril without starting is fine)
    56  *
    57  * Additionally, locking with a timeout is not possible on this mutex,
    58  * and there is no associated condition variable type.
    59  * This is a design constraint, not a lack of implementation effort.
    60  */
    61 typedef struct {
    62         // TODO: At this point, this is just silly handwaving to hide current
    63         //       futex use behind a fibril based abstraction. Later, the imple-
    64         //       mentation will change, but the restrictions placed on this type
    65         //       will allow it to be simpler and faster than a regular mutex.
    66         //       There might also be optional debug checking of the assumptions.
    67         //
    68         //       Note that a consequence of the restrictions is that if we are
    69         //       running on a single thread, no other fibril can ever get to run
    70         //       while a fibril has a rmutex locked. That means that for
    71         //       single-threaded programs, we can reduce all rmutex locks and
    72         //       unlocks to simple branches on a global bool variable.
    73 
    74         futex_t futex;
    75 } fibril_rmutex_t;
    76 
    77 #define FIBRIL_RMUTEX_INITIALIZER(name) \
    78         { .futex = FUTEX_INITIALIZE(1) }
    79 
    80 #define FIBRIL_RMUTEX_INITIALIZE(name) \
    81         fibril_rmutex_t name = FIBRIL_RMUTEX_INITIALIZER(name)
    8243
    8344typedef struct {
     
    186147        long int count;
    187148        list_t waiters;
     149        bool closed;
    188150} fibril_semaphore_t;
    189151
     
    201163#define FIBRIL_SEMAPHORE_INITIALIZE(name, cnt) \
    202164        fibril_semaphore_t name = FIBRIL_SEMAPHORE_INITIALIZER(name, cnt)
    203 
    204 extern void fibril_rmutex_initialize(fibril_rmutex_t *);
    205 extern void fibril_rmutex_lock(fibril_rmutex_t *);
    206 extern bool fibril_rmutex_trylock(fibril_rmutex_t *);
    207 extern void fibril_rmutex_unlock(fibril_rmutex_t *);
    208165
    209166extern void fibril_mutex_initialize(fibril_mutex_t *);
     
    241198extern void fibril_semaphore_up(fibril_semaphore_t *);
    242199extern void fibril_semaphore_down(fibril_semaphore_t *);
     200extern errno_t fibril_semaphore_down_timeout(fibril_semaphore_t *, suseconds_t);
     201extern void fibril_semaphore_close(fibril_semaphore_t *);
     202
     203typedef struct mpsc mpsc_t;
     204extern mpsc_t *mpsc_create(size_t);
     205extern void mpsc_destroy(mpsc_t *);
     206extern errno_t mpsc_send(mpsc_t *, const void *);
     207extern errno_t mpsc_receive(mpsc_t *, void *, const struct timeval *);
     208extern void mpsc_close(mpsc_t *);
    243209
    244210#endif
  • uspace/lib/c/include/ipc/common.h

    r42964a7 r3b10ae36  
    3737
    3838#include <abi/ipc/ipc.h>
    39 #include <atomic.h>
    4039#include <abi/proc/task.h>
    41 #include <futex.h>
    4240#include <abi/cap.h>
     41#include <types/common.h>
    4342
    4443#define IPC_FLAG_BLOCKING  0x01
  • uspace/lib/drv/include/dev_iface.h

    r42964a7 r3b10ae36  
    3838#include <ipc/common.h>
    3939#include <ipc/dev_iface.h>
     40#include <stdbool.h>
    4041
    4142/*
  • uspace/lib/pcut/Makefile

    r42964a7 r3b10ae36  
    3636
    3737test-libpcut-%: $(LIBRARY).a
    38         $(CC) $(CFLAGS) $(LDFLAGS) -T $(LINKER_SCRIPT) -o $@ $(START_FILES) $^ $(LIBRARY).a $(BASE_LIBS)
     38        $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(START_FILES) $^ $(LIBRARY).a $(BASE_LIBS)
    3939
  • uspace/lib/pcut/update-from-master.sh

    r42964a7 r3b10ae36  
    8080
    8181test-libpcut-%: $(LIBRARY).a
    82         $(CC) $(CFLAGS) $(LDFLAGS) -T $(LINKER_SCRIPT) -o $@ $(START_FILES) $^ $(LIBRARY).a $(BASE_LIBS)
     82        $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(START_FILES) $^ $(LIBRARY).a $(BASE_LIBS)
    8383
    8484EOF_MAKEFILE_TAIL
  • uspace/lib/posix/Makefile

    r42964a7 r3b10ae36  
    3636
    3737SPECS = gcc.specs
    38 LIBC_LINKER_SCRIPT = $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld
    39 EXPORT_LINKER_SCRIPT = link.ld
    4038
    4139EXPORT_FILES = \
     
    4846        $(LIBC_PREFIX)/crt1.o \
    4947        $(LIBRARY).a \
    50         $(EXPORT_LINKER_SCRIPT) \
    5148        $(SPECS)
    5249
     
    5451EXTRA_CLEAN = $(INCLUDE_LIBC)
    5552
    56 EXTRA_OUTPUT = $(SPECS) $(EXPORT_LINKER_SCRIPT) $(EXPORT_STARTUP_FILE)
     53EXTRA_OUTPUT = $(SPECS)
    5754
    5855SOURCES = \
     
    9289EXPORT_LDFLAGS = \
    9390        -L$$(HELENOS_EXPORT_ROOT)/lib \
    94         -T link.ld \
    9591        $$(HELENOS_EXPORT_ROOT)/lib/crt0.o \
    9692        $$(HELENOS_EXPORT_ROOT)/lib/crt1.o
     
    114110        echo '$(EXPORT_LDLIBS)' >> $@.new
    115111        mv $@.new $@
    116 
    117 $(EXPORT_LINKER_SCRIPT): $(LIBC_LINKER_SCRIPT)
    118         cp $< $@
    119 
    120 $(EXPORT_STARTUP_FILE): $(LIBC_STARTUP_FILE)
    121         cp $< $@
    122112
    123113$(INCLUDE_LIBC): $(shell find ../c/include -name '*.h')
  • uspace/srv/hid/input/ctl/stty.c

    r42964a7 r3b10ae36  
    3838 */
    3939
     40#include <errno.h>
    4041#include <io/keycode.h>
    4142#include "../stroke.h"
  • uspace/srv/loader/Makefile

    r42964a7 r3b10ae36  
    2929
    3030USPACE_PREFIX = ../..
     31ROOT_PATH = $(USPACE_PREFIX)/..
     32CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config
    3133
    32 EXTRA_LDFLAGS = -Wl,-Ttext-segment=0x70000000
     34include $(CONFIG_MAKEFILE)
     35
     36ifeq ($(UARCH),ia64)
     37        # IA64 has a peculiar linker script with a fixed data segment address.
     38        # Because the loader is a separate nonrelocatable binary in the same
     39        # address space as the application, we provide a modified copy of
     40        # the default linker script to work around that.
     41        EXTRA_LDFLAGS = -T elf64_ia64_loader.x
     42else
     43        # On all other architectures, we can simply move the text segment.
     44        EXTRA_LDFLAGS = -Wl,-Ttext-segment=0x70000000
     45endif
    3346
    3447BINARY = loader
Note: See TracChangeset for help on using the changeset viewer.