From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12114 invoked by alias); 10 Nov 2013 23:46:00 -0000 Mailing-List: contact ecos-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-bugs-owner@sourceware.org Received: (qmail 12092 invoked by uid 89); 10 Nov 2013 23:45:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_20,RDNS_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: mail.ecoscentric.com Received: from Unknown (HELO mail.ecoscentric.com) (212.13.207.197) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Sun, 10 Nov 2013 23:45:58 +0000 Received: by mail.ecoscentric.com (Postfix, from userid 48) id 859EF4680002; Sun, 10 Nov 2013 23:45:49 +0000 (GMT) From: bugzilla-daemon@bugs.ecos.sourceware.org To: unassigned@bugs.ecos.sourceware.org Subject: [Bug 1001914] New: cyg_io_select behaves as "device ready" when the device driver actually doesn't support select? Date: Sun, 10 Nov 2013 23:46:00 -0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: eCos X-Bugzilla-Component: Other X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vlad_a_pudovkin@hotmail.com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: low X-Bugzilla-Assigned-To: unassigned@bugs.ecos.sourceware.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter cc Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://bugs.ecos.sourceware.org/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013/txt/msg00641.txt.bz2 Please do not reply to this email, use the link below. http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001914 Bug ID: 1001914 Summary: cyg_io_select behaves as "device ready" when the device driver actually doesn't support select? Product: eCos Version: 3.0 Target: All Architecture/Host Other OS: Status: UNCONFIRMED Severity: normal Priority: low Component: Other Assignee: unassigned@bugs.ecos.sourceware.org Reporter: vlad_a_pudovkin@hotmail.com CC: ecos-bugs@ecos.sourceware.org The cyg_io_select seems to be not covered by the official eCos reference guide; the only sort of "spec" I found for it was this snippet from the header packages/io/common//include/io.h: // Test a device for readiness cyg_bool cyg_io_select(cyg_io_handle_t handle, cyg_uint32 which, CYG_ADDRWORD info); The code of this function (file packages/io/common//src/iosys.c) seems to try to encode one "special value" into type cyg_bool: cyg_bool cyg_io_select(cyg_io_handle_t handle, cyg_uint32 which, CYG_ADDRWORD info) { cyg_devtab_entry_t *t = (cyg_devtab_entry_t *)handle; // Validate request if (!t->handlers->select) { return -EDEVNOSUPP; } return t->handlers->select( handle, which, info ); } There are two issues with this "special value": 1) This return statement issues a compiler warning like this: implicit conversion from 'int' to 'cyg_bool' (aka 'unsigned char') changes value from -202 to 54 2) It is somewhat confusing to have one peculiar "true" value to actually indicate an error while other "true" values mean that the device is ready. The whole ecos code does not seem to contain examples of using the return value of this function, which otherwise could help figuring out the "recommended" way of using that return value. This lack of cyg_io_select usage examples in the whole ecos code makes me wonder whether this is a widely used function or rather a work in progress? -- You are receiving this mail because: You are the assignee for the bug.