All of lore.kernel.org
 help / color / mirror / Atom feed
* incompatible prototypes
@ 2007-04-27  8:23 PUCCETTI Armand
  2007-04-27  8:34 ` Keir Fraser
  0 siblings, 1 reply; 7+ messages in thread
From: PUCCETTI Armand @ 2007-04-27  8:23 UTC (permalink / raw)
  To: xen-devel

In XEN 3.0.3, some functions have prototypes incompatible with their
body:

- prototype fct "asmlinkage void do_nmi(struct cpu_user_regs *regs)"
in svm.c:57 is incompatible with body in traps.c:1608
- same for fct "do_memory_op" in hypercall.h:46 and memory.c:511 resp.
- same for functions "cyrix_init_mtrr", "centaur_init_mtrr" and 
"amd_init_mtrr"

perhaps due to porting from x86 to x86_64...

Also, it seems that in the declaration part (file vmx.c:1966) of the 
following fct, some
extern are missing, and that the functions smp_event_check_interrupt and 
smp_call_function_interrupt
are also incompatible with their body (in file smp.c:326 and smp.c:332)

static inline void vmx_vmexit_do_extint(struct cpu_user_regs *regs)
{
    unsigned int vector;
    int error;
    asmlinkage void do_IRQ(struct cpu_user_regs *);
    fastcall void smp_apic_timer_interrupt(struct cpu_user_regs *);
    extern fastcall void smp_event_check_interrupt(void);
    fastcall void smp_invalidate_interrupt(void);
    extern fastcall void smp_call_function_interrupt(void);
    fastcall void smp_spurious_interrupt(struct cpu_user_regs *regs);
    fastcall void smp_error_interrupt(struct cpu_user_regs *regs);
...
Armand

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: incompatible prototypes
  2007-04-27  8:23 incompatible prototypes PUCCETTI Armand
@ 2007-04-27  8:34 ` Keir Fraser
  2007-04-27 15:51   ` PUCCETTI Armand
  0 siblings, 1 reply; 7+ messages in thread
From: Keir Fraser @ 2007-04-27  8:34 UTC (permalink / raw)
  To: PUCCETTI Armand, xen-devel




On 27/4/07 09:23, "PUCCETTI Armand" <armand.puccetti@cea.fr> wrote:

> Also, it seems that in the declaration part (file vmx.c:1966) of the
> following fct, some
> extern are missing, and that the functions smp_event_check_interrupt and
> smp_call_function_interrupt
> are also incompatible with their body (in file smp.c:326 and smp.c:332)

Extern is optional on function prototypes. Asmlinkage defines away to
nothing. So there's a lack of consistency, but nothing incorrect.

 -- Keir

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: incompatible prototypes
  2007-04-27  8:34 ` Keir Fraser
@ 2007-04-27 15:51   ` PUCCETTI Armand
  2007-04-27 16:09     ` Keir Fraser
  0 siblings, 1 reply; 7+ messages in thread
From: PUCCETTI Armand @ 2007-04-27 15:51 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel

Keir Fraser a écrit :
>
> On 27/4/07 09:23, "PUCCETTI Armand" <armand.puccetti@cea.fr> wrote:
>
>   
>> Also, it seems that in the declaration part (file vmx.c:1966) of the
>> following fct, some
>> extern are missing, and that the functions smp_event_check_interrupt and
>> smp_call_function_interrupt
>> are also incompatible with their body (in file smp.c:326 and smp.c:332)
>>     
>
> Extern is optional on function prototypes. Asmlinkage defines away to
> nothing. So there's a lack of consistency, but nothing incorrect.
>
>  -- Keir
>
>
>
>   
You're quite right on the first point. However the incompatible prototypes
might lead to errors if some of these functions are called.

Armand

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: incompatible prototypes
  2007-04-27 15:51   ` PUCCETTI Armand
@ 2007-04-27 16:09     ` Keir Fraser
  2007-04-27 16:18       ` Jeremy Fitzhardinge
  0 siblings, 1 reply; 7+ messages in thread
From: Keir Fraser @ 2007-04-27 16:09 UTC (permalink / raw)
  To: PUCCETTI Armand; +Cc: xen-devel




On 27/4/07 16:51, "PUCCETTI Armand" <armand.puccetti@cea.fr> wrote:

> You're quite right on the first point. However the incompatible prototypes
> might lead to errors if some of these functions are called.

__attribute__((regparm(0))) is the default for i386 anyway. Really
asmlinkage should define to nothing for all x86 architectures, and we can
just kill off all use of asmlinkage under arch/x86.

 -- Keir

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: incompatible prototypes
  2007-04-27 16:09     ` Keir Fraser
@ 2007-04-27 16:18       ` Jeremy Fitzhardinge
  2007-04-27 16:22         ` Keir Fraser
  0 siblings, 1 reply; 7+ messages in thread
From: Jeremy Fitzhardinge @ 2007-04-27 16:18 UTC (permalink / raw)
  To: Keir Fraser; +Cc: PUCCETTI Armand, xen-devel

Keir Fraser wrote:
> __attribute__((regparm(0))) is the default for i386 anyway. Really
> asmlinkage should define to nothing for all x86 architectures, and we can
> just kill off all use of asmlinkage under arch/x86.

We don't use regparm(3) inside Xen?  Works nicely for the kernel.

    J

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: incompatible prototypes
  2007-04-27 16:18       ` Jeremy Fitzhardinge
@ 2007-04-27 16:22         ` Keir Fraser
  2007-04-27 16:40           ` Jeremy Fitzhardinge
  0 siblings, 1 reply; 7+ messages in thread
From: Keir Fraser @ 2007-04-27 16:22 UTC (permalink / raw)
  To: Jeremy Fitzhardinge; +Cc: PUCCETTI Armand, xen-devel




On 27/4/07 17:18, "Jeremy Fitzhardinge" <jeremy@goop.org> wrote:

> Keir Fraser wrote:
>> __attribute__((regparm(0))) is the default for i386 anyway. Really
>> asmlinkage should define to nothing for all x86 architectures, and we can
>> just kill off all use of asmlinkage under arch/x86.
> 
> We don't use regparm(3) inside Xen?  Works nicely for the kernel.

What's the speedup?

 K.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: incompatible prototypes
  2007-04-27 16:22         ` Keir Fraser
@ 2007-04-27 16:40           ` Jeremy Fitzhardinge
  0 siblings, 0 replies; 7+ messages in thread
From: Jeremy Fitzhardinge @ 2007-04-27 16:40 UTC (permalink / raw)
  To: Keir Fraser; +Cc: PUCCETTI Armand, xen-devel

Keir Fraser wrote:
>> We don't use regparm(3) inside Xen?  Works nicely for the kernel.
>>     
>
> What's the speedup?
>   

Mumble mumble.  Don't know.  It's been that way for quite a long time now.

But it makes the generated code moderately smaller.  -freg-struct-return
helps too (about 2k of text saved on the kernel, which is fairly piddling).

    J

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-04-27 16:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-27  8:23 incompatible prototypes PUCCETTI Armand
2007-04-27  8:34 ` Keir Fraser
2007-04-27 15:51   ` PUCCETTI Armand
2007-04-27 16:09     ` Keir Fraser
2007-04-27 16:18       ` Jeremy Fitzhardinge
2007-04-27 16:22         ` Keir Fraser
2007-04-27 16:40           ` Jeremy Fitzhardinge

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.