From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 4 10:18:54 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5378A16A41F for ; Thu, 4 Aug 2005 10:18:54 +0000 (GMT) (envelope-from Felix-KM@yandex.ru) Received: from mfront8.yandex.ru (mfront8.yandex.ru [213.180.200.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id EB8F643D45 for ; Thu, 4 Aug 2005 10:18:53 +0000 (GMT) (envelope-from Felix-KM@yandex.ru) Received: from YAMAIL (mfront8.yandex.ru) by mail.yandex.ru id ; Thu, 4 Aug 2005 14:18:33 +0400 Date: Thu, 4 Aug 2005 14:18:33 +0400 (MSD) From: "Felix-KM" Sender: Felix-KM@yandex.ru Message-Id: <42F1EB79.000002.18984@mfront8.yandex.ru> MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] Errors-To: Felix-KM@yandex.ru To: NKoch@demig.de In-Reply-To: <000001c598c8$e4045ee0$4801a8c0@ws-ew-3.W2KDEMIG> References: <000001c598c8$e4045ee0$4801a8c0@ws-ew-3.W2KDEMIG> X-Source-Ip: 82.179.191.126 X-Originating-Ip: unknown Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: RE: (no subject) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Felix-KM@yandex.ru List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Aug 2005 10:18:54 -0000 >> #define DEVICE2SOFTC(device) ((struct dev_softc >> *)device_get_softc(device)) >> >> static void dev_intr(void *arg); >> >> struct dev_softc { >> ... >> int rid_irq; >> struct resource* res_irq; >> void *intr_cookie; >> ... >> }; >> >> static int >> dev_attach(device_t device) >> { >> ... >> >> dev_sc->rid_irq = 0; >> dev_sc->res_irq = bus_alloc_resource_any(device, SYS_RES_IRQ, >> &(dev_sc->rid_irq), >> RF_SHAREABLE|RF_ACTIVE); >> if (dev_sc->res_irq == NULL) >> { >> uprintf("!!! Could not map interrupt !!!\n"); >> goto fail; >> } >> >> if (bus_setup_intr(device, dev_sc->res_irq, INTR_TYPE_TTY, >> dev_intr, dev_sc, &dev_sc->intr_cookie)) >> { >> uprintf("!!! Could not setup irq !!!\n"); >> goto fail; >> } >> >> ... >> >> fail: >> return ENXIO; >> } >> >> static int >> dev_detach(device_t device) >> { >> struct dev_softc *dev_sc = DEVICE2SOFTC(device); >> >> destroy_dev(dev_sc->device); >> >> if (bus_teardown_intr(device, dev_sc->res_irq, >> dev_sc->intr_cookie) != 0); > >!!!! Do you see that semicolon? !!!! > > >Norbert > > Oops... I am ashamed for my inattention... Thank you very much...