From owner-freebsd-drivers@FreeBSD.ORG Mon Apr 27 15:44:52 2015 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B18B45D for ; Mon, 27 Apr 2015 15:44:52 +0000 (UTC) Received: from mail-wg0-x229.google.com (mail-wg0-x229.google.com [IPv6:2a00:1450:400c:c00::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 22D461632 for ; Mon, 27 Apr 2015 15:44:52 +0000 (UTC) Received: by wgen6 with SMTP id n6so120468932wge.3 for ; Mon, 27 Apr 2015 08:44:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=OkmRUMH93CqT6yNv+Rp8GQebwPY7ANylk3O/llYKk/M=; b=Dq/4jDlhbiZ5AanjMabXE3krqfqHCThfofEsQQjgftIjqyzIGPewzokkL9EBhj8r/H rVaB5fDae3uMuOdmMbxkrfgFdortQLlC18WxkJ6EG73Qz56lJSMZUGQjZoGvXvaH2efA e9Ca6UGPmr/d+w9K8DqOg3e53w4Vl37//SOUFoaQZesGVFL7hBcAIYbn5cvSxXqZN1Hi q9x+1XZapMeMgyAWmbng51tYJpZeFMZO0SdNn3jWioc1W9wUYQwdoIt9PLSriz5s31oi XwAaiXmzkJHA24UmGeG1WhsLiA5eEtDQoC3mThqcEHnCH8LQuzKNLhY78eolPW8lBLdR GbsA== MIME-Version: 1.0 X-Received: by 10.180.186.5 with SMTP id fg5mr21685241wic.60.1430149490423; Mon, 27 Apr 2015 08:44:50 -0700 (PDT) Received: by 10.27.219.14 with HTTP; Mon, 27 Apr 2015 08:44:50 -0700 (PDT) In-Reply-To: <1512772.cb4krpaZ39@ralph.baldwin.cx> References: <1512772.cb4krpaZ39@ralph.baldwin.cx> Date: Mon, 27 Apr 2015 12:44:50 -0300 Message-ID: Subject: Re: general question on interrupts handling From: =?UTF-8?Q?Mat=C3=ADas_Perret_Cantoni?= To: John Baldwin Cc: freebsd-drivers@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Apr 2015 15:44:52 -0000 2015-04-06 18:07 GMT-03:00 John Baldwin : > On Thursday, March 12, 2015 06:52:25 PM Mat=C3=ADas Perret Cantoni wrote: > > Hi! > > > > I'm writing my first interrupt handling routine of a newbus driver and > I'm > > not sure what things should I take care of in my ISR and what things th= e > > system will take care. > > > > I'm working on a Xilinx Zynq-7000 platform. I'm generating a Shared > > Peripheral Interrupt from the FPGA. > > > > For example... > > ... do I have to disable interrupts upon entering my ISR and enable the= m > > again before returning, o FreeBSD does it for me? > > ... do I have to clear the GIC interrupt status of my interrupt or the > > systems does it automatically when my routine returns? > > > > Please excuse me if this is too general or silly. If you can point me > any > > documentation or sources to read, It'd be great. > > For a regular interrupt handler that runs in an thread context, the syste= m > will generally mask your device's interrupt until the interrupt thread is > scheduled and runs your handler. After your handler returns the interrup= t > will be unmasked. > > For a filter interrupt handler that does not run in an interrupt thread > context, no masking is done and you generally need to mask the interrupt > yourself using a device-specific register if you cannot fully handle the > interrupt in the filter routine. > > -- > John Baldwin > > Thank you John! Regards.