In article <18bc2a5a-f82d-91ba-5e52-b262c907bd43%m00nbsd.net@localhost>,
Maxime Villard <max%m00nbsd.net@localhost> wrote:
Le 24/02/2018 à 11:54, Martin Husemann a écrit :
On Sat, Feb 24, 2018 at 11:37:11AM +0100, Maxime Villard wrote:
If the macro was defined as #if, you would need to do something like:
SYSCALL_ENTRY(syscall)
#define SYSCALL_ENTRY_SVS
SYSCALL_ENTRY(syscall_svs)
#undef SYSCALL_ENTRY_SVS
Where SYSCALL_ENTRY would contain another macro that depends on whether
SYSCALL_ENTRY_SVS is defined.
Not sure I follow here.
I would do something like:
SYSCALL_ENTRY_PLAIN(syscall)
SYSCALL_ENTRY_SVS(syscall_svs)
and have the SYSCALL_ENTRY_SVS be defined empty ifndef SVS.
But then you are duplicating the code that is shared between the two.
Yes, I can see why you prefer macros here, but you are also duplicating
the stack frame formation code just because in one branch you are using
r15 and in the other rax. Why not simplify it? or use a macro for it?