Move md_flags back to mdproc. MDP_FIXALIGN, the only flag we have, is
per-process, not per-lwp. We don't have per-lwp flags currently.
This commit is contained in:
parent
2a0a441743
commit
ab5d782da8
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: proc.h,v 1.13 2005/07/10 17:02:19 christos Exp $ */
|
||||
/* $NetBSD: proc.h,v 1.14 2005/10/26 23:21:47 uwe Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
|
@ -44,31 +44,34 @@
|
|||
#define _SPARC_PROC_H_
|
||||
|
||||
/*
|
||||
* Machine-dependent part of the proc structure for SPARC.
|
||||
* Machine-dependent parts of the lwp and proc structures for SPARC.
|
||||
*/
|
||||
struct mdlwp {
|
||||
struct trapframe *md_tf; /* trap/syscall registers */
|
||||
struct fpstate *md_fpstate; /* fpu state, if any; always resident */
|
||||
u_long md_flags;
|
||||
struct cpu_info *md_fpu; /* Module holding FPU state */
|
||||
};
|
||||
|
||||
struct mdproc {
|
||||
void (*md_syscall)(register_t, struct trapframe *, register_t);
|
||||
u_long md_flags;
|
||||
};
|
||||
|
||||
/* md_flags */
|
||||
#define MDP_FIXALIGN 0x1 /* Fix unaligned memory accesses */
|
||||
|
||||
|
||||
/*
|
||||
* FPU context switch lock
|
||||
* Prevent interrupts that grab the kernel lock
|
||||
*/
|
||||
extern struct simplelock fpulock;
|
||||
|
||||
#define FPU_LOCK(s) do { \
|
||||
s = splclock(); \
|
||||
simple_lock(&fpulock); \
|
||||
} while (/* CONSTCOND */ 0)
|
||||
|
||||
#define FPU_UNLOCK(s) do { \
|
||||
simple_unlock(&fpulock); \
|
||||
splx(s); \
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: machdep.c,v 1.258 2005/09/14 15:03:50 he Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.259 2005/10/26 23:21:47 uwe Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -78,7 +78,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.258 2005/09/14 15:03:50 he Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.259 2005/10/26 23:21:47 uwe Exp $");
|
||||
|
||||
#include "opt_compat_netbsd.h"
|
||||
#include "opt_compat_sunos.h"
|
||||
|
@ -363,8 +363,8 @@ setregs(l, pack, stack)
|
|||
struct fpstate *fs;
|
||||
int psr;
|
||||
|
||||
/* Don't allow misaligned code by default */
|
||||
l->l_md.md_flags &= ~MDP_FIXALIGN;
|
||||
/* Don't allow unaligned data references by default */
|
||||
l->l_proc->p_md.md_flags &= ~MDP_FIXALIGN;
|
||||
|
||||
/*
|
||||
* Set the registers to 0 except for:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: trap.c,v 1.159 2005/07/10 17:02:19 christos Exp $ */
|
||||
/* $NetBSD: trap.c,v 1.160 2005/10/26 23:21:47 uwe Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996
|
||||
|
@ -49,7 +49,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.159 2005/07/10 17:02:19 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.160 2005/10/26 23:21:47 uwe Exp $");
|
||||
|
||||
#include "opt_ddb.h"
|
||||
#include "opt_ktrace.h"
|
||||
|
@ -574,7 +574,7 @@ badtrap:
|
|||
break;
|
||||
|
||||
case T_ALIGN:
|
||||
if ((l->l_md.md_flags & MDP_FIXALIGN) != 0) {
|
||||
if ((p->p_md.md_flags & MDP_FIXALIGN) != 0) {
|
||||
KERNEL_PROC_LOCK(l);
|
||||
n = fixalign(l, tf);
|
||||
KERNEL_PROC_UNLOCK(l);
|
||||
|
@ -687,7 +687,7 @@ badtrap:
|
|||
uprintf("T_FIXALIGN\n");
|
||||
#endif
|
||||
/* User wants us to fix alignment faults */
|
||||
l->l_md.md_flags |= MDP_FIXALIGN;
|
||||
p->p_md.md_flags |= MDP_FIXALIGN;
|
||||
ADVANCE;
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in New Issue