From: Alexander Graf Date: Fri, 22 Jun 2018 14:44:16 +0200 Subject: [U-Boot] [PATCH v5 08/10] sandbox: Add support for calling abort() In-Reply-To: <20180622124418.52892-1-agraf@suse.de> References: <20180622124418.52892-1-agraf@suse.de> Message-ID: <20180622124418.52892-9-agraf@suse.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Simon Glass This function is useful to signal that the application needs to exit immediate. It can be caught with a debugger (e.g. gdb). Add a stub for it so that it can be called from within sandbox when an internal error occurs. Signed-off-by: Simon Glass Signed-off-by: Alexander Graf --- arch/sandbox/cpu/os.c | 5 +++++ include/os.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c index 3067503d51..9fbcb9ef92 100644 --- a/arch/sandbox/cpu/os.c +++ b/arch/sandbox/cpu/os.c @@ -631,3 +631,8 @@ void os_localtime(struct rtc_time *rt) rt->tm_yday = tm->tm_yday; rt->tm_isdst = tm->tm_isdst; } + +void os_abort(void) +{ + abort(); +} diff --git a/include/os.h b/include/os.h index 64e89a06c9..8fb9d309d0 100644 --- a/include/os.h +++ b/include/os.h @@ -330,4 +330,9 @@ int os_spl_to_uboot(const char *fname); */ void os_localtime(struct rtc_time *rt); +/** + * os_abort() - Raise SIGABRT to exit sandbox (e.g. to debugger) + */ +void os_abort(void); + #endif -- 2.12.3