From owner-freebsd-arch@FreeBSD.ORG Tue Jun 18 10:59:34 2013 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C87573A1; Tue, 18 Jun 2013 10:59:34 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-qa0-x22c.google.com (mail-qa0-x22c.google.com [IPv6:2607:f8b0:400d:c00::22c]) by mx1.freebsd.org (Postfix) with ESMTP id 7930B1F64; Tue, 18 Jun 2013 10:59:34 +0000 (UTC) Received: by mail-qa0-f44.google.com with SMTP id j8so2092829qah.10 for ; Tue, 18 Jun 2013 03:59:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=0RQHGj2Lzwr0dPPbQinFWM3NcAQlSwkc1UJUpHeS0yk=; b=1CngH+Iv1R5EDH8bbw1/0LmKP77JubJLbaFme9qcwWZxo98QEo/L7FhtPa5jD9lNMS wx69COlOGLiG8ziM3jCf3TVsLGrq5KLzmMW02KeNEZB7hqbbuO9FmMxQfrZp3Xb7KPMF EHfzuCkSAxVYO/pDog71NB9pwAWZLt26QdJ0WjbSgjfYHfmQp9f9PgrsSTahdDCIT+/j kbAv50j6QcQVwROQCvzIYD3mAinMsubH0E8Sg+iFgp9JqNZU4U1+EWi0z/xnhjT/Ryg/ LDtvnlAUIGWuj3wOGupMBFHPZnWE+xa2TFVmNfs4NGjZeObfTq7IaJLR0zHg+2WnooPe oNqg== MIME-Version: 1.0 X-Received: by 10.229.144.14 with SMTP id x14mr2071439qcu.36.1371553173944; Tue, 18 Jun 2013 03:59:33 -0700 (PDT) Sender: rmh.aybabtu@gmail.com Received: by 10.49.117.3 with HTTP; Tue, 18 Jun 2013 03:59:33 -0700 (PDT) In-Reply-To: References: <51C0345E.4000309@freebsd.org> Date: Tue, 18 Jun 2013 12:59:33 +0200 X-Google-Sender-Auth: RCkbE2BYAhmYV2bs3AWFXvmpp7M Message-ID: Subject: Re: Bus space routines From: Robert Millan To: Niclas Zeising , Bruce Evans Content-Type: text/plain; charset=UTF-8 Cc: arch@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 10:59:34 -0000 2013/6/18 Robert Millan : > static __inline void > bus_space_write_1(bus_space_tag_t tag, bus_space_handle_t bsh, > bus_size_t offset, u_int8_t value) > { > > if (tag == X86_BUS_SPACE_IO) > outb(bsh + offset, value); > else > *(volatile u_int8_t *)(bsh + offset) = value; > } > > So why not just use those? It seems very natural to me that if you > have something which is unambigous and reliable, you use this instead > of something else which is prone to nasty errors. (Yes, I'm aware that GNU systems in general don't have this, and that using bus_space_* would introduce a portability nuissance, but IMHO this is much better than encouraging them to use the non-portable from Glibc right away. At least this forces them to think about what they're doing) -- Robert Millan