Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F140116476
D1007.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D1007.diff
View Options
Index: sys/kern/kern_syscalls.c
===================================================================
--- sys/kern/kern_syscalls.c
+++ sys/kern/kern_syscalls.c
@@ -75,14 +75,12 @@
}
int
-syscall_thread_enter(struct thread *td, struct sysent *se)
+_syscall_thread_enter(struct thread *td, struct sysent *se)
{
u_int32_t cnt, oldcnt;
do {
oldcnt = se->sy_thrcnt;
- if ((oldcnt & SY_THR_STATIC) != 0)
- return (0);
if ((oldcnt & (SY_THR_DRAINING | SY_THR_ABSENT)) != 0)
return (ENOSYS);
cnt = oldcnt + SY_THR_INCR;
@@ -91,14 +89,12 @@
}
void
-syscall_thread_exit(struct thread *td, struct sysent *se)
+_syscall_thread_exit(struct thread *td, struct sysent *se)
{
u_int32_t cnt, oldcnt;
do {
oldcnt = se->sy_thrcnt;
- if ((oldcnt & SY_THR_STATIC) != 0)
- return;
cnt = oldcnt - SY_THR_INCR;
} while (atomic_cmpset_rel_32(&se->sy_thrcnt, oldcnt, cnt) == 0);
}
Index: sys/sys/sysent.h
===================================================================
--- sys/sys/sysent.h
+++ sys/sys/sysent.h
@@ -257,8 +257,27 @@
int lkmnosys(struct thread *, struct nosys_args *);
int lkmressys(struct thread *, struct nosys_args *);
-int syscall_thread_enter(struct thread *td, struct sysent *se);
-void syscall_thread_exit(struct thread *td, struct sysent *se);
+int _syscall_thread_enter(struct thread *td, struct sysent *se);
+void _syscall_thread_exit(struct thread *td, struct sysent *se);
+
+static inline int
+syscall_thread_enter(struct thread *td, struct sysent *se)
+{
+
+ if ((se->sy_thrcnt & SY_THR_STATIC) != 0)
+ return (0);
+
+ return (_syscall_thread_enter(td, se));
+}
+
+static inline void
+syscall_thread_exit(struct thread *td, struct sysent *se)
+{
+
+ if ((se->sy_thrcnt & SY_THR_STATIC) != 0)
+ return;
+ _syscall_thread_exit(td, se);
+}
int shared_page_alloc(int size, int align);
int shared_page_fill(int size, int align, const void *data);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 21, 11:11 AM (55 m, 9 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27111964
Default Alt Text
D1007.diff (1 KB)
Attached To
Mode
D1007: Move typically true check for static syscall out of syscall_thread_enter/exit functions into an inline.
Attached
Detach File
Event Timeline
Log In to Comment