From patchwork Fri Jun 22 12:44:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 139611 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp831057lji; Fri, 22 Jun 2018 05:46:13 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJYGM76a5YAFoz74ENUJUFf37FQCNqvEy1eOXJrVEZhqhJ+2E4dsR2eeBpZmebp9mbp529B X-Received: by 2002:a50:9772:: with SMTP id d47-v6mr1768319edb.174.1529671573069; Fri, 22 Jun 2018 05:46:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529671573; cv=none; d=google.com; s=arc-20160816; b=xO/UEU9D4VIVTuYBLomxZ8V/IheXtm4XlUZZckwLZblRORjvHwrBfxCKJhaG/qj/lg FL2jk0Bn2FChz9YPm3JF0Zud7+QklOdLzZ7UdLS59vb1+AHGGmryKH+o5LHVweBrfaKv 7gG+54aY9XtpOIKFIAYraOp3eDK3OdqP3EUU3hvbcVtn+Bw7DaJxn3kPUVpana54vU/v ruP6OOOxswJiaLVX1YP4vVdU1v4gBReTbH6emdSzkNe2IQWijjbV8EOvVkyKVIg+vffG +vqYWDhpfiyH+UKi02+OBMDgP1OV7tnBFFvt1ti6i38qmOFcQeo91zQeileOsVx5tLoF Sbfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:arc-authentication-results; bh=yPEUlUDlkVKnJLK7CCyZ1uE9cyS+bc3n7BCsw7FlFoE=; b=yTv8iaJwRW9gg2UQtuVwey2xit/LkVGahB/DufbAgHFBy8IzFH7X7I37JjVNzDkC4r //wqSAzwaP8cylbgHhZx7QYkAzmQ3g26dEO15pd/JG3dE8boUqMjOZCFuvAz8eETkRkM IiXqqtX7vDofvN7EdHUZVbCVwDzn2n/9VYHjdK77BtYdADkxp5h4q4xoeADz1/JgGIh7 baHWP6PTpLzJ1HgjtLO/eWUPNhxOH5Ij4FXUW7VKZ/YZcBuUFbs458rxw4T87gvIR12/ fc2AiAYwovTbrJgMJUVXfk7SSdstSL53Z8uzKjvvwgahw4Q8EhyEMEdSWZ+AM3H3vOGJ XPSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id x4-v6si527971edx.103.2018.06.22.05.46.12; Fri, 22 Jun 2018 05:46:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 9616FC21F6E; Fri, 22 Jun 2018 12:45:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 825CEC21F79; Fri, 22 Jun 2018 12:44:24 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 41CA2C21C50; Fri, 22 Jun 2018 12:44:21 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id B63AAC21EF1 for ; Fri, 22 Jun 2018 12:44:20 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id F1416AF39; Fri, 22 Jun 2018 12:44:19 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Fri, 22 Jun 2018 14:44:16 +0200 Message-Id: <20180622124418.52892-9-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180622124418.52892-1-agraf@suse.de> References: <20180622124418.52892-1-agraf@suse.de> Cc: Heinrich Schuchardt , Andy Shevchenko Subject: [U-Boot] [PATCH v5 08/10] sandbox: Add support for calling abort() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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