Skip to contentSkip to conversation

x86_64 restore_image declaration needs asmlinkage?

DISCUSSION Nigel Cunningham 2 participants 4 messages Jun 28, 2006

lore
Share & tools
lore
#0 lore raw

Hi.

I received a report of problems with CONFIG_REGPARM and suspending, that led me to recheck asm calls and declarations. Not being a guru on these things, I want to ask advice from those who know more.

Along the way I noticed that current git has:

extern asmlinkage int swsusp_arch_suspend(void);
extern asmlinkage int swsusp_arch_resume(void);

This is right for x86, but for x86_64, we actually call a C routine in arch/x86_64/kernel/suspend.c, which calls restore_image in arch/x86_64/kernel/suspend_asm.S. Restore image is declared in suspend.c as

extern int restore_image(void);

should it be:

extern asmlinkage int restore_image(void);

Having swsusp_arch_resume declared as asmlinkage doesn't matter, does it?

Regards,

Nigel

Signature · 4 lines
Nigel, Michelle and Alisdair Cunningham
5 Mitchell Street
Cobden 3266
Victoria, Australia

_______________________________________________
Suspend2-devel mailing list
[email protected]
http://lists.suspend2.net/mailman/listinfo/suspend2-devel

#1 lore raw

Hi,

Quoted 13 lines · Nigel Cunningham

I received a report of problems with CONFIG_REGPARM and suspending, that led me to recheck asm calls and declarations. Not being a guru on these things, I want to ask advice from those who know more.

Along the way I noticed that current git has:

extern asmlinkage int swsusp_arch_suspend(void);
extern asmlinkage int swsusp_arch_resume(void);

This is right for x86, but for x86_64, we actually call a C routine in arch/x86_64/kernel/suspend.c, which calls restore_image in arch/x86_64/kernel/suspend_asm.S. Restore image is declared in suspend.c as

Quoted 7 lines

extern int restore_image(void);

should it be:

extern asmlinkage int restore_image(void);

Having swsusp_arch_resume declared as asmlinkage doesn't matter, does it?

No, it doesn't. It would have mattered on i386 if the function had taken any arguments. AFAICT, on x86_64 it desn't matter at all.

Greetings,
Rafael

#2 lore raw

Hi.

Quoted 19 lines · Rafael J. Wysocki

Hi,

Quoted 16 lines · Nigel Cunningham

I received a report of problems with CONFIG_REGPARM and suspending, that led me to recheck asm calls and declarations. Not being a guru on these things, I want to ask advice from those who know more.

Along the way I noticed that current git has:

extern asmlinkage int swsusp_arch_suspend(void);
extern asmlinkage int swsusp_arch_resume(void);

This is right for x86, but for x86_64, we actually call a C routine in arch/x86_64/kernel/suspend.c, which calls restore_image in arch/x86_64/kernel/suspend_asm.S. Restore image is declared in suspend.c as

extern int restore_image(void);

Quoted 8 lines
Quoted 5 lines

should it be:

extern asmlinkage int restore_image(void);

Having swsusp_arch_resume declared as asmlinkage doesn't matter, does it?

No, it doesn't. It would have mattered on i386 if the function had taken any arguments. AFAICT, on x86_64 it desn't matter at all.

Right. But what about restore_image lacking the asmlinkage? I'm also wondering if that does matter.

Regards,

Nigel

Signature · 4 lines
Nigel, Michelle and Alisdair Cunningham
5 Mitchell Street
Cobden 3266
Victoria, Australia
#3 lore raw
Quoted 26 lines · Nigel Cunningham

Hi.

Quoted 23 lines · Rafael J. Wysocki

Hi,

Quoted 20 lines · Nigel Cunningham

I received a report of problems with CONFIG_REGPARM and suspending, that led me to recheck asm calls and declarations. Not being a guru on these things, I want to ask advice from those who know more.

Along the way I noticed that current git has:

extern asmlinkage int swsusp_arch_suspend(void);
extern asmlinkage int swsusp_arch_resume(void);

This is right for x86, but for x86_64, we actually call a C routine in arch/x86_64/kernel/suspend.c, which calls restore_image in arch/x86_64/kernel/suspend_asm.S. Restore image is declared in suspend.c as

extern int restore_image(void);

should it be:

extern asmlinkage int restore_image(void);

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Having swsusp_arch_resume declared as asmlinkage doesn't matter, does it?

No, it doesn't. It would have mattered on i386 if the function had taken any arguments. AFAICT, on x86_64 it desn't matter at all.

Right. But what about restore_image lacking the asmlinkage? I'm also wondering if that does matter.

I think asmlinkage would not matter here too (the function is x86_64-specific).

Greetings,
Rafael