Adapt to the merge of yamt-idlelwp branch.
tested on my X68030.
This commit is contained in:
parent
b95973aaa7
commit
2440803ee4
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: cpu.h,v 1.38 2007/03/04 06:01:07 christos Exp $ */
|
||||
/* $NetBSD: cpu.h,v 1.39 2007/05/19 14:19:39 isaki Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1990, 1993
|
||||
@ -106,6 +106,7 @@ struct cpu_info {
|
||||
struct cpu_data ci_data; /* MI per-cpu data */
|
||||
int ci_mtx_count;
|
||||
int ci_mtx_oldspl;
|
||||
int ci_want_resched;
|
||||
};
|
||||
|
||||
extern struct cpu_info cpu_info_store;
|
||||
@ -148,8 +149,8 @@ struct clockframe {
|
||||
* Preempt the current process if in interrupt from user mode,
|
||||
* or after the current trap/syscall if in system mode.
|
||||
*/
|
||||
extern int want_resched; /* resched() was called */
|
||||
#define cpu_need_resched(ci) { want_resched++; aston(); }
|
||||
#define cpu_need_resched(ci, flags) \
|
||||
do { (ci)->ci_want_resched = 1; aston(); } while (/* CONSTCOND */ 0)
|
||||
|
||||
/*
|
||||
* Give a profiling tick to the current process when the user profiling
|
||||
@ -204,8 +205,6 @@ struct pcb;
|
||||
struct fpframe;
|
||||
int suline(void *, void *);
|
||||
void savectx(struct pcb *);
|
||||
void switch_exit(struct lwp *);
|
||||
void switch_lwp_exit(struct lwp *);
|
||||
void proc_trampoline(void);
|
||||
void loadustp(int);
|
||||
void m68881_save(struct fpframe *);
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: genassym.cf,v 1.25 2005/12/11 12:19:45 christos Exp $
|
||||
# $NetBSD: genassym.cf,v 1.26 2007/05/19 14:19:39 isaki Exp $
|
||||
|
||||
#
|
||||
# Copyright (c) 1982, 1990, 1993
|
||||
@ -109,8 +109,6 @@ define USRSTACK USRSTACK
|
||||
|
||||
# lwp & proc fields and values
|
||||
define L_ADDR offsetof(struct lwp, l_addr)
|
||||
define L_BACK offsetof(struct lwp, l_back)
|
||||
define L_FORW offsetof(struct lwp, l_forw)
|
||||
define L_PRIORITY offsetof(struct lwp, l_priority)
|
||||
define L_STAT offsetof(struct lwp, l_stat)
|
||||
define L_WCHAN offsetof(struct lwp, l_wchan)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: locore.s,v 1.77 2007/03/04 02:17:15 tsutsui Exp $ */
|
||||
/* $NetBSD: locore.s,v 1.78 2007/05/19 14:19:39 isaki Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1990, 1993
|
||||
@ -959,7 +959,8 @@ Lenab1:
|
||||
/* set kernel stack, user SP, and initial pcb */
|
||||
movl _C_LABEL(proc0paddr),%a1 | get lwp0 pcb addr
|
||||
lea %a1@(USPACE-4),%sp | set kernel stack to end of area
|
||||
lea _C_LABEL(lwp0),%a2 | initialize lwp0.l_addr so that
|
||||
lea _C_LABEL(lwp0),%a2 | initialize lwp0.l_addr
|
||||
movl %a2,_C_LABEL(curlwp) | and curlwp so that
|
||||
movl %a1,%a2@(L_ADDR) | we don't deref NULL in trap()
|
||||
movl #USRSTACK-4,%a2
|
||||
movl %a2,%usp | init user SP
|
||||
@ -1025,11 +1026,6 @@ Lenab3:
|
||||
*/
|
||||
#include <m68k/m68k/support.s>
|
||||
|
||||
/*
|
||||
* Use common m68k process manipulation routines.
|
||||
*/
|
||||
#include <m68k/m68k/proc_subr.s>
|
||||
|
||||
/*
|
||||
* Use common m68k process/lwp switch and context save subroutines.
|
||||
*/
|
||||
@ -1287,9 +1283,6 @@ GLOBAL(fputype)
|
||||
GLOBAL(protorp)
|
||||
.long 0,0 | prototype root pointer
|
||||
|
||||
GLOBAL(want_resched)
|
||||
.long 0
|
||||
|
||||
GLOBAL(proc0paddr)
|
||||
.long 0 | KVA of lwp0 u-area
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: machdep.c,v 1.141 2007/05/12 06:31:19 isaki Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.142 2007/05/19 14:19:39 isaki Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1990, 1993
|
||||
@ -77,7 +77,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.141 2007/05/12 06:31:19 isaki Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.142 2007/05/19 14:19:39 isaki Exp $");
|
||||
|
||||
#include "opt_ddb.h"
|
||||
#include "opt_kgdb.h"
|
||||
@ -477,7 +477,7 @@ void
|
||||
cpu_reboot(int howto, char *bootstr)
|
||||
{
|
||||
/* take a snap shot before clobbering any registers */
|
||||
if (curlwp && curlwp->l_addr)
|
||||
if (curlwp->l_addr)
|
||||
savectx(&curlwp->l_addr->u_pcb);
|
||||
|
||||
boothowto = howto;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: trap.c,v 1.87 2007/03/21 05:15:50 isaki Exp $ */
|
||||
/* $NetBSD: trap.c,v 1.88 2007/05/19 14:19:39 isaki Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1990, 1993
|
||||
@ -77,7 +77,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.87 2007/03/21 05:15:50 isaki Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.88 2007/05/19 14:19:39 isaki Exp $");
|
||||
|
||||
#include "opt_ddb.h"
|
||||
#include "opt_kgdb.h"
|
||||
@ -311,8 +311,6 @@ trap(int type, unsigned code, unsigned v, struct frame frame)
|
||||
KSI_INIT_TRAP(&ksi);
|
||||
ksi.ksi_trap = type & ~T_USER;
|
||||
|
||||
if (l == NULL)
|
||||
l = &lwp0;
|
||||
p = l->l_proc;
|
||||
|
||||
#ifdef DIAGNOSTIC
|
||||
@ -611,7 +609,7 @@ trap(int type, unsigned code, unsigned v, struct frame frame)
|
||||
l->l_pflag &= ~LP_OWEUPC;
|
||||
ADDUPROF(l);
|
||||
}
|
||||
if (want_resched)
|
||||
if (curcpu()->ci_want_resched)
|
||||
preempt();
|
||||
goto out;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user