From: inbox1.sudheer@gmail.com (Sudheer Divakaran)
To: kernelnewbies@lists.kernelnewbies.org
Subject: question regarding SYSCALL macros
Date: Thu, 28 Apr 2011 15:46:14 +0530 [thread overview]
Message-ID: <BANLkTimVd9T-a0a26=N55gSXF9sN-bAJBg@mail.gmail.com> (raw)
Hi,
I was going through the file kernel/time.c and found the definition
of 'gettimeofday' system call as follows.
SYSCALL_DEFINE2(gettimeofday, struct timeval __user *, tv,
struct timezone __user *, tz) <--- NOTE THE COMMA between variable
types and names.
In syscalls.h I could find the needed macros for expanding the
definition to its final form i.e.,
asmlinkage long sys_gettimeofday(struct timeval __user * tv, struct
timezone __user *tz)
[syscalls.h macros]
#define SYSCALL_DEFINE2(name, ...) SYSCALL_DEFINEx(2, _##name, __VA_ARGS__)
#define SYSCALL_DEFINEx(x, sname, ...) \
__SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
#define __SYSCALL_DEFINEx(x, name, ...) \
asmlinkage long sys##name(__SC_DECL##x(__VA_ARGS__))
#define __SC_DECL1(t1, a1) t1 a1
#define __SC_DECL2(t2, a2, ...) t2 a2, __SC_DECL1(__VA_ARGS__)
[Question]
Note the comma between the variable types and names in the original
definition (e.g., "struct timeval __user *, tv" instead of "struct
timeval __user *tv").
What is is the reason behind separating variable types and variable
names using 'comma' and latter removing the comma character using
_SC_DECLx macros?
--
Thanks
Sudheer
next reply other threads:[~2011-04-28 10:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-28 10:16 Sudheer Divakaran [this message]
2011-04-28 12:25 ` question regarding SYSCALL macros Mulyadi Santosa
2011-04-29 20:30 ` Dave Hylands
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='BANLkTimVd9T-a0a26=N55gSXF9sN-bAJBg@mail.gmail.com' \
--to=inbox1.sudheer@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).