4.104.115
Line | |
---|
1 | /* __assert - small RTEMS Specific Implementation |
---|
2 | * |
---|
3 | * COPYRIGHT (c) 2007. |
---|
4 | * On-Line Applications Research Corporation (OAR). |
---|
5 | * |
---|
6 | * The license and distribution terms for this file may be |
---|
7 | * found in the file LICENSE in this distribution or at |
---|
8 | * http://www.rtems.com/license/LICENSE. |
---|
9 | * |
---|
10 | * $Id$ |
---|
11 | */ |
---|
12 | |
---|
13 | #if HAVE_CONFIG_H |
---|
14 | #include "config.h" |
---|
15 | #endif |
---|
16 | |
---|
17 | #include <rtems/bspIo.h> |
---|
18 | #include <rtems.h> |
---|
19 | |
---|
20 | #if defined(RTEMS_NEWLIB) && !defined(HAVE___ASSERT_FUNC) |
---|
21 | /* |
---|
22 | * Newlib 1.16.0 added this method. Together these provide an |
---|
23 | * RTEMS safe, low memory implementation. |
---|
24 | */ |
---|
25 | void __assert_func( |
---|
26 | const char *file, |
---|
27 | int line, |
---|
28 | const char *func, |
---|
29 | const char *failedexpr |
---|
30 | ) |
---|
31 | { |
---|
32 | printk("assertion \"%s\" failed: file \"%s\", line %d%s%s\n", |
---|
33 | failedexpr, |
---|
34 | file, |
---|
35 | line, |
---|
36 | (func) ? ", function: " : "", |
---|
37 | (func) ? func : "" |
---|
38 | ); |
---|
39 | rtems_fatal_error_occurred(0); |
---|
40 | } |
---|
41 | #endif |
---|
42 | |
---|
43 | #if defined(RTEMS_NEWLIB) && !defined(HAVE___ASSERT) |
---|
44 | void __assert( |
---|
45 | const char *file, |
---|
46 | int line, |
---|
47 | const char *failedexpr |
---|
48 | ) |
---|
49 | { |
---|
50 | __assert_func (file, line, NULL, failedexpr); |
---|
51 | } |
---|
52 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.