From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 129537 invoked by alias); 8 Jul 2019 08:19:14 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 128901 invoked by uid 89); 8 Jul 2019 08:19:10 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.2 required=5.0 tests=BAYES_20,GIT_PATCH_2,GIT_PATCH_3,SPF_NEUTRAL autolearn=ham version=3.3.1 spammy=rates, Bob, bob, U*duff X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (209.51.188.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 08 Jul 2019 08:19:08 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hkOrX-0002Sh-Bb for gcc-patches@gcc.gnu.org; Mon, 08 Jul 2019 04:19:04 -0400 Received: from rock.gnat.com ([2620:20:4000:0:a9e:1ff:fe9b:1d1]:50367) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hkOrX-0002N6-42 for gcc-patches@gcc.gnu.org; Mon, 08 Jul 2019 04:19:03 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 0A34356184; Mon, 8 Jul 2019 04:19:00 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id dQpYxYqoWn9I; Mon, 8 Jul 2019 04:18:59 -0400 (EDT) Received: from tron.gnat.com (tron.gnat.com [IPv6:2620:20:4000:0:46a8:42ff:fe0e:e294]) by rock.gnat.com (Postfix) with ESMTP id 665A756187; Mon, 8 Jul 2019 04:18:58 -0400 (EDT) Received: by tron.gnat.com (Postfix, from userid 4862) id 653E3602; Mon, 8 Jul 2019 04:18:58 -0400 (EDT) Date: Mon, 08 Jul 2019 08:36:00 -0000 From: Pierre-Marie de Rodat To: gcc-patches@gcc.gnu.org Cc: Bob Duff Subject: [Ada] More data rates supported on Linux Message-ID: <20190708081858.GA80668@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="zhXaljGHf11kAtnf" Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 2620:20:4000:0:a9e:1ff:fe9b:1d1 X-IsSubscribed: yes X-SW-Source: 2019-07/txt/msg00550.txt.bz2 --zhXaljGHf11kAtnf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 298 This patch adds additional data rates to the GNAT.Serial_Communications package (Linux version). Tested on x86_64-pc-linux-gnu, committed on trunk 2019-07-08 Bob Duff gcc/ada/ * libgnat/g-sercom.ads, libgnat/g-sercom__linux.adb (Data_Rate): Support additional data rates. --zhXaljGHf11kAtnf Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="patch.diff" Content-length: 4753 --- gcc/ada/libgnat/g-sercom.ads +++ gcc/ada/libgnat/g-sercom.ads @@ -100,8 +100,13 @@ package GNAT.Serial_Communications is -- cases, an explicit port name can be passed directly to Open. type Data_Rate is - (B75, B110, B150, B300, B600, B1200, B2400, B4800, B9600, - B19200, B38400, B57600, B115200); + (B75, B110, B150, B300, B600, B1200, + B2400, B4800, B9600, + B19200, B38400, B57600, B115200, + B230400, B460800, B500000, B576000, B921600, + B1000000, B1152000, B1500000, + B2000000, B2500000, B3000000, + B3500000, B4000000); -- Speed of the communication type Data_Bits is (CS8, CS7); @@ -173,18 +178,31 @@ private end record; Data_Rate_Value : constant array (Data_Rate) of Interfaces.C.unsigned := - (B75 => 75, - B110 => 110, - B150 => 150, - B300 => 300, - B600 => 600, - B1200 => 1_200, - B2400 => 2_400, - B4800 => 4_800, - B9600 => 9_600, - B19200 => 19_200, - B38400 => 38_400, - B57600 => 57_600, - B115200 => 115_200); + (B75 => 75, + B110 => 110, + B150 => 150, + B300 => 300, + B600 => 600, + B1200 => 1_200, + B2400 => 2_400, + B4800 => 4_800, + B9600 => 9_600, + B19200 => 19_200, + B38400 => 38_400, + B57600 => 57_600, + B115200 => 115_200, + B230400 => 230_400, + B460800 => 460_800, + B500000 => 500_000, + B576000 => 576_000, + B921600 => 921_600, + B1000000 => 1_000_000, + B1152000 => 1_152_000, + B1500000 => 1_500_000, + B2000000 => 2_000_000, + B2500000 => 2_500_000, + B3000000 => 3_000_000, + B3500000 => 3_500_000, + B4000000 => 4_000_000); end GNAT.Serial_Communications; --- gcc/ada/libgnat/g-sercom__linux.adb +++ gcc/ada/libgnat/g-sercom__linux.adb @@ -58,19 +58,32 @@ package body GNAT.Serial_Communications is pragma Import (C, fcntl, "fcntl"); C_Data_Rate : constant array (Data_Rate) of unsigned := - (B75 => OSC.B75, - B110 => OSC.B110, - B150 => OSC.B150, - B300 => OSC.B300, - B600 => OSC.B600, - B1200 => OSC.B1200, - B2400 => OSC.B2400, - B4800 => OSC.B4800, - B9600 => OSC.B9600, - B19200 => OSC.B19200, - B38400 => OSC.B38400, - B57600 => OSC.B57600, - B115200 => OSC.B115200); + (B75 => OSC.B75, + B110 => OSC.B110, + B150 => OSC.B150, + B300 => OSC.B300, + B600 => OSC.B600, + B1200 => OSC.B1200, + B2400 => OSC.B2400, + B4800 => OSC.B4800, + B9600 => OSC.B9600, + B19200 => OSC.B19200, + B38400 => OSC.B38400, + B57600 => OSC.B57600, + B115200 => OSC.B115200, + B230400 => OSC.B230400, + B460800 => OSC.B460800, + B500000 => OSC.B500000, + B576000 => OSC.B576000, + B921600 => OSC.B921600, + B1000000 => OSC.B1000000, + B1152000 => OSC.B1152000, + B1500000 => OSC.B1500000, + B2000000 => OSC.B2000000, + B2500000 => OSC.B2500000, + B3000000 => OSC.B3000000, + B3500000 => OSC.B3500000, + B4000000 => OSC.B4000000); C_Bits : constant array (Data_Bits) of unsigned := (CS7 => OSC.CS7, CS8 => OSC.CS8); --zhXaljGHf11kAtnf--