summaryrefslogtreecommitdiffstats
path: root/sys/sys
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2011-09-16 13:58:51 +0000
committerkmacy <kmacy@FreeBSD.org>2011-09-16 13:58:51 +0000
commit99851f359e6f006b3223bb37dbc49e751ca8c13a (patch)
tree2ed8c1cfa9e408c1c66c2cde0823123897e0306e /sys/sys
parentbf8fedabcd023c90bb2ee4ce0e5d6d8c2b927714 (diff)
downloadFreeBSD-src-99851f359e6f006b3223bb37dbc49e751ca8c13a.zip
FreeBSD-src-99851f359e6f006b3223bb37dbc49e751ca8c13a.tar.gz
In order to maximize the re-usability of kernel code in user space this
patch modifies makesyscalls.sh to prefix all of the non-compatibility calls (e.g. not linux_, freebsd32_) with sys_ and updates the kernel entry points and all places in the code that use them. It also fixes an additional name space collision between the kernel function psignal and the libc function of the same name by renaming the kernel psignal kern_psignal(). By introducing this change now we will ease future MFCs that change syscalls. Reviewed by: rwatson Approved by: re (bz)
Diffstat (limited to 'sys/sys')
-rw-r--r--sys/sys/posix4.h2
-rw-r--r--sys/sys/signalvar.h2
-rw-r--r--sys/sys/sysent.h17
3 files changed, 19 insertions, 2 deletions
diff --git a/sys/sys/posix4.h b/sys/sys/posix4.h
index 34f77f4..25dbeae 100644
--- a/sys/sys/posix4.h
+++ b/sys/sys/posix4.h
@@ -48,7 +48,7 @@ struct nosys_args;
extern int syscall_not_present(struct thread *, const char *, struct nosys_args *);
#define SYSCALL_NOT_PRESENT_GEN(SC) \
-int SC (struct thread *td, struct SC##_args *uap) \
+int sys_ ## SC (struct thread *td, struct SC##_args *uap) \
{ \
return syscall_not_present(td, #SC , (struct nosys_args *)uap); \
}
diff --git a/sys/sys/signalvar.h b/sys/sys/signalvar.h
index f5abae6..71685e7 100644
--- a/sys/sys/signalvar.h
+++ b/sys/sys/signalvar.h
@@ -337,7 +337,7 @@ int pksignal(struct proc *p, int sig, ksiginfo_t *ksi);
void pgsigio(struct sigio **sigiop, int sig, int checkctty);
void pgsignal(struct pgrp *pgrp, int sig, int checkctty, ksiginfo_t *ksi);
int postsig(int sig);
-void psignal(struct proc *p, int sig);
+void kern_psignal(struct proc *p, int sig);
int ptracestop(struct thread *td, int sig);
void sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *retmask);
struct sigacts *sigacts_alloc(void);
diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h
index 90bce21..6a4b485 100644
--- a/sys/sys/sysent.h
+++ b/sys/sys/sysent.h
@@ -167,6 +167,14 @@ struct syscall_module_data {
static struct sysent syscallname##_sysent = { \
(sizeof(struct syscallname ## _args ) \
/ sizeof(register_t)), \
+ (sy_call_t *)& sys_##syscallname, \
+ SYS_AUE_##syscallname \
+}
+
+#define MAKE_SYSENT_COMPAT(syscallname) \
+static struct sysent syscallname##_sysent = { \
+ (sizeof(struct syscallname ## _args ) \
+ / sizeof(register_t)), \
(sy_call_t *)& syscallname, \
SYS_AUE_##syscallname \
}
@@ -207,6 +215,15 @@ struct syscall_helper_data {
.new_sysent = { \
.sy_narg = (sizeof(struct syscallname ## _args ) \
/ sizeof(register_t)), \
+ .sy_call = (sy_call_t *)& sys_ ## syscallname, \
+ .sy_auevent = SYS_AUE_##syscallname \
+ }, \
+ .syscall_no = SYS_##syscallname \
+}
+#define SYSCALL_INIT_HELPER_COMPAT(syscallname) { \
+ .new_sysent = { \
+ .sy_narg = (sizeof(struct syscallname ## _args ) \
+ / sizeof(register_t)), \
.sy_call = (sy_call_t *)& syscallname, \
.sy_auevent = SYS_AUE_##syscallname \
}, \
OpenPOWER on IntegriCloud