Changeset 3558ba93 in mainline for uspace/lib
- Timestamp:
- 2013-12-09T15:55:40Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5b89d43b
- Parents:
- 12735849 (diff), 9521eca (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:
-
- 3 added
- 12 edited
- 1 moved
-
c/Makefile (modified) (2 diffs)
-
c/arch/amd64/_link.ld.in (modified) (1 diff)
-
c/arch/ia32/Makefile.inc (modified) (1 diff)
-
c/generic/setjmp.c (added)
-
c/include/bitops.h (modified) (1 diff)
-
c/include/setjmp.h (modified) (3 diffs)
-
posix/include/posix/float.h (modified) (2 diffs)
-
posix/include/posix/setjmp.h (moved) (moved from uspace/lib/c/generic/bitops.c ) (1 diff)
-
posix/include/posix/stdlib.h (modified) (1 diff)
-
softfloat/softfloat.c (modified) (4 diffs)
-
softfloat/softfloat.h (modified) (2 diffs)
-
softint/Makefile (modified) (1 diff)
-
softint/generic/bits.c (added)
-
softint/generic/shift.c (modified) (1 diff)
-
softint/include/bits.h (added)
-
softint/include/shift.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/Makefile
r12735849 r3558ba93 61 61 generic/bd.c \ 62 62 generic/bd_srv.c \ 63 generic/bitops.c \64 63 generic/cap.c \ 65 64 generic/cfg.c \ … … 143 142 generic/net/socket_client.c \ 144 143 generic/net/socket_parse.c \ 144 generic/setjmp.c \ 145 145 generic/stack.c \ 146 146 generic/stacktrace.c \ -
uspace/lib/c/arch/amd64/_link.ld.in
r12735849 r3558ba93 39 39 .data : { 40 40 *(.data); 41 *(.data.rel*); 41 42 } :data 42 43 -
uspace/lib/c/arch/ia32/Makefile.inc
r12735849 r3558ba93 34 34 arch/$(UARCH)/src/fibril.S \ 35 35 arch/$(UARCH)/src/tls.c \ 36 arch/$(UARCH)/src/setjmp.S \37 36 arch/$(UARCH)/src/stacktrace.c \ 38 37 arch/$(UARCH)/src/stacktrace_asm.S \ -
uspace/lib/c/include/bitops.h
r12735849 r3558ba93 107 107 } 108 108 109 extern int __popcountsi2(int);110 111 109 #endif 112 110 -
uspace/lib/c/include/setjmp.h
r12735849 r3558ba93 1 1 /* 2 2 * Copyright (c) 2008 Josef Cejka 3 * Copyright (c) 2013 Vojtech Horky 3 4 * All rights reserved. 4 5 * … … 30 31 * @{ 31 32 */ 32 /** @file 33 /** @file Long jump implementation. 34 * 35 * Implementation inspired by Jiri Zarevucky's code from 36 * http://bazaar.launchpad.net/~zarevucky-jiri/helenos/stdc/revision/1544/uspace/lib/posix/setjmp.h 33 37 */ 34 38 … … 38 42 #include <libarch/fibril.h> 39 43 40 typedef context_t jmp_buf[1]; 44 struct jmp_buf_interal { 45 context_t context; 46 int return_value; 47 }; 48 typedef struct jmp_buf_interal jmp_buf[1]; 41 49 42 extern int setjmp(jmp_buf env); 50 /* 51 * Specified as extern to minimize number of included headers 52 * because this file is used as is in libposix too. 53 */ 54 extern int context_save(context_t *ctx) __attribute__((returns_twice)); 55 56 /** 57 * Save current environment (registers). 58 * 59 * This function may return twice. 60 * 61 * @param env Variable where to save the environment (of type jmp_buf). 62 * @return Whether the call returned after longjmp. 63 * @retval 0 Environment was saved, normal execution. 64 * @retval other longjmp was executed and returned here. 65 */ 66 #define setjmp(env) \ 67 ((env)[0].return_value = 0, \ 68 context_save(&(env)[0].context), \ 69 (env)[0].return_value) 70 43 71 extern void longjmp(jmp_buf env, int val) __attribute__((noreturn)); 44 72 -
uspace/lib/posix/include/posix/float.h
r12735849 r3558ba93 59 59 #undef DBL_EPSILON 60 60 #define DBL_EPSILON __DBL_EPSILON__ 61 #undef LDBL_EPSILON 62 #define LDBL_EPSILON __LDBL_EPSILON__ 61 63 #undef FLT_RADIX 62 64 #define FLT_RADIX __FLT_RADIX__ … … 69 71 #undef FLT_MANT_DIG 70 72 #define FLT_MANT_DIG __FLT_MANT_DIG__ 73 #undef LDBL_MIN 74 #define LDBL_MIN __LDBL_MIN__ 75 #undef LDBL_MAX 76 #define LDBL_MAX __LDBL_MAX__ 71 77 #undef LDBL_MANT_DIG 72 78 #define LDBL_MANT_DIG __LDBL_MANT_DIG__ -
uspace/lib/posix/include/posix/setjmp.h
r12735849 r3558ba93 27 27 */ 28 28 29 /** @addtogroup lib c29 /** @addtogroup libposix 30 30 * @{ 31 31 */ 32 32 33 #include <bitops.h> 34 35 int __popcountsi2(int a) 36 { 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; 44 } 45 33 /* 34 * Just a pass-through to libc setjmp. 35 */ 36 #include "libc/setjmp.h" 46 37 47 38 /** @} -
uspace/lib/posix/include/posix/stdlib.h
r12735849 r3558ba93 56 56 #define _Exit exit 57 57 extern int __POSIX_DEF__(atexit)(void (*func)(void)); 58 extern void exit(int status) ;58 extern void exit(int status) __attribute__((noreturn)); 59 59 extern void abort(void) __attribute__((noreturn)); 60 60 -
uspace/lib/softfloat/softfloat.c
r12735849 r3558ba93 1265 1265 } 1266 1266 1267 float __aeabi_d2f(double a) 1268 { 1269 return __truncdfsf2(a); 1270 } 1271 1272 double __aeabi_f2d(float a) 1273 { 1274 return __extendsfdf2(a); 1275 } 1276 1277 1267 1278 float __aeabi_i2f(int i) 1268 1279 { … … 1285 1296 } 1286 1297 1298 double __aeabi_l2d(long long i) 1299 { 1300 return __floattidf(i); 1301 } 1302 1303 float __aeabi_l2f(long long i) 1304 { 1305 return __floattisf(i); 1306 } 1307 1308 float __aeabi_ul2f(unsigned long long u) 1309 { 1310 return __floatuntisf(u); 1311 } 1312 1287 1313 int __aeabi_f2iz(float a) 1288 1314 { … … 1305 1331 } 1306 1332 1333 long long __aeabi_d2lz(double a) 1334 { 1335 return __fixdfti(a); 1336 } 1337 1307 1338 int __aeabi_fcmpge(float a, float b) 1308 1339 { … … 1339 1370 return __ltdf2(a, b); 1340 1371 } 1372 1373 int __aeabi_dcmple(double a, double b) 1374 { 1375 return __ledf2(a, b); 1376 } 1377 1341 1378 1342 1379 int __aeabi_dcmpeq(double a, double b) -
uspace/lib/softfloat/softfloat.h
r12735849 r3558ba93 204 204 205 205 /* ARM EABI */ 206 extern float __aeabi_d2f(double); 207 extern double __aeabi_f2d(float); 206 208 extern float __aeabi_i2f(int); 207 209 extern float __aeabi_ui2f(int); 208 210 extern double __aeabi_i2d(int); 209 211 extern double __aeabi_ui2d(unsigned int); 212 extern double __aeabi_l2d(long long); 213 extern float __aeabi_l2f(long long); 214 extern float __aeabi_ul2f(unsigned long long); 210 215 extern unsigned int __aeabi_d2uiz(double); 216 extern long long __aeabi_d2lz(double); 211 217 212 218 extern int __aeabi_f2iz(float); … … 222 228 extern int __aeabi_dcmpgt(double, double); 223 229 extern int __aeabi_dcmplt(double, double); 230 extern int __aeabi_dcmple(double, double); 224 231 extern int __aeabi_dcmpeq(double, double); 225 232 -
uspace/lib/softint/Makefile
r12735849 r3558ba93 35 35 36 36 SOURCES = \ 37 generic/bits.c \ 37 38 generic/comparison.c \ 38 39 generic/division.c \ -
uspace/lib/softint/generic/shift.c
r12735849 r3558ba93 123 123 } 124 124 125 long long __aeabi_llsl(long long val, int shift) 126 { 127 return __ashldi3(val, shift); 128 } 129 125 130 /** @} 126 131 */ -
uspace/lib/softint/include/shift.h
r12735849 r3558ba93 46 46 extern long long __lshrdi3(long long, int); 47 47 48 49 /* ARM EABI */ 50 extern long long __aeabi_llsl(long long, int); 51 48 52 #endif 49 53
Note:
See TracChangeset
for help on using the changeset viewer.
