Changeset 0c96e6cb in mainline for uspace/lib
- Timestamp:
- 2013-10-18T11:00:23Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b5851913
- Parents:
- 39bcc99 (diff), 9f9450bb (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/lib
- Files:
-
- 5 added
- 3 deleted
- 10 edited
-
c/generic/bitops.c (modified) (1 diff)
-
posix/Makefile (modified) (3 diffs)
-
posix/include/posix/float.h (modified) (1 diff)
-
posix/include/posix/pthread.h (added)
-
posix/include/posix/stdint.h (modified) (1 diff)
-
posix/include/posix/stdio.h (modified) (1 diff)
-
posix/include/posix/time.h (modified) (1 diff)
-
posix/source/internal/common.h (modified) (1 diff)
-
posix/source/math.c (modified) (13 diffs)
-
posix/source/pthread/condvar.c (added)
-
posix/source/pthread/keys.c (added)
-
posix/source/pthread/mutex.c (added)
-
posix/source/pthread/threads.c (added)
-
posix/source/stdlib.c (modified) (1 diff)
-
posix/source/unistd.c (modified) (5 diffs)
-
posix/tools/create-redefines.sh (deleted)
-
posix/tools/get-collision-list.sh (deleted)
-
posix/tools/transform-symbols.sh (deleted)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/bitops.c
r39bcc99 r0c96e6cb 33 33 #include <bitops.h> 34 34 35 externint __popcountsi2(int a)35 int __popcountsi2(int a) 36 36 { 37 return __builtin_popcount(a); 37 int bits = 0; 38 for (unsigned int i = 0; i < sizeof(a) * 8; i++) { 39 if (((a >> i) & 1) != 0) { 40 bits++; 41 } 42 } 43 return bits; 38 44 } 39 45 -
uspace/lib/posix/Makefile
r39bcc99 r0c96e6cb 42 42 FIXED_C_LIBRARY = libc4posix.a 43 43 44 REDEFS_HIDE_LIBC = redefs-hide-libc .xargs45 REDEFS_SHOW_LIBPOSIX = redefs-show-posix .xargs44 REDEFS_HIDE_LIBC = redefs-hide-libc-symbols.list 45 REDEFS_SHOW_LIBPOSIX = redefs-show-posix-symbols.list 46 46 COLLISIONS_LIST = collisions.list 47 47 … … 61 61 source/locale.c \ 62 62 source/math.c \ 63 source/pthread/condvar.c \ 64 source/pthread/keys.c \ 65 source/pthread/mutex.c \ 66 source/pthread/threads.c \ 63 67 source/pwd.c \ 64 68 source/signal.c \ … … 81 85 82 86 $(FIXED_C_LIBRARY): $(REDEFS_HIDE_LIBC) $(REDEFS_SHOW_LIBPOSIX) 83 ./tools/transform-symbols.sh \ 84 $(OBJCOPY) $(AR) echo \ 85 $(LIBC_FILE) $@ \ 86 $(REDEFS_HIDE_LIBC) $(REDEFS_SHOW_LIBPOSIX) 87 $(OBJCOPY) --redefine-syms=$(REDEFS_HIDE_LIBC) $(LIBC_FILE) $@ 88 $(OBJCOPY) --redefine-syms=$(REDEFS_SHOW_LIBPOSIX) $@ $@ 87 89 88 90 $(FIXED_POSIX_LIBRARY): $(LIBRARY).a $(REDEFS_HIDE_LIBC) $(REDEFS_SHOW_LIBPOSIX) 89 ./tools/transform-symbols.sh \ 90 $(OBJCOPY) $(AR) echo \ 91 $(LIBRARY).a $@ \ 92 $(REDEFS_HIDE_LIBC) $(REDEFS_SHOW_LIBPOSIX) 91 $(OBJCOPY) --redefine-syms=$(REDEFS_HIDE_LIBC) $(LIBRARY).a $@ 92 $(OBJCOPY) --redefine-syms=$(REDEFS_SHOW_LIBPOSIX) $@ $@ 93 93 94 94 $(REDEFS_HIDE_LIBC): $(COLLISIONS_LIST) 95 ./tools/create-redefines.sh "" "__helenos_libc_"<$(COLLISIONS_LIST) >$@96 95 sed 's/.*/& __helenos_libc_&/' <$(COLLISIONS_LIST) >$@ 96 97 97 $(REDEFS_SHOW_LIBPOSIX): $(COLLISIONS_LIST) 98 ./tools/create-redefines.sh "posix_" ""<$(COLLISIONS_LIST) >$@98 sed 's/.*/posix_& &/' <$(COLLISIONS_LIST) >$@ 99 99 100 100 $(COLLISIONS_LIST): 101 ./tools/get-collision-list.sh ./include/posix >$@ 101 find ./include/posix -name '*.h' -exec \ 102 sed -n -e '/^#/d' -e 's/__POSIX_DEF__/\n&/gp' {} \; | \ 103 sed -n -e 's/__POSIX_DEF__(\([^)]*\)).*/\1/p' | \ 104 sort -u >$@ -
uspace/lib/posix/include/posix/float.h
r39bcc99 r0c96e6cb 61 61 #undef FLT_RADIX 62 62 #define FLT_RADIX __FLT_RADIX__ 63 #undef FLT_MIN 64 #define FLT_MIN __FLT_MIN__ 65 #undef FLT_MAX 66 #define FLT_MAX __FLT_MAX__ 67 #undef FLT_EPSILON 68 #define FLT_EPSILON __FLT_EPSILON__ 69 #undef FLT_MANT_DIG 70 #define FLT_MANT_DIG __FLT_MANT_DIG__ 71 #undef LDBL_MANT_DIG 72 #define LDBL_MANT_DIG __LDBL_MANT_DIG__ 63 73 #else 64 74 /* For something else than GCC, following definitions are provided. -
uspace/lib/posix/include/posix/stdint.h
r39bcc99 r0c96e6cb 108 108 109 109 110 /* 111 * Fast* and least* integer types. 112 * 113 * The definitions below are definitely safe if not the best. 114 */ 115 typedef uint8_t uint_least8_t; 116 typedef uint16_t uint_least16_t; 117 typedef uint32_t uint_least32_t; 118 typedef uint64_t uint_least64_t; 119 120 typedef int8_t int_least8_t; 121 typedef int16_t int_least16_t; 122 typedef int32_t int_least32_t; 123 typedef int64_t int_least64_t; 124 125 typedef uint8_t uint_fast8_t; 126 typedef uint16_t uint_fast16_t; 127 typedef uint32_t uint_fast32_t; 128 typedef uint64_t uint_fast64_t; 129 130 typedef int8_t int_fast8_t; 131 typedef int16_t int_fast16_t; 132 typedef int32_t int_fast32_t; 133 typedef int64_t int_fast64_t; 134 110 135 #endif /* POSIX_STDINT_H_ */ 111 136 -
uspace/lib/posix/include/posix/stdio.h
r39bcc99 r0c96e6cb 123 123 124 124 extern void setvbuf(FILE *, void *, int, size_t); 125 125 extern void setbuf(FILE *, void *); 126 126 127 127 /* POSIX specific stuff. */ -
uspace/lib/posix/include/posix/time.h
r39bcc99 r0c96e6cb 104 104 extern char *__POSIX_DEF__(ctime_r)(const time_t *timer, char *buf); 105 105 extern char *__POSIX_DEF__(ctime)(const time_t *timer); 106 extern time_t time(time_t *t); 106 107 107 108 /* Clocks */ -
uspace/lib/posix/source/internal/common.h
r39bcc99 r0c96e6cb 39 39 #include <stdlib.h> 40 40 41 #define not_implemented() (fprintf(stderr, \ 42 "Function %s() in file %s at line %d is not implemented\n", \ 43 __func__, __FILE__, __LINE__), abort()) 41 #define not_implemented() do { \ 42 static int __not_implemented_counter = 0; \ 43 if (__not_implemented_counter == 0) { \ 44 fprintf(stderr, "%s() not implemented in %s:%d, something will NOT work.\n", \ 45 __func__, __FILE__, __LINE__); \ 46 } \ 47 __not_implemented_counter++; \ 48 } while (0) 44 49 45 50 /* A little helper macro to avoid typing this over and over. */ -
uspace/lib/posix/source/math.c
r39bcc99 r0c96e6cb 49 49 // TODO: low priority, just a compile-time dependency of binutils 50 50 not_implemented(); 51 return 0.0; 51 52 } 52 53 … … 61 62 // TODO: low priority, just a compile-time dependency of binutils 62 63 not_implemented(); 64 return 0.0; 63 65 } 64 66 … … 72 74 // TODO: Python dependency 73 75 not_implemented(); 76 return 0.0; 74 77 } 75 78 … … 84 87 // TODO: Python dependency 85 88 not_implemented(); 89 return 0.0; 86 90 } 87 91 … … 95 99 // TODO: Python dependency 96 100 not_implemented(); 101 return 0.0; 97 102 } 98 103 … … 106 111 // TODO: Python dependency 107 112 not_implemented(); 113 return 0.0; 108 114 } 109 115 … … 118 124 // TODO: Python dependency 119 125 not_implemented(); 126 return 0.0; 120 127 } 121 128 … … 130 137 // TODO: Python dependency 131 138 not_implemented(); 139 return 0.0; 132 140 } 133 141 … … 141 149 // TODO: Python dependency 142 150 not_implemented(); 151 return 0.0; 143 152 } 144 153 … … 153 162 // TODO: Python dependency 154 163 not_implemented(); 164 return 0.0; 155 165 } 156 166 … … 164 174 // TODO: Python dependency 165 175 not_implemented(); 176 return 0.0; 166 177 } 167 178 … … 175 186 // TODO: Python dependency 176 187 not_implemented(); 188 return 0.0; 177 189 } 178 190 … … 186 198 // TODO: Python dependency 187 199 not_implemented(); 200 return 0.0; 188 201 } 189 202 -
uspace/lib/posix/source/stdlib.c
r39bcc99 r0c96e6cb 63 63 // TODO: low priority, just a compile-time dependency of binutils 64 64 not_implemented(); 65 return 1;65 return 0; 66 66 } 67 67 -
uspace/lib/posix/source/unistd.c
r39bcc99 r0c96e6cb 389 389 // TODO: low priority, just a compile-time dependency of binutils 390 390 not_implemented(); 391 return -1; 391 392 } 392 393 … … 399 400 // TODO: low priority, just a compile-time dependency of binutils 400 401 not_implemented(); 402 return -1; 401 403 } 402 404 … … 411 413 // TODO: low priority, just a compile-time dependency of binutils 412 414 not_implemented(); 415 return -1; 413 416 } 414 417 … … 423 426 // TODO: low priority, just a compile-time dependency of binutils 424 427 not_implemented(); 428 return -1; 425 429 } 426 430 … … 434 438 // TODO: low priority, just a compile-time dependency of binutils 435 439 not_implemented(); 440 return -1; 436 441 } 437 442
Note:
See TracChangeset
for help on using the changeset viewer.
