Adapt hp300 to yamt-idlelwp. Tested on 9000/382.

This commit is contained in:
tsutsui 2007-05-18 10:15:08 +00:00
parent bbf9e3d14a
commit ed39f92a7f
5 changed files with 16 additions and 27 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: genassym.cf,v 1.34 2006/07/20 13:21:38 tsutsui Exp $
# $NetBSD: genassym.cf,v 1.35 2007/05/18 10:15:08 tsutsui Exp $
#
# Copyright (c) 1982, 1990, 1993
@ -156,8 +156,6 @@ define MAXADDR MAXADDR
# 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)

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.138 2006/09/09 19:45:49 tsutsui Exp $ */
/* $NetBSD: locore.s,v 1.139 2007/05/18 10:15:09 tsutsui Exp $ */
/*
* Copyright (c) 1980, 1990, 1993
@ -555,7 +555,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
@ -1248,11 +1249,6 @@ Ldorte:
*/
#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.
*/
@ -1575,9 +1571,6 @@ GLOBAL(prototc)
GLOBAL(internalhpib)
.long 1 | has internal HP-IB, default to yes
GLOBAL(want_resched)
.long 0
GLOBAL(proc0paddr)
.long 0 | KVA of lwp0 u-area

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.194 2007/03/05 12:50:15 tsutsui Exp $ */
/* $NetBSD: machdep.c,v 1.195 2007/05/18 10:15:09 tsutsui Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.194 2007/03/05 12:50:15 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.195 2007/05/18 10:15:09 tsutsui Exp $");
#include "opt_ddb.h"
#include "opt_compat_hpux.h"
@ -649,7 +649,7 @@ cpu_reboot(int howto, char *bootstr)
(void)&howto;
#endif
/* take a snap shot before clobbering any registers */
if (curlwp && curlwp->l_addr)
if (curlwp->l_addr)
savectx(&curlwp->l_addr->u_pcb);
/* If system is cold, just halt. */

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.129 2007/03/04 05:59:50 christos Exp $ */
/* $NetBSD: trap.c,v 1.130 2007/05/18 10:15:10 tsutsui Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.129 2007/03/04 05:59:50 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.130 2007/05/18 10:15:10 tsutsui Exp $");
#include "opt_ddb.h"
#include "opt_execfmt.h"
@ -303,8 +303,6 @@ trap(int type, u_int code, u_int 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
@ -584,7 +582,7 @@ trap(int type, u_int code, u_int v, struct frame frame)
l->l_pflag &= ~LP_OWEUPC;
ADDUPROF(l);
}
if (want_resched)
if (curcpu()->ci_want_resched)
preempt();
goto out;

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu.h,v 1.51 2007/03/04 11:23:26 tsutsui Exp $ */
/* $NetBSD: cpu.h,v 1.52 2007/05/18 10:15:10 tsutsui Exp $ */
/*
* Copyright (c) 1982, 1990, 1993
@ -105,6 +105,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;
@ -147,15 +148,16 @@ 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
* buffer pages are invalid. On the hp300, request an ast to send us
* through trap, marking the proc as needing a profiling tick.
*/
#define cpu_need_proftick(l) { (l)->l_flag |= LP_OWEUPC; aston(); }
#define cpu_need_proftick(l) \
do { (l)->l_flag |= LP_OWEUPC; aston(); } while (/* CONSTCOND */0)
/*
* Notify the current process (p) that it has a signal pending,
@ -197,8 +199,6 @@ void m68881_save(struct fpframe *);
void m68881_restore(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);