From patchwork Mon Oct 4 08:47:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Marie de Rodat X-Patchwork-Id: 1535992 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=F6gQirDK; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HNDwD4yfGz9t54 for ; Mon, 4 Oct 2021 19:51:24 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 83DB63858007 for ; Mon, 4 Oct 2021 08:51:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 83DB63858007 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1633337482; bh=CjP2cg2//Q26RWW9HjaNNpmdVvQlceez/+wfHkqEwyw=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=F6gQirDKFPxIA50ruvRCJtnvzBwedd4exJn0NuXLLFY3j4fRs4yaHmqcdm3tdCctX wWb42AmEr4vEUmGd8cLgrW9+mjwyuPBHO/zRzrXmifmM7oaSp1GgcOC7mMS8M80uB8 eWAPQmtiMNl85/aEsJm0U1frnDTCfJZS/2rN8KoY= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by sourceware.org (Postfix) with ESMTPS id 845DE385840B for ; Mon, 4 Oct 2021 08:47:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 845DE385840B Received: by mail-lf1-x130.google.com with SMTP id e15so68448186lfr.10 for ; Mon, 04 Oct 2021 01:47:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=CjP2cg2//Q26RWW9HjaNNpmdVvQlceez/+wfHkqEwyw=; b=eIcIVLS4nUdO1ApRKyoLosaHwJGp8oU/tiPw+ZmFpWJbmfGxJm8eHRcp2Kksg7svwY wF3ItmOWBtZ1NsLS27K1yY0JzQKJ0nVh9sO3JRuxHfOgciTor9SMAjl+aEO/OukSyzKi CS8t3GH80nOzNVlUp5TMoYbtsa5BDMEy5S/i6Q8Msi7Vq+ANgdPURZGQFbZMLmcj5+to WHjVgSm+X34XHS4d22Za2P6WiXAo1VBwwrkUC2KvjZwS142jbGyByfw6vSRePSBuItc4 EcnSm/IXek3vXEyRbJVw9zIHFi/GcY8yafTw3NQ4QfAMjQdMPdOW5vGP7B9OxiJxrm+U g0iA== X-Gm-Message-State: AOAM533d9M0UgyNzhpr0yw9iaCvy+UK5awOinneYyAHRCo8LBX8t16pi sQsOhho1W0JG04+A9As9FCILad4WMGMb6g== X-Google-Smtp-Source: ABdhPJyWj5WexzFFnauG8Rb9zY80K2U2/cygdnD0KGGbbKqbEItGX2YVVzQISApI2IWdTrHLFrR8Qg== X-Received: by 2002:a05:651c:1549:: with SMTP id y9mr15426671ljp.105.1633337256427; Mon, 04 Oct 2021 01:47:36 -0700 (PDT) Received: from adacore.com ([2a02:2ab8:224:2ce:72b5:e8ff:feef:ee60]) by smtp.gmail.com with ESMTPSA id l2sm1543628lfe.1.2021.10.04.01.47.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Oct 2021 01:47:35 -0700 (PDT) Date: Mon, 4 Oct 2021 08:47:34 +0000 To: gcc-patches@gcc.gnu.org Subject: [Ada] VxWorks inconsistent use of return type Fixup Message-ID: <20211004084734.GA1536272@adacore.com> MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Pierre-Marie de Rodat via Gcc-patches From: Pierre-Marie de Rodat Reply-To: Pierre-Marie de Rodat Cc: Doug Rupp Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Fix STATUS and int return types for Vxworks6 in legacy. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnarl/s-osinte__vxworks.ads (tlsKeyCreate): Return int. * libgnarl/s-tpopsp__vxworks-rtp.adb (ERROR): Declare from System.VxWorks.Ext.ERROR. (Initialize): Declare IERR. Assert it. * libgnarl/s-tpopsp__vxworks.adb (ERROR): Declare from System.VxWorks.Ext.ERROR. (Is_Valid_Task): Declare IERR. Test return. * libgnarl/s-vxwext__kernel.adb (semDelete): Return STATUS. diff --git a/gcc/ada/libgnarl/s-osinte__vxworks.ads b/gcc/ada/libgnarl/s-osinte__vxworks.ads --- a/gcc/ada/libgnarl/s-osinte__vxworks.ads +++ b/gcc/ada/libgnarl/s-osinte__vxworks.ads @@ -340,7 +340,7 @@ package System.OS_Interface is -- Can only be called from the VxWorks 6 run-time libary that supports -- tlsLib, and not by the VxWorks 6.6 SMP library - function tlsKeyCreate return STATUS; + function tlsKeyCreate return int; pragma Import (C, tlsKeyCreate, "tlsKeyCreate"); function tlsValueGet (key : int) return System.Address; diff --git a/gcc/ada/libgnarl/s-tpopsp__vxworks-rtp.adb b/gcc/ada/libgnarl/s-tpopsp__vxworks-rtp.adb --- a/gcc/ada/libgnarl/s-tpopsp__vxworks-rtp.adb +++ b/gcc/ada/libgnarl/s-tpopsp__vxworks-rtp.adb @@ -35,6 +35,8 @@ separate (System.Task_Primitives.Operations) package body Specific is + ERROR : constant STATUS := System.VxWorks.Ext.ERROR; + ATCB_Key : int := 0; -- Key used to find the Ada Task_Id associated with a thread @@ -43,9 +45,10 @@ package body Specific is ---------------- procedure Initialize is + IERR : constant := -1; begin ATCB_Key := tlsKeyCreate; - pragma Assert (ATCB_Key /= ERROR); + pragma Assert (ATCB_Key /= IERR); end Initialize; ------------------- diff --git a/gcc/ada/libgnarl/s-tpopsp__vxworks.adb b/gcc/ada/libgnarl/s-tpopsp__vxworks.adb --- a/gcc/ada/libgnarl/s-tpopsp__vxworks.adb +++ b/gcc/ada/libgnarl/s-tpopsp__vxworks.adb @@ -35,6 +35,8 @@ separate (System.Task_Primitives.Operations) package body Specific is + ERROR : constant STATUS := System.VxWorks.Ext.ERROR; + ATCB_Key : aliased System.Address := System.Null_Address; -- Key used to find the Ada Task_Id associated with a thread @@ -70,8 +72,9 @@ package body Specific is ------------------- function Is_Valid_Task return Boolean is + IERR : constant := -1; begin - return taskVarGet (taskIdSelf, ATCB_Key'Access) /= ERROR; + return taskVarGet (taskIdSelf, ATCB_Key'Access) /= IERR; end Is_Valid_Task; --------- diff --git a/gcc/ada/libgnarl/s-vxwext__kernel.adb b/gcc/ada/libgnarl/s-vxwext__kernel.adb --- a/gcc/ada/libgnarl/s-vxwext__kernel.adb +++ b/gcc/ada/libgnarl/s-vxwext__kernel.adb @@ -59,7 +59,7 @@ package body System.VxWorks.Ext is --------------- function semDelete (Sem : SEM_ID) return STATUS is - function Os_Sem_Delete (Sem : SEM_ID) return int; + function Os_Sem_Delete (Sem : SEM_ID) return STATUS; pragma Import (C, Os_Sem_Delete, "semDelete"); begin return Os_Sem_Delete (Sem);