PERFORCE change 43101 for review

Marcel Moolenaar marcel at FreeBSD.org
Thu Nov 27 15:04:36 PST 2003


http://perforce.freebsd.org/chv.cgi?CH=43101

Change 43101 by marcel at marcel_nfs on 2003/11/27 15:04:26

	Add a new syscall kse_switchin(2) that can be used to switch 
	contexts on platforms that need or benefit from kernel support
	for KSE.

Affected files ...

.. //depot/projects/ia64/sys/kern/kern_thread.c#69 edit
.. //depot/projects/ia64/sys/kern/syscalls.master#34 edit
.. //depot/projects/ia64/sys/sys/kse.h#15 edit

Differences ...

==== //depot/projects/ia64/sys/kern/kern_thread.c#69 (text+ko) ====

@@ -384,6 +384,30 @@
 	thread_link(td, kg);
 }
 
+#ifndef _SYS_SYSPROTO_H_
+struct kse_switchin_args {
+	const struct __mcontext *mcp;
+	long val;
+	long *loc;
+};
+#endif
+
+int
+kse_switchin(struct thread *td, struct kse_switchin_args *uap)
+{
+	mcontext_t mc;
+	int error;
+
+	error = (uap->mcp == NULL) ? EINVAL : 0;
+	if (!error)
+		error = copyin(uap->mcp, &mc, sizeof(mc));
+	if (!error)
+		error = set_mcontext(td, &mc);
+	if (!error && uap->loc != NULL)
+		suword(uap->loc, uap->val);
+	return ((error == 0) ? EJUSTRETURN : error);
+}
+
 /*
 struct kse_thr_interrupt_args {
 	struct kse_thr_mailbox * tmbx;

==== //depot/projects/ia64/sys/kern/syscalls.master#34 (text+ko) ====

@@ -639,6 +639,8 @@
 			    int attrnamespace, void *data, size_t nbytes); }
 439	STD	BSD	{ ssize_t extattr_list_link(const char *path, \
 			    int attrnamespace, void *data, size_t nbytes); }
+440	MSTD	BSD	{ int kse_switchin(const struct __mcontext *mcp, \
+			    long val, long *loc); }
 
 ; Please copy any additions and changes to the following compatability tables:
 ; sys/ia64/ia32/syscalls.master  (take a best guess)

==== //depot/projects/ia64/sys/sys/kse.h#15 (text+ko) ====

@@ -109,6 +109,7 @@
 int	kse_release(struct timespec *);
 int	kse_thr_interrupt(struct kse_thr_mailbox *, int, long);
 int	kse_wakeup(struct kse_mailbox *);
+int	kse_switchin(mcontext_t *, long, long *);
 #endif	/* !_KERNEL */
 
 #endif	/* !_SYS_KSE_H_ */


More information about the p4-projects mailing list