This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-devel] __function API

To: xen-devel@xxxxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] __function API
From: Hollis Blanchard <hollisb@xxxxxxxxxx>
Date: Thu, 17 Mar 2005 13:12:14 -0600
Delivery-date: Thu, 17 Mar 2005 19:46:41 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-archive: <http://sourceforge.net/mailarchive/forum.php?forum=xen-devel>
List-help: <mailto:xen-devel-request@lists.sourceforge.net?subject=help>
List-id: List for Xen developers <xen-devel.lists.sourceforge.net>
List-post: <mailto:xen-devel@lists.sourceforge.net>
List-subscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=subscribe>
List-unsubscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=unsubscribe>
Sender: xen-devel-admin@xxxxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.7.2
[resending to the still-active list]

I have a question about function naming conventions in headers. I've been 
assuming that the __ prefix means "internal", i.e. not really part of the 
exported API of a header. But I see code like this in 

#define __translate_gpfn_to_mfn(_d, gpfn)              \
    ( (shadow_mode_translate(_d))                      \
      ? translate_gpfn_to_mfn(_d, gpfn)                \
      : (gpfn) )

static inline unsigned long
translate_gpfn_to_mfn(struct domain *rd, unsigned long gpfn)

In this case, __translate_gpfn_to_mfn() is the *only* thing called by common 
code. translate_gpfn_to_mfn() is not.

Another example is _domain in asm-x86/mm.h: it's used in common/page_alloc.c.

As I implement the arch->common API, I've been skipping the __functions, but 
it seems many of them are in fact part of that API (while many others are 
not). In general is it ok for common code to call __functions provided by 
architecture headers, or should that be considered a bug?

Hollis Blanchard
IBM Linux Technology Center

SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>