- Timestamp:
- 2010-02-20T20:54:53Z (16 years ago)
- 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. - Location:
- uspace
- Files:
-
- 195 added
- 35 edited
- 1 moved
-
Makefile (modified) (1 diff)
-
app/tester/thread/thread1.c (modified) (1 diff)
-
doc/doxygroups.h (modified) (1 diff)
-
lib/Makefile.common (modified) (2 diffs)
-
lib/libc/Makefile (modified) (2 diffs)
-
lib/libc/arch/abs32le/Makefile.inc (added)
-
lib/libc/arch/abs32le/_link.ld.in (added)
-
lib/libc/arch/abs32le/include/atomic.h (added)
-
lib/libc/arch/abs32le/include/config.h (added)
-
lib/libc/arch/abs32le/include/ddi.h (added)
-
lib/libc/arch/abs32le/include/entry.h (added)
-
lib/libc/arch/abs32le/include/faddr.h (added)
-
lib/libc/arch/abs32le/include/fibril.h (added)
-
lib/libc/arch/abs32le/include/inttypes.h (added)
-
lib/libc/arch/abs32le/include/istate.h (added)
-
lib/libc/arch/abs32le/include/limits.h (added)
-
lib/libc/arch/abs32le/include/syscall.h (added)
-
lib/libc/arch/abs32le/include/thread.h (added)
-
lib/libc/arch/abs32le/include/tls.h (added)
-
lib/libc/arch/abs32le/include/types.h (added)
-
lib/libc/arch/abs32le/src/entry.c (added)
-
lib/libc/arch/abs32le/src/fibril.c (added)
-
lib/libc/arch/abs32le/src/stacktrace.c (added)
-
lib/libc/arch/abs32le/src/syscall.c (added)
-
lib/libc/arch/abs32le/src/thread_entry.c (moved) (moved from kernel/arch/mips32/include/smp/dorder.h ) (2 diffs)
-
lib/libc/arch/abs32le/src/tls.c (added)
-
lib/libc/arch/amd64/Makefile.inc (modified) (1 diff)
-
lib/libc/arch/amd64/include/atomic.h (modified) (2 diffs)
-
lib/libc/arch/amd64/include/types.h (modified) (1 diff)
-
lib/libc/arch/arm32/Makefile.inc (modified) (1 diff)
-
lib/libc/arch/arm32/include/atomic.h (modified) (12 diffs)
-
lib/libc/arch/arm32/include/types.h (modified) (1 diff)
-
lib/libc/arch/ia32/Makefile.inc (modified) (1 diff)
-
lib/libc/arch/ia32/include/atomic.h (modified) (2 diffs)
-
lib/libc/arch/ia32/include/types.h (modified) (1 diff)
-
lib/libc/arch/ia64/Makefile.inc (modified) (1 diff)
-
lib/libc/arch/ia64/include/atomic.h (modified) (6 diffs)
-
lib/libc/arch/ia64/include/types.h (modified) (1 diff)
-
lib/libc/arch/mips32/Makefile.inc (modified) (1 diff)
-
lib/libc/arch/mips32/include/atomic.h (modified) (3 diffs)
-
lib/libc/arch/mips32/include/types.h (modified) (2 diffs)
-
lib/libc/arch/mips32eb/Makefile.inc (modified) (1 diff)
-
lib/libc/arch/ppc32/Makefile.inc (modified) (1 diff)
-
lib/libc/arch/ppc32/include/atomic.h (modified) (6 diffs)
-
lib/libc/arch/ppc32/include/types.h (modified) (2 diffs)
-
lib/libc/arch/sparc64/Makefile.inc (modified) (1 diff)
-
lib/libc/arch/sparc64/include/atomic.h (modified) (1 diff)
-
lib/libc/arch/sparc64/include/types.h (modified) (1 diff)
-
lib/libc/generic/async.c (modified) (1 diff)
-
lib/libc/generic/futex.c (modified) (2 diffs)
-
lib/libc/include/async.h (modified) (1 diff)
-
lib/libc/include/atomicdflt.h (modified) (1 diff)
-
lib/libc/include/ipc/services.h (modified) (1 diff)
-
lib/libc/include/stacktrace.h (modified) (1 diff)
-
lib/softfloat/arch/abs32le/include/functions.h (added)
-
srv/hid/kbd/Makefile.build (modified) (1 diff)
-
srv/loader/arch/abs32le/Makefile.inc (added)
-
srv/loader/arch/abs32le/_link.ld.in (added)
-
srv/loader/arch/abs32le/abs32le.c (added)
-
srv/loader/include/arch.h (modified) (1 diff)
-
srv/net/Doxyfile (added)
-
srv/net/Makefile (added)
-
srv/net/Makefile.module (added)
-
srv/net/app/echo/Makefile (added)
-
srv/net/app/echo/echo.c (added)
-
srv/net/app/nettest1/Makefile (added)
-
srv/net/app/nettest1/nettest1.c (added)
-
srv/net/app/nettest2/Makefile (added)
-
srv/net/app/nettest2/nettest2.c (added)
-
srv/net/app/parse.c (added)
-
srv/net/app/parse.h (added)
-
srv/net/app/ping/Makefile (added)
-
srv/net/app/ping/ping.c (added)
-
srv/net/app/print_error.c (added)
-
srv/net/app/print_error.h (added)
-
srv/net/cfg/modular/general (added)
-
srv/net/cfg/modular/lo (added)
-
srv/net/cfg/modular/ne2k (added)
-
srv/net/cfg/module/general (added)
-
srv/net/cfg/module/lo (added)
-
srv/net/cfg/module/ne2k (added)
-
srv/net/checksum.c (added)
-
srv/net/configuration.h (added)
-
srv/net/documentation.txt (added)
-
srv/net/err.h (added)
-
srv/net/il/arp/Makefile (added)
-
srv/net/il/arp/arp.c (added)
-
srv/net/il/arp/arp.h (added)
-
srv/net/il/arp/arp_header.h (added)
-
srv/net/il/arp/arp_messages.h (added)
-
srv/net/il/arp/arp_module.c (added)
-
srv/net/il/arp/arp_module.h (added)
-
srv/net/il/arp/arp_oc.h (added)
-
srv/net/il/arp/arp_remote.c (added)
-
srv/net/il/il_messages.h (added)
-
srv/net/il/ip/Makefile (added)
-
srv/net/il/ip/ip.c (added)
-
srv/net/il/ip/ip.h (added)
-
srv/net/il/ip/ip_client.c (added)
-
srv/net/il/ip/ip_header.h (added)
-
srv/net/il/ip/ip_messages.h (added)
-
srv/net/il/ip/ip_module.c (added)
-
srv/net/il/ip/ip_module.h (added)
-
srv/net/il/ip/ip_remote.c (added)
-
srv/net/include/arp_interface.h (added)
-
srv/net/include/byteorder.h (added)
-
srv/net/include/checksum.h (added)
-
srv/net/include/device.h (added)
-
srv/net/include/ethernet_lsap.h (added)
-
srv/net/include/ethernet_protocols.h (added)
-
srv/net/include/hardware.h (added)
-
srv/net/include/icmp_api.h (added)
-
srv/net/include/icmp_client.h (added)
-
srv/net/include/icmp_codes.h (added)
-
srv/net/include/icmp_common.h (added)
-
srv/net/include/icmp_interface.h (added)
-
srv/net/include/il_interface.h (added)
-
srv/net/include/in.h (added)
-
srv/net/include/in6.h (added)
-
srv/net/include/inet.h (added)
-
srv/net/include/ip_client.h (added)
-
srv/net/include/ip_codes.h (added)
-
srv/net/include/ip_interface.h (added)
-
srv/net/include/ip_protocols.h (added)
-
srv/net/include/net_interface.h (added)
-
srv/net/include/netdb.h (added)
-
srv/net/include/netif_interface.h (added)
-
srv/net/include/nil_interface.h (added)
-
srv/net/include/protocol_map.h (added)
-
srv/net/include/socket.h (added)
-
srv/net/include/socket_codes.h (added)
-
srv/net/include/socket_errno.h (added)
-
srv/net/include/tcp_codes.h (added)
-
srv/net/include/tl_interface.h (added)
-
srv/net/inet.c (added)
-
srv/net/messages.h (added)
-
srv/net/module.c (added)
-
srv/net/modules.c (added)
-
srv/net/modules.h (added)
-
srv/net/net/Makefile (added)
-
srv/net/net/net.c (added)
-
srv/net/net/net.h (added)
-
srv/net/net/net_bundle.c (added)
-
srv/net/net/net_messages.h (added)
-
srv/net/net/net_remote.c (added)
-
srv/net/net/net_standalone.c (added)
-
srv/net/net/start/Makefile (added)
-
srv/net/net/start/netstart.c (added)
-
srv/net/netif/dp8390/Makefile (added)
-
srv/net/netif/dp8390/dp8390.c (added)
-
srv/net/netif/dp8390/dp8390.h (added)
-
srv/net/netif/dp8390/dp8390_drv.h (added)
-
srv/net/netif/dp8390/dp8390_module.c (added)
-
srv/net/netif/dp8390/dp8390_port.h (added)
-
srv/net/netif/dp8390/local.h (added)
-
srv/net/netif/dp8390/ne2000.c (added)
-
srv/net/netif/dp8390/ne2000.h (added)
-
srv/net/netif/lo/Makefile (added)
-
srv/net/netif/lo/lo.c (added)
-
srv/net/netif/netif.c (added)
-
srv/net/netif/netif.h (added)
-
srv/net/netif/netif_messages.h (added)
-
srv/net/netif/netif_module.h (added)
-
srv/net/netif/netif_nil_bundle.c (added)
-
srv/net/netif/netif_remote.c (added)
-
srv/net/netif/netif_standalone.c (added)
-
srv/net/nil/eth/Makefile (added)
-
srv/net/nil/eth/eth.c (added)
-
srv/net/nil/eth/eth.h (added)
-
srv/net/nil/eth/eth_header.h (added)
-
srv/net/nil/eth/eth_module.c (added)
-
srv/net/nil/nil_messages.h (added)
-
srv/net/nil/nil_module.h (added)
-
srv/net/nil/nil_remote.c (added)
-
srv/net/nil/nildummy/Makefile (added)
-
srv/net/nil/nildummy/nildummy.c (added)
-
srv/net/nil/nildummy/nildummy.h (added)
-
srv/net/nil/nildummy/nildummy_module.c (added)
-
srv/net/self_test.c (added)
-
srv/net/self_test.h (added)
-
srv/net/socket/Makefile (added)
-
srv/net/socket/socket_client.c (added)
-
srv/net/socket/socket_core.c (added)
-
srv/net/socket/socket_core.h (added)
-
srv/net/socket/socket_messages.h (added)
-
srv/net/structures/char_map.c (added)
-
srv/net/structures/char_map.h (added)
-
srv/net/structures/dynamic_fifo.c (added)
-
srv/net/structures/dynamic_fifo.h (added)
-
srv/net/structures/generic_char_map.h (added)
-
srv/net/structures/generic_field.h (added)
-
srv/net/structures/int_map.h (added)
-
srv/net/structures/measured_strings.c (added)
-
srv/net/structures/measured_strings.h (added)
-
srv/net/structures/module_map.c (added)
-
srv/net/structures/module_map.h (added)
-
srv/net/structures/packet/packet.c (added)
-
srv/net/structures/packet/packet.h (added)
-
srv/net/structures/packet/packet_client.c (added)
-
srv/net/structures/packet/packet_client.h (added)
-
srv/net/structures/packet/packet_header.h (added)
-
srv/net/structures/packet/packet_messages.h (added)
-
srv/net/structures/packet/packet_remote.c (added)
-
srv/net/structures/packet/packet_server.c (added)
-
srv/net/structures/packet/packet_server.h (added)
-
srv/net/tl/icmp/Makefile (added)
-
srv/net/tl/icmp/icmp.c (added)
-
srv/net/tl/icmp/icmp.h (added)
-
srv/net/tl/icmp/icmp_api.c (added)
-
srv/net/tl/icmp/icmp_client.c (added)
-
srv/net/tl/icmp/icmp_common.c (added)
-
srv/net/tl/icmp/icmp_header.h (added)
-
srv/net/tl/icmp/icmp_messages.h (added)
-
srv/net/tl/icmp/icmp_module.c (added)
-
srv/net/tl/icmp/icmp_module.h (added)
-
srv/net/tl/icmp/icmp_remote.c (added)
-
srv/net/tl/tcp/Makefile (added)
-
srv/net/tl/tcp/tcp.c (added)
-
srv/net/tl/tcp/tcp.h (added)
-
srv/net/tl/tcp/tcp_header.h (added)
-
srv/net/tl/tcp/tcp_module.c (added)
-
srv/net/tl/tcp/tcp_module.h (added)
-
srv/net/tl/tl_common.c (added)
-
srv/net/tl/tl_common.h (added)
-
srv/net/tl/tl_messages.h (added)
-
srv/net/tl/udp/Makefile (added)
-
srv/net/tl/udp/udp.c (added)
-
srv/net/tl/udp/udp.h (added)
-
srv/net/tl/udp/udp_header.h (added)
-
srv/net/tl/udp/udp_module.c (added)
-
srv/net/tl/udp/udp_module.h (added)
Legend:
- Unmodified
- Added
- Removed
-
uspace/Makefile
rf516bc2 rc2efbb4 60 60 srv/fs/devfs \ 61 61 srv/hid/adb_mouse \ 62 srv/hid/console \63 62 srv/hid/char_mouse \ 64 63 srv/hid/fb \ 65 64 srv/hid/kbd \ 66 srv/hw/char/i8042 65 srv/hw/char/i8042 \ 66 srv/net 67 68 ifneq ($(UARCH),abs32le) 69 DIRS += srv/hid/console 70 endif 67 71 68 72 ifeq ($(UARCH),amd64) -
uspace/app/tester/thread/thread1.c
rf516bc2 rc2efbb4 53 53 { 54 54 unsigned int i; 55 int total = 0;55 atomic_count_t total = 0; 56 56 57 57 atomic_set(&finish, 1); -
uspace/doc/doxygroups.h
rf516bc2 rc2efbb4 26 26 * @ingroup srvcs 27 27 */ 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 29 144 /** 30 145 * @cond amd64 -
uspace/lib/Makefile.common
rf516bc2 rc2efbb4 33 33 # Individual makefiles set: 34 34 # 35 # USPACE_PREFIXrelative path to uspace/ directory36 # LIBSlibraries to link with (with relative path)37 # EXTRA_CFLAGSadditional flags to pass to C compiler38 # JOBjob file name (like appname.job)39 # OUTPUToutput binary name (like appname)40 # SOURCESlist of source files35 # 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 41 41 # 42 42 … … 72 72 find . -name '*.o' -follow -exec rm \{\} \; 73 73 74 build: 74 build: 75 75 76 76 -include $(DEPEND) -
uspace/lib/libc/Makefile
rf516bc2 rc2efbb4 31 31 32 32 USPACE_PREFIX = $(shell pwd)/../.. 33 #LIBS = $(LIBC_PREFIX)/libc.a34 33 LIBS = 35 34 … … 91 90 generic/stacktrace.c 92 91 93 ARCH_SOURCES = \94 arch/$(UARCH)/src/entry.s \95 arch/$(UARCH)/src/thread_entry.s96 97 92 SOURCES = \ 98 93 $(GENERIC_SOURCES) \ -
uspace/lib/libc/arch/abs32le/src/thread_entry.c
rf516bc2 rc2efbb4 1 1 /* 2 * Copyright (c) 20 07Martin Decky2 * Copyright (c) 2010 Martin Decky 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 #ifndef KERN_mips32_DORDER_H_ 30 #define KERN_mips32_DORDER_H_ 29 /** @file 30 */ 31 31 32 extern void ipi_broadcast_arch(int ipi); 32 #include <unistd.h> 33 #include <thread.h> 33 34 34 #endif 35 void __thread_entry(void) 36 { 37 __thread_main(NULL); 38 } 39 40 /** @} 41 */ -
uspace/lib/libc/arch/amd64/Makefile.inc
rf516bc2 rc2efbb4 34 34 TOOLCHAIN_DIR = $(CROSS_PREFIX)/amd64/bin 35 35 36 ARCH_SOURCES += arch/$(UARCH)/src/syscall.S \ 36 ARCH_SOURCES = \ 37 arch/$(UARCH)/src/entry.s \ 38 arch/$(UARCH)/src/thread_entry.s \ 39 arch/$(UARCH)/src/syscall.S \ 37 40 arch/$(UARCH)/src/fibril.S \ 38 41 arch/$(UARCH)/src/tls.c \ -
uspace/lib/libc/arch/amd64/include/atomic.h
rf516bc2 rc2efbb4 42 42 #include <atomicdflt.h> 43 43 44 static inline void atomic_inc(atomic_t *val) { 45 asm volatile ("lock incq %0\n" : "+m" (val->count)); 44 static inline void atomic_inc(atomic_t *val) 45 { 46 asm volatile ( 47 "lock incq %[count]\n" 48 : [count] "+m" (val->count) 49 ); 46 50 } 47 51 48 static inline void atomic_dec(atomic_t *val) { 49 asm volatile ("lock decq %0\n" : "+m" (val->count)); 52 static inline void atomic_dec(atomic_t *val) 53 { 54 asm volatile ( 55 "lock decq %[count]\n" 56 : [count] "+m" (val->count) 57 ); 50 58 } 51 59 52 static inline long atomic_postinc(atomic_t *val)60 static inline atomic_count_t atomic_postinc(atomic_t *val) 53 61 { 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; 68 63 69 64 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) 73 68 ); 74 69 … … 76 71 } 77 72 78 #define atomic_preinc(val) (atomic_postinc(val) + 1) 79 #define atomic_predec(val) (atomic_postdec(val) - 1) 73 static 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) 80 88 81 89 #endif -
uspace/lib/libc/arch/amd64/include/types.h
rf516bc2 rc2efbb4 54 54 55 55 typedef uint64_t uintptr_t; 56 typedef uint64_t atomic_count_t; 57 typedef int64_t atomic_signed_t; 56 58 57 59 #endif -
uspace/lib/libc/arch/arm32/Makefile.inc
rf516bc2 rc2efbb4 34 34 TOOLCHAIN_DIR = $(CROSS_PREFIX)/arm32/bin 35 35 36 ARCH_SOURCES += arch/$(UARCH)/src/syscall.c \ 36 ARCH_SOURCES = \ 37 arch/$(UARCH)/src/entry.s \ 38 arch/$(UARCH)/src/thread_entry.s \ 39 arch/$(UARCH)/src/syscall.c \ 37 40 arch/$(UARCH)/src/fibril.S \ 38 41 arch/$(UARCH)/src/tls.c \ -
uspace/lib/libc/arch/arm32/include/atomic.h
rf516bc2 rc2efbb4 27 27 */ 28 28 29 /** @addtogroup libcarm32 29 /** @addtogroup libcarm32 30 30 * @{ 31 31 */ … … 38 38 39 39 #define LIBC_ARCH_ATOMIC_H_ 40 #define CAS 40 #define CAS 41 41 42 42 #include <atomicdflt.h> … … 46 46 extern uintptr_t *ras_page; 47 47 48 static inline bool cas(atomic_t *val, long ov, longnv)49 { 50 longret = 0;51 48 static inline bool cas(atomic_t *val, atomic_count_t ov, atomic_count_t nv) 49 { 50 atomic_count_t ret = 0; 51 52 52 /* 53 53 * The following instructions between labels 1 and 2 constitute a … … 75 75 : "memory" 76 76 ); 77 77 78 78 ras_page[0] = 0; 79 asm volatile ("" ::: "memory"); 79 asm volatile ( 80 "" ::: "memory" 81 ); 80 82 ras_page[1] = 0xffffffff; 81 83 82 84 return (bool) ret; 83 85 } … … 89 91 * 90 92 * @return Value after addition. 91 */ 92 static inline long atomic_add(atomic_t *val, int i) 93 { 94 long ret = 0; 95 93 * 94 */ 95 static inline atomic_count_t atomic_add(atomic_t *val, atomic_count_t i) 96 { 97 atomic_count_t ret = 0; 98 96 99 /* 97 100 * The following instructions between labels 1 and 2 constitute a … … 115 118 : [imm] "r" (i) 116 119 ); 117 120 118 121 ras_page[0] = 0; 119 asm volatile ("" ::: "memory"); 122 asm volatile ( 123 "" ::: "memory" 124 ); 120 125 ras_page[1] = 0xffffffff; 121 126 122 127 return ret; 123 128 } … … 127 132 * 128 133 * @param val Variable to be incremented. 134 * 129 135 */ 130 136 static inline void atomic_inc(atomic_t *val) … … 137 143 * 138 144 * @param val Variable to be decremented. 145 * 139 146 */ 140 147 static inline void atomic_dec(atomic_t *val) … … 148 155 * @param val Variable to be incremented. 149 156 * @return Value after incrementation. 150 */ 151 static inline long atomic_preinc(atomic_t *val) 157 * 158 */ 159 static inline atomic_count_t atomic_preinc(atomic_t *val) 152 160 { 153 161 return atomic_add(val, 1); … … 159 167 * @param val Variable to be decremented. 160 168 * @return Value after decrementation. 161 */ 162 static inline long atomic_predec(atomic_t *val) 169 * 170 */ 171 static inline atomic_count_t atomic_predec(atomic_t *val) 163 172 { 164 173 return atomic_add(val, -1); … … 170 179 * @param val Variable to be incremented. 171 180 * @return Value before incrementation. 172 */ 173 static inline long atomic_postinc(atomic_t *val) 181 * 182 */ 183 static inline atomic_count_t atomic_postinc(atomic_t *val) 174 184 { 175 185 return atomic_add(val, 1) - 1; … … 181 191 * @param val Variable to be decremented. 182 192 * @return Value before decrementation. 183 */ 184 static inline long atomic_postdec(atomic_t *val) 193 * 194 */ 195 static inline atomic_count_t atomic_postdec(atomic_t *val) 185 196 { 186 197 return atomic_add(val, -1) + 1; -
uspace/lib/libc/arch/arm32/include/types.h
rf516bc2 rc2efbb4 55 55 56 56 typedef uint32_t uintptr_t; 57 typedef uint32_t atomic_count_t; 58 typedef int32_t atomic_signed_t; 57 59 58 60 #endif -
uspace/lib/libc/arch/ia32/Makefile.inc
rf516bc2 rc2efbb4 34 34 TOOLCHAIN_DIR = $(CROSS_PREFIX)/ia32/bin 35 35 36 ARCH_SOURCES += arch/$(UARCH)/src/syscall.S \ 36 ARCH_SOURCES = \ 37 arch/$(UARCH)/src/entry.s \ 38 arch/$(UARCH)/src/thread_entry.s \ 39 arch/$(UARCH)/src/syscall.S \ 37 40 arch/$(UARCH)/src/fibril.S \ 38 41 arch/$(UARCH)/src/tls.c \ -
uspace/lib/libc/arch/ia32/include/atomic.h
rf516bc2 rc2efbb4 40 40 #include <atomicdflt.h> 41 41 42 static inline void atomic_inc(atomic_t *val) { 43 asm volatile ("lock incl %0\n" : "+m" (val->count)); 42 static inline void atomic_inc(atomic_t *val) 43 { 44 asm volatile ( 45 "lock incl %[count]\n" 46 : [count] "+m" (val->count) 47 ); 44 48 } 45 49 46 static inline void atomic_dec(atomic_t *val) { 47 asm volatile ("lock decl %0\n" : "+m" (val->count)); 50 static inline void atomic_dec(atomic_t *val) 51 { 52 asm volatile ( 53 "lock decl %[count]\n" 54 : [count] "+m" (val->count) 55 ); 48 56 } 49 57 50 static inline long atomic_postinc(atomic_t *val)58 static inline atomic_count_t atomic_postinc(atomic_t *val) 51 59 { 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; 66 61 67 62 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) 71 66 ); 72 67 … … 74 69 } 75 70 76 #define atomic_preinc(val) (atomic_postinc(val) + 1) 77 #define atomic_predec(val) (atomic_postdec(val) - 1) 71 static 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) 78 86 79 87 #endif -
uspace/lib/libc/arch/ia32/include/types.h
rf516bc2 rc2efbb4 54 54 55 55 typedef uint32_t uintptr_t; 56 typedef uint32_t atomic_count_t; 57 typedef int32_t atomic_signed_t; 56 58 57 59 #endif -
uspace/lib/libc/arch/ia64/Makefile.inc
rf516bc2 rc2efbb4 33 33 TOOLCHAIN_DIR = $(CROSS_PREFIX)/ia64/bin 34 34 35 ARCH_SOURCES += arch/$(UARCH)/src/syscall.S \ 35 ARCH_SOURCES = \ 36 arch/$(UARCH)/src/entry.s \ 37 arch/$(UARCH)/src/thread_entry.s \ 38 arch/$(UARCH)/src/syscall.S \ 36 39 arch/$(UARCH)/src/fibril.S \ 37 40 arch/$(UARCH)/src/tls.c \ -
uspace/lib/libc/arch/ia64/include/atomic.h
rf516bc2 rc2efbb4 42 42 static inline void atomic_inc(atomic_t *val) 43 43 { 44 longv;44 atomic_count_t v; 45 45 46 46 asm volatile ( … … 53 53 static inline void atomic_dec(atomic_t *val) 54 54 { 55 longv;55 atomic_count_t v; 56 56 57 57 asm volatile ( … … 62 62 } 63 63 64 static inline longatomic_preinc(atomic_t *val)64 static inline atomic_count_t atomic_preinc(atomic_t *val) 65 65 { 66 longv;66 atomic_count_t v; 67 67 68 68 asm volatile ( … … 75 75 } 76 76 77 static inline longatomic_predec(atomic_t *val)77 static inline atomic_count_t atomic_predec(atomic_t *val) 78 78 { 79 longv;79 atomic_count_t v; 80 80 81 81 asm volatile ( … … 88 88 } 89 89 90 static inline longatomic_postinc(atomic_t *val)90 static inline atomic_count_t atomic_postinc(atomic_t *val) 91 91 { 92 longv;92 atomic_count_t v; 93 93 94 94 asm volatile ( … … 101 101 } 102 102 103 static inline longatomic_postdec(atomic_t *val)103 static inline atomic_count_t atomic_postdec(atomic_t *val) 104 104 { 105 longv;105 atomic_count_t v; 106 106 107 107 asm volatile ( -
uspace/lib/libc/arch/ia64/include/types.h
rf516bc2 rc2efbb4 59 59 60 60 typedef uint64_t uintptr_t; 61 typedef uint64_t atomic_count_t; 62 typedef int64_t atomic_signed_t; 61 63 62 64 typedef struct { -
uspace/lib/libc/arch/mips32/Makefile.inc
rf516bc2 rc2efbb4 33 33 TOOLCHAIN_DIR = $(CROSS_PREFIX)/mips32/bin 34 34 35 ARCH_SOURCES += arch/$(UARCH)/src/syscall.c \ 35 ARCH_SOURCES = \ 36 arch/$(UARCH)/src/entry.s \ 37 arch/$(UARCH)/src/thread_entry.s \ 38 arch/$(UARCH)/src/syscall.c \ 36 39 arch/$(UARCH)/src/fibril.S \ 37 40 arch/$(UARCH)/src/tls.c \ -
uspace/lib/libc/arch/mips32/include/atomic.h
rf516bc2 rc2efbb4 27 27 */ 28 28 29 /** @addtogroup libcmips32 29 /** @addtogroup libcmips32 30 30 * @{ 31 31 */ 32 32 /** @file 33 * @ingroup libcmips32eb 33 * @ingroup libcmips32eb 34 34 */ 35 35 … … 41 41 #include <atomicdflt.h> 42 42 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)) 45 45 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) 48 48 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) 51 51 52 52 /* Atomic addition of immediate value. 53 53 * 54 54 * @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. 56 56 * 57 57 * @return Value after addition. 58 * 58 59 */ 59 static inline long atomic_add(atomic_t *val, int i)60 static inline atomic_count_t atomic_add(atomic_t *val, atomic_count_t i) 60 61 { 61 long tmp, v; 62 62 atomic_count_t tmp; 63 atomic_count_t v; 64 63 65 asm volatile ( 64 66 "1:\n" … … 70 72 /* nop */ /* nop is inserted automatically by compiler */ 71 73 " 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 76 81 return v; 77 82 } -
uspace/lib/libc/arch/mips32/include/types.h
rf516bc2 rc2efbb4 27 27 */ 28 28 29 /** @addtogroup libcmips32 29 /** @addtogroup libcmips32 30 30 * @{ 31 31 */ … … 55 55 56 56 typedef uint32_t uintptr_t; 57 typedef uint32_t atomic_count_t; 58 typedef int32_t atomic_signed_t; 57 59 58 60 #endif -
uspace/lib/libc/arch/mips32eb/Makefile.inc
rf516bc2 rc2efbb4 33 33 TOOLCHAIN_DIR = $(CROSS_PREFIX)/mips32eb/bin 34 34 35 ARCH_SOURCES += arch/$(UARCH)/src/syscall.c \ 35 ARCH_SOURCES = \ 36 arch/$(UARCH)/src/entry.s \ 37 arch/$(UARCH)/src/thread_entry.s \ 38 arch/$(UARCH)/src/syscall.c \ 36 39 arch/$(UARCH)/src/fibril.S \ 37 40 arch/$(UARCH)/src/tls.c \ -
uspace/lib/libc/arch/ppc32/Makefile.inc
rf516bc2 rc2efbb4 33 33 TOOLCHAIN_DIR = $(CROSS_PREFIX)/ppc32/bin 34 34 35 ARCH_SOURCES += arch/$(UARCH)/src/syscall.c \ 35 ARCH_SOURCES = \ 36 arch/$(UARCH)/src/entry.s \ 37 arch/$(UARCH)/src/thread_entry.s \ 38 arch/$(UARCH)/src/syscall.c \ 36 39 arch/$(UARCH)/src/fibril.S \ 37 40 arch/$(UARCH)/src/tls.c \ -
uspace/lib/libc/arch/ppc32/include/atomic.h
rf516bc2 rc2efbb4 27 27 */ 28 28 29 /** @addtogroup libcppc32 29 /** @addtogroup libcppc32 30 30 * @{ 31 31 */ … … 42 42 static inline void atomic_inc(atomic_t *val) 43 43 { 44 longtmp;45 44 atomic_count_t tmp; 45 46 46 asm volatile ( 47 47 "1:\n" … … 50 50 "stwcx. %0, 0, %2\n" 51 51 "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 ); 55 58 } 56 59 57 60 static inline void atomic_dec(atomic_t *val) 58 61 { 59 longtmp;60 62 atomic_count_t tmp; 63 61 64 asm volatile ( 62 65 "1:\n" 63 66 "lwarx %0, 0, %2\n" 64 67 "addic %0, %0, -1\n" 65 "stwcx. %0, 0, %2\n"68 "stwcx. %0, 0, %2\n" 66 69 "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 ); 70 76 } 71 77 72 static inline longatomic_postinc(atomic_t *val)78 static inline atomic_count_t atomic_postinc(atomic_t *val) 73 79 { 74 80 atomic_inc(val); … … 76 82 } 77 83 78 static inline longatomic_postdec(atomic_t *val)84 static inline atomic_count_t atomic_postdec(atomic_t *val) 79 85 { 80 86 atomic_dec(val); … … 82 88 } 83 89 84 static inline longatomic_preinc(atomic_t *val)90 static inline atomic_count_t atomic_preinc(atomic_t *val) 85 91 { 86 92 atomic_inc(val); … … 88 94 } 89 95 90 static inline longatomic_predec(atomic_t *val)96 static inline atomic_count_t atomic_predec(atomic_t *val) 91 97 { 92 98 atomic_dec(val); -
uspace/lib/libc/arch/ppc32/include/types.h
rf516bc2 rc2efbb4 27 27 */ 28 28 29 /** @addtogroup libcppc32 29 /** @addtogroup libcppc32 30 30 * @{ 31 31 */ … … 54 54 55 55 typedef uint32_t uintptr_t; 56 typedef uint32_t atomic_count_t; 57 typedef int32_t atomic_signed_t; 56 58 57 59 #endif -
uspace/lib/libc/arch/sparc64/Makefile.inc
rf516bc2 rc2efbb4 33 33 TOOLCHAIN_DIR = $(CROSS_PREFIX)/sparc64/bin 34 34 35 ARCH_SOURCES += arch/$(UARCH)/src/fibril.S \ 35 ARCH_SOURCES = \ 36 arch/$(UARCH)/src/entry.s \ 37 arch/$(UARCH)/src/thread_entry.s \ 38 arch/$(UARCH)/src/fibril.S \ 36 39 arch/$(UARCH)/src/tls.c \ 37 40 arch/$(UARCH)/src/stacktrace.c \ -
uspace/lib/libc/arch/sparc64/include/atomic.h
rf516bc2 rc2efbb4 46 46 * 47 47 * @param val Atomic variable. 48 * @param i Signed value to be added.48 * @param i Signed value to be added. 49 49 * 50 50 * @return Value of the atomic variable as it existed before addition. 51 * 51 52 */ 52 static inline long atomic_add(atomic_t *val, int i)53 static inline atomic_count_t atomic_add(atomic_t *val, atomic_count_t i) 53 54 { 54 uint64_t a, b; 55 55 atomic_count_t a; 56 atomic_count_t b; 57 56 58 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); 60 62 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 ); 62 70 } while (a != b); 63 71 64 72 return a; 65 73 } 66 74 67 static inline longatomic_preinc(atomic_t *val)75 static inline atomic_count_t atomic_preinc(atomic_t *val) 68 76 { 69 77 return atomic_add(val, 1) + 1; 70 78 } 71 79 72 static inline longatomic_postinc(atomic_t *val)80 static inline atomic_count_t atomic_postinc(atomic_t *val) 73 81 { 74 82 return atomic_add(val, 1); 75 83 } 76 84 77 static inline longatomic_predec(atomic_t *val)85 static inline atomic_count_t atomic_predec(atomic_t *val) 78 86 { 79 87 return atomic_add(val, -1) - 1; 80 88 } 81 89 82 static inline longatomic_postdec(atomic_t *val)90 static inline atomic_count_t atomic_postdec(atomic_t *val) 83 91 { 84 92 return atomic_add(val, -1); -
uspace/lib/libc/arch/sparc64/include/types.h
rf516bc2 rc2efbb4 54 54 55 55 typedef uint64_t uintptr_t; 56 typedef uint64_t atomic_count_t; 57 typedef int64_t atomic_signed_t; 56 58 57 59 #endif -
uspace/lib/libc/generic/async.c
rf516bc2 rc2efbb4 1101 1101 } 1102 1102 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 */ 1114 int 1115 async_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 */ 1141 int 1142 async_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 1103 1157 /** Wrapper for making IPC_M_SHARE_IN calls using the async framework. 1104 1158 * -
uspace/lib/libc/generic/futex.c
rf516bc2 rc2efbb4 68 68 int futex_down(futex_t *futex) 69 69 { 70 if ( atomic_predec(futex) < 0)70 if ((atomic_signed_t) atomic_predec(futex) < 0) 71 71 return __SYSCALL1(SYS_FUTEX_SLEEP, (sysarg_t) &futex->count); 72 72 … … 82 82 int futex_up(futex_t *futex) 83 83 { 84 if ( atomic_postinc(futex) < 0)84 if ((atomic_signed_t) atomic_postinc(futex) < 0) 85 85 return __SYSCALL1(SYS_FUTEX_WAKEUP, (sysarg_t) &futex->count); 86 86 -
uspace/lib/libc/include/async.h
rf516bc2 rc2efbb4 259 259 } 260 260 261 extern int async_connect_me_to(int, ipcarg_t, ipcarg_t, ipcarg_t); 262 extern int async_connect_me_to_blocking(int, ipcarg_t, ipcarg_t, ipcarg_t); 263 261 264 /* 262 265 * User-friendly wrappers for async_share_in_start(). -
uspace/lib/libc/include/atomicdflt.h
rf516bc2 rc2efbb4 37 37 38 38 #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. 40 40 #endif 41 41 42 #include <stdint.h> 42 43 #include <bool.h> 43 44 44 45 typedef struct atomic { 45 volatile longcount;46 volatile atomic_count_t count; 46 47 } atomic_t; 47 48 48 static inline void atomic_set(atomic_t *val, longi)49 static inline void atomic_set(atomic_t *val, atomic_count_t i) 49 50 { 50 val->count = i;51 val->count = i; 51 52 } 52 53 53 static inline longatomic_get(atomic_t *val)54 static inline atomic_count_t atomic_get(atomic_t *val) 54 55 { 55 return val->count;56 return val->count; 56 57 } 57 58 58 #ifndef CAS 59 static inline bool cas(atomic_t *val, long ov, longnv)59 #ifndef CAS 60 static inline bool cas(atomic_t *val, atomic_count_t ov, atomic_count_t nv) 60 61 { 61 62 return __sync_bool_compare_and_swap(&val->count, ov, nv); -
uspace/lib/libc/include/ipc/services.h
rf516bc2 rc2efbb4 47 47 SERVICE_FHC, 48 48 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 50 62 } services_t; 51 63 -
uspace/lib/libc/include/stacktrace.h
rf516bc2 rc2efbb4 57 57 extern void stacktrace_prepare(void); 58 58 extern uintptr_t stacktrace_fp_get(void); 59 extern uintptr_t stacktrace_pc_get( );59 extern uintptr_t stacktrace_pc_get(void); 60 60 61 61 #endif -
uspace/srv/hid/kbd/Makefile.build
rf516bc2 rc2efbb4 150 150 endif 151 151 152 ifeq ($(UARCH),abs32le) 153 SOURCES += \ 154 port/dummy.c \ 155 ctl/pc.c 156 endif 157 152 158 OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) 153 159 -
uspace/srv/loader/include/arch.h
rf516bc2 rc2efbb4 37 37 #define LOADER_ARCH_H_ 38 38 39 void program_run(void *entry_point, void *pcb);39 extern void program_run(void *entry_point, void *pcb); 40 40 41 41 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
