1 | /* Copyright (c) 2009, 2010, 2011, 2012 ARM Ltd. All rights reserved. |
---|
2 | |
---|
3 | Redistribution and use in source and binary forms, with or without |
---|
4 | modification, are permitted provided that the following conditions |
---|
5 | are met: |
---|
6 | 1. Redistributions of source code must retain the above copyright |
---|
7 | notice, this list of conditions and the following disclaimer. |
---|
8 | 2. Redistributions in binary form must reproduce the above copyright |
---|
9 | notice, this list of conditions and the following disclaimer in the |
---|
10 | documentation and/or other materials provided with the distribution. |
---|
11 | 3. The name of the company may not be used to endorse or promote |
---|
12 | products derived from this software without specific prior written |
---|
13 | permission. |
---|
14 | |
---|
15 | THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED |
---|
16 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
---|
17 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
---|
18 | IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
---|
19 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED |
---|
20 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
---|
21 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
---|
22 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
---|
23 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
---|
24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ |
---|
25 | |
---|
26 | #include <_ansi.h> |
---|
27 | #include "svc.h" |
---|
28 | |
---|
29 | void _exit (int); |
---|
30 | |
---|
31 | __attribute__ ((noreturn)) void |
---|
32 | _exit (int status) |
---|
33 | { |
---|
34 | while (1) |
---|
35 | { |
---|
36 | param_block_t block[2]; |
---|
37 | block[0] = ADP_Stopped_ApplicationExit; |
---|
38 | block[1] = status; |
---|
39 | |
---|
40 | #if SEMIHOST_V2 |
---|
41 | if (_has_ext_exit_extended ()) |
---|
42 | do_AngelSVC (AngelSVC_Reason_ReportExceptionExtended, block); |
---|
43 | else |
---|
44 | #endif |
---|
45 | do_AngelSVC (AngelSVC_Reason_ReportException, block); |
---|
46 | } |
---|
47 | } |
---|