Changeset b5143bd in mainline
- Timestamp:
- 2015-06-06T01:50:56Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0453261
- Parents:
- 94e46c9 (diff), 87a2f9b (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. - Files:
-
- 45 edited
Legend:
- Unmodified
- Added
- Removed
-
abi/include/abi/proc/uarg.h
r94e46c9 rb5143bd 42 42 size_t uspace_stack_size; 43 43 44 void (* uspace_thread_function)( );44 void (* uspace_thread_function)(void *); 45 45 void *uspace_thread_arg; 46 46 -
boot/arch/arm32/src/mm.c
r94e46c9 rb5143bd 193 193 } 194 194 195 static void enable_paging() 196 { 197 /* c3 - each two bits controls access to the one of domains (16) 195 static void enable_paging(void) 196 { 197 /* 198 * c3 - each two bits controls access to the one of domains (16) 198 199 * 0b01 - behave as a client (user) of a domain 199 200 */ … … 232 233 233 234 /** Start the MMU - initialize page table and enable paging. */ 234 void mmu_start() { 235 void mmu_start(void) 236 { 235 237 disable_paging(); 236 238 #ifdef PROCESSOR_ARCH_armv7_a -
boot/arch/ppc32/include/asm.h
r94e46c9 rb5143bd 35 35 extern void jump_to_kernel(void *, void *, size_t, void *) 36 36 __attribute__((noreturn)); 37 extern void real_mode( );37 extern void real_mode(void); 38 38 39 39 #endif -
boot/arch/sparc32/src/ambapp.c
r94e46c9 rb5143bd 58 58 static void ambapp_scan_area(uintptr_t, unsigned int); 59 59 60 void ambapp_scan( )60 void ambapp_scan(void) 61 61 { 62 62 amba_fake = false; … … 104 104 } 105 105 106 void ambapp_qemu_fake_scan( )106 void ambapp_qemu_fake_scan(void) 107 107 { 108 108 /* UART */ … … 134 134 } 135 135 136 bool ambapp_fake( )136 bool ambapp_fake(void) 137 137 { 138 138 return amba_fake; 139 139 } 140 140 141 void ambapp_print_devices( )141 void ambapp_print_devices(void) 142 142 { 143 143 printf("ABMA devices:\n"); -
boot/arch/sparc32/src/mm.c
r94e46c9 rb5143bd 76 76 } 77 77 78 static void mmu_disable( )78 static void mmu_disable(void) 79 79 { 80 80 uint32_t cr = asi_u32_read(ASI_MMUREGS, 0x000); -
boot/generic/include/memstr.h
r94e46c9 rb5143bd 36 36 37 37 extern void *memcpy(void *, const void *, size_t) 38 __attribute__ ((optimize("-fno-tree-loop-distribute-patterns"))); 38 __attribute__((nonnull(1, 2))) 39 __attribute__((optimize("-fno-tree-loop-distribute-patterns"))); 39 40 extern void *memset(void *, int, size_t) 40 __attribute__ ((optimize("-fno-tree-loop-distribute-patterns"))); 41 extern void *memmove(void *, const void *, size_t); 41 __attribute__((nonnull(1))) 42 __attribute__((optimize("-fno-tree-loop-distribute-patterns"))); 43 extern void *memmove(void *, const void *, size_t) 44 __attribute__((nonnull(1, 2))); 42 45 43 46 #endif -
contrib/bazaar/bzreml/__init__.py
r94e46c9 rb5143bd 70 70 71 71 sender_user, sender_email = parseaddr(sender) 72 payload = MIMEText(body. encode("utf-8"), "plain", "utf-8")72 payload = MIMEText(body.decode("utf-8", 'ignore').encode("utf-8", 'ignore'), "plain", "utf-8") 73 73 74 74 msg = MIMEMultipart() -
contrib/bazaar/mbprotect/__init__.py
r94e46c9 rb5143bd 60 60 return 61 61 62 # First permitted case is appending changesets to main branch. Look for62 # First permitted case is appending changesets to main branch. Look for 63 63 # old tip in new main branch. 64 64 for revision_id in iter_reverse_revision_history(repo, params.new_revid): 65 65 if revision_id == params.old_revid: 66 return # Found old tip 66 # Old tip found 67 return 67 68 68 69 # Another permitted case is backing out changesets. Look for new tip … … 70 71 for revision_id in iter_reverse_revision_history(repo, params.old_revid): 71 72 if revision_id == params.new_revid: 72 return # Found new tip 73 # New tip found 74 return 73 75 74 76 # Trying to do something else. Reject the change. -
kernel/arch/abs32le/src/abs32le.c
r94e46c9 rb5143bd 69 69 } 70 70 71 void arch_post_cpu_init( )71 void arch_post_cpu_init(void) 72 72 { 73 73 } -
kernel/arch/amd64/include/arch/asm.h
r94e46c9 rb5143bd 339 339 * 340 340 */ 341 NO_TRACE static inline void enable_l_apic_in_msr( )341 NO_TRACE static inline void enable_l_apic_in_msr(void) 342 342 { 343 343 asm volatile ( -
kernel/arch/amd64/src/fpu_context.c
r94e46c9 rb5143bd 54 54 } 55 55 56 void fpu_init( )56 void fpu_init(void) 57 57 { 58 58 /* TODO: Zero all SSE, MMX etc. registers */ -
kernel/arch/arm32/include/arch/cp15.h
r94e46c9 rb5143bd 47 47 48 48 #define CONTROL_REG_GEN_READ(name, crn, opc1, crm, opc2) \ 49 static inline uint32_t name##_read( ) \49 static inline uint32_t name##_read(void) \ 50 50 { \ 51 51 uint32_t val; \ -
kernel/arch/arm32/include/arch/security_ext.h
r94e46c9 rb5143bd 46 46 * older archs. 47 47 */ 48 static inline bool sec_ext_is_implemented( )48 static inline bool sec_ext_is_implemented(void) 49 49 { 50 50 #ifdef PROCESSOR_ARCH_armv7_a … … 60 60 * mode. 61 61 */ 62 static inline bool sec_ext_is_monitor_mode( )62 static inline bool sec_ext_is_monitor_mode(void) 63 63 { 64 64 return (current_status_reg_read() & MODE_MASK) == MONITOR_MODE; … … 75 75 * Look for 'secureworld_exit' in arch/arm/cpu/armv7/omap3/board.c. 76 76 */ 77 static inline bool sec_ext_is_secure( )77 static inline bool sec_ext_is_secure(void) 78 78 { 79 79 return sec_ext_is_implemented() -
kernel/arch/arm32/src/arm32.c
r94e46c9 rb5143bd 158 158 159 159 /** Reboot. */ 160 void arch_reboot( )160 void arch_reboot(void) 161 161 { 162 162 /* not implemented */ -
kernel/arch/arm32/src/fpu_context.c
r94e46c9 rb5143bd 101 101 FPSCR_EN_ALL = FPSCR_DENORMAL_EN_FLAG | FPSCR_INEXACT_EN_FLAG | FPSCR_UNDERFLOW_EN_FLAG | FPSCR_OVERFLOW_EN_FLAG | FPSCR_ZERO_DIV_EN_FLAG | FPSCR_INVALID_OP_EN_FLAG, 102 102 }; 103 103 104 extern uint32_t fpscr_read(void); 104 105 extern void fpscr_write(uint32_t); … … 114 115 static void (*restore_context)(fpu_context_t *ctx); 115 116 116 static int fpu_have_coprocessor_access() 117 { 118 /* The register containing the information (CPACR) is not available on armv6- 117 static int fpu_have_coprocessor_access(void) 118 { 119 /* 120 * The register containing the information (CPACR) is not available on armv6- 119 121 * rely on user decision to use CONFIG_FPU. 120 122 */ … … 143 145 * @note do we need to call secure monitor here? 144 146 */ 145 static void fpu_enable_coprocessor_access() 146 { 147 /* The register containing the information (CPACR) is not available on armv6- 147 static void fpu_enable_coprocessor_access(void) 148 { 149 /* 150 * The register containing the information (CPACR) is not available on armv6- 148 151 * rely on user decision to use CONFIG_FPU. 149 152 */ -
kernel/arch/ia32/src/fpu_context.c
r94e46c9 rb5143bd 125 125 126 126 /** Initialize x87 FPU. Mask all exceptions. */ 127 void fpu_init( )127 void fpu_init(void) 128 128 { 129 129 uint32_t help0 = 0; -
kernel/arch/ia64/src/mm/vhpt.c
r94e46c9 rb5143bd 82 82 } 83 83 84 void vhpt_invalidate_all( )84 void vhpt_invalidate_all(void) 85 85 { 86 86 memsetb(vhpt_base, VHPT_SIZE, 0); -
kernel/arch/mips32/src/debugger.c
r94e46c9 rb5143bd 288 288 * 289 289 */ 290 void debugger_init( )290 void debugger_init(void) 291 291 { 292 292 unsigned int i; -
kernel/arch/mips32/src/fpu_context.c
r94e46c9 rb5143bd 53 53 } 54 54 55 void fpu_init( )55 void fpu_init(void) 56 56 { 57 57 /* TODO: Zero all registers */ -
kernel/arch/sparc32/src/sparc32.c
r94e46c9 rb5143bd 96 96 97 97 98 void arch_post_cpu_init( )98 void arch_post_cpu_init(void) 99 99 { 100 100 } -
kernel/generic/include/lib/memfnc.h
r94e46c9 rb5143bd 46 46 47 47 extern void *memset(void *, int, size_t) 48 __attribute__((nonnull(1))) 48 49 ATTRIBUTE_OPTIMIZE("-fno-tree-loop-distribute-patterns") DO_NOT_DISCARD; 49 50 extern void *memcpy(void *, const void *, size_t) 51 __attribute__((nonnull(1, 2))) 50 52 ATTRIBUTE_OPTIMIZE("-fno-tree-loop-distribute-patterns") DO_NOT_DISCARD; 51 53 -
kernel/generic/include/memstr.h
r94e46c9 rb5143bd 48 48 #define memcpy(dst, src, cnt) __builtin_memcpy((dst), (src), (cnt)) 49 49 50 extern void memsetb(void *, size_t, uint8_t); 51 extern void memsetw(void *, size_t, uint16_t); 52 extern void *memmove(void *, const void *, size_t) DO_NOT_DISCARD; 50 extern void memsetb(void *, size_t, uint8_t) 51 __attribute__((nonnull(1))); 52 extern void memsetw(void *, size_t, uint16_t) 53 __attribute__((nonnull(1))); 54 extern void *memmove(void *, const void *, size_t) 55 __attribute__((nonnull(1, 2))) DO_NOT_DISCARD; 53 56 54 57 #endif -
kernel/generic/include/mm/slab.h
r94e46c9 rb5143bd 142 142 extern void *malloc(size_t, unsigned int) 143 143 __attribute__((malloc)); 144 extern void *realloc(void *, size_t, unsigned int); 144 extern void *realloc(void *, size_t, unsigned int) 145 __attribute__((warn_unused_result)); 145 146 extern void free(void *); 146 147 -
kernel/generic/include/typedefs.h
r94e46c9 rb5143bd 50 50 } atomic_t; 51 51 52 typedef void (* function)( );52 typedef void (* function)(void); 53 53 54 54 typedef uint32_t container_id_t; -
kernel/generic/src/ipc/ops/conctmeto.c
r94e46c9 rb5143bd 44 44 int newphid = phone_alloc(TASK); 45 45 46 /* Remember the phoneid or the error. */ 47 call->priv = newphid; 46 48 if (newphid < 0) 47 49 return ELIMIT; … … 49 51 /* Set arg5 for server */ 50 52 IPC_SET_ARG5(call->data, (sysarg_t) &TASK->phones[newphid]); 51 call->priv = newphid;52 53 53 54 return EOK; … … 73 74 static int answer_process(call_t *answer) 74 75 { 75 if (IPC_GET_RETVAL(answer->data)) 76 phone_dealloc(answer->priv); 77 else 78 IPC_SET_ARG5(answer->data, answer->priv); 76 int newphid = (int) answer->priv; 77 78 if (IPC_GET_RETVAL(answer->data)) { 79 if (newphid >= 0) { 80 /* 81 * The phone was indeed allocated and now needs 82 * to be deallocated. 83 */ 84 phone_dealloc(newphid); 85 } 86 } else { 87 IPC_SET_ARG5(answer->data, newphid); 88 } 79 89 80 90 return EOK; -
kernel/generic/src/ipc/sysipc.c
r94e46c9 rb5143bd 388 388 { 389 389 call_t *call = get_call(callid); 390 phone_t *phone;391 bool need_old = answer_need_old(call);392 bool after_forward = false;393 ipc_data_t old;394 int rc;395 396 390 if (!call) 397 391 return ENOENT; 398 392 393 ipc_data_t old; 394 bool need_old = answer_need_old(call); 399 395 if (need_old) 400 396 old = call->data; 397 398 bool after_forward = false; 399 int rc; 400 phone_t *phone; 401 401 402 402 if (phone_get(phoneid, &phone) != EOK) { … … 409 409 goto error; 410 410 } 411 411 412 412 call->flags |= IPC_CALL_FORWARDED; 413 413 -
kernel/generic/src/lib/func.c
r94e46c9 rb5143bd 51 51 * 52 52 */ 53 void halt( )53 void halt(void) 54 54 { 55 55 #if (defined(CONFIG_DEBUG)) && (defined(CONFIG_KCONSOLE)) -
kernel/generic/src/mm/as.c
r94e46c9 rb5143bd 834 834 if ((cond = (bool) node->keys)) { 835 835 uintptr_t ptr = node->key[node->keys - 1]; 836 size_t size =836 size_t node_size = 837 837 (size_t) node->value[node->keys - 1]; 838 838 size_t i = 0; 839 839 840 if (overlaps(ptr, P2SZ( size), area->base,840 if (overlaps(ptr, P2SZ(node_size), area->base, 841 841 P2SZ(pages))) { 842 842 843 if (ptr + P2SZ( size) <= start_free) {843 if (ptr + P2SZ(node_size) <= start_free) { 844 844 /* 845 845 * The whole interval fits … … 860 860 i = (start_free - ptr) >> PAGE_WIDTH; 861 861 if (!used_space_remove(area, start_free, 862 size - i))862 node_size - i)) 863 863 panic("Cannot remove used space."); 864 864 } else { … … 867 867 * completely removed. 868 868 */ 869 if (!used_space_remove(area, ptr, size))869 if (!used_space_remove(area, ptr, node_size)) 870 870 panic("Cannot remove used space."); 871 871 } … … 887 887 area->pages - pages); 888 888 889 for (; i < size; i++) {889 for (; i < node_size; i++) { 890 890 pte_t *pte = page_mapping_find(as, 891 891 ptr + P2SZ(i), false); -
kernel/generic/src/mm/slab.c
r94e46c9 rb5143bd 610 610 unsigned int kmflag), size_t (*destructor)(void *obj), unsigned int flags) 611 611 { 612 ASSERT(size > 0); 613 612 614 memsetb(cache, sizeof(*cache), 0); 613 615 cache->name = name; … … 888 890 /* Initialize magazine cache */ 889 891 _slab_cache_create(&mag_cache, "slab_magazine_t", 890 sizeof(slab_magazine_t) + SLAB_MAG_SIZE * sizeof(void *),892 sizeof(slab_magazine_t) + SLAB_MAG_SIZE * sizeof(void *), 891 893 sizeof(uintptr_t), NULL, NULL, SLAB_CACHE_NOMAGAZINE | 892 894 SLAB_CACHE_SLINSIDE); -
kernel/generic/src/udebug/udebug_ops.c
r94e46c9 rb5143bd 375 375 if (TASK->udebug.dt_state != UDEBUG_TS_ACTIVE) { 376 376 mutex_unlock(&TASK->udebug.lock); 377 free(id_buffer); 377 378 return EINVAL; 378 379 } … … 456 457 int udebug_args_read(thread_t *thread, void **buffer) 457 458 { 458 /* Prepare a buffer to hold the arguments. */459 sysarg_t *arg_buffer = malloc(6 * sizeof(sysarg_t), 0);460 461 459 /* On success, this will lock t->udebug.lock. */ 462 460 int rc = _thread_op_begin(thread, false); … … 471 469 } 472 470 471 /* Prepare a buffer to hold the arguments. */ 472 sysarg_t *arg_buffer = malloc(6 * sizeof(sysarg_t), 0); 473 473 474 /* Copy to a local buffer before releasing the lock. */ 474 475 memcpy(arg_buffer, thread->udebug.syscall_args, 6 * sizeof(sysarg_t)); … … 499 500 int udebug_regs_read(thread_t *thread, void **buffer) 500 501 { 501 /* Prepare a buffer to hold the data. */502 istate_t *state_buf = malloc(sizeof(istate_t), 0);503 504 502 /* On success, this will lock t->udebug.lock */ 505 503 int rc = _thread_op_begin(thread, false); … … 512 510 return EBUSY; 513 511 } 512 513 /* Prepare a buffer to hold the data. */ 514 istate_t *state_buf = malloc(sizeof(istate_t), 0); 514 515 515 516 /* Copy to the allocated buffer */ -
uspace/app/bdsh/cmds/modules/cat/cat.c
r94e46c9 rb5143bd 108 108 } 109 109 110 static void waitprompt( )110 static void waitprompt(void) 111 111 { 112 112 console_set_pos(console, 0, console_rows-1); … … 120 120 } 121 121 122 static void waitkey( )122 static void waitkey(void) 123 123 { 124 124 cons_event_t ev; … … 149 149 } 150 150 151 static void newpage( )151 static void newpage(void) 152 152 { 153 153 console_clear(console); -
uspace/app/bdsh/input.c
r94e46c9 rb5143bd 219 219 } 220 220 221 void print_pipe_usage( )221 void print_pipe_usage(void) 222 222 { 223 223 printf("Invalid syntax!\n"); -
uspace/app/trace/trace.c
r94e46c9 rb5143bd 730 730 } 731 731 732 static void print_syntax( )732 static void print_syntax(void) 733 733 { 734 734 printf("Syntax:\n"); -
uspace/drv/bus/usb/vhc/devconn.c
r94e46c9 rb5143bd 32 32 33 33 34 static vhc_virtdev_t *vhc_virtdev_create( )34 static vhc_virtdev_t *vhc_virtdev_create(void) 35 35 { 36 36 vhc_virtdev_t *dev = malloc(sizeof(vhc_virtdev_t)); -
uspace/lib/c/generic/getopt.c
r94e46c9 rb5143bd 95 95 * Compute the greatest common divisor of a and b. 96 96 */ 97 static int 98 gcd(a, b) 99 int a; 100 int b; 97 static int gcd(int a, int b) 101 98 { 102 99 int c; 103 100 104 101 c = a % b; 105 102 while (c != 0) { … … 108 105 c = a % b; 109 106 } 110 107 111 108 return b; 112 109 } … … 117 114 * in each block). 118 115 */ 119 static void 120 permute_args(panonopt_start, panonopt_end, opt_end, nargv) 121 int panonopt_start; 122 int panonopt_end; 123 int opt_end; 124 char **nargv; 116 static void permute_args(int panonopt_start, int panonopt_end, int opt_end, 117 char **nargv) 125 118 { 126 119 int cstart, cyclelen, i, j, ncycle, nnonopts, nopts, pos; … … 157 150 * Returns -2 if -- is found (can be long option or end of options marker). 158 151 */ 159 static int 160 getopt_internal(nargc, nargv, options) 161 int nargc; 162 char **nargv; 163 const char *options; 152 static int getopt_internal(int nargc, char **nargv, const char *options) 164 153 { 165 154 const char *oli; /* option letter list index */ … … 299 288 * Parse argc/argv argument vector. 300 289 */ 301 int 302 getopt(nargc, nargv, options) 303 int nargc; 304 char * const *nargv; 305 const char *options; 290 int getopt(int nargc, char * const *nargv, const char *options) 306 291 { 307 292 int retval; … … 332 317 * Parse argc/argv argument vector. 333 318 */ 334 int 335 getopt_long(nargc, nargv, options, long_options, idx) 336 int nargc; 337 char * const *nargv; 338 const char *options; 339 const struct option *long_options; 340 int *idx; 319 int getopt_long(int nargc, char * const *nargv, const char *options, 320 const struct option *long_options, int *idx) 341 321 { 342 322 int retval; -
uspace/lib/c/include/malloc.h
r94e46c9 rb5143bd 44 44 extern void *memalign(const size_t align, const size_t size) 45 45 __attribute__((malloc)); 46 extern void *realloc(const void *addr, const size_t size); 46 extern void *realloc(const void *addr, const size_t size) 47 __attribute__((warn_unused_result)); 47 48 extern void free(const void *addr); 48 49 extern void *heap_check(void); -
uspace/lib/c/include/mem.h
r94e46c9 rb5143bd 40 40 41 41 extern void *memset(void *, int, size_t) 42 __attribute__((nonnull(1))) 42 43 ATTRIBUTE_OPTIMIZE("-fno-tree-loop-distribute-patterns"); 43 44 extern void *memcpy(void *, const void *, size_t) 45 __attribute__((nonnull(1, 2))) 44 46 ATTRIBUTE_OPTIMIZE("-fno-tree-loop-distribute-patterns"); 45 extern void *memmove(void *, const void *, size_t); 46 extern int memcmp(const void *, const void *, size_t); 47 extern void *memmove(void *, const void *, size_t) 48 __attribute__((nonnull(1, 2))); 49 extern int memcmp(const void *, const void *, size_t) 50 __attribute__((nonnull(1, 2))); 47 51 48 52 #endif -
uspace/lib/c/include/task.h
r94e46c9 rb5143bd 60 60 extern int task_spawn(task_id_t *, task_wait_t *, const char *path, int, 61 61 va_list ap); 62 extern int task_spawnl(task_id_t *, task_wait_t *, const char *path, ...); 62 extern int task_spawnl(task_id_t *, task_wait_t *, const char *path, ...) 63 __attribute__((sentinel)); 63 64 64 65 extern int task_setup_wait(task_id_t, task_wait_t *); -
uspace/lib/ieee80211/src/ieee80211.c
r94e46c9 rb5143bd 718 718 * 719 719 */ 720 ieee80211_dev_t *ieee80211_device_create( )720 ieee80211_dev_t *ieee80211_device_create(void) 721 721 { 722 722 return calloc(1, sizeof(ieee80211_dev_t)); -
uspace/lib/pcut/src/run.c
r94e46c9 rb5143bd 73 73 static int default_suite_initialized = 0; 74 74 75 static void init_default_suite_when_needed() { 76 if (default_suite_initialized) { 75 static void init_default_suite_when_needed(void) 76 { 77 if (default_suite_initialized) 77 78 return; 78 }79 79 80 default_suite.id = -1; 80 81 default_suite.kind = PCUT_KIND_TESTSUITE; … … 91 92 * @return Always a valid test suite item. 92 93 */ 93 static pcut_item_t *pcut_find_parent_suite(pcut_item_t *it) { 94 static pcut_item_t *pcut_find_parent_suite(pcut_item_t *it) 95 { 94 96 while (it != NULL) { 95 if (it->kind == PCUT_KIND_TESTSUITE) {97 if (it->kind == PCUT_KIND_TESTSUITE) 96 98 return it; 97 }99 98 100 it = it->previous; 99 101 } 102 100 103 init_default_suite_when_needed(); 101 104 return &default_suite; … … 106 109 * @param func Function to run (can be NULL). 107 110 */ 108 static void run_setup_teardown(pcut_setup_func_t func) { 109 if (func != NULL) { 111 static void run_setup_teardown(pcut_setup_func_t func) 112 { 113 if (func != NULL) 110 114 func(); 111 }112 115 } 113 116 … … 119 122 * @param outcome Outcome of the current test. 120 123 */ 121 static void leave_test(int outcome) { 124 static void leave_test(int outcome) 125 { 122 126 PCUT_DEBUG("leave_test(outcome=%d), will_exit=%s", outcome, 123 124 if (leave_means_exit) {127 leave_means_exit ? "yes" : "no"); 128 if (leave_means_exit) 125 129 exit(outcome); 126 } 127 130 128 131 #ifndef PCUT_NO_LONG_JUMP 129 132 longjmp(start_test_jump, 1); … … 138 141 * @param message Message describing the failure. 139 142 */ 140 void pcut_failed_assertion(const char *message) { 143 void pcut_failed_assertion(const char *message) 144 { 141 145 static const char *prev_message = NULL; 146 142 147 /* 143 148 * The assertion failed. We need to abort the current test, … … 145 150 * include running the tear-down routine. 146 151 */ 147 if (print_test_error) {152 if (print_test_error) 148 153 pcut_print_fail_message(message); 149 } 150 154 151 155 if (execute_teardown_on_failure) { 152 156 execute_teardown_on_failure = 0; 153 157 prev_message = message; 154 158 run_setup_teardown(current_suite->teardown_func); 155 159 156 160 /* Tear-down was okay. */ 157 161 if (report_test_result) { … … 165 169 } 166 170 } 167 171 168 172 prev_message = NULL; 169 173 170 174 leave_test(TEST_OUTCOME_FAIL); /* No return. */ 171 175 } … … 176 180 * @return Error status (zero means success). 177 181 */ 178 static int run_test(pcut_item_t *test) { 182 static int run_test(pcut_item_t *test) 183 { 179 184 /* 180 185 * Set here as the returning point in case of test failure. … … 182 187 * test execution. 183 188 */ 189 184 190 #ifndef PCUT_NO_LONG_JUMP 185 191 int test_finished = setjmp(start_test_jump); 186 if (test_finished) {192 if (test_finished) 187 193 return 1; 188 }189 194 #endif 190 191 if (report_test_result) {195 196 if (report_test_result) 192 197 pcut_report_test_start(test); 193 } 194 198 195 199 current_suite = pcut_find_parent_suite(test); 196 200 current_test = test; 197 201 198 202 pcut_hook_before_test(test); 199 203 200 204 /* 201 205 * If anything goes wrong, execute the tear-down function … … 203 207 */ 204 208 execute_teardown_on_failure = 1; 205 209 206 210 /* 207 211 * Run the set-up function. 208 212 */ 209 213 run_setup_teardown(current_suite->setup_func); 210 214 211 215 /* 212 216 * The setup function was performed, it is time to run … … 214 218 */ 215 219 test->test_func(); 216 220 217 221 /* 218 222 * Finally, run the tear-down function. We need to clear … … 221 225 execute_teardown_on_failure = 0; 222 226 run_setup_teardown(current_suite->teardown_func); 223 227 224 228 /* 225 229 * If we got here, it means everything went well with 226 230 * this test. 227 231 */ 228 if (report_test_result) {232 if (report_test_result) 229 233 pcut_report_test_done(current_test, TEST_OUTCOME_PASS, 230 NULL, NULL, NULL); 231 } 232 234 NULL, NULL, NULL); 235 233 236 return 0; 234 237 } … … 242 245 * @return Error status (zero means success). 243 246 */ 244 int pcut_run_test_forked(pcut_item_t *test) { 245 int rc; 246 247 int pcut_run_test_forked(pcut_item_t *test) 248 { 247 249 report_test_result = 0; 248 250 print_test_error = 1; 249 251 leave_means_exit = 1; 250 251 rc = run_test(test);252 252 253 int rc = run_test(test); 254 253 255 current_test = NULL; 254 256 current_suite = NULL; 255 257 256 258 return rc; 257 259 } … … 265 267 * @return Error status (zero means success). 266 268 */ 267 int pcut_run_test_single(pcut_item_t *test) { 268 int rc; 269 269 int pcut_run_test_single(pcut_item_t *test) 270 { 270 271 report_test_result = 1; 271 272 print_test_error = 0; 272 273 leave_means_exit = 0; 273 274 rc = run_test(test);275 274 275 int rc = run_test(test); 276 276 277 current_test = NULL; 277 278 current_suite = NULL; 278 279 279 280 return rc; 280 281 } … … 285 286 * @return Timeout in seconds. 286 287 */ 287 int pcut_get_test_timeout(pcut_item_t *test) { 288 int pcut_get_test_timeout(pcut_item_t *test) 289 { 288 290 int timeout = PCUT_DEFAULT_TEST_TIMEOUT; 289 291 pcut_extra_t *extras = test->extras; 290 291 292 292 293 while (extras->type != PCUT_EXTRA_LAST) { 293 if (extras->type == PCUT_EXTRA_TIMEOUT) {294 if (extras->type == PCUT_EXTRA_TIMEOUT) 294 295 timeout = extras->timeout; 295 }296 296 297 extras++; 297 298 } 298 299 299 300 return timeout; 300 301 } -
uspace/lib/posix/include/posix/stdlib.h
r94e46c9 rb5143bd 116 116 117 117 /* Memory Allocation */ 118 extern void *__POSIX_DEF__(malloc)(size_t size); 119 extern void *__POSIX_DEF__(calloc)(size_t nelem, size_t elsize); 120 extern void *__POSIX_DEF__(realloc)(void *ptr, size_t size); 118 extern void *__POSIX_DEF__(malloc)(size_t size) 119 __attribute__((malloc)); 120 extern void *__POSIX_DEF__(calloc)(size_t nelem, size_t elsize) 121 __attribute__((malloc)); 122 extern void *__POSIX_DEF__(realloc)(void *ptr, size_t size) 123 __attribute__((warn_unused_result)); 121 124 extern void __POSIX_DEF__(free)(void *ptr); 122 125 -
uspace/lib/posix/include/posix/string.h
r94e46c9 rb5143bd 67 67 /* From mem.h */ 68 68 // #define bzero(ptr, len) memset((ptr), 0, (len)) 69 extern void *memset(void *, int, size_t); 70 extern void *memcpy(void *, const void *, size_t); 71 extern void *memmove(void *, const void *, size_t); 69 extern void *memset(void *, int, size_t) 70 __attribute__((nonnull(1))); 71 extern void *memcpy(void *, const void *, size_t) 72 __attribute__((nonnull(1, 2))); 73 extern void *memmove(void *, const void *, size_t) 74 __attribute__((nonnull(1, 2))); 72 75 73 76 -
uspace/lib/posix/source/signal.c
r94e46c9 rb5143bd 382 382 * Raise all unblocked previously queued signals. 383 383 */ 384 static void _dequeue_unblocked_signals( )384 static void _dequeue_unblocked_signals(void) 385 385 { 386 386 link_t *iterator = _signal_queue.head.next; -
uspace/srv/bd/sata_bd/sata_bd.c
r94e46c9 rb5143bd 147 147 * 148 148 */ 149 static int get_sata_disks( )149 static int get_sata_disks(void) 150 150 { 151 151 devman_handle_t root_fun; -
uspace/srv/klog/klog.c
r94e46c9 rb5143bd 51 51 #include <io/logctl.h> 52 52 53 #define NAME 53 #define NAME "klog" 54 54 55 55 typedef size_t __attribute__ ((aligned(1))) unaligned_size_t; … … 98 98 * 99 99 */ 100 static void producer( )100 static void producer(void) 101 101 { 102 102 int read = klog_read(buffer, BUFFER_SIZE);
Note:
See TracChangeset
for help on using the changeset viewer.