From: Hollis Blanchard Subject: __function API Date: Thu, 17 Mar 2005 13:12:14 -0600 Message-ID: <200503171312.14183.hollisb@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Sender: xen-devel-admin@lists.sourceforge.net Errors-To: xen-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: xen-devel@lists.sourceforge.net List-Id: xen-devel@lists.xenproject.org [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 include/asm-x86/shadow.h: #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. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click