minios, use of namespace
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.
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.
Quoted 18 lines · Ian Jackson
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.
Quoted 4 lines
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...
Quoted 20 lines
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
[email protected]
http://lists.xen.org/xen-devel
Ian Campbell writes ("Re: [Xen-devel] minios, use of namespace"):
Quoted 6 lines · Ian Jackson
Quoted 4 lines
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.
Quoted 6 lines
Would it also be usual/helpful to provide a
minios-gntdev.hwith just a load of
#definegntdev_foo_gntdev_fooTo make code used by folks opening the hatch a little bit less odd looking or indeed for internal users of the functions...
That would be quite plausible.
Ian.
Quoted 2 lines · Ian Jackson, le Wed 19 Jun 2013 16:49:10 +0100, a écrit :
So I think the best solution is to rename the functions in minios to use names starting with _.
While renaming things, I'd even say put a "minios" prefix, otherwise the conflict risk is still significant.
Quoted 3 lines
External symbols starting with _ are
reserved (by the C specification) for "the implementation", which is what we are.
That's unfortunately theory which is not so strictly applied.
Samuel