1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-15 10:17:20 +00:00

Make the following name changes to KSE related functions, etc., to better

represent their purpose and minimize namespace conflicts:

	kse_fn_t		-> kse_func_t
	struct thread_mailbox	-> struct kse_thr_mailbox
	thread_interrupt()	-> kse_thr_interrupt()
	kse_yield()		-> kse_release()
	kse_new()		-> kse_create()

Add missing declaration of kse_thr_interrupt() to <sys/kse.h>.
Regenerate the various generated syscall files. Minor style fixes.

Reviewed by:	julian
This commit is contained in:
Archie Cobbs 2002-09-25 18:10:42 +00:00
parent a6fa9438ba
commit 89def71cbd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=103972
23 changed files with 88 additions and 85 deletions

View File

@ -10,8 +10,8 @@
#define _IA32_SYSPROTO_H_
#include <sys/signal.h>
#include <sys/acl.h>
#include <posix4/_semaphore.h>
struct proc;

View File

@ -279,9 +279,9 @@
#define IA32_SYS_nmount 378
#define IA32_SYS_kse_exit 379
#define IA32_SYS_kse_wakeup 380
#define IA32_SYS_kse_new 381
#define IA32_SYS_thread_wakeup 382
#define IA32_SYS_kse_yield 383
#define IA32_SYS_kse_create 381
#define IA32_SYS_kse_thr_interrupt 382
#define IA32_SYS_kse_release 383
#define IA32_SYS_kenv 390
#define IA32_SYS_lchflags 391
#define IA32_SYS_uuidgen 392

View File

@ -398,9 +398,9 @@ struct sysent ia32_sysent[] = {
{ AS(nmount_args), (sy_call_t *)nmount }, /* 378 = nmount */
{ 0, (sy_call_t *)kse_exit }, /* 379 = kse_exit */
{ 0, (sy_call_t *)kse_wakeup }, /* 380 = kse_wakeup */
{ AS(kse_new_args), (sy_call_t *)kse_new }, /* 381 = kse_new */
{ AS(thread_wakeup_args), (sy_call_t *)thread_wakeup }, /* 382 = thread_wakeup */
{ 0, (sy_call_t *)kse_yield }, /* 383 = kse_yield */
{ AS(kse_create_args), (sy_call_t *)kse_create }, /* 381 = kse_create */
{ AS(kse_thr_interrupt_args), (sy_call_t *)kse_thr_interrupt }, /* 382 = kse_thr_interrupt */
{ 0, (sy_call_t *)kse_release }, /* 383 = kse_release */
{ 0, (sy_call_t *)nosys }, /* 384 = __mac_get_proc */
{ 0, (sy_call_t *)nosys }, /* 385 = __mac_set_proc */
{ 0, (sy_call_t *)nosys }, /* 386 = __mac_get_fd */

View File

@ -547,10 +547,10 @@
int flags); }
379 NOPROTO BSD { int kse_exit(void); }
380 NOPROTO BSD { int kse_wakeup(void); }
381 NOPROTO BSD { int kse_new(struct kse_mailbox * mbx, \
int new_grp_flag); }
382 NOPROTO BSD { int thread_wakeup(struct thread_mailbox *tmbx); }
383 NOPROTO BSD { int kse_yield(void); }
381 NOPROTO BSD { int kse_create(struct kse_mailbox *mbx, \
int newgroup); }
382 NOPROTO BSD { int kse_thr_interrupt(struct kse_thr_mailbox *tmbx); }
383 NOPROTO BSD { int kse_release(void); }
384 UNIMPL BSD __mac_get_proc
385 UNIMPL BSD __mac_set_proc
386 UNIMPL BSD __mac_get_fd

View File

@ -10,8 +10,8 @@
#define _IA32_SYSPROTO_H_
#include <sys/signal.h>
#include <sys/acl.h>
#include <posix4/_semaphore.h>
struct proc;

View File

