Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-6]: src/sys/arch/amd64/amd64 Pull up following revision(s) (reque...
details: https://anonhg.NetBSD.org/src/rev/b6464a852e16
branches: netbsd-6
changeset: 774053:b6464a852e16
user: riz <riz%NetBSD.org@localhost>
date: Mon May 07 15:58:04 2012 +0000
description:
Pull up following revision(s) (requested by christos in ticket #212):
sys/arch/amd64/amd64/machdep.c: revision 1.181
Fix check_mcontext for PK_32 binaries. Makes gdb work for i386 binaries on
amd64.
diffstat:
sys/arch/amd64/amd64/machdep.c | 26 ++++++++++++++++++--------
1 files changed, 18 insertions(+), 8 deletions(-)
diffs (75 lines):
diff -r 01217ddc5838 -r b6464a852e16 sys/arch/amd64/amd64/machdep.c
--- a/sys/arch/amd64/amd64/machdep.c Mon May 07 03:17:51 2012 +0000
+++ b/sys/arch/amd64/amd64/machdep.c Mon May 07 15:58:04 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.175.2.3 2012/03/22 22:50:48 riz Exp $ */
+/* $NetBSD: machdep.c,v 1.175.2.4 2012/05/07 15:58:04 riz Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@@ -111,7 +111,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.175.2.3 2012/03/22 22:50:48 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.175.2.4 2012/05/07 15:58:04 riz Exp $");
/* #define XENDEBUG_LOW */
@@ -2111,6 +2111,7 @@
uint16_t sel;
int error;
struct pmap *pmap = l->l_proc->p_vmspace->vm_map.pmap;
+ struct proc *p = l->l_proc;
gr = mcp->__gregs;
@@ -2144,33 +2145,42 @@
return error;
#endif
} else {
+#define VUD(sel) \
+ ((p->p_flag & PK_32) ? VALID_USER_DSEL32(sel) : VALID_USER_DSEL(sel))
sel = gr[_REG_ES] & 0xffff;
- if (sel != 0 && !VALID_USER_DSEL(sel))
+ if (sel != 0 && !VUD(sel))
return EINVAL;
+/* XXX: Shouldn't this be FSEL32? */
+#define VUF(sel) \
+ ((p->p_flag & PK_32) ? VALID_USER_DSEL32(sel) : VALID_USER_DSEL(sel))
sel = gr[_REG_FS] & 0xffff;
- if (sel != 0 && !VALID_USER_DSEL(sel))
+ if (sel != 0 && !VUF(sel))
return EINVAL;
+#define VUG(sel) \
+ ((p->p_flag & PK_32) ? VALID_USER_GSEL32(sel) : VALID_USER_DSEL(sel))
sel = gr[_REG_GS] & 0xffff;
- if (sel != 0 && !VALID_USER_DSEL(sel))
+ if (sel != 0 && !VUG(sel))
return EINVAL;
sel = gr[_REG_DS] & 0xffff;
- if (!VALID_USER_DSEL(sel))
+ if (!VUD(sel))
return EINVAL;
#ifndef XEN
sel = gr[_REG_SS] & 0xffff;
- if (!VALID_USER_DSEL(sel))
+ if (!VUD(sel))
return EINVAL;
#endif
}
#ifndef XEN
+#define VUC(sel) \
+ ((p->p_flag & PK_32) ? VALID_USER_CSEL32(sel) : VALID_USER_CSEL(sel))
sel = gr[_REG_CS] & 0xffff;
- if (!VALID_USER_CSEL(sel))
+ if (!VUC(sel))
return EINVAL;
#endif
Home |
Main Index |
Thread Index |
Old Index