Changeset c2efbb4 in mainline for uspace


Ignore:
Timestamp:
2010-02-20T20:54:53Z (16 years ago)
Author:
Pavel Rimsky <pavel@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
721d4e85, 95c4776
Parents:
f516bc2 (diff), b03a666 (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:

Synchronize with head.

Location:
uspace
Files:
195 added
35 edited
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/Makefile

    rf516bc2 rc2efbb4  
    6060        srv/fs/devfs \
    6161        srv/hid/adb_mouse \
    62         srv/hid/console \
    6362        srv/hid/char_mouse \
    6463        srv/hid/fb \
    6564        srv/hid/kbd \
    66         srv/hw/char/i8042
     65        srv/hw/char/i8042 \
     66        srv/net
     67
     68ifneq ($(UARCH),abs32le)
     69        DIRS += srv/hid/console
     70endif
    6771
    6872ifeq ($(UARCH),amd64)
  • uspace/app/tester/thread/thread1.c

    rf516bc2 rc2efbb4  
    5353{
    5454        unsigned int i;
    55         int total = 0;
     55        atomic_count_t total = 0;
    5656       
    5757        atomic_set(&finish, 1);
  • uspace/doc/doxygroups.h

    rf516bc2 rc2efbb4  
    2626         * @ingroup srvcs
    2727         */
    28        
     28
     29        /**
     30         * @defgroup net Networking Stack
     31         * @ingroup srvcs
     32         */
     33
     34                /**
     35                 * @defgroup netif Network interface drivers
     36                 * @ingroup net
     37                 */
     38
     39                        /**
     40                         * @defgroup lo Loopback Service
     41                         * @ingroup netif
     42                         */
     43
     44                        /**
     45                         * @defgroup dp8390 Generic DP8390 network interface family service
     46                         * @ingroup netif
     47                         */
     48
     49                                /**
     50                                 * @defgroup ne2k NE2000 network interface family
     51                                 * @ingroup dp8390
     52                                 */
     53
     54                /**
     55                 * @defgroup net_nil Network interface layer
     56                 * @ingroup net
     57                 */
     58
     59                        /**
     60                         * @defgroup eth Ethernet (IEEE 802.3) network interface layer Service
     61                         * @ingroup net_nil
     62                         */
     63
     64                        /**
     65                         * @defgroup nildummy Dummy network interface layer Service
     66                         * @ingroup net_nil
     67                         */
     68
     69                /**
     70                 * @defgroup net_il Inter-networking layer
     71                 * @ingroup net
     72                 */
     73
     74                        /**
     75                         * @defgroup arp Address Resolution Protocol (ARP) Service
     76                         * @ingroup net_il
     77                         */
     78
     79                        /**
     80                         * @defgroup ip Internet Protocol (IP) Service
     81                         * @ingroup net_il
     82                         */
     83
     84                /**
     85                 * @defgroup net_tl Transport layer
     86                 * @ingroup net
     87                 */
     88
     89                        /**
     90                         * @defgroup icmp Internet Control Message Protocol (ICMP) Service
     91                         * @ingroup net_tl
     92                         */
     93
     94                        /**
     95                         * @defgroup udp User Datagram Protocol (UDP) Service
     96                         * @ingroup net_tl
     97                         */
     98
     99                        /**
     100                         * @defgroup tcp Transmission Control Protocol (TCP) Service
     101                         * @ingroup net_tl
     102                         */
     103
     104                /**
     105                 * @defgroup packet Packet management system
     106                 * @ingroup net
     107                 */
     108
     109                /**
     110                 * @defgroup net_app Applications
     111                 * @ingroup net
     112                 */
     113
     114                        /**
     115                         * @defgroup echo Echo Service
     116                         * @ingroup net_app
     117                         */
     118
     119                        /**
     120                         * @defgroup ping Ping
     121                         * @ingroup net_app
     122                         */
     123
     124                        /**
     125                         * @defgroup nettest Networking tests
     126                         * @ingroup net_app
     127                         */
     128
     129                /**
     130                 * @defgroup net_lib Application library
     131                 * @ingroup net
     132                 */
     133
     134                        /**
     135                         * @defgroup socket Sockets
     136                         * @ingroup net_lib
     137                         */
     138
     139                        /**
     140                         * @defgroup netdb Netdb
     141                         * @ingroup net_lib
     142                         */
     143
    29144        /**
    30145         * @cond amd64
  • uspace/lib/Makefile.common

    rf516bc2 rc2efbb4  
    3333# Individual makefiles set:
    3434#
    35 #       USPACE_PREFIX   relative path to uspace/ directory
    36 #       LIBS            libraries to link with (with relative path)
    37 #       EXTRA_CFLAGS    additional flags to pass to C compiler
    38 #       JOB             job file name (like appname.job)
    39 #       OUTPUT          output binary name (like appname)
    40 #       SOURCES         list of source files
     35#   USPACE_PREFIX  relative path to uspace/ directory
     36#   LIBS           libraries to link with (with relative path)
     37#   EXTRA_CFLAGS   additional flags to pass to C compiler
     38#   JOB            job file name (like appname.job)
     39#   OUTPUT         output binary name (like appname)
     40#   SOURCES        list of source files
    4141#
    4242
     
    7272        find . -name '*.o' -follow -exec rm \{\} \;
    7373
    74 build: 
     74build:
    7575
    7676-include $(DEPEND)
  • uspace/lib/libc/Makefile

    rf516bc2 rc2efbb4  
    3131
    3232USPACE_PREFIX = $(shell pwd)/../..
    33 #LIBS = $(LIBC_PREFIX)/libc.a
    3433LIBS =
    3534
     
    9190        generic/stacktrace.c
    9291
    93 ARCH_SOURCES = \
    94         arch/$(UARCH)/src/entry.s \
    95         arch/$(UARCH)/src/thread_entry.s
    96 
    9792SOURCES = \
    9893        $(GENERIC_SOURCES) \
  • uspace/lib/libc/arch/abs32le/src/thread_entry.c

    rf516bc2 rc2efbb4  
    11/*
    2  * Copyright (c) 2007 Martin Decky
     2 * Copyright (c) 2010 Martin Decky
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 #ifndef KERN_mips32_DORDER_H_
    30 #define KERN_mips32_DORDER_H_
     29/** @file
     30 */
    3131
    32 extern void ipi_broadcast_arch(int ipi);
     32#include <unistd.h>
     33#include <thread.h>
    3334
    34 #endif
     35void __thread_entry(void)
     36{
     37        __thread_main(NULL);
     38}
     39
     40/** @}
     41 */
  • uspace/lib/libc/arch/amd64/Makefile.inc

    rf516bc2 rc2efbb4  
    3434TOOLCHAIN_DIR = $(CROSS_PREFIX)/amd64/bin
    3535
    36 ARCH_SOURCES += arch/$(UARCH)/src/syscall.S \
     36ARCH_SOURCES = \
     37        arch/$(UARCH)/src/entry.s \
     38        arch/$(UARCH)/src/thread_entry.s \
     39        arch/$(UARCH)/src/syscall.S \
    3740        arch/$(UARCH)/src/fibril.S \
    3841        arch/$(UARCH)/src/tls.c \
  • uspace/lib/libc/arch/amd64/include/atomic.h

    rf516bc2 rc2efbb4  
    4242#include <atomicdflt.h>
    4343
    44 static inline void atomic_inc(atomic_t *val) {
    45         asm volatile ("lock incq %0\n" : "+m" (val->count));
     44static inline void atomic_inc(atomic_t *val)
     45{
     46        asm volatile (
     47                "lock incq %[count]\n"
     48                : [count] "+m" (val->count)
     49        );
    4650}
    4751
    48 static inline void atomic_dec(atomic_t *val) {
    49         asm volatile ("lock decq %0\n" : "+m" (val->count));
     52static inline void atomic_dec(atomic_t *val)
     53{
     54        asm volatile (
     55                "lock decq %[count]\n"
     56                : [count] "+m" (val->count)
     57        );
    5058}
    5159
    52 static inline long atomic_postinc(atomic_t *val)
     60static inline atomic_count_t atomic_postinc(atomic_t *val)
    5361{
    54         long r;
    55 
    56         asm volatile (
    57                 "movq $1, %0\n"
    58                 "lock xaddq %0, %1\n"
    59                 : "=r" (r), "+m" (val->count)
    60         );
    61 
    62         return r;
    63 }
    64 
    65 static inline long atomic_postdec(atomic_t *val)
    66 {
    67         long r;
     62        atomic_count_t r = 1;
    6863       
    6964        asm volatile (
    70                 "movq $-1, %0\n"
    71                 "lock xaddq %0, %1\n"
    72                 : "=r" (r), "+m" (val->count)
     65                "lock xaddq %[r], %[count]\n"
     66                : [count] "+m" (val->count),
     67                  [r] "+r" (r)
    7368        );
    7469       
     
    7671}
    7772
    78 #define atomic_preinc(val) (atomic_postinc(val) + 1)
    79 #define atomic_predec(val) (atomic_postdec(val) - 1)
     73static inline atomic_count_t atomic_postdec(atomic_t *val)
     74{
     75        atomic_count_t r = -1;
     76       
     77        asm volatile (
     78                "lock xaddq %[r], %[count]\n"
     79                : [count] "+m" (val->count),
     80                  [r] "+r" (r)
     81        );
     82       
     83        return r;
     84}
     85
     86#define atomic_preinc(val)  (atomic_postinc(val) + 1)
     87#define atomic_predec(val)  (atomic_postdec(val) - 1)
    8088
    8189#endif
  • uspace/lib/libc/arch/amd64/include/types.h

    rf516bc2 rc2efbb4  
    5454
    5555typedef uint64_t uintptr_t;
     56typedef uint64_t atomic_count_t;
     57typedef int64_t atomic_signed_t;
    5658
    5759#endif
  • uspace/lib/libc/arch/arm32/Makefile.inc

    rf516bc2 rc2efbb4  
    3434TOOLCHAIN_DIR = $(CROSS_PREFIX)/arm32/bin
    3535
    36 ARCH_SOURCES += arch/$(UARCH)/src/syscall.c \
     36ARCH_SOURCES = \
     37        arch/$(UARCH)/src/entry.s \
     38        arch/$(UARCH)/src/thread_entry.s \
     39        arch/$(UARCH)/src/syscall.c \
    3740        arch/$(UARCH)/src/fibril.S \
    3841        arch/$(UARCH)/src/tls.c \
  • uspace/lib/libc/arch/arm32/include/atomic.h

    rf516bc2 rc2efbb4  
    2727 */
    2828
    29 /** @addtogroup libcarm32       
     29/** @addtogroup libcarm32
    3030 * @{
    3131 */
     
    3838
    3939#define LIBC_ARCH_ATOMIC_H_
    40 #define CAS 
     40#define CAS
    4141
    4242#include <atomicdflt.h>
     
    4646extern uintptr_t *ras_page;
    4747
    48 static inline bool cas(atomic_t *val, long ov, long nv)
    49 {
    50         long ret = 0;
    51 
     48static inline bool cas(atomic_t *val, atomic_count_t ov, atomic_count_t nv)
     49{
     50        atomic_count_t ret = 0;
     51       
    5252        /*
    5353         * The following instructions between labels 1 and 2 constitute a
     
    7575                : "memory"
    7676        );
    77 
     77       
    7878        ras_page[0] = 0;
    79         asm volatile ("" ::: "memory");
     79        asm volatile (
     80                "" ::: "memory"
     81        );
    8082        ras_page[1] = 0xffffffff;
    81 
     83       
    8284        return (bool) ret;
    8385}
     
    8991 *
    9092 * @return Value after addition.
    91  */
    92 static inline long atomic_add(atomic_t *val, int i)
    93 {
    94         long ret = 0;
    95 
     93 *
     94 */
     95static inline atomic_count_t atomic_add(atomic_t *val, atomic_count_t i)
     96{
     97        atomic_count_t ret = 0;
     98       
    9699        /*
    97100         * The following instructions between labels 1 and 2 constitute a
     
    115118                : [imm] "r" (i)
    116119        );
    117 
     120       
    118121        ras_page[0] = 0;
    119         asm volatile ("" ::: "memory");
     122        asm volatile (
     123                "" ::: "memory"
     124        );
    120125        ras_page[1] = 0xffffffff;
    121 
     126       
    122127        return ret;
    123128}
     
    127132 *
    128133 * @param val Variable to be incremented.
     134 *
    129135 */
    130136static inline void atomic_inc(atomic_t *val)
     
    137143 *
    138144 * @param val Variable to be decremented.
     145 *
    139146 */
    140147static inline void atomic_dec(atomic_t *val)
     
    148155 * @param val Variable to be incremented.
    149156 * @return    Value after incrementation.
    150  */
    151 static inline long atomic_preinc(atomic_t *val)
     157 *
     158 */
     159static inline atomic_count_t atomic_preinc(atomic_t *val)
    152160{
    153161        return atomic_add(val, 1);
     
    159167 * @param val Variable to be decremented.
    160168 * @return    Value after decrementation.
    161  */
    162 static inline long atomic_predec(atomic_t *val)
     169 *
     170 */
     171static inline atomic_count_t atomic_predec(atomic_t *val)
    163172{
    164173        return atomic_add(val, -1);
     
    170179 * @param val Variable to be incremented.
    171180 * @return    Value before incrementation.
    172  */
    173 static inline long atomic_postinc(atomic_t *val)
     181 *
     182 */
     183static inline atomic_count_t atomic_postinc(atomic_t *val)
    174184{
    175185        return atomic_add(val, 1) - 1;
     
    181191 * @param val Variable to be decremented.
    182192 * @return    Value before decrementation.
    183  */
    184 static inline long atomic_postdec(atomic_t *val)
     193 *
     194 */
     195static inline atomic_count_t atomic_postdec(atomic_t *val)
    185196{
    186197        return atomic_add(val, -1) + 1;
  • uspace/lib/libc/arch/arm32/include/types.h

    rf516bc2 rc2efbb4  
    5555
    5656typedef uint32_t uintptr_t;
     57typedef uint32_t atomic_count_t;
     58typedef int32_t atomic_signed_t;
    5759
    5860#endif
  • uspace/lib/libc/arch/ia32/Makefile.inc

    rf516bc2 rc2efbb4  
    3434TOOLCHAIN_DIR = $(CROSS_PREFIX)/ia32/bin
    3535
    36 ARCH_SOURCES += arch/$(UARCH)/src/syscall.S \
     36ARCH_SOURCES = \
     37        arch/$(UARCH)/src/entry.s \
     38        arch/$(UARCH)/src/thread_entry.s \
     39        arch/$(UARCH)/src/syscall.S \
    3740        arch/$(UARCH)/src/fibril.S \
    3841        arch/$(UARCH)/src/tls.c \
  • uspace/lib/libc/arch/ia32/include/atomic.h

    rf516bc2 rc2efbb4  
    4040#include <atomicdflt.h>
    4141
    42 static inline void atomic_inc(atomic_t *val) {
    43         asm volatile ("lock incl %0\n" : "+m" (val->count));
     42static inline void atomic_inc(atomic_t *val)
     43{
     44        asm volatile (
     45                "lock incl %[count]\n"
     46                : [count] "+m" (val->count)
     47        );
    4448}
    4549
    46 static inline void atomic_dec(atomic_t *val) {
    47         asm volatile ("lock decl %0\n" : "+m" (val->count));
     50static inline void atomic_dec(atomic_t *val)
     51{
     52        asm volatile (
     53                "lock decl %[count]\n"
     54                : [count] "+m" (val->count)
     55        );
    4856}
    4957
    50 static inline long atomic_postinc(atomic_t *val)
     58static inline atomic_count_t atomic_postinc(atomic_t *val)
    5159{
    52         long r;
    53 
    54         asm volatile (
    55                 "movl $1, %0\n"
    56                 "lock xaddl %0, %1\n"
    57                 : "=r" (r), "+m" (val->count)
    58         );
    59 
    60         return r;
    61 }
    62 
    63 static inline long atomic_postdec(atomic_t *val)
    64 {
    65         long r;
     60        atomic_count_t r = 1;
    6661       
    6762        asm volatile (
    68                 "movl $-1, %0\n"
    69                 "lock xaddl %0, %1\n"
    70                 : "=r" (r), "+m" (val->count)
     63                "lock xaddl %[r], %[count]\n"
     64                : [count] "+m" (val->count),
     65                  [r] "+r" (r)
    7166        );
    7267       
     
    7469}
    7570
    76 #define atomic_preinc(val) (atomic_postinc(val) + 1)
    77 #define atomic_predec(val) (atomic_postdec(val) - 1)
     71static inline atomic_count_t atomic_postdec(atomic_t *val)
     72{
     73        atomic_count_t r = -1;
     74       
     75        asm volatile (
     76                "lock xaddl %[r], %[count]\n"
     77                : [count] "+m" (val->count),
     78                  [r] "+r" (r)
     79        );
     80       
     81        return r;
     82}
     83
     84#define atomic_preinc(val)  (atomic_postinc(val) + 1)
     85#define atomic_predec(val)  (atomic_postdec(val) - 1)
    7886
    7987#endif
  • uspace/lib/libc/arch/ia32/include/types.h

    rf516bc2 rc2efbb4  
    5454
    5555typedef uint32_t uintptr_t;
     56typedef uint32_t atomic_count_t;
     57typedef int32_t atomic_signed_t;
    5658
    5759#endif
  • uspace/lib/libc/arch/ia64/Makefile.inc

    rf516bc2 rc2efbb4  
    3333TOOLCHAIN_DIR = $(CROSS_PREFIX)/ia64/bin
    3434
    35 ARCH_SOURCES += arch/$(UARCH)/src/syscall.S \
     35ARCH_SOURCES = \
     36        arch/$(UARCH)/src/entry.s \
     37        arch/$(UARCH)/src/thread_entry.s \
     38        arch/$(UARCH)/src/syscall.S \
    3639        arch/$(UARCH)/src/fibril.S \
    3740        arch/$(UARCH)/src/tls.c \
  • uspace/lib/libc/arch/ia64/include/atomic.h

    rf516bc2 rc2efbb4  
    4242static inline void atomic_inc(atomic_t *val)
    4343{
    44         long v;
     44        atomic_count_t v;
    4545       
    4646        asm volatile (
     
    5353static inline void atomic_dec(atomic_t *val)
    5454{
    55         long v;
     55        atomic_count_t v;
    5656       
    5757        asm volatile (
     
    6262}
    6363
    64 static inline long atomic_preinc(atomic_t *val)
     64static inline atomic_count_t atomic_preinc(atomic_t *val)
    6565{
    66         long v;
     66        atomic_count_t v;
    6767       
    6868        asm volatile (
     
    7575}
    7676
    77 static inline long atomic_predec(atomic_t *val)
     77static inline atomic_count_t atomic_predec(atomic_t *val)
    7878{
    79         long v;
     79        atomic_count_t v;
    8080       
    8181        asm volatile (
     
    8888}
    8989
    90 static inline long atomic_postinc(atomic_t *val)
     90static inline atomic_count_t atomic_postinc(atomic_t *val)
    9191{
    92         long v;
     92        atomic_count_t v;
    9393       
    9494        asm volatile (
     
    101101}
    102102
    103 static inline long atomic_postdec(atomic_t *val)
     103static inline atomic_count_t atomic_postdec(atomic_t *val)
    104104{
    105         long v;
     105        atomic_count_t v;
    106106       
    107107        asm volatile (
  • uspace/lib/libc/arch/ia64/include/types.h

    rf516bc2 rc2efbb4  
    5959
    6060typedef uint64_t uintptr_t;
     61typedef uint64_t atomic_count_t;
     62typedef int64_t atomic_signed_t;
    6163
    6264typedef struct {
  • uspace/lib/libc/arch/mips32/Makefile.inc

    rf516bc2 rc2efbb4  
    3333TOOLCHAIN_DIR = $(CROSS_PREFIX)/mips32/bin
    3434
    35 ARCH_SOURCES += arch/$(UARCH)/src/syscall.c \
     35ARCH_SOURCES = \
     36        arch/$(UARCH)/src/entry.s \
     37        arch/$(UARCH)/src/thread_entry.s \
     38        arch/$(UARCH)/src/syscall.c \
    3639        arch/$(UARCH)/src/fibril.S \
    3740        arch/$(UARCH)/src/tls.c \
  • uspace/lib/libc/arch/mips32/include/atomic.h

    rf516bc2 rc2efbb4  
    2727 */
    2828
    29 /** @addtogroup libcmips32     
     29/** @addtogroup libcmips32
    3030 * @{
    3131 */
    3232/** @file
    33  * @ingroup libcmips32eb       
     33 * @ingroup libcmips32eb
    3434 */
    3535
     
    4141#include <atomicdflt.h>
    4242
    43 #define atomic_inc(x)   ((void) atomic_add(x, 1))
    44 #define atomic_dec(x)   ((void) atomic_add(x, -1))
     43#define atomic_inc(x)  ((void) atomic_add(x, 1))
     44#define atomic_dec(x)  ((void) atomic_add(x, -1))
    4545
    46 #define atomic_postinc(x) (atomic_add(x, 1) - 1)
    47 #define atomic_postdec(x) (atomic_add(x, -1) + 1)
     46#define atomic_postinc(x)  (atomic_add(x, 1) - 1)
     47#define atomic_postdec(x)  (atomic_add(x, -1) + 1)
    4848
    49 #define atomic_preinc(x) atomic_add(x, 1)
    50 #define atomic_predec(x) atomic_add(x, -1)
     49#define atomic_preinc(x)  atomic_add(x, 1)
     50#define atomic_predec(x)  atomic_add(x, -1)
    5151
    5252/* Atomic addition of immediate value.
    5353 *
    5454 * @param val Memory location to which will be the immediate value added.
    55  * @param i Signed immediate that will be added to *val.
     55 * @param i   Signed immediate that will be added to *val.
    5656 *
    5757 * @return Value after addition.
     58 *
    5859 */
    59 static inline long atomic_add(atomic_t *val, int i)
     60static inline atomic_count_t atomic_add(atomic_t *val, atomic_count_t i)
    6061{
    61         long tmp, v;
    62 
     62        atomic_count_t tmp;
     63        atomic_count_t v;
     64       
    6365        asm volatile (
    6466                "1:\n"
     
    7072                /*      nop     */              /* nop is inserted automatically by compiler */
    7173                "       nop\n"
    72                 : "=&r" (tmp), "+m" (val->count), "=&r" (v)
    73                 : "r" (i), "i" (0)
    74                 );
    75 
     74                : "=&r" (tmp),
     75                  "+m" (val->count),
     76                  "=&r" (v)
     77                : "r" (i),
     78                  "i" (0)
     79        );
     80       
    7681        return v;
    7782}
  • uspace/lib/libc/arch/mips32/include/types.h

    rf516bc2 rc2efbb4  
    2727 */
    2828
    29 /** @addtogroup libcmips32     
     29/** @addtogroup libcmips32
    3030 * @{
    3131 */
     
    5555
    5656typedef uint32_t uintptr_t;
     57typedef uint32_t atomic_count_t;
     58typedef int32_t atomic_signed_t;
    5759
    5860#endif
  • uspace/lib/libc/arch/mips32eb/Makefile.inc

    rf516bc2 rc2efbb4  
    3333TOOLCHAIN_DIR = $(CROSS_PREFIX)/mips32eb/bin
    3434
    35 ARCH_SOURCES += arch/$(UARCH)/src/syscall.c \
     35ARCH_SOURCES = \
     36        arch/$(UARCH)/src/entry.s \
     37        arch/$(UARCH)/src/thread_entry.s \
     38        arch/$(UARCH)/src/syscall.c \
    3639        arch/$(UARCH)/src/fibril.S \
    3740        arch/$(UARCH)/src/tls.c \
  • uspace/lib/libc/arch/ppc32/Makefile.inc

    rf516bc2 rc2efbb4  
    3333TOOLCHAIN_DIR = $(CROSS_PREFIX)/ppc32/bin
    3434
    35 ARCH_SOURCES += arch/$(UARCH)/src/syscall.c \
     35ARCH_SOURCES = \
     36        arch/$(UARCH)/src/entry.s \
     37        arch/$(UARCH)/src/thread_entry.s \
     38        arch/$(UARCH)/src/syscall.c \
    3639        arch/$(UARCH)/src/fibril.S \
    3740        arch/$(UARCH)/src/tls.c \
  • uspace/lib/libc/arch/ppc32/include/atomic.h

    rf516bc2 rc2efbb4  
    2727 */
    2828
    29 /** @addtogroup libcppc32       
     29/** @addtogroup libcppc32
    3030 * @{
    3131 */
     
    4242static inline void atomic_inc(atomic_t *val)
    4343{
    44         long tmp;
    45 
     44        atomic_count_t tmp;
     45       
    4646        asm volatile (
    4747                "1:\n"
     
    5050                "stwcx. %0, 0, %2\n"
    5151                "bne- 1b"
    52                 : "=&r" (tmp), "=m" (val->count)
    53                 : "r" (&val->count), "m" (val->count)
    54                 : "cc");
     52                : "=&r" (tmp),
     53                  "=m" (val->count)
     54                : "r" (&val->count),
     55                  "m" (val->count)
     56                : "cc"
     57        );
    5558}
    5659
    5760static inline void atomic_dec(atomic_t *val)
    5861{
    59         long tmp;
    60 
     62        atomic_count_t tmp;
     63       
    6164        asm volatile (
    6265                "1:\n"
    6366                "lwarx %0, 0, %2\n"
    6467                "addic %0, %0, -1\n"
    65                 "stwcx. %0, 0, %2\n"
     68                "stwcx. %0, 0, %2\n"
    6669                "bne- 1b"
    67                 : "=&r" (tmp), "=m" (val->count)
    68                 : "r" (&val->count), "m" (val->count)
    69                 : "cc");
     70                : "=&r" (tmp),
     71                  "=m" (val->count)
     72                : "r" (&val->count),
     73                  "m" (val->count)
     74                : "cc"
     75        );
    7076}
    7177
    72 static inline long atomic_postinc(atomic_t *val)
     78static inline atomic_count_t atomic_postinc(atomic_t *val)
    7379{
    7480        atomic_inc(val);
     
    7682}
    7783
    78 static inline long atomic_postdec(atomic_t *val)
     84static inline atomic_count_t atomic_postdec(atomic_t *val)
    7985{
    8086        atomic_dec(val);
     
    8288}
    8389
    84 static inline long atomic_preinc(atomic_t *val)
     90static inline atomic_count_t atomic_preinc(atomic_t *val)
    8591{
    8692        atomic_inc(val);
     
    8894}
    8995
    90 static inline long atomic_predec(atomic_t *val)
     96static inline atomic_count_t atomic_predec(atomic_t *val)
    9197{
    9298        atomic_dec(val);
  • uspace/lib/libc/arch/ppc32/include/types.h

    rf516bc2 rc2efbb4  
    2727 */
    2828
    29 /** @addtogroup libcppc32       
     29/** @addtogroup libcppc32
    3030 * @{
    3131 */
     
    5454
    5555typedef uint32_t uintptr_t;
     56typedef uint32_t atomic_count_t;
     57typedef int32_t atomic_signed_t;
    5658
    5759#endif
  • uspace/lib/libc/arch/sparc64/Makefile.inc

    rf516bc2 rc2efbb4  
    3333TOOLCHAIN_DIR = $(CROSS_PREFIX)/sparc64/bin
    3434
    35 ARCH_SOURCES += arch/$(UARCH)/src/fibril.S \
     35ARCH_SOURCES = \
     36        arch/$(UARCH)/src/entry.s \
     37        arch/$(UARCH)/src/thread_entry.s \
     38        arch/$(UARCH)/src/fibril.S \
    3639        arch/$(UARCH)/src/tls.c \
    3740        arch/$(UARCH)/src/stacktrace.c \
  • uspace/lib/libc/arch/sparc64/include/atomic.h

    rf516bc2 rc2efbb4  
    4646 *
    4747 * @param val Atomic variable.
    48  * @param i Signed value to be added.
     48 * @param i   Signed value to be added.
    4949 *
    5050 * @return Value of the atomic variable as it existed before addition.
     51 *
    5152 */
    52 static inline long atomic_add(atomic_t *val, int i)
     53static inline atomic_count_t atomic_add(atomic_t *val, atomic_count_t i)
    5354{
    54         uint64_t a, b;
    55 
     55        atomic_count_t a;
     56        atomic_count_t b;
     57       
    5658        do {
    57                 volatile uintptr_t x = (uint64_t) &val->count;
    58 
    59                 a = *((uint64_t *) x);
     59                volatile uintptr_t ptr = (uintptr_t) &val->count;
     60               
     61                a = *((atomic_count_t *) ptr);
    6062                b = a + i;
    61                 asm volatile ("casx %0, %2, %1\n" : "+m" (*((uint64_t *)x)), "+r" (b) : "r" (a));
     63               
     64                asm volatile (
     65                        "casx %0, %2, %1\n"
     66                        : "+m" (*((atomic_count_t *) ptr)),
     67                          "+r" (b)
     68                        : "r" (a)
     69                );
    6270        } while (a != b);
    63 
     71       
    6472        return a;
    6573}
    6674
    67 static inline long atomic_preinc(atomic_t *val)
     75static inline atomic_count_t atomic_preinc(atomic_t *val)
    6876{
    6977        return atomic_add(val, 1) + 1;
    7078}
    7179
    72 static inline long atomic_postinc(atomic_t *val)
     80static inline atomic_count_t atomic_postinc(atomic_t *val)
    7381{
    7482        return atomic_add(val, 1);
    7583}
    7684
    77 static inline long atomic_predec(atomic_t *val)
     85static inline atomic_count_t atomic_predec(atomic_t *val)
    7886{
    7987        return atomic_add(val, -1) - 1;
    8088}
    8189
    82 static inline long atomic_postdec(atomic_t *val)
     90static inline atomic_count_t atomic_postdec(atomic_t *val)
    8391{
    8492        return atomic_add(val, -1);
  • uspace/lib/libc/arch/sparc64/include/types.h

    rf516bc2 rc2efbb4  
    5454
    5555typedef uint64_t uintptr_t;
     56typedef uint64_t atomic_count_t;
     57typedef int64_t atomic_signed_t;
    5658
    5759#endif
  • uspace/lib/libc/generic/async.c

    rf516bc2 rc2efbb4  
    11011101}
    11021102
     1103/** Wrapper for making IPC_M_CONNECT_ME_TO calls using the async framework.
     1104 *
     1105 * Ask through phone for a new connection to some service.
     1106 *
     1107 * @param phoneid       Phone handle used for contacting the other side.
     1108 * @param arg1          User defined argument.
     1109 * @param arg2          User defined argument.
     1110 * @param arg3          User defined argument.
     1111 *
     1112 * @return              New phone handle on success or a negative error code.
     1113 */
     1114int
     1115async_connect_me_to(int phoneid, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3)
     1116{
     1117        int rc;
     1118        ipcarg_t newphid;
     1119
     1120        rc = async_req_3_5(phoneid, IPC_M_CONNECT_ME_TO, arg1, arg2, arg3, NULL,
     1121            NULL, NULL, NULL, &newphid);
     1122       
     1123        if (rc != EOK) 
     1124                return rc;
     1125
     1126        return newphid;
     1127}
     1128
     1129/** Wrapper for making IPC_M_CONNECT_ME_TO calls using the async framework.
     1130 *
     1131 * Ask through phone for a new connection to some service and block until
     1132 * success.
     1133 *
     1134 * @param phoneid       Phone handle used for contacting the other side.
     1135 * @param arg1          User defined argument.
     1136 * @param arg2          User defined argument.
     1137 * @param arg3          User defined argument.
     1138 *
     1139 * @return              New phone handle on success or a negative error code.
     1140 */
     1141int
     1142async_connect_me_to_blocking(int phoneid, ipcarg_t arg1, ipcarg_t arg2,
     1143    ipcarg_t arg3)
     1144{
     1145        int rc;
     1146        ipcarg_t newphid;
     1147
     1148        rc = async_req_4_5(phoneid, IPC_M_CONNECT_ME_TO, arg1, arg2, arg3,
     1149            IPC_FLAG_BLOCKING, NULL, NULL, NULL, NULL, &newphid);
     1150       
     1151        if (rc != EOK) 
     1152                return rc;
     1153
     1154        return newphid;
     1155}
     1156
    11031157/** Wrapper for making IPC_M_SHARE_IN calls using the async framework.
    11041158 *
  • uspace/lib/libc/generic/futex.c

    rf516bc2 rc2efbb4  
    6868int futex_down(futex_t *futex)
    6969{
    70         if (atomic_predec(futex) < 0)
     70        if ((atomic_signed_t) atomic_predec(futex) < 0)
    7171                return __SYSCALL1(SYS_FUTEX_SLEEP, (sysarg_t) &futex->count);
    7272
     
    8282int futex_up(futex_t *futex)
    8383{
    84         if (atomic_postinc(futex) < 0)
     84        if ((atomic_signed_t) atomic_postinc(futex) < 0)
    8585                return __SYSCALL1(SYS_FUTEX_WAKEUP, (sysarg_t) &futex->count);
    8686               
  • uspace/lib/libc/include/async.h

    rf516bc2 rc2efbb4  
    259259}
    260260
     261extern int async_connect_me_to(int, ipcarg_t, ipcarg_t, ipcarg_t);
     262extern int async_connect_me_to_blocking(int, ipcarg_t, ipcarg_t, ipcarg_t);
     263
    261264/*
    262265 * User-friendly wrappers for async_share_in_start().
  • uspace/lib/libc/include/atomicdflt.h

    rf516bc2 rc2efbb4  
    3737
    3838#ifndef LIBC_ARCH_ATOMIC_H_
    39 #error This file cannot be included directly, include atomic.h instead.
     39        #error This file cannot be included directly, include atomic.h instead.
    4040#endif
    4141
     42#include <stdint.h>
    4243#include <bool.h>
    4344
    4445typedef struct atomic {
    45         volatile long count;
     46        volatile atomic_count_t count;
    4647} atomic_t;
    4748
    48 static inline void atomic_set(atomic_t *val, long i)
     49static inline void atomic_set(atomic_t *val, atomic_count_t i)
    4950{
    50         val->count = i;
     51        val->count = i;
    5152}
    5253
    53 static inline long atomic_get(atomic_t *val)
     54static inline atomic_count_t atomic_get(atomic_t *val)
    5455{
    55         return val->count;
     56        return val->count;
    5657}
    5758
    58 #ifndef CAS 
    59 static inline bool cas(atomic_t *val, long ov, long nv)
     59#ifndef CAS
     60static inline bool cas(atomic_t *val, atomic_count_t ov, atomic_count_t nv)
    6061{
    6162        return __sync_bool_compare_and_swap(&val->count, ov, nv);
  • uspace/lib/libc/include/ipc/services.h

    rf516bc2 rc2efbb4  
    4747        SERVICE_FHC,
    4848        SERVICE_OBIO,
    49         SERVICE_CLIPBOARD
     49        SERVICE_CLIPBOARD,
     50        SERVICE_NETWORKING,
     51        SERVICE_LO,
     52        SERVICE_DP8390,
     53        SERVICE_ETHERNET,
     54        SERVICE_NILDUMMY,
     55        SERVICE_IP,
     56        SERVICE_ARP,
     57        SERVICE_RARP,
     58        SERVICE_ICMP,
     59        SERVICE_UDP,
     60        SERVICE_TCP,
     61        SERVICE_SOCKET
    5062} services_t;
    5163
  • uspace/lib/libc/include/stacktrace.h

    rf516bc2 rc2efbb4  
    5757extern void stacktrace_prepare(void);
    5858extern uintptr_t stacktrace_fp_get(void);
    59 extern uintptr_t stacktrace_pc_get();
     59extern uintptr_t stacktrace_pc_get(void);
    6060
    6161#endif
  • uspace/srv/hid/kbd/Makefile.build

    rf516bc2 rc2efbb4  
    150150endif
    151151
     152ifeq ($(UARCH),abs32le)
     153        SOURCES += \
     154                port/dummy.c \
     155                ctl/pc.c
     156endif
     157
    152158OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
    153159
  • uspace/srv/loader/include/arch.h

    rf516bc2 rc2efbb4  
    3737#define LOADER_ARCH_H_
    3838
    39 void program_run(void *entry_point, void *pcb);
     39extern void program_run(void *entry_point, void *pcb);
    4040
    4141#endif
Note: See TracChangeset for help on using the changeset viewer.