From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23467 invoked by alias); 27 Mar 2011 12:45:20 -0000 Received: (qmail 23449 invoked by uid 22791); 27 Mar 2011 12:45:19 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-fx0-f49.google.com (HELO mail-fx0-f49.google.com) (209.85.161.49) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 27 Mar 2011 12:45:12 +0000 Received: by fxm14 with SMTP id 14so1749852fxm.36 for ; Sun, 27 Mar 2011 05:45:11 -0700 (PDT) Received: by 10.223.73.133 with SMTP id q5mr884251faj.127.1301229911448; Sun, 27 Mar 2011 05:45:11 -0700 (PDT) Received: from sg-laptop ([178.123.254.201]) by mx.google.com with ESMTPS id j12sm1077702fax.9.2011.03.27.05.45.08 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 27 Mar 2011 05:45:09 -0700 (PDT) Date: Sun, 27 Mar 2011 12:45:00 -0000 From: Sergei Gavrikov To: Ilija Kocho cc: ecos-devel@ecos.sourceware.org Subject: Re: tty.cdl In-Reply-To: <4D8F2207.7070701@siva.com.mk> Message-ID: References: <4D8DBE3F.2000708@siva.com.mk> <4D8F2207.7070701@siva.com.mk> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-IsSubscribed: yes Mailing-List: contact ecos-devel-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-devel-owner@ecos.sourceware.org X-SW-Source: 2011-03/txt/msg00027.txt.bz2 On Sun, 27 Mar 2011, Ilija Kocho wrote: > On 26.03.2011 19:32, Sergei Gavrikov wrote: > > On Sat, 26 Mar 2011, Ilija Kocho wrote: > > > >> Hello colleagues > >> > >> I need to extend tty.cdl in order to accommodate more than 4 serial > >> ports, currently I need 6. I can simply add 2 port entries but i would > >> prefer something like the snippet below. Either case I am ready to post > >> to Bugzilla. > >> Note: Similar case is with termios.cdl > >> > >> Please advise. > > > > Hi Ilija, > > > > It seems your issue cannot be solved by editing the config files *only*. > > There are a couple of hardwired conditional definitions for device table > > entries there, take a look at > > > > $ECOS_REPOSITORY/io/serial//src/common/tty.c > > $ECOS_REPOSITORY/io/serial//src/common/termiostty.c > > > > > > Sergei > Hi Sergei > > Thanks for the notes. I tried to extend this concept to tty.c, please > see attached CDL. Here are my questions. > > 1. The proc output is in io-serial.h and is protected to instantiate in > only file that defines __CYGSEM_FILE_IS_IO_SERIAL_COMMON_TTY_C (tty.c) > I would ask if it is possible to redirect puts to other file? Hi Ilija, I get it (about your attempting to build the in-lines using CDL), but, I would keep things simpler, i.e. just would add two absent entries for TTY4, TTY5, TTYx in tty.c. Those are conditional definitions depend on cdl_component CYGPKG_IO_SERIAL_TTY_TTYx { user_value 1 }; such things define itself if user enables TTYx pkgconf/io_serial.h: #define CYGPKG_IO_SERIAL_TTY_TTYx 1 #define CYGDAT_IO_SERIAL_TTY_TTYx_DEV "/dev/serX" otherwise auto-generated io_serial.h header has no such definitions. Right? I dislike a complicated Tcl programming in eCos config files (however, this is mine). I tried such thing in config file if {! [info exist ::env(ECOS_MAX_TTY_DEVS)]} {;# check env variable set ::max_tty_devs 4 } { set ::max_tty_devs $::env(ECOS_MAX_TTY_DEVS) } for { set ::device 0 } { $::device < $::max_tty_devs } { incr ::device } { cdl_component CYGPKG_IO_SERIAL_TTY_TTY[set ::device] { display "TTY mode channel #[set ::device]" flavor bool default_value 0 ... and if I've configured eCos as % env ECOS_MAX_TTY_DEVS=6 ecosconfig new % env ECOS_MAX_TTY_DEVS=6 ecosconfig tree I got 6 definitions for TTYs in eCos config. So, it was needed to add 2 new entries in tty.c *only* (just c&p) to get things spin. Well, I tried % export ECOS_MAX_TTY_DEVS=6 configtool and, I've seen in CT -[*] TTY mode serial device drivers ... + [ ] TTY mode for channel #0 ... + [ ] TTY mode for channel #5 + [ ] TTY mode for channel #6 However, I have nothing against hardwired iterators in {,termios}tty.cdl For six? eight ports? for { set ::device 0 } { $::device < 6 } { incr ::device } { ... In any cases user should enable the Nth serial port for TTY/TERMIOS to get the record in pkgconf/io_serial.h and this header is included in tty.c and termiostty.c sources. Sergei