From: Ian Campbell Subject: Re: minios, use of namespace Date: Wed, 19 Jun 2013 16:54:51 +0100 Message-ID: <1371657291.22783.179.camel@zakaz.uk.xensource.com> References: <20929.54006.427511.235263@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20929.54006.427511.235263@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: Samuel Thibault , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Wed, 2013-06-19 at 16:49 +0100, Ian Jackson wrote: > For a while I've been intending to provide a better environment for PV > baremetal guests. The current arrangements, based on newlib, take > quite a bit of porting for many programs. My plan is to take the > FreeBSD libc, and write a set of functions implementing the "system > calls" in terms of facilities provided by the Xen PV environment, > frontend drivers, etc. > > As part of this I intend to reuse much if not all of > xen.git/extras/mini-os. However, there is a difficulty with this: the > functions there have very generic names which if nothing is done will > get in the way of porting applications. > > It might be possible to deal with this by symbol hiding - except for > the fact that some applications will want to "open the hatch" and > bypass the provided POSIX API to deal with Xen features directly. The > alternative would be to write an emulated gntdev with an emulated > ioctl etc., which would just be grim. > > So I think the best solution is to rename the functions in minios to > use names starting with _. External symbols starting with _ are > reserved (by the C specification) for "the implementation", which is > what we are. Would it also be usual/helpful to provide a minios-gntdev.h with just a load of #define gntdev_foo _gntdev_foo To make code used by folks opening the hatch a little bit less odd looking or indeed for internal users of the functions... > > I will also probably find that I want to #ifdef out some bits of > minios, but I don't expect that to be particularly controversial. > > All the changes I make will, when I submit them as a proper patch > series, come with corresponding changes to the in-tree consumers of > minios. > > I won't be producing a patch series to do this particularly soon, but > I thought I should mention this plan here to see if anyone objects. > CCing Samuel who knows most about the existing minios and stubdom > arrangements. > > Thanks, > Ian. > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel