Changeset 3558ba93 in mainline for uspace/lib/c
- 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/c
- Files:
-
- 1 added
- 5 edited
-
Makefile (modified) (2 diffs)
-
arch/amd64/_link.ld.in (modified) (1 diff)
-
arch/ia32/Makefile.inc (modified) (1 diff)
-
generic/setjmp.c (added)
-
include/bitops.h (modified) (1 diff)
-
include/setjmp.h (modified) (3 diffs)
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
Note:
See TracChangeset
for help on using the changeset viewer.