@ -279,9 +279,9 @@
#define IA32_SYS_nmount 378
#define IA32_SYS_kse_exit 379
#define IA32_SYS_kse_wakeup 380
#define IA32_SYS_kse_new 381
#define IA32_SYS_thread_wakeup 382
#define IA32_SYS_kse_yield 383
#define IA32_SYS_kse_create 381
#define IA32_SYS_kse_thr_interrupt 382
#define IA32_SYS_kse_release 383
#define IA32_SYS_kenv 390
#define IA32_SYS_lchflags 391
#define IA32_SYS_uuidgen 392

View File

@ -398,9 +398,9 @@ struct sysent ia32_sysent[] = {
{ AS(nmount_args), (sy_call_t *)nmount }, /* 378 = nmount */
{ 0, (sy_call_t *)kse_exit }, /* 379 = kse_exit */
{ 0, (sy_call_t *)kse_wakeup }, /* 380 = kse_wakeup */
{ AS(kse_new_args), (sy_call_t *)kse_new }, /* 381 = kse_new */
{ AS(thread_wakeup_args), (sy_call_t *)thread_wakeup }, /* 382 = thread_wakeup */
{ 0, (sy_call_t *)kse_yield }, /* 383 = kse_yield */
{ AS(kse_create_args), (sy_call_t *)kse_create }, /* 381 = kse_create */
{ AS(kse_thr_interrupt_args), (sy_call_t *)kse_thr_interrupt }, /* 382 = kse_thr_interrupt */
{ 0, (sy_call_t *)kse_release }, /* 383 = kse_release */
{ 0, (sy_call_t *)nosys }, /* 384 = __mac_get_proc */
{ 0, (sy_call_t *)nosys }, /* 385 = __mac_set_proc */
{ 0, (sy_call_t *)nosys }, /* 386 = __mac_get_fd */

View File

@ -547,10 +547,10 @@
int flags); }
379 NOPROTO BSD { int kse_exit(void); }
380 NOPROTO BSD { int kse_wakeup(void); }
381 NOPROTO BSD { int kse_new(struct kse_mailbox * mbx, \
int new_grp_flag); }
382 NOPROTO BSD { int thread_wakeup(struct thread_mailbox *tmbx); }
383 NOPROTO BSD { int kse_yield(void); }
381 NOPROTO BSD { int kse_create(struct kse_mailbox *mbx, \
int newgroup); }
382 NOPROTO BSD { int kse_thr_interrupt(struct kse_thr_mailbox *tmbx); }
383 NOPROTO BSD { int kse_release(void); }
384 UNIMPL BSD __mac_get_proc
385 UNIMPL BSD __mac_set_proc
386 UNIMPL BSD __mac_get_fd

View File

@ -10,8 +10,8 @@
#define _IA32_SYSPROTO_H_
#include <sys/signal.h>
#include <sys/acl.h>
#include <posix4/_semaphore.h>
struct proc;

View File

@ -279,9 +279,9 @@
#define IA32_SYS_nmount 378
#define IA32_SYS_kse_exit 379
#define IA32_SYS_kse_wakeup 380
#define IA32_SYS_kse_new 381
#define IA32_SYS_thread_wakeup 382
#define IA32_SYS_kse_yield 383
#define IA32_SYS_kse_create 381
#define IA32_SYS_kse_thr_interrupt 382
#define IA32_SYS_kse_release 383
#define IA32_SYS_kenv 390
#define IA32_SYS_lchflags 391
#define IA32_SYS_uuidgen 392

View File

