lkml.org 
[lkml]   [2012]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] ix86: adjust asm constraints in atomic64 wrappers
On 01/18/2012 06:22 AM, Jan Beulich wrote:
>
> +#ifndef __ATOMIC64_EXPORT
> +/*
> + * Don't declare these as functions, even though they are - due to their
> + * non-standard calling conventions they can't be called by C code anyway.
> + */
> +#define __ATOMIC64_EXPORT(sym) extern const atomic64_t atomic64_##sym[]
> +#endif
> +

This is obviously bogus. They are still functions even if they are not
callable by C. In particular, they are NOT in any shape, way, or form
arrays of type const atomic64_t; if you want to assign them to a
"generic memory type" they would be const char, but there is no reason
to declare them as anything other than executable code. Yes, it would
be wrong to call them, but so would calling any other function that is
inappropriate.

For functions with nonstandard calling conventions it is normal to
declare them as void foo(void);

It may be a good idea to prefix these symbols with __ though.

-hpa

--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.



\
 
 \ /
  Last update: 2012-01-18 17:47    [W:0.058 / U:0.460 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site