Index: amd64/amd64/machdep.c =================================================================== RCS file: /home/ncvs/src/sys/amd64/amd64/machdep.c,v retrieving revision 1.680 diff -u -p -r1.680 machdep.c --- amd64/amd64/machdep.c 25 Dec 2007 17:51:55 -0000 1.680 +++ amd64/amd64/machdep.c 12 Mar 2008 08:42:40 -0000 @@ -1325,7 +1325,7 @@ hammer_time(u_int64_t modulep, u_int64_t _ucode32sel = GSEL(GUCODE32_SEL, SEL_UPL); /* setup proc 0's pcb */ - thread0.td_pcb->pcb_flags = 0; /* XXXKSE */ + thread0.td_pcb->pcb_flags = 0; thread0.td_pcb->pcb_cr3 = KPML4phys; thread0.td_frame = &proc0_tf; Index: amd64/amd64/trap.c =================================================================== RCS file: /home/ncvs/src/sys/amd64/amd64/trap.c,v retrieving revision 1.324 diff -u -p -r1.324 trap.c --- amd64/amd64/trap.c 7 Dec 2007 08:20:15 -0000 1.324 +++ amd64/amd64/trap.c 12 Mar 2008 08:42:40 -0000 @@ -301,10 +301,6 @@ trap(struct trapframe *frame) case T_PAGEFLT: /* page fault */ addr = frame->tf_addr; -#ifdef KSE - if (td->td_pflags & TDP_SA) - thread_user_enter(td); -#endif i = trap_pfault(frame, TRUE); if (i == -1) goto userout; @@ -782,10 +778,6 @@ syscall(struct trapframe *frame) td->td_frame = frame; if (td->td_ucred != p->p_ucred) cred_update_thread(td); -#ifdef KSE - if (p->p_flag & P_SA) - thread_user_enter(td); -#endif params = (caddr_t)frame->tf_rsp + sizeof(register_t); code = frame->tf_rax; orig_tf_rflags = frame->tf_rflags; Index: amd64/amd64/vm_machdep.c =================================================================== RCS file: /home/ncvs/src/sys/amd64/amd64/vm_machdep.c,v retrieving revision 1.256 diff -u -p -r1.256 vm_machdep.c --- amd64/amd64/vm_machdep.c 14 Nov 2007 20:21:52 -0000 1.256 +++ amd64/amd64/vm_machdep.c 12 Mar 2008 08:42:40 -0000 @@ -51,7 +51,6 @@ __FBSDID("$FreeBSD: src/sys/amd64/amd64/ #include #include #include -#include #include #include #include @@ -272,22 +271,12 @@ cpu_set_upcall(struct thread *td, struct * Copy the upcall pcb. This loads kernel regs. * Those not loaded individually below get their default * values here. - * - * XXXKSE It might be a good idea to simply skip this as - * the values of the other registers may be unimportant. - * This would remove any requirement for knowing the KSE - * at this time (see the matching comment below for - * more analysis) (need a good safe default). */ bcopy(td0->td_pcb, pcb2, sizeof(*pcb2)); pcb2->pcb_flags &= ~PCB_FPUINITDONE; /* * Create a new fresh stack for the new thread. - * Don't forget to set this stack value into whatever supplies - * the address for the fault handlers. - * The contexts are filled in at the time we actually DO the - * upcall as only then do we know which KSE we got. */ bcopy(td0->td_frame, td->td_frame, sizeof(struct trapframe)); Index: amd64/conf/DEFAULTS =================================================================== RCS file: /home/ncvs/src/sys/amd64/conf/DEFAULTS,v retrieving revision 1.12 diff -u -p -r1.12 DEFAULTS --- amd64/conf/DEFAULTS 29 Oct 2007 22:19:08 -0000 1.12 +++ amd64/conf/DEFAULTS 12 Mar 2008 08:42:40 -0000 @@ -18,6 +18,3 @@ device uart_ns8250 # Default partitioning schemes options GEOM_BSD options GEOM_MBR - -# KSE support went from being default to a kernel option -options KSE Index: amd64/conf/GENERIC =================================================================== RCS file: /home/ncvs/src/sys/amd64/conf/GENERIC,v retrieving revision 1.494 diff -u -p -r1.494 GENERIC --- amd64/conf/GENERIC 5 Mar 2008 14:13:29 -0000 1.494 +++ amd64/conf/GENERIC 12 Mar 2008 08:42:40 -0000 @@ -67,7 +67,8 @@ options AUDIT # Security event auditi # Debugging for use in -current options KDB # Enable kernel debugger support. options DDB # Support DDB. -options GDB # Support remote GDB. +#options GDB # Support remote GDB. +options KDB_TRACE options INVARIANTS # Enable calls of extra sanity checking options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS options WITNESS # Enable checks to detect deadlocks and cycles Index: amd64/linux32/linux32_sysvec.c =================================================================== RCS file: /home/ncvs/src/sys/amd64/linux32/linux32_sysvec.c,v retrieving revision 1.31 diff -u -p -r1.31 linux32_sysvec.c --- amd64/linux32/linux32_sysvec.c 20 Sep 2007 13:46:26 -0000 1.31 +++ amd64/linux32/linux32_sysvec.c 12 Mar 2008 08:42:40 -0000 @@ -247,8 +247,7 @@ elf_linux_fixup(register_t **stack_base, Elf32_Addr *base; Elf32_Addr *pos; - KASSERT(curthread->td_proc == imgp->proc && - (curthread->td_proc->p_flag & P_SA) == 0, + KASSERT(curthread->td_proc == imgp->proc, ("unsafe elf_linux_fixup(), should be curproc")); base = (Elf32_Addr *)*stack_base; args = (Elf32_Auxargs *)imgp->auxargs; Index: arm/arm/trap.c =================================================================== RCS file: /home/ncvs/src/sys/arm/arm/trap.c,v retrieving revision 1.36 diff -u -p -r1.36 trap.c --- arm/arm/trap.c 14 Nov 2007 06:21:23 -0000 1.36 +++ arm/arm/trap.c 12 Mar 2008 08:42:40 -0000 @@ -262,10 +262,6 @@ data_abort_handler(trapframe_t *tf) td->td_frame = tf; if (td->td_ucred != td->td_proc->p_ucred) cred_update_thread(td); -#ifdef KSE - if (td->td_pflags & TDP_SA) - thread_user_enter(td); -#endif } /* Grab the current pcb */ @@ -731,10 +727,6 @@ prefetch_abort_handler(trapframe_t *tf) td->td_frame = tf; if (td->td_ucred != td->td_proc->p_ucred) cred_update_thread(td); -#ifdef KSE - if (td->td_proc->p_flag & P_SA) - thread_user_enter(td); -#endif } fault_pc = tf->tf_pc; if (td->td_md.md_spinlock_count == 0) { @@ -1008,10 +1000,6 @@ swi_handler(trapframe_t *frame) td->td_frame = frame; td->td_pticks = 0; -#ifdef KSE - if (td->td_proc->p_flag & P_SA) - thread_user_enter(td); -#endif /* * Make sure the program counter is correctly aligned so we * don't take an alignment fault trying to read the opcode. Index: arm/conf/AVILA =================================================================== RCS file: /home/ncvs/src/sys/arm/conf/AVILA,v retrieving revision 1.8 diff -u -p -r1.8 AVILA --- arm/conf/AVILA 5 Mar 2008 07:55:45 -0000 1.8 +++ arm/conf/AVILA 12 Mar 2008 08:42:40 -0000 @@ -49,7 +49,6 @@ options DDB #Enable the kernel debugg #options DIAGNOSTIC options SCHED_4BSD #4BSD scheduler -options KSE options INET #InterNETworking options INET6 #IPv6 communications protocols options FFS #Berkeley Fast Filesystem Index: arm/xscale/i8134x/crb_machdep.c =================================================================== RCS file: /home/ncvs/src/sys/arm/xscale/i8134x/crb_machdep.c,v retrieving revision 1.3 diff -u -p -r1.3 crb_machdep.c --- arm/xscale/i8134x/crb_machdep.c 5 Nov 2007 11:36:11 -0000 1.3 +++ arm/xscale/i8134x/crb_machdep.c 12 Mar 2008 08:42:40 -0000 @@ -406,11 +406,7 @@ initarm(void *arg, void *arg2) undefined_handler_address = (u_int)undefinedinstruction_bounce; undefined_init(); -#ifdef KSE - proc_linkup(&proc0, &ksegrp0, &thread0); -#else proc_linkup0(&proc0, &thread0); -#endif thread0.td_kstack = kernelstack.pv_va; thread0.td_pcb = (struct pcb *) (thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1; Index: compat/freebsd32/freebsd32_proto.h =================================================================== RCS file: /home/ncvs/src/sys/compat/freebsd32/freebsd32_proto.h,v retrieving revision 1.82 diff -u -p -r1.82 freebsd32_proto.h --- compat/freebsd32/freebsd32_proto.h 12 Feb 2008 20:11:54 -0000 1.82 +++ compat/freebsd32/freebsd32_proto.h 12 Mar 2008 08:42:41 -0000 @@ -2,7 +2,7 @@ * System call prototypes. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/compat/freebsd32/freebsd32_proto.h,v 1.82 2008/02/12 20:11:54 ru Exp $ + * $FreeBSD$ * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.96 2008/02/12 20:09:03 ru Exp */ Index: compat/freebsd32/freebsd32_syscall.h =================================================================== RCS file: /home/ncvs/src/sys/compat/freebsd32/freebsd32_syscall.h,v retrieving revision 1.80 diff -u -p -r1.80 freebsd32_syscall.h --- compat/freebsd32/freebsd32_syscall.h 12 Feb 2008 20:11:54 -0000 1.80 +++ compat/freebsd32/freebsd32_syscall.h 12 Mar 2008 08:42:41 -0000 @@ -2,7 +2,7 @@ * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscall.h,v 1.80 2008/02/12 20:11:54 ru Exp $ + * $FreeBSD$ * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.96 2008/02/12 20:09:03 ru Exp */ @@ -284,11 +284,6 @@ #define FREEBSD32_SYS___setugid 374 #define FREEBSD32_SYS_eaccess 376 #define FREEBSD32_SYS_nmount 378 -#define FREEBSD32_SYS_kse_exit 379 -#define FREEBSD32_SYS_kse_wakeup 380 -#define FREEBSD32_SYS_kse_create 381 -#define FREEBSD32_SYS_kse_thr_interrupt 382 -#define FREEBSD32_SYS_kse_release 383 #define FREEBSD32_SYS_kenv 390 #define FREEBSD32_SYS_lchflags 391 #define FREEBSD32_SYS_uuidgen 392 Index: compat/freebsd32/freebsd32_syscalls.c =================================================================== RCS file: /home/ncvs/src/sys/compat/freebsd32/freebsd32_syscalls.c,v retrieving revision 1.71 diff -u -p -r1.71 freebsd32_syscalls.c --- compat/freebsd32/freebsd32_syscalls.c 12 Feb 2008 20:11:54 -0000 1.71 +++ compat/freebsd32/freebsd32_syscalls.c 12 Mar 2008 08:42:41 -0000 @@ -2,7 +2,7 @@ * System call names. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscalls.c,v 1.71 2008/02/12 20:11:54 ru Exp $ + * $FreeBSD$ * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.96 2008/02/12 20:09:03 ru Exp */ @@ -386,11 +386,11 @@ const char *freebsd32_syscallnames[] = { "eaccess", /* 376 = eaccess */ "#377", /* 377 = afs_syscall */ "nmount", /* 378 = nmount */ - "kse_exit", /* 379 = kse_exit */ - "kse_wakeup", /* 380 = kse_wakeup */ - "kse_create", /* 381 = kse_create */ - "kse_thr_interrupt", /* 382 = kse_thr_interrupt */ - "kse_release", /* 383 = kse_release */ + "#379", /* 379 = kse_exit */ + "#380", /* 380 = kse_wakeup */ + "#381", /* 381 = kse_create */ + "#382", /* 382 = kse_thr_interrupt */ + "#383", /* 383 = kse_release */ "#384", /* 384 = __mac_get_proc */ "#385", /* 385 = __mac_set_proc */ "#386", /* 386 = __mac_get_fd */ Index: compat/freebsd32/freebsd32_sysent.c =================================================================== RCS file: /home/ncvs/src/sys/compat/freebsd32/freebsd32_sysent.c,v retrieving revision 1.81 diff -u -p -r1.81 freebsd32_sysent.c --- compat/freebsd32/freebsd32_sysent.c 12 Feb 2008 20:11:54 -0000 1.81 +++ compat/freebsd32/freebsd32_sysent.c 12 Mar 2008 08:42:41 -0000 @@ -2,7 +2,7 @@ * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/compat/freebsd32/freebsd32_sysent.c,v 1.81 2008/02/12 20:11:54 ru Exp $ + * $FreeBSD$ * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.96 2008/02/12 20:09:03 ru Exp */ @@ -418,11 +418,11 @@ struct sysent freebsd32_sysent[] = { { AS(eaccess_args), (sy_call_t *)eaccess, AUE_EACCESS, NULL, 0, 0 }, /* 376 = eaccess */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 377 = afs_syscall */ { AS(nmount_args), (sy_call_t *)nmount, AUE_NMOUNT, NULL, 0, 0 }, /* 378 = nmount */ - { 0, (sy_call_t *)kse_exit, AUE_NULL, NULL, 0, 0 }, /* 379 = kse_exit */ - { AS(kse_wakeup_args), (sy_call_t *)kse_wakeup, AUE_NULL, NULL, 0, 0 }, /* 380 = kse_wakeup */ - { AS(kse_create_args), (sy_call_t *)kse_create, AUE_NULL, NULL, 0, 0 }, /* 381 = kse_create */ - { AS(kse_thr_interrupt_args), (sy_call_t *)kse_thr_interrupt, AUE_NULL, NULL, 0, 0 }, /* 382 = kse_thr_interrupt */ - { 0, (sy_call_t *)kse_release, AUE_NULL, NULL, 0, 0 }, /* 383 = kse_release */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 379 = kse_exit */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 380 = kse_wakeup */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 381 = kse_create */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 382 = kse_thr_interrupt */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 383 = kse_release */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 384 = __mac_get_proc */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 385 = __mac_set_proc */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 386 = __mac_get_fd */ Index: compat/freebsd32/syscalls.master =================================================================== RCS file: /home/ncvs/src/sys/compat/freebsd32/syscalls.master,v retrieving revision 1.96 diff -u -p -r1.96 syscalls.master --- compat/freebsd32/syscalls.master 12 Feb 2008 20:09:03 -0000 1.96 +++ compat/freebsd32/syscalls.master 12 Mar 2008 08:42:41 -0000 @@ -645,13 +645,11 @@ 377 AUE_NULL UNIMPL afs_syscall 378 AUE_NMOUNT NOPROTO { int nmount(struct iovec *iovp, \ unsigned int iovcnt, int flags); } -379 AUE_NULL NOPROTO { int kse_exit(void); } -380 AUE_NULL NOPROTO { int kse_wakeup(struct kse_mailbox *mbx); } -381 AUE_NULL NOPROTO { int kse_create(struct kse_mailbox *mbx, \ - int newgroup); } -382 AUE_NULL NOPROTO { int kse_thr_interrupt( \ - struct kse_thr_mailbox *tmbx); } -383 AUE_NULL NOPROTO { int kse_release(void); } +379 AUE_NULL UNIMPL kse_exit +380 AUE_NULL UNIMPL kse_wakeup +381 AUE_NULL UNIMPL kse_create +382 AUE_NULL UNIMPL kse_thr_interrupt +383 AUE_NULL UNIMPL kse_release 384 AUE_NULL UNIMPL __mac_get_proc 385 AUE_NULL UNIMPL __mac_set_proc 386 AUE_NULL UNIMPL __mac_get_fd Index: conf/files =================================================================== RCS file: /home/ncvs/src/sys/conf/files,v retrieving revision 1.1279 diff -u -p -r1.1279 files --- conf/files 11 Mar 2008 03:50:56 -0000 1.1279 +++ conf/files 12 Mar 2008 08:42:41 -0000 @@ -1459,7 +1459,6 @@ kern/kern_fork.c standard kern/kern_idle.c standard kern/kern_intr.c standard kern/kern_jail.c standard -kern/kern_kse.c standard kern/kern_kthread.c standard kern/kern_ktr.c optional ktr kern/kern_ktrace.c standard Index: conf/options =================================================================== RCS file: /home/ncvs/src/sys/conf/options,v retrieving revision 1.619 diff -u -p -r1.619 options --- conf/options 2 Mar 2008 00:52:49 -0000 1.619 +++ conf/options 12 Mar 2008 08:42:41 -0000 @@ -104,7 +104,6 @@ GEOM_UZIP opt_geom.h GEOM_VIRSTOR opt_geom.h GEOM_VOL opt_geom.h GEOM_ZERO opt_geom.h -KSE opt_global.h KSTACK_MAX_PAGES KSTACK_PAGES KTRACE Index: fs/fifofs/fifo_vnops.c =================================================================== RCS file: /home/ncvs/src/sys/fs/fifofs/fifo_vnops.c,v retrieving revision 1.143 diff -u -p -r1.143 fifo_vnops.c --- fs/fifofs/fifo_vnops.c 26 Jan 2008 12:34:23 -0000 1.143 +++ fs/fifofs/fifo_vnops.c 12 Mar 2008 08:42:41 -0000 @@ -43,7 +43,7 @@ #include #include #include -#include /* XXXKSE */ +#include #include #include #include Index: fs/procfs/procfs_ctl.c =================================================================== RCS file: /home/ncvs/src/sys/fs/procfs/procfs_ctl.c,v retrieving revision 1.56 diff -u -p -r1.56 procfs_ctl.c --- fs/procfs/procfs_ctl.c 5 Jun 2007 00:00:51 -0000 1.56 +++ fs/procfs/procfs_ctl.c 12 Mar 2008 08:42:41 -0000 @@ -189,7 +189,7 @@ out: /* * do single-step fixup if needed */ - FIX_SSTEP(FIRST_THREAD_IN_PROC(p)); /* XXXKSE */ + FIX_SSTEP(FIRST_THREAD_IN_PROC(p)); #endif /* @@ -245,7 +245,7 @@ out: * What does it mean to single step a threaded program? */ case PROCFS_CTL_STEP: - error = proc_sstep(FIRST_THREAD_IN_PROC(p)); /* XXXKSE */ + error = proc_sstep(FIRST_THREAD_IN_PROC(p)); PROC_UNLOCK(p); if (error) return (error); @@ -335,14 +335,11 @@ procfs_doprocctl(PFS_FILL_ARGS) printf("procfs: got a sig%s\n", sbuf_data(sb)); PROC_LOCK(p); - /* This is very broken XXXKSE: */ if (TRACE_WAIT_P(td->td_proc, p)) { p->p_xstat = nm->nm_val; #ifdef FIX_SSTEP - /* XXXKSE: */ FIX_SSTEP(FIRST_THREAD_IN_PROC(p)); #endif - /* XXXKSE: */ p->p_flag &= ~P_STOPPED_SIG; PROC_SLOCK(p); thread_unsuspend(p); Index: fs/procfs/procfs_dbregs.c =================================================================== RCS file: /home/ncvs/src/sys/fs/procfs/procfs_dbregs.c,v retrieving revision 1.27 diff -u -p -r1.27 procfs_dbregs.c --- fs/procfs/procfs_dbregs.c 15 Apr 2007 13:24:03 -0000 1.27 +++ fs/procfs/procfs_dbregs.c 12 Mar 2008 08:42:41 -0000 @@ -105,7 +105,6 @@ procfs_doprocdbregs(PFS_FILL_ARGS) return (EPERM); } - /* XXXKSE: */ td2 = FIRST_THREAD_IN_PROC(p); #ifdef COMPAT_IA32 if (td->td_proc->p_sysent == &ia32_freebsd_sysvec) { Index: fs/procfs/procfs_status.c =================================================================== RCS file: /home/ncvs/src/sys/fs/procfs/procfs_status.c,v retrieving revision 1.62 diff -u -p -r1.62 procfs_status.c --- fs/procfs/procfs_status.c 17 Sep 2007 05:31:39 -0000 1.62 +++ fs/procfs/procfs_status.c 12 Mar 2008 08:42:41 -0000 @@ -112,20 +112,13 @@ procfs_doprocstatus(PFS_FILL_ARGS) sbuf_printf(sb, "noflags"); } -#ifdef KSE - if (p->p_flag & P_SA) - wmesg = "-kse- "; - else -#endif - { - tdfirst = FIRST_THREAD_IN_PROC(p); - if (tdfirst->td_wchan != NULL) { - KASSERT(tdfirst->td_wmesg != NULL, - ("wchan %p has no wmesg", tdfirst->td_wchan)); - wmesg = tdfirst->td_wmesg; - } else - wmesg = "nochan"; - } + tdfirst = FIRST_THREAD_IN_PROC(p); + if (tdfirst->td_wchan != NULL) { + KASSERT(tdfirst->td_wmesg != NULL, + ("wchan %p has no wmesg", tdfirst->td_wchan)); + wmesg = tdfirst->td_wmesg; + } else + wmesg = "nochan"; if (p->p_flag & P_INMEM) { struct timeval start, ut, st; Index: i386/conf/DEFAULTS =================================================================== RCS file: /home/ncvs/src/sys/i386/conf/DEFAULTS,v retrieving revision 1.12 diff -u -p -r1.12 DEFAULTS --- i386/conf/DEFAULTS 29 Oct 2007 22:19:08 -0000 1.12 +++ i386/conf/DEFAULTS 12 Mar 2008 08:42:41 -0000 @@ -22,6 +22,3 @@ device uart_ns8250 # Default partitioning schemes options GEOM_BSD options GEOM_MBR - -# KSE support went from being default to a kernel option -options KSE Index: i386/i386/sys_machdep.c =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/sys_machdep.c,v retrieving revision 1.112 diff -u -p -r1.112 sys_machdep.c --- i386/i386/sys_machdep.c 8 Jul 2007 18:17:42 -0000 1.112 +++ i386/i386/sys_machdep.c 12 Mar 2008 08:42:41 -0000 @@ -233,9 +233,6 @@ i386_extend_pcb(struct thread *td) 0 /* granularity */ }; - if (td->td_proc->p_flag & P_SA) - return (EINVAL); /* XXXKSE */ -/* XXXKSE All the code below only works in 1:1 needs changing */ ext = (struct pcb_ext *)kmem_alloc(kernel_map, ctob(IOPAGES+1)); if (ext == 0) return (ENOMEM); Index: i386/i386/trap.c =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/trap.c,v retrieving revision 1.311 diff -u -p -r1.311 trap.c --- i386/i386/trap.c 7 Dec 2007 08:20:16 -0000 1.311 +++ i386/i386/trap.c 12 Mar 2008 08:42:41 -0000 @@ -348,10 +348,6 @@ trap(struct trapframe *frame) break; case T_PAGEFLT: /* page fault */ -#ifdef KSE - if (td->td_pflags & TDP_SA) - thread_user_enter(td); -#endif i = trap_pfault(frame, TRUE, eva); #if defined(I586_CPU) && !defined(NO_F00F_HACK) @@ -959,10 +955,6 @@ syscall(struct trapframe *frame) td->td_frame = frame; if (td->td_ucred != p->p_ucred) cred_update_thread(td); -#ifdef KSE - if (p->p_flag & P_SA) - thread_user_enter(td); -#endif params = (caddr_t)frame->tf_esp + sizeof(int); code = frame->tf_eax; orig_tf_eflags = frame->tf_eflags; Index: i386/i386/vm_machdep.c =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/vm_machdep.c,v retrieving revision 1.284 diff -u -p -r1.284 vm_machdep.c --- i386/i386/vm_machdep.c 14 Nov 2007 20:21:53 -0000 1.284 +++ i386/i386/vm_machdep.c 12 Mar 2008 08:42:41 -0000 @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD: src/sys/i386/i386/vm #include #include #include -#include #include #include #include @@ -338,7 +337,6 @@ cpu_thread_clean(struct thread *td) pcb = td->td_pcb; if (pcb->pcb_ext != NULL) { - /* XXXKSE XXXSMP not SMP SAFE.. what locks do we have? */ /* if (pcb->pcb_ext->ext_refcount-- == 1) ?? */ /* * XXX do we need to move the TSS off the allocated pages @@ -396,23 +394,12 @@ cpu_set_upcall(struct thread *td, struct * Copy the upcall pcb. This loads kernel regs. * Those not loaded individually below get their default * values here. - * - * XXXKSE It might be a good idea to simply skip this as - * the values of the other registers may be unimportant. - * This would remove any requirement for knowing the KSE - * at this time (see the matching comment below for - * more analysis) (need a good safe default). */ bcopy(td0->td_pcb, pcb2, sizeof(*pcb2)); pcb2->pcb_flags &= ~(PCB_NPXTRAP|PCB_NPXINITDONE); /* * Create a new fresh stack for the new thread. - * The -16 is so we can expand the trapframe if we go to vm86. - * Don't forget to set this stack value into whatever supplies - * the address for the fault handlers. - * The contexts are filled in at the time we actually DO the - * upcall as only then do we know which KSE we got. */ bcopy(td0->td_frame, td->td_frame, sizeof(struct trapframe)); @@ -439,7 +426,7 @@ cpu_set_upcall(struct thread *td, struct * pcb2->pcb_savefpu: cloned above. * pcb2->pcb_flags: cloned above. * pcb2->pcb_onfault: cloned above (always NULL here?). - * pcb2->pcb_gs: cloned above. XXXKSE ??? + * pcb2->pcb_gs: cloned above. * pcb2->pcb_ext: cleared below. */ pcb2->pcb_ext = NULL; Index: i386/ibcs2/imgact_coff.c =================================================================== RCS file: /home/ncvs/src/sys/i386/ibcs2/imgact_coff.c,v retrieving revision 1.70 diff -u -p -r1.70 imgact_coff.c --- i386/ibcs2/imgact_coff.c 13 Jan 2008 14:44:08 -0000 1.70 +++ i386/ibcs2/imgact_coff.c 12 Mar 2008 08:42:41 -0000 @@ -405,7 +405,6 @@ exec_coff_imgact(imgp) DPRINTF(("%s(%d): shared library %s\n", __FILE__, __LINE__, libname)); strlcpy(&libbuf[emul_path_len], libname, MAXPATHLEN); -/* XXXKSE only 1:1 in coff */ error = coff_load_file( FIRST_THREAD_IN_PROC(imgp->proc), libbuf); if (error) error = coff_load_file( Index: i386/linux/linux_sysvec.c =================================================================== RCS file: /home/ncvs/src/sys/i386/linux/linux_sysvec.c,v retrieving revision 1.150 diff -u -p -r1.150 linux_sysvec.c --- i386/linux/linux_sysvec.c 20 Sep 2007 13:46:26 -0000 1.150 +++ i386/linux/linux_sysvec.c 12 Mar 2008 08:42:41 -0000 @@ -239,8 +239,7 @@ elf_linux_fixup(register_t **stack_base, Elf32_Auxargs *args; register_t *pos; - KASSERT(curthread->td_proc == imgp->proc && - (curthread->td_proc->p_flag & P_SA) == 0, + KASSERT(curthread->td_proc == imgp->proc, ("unsafe elf_linux_fixup(), should be curproc")); args = (Elf32_Auxargs *)imgp->auxargs; pos = *stack_base + (imgp->args->argc + imgp->args->envc + 2); Index: ia64/conf/DEFAULTS =================================================================== RCS file: /home/ncvs/src/sys/ia64/conf/DEFAULTS,v retrieving revision 1.12 diff -u -p -r1.12 DEFAULTS --- ia64/conf/DEFAULTS 6 Dec 2007 02:32:42 -0000 1.12 +++ ia64/conf/DEFAULTS 12 Mar 2008 08:42:41 -0000 @@ -17,6 +17,3 @@ device uart_ns8250 options GEOM_PART_BSD options GEOM_PART_GPT options GEOM_PART_MBR - -# KSE support went from being default to a kernel option -options KSE Index: ia64/ia64/machdep.c =================================================================== RCS file: /home/ncvs/src/sys/ia64/ia64/machdep.c,v retrieving revision 1.230 diff -u -p -r1.230 machdep.c --- ia64/ia64/machdep.c 14 Feb 2008 18:46:50 -0000 1.230 +++ ia64/ia64/machdep.c 12 Mar 2008 08:42:41 -0000 @@ -1231,9 +1231,6 @@ set_mcontext(struct thread *td, const mc restore_callee_saved(&mc->mc_preserved); restore_callee_saved_fp(&mc->mc_preserved_fp); - if (mc->mc_flags & _MC_FLAGS_KSE_SET_MBOX) - suword((caddr_t)mc->mc_special.ifa, mc->mc_special.isr); - return (0); } Index: ia64/ia64/trap.c =================================================================== RCS file: /home/ncvs/src/sys/ia64/ia64/trap.c,v retrieving revision 1.129 diff -u -p -r1.129 trap.c --- ia64/ia64/trap.c 14 Nov 2007 06:21:24 -0000 1.129 +++ ia64/ia64/trap.c 12 Mar 2008 08:42:41 -0000 @@ -987,10 +987,6 @@ syscall(struct trapframe *tf) td->td_pticks = 0; if (td->td_ucred != p->p_ucred) cred_update_thread(td); -#ifdef KSE - if (p->p_flag & P_SA) - thread_user_enter(td); -#endif if (p->p_sysent->sv_prepsyscall) { /* (*p->p_sysent->sv_prepsyscall)(tf, args, &code, ¶ms); */ Index: ia64/include/ucontext.h =================================================================== RCS file: /home/ncvs/src/sys/ia64/include/ucontext.h,v retrieving revision 1.7 diff -u -p -r1.7 ucontext.h --- ia64/include/ucontext.h 7 Dec 2003 20:47:33 -0000 1.7 +++ ia64/include/ucontext.h 12 Mar 2008 08:42:41 -0000 @@ -79,7 +79,6 @@ typedef struct __mcontext { unsigned long mc_flags; #define _MC_FLAGS_ASYNC_CONTEXT 0x0001 #define _MC_FLAGS_HIGHFP_VALID 0x0002 -#define _MC_FLAGS_KSE_SET_MBOX 0x0004 /* Undocumented. Has to go. */ #define _MC_FLAGS_SYSCALL_CONTEXT 0x0008 unsigned long _reserved_; struct _special mc_special; Index: kern/imgact_elf.c =================================================================== RCS file: /home/ncvs/src/sys/kern/imgact_elf.c,v retrieving revision 1.185 diff -u -p -r1.185 imgact_elf.c --- kern/imgact_elf.c 13 Jan 2008 14:44:08 -0000 1.185 +++ kern/imgact_elf.c 12 Mar 2008 08:42:41 -0000 @@ -480,9 +480,6 @@ __elfN(load_file)(struct proc *p, const u_long base_addr = 0; int vfslocked, error, i, numsegs; - if (curthread->td_proc != p) - panic("elf_load_file - thread"); /* XXXKSE DIAGNOSTIC */ - tempdata = malloc(sizeof(*tempdata), M_TEMP, M_WAITOK); nd = &tempdata->nd; attr = &tempdata->attr; @@ -498,7 +495,6 @@ __elfN(load_file)(struct proc *p, const imgp->object = NULL; imgp->execlabel = NULL; - /* XXXKSE */ NDINIT(nd, LOOKUP, MPSAFE|LOCKLEAF|FOLLOW, UIO_SYSSPACE, file, curthread); vfslocked = 0; @@ -999,7 +995,7 @@ __elfN(coredump)(td, vp, limit) (caddr_t)(uintptr_t)php->p_vaddr, php->p_filesz, offset, UIO_USERSPACE, IO_UNIT | IO_DIRECT, cred, NOCRED, NULL, - curthread); /* XXXKSE */ + curthread); if (error != 0) break; offset += php->p_filesz; @@ -1147,7 +1143,7 @@ __elfN(corehdr)(td, vp, cred, numsegs, h /* Write it to the core file. */ return (vn_rdwr_inchunks(UIO_WRITE, vp, hdr, hdrsize, (off_t)0, UIO_SYSSPACE, IO_UNIT | IO_DIRECT, cred, NOCRED, NULL, - td)); /* XXXKSE */ + td)); } #if defined(COMPAT_IA32) && __ELF_WORD_SIZE == 32 Index: kern/init_sysent.c =================================================================== RCS file: /home/ncvs/src/sys/kern/init_sysent.c,v retrieving revision 1.234 diff -u -p -r1.234 init_sysent.c --- kern/init_sysent.c 2 Mar 2008 07:41:10 -0000 1.234 +++ kern/init_sysent.c 12 Mar 2008 08:42:41 -0000 @@ -2,7 +2,7 @@ * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/kern/init_sysent.c,v 1.234 2008/03/02 07:41:10 jeff Exp $ + * $FreeBSD$ * created from FreeBSD: src/sys/kern/syscalls.master,v 1.238 2008/03/02 07:39:22 jeff Exp */ @@ -408,11 +408,11 @@ struct sysent sysent[] = { { AS(eaccess_args), (sy_call_t *)eaccess, AUE_EACCESS, NULL, 0, 0 }, /* 376 = eaccess */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 377 = afs_syscall */ { AS(nmount_args), (sy_call_t *)nmount, AUE_NMOUNT, NULL, 0, 0 }, /* 378 = nmount */ - { 0, (sy_call_t *)kse_exit, AUE_NULL, NULL, 0, 0 }, /* 379 = kse_exit */ - { AS(kse_wakeup_args), (sy_call_t *)kse_wakeup, AUE_NULL, NULL, 0, 0 }, /* 380 = kse_wakeup */ - { AS(kse_create_args), (sy_call_t *)kse_create, AUE_NULL, NULL, 0, 0 }, /* 381 = kse_create */ - { AS(kse_thr_interrupt_args), (sy_call_t *)kse_thr_interrupt, AUE_NULL, NULL, 0, 0 }, /* 382 = kse_thr_interrupt */ - { AS(kse_release_args), (sy_call_t *)kse_release, AUE_NULL, NULL, 0, 0 }, /* 383 = kse_release */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 379 = kse_exit */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 380 = kse_wakeup */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 381 = kse_create */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 382 = kse_thr_interrupt */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 383 = kse_release */ { AS(__mac_get_proc_args), (sy_call_t *)__mac_get_proc, AUE_NULL, NULL, 0, 0 }, /* 384 = __mac_get_proc */ { AS(__mac_set_proc_args), (sy_call_t *)__mac_set_proc, AUE_NULL, NULL, 0, 0 }, /* 385 = __mac_set_proc */ { AS(__mac_get_fd_args), (sy_call_t *)__mac_get_fd, AUE_NULL, NULL, 0, 0 }, /* 386 = __mac_get_fd */ @@ -469,7 +469,7 @@ struct sysent sysent[] = { { AS(extattr_list_fd_args), (sy_call_t *)extattr_list_fd, AUE_EXTATTR_LIST_FD, NULL, 0, 0 }, /* 437 = extattr_list_fd */ { AS(extattr_list_file_args), (sy_call_t *)extattr_list_file, AUE_EXTATTR_LIST_FILE, NULL, 0, 0 }, /* 438 = extattr_list_file */ { AS(extattr_list_link_args), (sy_call_t *)extattr_list_link, AUE_EXTATTR_LIST_LINK, NULL, 0, 0 }, /* 439 = extattr_list_link */ - { AS(kse_switchin_args), (sy_call_t *)kse_switchin, AUE_NULL, NULL, 0, 0 }, /* 440 = kse_switchin */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 440 = kse_switchin */ { AS(ksem_timedwait_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 441 = ksem_timedwait */ { AS(thr_suspend_args), (sy_call_t *)thr_suspend, AUE_NULL, NULL, 0, 0 }, /* 442 = thr_suspend */ { AS(thr_wake_args), (sy_call_t *)thr_wake, AUE_NULL, NULL, 0, 0 }, /* 443 = thr_wake */ Index: kern/kern_clock.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_clock.c,v retrieving revision 1.206 diff -u -p -r1.206 kern_clock.c --- kern/kern_clock.c 25 Dec 2007 17:51:58 -0000 1.206 +++ kern/kern_clock.c 12 Mar 2008 08:42:41 -0000 @@ -477,10 +477,6 @@ statclock(int usermode) /* * Charge the time as appropriate. */ -#ifdef KSE - if (p->p_flag & P_SA) - thread_statclock(1); -#endif td->td_uticks++; if (p->p_nice > NZERO) cp_time[CP_NICE]++; @@ -504,10 +500,6 @@ statclock(int usermode) td->td_iticks++; cp_time[CP_INTR]++; } else { -#ifdef KSE - if (p->p_flag & P_SA) - thread_statclock(0); -#endif td->td_pticks++; td->td_sticks++; if (!TD_IS_IDLETHREAD(td)) Index: kern/kern_exec.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_exec.c,v retrieving revision 1.315 diff -u -p -r1.315 kern_exec.c --- kern/kern_exec.c 13 Jan 2008 14:44:08 -0000 1.315 +++ kern/kern_exec.c 12 Mar 2008 08:42:41 -0000 @@ -1194,7 +1194,7 @@ exec_check_permissions(imgp) struct thread *td; int error; - td = curthread; /* XXXKSE */ + td = curthread; /* Get file attributes */ error = VOP_GETATTR(vp, attr, td->td_ucred, td); Index: kern/kern_fork.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_fork.c,v retrieving revision 1.289 diff -u -p -r1.289 kern_fork.c --- kern/kern_fork.c 15 Nov 2007 02:13:44 -0000 1.289 +++ kern/kern_fork.c 12 Mar 2008 08:42:41 -0000 @@ -764,7 +764,7 @@ fork_exit(callout, arg, frame) p = td->td_proc; KASSERT(p->p_state == PRS_NORMAL, ("executing process is still new")); - CTR4(KTR_PROC, "fork_exit: new thread %p (kse %p, pid %d, %s)", + CTR4(KTR_PROC, "fork_exit: new thread %p (td_sched %p, pid %d, %s)", td, td->td_sched, p->p_pid, td->td_name); sched_fork_exit(td); Index: kern/kern_intr.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_intr.c,v retrieving revision 1.153 diff -u -p -r1.153 kern_intr.c --- kern/kern_intr.c 29 Oct 2007 20:45:31 -0000 1.153 +++ kern/kern_intr.c 12 Mar 2008 08:42:41 -0000 @@ -905,7 +905,6 @@ swi_add(struct intr_event **eventp, cons } return (intr_event_add_handler(ie, name, NULL, handler, arg, (pri * RQ_PPQ) + PI_SOFT, flags, cookiep)); - /* XXKSE.. think of a better way to get separate queues */ } /* Index: kern/kern_proc.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_proc.c,v retrieving revision 1.261 diff -u -p -r1.261 kern_proc.c --- kern/kern_proc.c 10 Jan 2008 22:11:20 -0000 1.261 +++ kern/kern_proc.c 12 Mar 2008 08:42:41 -0000 @@ -645,7 +645,7 @@ fill_kinfo_proc_only(struct proc *p, str kp->ki_structsize = sizeof(*kp); kp->ki_paddr = p; PROC_LOCK_ASSERT(p, MA_OWNED); - kp->ki_addr =/* p->p_addr; */0; /* XXXKSE */ + kp->ki_addr =/* p->p_addr; */0; /* XXX */ kp->ki_args = p->p_args; kp->ki_textvp = p->p_textvp; #ifdef KTRACE @@ -794,7 +794,7 @@ fill_kinfo_thread(struct thread *td, str bzero(kp->ki_lockname, sizeof(kp->ki_lockname)); } - if (p->p_state == PRS_NORMAL) { /* XXXKSE very approximate */ + if (p->p_state == PRS_NORMAL) { /* approximate. */ if (TD_ON_RUNQ(td) || TD_CAN_RUN(td) || TD_IS_RUNNING(td)) { Index: kern/kern_resource.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_resource.c,v retrieving revision 1.182 diff -u -p -r1.182 kern_resource.c --- kern/kern_resource.c 10 Jan 2008 22:11:20 -0000 1.182 +++ kern/kern_resource.c 12 Mar 2008 08:42:41 -0000 @@ -407,8 +407,6 @@ rtprio(td, uap) * or if one is, report the highest priority * in the process. There isn't much more you can do as * there is only room to return a single priority. - * XXXKSE: maybe need a new interface to report - * priorities of multiple system scope threads. * Note: specifying our own pid is not the same * as leaving it zero. */ Index: kern/kern_sig.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_sig.c,v retrieving revision 1.357 diff -u -p -r1.357 kern_sig.c --- kern/kern_sig.c 8 Mar 2008 16:31:29 -0000 1.357 +++ kern/kern_sig.c 12 Mar 2008 08:42:41 -0000 @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD: src/sys/kern/kern_si #include #include #include -#include #include #include #include @@ -94,9 +93,6 @@ static int filt_sigattach(struct knote * static void filt_sigdetach(struct knote *kn); static int filt_signal(struct knote *kn, long hint); static struct thread *sigtd(struct proc *p, int sig, int prop); -#ifdef KSE -static int do_tdsignal(struct proc *, struct thread *, int, ksiginfo_t *); -#endif static void sigqueue_start(void); static uma_zone_t ksiginfo_zone = NULL; @@ -566,11 +562,7 @@ void signotify(struct thread *td) { struct proc *p; -#ifdef KSE - sigset_t set, saved; -#else sigset_t set; -#endif p = td->td_proc; @@ -581,10 +573,6 @@ signotify(struct thread *td) * previously masked by all threads to our sigqueue. */ set = p->p_sigqueue.sq_signals; -#ifdef KSE - if (p->p_flag & P_SA) - saved = p->p_sigqueue.sq_signals; -#endif SIGSETNAND(set, td->td_sigmask); if (! SIGISEMPTY(set)) sigqueue_move_set(&p->p_sigqueue, &td->td_sigqueue, &set); @@ -593,15 +581,6 @@ signotify(struct thread *td) td->td_flags |= TDF_NEEDSIGCHK | TDF_ASTPENDING; thread_unlock(td); } -#ifdef KSE - if ((p->p_flag & P_SA) && !(p->p_flag & P_SIGEVENT)) { - if (!SIGSETEQ(saved, p->p_sigqueue.sq_signals)) { - /* pending set changed */ - p->p_flag |= P_SIGEVENT; - wakeup(&p->p_siglist); - } - } -#endif } int @@ -754,13 +733,6 @@ kern_sigaction(td, sig, act, oact, flags if (ps->ps_sigact[_SIG_IDX(sig)] == SIG_IGN || (sigprop(sig) & SA_IGNORE && ps->ps_sigact[_SIG_IDX(sig)] == SIG_DFL)) { -#ifdef KSE - if ((p->p_flag & P_SA) && - SIGISMEMBER(p->p_sigqueue.sq_signals, sig)) { - p->p_flag |= P_SIGEVENT; - wakeup(&p->p_siglist); - } -#endif /* never to be seen again */ PROC_SLOCK(p); sigqueue_delete_proc(p, sig); @@ -1200,12 +1172,6 @@ restart: continue; if (!SIGISMEMBER(td->td_sigqueue.sq_signals, i)) { if (SIGISMEMBER(p->p_sigqueue.sq_signals, i)) { -#ifdef KSE - if (p->p_flag & P_SA) { - p->p_flag |= P_SIGEVENT; - wakeup(&p->p_siglist); - } -#endif sigqueue_move(&p->p_sigqueue, &td->td_sigqueue, i); } else @@ -1842,9 +1808,6 @@ trapsignal(struct thread *td, ksiginfo_t { struct sigacts *ps; struct proc *p; -#ifdef KSE - int error; -#endif int sig; int code; @@ -1853,27 +1816,7 @@ trapsignal(struct thread *td, ksiginfo_t code = ksi->ksi_code; KASSERT(_SIG_VALID(sig), ("invalid signal")); -#ifdef KSE - if (td->td_pflags & TDP_SA) { - if (td->td_mailbox == NULL) - thread_user_enter(td); - PROC_LOCK(p); - SIGDELSET(td->td_sigmask, sig); - thread_lock(td); - /* - * Force scheduling an upcall, so UTS has chance to - * process the signal before thread runs again in - * userland. - */ - if (td->td_upcall) - td->td_upcall->ku_flags |= KUF_DOUPCALL; - thread_unlock(td); - } else { - PROC_LOCK(p); - } -#else PROC_LOCK(p); -#endif ps = p->p_sigacts; mtx_lock(&ps->ps_mtx); if ((p->p_flag & P_TRACED) == 0 && SIGISMEMBER(ps->ps_sigcatch, sig) && @@ -1884,34 +1827,8 @@ trapsignal(struct thread *td, ksiginfo_t ktrpsig(sig, ps->ps_sigact[_SIG_IDX(sig)], &td->td_sigmask, code); #endif -#ifdef KSE - if (!(td->td_pflags & TDP_SA)) - (*p->p_sysent->sv_sendsig)(ps->ps_sigact[_SIG_IDX(sig)], - ksi, &td->td_sigmask); -#else (*p->p_sysent->sv_sendsig)(ps->ps_sigact[_SIG_IDX(sig)], ksi, &td->td_sigmask); -#endif -#ifdef KSE - else if (td->td_mailbox == NULL) { - mtx_unlock(&ps->ps_mtx); - /* UTS caused a sync signal */ - p->p_code = code; /* XXX for core dump/debugger */ - p->p_sig = sig; /* XXX to verify code */ - sigexit(td, sig); - } else { - mtx_unlock(&ps->ps_mtx); - SIGADDSET(td->td_sigmask, sig); - PROC_UNLOCK(p); - error = copyout(&ksi->ksi_info, &td->td_mailbox->tm_syncsig, - sizeof(siginfo_t)); - PROC_LOCK(p); - /* UTS memory corrupted */ - if (error) - sigexit(td, SIGSEGV); - mtx_lock(&ps->ps_mtx); - } -#endif SIGSETOR(td->td_sigmask, ps->ps_catchmask[_SIG_IDX(sig)]); if (!SIGISMEMBER(ps->ps_signodefer, sig)) SIGADDSET(td->td_sigmask, sig); @@ -2024,27 +1941,6 @@ psignal_event(struct proc *p, struct sig int tdsignal(struct proc *p, struct thread *td, int sig, ksiginfo_t *ksi) { -#ifdef KSE - sigset_t saved; - int ret; - - if (p->p_flag & P_SA) - saved = p->p_sigqueue.sq_signals; - ret = do_tdsignal(p, td, sig, ksi); - if ((p->p_flag & P_SA) && !(p->p_flag & P_SIGEVENT)) { - if (!SIGSETEQ(saved, p->p_sigqueue.sq_signals)) { - /* pending set changed */ - p->p_flag |= P_SIGEVENT; - wakeup(&p->p_siglist); - } - } - return (ret); -} - -static int -do_tdsignal(struct proc *p, struct thread *td, int sig, ksiginfo_t *ksi) -{ -#endif sig_t action; sigqueue_t *sigqueue; int prop; @@ -2055,17 +1951,9 @@ do_tdsignal(struct proc *p, struct threa PROC_LOCK_ASSERT(p, MA_OWNED); if (!_SIG_VALID(sig)) -#ifdef KSE - panic("do_tdsignal(): invalid signal %d", sig); -#else panic("tdsignal(): invalid signal %d", sig); -#endif -#ifdef KSE - KASSERT(ksi == NULL || !KSI_ONQ(ksi), ("do_tdsignal: ksi on queue")); -#else KASSERT(ksi == NULL || !KSI_ONQ(ksi), ("tdsignal: ksi on queue")); -#endif /* * IEEE Std 1003.1-2001: return success when killing a zombie. @@ -2232,18 +2120,6 @@ do_tdsignal(struct proc *p, struct threa goto out; } if (action == SIG_CATCH) { -#ifdef KSE - /* - * The process wants to catch it so it needs - * to run at least one thread, but which one? - * It would seem that the answer would be to - * run an upcall in the next KSE to run, and - * deliver the signal that way. In a NON KSE - * process, we need to make sure that the - * single thread is runnable asap. - * XXXKSE for now however, make them all run. - */ -#endif /* * The process wants to catch it so it needs * to run at least one thread, but which one? @@ -2540,10 +2416,6 @@ issignal(td) */ if (SIGISMEMBER(ps->ps_sigignore, sig) && (traced == 0)) { sigqueue_delete(&td->td_sigqueue, sig); -#ifdef KSE - if (td->td_pflags & TDP_SA) - SIGADDSET(td->td_sigmask, sig); -#endif continue; } if (p->p_flag & P_TRACED && (p->p_flag & P_PPWAIT) == 0) { @@ -2554,11 +2426,6 @@ issignal(td) newsig = ptracestop(td, sig); mtx_lock(&ps->ps_mtx); -#ifdef KSE - if (td->td_pflags & TDP_SA) - SIGADDSET(td->td_sigmask, sig); - -#endif if (sig != newsig) { ksiginfo_t ksi; /* @@ -2582,10 +2449,6 @@ issignal(td) * signal is being masked, look for other signals. */ SIGADDSET(td->td_sigqueue.sq_signals, sig); -#ifdef KSE - if (td->td_pflags & TDP_SA) - SIGDELSET(td->td_sigmask, sig); -#endif if (SIGISMEMBER(td->td_sigmask, sig)) continue; signotify(td); @@ -2739,11 +2602,7 @@ postsig(sig) mtx_lock(&ps->ps_mtx); } -#ifdef KSE - if (!(td->td_pflags & TDP_SA) && action == SIG_DFL) { -#else if (action == SIG_DFL) { -#endif /* * Default action, where the default is to kill * the process. (Other cases were ignored above.) @@ -2752,15 +2611,6 @@ postsig(sig) sigexit(td, sig); /* NOTREACHED */ } else { -#ifdef KSE - if (td->td_pflags & TDP_SA) { - if (sig == SIGKILL) { - mtx_unlock(&ps->ps_mtx); - sigexit(td, sig); - } - } - -#endif /* * If we get here, the signal must be caught. */ @@ -2803,14 +2653,7 @@ postsig(sig) p->p_code = 0; p->p_sig = 0; } -#ifdef KSE - if (td->td_pflags & TDP_SA) - thread_signal_add(curthread, &ksi); - else - (*p->p_sysent->sv_sendsig)(action, &ksi, &returnmask); -#else (*p->p_sysent->sv_sendsig)(action, &ksi, &returnmask); -#endif } } Index: kern/kern_switch.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_switch.c,v retrieving revision 1.138 diff -u -p -r1.138 kern_switch.c --- kern/kern_switch.c 14 Nov 2007 06:21:22 -0000 1.138 +++ kern/kern_switch.c 12 Mar 2008 08:42:41 -0000 @@ -521,7 +521,7 @@ runq_choose_from(struct runq *rq, u_char ts = TAILQ_FIRST(rqh); KASSERT(ts != NULL, ("runq_choose: no proc on busy queue")); CTR4(KTR_RUNQ, - "runq_choose_from: pri=%d kse=%p idx=%d rqh=%p", + "runq_choose_from: pri=%d td_sched=%p idx=%d rqh=%p", pri, ts, ts->ts_rqindex, rqh); return (ts); } Index: kern/kern_synch.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_synch.c,v retrieving revision 1.307 diff -u -p -r1.307 kern_synch.c --- kern/kern_synch.c 12 Mar 2008 06:31:06 -0000 1.307 +++ kern/kern_synch.c 12 Mar 2008 08:42:41 -0000 @@ -412,7 +412,7 @@ mi_switch(int flags, struct thread *newt td->td_generation++; /* bump preempt-detect counter */ PCPU_INC(cnt.v_swtch); PCPU_SET(switchticks, ticks); - CTR4(KTR_PROC, "mi_switch: old thread %ld (kse %p, pid %ld, %s)", + CTR4(KTR_PROC, "mi_switch: old thread %ld (td_sched %p, pid %ld, %s)", td->td_tid, td->td_sched, p->p_pid, td->td_name); #if (KTR_COMPILE & KTR_SCHED) != 0 if (TD_IS_IDLETHREAD(td)) @@ -429,19 +429,11 @@ mi_switch(int flags, struct thread *newt td, td->td_name, td->td_priority, td->td_inhibitors, td->td_wmesg, td->td_lockname); #endif - /* - * We call thread_switchout after the KTR_SCHED prints above so kse - * selecting a new thread to run does not show up as a preemption. - */ -#ifdef KSE - if ((flags & SW_VOL) && (td->td_proc->p_flag & P_SA)) - newtd = thread_switchout(td, flags, newtd); -#endif sched_switch(td, newtd, flags); CTR3(KTR_SCHED, "mi_switch: running %p(%s) prio %d", td, td->td_name, td->td_priority); - CTR4(KTR_PROC, "mi_switch: new thread %ld (kse %p, pid %ld, %s)", + CTR4(KTR_PROC, "mi_switch: new thread %ld (td_sched %p, pid %ld, %s)", td->td_tid, td->td_sched, p->p_pid, td->td_name); /* @@ -500,8 +492,6 @@ setrunnable(struct thread *td) /* * Compute a tenex style load average of a quantity on * 1, 5 and 15 minute intervals. - * XXXKSE Needs complete rewrite when correct info is available. - * Completely Bogus.. only works with 1:1 (but compiles ok now :-) */ static void loadav(void *arg) Index: kern/kern_thread.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_thread.c,v retrieving revision 1.268 diff -u -p -r1.268 kern_thread.c --- kern/kern_thread.c 12 Mar 2008 06:31:06 -0000 1.268 +++ kern/kern_thread.c 12 Mar 2008 08:42:41 -0000 @@ -68,43 +68,12 @@ int max_threads_hits; SYSCTL_INT(_kern_threads, OID_AUTO, max_threads_hits, CTLFLAG_RD, &max_threads_hits, 0, ""); -#ifdef KSE -int virtual_cpu; - -#endif TAILQ_HEAD(, thread) zombie_threads = TAILQ_HEAD_INITIALIZER(zombie_threads); static struct mtx zombie_lock; MTX_SYSINIT(zombie_lock, &zombie_lock, "zombie lock", MTX_SPIN); static void thread_zombie(struct thread *); -#ifdef KSE -static int -sysctl_kse_virtual_cpu(SYSCTL_HANDLER_ARGS) -{ - int error, new_val; - int def_val; - - def_val = mp_ncpus; - if (virtual_cpu == 0) - new_val = def_val; - else - new_val = virtual_cpu; - error = sysctl_handle_int(oidp, &new_val, 0, req); - if (error != 0 || req->newptr == NULL) - return (error); - if (new_val < 0) - return (EINVAL); - virtual_cpu = new_val; - return (0); -} - -/* DEBUG ONLY */ -SYSCTL_PROC(_kern_threads, OID_AUTO, virtual_cpu, CTLTYPE_INT|CTLFLAG_RW, - 0, sizeof(virtual_cpu), sysctl_kse_virtual_cpu, "I", - "debug virtual cpus"); -#endif - struct mtx tid_lock; static struct unrhdr *tid_unrhdr; @@ -230,9 +199,6 @@ void proc_linkup(struct proc *p, struct thread *td) { -#ifdef KSE - TAILQ_INIT(&p->p_upcalls); /* upcall list */ -#endif sigqueue_init(&p->p_sigqueue, p); p->p_ksi = ksiginfo_alloc(1); if (p->p_ksi != NULL) { @@ -258,9 +224,6 @@ threadinit(void) thread_zone = uma_zcreate("THREAD", sched_sizeof_thread(), thread_ctor, thread_dtor, thread_init, thread_fini, 16 - 1, 0); -#ifdef KSE - kseinit(); /* set up kse specific stuff e.g. upcall zone*/ -#endif } /* @@ -286,7 +249,7 @@ thread_stash(struct thread *td) } /* - * Reap zombie kse resource. + * Reap zombie resources. */ void thread_reap(void) @@ -311,9 +274,6 @@ thread_reap(void) td_first = td_next; } } -#ifdef KSE - upcall_reap(); -#endif } /* @@ -343,12 +303,7 @@ thread_alloc(void) void thread_free(struct thread *td) { -#ifdef KSE - if (td->td_cpuset != NULL) - cpuset_rel(td->td_cpuset); -#else cpuset_rel(td->td_cpuset); -#endif td->td_cpuset = NULL; cpu_thread_free(td); if (td->td_altkstack != 0) @@ -365,29 +320,7 @@ thread_free(struct thread *td) * Because we can't free a thread while we're operating under its context, * push the current thread into our CPU's deadthread holder. This means * we needn't worry about someone else grabbing our context before we - * do a cpu_throw(). This may not be needed now as we are under schedlock. - * Maybe we can just do a thread_stash() as thr_exit1 does. - */ -/* XXX - * libthr expects its thread exit to return for the last - * thread, meaning that the program is back to non-threaded - * mode I guess. Because we do this (cpu_throw) unconditionally - * here, they have their own version of it. (thr_exit1()) - * that doesn't do it all if this was the last thread. - * It is also called from thread_suspend_check(). - * Of course in the end, they end up coming here through exit1 - * anyhow.. After fixing 'thr' to play by the rules we should be able - * to merge these two functions together. - * - * called from: - * exit1() - * kse_exit() - * thr_exit() - * ifdef KSE - * thread_user_enter() - * thread_userret() - * endif - * thread_suspend_check() + * do a cpu_throw(). */ void thread_exit(void) @@ -413,17 +346,6 @@ thread_exit(void) AUDIT_SYSCALL_EXIT(0, td); #endif -#ifdef KSE - if (td->td_standin != NULL) { - /* - * Note that we don't need to free the cred here as it - * is done in thread_reap(). - */ - thread_zombie(td->td_standin); - td->td_standin = NULL; - } -#endif - umtx_thread_exit(td); /* @@ -453,11 +375,7 @@ thread_exit(void) if (p->p_flag & P_HADTHREADS) { if (p->p_numthreads > 1) { thread_lock(td); -#ifdef KSE - kse_unlink(td); -#else thread_unlink(td); -#endif thread_unlock(td); td2 = FIRST_THREAD_IN_PROC(p); sched_exit_thread(td2, td); @@ -480,16 +398,6 @@ thread_exit(void) } else { /* * The last thread is exiting.. but not through exit() - * what should we do? - * Theoretically this can't happen - * exit1() - clears threading flags before coming here - * kse_exit() - treats last thread specially - * thr_exit() - treats last thread specially - * ifdef KSE - * thread_user_enter() - only if more exist - * thread_userret() - only if more exist - * endif - * thread_suspend_check() - only if more exist */ panic ("thread_exit: Last thread exiting on its own"); } @@ -518,16 +426,6 @@ thread_wait(struct proc *p) mtx_assert(&Giant, MA_NOTOWNED); KASSERT((p->p_numthreads == 1), ("Multiple threads in wait1()")); td = FIRST_THREAD_IN_PROC(p); -#ifdef KSE - if (td->td_standin != NULL) { - if (td->td_standin->td_ucred != NULL) { - crfree(td->td_standin->td_ucred); - td->td_standin->td_ucred = NULL; - } - thread_free(td->td_standin); - td->td_standin = NULL; - } -#endif /* Lock the last thread so we spin until it exits cpu_throw(). */ thread_lock(td); thread_unlock(td); @@ -545,13 +443,6 @@ thread_wait(struct proc *p) * Link a thread to a process. * set up anything that needs to be initialized for it to * be used by the process. - * - * Note that we do not link to the proc's ucred here. - * The thread is linked as if running but no KSE assigned. - * Called from: - * proc_linkup() - * thread_schedule_upcall() - * thr_create() */ void thread_link(struct thread *td, struct proc *p) @@ -577,9 +468,6 @@ thread_link(struct thread *td, struct pr /* * Convert a process with one thread to an unthreaded process. - * Called from: - * thread_single(exit) (called from execve and exit) - * kse_exit() XXX may need cleaning up wrt KSE stuff */ void thread_unthread(struct thread *td) @@ -587,20 +475,7 @@ thread_unthread(struct thread *td) struct proc *p = td->td_proc; KASSERT((p->p_numthreads == 1), ("Unthreading with >1 threads")); -#ifdef KSE - thread_lock(td); - upcall_remove(td); - thread_unlock(td); - p->p_flag &= ~(P_SA|P_HADTHREADS); - td->td_mailbox = NULL; - td->td_pflags &= ~(TDP_SA | TDP_CAN_UNBIND); - if (td->td_standin != NULL) { - thread_zombie(td->td_standin); - td->td_standin = NULL; - } -#else p->p_flag &= ~P_HADTHREADS; -#endif } /* Index: kern/p1003_1b.c =================================================================== RCS file: /home/ncvs/src/sys/kern/p1003_1b.c,v retrieving revision 1.37 diff -u -p -r1.37 p1003_1b.c --- kern/p1003_1b.c 14 Nov 2007 06:21:22 -0000 1.37 +++ kern/p1003_1b.c 12 Mar 2008 08:42:41 -0000 @@ -156,7 +156,7 @@ sched_getparam(struct thread *td, struct if (targetp == NULL) { return (ESRCH); } - targettd = FIRST_THREAD_IN_PROC(targetp); /* XXXKSE */ + targettd = FIRST_THREAD_IN_PROC(targetp); } e = p_cansee(td, targetp); @@ -223,7 +223,7 @@ sched_getscheduler(struct thread *td, st e = ESRCH; goto done2; } - targettd = FIRST_THREAD_IN_PROC(targetp); /* XXXKSE */ + targettd = FIRST_THREAD_IN_PROC(targetp); } e = p_cansee(td, targetp); Index: kern/sched_4bsd.c =================================================================== RCS file: /home/ncvs/src/sys/kern/sched_4bsd.c,v retrieving revision 1.116 diff -u -p -r1.116 sched_4bsd.c --- kern/sched_4bsd.c 12 Mar 2008 06:31:06 -0000 1.116 +++ kern/sched_4bsd.c 12 Mar 2008 08:42:41 -0000 @@ -383,8 +383,6 @@ schedcpu(void) /* * ts_pctcpu is only for ps and ttyinfo(). - * Do it per td_sched, and add them up at the end? - * XXXKSE */ ts->ts_pctcpu = (ts->ts_pctcpu * ccpu) >> FSHIFT; /* Index: kern/sched_ule.c =================================================================== RCS file: /home/ncvs/src/sys/kern/sched_ule.c,v retrieving revision 1.231 diff -u -p -r1.231 sched_ule.c --- kern/sched_ule.c 12 Mar 2008 06:31:06 -0000 1.231 +++ kern/sched_ule.c 12 Mar 2008 08:42:41 -0000 @@ -2013,15 +2013,6 @@ sched_exit_thread(struct thread *td, str CTR3(KTR_SCHED, "sched_exit_thread: %p(%s) prio %d", child, child->td_name, child->td_priority); -#ifdef KSE - /* - * KSE forks and exits so often that this penalty causes short-lived - * threads to always be non-interactive. This causes mozilla to - * crawl under load. - */ - if ((td->td_pflags & TDP_SA) && td->td_proc == child->td_proc) - return; -#endif /* * Give the child's runtime to the parent without returning the * sleep time as a penalty to the parent. This causes shells that Index: kern/subr_sleepqueue.c =================================================================== RCS file: /home/ncvs/src/sys/kern/subr_sleepqueue.c,v retrieving revision 1.46 diff -u -p -r1.46 subr_sleepqueue.c --- kern/subr_sleepqueue.c 12 Mar 2008 06:31:06 -0000 1.46 +++ kern/subr_sleepqueue.c 12 Mar 2008 08:42:41 -0000 @@ -410,13 +410,8 @@ sleepq_catch_signals(void *wchan, int pr PROC_UNLOCK(p); thread_lock(td); if (ret == 0) { - if (!(td->td_flags & TDF_INTERRUPT)) { - sleepq_switch(wchan, pri); - return (0); - } - /* KSE threads tried unblocking us. */ - ret = td->td_intrval; - MPASS(ret == EINTR || ret == ERESTART || ret == EWOULDBLOCK); + sleepq_switch(wchan, pri); + return (0); } /* * There were pending signals and this thread is still @@ -540,9 +535,6 @@ sleepq_check_signals(void) return (td->td_intrval); } - if (td->td_flags & TDF_INTERRUPT) - return (td->td_intrval); - return (0); } Index: kern/subr_trap.c =================================================================== RCS file: /home/ncvs/src/sys/kern/subr_trap.c,v retrieving revision 1.301 diff -u -p -r1.301 subr_trap.c --- kern/subr_trap.c 7 Dec 2007 08:20:16 -0000 1.301 +++ kern/subr_trap.c 12 Mar 2008 08:42:41 -0000 @@ -119,15 +119,6 @@ userret(struct thread *td, struct trapfr thread_suspend_check(0); /* Can suspend or kill */ PROC_UNLOCK(p); } - -#ifdef KSE - /* - * Do special thread processing, e.g. upcall tweaking and such. - */ - if (p->p_flag & P_SA) - thread_userret(td, frame); -#endif - /* * Charge system time if profiling. */ @@ -135,7 +126,6 @@ userret(struct thread *td, struct trapfr addupc_task(td, TRAPF_PC(frame), td->td_pticks * psratio); } - /* * Let the scheduler adjust our priority etc. */ @@ -173,11 +163,6 @@ ast(struct trapframe *framep) td->td_frame = framep; td->td_pticks = 0; -#ifdef KSE - if ((p->p_flag & P_SA) && (td->td_mailbox == NULL)) - thread_user_enter(td); -#endif - /* * This updates the td_flag's for the checks below in one * "atomic" operation with turning off the astpending flag. @@ -188,18 +173,11 @@ ast(struct trapframe *framep) thread_lock(td); flags = td->td_flags; td->td_flags &= ~(TDF_ASTPENDING | TDF_NEEDSIGCHK | - TDF_NEEDRESCHED | TDF_INTERRUPT | TDF_ALRMPEND | TDF_PROFPEND | + TDF_NEEDRESCHED | TDF_ALRMPEND | TDF_PROFPEND | TDF_MACPEND); thread_unlock(td); PCPU_INC(cnt.v_trap); - /* - * XXXKSE While the fact that we owe a user profiling - * tick is stored per thread in this code, the statistics - * themselves are still stored per process. - * This should probably change, by which I mean that - * possibly the location of both might change. - */ if (td->td_ucred != p->p_ucred) cred_update_thread(td); if (td->td_pflags & TDP_OWEUPC && p->p_flag & P_PROFIL) { Index: kern/subr_witness.c =================================================================== RCS file: /home/ncvs/src/sys/kern/subr_witness.c,v retrieving revision 1.240 diff -u -p -r1.240 subr_witness.c --- kern/subr_witness.c 3 Mar 2008 17:16:59 -0000 1.240 +++ kern/subr_witness.c 12 Mar 2008 08:42:41 -0000 @@ -450,7 +450,6 @@ static struct witness_order_list_entry o #endif { "clk", &lock_class_mtx_spin }, { "mprof lock", &lock_class_mtx_spin }, - { "kse lock", &lock_class_mtx_spin }, { "zombie lock", &lock_class_mtx_spin }, { "ALD Queue", &lock_class_mtx_spin }, #ifdef __ia64__ Index: kern/sys_process.c =================================================================== RCS file: /home/ncvs/src/sys/kern/sys_process.c,v retrieving revision 1.146 diff -u -p -r1.146 sys_process.c --- kern/sys_process.c 8 Nov 2007 19:35:36 -0000 1.146 +++ kern/sys_process.c 12 Mar 2008 08:42:41 -0000 @@ -803,11 +803,6 @@ kern_ptrace(struct thread *td, int req, * you should use PT_SUSPEND to suspend it before * continuing process. */ -#ifdef KSE - PROC_SUNLOCK(p); - thread_continued(p); - PROC_SLOCK(p); -#endif p->p_flag &= ~(P_STOPPED_TRACE|P_STOPPED_SIG|P_WAITED); thread_unsuspend(p); PROC_SUNLOCK(p); @@ -943,17 +938,7 @@ kern_ptrace(struct thread *td, int req, pl->pl_event = PL_EVENT_SIGNAL; else pl->pl_event = 0; -#ifdef KSE - if (td2->td_pflags & TDP_SA) { - pl->pl_flags = PL_FLAG_SA; - if (td2->td_upcall && !TD_CAN_UNBIND(td2)) - pl->pl_flags |= PL_FLAG_BOUND; - } else { - pl->pl_flags = 0; - } -#else pl->pl_flags = 0; -#endif pl->pl_sigmask = td2->td_sigmask; pl->pl_siglist = td2->td_siglist; break; Index: kern/syscalls.c =================================================================== RCS file: /home/ncvs/src/sys/kern/syscalls.c,v retrieving revision 1.218 diff -u -p -r1.218 syscalls.c --- kern/syscalls.c 2 Mar 2008 07:41:10 -0000 1.218 +++ kern/syscalls.c 12 Mar 2008 08:42:41 -0000 @@ -2,7 +2,7 @@ * System call names. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/kern/syscalls.c,v 1.218 2008/03/02 07:41:10 jeff Exp $ + * $FreeBSD$ * created from FreeBSD: src/sys/kern/syscalls.master,v 1.238 2008/03/02 07:39:22 jeff Exp */ @@ -386,11 +386,11 @@ const char *syscallnames[] = { "eaccess", /* 376 = eaccess */ "#377", /* 377 = afs_syscall */ "nmount", /* 378 = nmount */ - "kse_exit", /* 379 = kse_exit */ - "kse_wakeup", /* 380 = kse_wakeup */ - "kse_create", /* 381 = kse_create */ - "kse_thr_interrupt", /* 382 = kse_thr_interrupt */ - "kse_release", /* 383 = kse_release */ + "#379", /* 379 = kse_exit */ + "#380", /* 380 = kse_wakeup */ + "#381", /* 381 = kse_create */ + "#382", /* 382 = kse_thr_interrupt */ + "#383", /* 383 = kse_release */ "__mac_get_proc", /* 384 = __mac_get_proc */ "__mac_set_proc", /* 385 = __mac_set_proc */ "__mac_get_fd", /* 386 = __mac_get_fd */ @@ -447,7 +447,7 @@ const char *syscallnames[] = { "extattr_list_fd", /* 437 = extattr_list_fd */ "extattr_list_file", /* 438 = extattr_list_file */ "extattr_list_link", /* 439 = extattr_list_link */ - "kse_switchin", /* 440 = kse_switchin */ + "#440", /* 440 = kse_switchin */ "ksem_timedwait", /* 441 = ksem_timedwait */ "thr_suspend", /* 442 = thr_suspend */ "thr_wake", /* 443 = thr_wake */ Index: kern/syscalls.master =================================================================== RCS file: /home/ncvs/src/sys/kern/syscalls.master,v retrieving revision 1.238 diff -u -p -r1.238 syscalls.master --- kern/syscalls.master 2 Mar 2008 07:39:22 -0000 1.238 +++ kern/syscalls.master 12 Mar 2008 08:42:41 -0000 @@ -664,14 +664,11 @@ 377 AUE_NULL UNIMPL afs_syscall 378 AUE_NMOUNT STD { int nmount(struct iovec *iovp, \ unsigned int iovcnt, int flags); } -379 AUE_NULL STD { int kse_exit(void); } -380 AUE_NULL STD { int kse_wakeup(struct kse_mailbox *mbx); } -381 AUE_NULL STD { int kse_create(struct kse_mailbox *mbx, \ - int newgroup); } -382 AUE_NULL STD { int kse_thr_interrupt( \ - struct kse_thr_mailbox *tmbx, int cmd, \ - long data); } -383 AUE_NULL STD { int kse_release(struct timespec *timeout); } +379 AUE_NULL UNIMPL kse_exit +380 AUE_NULL UNIMPL kse_wakeup +381 AUE_NULL UNIMPL kse_create +382 AUE_NULL UNIMPL kse_thr_interrupt +383 AUE_NULL UNIMPL kse_release 384 AUE_NULL STD { int __mac_get_proc(struct mac *mac_p); } 385 AUE_NULL STD { int __mac_set_proc(struct mac *mac_p); } 386 AUE_NULL STD { int __mac_get_fd(int fd, \ @@ -772,9 +769,7 @@ 439 AUE_EXTATTR_LIST_LINK STD { ssize_t extattr_list_link( \ const char *path, int attrnamespace, \ void *data, size_t nbytes); } -440 AUE_NULL STD { int kse_switchin( \ - struct kse_thr_mailbox *tmbx, \ - int flags); } +440 AUE_NULL UNIMPL kse_switchin 441 AUE_NULL NOSTD { int ksem_timedwait(semid_t id, \ const struct timespec *abstime); } 442 AUE_NULL STD { int thr_suspend( \ Index: kern/systrace_args.c =================================================================== RCS file: /home/ncvs/src/sys/kern/systrace_args.c,v retrieving revision 1.18 diff -u -p -r1.18 systrace_args.c --- kern/systrace_args.c 2 Mar 2008 07:41:10 -0000 1.18 +++ kern/systrace_args.c 12 Mar 2008 08:42:41 -0000 @@ -2,7 +2,7 @@ * System call argument to DTrace register array converstion. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/kern/systrace_args.c,v 1.18 2008/03/02 07:41:10 jeff Exp $ + * $FreeBSD$ * This file is part of the DTrace syscall provider. */ @@ -2067,42 +2067,6 @@ systrace_args(int sysnum, void *params, *n_args = 3; break; } - /* kse_exit */ - case 379: { - *n_args = 0; - break; - } - /* kse_wakeup */ - case 380: { - struct kse_wakeup_args *p = params; - uarg[0] = (intptr_t) p->mbx; /* struct kse_mailbox * */ - *n_args = 1; - break; - } - /* kse_create */ - case 381: { - struct kse_create_args *p = params; - uarg[0] = (intptr_t) p->mbx; /* struct kse_mailbox * */ - iarg[1] = p->newgroup; /* int */ - *n_args = 2; - break; - } - /* kse_thr_interrupt */ - case 382: { - struct kse_thr_interrupt_args *p = params; - uarg[0] = (intptr_t) p->tmbx; /* struct kse_thr_mailbox * */ - iarg[1] = p->cmd; /* int */ - iarg[2] = p->data; /* long */ - *n_args = 3; - break; - } - /* kse_release */ - case 383: { - struct kse_release_args *p = params; - uarg[0] = (intptr_t) p->timeout; /* struct timespec * */ - *n_args = 1; - break; - } /* __mac_get_proc */ case 384: { struct __mac_get_proc_args *p = params; @@ -2534,14 +2498,6 @@ systrace_args(int sysnum, void *params, *n_args = 4; break; } - /* kse_switchin */ - case 440: { - struct kse_switchin_args *p = params; - uarg[0] = (intptr_t) p->tmbx; /* struct kse_thr_mailbox * */ - iarg[1] = p->flags; /* int */ - *n_args = 2; - break; - } /* ksem_timedwait */ case 441: { struct ksem_timedwait_args *p = params; Index: pc98/conf/DEFAULTS =================================================================== RCS file: /home/ncvs/src/sys/pc98/conf/DEFAULTS,v retrieving revision 1.10 diff -u -p -r1.10 DEFAULTS --- pc98/conf/DEFAULTS 11 Jun 2007 00:38:06 -0000 1.10 +++ pc98/conf/DEFAULTS 12 Mar 2008 08:42:41 -0000 @@ -24,6 +24,3 @@ device uart_ns8250 # Default partitioning schemes options GEOM_BSD options GEOM_PC98 - -# KSE support went from being default to a kernel option -options KSE Index: pc98/pc98/machdep.c =================================================================== RCS file: /home/ncvs/src/sys/pc98/pc98/machdep.c,v retrieving revision 1.400 diff -u -p -r1.400 machdep.c --- pc98/pc98/machdep.c 29 Feb 2008 05:01:10 -0000 1.400 +++ pc98/pc98/machdep.c 12 Mar 2008 08:42:41 -0000 @@ -2148,7 +2148,7 @@ init386(first) _udatasel = GSEL(GUDATA_SEL, SEL_UPL); /* setup proc 0's pcb */ - thread0.td_pcb->pcb_flags = 0; /* XXXKSE */ + thread0.td_pcb->pcb_flags = 0; thread0.td_pcb->pcb_cr3 = (int)IdlePTD; thread0.td_pcb->pcb_ext = 0; thread0.td_frame = &proc0_tf; Index: powerpc/aim/trap.c =================================================================== RCS file: /home/ncvs/src/sys/powerpc/aim/trap.c,v retrieving revision 1.71 diff -u -p -r1.71 trap.c --- powerpc/aim/trap.c 2 Mar 2008 17:05:56 -0000 1.71 +++ powerpc/aim/trap.c 12 Mar 2008 08:42:41 -0000 @@ -349,11 +349,6 @@ syscall(struct trapframe *frame) PCPU_INC(cnt.v_syscall); -#ifdef KSE - if (p->p_flag & P_SA) - thread_user_enter(td); -#endif - code = frame->fixreg[0]; params = (caddr_t)(frame->fixreg + FIRSTARG); n = NARGREG; Index: powerpc/aim/vm_machdep.c =================================================================== RCS file: /home/ncvs/src/sys/powerpc/aim/vm_machdep.c,v retrieving revision 1.119 diff -u -p -r1.119 vm_machdep.c --- powerpc/aim/vm_machdep.c 2 Mar 2008 17:05:56 -0000 1.119 +++ powerpc/aim/vm_machdep.c 12 Mar 2008 08:42:41 -0000 @@ -264,7 +264,7 @@ is_physical_memory(addr) } /* - * KSE functions + * Threading functions */ void cpu_thread_exit(struct thread *td) Index: powerpc/booke/trap.c =================================================================== RCS file: /home/ncvs/src/sys/powerpc/booke/trap.c,v retrieving revision 1.1 diff -u -p -r1.1 trap.c --- powerpc/booke/trap.c 3 Mar 2008 17:17:00 -0000 1.1 +++ powerpc/booke/trap.c 12 Mar 2008 08:42:41 -0000 @@ -343,11 +343,6 @@ syscall(struct trapframe *frame) PCPU_INC(cnt.v_syscall); -#if KSE - if (p->p_flag & P_SA) - thread_user_enter(td); -#endif - code = frame->fixreg[0]; params = (caddr_t)(frame->fixreg + FIRSTARG); n = NARGREG; Index: powerpc/booke/vm_machdep.c =================================================================== RCS file: /home/ncvs/src/sys/powerpc/booke/vm_machdep.c,v retrieving revision 1.1 diff -u -p -r1.1 vm_machdep.c --- powerpc/booke/vm_machdep.c 3 Mar 2008 17:17:00 -0000 1.1 +++ powerpc/booke/vm_machdep.c 12 Mar 2008 08:42:41 -0000 @@ -408,7 +408,7 @@ is_physical_memory(vm_offset_t addr) } /* - * KSE functions + * Thread functions */ void cpu_thread_exit(struct thread *td) Index: powerpc/conf/DEFAULTS =================================================================== RCS file: /home/ncvs/src/sys/powerpc/conf/DEFAULTS,v retrieving revision 1.9 diff -u -p -r1.9 DEFAULTS --- powerpc/conf/DEFAULTS 13 Jun 2007 05:07:42 -0000 1.9 +++ powerpc/conf/DEFAULTS 12 Mar 2008 08:42:41 -0000 @@ -14,6 +14,3 @@ device uart_z8530 options GEOM_PART_APM options GEOM_PART_MBR - -# KSE support went from being default to a kernel option -options KSE Index: sparc64/conf/DEFAULTS =================================================================== RCS file: /home/ncvs/src/sys/sparc64/conf/DEFAULTS,v retrieving revision 1.11 diff -u -p -r1.11 DEFAULTS --- sparc64/conf/DEFAULTS 18 Nov 2007 18:11:16 -0000 1.11 +++ sparc64/conf/DEFAULTS 12 Mar 2008 08:42:41 -0000 @@ -13,9 +13,6 @@ device uart_ns8250 device uart_sab82532 device uart_z8530 -# KSE support went from being default to a kernel option -options KSE - # Default partitioning schemes options GEOM_BSD options GEOM_SUNLABEL Index: sparc64/sparc64/trap.c =================================================================== RCS file: /home/ncvs/src/sys/sparc64/sparc64/trap.c,v retrieving revision 1.89 diff -u -p -r1.89 trap.c --- sparc64/sparc64/trap.c 25 Dec 2007 17:52:01 -0000 1.89 +++ sparc64/sparc64/trap.c 12 Mar 2008 08:42:41 -0000 @@ -529,10 +529,6 @@ syscall(struct trapframe *tf) td->td_frame = tf; if (td->td_ucred != p->p_ucred) cred_update_thread(td); -#ifdef KSE - if (p->p_flag & P_SA) - thread_user_enter(td); -#endif code = tf->tf_global[1]; /* Index: sys/proc.h =================================================================== RCS file: /home/ncvs/src/sys/sys/proc.h,v retrieving revision 1.505 diff -u -p -r1.505 proc.h --- sys/proc.h 12 Mar 2008 06:31:06 -0000 1.505 +++ sys/proc.h 12 Mar 2008 08:42:41 -0000 @@ -166,37 +166,6 @@ struct mqueue_notifier; struct cpuset; /* - * Here we define the two structures used for process information. - * - * The first is the thread. It might be thought of as a "Kernel - * Schedulable Entity Context". - * This structure contains all the information as to where a thread of - * execution is now, or was when it was suspended, why it was suspended, - * and anything else that will be needed to restart it when it is - * rescheduled. It includes a scheduler specific substructure that is different - * for each scheduler. - * - * M:N notes. - * It is important to remember that when using M:N threading, - * a particular thread structure may only exist as long as - * the system call or kernel entrance (e.g. by pagefault) - * which it is currently executing. It should therefore NEVER be referenced - * by pointers in long lived structures that live longer than a single - * request. If several threads complete their work at the same time, - * they will all rewind their stacks to the user boundary, report their - * completion state, and all but one will be freed. That last one will - * be kept to provide a kernel stack and pcb for the NEXT syscall or kernel - * entrance (basically to save freeing and then re-allocating it). The existing - * thread keeps a cached spare thread available to allow it to quickly - * get one when it needs a new one. There is also a system - * cache of free threads. Threads have priority and partake in priority - * inheritance schemes. - * - * The second is the proc (process) which owns all the resources of a process - * other than CPU cycles, which are parceled out to the threads. - */ - -/* * Kernel runnable context (thread). * This is what is put to sleep and reactivated. * Thread context. Processes may have multiple threads. @@ -218,7 +187,7 @@ struct thread { sigqueue_t td_sigqueue; /* (c) Sigs arrived, not delivered. */ #define td_siglist td_sigqueue.sq_signals -/* Cleared during fork1() or thread_schedule_upcall(). */ +/* Cleared during fork1() */ #define td_startzero td_flags int td_flags; /* (t) TDF_* flags. */ int td_inhibitors; /* (t) Why can not run. */ @@ -239,10 +208,7 @@ struct thread { struct lock_list_entry *td_sleeplocks; /* (k) Held sleep locks. */ int td_intr_nesting_level; /* (k) Interrupt recursion. */ int td_pinned; /* (k) Temporary cpu pin count. */ - struct kse_thr_mailbox *td_mailbox; /* (*) Userland mailbox address. */ struct ucred *td_ucred; /* (k) Reference to credentials. */ - struct thread *td_standin; /* (k + a) Use this for an upcall. */ - struct kse_upcall *td_upcall; /* (k + t) Upcall structure. */ u_int td_estcpu; /* (t) estimated cpu utilization */ u_int td_slptick; /* (t) Time at sleep. */ struct rusage td_ru; /* (t) rusage information */ @@ -254,12 +220,11 @@ struct thread { u_int td_uticks; /* (t) Statclock hits in user mode. */ u_int td_uuticks; /* (k) Statclock hits (usr), for UTS. */ u_int td_usticks; /* (k) Statclock hits (sys), for UTS. */ - int td_intrval; /* (t) Return value of TDF_INTERRUPT. */ + int td_intrval; /* (t) Return value for sleepq. */ sigset_t td_oldsigmask; /* (k) Saved mask from pre sigpause. */ sigset_t td_sigmask; /* (c) Current signal mask. */ volatile u_int td_generation; /* (k) For detection of preemption */ stack_t td_sigstk; /* (k) Stack ptr and on-stack flag. */ - int td_kflags; /* (c) Flags for KSE threading. */ int td_xsig; /* (c) Signal for ptrace */ u_long td_profil_addr; /* (k) Temporary addr until AST. */ u_int td_profil_ticks; /* (k) Temporary ticks until AST. */ @@ -342,7 +307,7 @@ do { \ #define TDF_BOUNDARY 0x00000400 /* Thread suspended at user boundary */ #define TDF_ASTPENDING 0x00000800 /* Thread has some asynchronous events. */ #define TDF_TIMOFAIL 0x00001000 /* Timeout from sleep after we were awake. */ -#define TDF_INTERRUPT 0x00002000 /* Thread is marked as interrupted. */ +#define TDF_UNUSED2000 0x00002000 /* --available-- */ #define TDF_UPIBLOCKED 0x00004000 /* Thread blocked on user PI mutex. */ #define TDF_UNUSED15 0x00008000 /* --available-- */ #define TDF_NEEDRESCHED 0x00010000 /* Thread needs to yield. */ @@ -368,15 +333,15 @@ do { \ #define TDP_OLDMASK 0x00000001 /* Need to restore mask after suspend. */ #define TDP_INKTR 0x00000002 /* Thread is currently in KTR code. */ #define TDP_INKTRACE 0x00000004 /* Thread is currently in KTRACE code. */ -#define TDP_UPCALLING 0x00000008 /* This thread is doing an upcall. */ +#define TDP_UNUSED8 0x00000008 /* available */ #define TDP_COWINPROGRESS 0x00000010 /* Snapshot copy-on-write in progress. */ #define TDP_ALTSTACK 0x00000020 /* Have alternate signal stack. */ #define TDP_DEADLKTREAT 0x00000040 /* Lock aquisition - deadlock treatment. */ -#define TDP_SA 0x00000080 /* A scheduler activation based thread. */ +#define TDP_UNUSED80 0x00000080 /* available. */ #define TDP_NOSLEEPING 0x00000100 /* Thread is not allowed to sleep on a sq. */ #define TDP_OWEUPC 0x00000200 /* Call addupc() at next AST. */ #define TDP_ITHREAD 0x00000400 /* Thread is an interrupt thread. */ -#define TDP_CAN_UNBIND 0x00000800 /* Only temporarily bound. */ +#define TDP_UNUSED800 0x00000800 /* available. */ #define TDP_SCHED1 0x00001000 /* Reserved for scheduler private use */ #define TDP_SCHED2 0x00002000 /* Reserved for scheduler private use */ #define TDP_SCHED3 0x00004000 /* Reserved for scheduler private use */ @@ -399,17 +364,6 @@ do { \ #define TDI_LOCK 0x0008 /* Stopped on a lock. */ #define TDI_IWAIT 0x0010 /* Awaiting interrupt. */ -/* - * flags (in kflags) related to M:N threading. - */ -#define TDK_KSEREL 0x0001 /* Blocked in msleep on p->p_completed. */ -#define TDK_KSERELSIG 0x0002 /* Blocked in msleep on p->p_siglist. */ -#define TDK_WAKEUP 0x0004 /* Thread has been woken by kse_wakeup. */ - -#define TD_CAN_UNBIND(td) \ - (((td)->td_pflags & TDP_CAN_UNBIND) && \ - ((td)->td_upcall != NULL)) - #define TD_IS_SLEEPING(td) ((td)->td_inhibitors & TDI_SLEEPING) #define TD_ON_SLEEPQ(td) ((td)->td_wchan != NULL) #define TD_IS_SUSPENDED(td) ((td)->td_inhibitors & TDI_SUSPENDED) @@ -421,11 +375,7 @@ do { \ #define TD_CAN_RUN(td) ((td)->td_state == TDS_CAN_RUN) #define TD_IS_INHIBITED(td) ((td)->td_state == TDS_INHIBITED) #define TD_ON_UPILOCK(td) ((td)->td_flags & TDF_UPIBLOCKED) -#if 0 -#define TD_IS_IDLETHREAD(td) ((td) == pcpu(idlethread)) -#else #define TD_IS_IDLETHREAD(td) ((td)->td_flags & TDF_IDLETD) -#endif #define TD_SET_INHIB(td, inhib) do { \ @@ -457,24 +407,6 @@ do { \ #define TD_SET_CAN_RUN(td) (td)->td_state = TDS_CAN_RUN /* - * An upcall is used when returning to userland. If a thread does not have - * an upcall on return to userland the thread exports its context and exits. - */ -struct kse_upcall { - TAILQ_ENTRY(kse_upcall) ku_link; /* List of upcalls in proc. */ - struct proc *ku_proc; /* Associated proc. */ - struct thread *ku_owner; /* Owning thread. */ - int ku_flags; /* KUF_* flags. */ - struct kse_mailbox *ku_mailbox; /* Userland mailbox address. */ - stack_t ku_stack; /* Userland upcall stack. */ - void *ku_func; /* Userland upcall function. */ - unsigned int ku_mflags; /* Cached upcall mbox flags. */ -}; - -#define KUF_DOUPCALL 0x00001 /* Do upcall now; don't wait. */ -#define KUF_EXITING 0x00002 /* Upcall structure is exiting. */ - -/* * XXX: Does this belong in resource.h or resourcevar.h instead? * Resource usage extension. The times in rusage structs in the kernel are * never up to date. The actual times are kept as runtimes and tick counts @@ -495,18 +427,15 @@ struct rusage_ext { }; /* - * The old fashionned process. May have multiple threads. - * Starts off with a single embedded THREAD. + * Process structure. */ struct proc { LIST_ENTRY(proc) p_list; /* (d) List of all processes. */ TAILQ_HEAD(, thread) p_threads; /* (j) all threads. */ - TAILQ_HEAD(, kse_upcall) p_upcalls; /* (j) All upcalls in the proc. */ struct mtx p_slock; /* process spin lock */ struct ucred *p_ucred; /* (c) Process owner's identity. */ struct filedesc *p_fd; /* (b) Open files. */ struct filedesc_to_leader *p_fdtol; /* (b) Tracking node */ - /* Accumulated stats for all threads? */ struct pstats *p_stats; /* (b) Accounting/statistics (CPU). */ struct plimit *p_limit; /* (c) Process limits. */ struct callout p_limco; /* (c) Limit callout handle */ @@ -565,11 +494,6 @@ struct proc { int p_boundary_count;/* (c) Num threads at user boundary */ int p_pendingcnt; /* how many signals are pending */ struct itimers *p_itimers; /* (c) POSIX interval timers. */ - int p_numupcalls; /* (j) Num upcalls. */ - int p_upsleeps; /* (c) Num threads in kse_release(). */ - struct kse_thr_mailbox *p_completed; /* (c) Completed thread mboxes. */ - int p_nextupcall; /* (n) Next upcall time. */ - int p_upquantum; /* (n) Quantum to schedule an upcall. */ /* End area that is zeroed on creation. */ #define p_endzero p_magic @@ -627,7 +551,7 @@ struct proc { #define P_WAITED 0x01000 /* Someone is waiting for us. */ #define P_WEXIT 0x02000 /* Working on exiting. */ #define P_EXEC 0x04000 /* Process called exec. */ -#define P_SA 0x08000 /* Using scheduler activations. */ +#define P_UNUSED8000 0x08000 /* available. */ #define P_CONTINUED 0x10000 /* Proc has continued from a stopped state. */ #define P_STOPPED_SIG 0x20000 /* Stopped due to SIGSTOP/SIGTSTP. */ #define P_STOPPED_TRACE 0x40000 /* Stopped because of tracing. */ @@ -673,8 +597,6 @@ struct proc { #define SINGLE_EXIT 1 #define SINGLE_BOUNDARY 2 -/* XXXKSE: Missing values for thread_suspend_check(). */ - #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_PARGS); MALLOC_DECLARE(M_PGRP); @@ -687,10 +609,7 @@ MALLOC_DECLARE(M_ZOMBIE); LIST_FOREACH((p), &allproc, p_list) #define FOREACH_THREAD_IN_PROC(p, td) \ TAILQ_FOREACH((td), &(p)->p_threads, td_plist) -#define FOREACH_UPCALL_IN_PROC(p, ku) \ - TAILQ_FOREACH((ku), &(p)->p_upcalls, ku_link) -/* XXXKSE the following lines should probably only be used in 1:1 code: */ #define FIRST_THREAD_IN_PROC(p) TAILQ_FIRST(&(p)->p_threads) /* @@ -884,15 +803,9 @@ void exit1(struct thread *, int) __dead2 void cpu_fork(struct thread *, struct proc *, struct thread *, int); void cpu_set_fork_handler(struct thread *, void (*)(void *), void *); -/* New in KSE. */ -#ifdef KSE -void kse_unlink(struct thread *); -void kseinit(void); -void upcall_reap(void); -void upcall_remove(struct thread *td); -#endif void cpu_set_upcall(struct thread *td, struct thread *td0); -void cpu_set_upcall_kse(struct thread *, void (*)(void *), void *, stack_t *); +void cpu_set_upcall_kse(struct thread *, void (*)(void *), void *, + stack_t *); int cpu_set_user_tls(struct thread *, void *tls_base); void cpu_thread_alloc(struct thread *); void cpu_thread_clean(struct thread *); @@ -901,17 +814,13 @@ void cpu_thread_free(struct thread *); void cpu_thread_swapin(struct thread *); void cpu_thread_swapout(struct thread *); struct thread *thread_alloc(void); -void thread_continued(struct proc *p); void thread_exit(void) __dead2; -int thread_export_context(struct thread *td, int willexit); void thread_free(struct thread *td); void thread_link(struct thread *td, struct proc *p); void thread_reap(void); -void thread_signal_add(struct thread *td, ksiginfo_t *); int thread_single(int how); void thread_single_end(void); void thread_stash(struct thread *td); -int thread_statclock(int user); void thread_stopped(struct proc *p); void childproc_stopped(struct proc *child, int reason); void childproc_continued(struct proc *child); @@ -919,14 +828,10 @@ void childproc_exited(struct proc *child int thread_suspend_check(int how); void thread_suspend_switch(struct thread *); void thread_suspend_one(struct thread *td); -struct thread *thread_switchout(struct thread *td, int flags, - struct thread *newtd); void thread_unlink(struct thread *td); void thread_unsuspend(struct proc *p); void thread_unsuspend_one(struct thread *td); void thread_unthread(struct thread *td); -int thread_userret(struct thread *td, struct trapframe *frame); -void thread_user_enter(struct thread *td); void thread_wait(struct proc *p); struct thread *thread_find(struct proc *p, lwpid_t tid); void thr_exit1(void); Index: sys/sched.h =================================================================== RCS file: /home/ncvs/src/sys/sys/sched.h,v retrieving revision 1.36 diff -u -p -r1.36 sched.h --- sys/sched.h 12 Mar 2008 06:31:06 -0000 1.36 +++ sys/sched.h 12 Mar 2008 08:42:41 -0000 @@ -82,11 +82,6 @@ int sched_runnable(void); void sched_exit(struct proc *p, struct thread *childtd); void sched_fork(struct thread *td, struct thread *childtd); void sched_fork_exit(struct thread *td); - -/* - * KSE Groups contain scheduling priority information. They record the - * behavior of groups of KSEs and threads. - */ void sched_class(struct thread *td, int class); void sched_nice(struct proc *p, int nice); Index: sys/syscall.h =================================================================== RCS file: /home/ncvs/src/sys/sys/syscall.h,v retrieving revision 1.215 diff -u -p -r1.215 syscall.h --- sys/syscall.h 2 Mar 2008 07:41:10 -0000 1.215 +++ sys/syscall.h 12 Mar 2008 08:42:41 -0000 @@ -2,7 +2,7 @@ * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/sys/syscall.h,v 1.215 2008/03/02 07:41:10 jeff Exp $ + * $FreeBSD$ * created from FreeBSD: src/sys/kern/syscalls.master,v 1.238 2008/03/02 07:39:22 jeff Exp */ @@ -306,11 +306,6 @@ #define SYS_nfsclnt 375 #define SYS_eaccess 376 #define SYS_nmount 378 -#define SYS_kse_exit 379 -#define SYS_kse_wakeup 380 -#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 @@ -363,7 +358,6 @@ #define SYS_extattr_list_fd 437 #define SYS_extattr_list_file 438 #define SYS_extattr_list_link 439 -#define SYS_kse_switchin 440 #define SYS_ksem_timedwait 441 #define SYS_thr_suspend 442 #define SYS_thr_wake 443 Index: sys/syscall.mk =================================================================== RCS file: /home/ncvs/src/sys/sys/syscall.mk,v retrieving revision 1.170 diff -u -p -r1.170 syscall.mk --- sys/syscall.mk 2 Mar 2008 07:41:10 -0000 1.170 +++ sys/syscall.mk 12 Mar 2008 08:42:41 -0000 @@ -1,6 +1,6 @@ # FreeBSD system call names. # DO NOT EDIT-- this file is automatically generated. -# $FreeBSD: src/sys/sys/syscall.mk,v 1.170 2008/03/02 07:41:10 jeff Exp $ +# $FreeBSD$ # created from FreeBSD: src/sys/kern/syscalls.master,v 1.238 2008/03/02 07:39:22 jeff Exp MIASM = \ syscall.o \ @@ -255,11 +255,6 @@ MIASM = \ nfsclnt.o \ eaccess.o \ nmount.o \ - kse_exit.o \ - kse_wakeup.o \ - kse_create.o \ - kse_thr_interrupt.o \ - kse_release.o \ __mac_get_proc.o \ __mac_set_proc.o \ __mac_get_fd.o \ @@ -312,7 +307,6 @@ MIASM = \ extattr_list_fd.o \ extattr_list_file.o \ extattr_list_link.o \ - kse_switchin.o \ ksem_timedwait.o \ thr_suspend.o \ thr_wake.o \ Index: sys/sysproto.h =================================================================== RCS file: /home/ncvs/src/sys/sys/sysproto.h,v retrieving revision 1.219 diff -u -p -r1.219 sysproto.h --- sys/sysproto.h 2 Mar 2008 07:41:10 -0000 1.219 +++ sys/sysproto.h 12 Mar 2008 08:42:41 -0000 @@ -2,7 +2,7 @@ * System call prototypes. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/sys/sysproto.h,v 1.219 2008/03/02 07:41:10 jeff Exp $ + * $FreeBSD$ * created from FreeBSD: src/sys/kern/syscalls.master,v 1.238 2008/03/02 07:39:22 jeff Exp */ @@ -1094,24 +1094,6 @@ struct nmount_args { char iovcnt_l_[PADL_(unsigned int)]; unsigned int iovcnt; char iovcnt_r_[PADR_(unsigned int)]; char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; }; -struct kse_exit_args { - register_t dummy; -}; -struct kse_wakeup_args { - char mbx_l_[PADL_(struct kse_mailbox *)]; struct kse_mailbox * mbx; char mbx_r_[PADR_(struct kse_mailbox *)]; -}; -struct kse_create_args { - char mbx_l_[PADL_(struct kse_mailbox *)]; struct kse_mailbox * mbx; char mbx_r_[PADR_(struct kse_mailbox *)]; - char newgroup_l_[PADL_(int)]; int newgroup; char newgroup_r_[PADR_(int)]; -}; -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 *)]; - char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; - char data_l_[PADL_(long)]; long data; char data_r_[PADR_(long)]; -}; -struct kse_release_args { - char timeout_l_[PADL_(struct timespec *)]; struct timespec * timeout; char timeout_r_[PADR_(struct timespec *)]; -}; struct __mac_get_proc_args { char mac_p_l_[PADL_(struct mac *)]; struct mac * mac_p; char mac_p_r_[PADR_(struct mac *)]; }; @@ -1335,10 +1317,6 @@ struct extattr_list_link_args { char data_l_[PADL_(void *)]; void * data; char data_r_[PADR_(void *)]; char nbytes_l_[PADL_(size_t)]; size_t nbytes; char nbytes_r_[PADR_(size_t)]; }; -struct kse_switchin_args { - char tmbx_l_[PADL_(struct kse_thr_mailbox *)]; struct kse_thr_mailbox * tmbx; char tmbx_r_[PADR_(struct kse_thr_mailbox *)]; - char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; -}; struct ksem_timedwait_args { char id_l_[PADL_(semid_t)]; semid_t id; char id_r_[PADR_(semid_t)]; char abstime_l_[PADL_(const struct timespec *)]; const struct timespec * abstime; char abstime_r_[PADR_(const struct timespec *)]; @@ -1800,11 +1778,6 @@ int __setugid(struct thread *, struct __ int nfsclnt(struct thread *, struct nfsclnt_args *); 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_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 *); @@ -1857,7 +1830,6 @@ int jail_attach(struct thread *, struct int extattr_list_fd(struct thread *, struct extattr_list_fd_args *); int extattr_list_file(struct thread *, struct extattr_list_file_args *); int extattr_list_link(struct thread *, struct extattr_list_link_args *); -int kse_switchin(struct thread *, struct kse_switchin_args *); int ksem_timedwait(struct thread *, struct ksem_timedwait_args *); int thr_suspend(struct thread *, struct thr_suspend_args *); int thr_wake(struct thread *, struct thr_wake_args *); @@ -2371,11 +2343,6 @@ int freebsd4_sigreturn(struct thread *, #define SYS_AUE_nfsclnt AUE_NULL #define SYS_AUE_eaccess AUE_EACCESS #define SYS_AUE_nmount AUE_NMOUNT -#define SYS_AUE_kse_exit AUE_NULL -#define SYS_AUE_kse_wakeup AUE_NULL -#define SYS_AUE_kse_create AUE_NULL -#define SYS_AUE_kse_thr_interrupt AUE_NULL -#define SYS_AUE_kse_release AUE_NULL #define SYS_AUE___mac_get_proc AUE_NULL #define SYS_AUE___mac_set_proc AUE_NULL #define SYS_AUE___mac_get_fd AUE_NULL @@ -2428,7 +2395,6 @@ int freebsd4_sigreturn(struct thread *, #define SYS_AUE_extattr_list_fd AUE_EXTATTR_LIST_FD #define SYS_AUE_extattr_list_file AUE_EXTATTR_LIST_FILE #define SYS_AUE_extattr_list_link AUE_EXTATTR_LIST_LINK -#define SYS_AUE_kse_switchin AUE_NULL #define SYS_AUE_ksem_timedwait AUE_NULL #define SYS_AUE_thr_suspend AUE_NULL #define SYS_AUE_thr_wake AUE_NULL Index: sys/systm.h =================================================================== RCS file: /home/ncvs/src/sys/sys/systm.h,v retrieving revision 1.263 diff -u -p -r1.263 systm.h --- sys/systm.h 16 Dec 2007 06:21:20 -0000 1.263 +++ sys/systm.h 12 Mar 2008 08:42:41 -0000 @@ -116,7 +116,6 @@ struct lock_object; struct malloc_type; struct mtx; struct proc; -struct kse; struct socket; struct thread; struct tty; Index: vm/vm_glue.c =================================================================== RCS file: /home/ncvs/src/sys/vm/vm_glue.c,v retrieving revision 1.227 diff -u -p -r1.227 vm_glue.c --- vm/vm_glue.c 12 Mar 2008 06:31:06 -0000 1.227 +++ vm/vm_glue.c 12 Mar 2008 08:42:41 -0000 @@ -663,8 +663,6 @@ faultin(p) * is enough space for them. Of course, if a process waits for a long * time, it will be swapped in anyway. * - * XXXKSE - process with the thread with highest priority counts.. - * * Giant is held on entry. */ /* ARGSUSED*/ Index: vm/vm_map.c =================================================================== RCS file: /home/ncvs/src/sys/vm/vm_map.c,v retrieving revision 1.392 diff -u -p -r1.392 vm_map.c --- vm/vm_map.c 4 Jan 2008 04:33:13 -0000 1.392 +++ vm/vm_map.c 12 Mar 2008 08:42:41 -0000 @@ -3036,7 +3036,7 @@ vmspace_exec(struct proc *p, vm_offset_t PROC_VMSPACE_LOCK(p); p->p_vmspace = newvmspace; PROC_VMSPACE_UNLOCK(p); - if (p == curthread->td_proc) /* XXXKSE ? */ + if (p == curthread->td_proc) pmap_activate(curthread); vmspace_free(oldvmspace); return (0); @@ -3060,7 +3060,7 @@ vmspace_unshare(struct proc *p) PROC_VMSPACE_LOCK(p); p->p_vmspace = newvmspace; PROC_VMSPACE_UNLOCK(p); - if (p == curthread->td_proc) /* XXXKSE ? */ + if (p == curthread->td_proc) pmap_activate(curthread); vmspace_free(oldvmspace); return (0);