@ -398,9 +398,9 @@ struct sysent ia32_sysent[] = {
{ AS(nmount_args), (sy_call_t *)nmount }, /* 378 = nmount */
{ 0, (sy_call_t *)kse_exit }, /* 379 = kse_exit */
{ 0, (sy_call_t *)kse_wakeup }, /* 380 = kse_wakeup */
{ AS(kse_new_args), (sy_call_t *)kse_new }, /* 381 = kse_new */
{ AS(thread_wakeup_args), (sy_call_t *)thread_wakeup }, /* 382 = thread_wakeup */
{ 0, (sy_call_t *)kse_yield }, /* 383 = kse_yield */
{ AS(kse_create_args), (sy_call_t *)kse_create }, /* 381 = kse_create */
{ AS(kse_thr_interrupt_args), (sy_call_t *)kse_thr_interrupt }, /* 382 = kse_thr_interrupt */
{ 0, (sy_call_t *)kse_release }, /* 383 = kse_release */
{ 0, (sy_call_t *)nosys }, /* 384 = __mac_get_proc */
{ 0, (sy_call_t *)nosys }, /* 385 = __mac_set_proc */
{ 0, (sy_call_t *)nosys }, /* 386 = __mac_get_fd */

View File

@ -547,10 +547,10 @@
int flags); }
379 NOPROTO BSD { int kse_exit(void); }
380 NOPROTO BSD { int kse_wakeup(void); }
381 NOPROTO BSD { int kse_new(struct kse_mailbox * mbx, \
int new_grp_flag); }
382 NOPROTO BSD { int thread_wakeup(struct thread_mailbox *tmbx); }
383 NOPROTO BSD { int kse_yield(void); }
381 NOPROTO BSD { int kse_create(struct kse_mailbox *mbx, \
int newgroup); }
382 NOPROTO BSD { int kse_thr_interrupt(struct kse_thr_mailbox *tmbx); }
383 NOPROTO BSD { int kse_release(void); }
384 UNIMPL BSD __mac_get_proc
385 UNIMPL BSD __mac_set_proc
386 UNIMPL BSD __mac_get_fd

View File

