From: Samuel Thibault Subject: Re: [PATCH 3/12] VTPM mini-os: Add ioread() and iowrite() functions to mini-os Date: Sat, 12 Mar 2011 01:29:14 +0100 Message-ID: <20110312002914.GD4922@const.famille.thibault.fr> References: <4D7AA468.7000204@jhuapl.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Resent-Message-ID: <20110312013937.GI4922@const.famille.thibault.fr> Resent-To: xen-devel@lists.xensource.com Content-Disposition: inline In-Reply-To: <4D7AA468.7000204@jhuapl.edu> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Matthew Fioravante Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org Matthew Fioravante, le Fri 11 Mar 2011 17:38:32 -0500, a =E9crit : > Mini-os currently doesn't have very many facilities for reading and=20 > writing to hardware io memory. This patch addes a new header file=20 > iorw.h which when included gives access to > the ioread8(), iread32(), iowrite8(), iowrite32() family of functions.=20 > +void iowrite8(void* addr, uint8_t val) > +{ > + *((uint8_t*)addr) =3D val; > +} > +void iowrite32(void* addr, uint32_t val) > +{ > + *((uint32_t*)addr) =3D val; > +} Don't you need a volatile qualifier on the cast pointer to not let the compiler optimize it away? Samuel