@ -409,9 +409,9 @@ struct sysent sysent[] = {
{ AS(nmount_args), (sy_call_t *)nmount }, /* 378 = nmount */
{ 0, (sy_call_t *)kse_exit }, /* 379 = kse_exit */
{ 0, (sy_call_t *)kse_wakeup }, /* 380 = kse_wakeup */
{ AS(kse_new_args), (sy_call_t *)kse_new }, /* 381 = kse_new */
{ AS(thread_wakeup_args), (sy_call_t *)thread_wakeup }, /* 382 = thread_wakeup */
{ SYF_MPSAFE | 0, (sy_call_t *)kse_yield }, /* 383 = kse_yield */
{ AS(kse_create_args), (sy_call_t *)kse_create }, /* 381 = kse_create */
{ AS(kse_thr_interrupt_args), (sy_call_t *)kse_thr_interrupt }, /* 382 = kse_thr_interrupt */
{ SYF_MPSAFE | 0, (sy_call_t *)kse_release }, /* 383 = kse_release */
{ SYF_MPSAFE | AS(__mac_get_proc_args), (sy_call_t *)__mac_get_proc }, /* 384 = __mac_get_proc */
{ SYF_MPSAFE | AS(__mac_set_proc_args), (sy_call_t *)__mac_set_proc }, /* 385 = __mac_set_proc */
{ SYF_MPSAFE | AS(__mac_get_fd_args), (sy_call_t *)__mac_get_fd }, /* 386 = __mac_get_fd */

View File

@ -339,13 +339,13 @@ thread_export_context(struct thread *td)
#endif
/* Export the user/machine context. */
error = copyin((caddr_t)td->td_mailbox +
offsetof(struct thread_mailbox, tm_context),
offsetof(struct kse_thr_mailbox, tm_context),
&uc,
sizeof(ucontext_t));
if (error == 0) {
thread_getcontext(td, &uc);
error = copyout(&uc, (caddr_t)td->td_mailbox +
offsetof(struct thread_mailbox, tm_context),
offsetof(struct kse_thr_mailbox, tm_context),
sizeof(ucontext_t));
}
@ -353,7 +353,7 @@ thread_export_context(struct thread *td)
addr1 = (caddr_t)ke->ke_mailbox
+ offsetof(struct kse_mailbox, km_completed);
addr2 = (caddr_t)td->td_mailbox
+ offsetof(struct thread_mailbox , tm_next);
+ offsetof(struct kse_thr_mailbox, tm_next);
/* Then link it into it's KSE's list of completed threads. */
if (!error) {
error = td2_mbx = fuword(addr1);

View File

@ -282,7 +282,7 @@ proc_linkup(struct proc *p, struct ksegrp *kg,
}
int
thread_wakeup(struct thread *td, struct thread_wakeup_args *uap)
kse_thr_interrupt(struct thread *td, struct kse_thr_interrupt_args *uap)
{
return(ENOSYS);
@ -296,7 +296,7 @@ kse_exit(struct thread *td, struct kse_exit_args *uap)
}
int
kse_yield(struct thread *td, struct kse_yield_args *uap)
kse_release(struct thread *td, struct kse_release_args *uap)
{
struct thread *td2;
@ -306,7 +306,7 @@ kse_yield(struct thread *td, struct kse_yield_args *uap)
/* Don't discard the last thread. */
td2 = FIRST_THREAD_IN_PROC(td->td_proc);
KASSERT(td2 != NULL, ("kse_yield: no threads in our proc"));
KASSERT(td2 != NULL, ("kse_release: no threads in our proc"));
if (TAILQ_NEXT(td, td_plist) == NULL)
return (EINVAL);
@ -318,7 +318,8 @@ kse_yield(struct thread *td, struct kse_yield_args *uap)
return (0);
}
int kse_wakeup(struct thread *td, struct kse_wakeup_args *uap)
int
kse_wakeup(struct thread *td, struct kse_wakeup_args *uap)
{
return(ENOSYS);
@ -328,12 +329,12 @@ int kse_wakeup(struct thread *td, struct kse_wakeup_args *uap)
* No new KSEG: first call: use current KSE, don't schedule an upcall
* All other situations, do allocate a new KSE and schedule an upcall on it.
*/
/* struct kse_new_args {
/* struct kse_create_args {
struct kse_mailbox *mbx;
int new_grp_flag;
int newgroup;
}; */
int
kse_new(struct thread *td, struct kse_new_args *uap)
kse_create(struct thread *td, struct kse_create_args *uap)
{
struct kse *newke;
struct ksegrp *newkg;
@ -358,7 +359,7 @@ kse_new(struct thread *td, struct kse_new_args *uap)
* If newgroup then create the new group.
* Check we have the resources for this.
*/
if (uap->new_grp_flag) {
if (uap->newgroup) {
newkg = ksegrp_alloc();
bzero(&newkg->kg_startzero, RANGEOF(struct ksegrp,
kg_startzero, kg_endzero));
@ -401,7 +402,7 @@ kse_new(struct thread *td, struct kse_new_args *uap)
PROC_LOCK(p);
if (td->td_proc->p_flag & P_KSES) {
mtx_lock_spin(&sched_lock);
if (uap->new_grp_flag)
if (uap->newgroup)
ksegrp_link(newkg, p);
kse_link(newke, newkg);
if (SIGPENDING(p))

View File

@ -339,13 +339,13 @@ thread_export_context(struct thread *td)
#endif
/* Export the user/machine context. */
error = copyin((caddr_t)td->td_mailbox +
offsetof(struct thread_mailbox, tm_context),
offsetof(struct kse_thr_mailbox, tm_context),
&uc,
sizeof(ucontext_t));
if (error == 0) {
thread_getcontext(td, &uc);
error = copyout(&uc, (caddr_t)td->td_mailbox +
offsetof(struct thread_mailbox, tm_context),
offsetof(struct kse_thr_mailbox, tm_context),
sizeof(ucontext_t));
}
@ -353,7 +353,7 @@ thread_export_context(struct thread *td)
addr1 = (caddr_t)ke->ke_mailbox
+ offsetof(struct kse_mailbox, km_completed);
addr2 = (caddr_t)td->td_mailbox
+ offsetof(struct thread_mailbox , tm_next);
+ offsetof(struct kse_thr_mailbox, tm_next);
/* Then link it into it's KSE's list of completed threads. */
if (!error) {
error = td2_mbx = fuword(addr1);

View File

@ -388,9 +388,9 @@ char *syscallnames[] = {
"nmount", /* 378 = nmount */
"kse_exit", /* 379 = kse_exit */
"kse_wakeup", /* 380 = kse_wakeup */
"kse_new", /* 381 = kse_new */
"thread_wakeup", /* 382 = thread_wakeup */
"kse_yield", /* 383 = kse_yield */
"kse_create", /* 381 = kse_create */
"kse_thr_interrupt", /* 382 = kse_thr_interrupt */
"kse_release", /* 383 = kse_release */
"__mac_get_proc", /* 384 = __mac_get_proc */
"__mac_set_proc", /* 385 = __mac_set_proc */
"__mac_get_fd", /* 386 = __mac_get_fd */

View File

@ -549,10 +549,10 @@
int flags); }
379 STD BSD { int kse_exit(void); }
380 STD BSD { int kse_wakeup(void); }
381 STD BSD { int kse_new(struct kse_mailbox * mbx, \
int new_grp_flag); }
382 STD BSD { int thread_wakeup(struct thread_mailbox *tmbx); }
383 MSTD BSD { int kse_yield(void); }
381 STD BSD { int kse_create(struct kse_mailbox *mbx, \
int newgroup); }
382 STD BSD { int kse_thr_interrupt(struct kse_thr_mailbox *tmbx); }
383 MSTD BSD { int kse_release(void); }
384 MSTD BSD { int __mac_get_proc(struct mac *mac_p); }
385 MSTD BSD { int __mac_set_proc(struct mac *mac_p); }
386 MSTD BSD { int __mac_get_fd(int fd, struct mac *mac_p); }

View File

@ -30,8 +30,8 @@
* $FreeBSD$
*/
#ifndef SYS_KSE_H
#define SYS_KSE_H
#ifndef _SYS_KSE_H_
#define _SYS_KSE_H_
#include <machine/kse.h>
#include <sys/ucontext.h>
@ -42,17 +42,18 @@
* The only programs that should see this file are the UTS and the kernel.
*/
struct kse_mailbox;
typedef void kse_fn_t(struct kse_mailbox *mbx);
typedef void kse_func_t(struct kse_mailbox *);
/*
* Thread mailbox.
*
* This describes a user thread to the kernel scheduler.
*/
struct thread_mailbox {
struct kse_thr_mailbox {
ucontext_t tm_context; /* User and machine context */
unsigned int tm_flags; /* Thread flags */
struct thread_mailbox *tm_next; /* Next thread in list */
struct kse_thr_mailbox *tm_next; /* Next thread in list */
void *tm_udata; /* For use by the UTS */
int tm_spare[8];
};
@ -64,21 +65,22 @@ struct thread_mailbox {
* a single KSE.
*/
struct kse_mailbox {
struct thread_mailbox *km_curthread; /* Currently running thread */
struct thread_mailbox *km_completed; /* Threads back from kernel */
struct kse_thr_mailbox *km_curthread; /* Currently running thread */
struct kse_thr_mailbox *km_completed; /* Threads back from kernel */
sigset_t km_sigscaught; /* Caught signals */
unsigned int km_flags; /* KSE flags */
void *km_func; /* UTS function */
kse_func_t *km_func; /* UTS function */
stack_t km_stack; /* UTS context */
void *km_udata; /* For use by the UTS */
int tm_spare[8];
};
#ifndef _KERNEL
int kse_create(struct kse_mailbox *, int);
int kse_exit(void);
int kse_release(void);
int kse_thr_interrupt(struct kse_thr_mailbox *);
int kse_wakeup(void);
int kse_new(struct kse_mailbox *, int);
int kse_yield(void);
#endif
#endif /* !_KERNEL */
#endif
#endif /* !_SYS_KSE_H_ */

View File

@ -283,7 +283,7 @@ struct thread {
LIST_HEAD(, mtx) td_contested; /* (j) Contested locks. */
struct lock_list_entry *td_sleeplocks; /* (k) Held sleep locks. */
int td_intr_nesting_level; /* (k) Interrupt recursion. */
struct thread_mailbox *td_mailbox; /* the userland mailbox address */
struct kse_thr_mailbox *td_mailbox; /* the userland mailbox address */
struct ucred *td_ucred; /* (k) Reference to credentials. */
void (*td_switchin)(void); /* (k) Switchin special func. */
u_int td_critnest; /* (k) Critical section nest level. */

View File

@ -294,9 +294,9 @@
#define SYS_nmount 378
#define SYS_kse_exit 379
#define SYS_kse_wakeup 380
#define SYS_kse_new 381
#define SYS_thread_wakeup 382
#define SYS_kse_yield 383
#define SYS_kse_create 381
#define SYS_kse_thr_interrupt 382
#define SYS_kse_release 383
#define SYS___mac_get_proc 384
#define SYS___mac_set_proc 385
#define SYS___mac_get_fd 386

View File

@ -243,9 +243,9 @@ MIASM = \
nmount.o \
kse_exit.o \
kse_wakeup.o \
kse_new.o \
thread_wakeup.o \
kse_yield.o \
kse_create.o \
kse_thr_interrupt.o \
kse_release.o \
__mac_get_proc.o \
__mac_set_proc.o \
__mac_get_fd.o \

View File

@ -1064,14 +1064,14 @@ struct kse_exit_args {
struct kse_wakeup_args {
register_t dummy;
};
struct kse_new_args {
struct kse_create_args {
char mbx_l_[PADL_(struct kse_mailbox *)]; struct kse_mailbox * mbx; char mbx_r_[PADR_(struct kse_mailbox *)];
char new_grp_flag_l_[PADL_(int)]; int new_grp_flag; char new_grp_flag_r_[PADR_(int)];
char newgroup_l_[PADL_(int)]; int newgroup; char newgroup_r_[PADR_(int)];
};
struct thread_wakeup_args {
char tmbx_l_[PADL_(struct thread_mailbox *)]; struct thread_mailbox * tmbx; char tmbx_r_[PADR_(struct thread_mailbox *)];
struct kse_thr_interrupt_args {
char tmbx_l_[PADL_(struct kse_thr_mailbox *)]; struct kse_thr_mailbox * tmbx; char tmbx_r_[PADR_(struct kse_thr_mailbox *)];
};
struct kse_yield_args {
struct kse_release_args {
register_t dummy;
};
struct __mac_get_proc_args {
@ -1396,9 +1396,9 @@ int eaccess(struct thread *, struct eaccess_args *);
int nmount(struct thread *, struct nmount_args *);
int kse_exit(struct thread *, struct kse_exit_args *);
int kse_wakeup(struct thread *, struct kse_wakeup_args *);
int kse_new(struct thread *, struct kse_new_args *);
int thread_wakeup(struct thread *, struct thread_wakeup_args *);
int kse_yield(struct thread *, struct kse_yield_args *);
int kse_create(struct thread *, struct kse_create_args *);
int kse_thr_interrupt(struct thread *, struct kse_thr_interrupt_args *);
int kse_release(struct thread *, struct kse_release_args *);
int __mac_get_proc(struct thread *, struct __mac_get_proc_args *);
int __mac_set_proc(struct thread *, struct __mac_set_proc_args *);
int __mac_get_fd(struct thread *, struct __mac_get_fd_args *);