Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Use struct segment_descriptor for pcb_fsd and pcb_gsd in...
details: https://anonhg.NetBSD.org/src/rev/9a95b8a676b1
branches: trunk
changeset: 754203:9a95b8a676b1
user: joerg <joerg%NetBSD.org@localhost>
date: Fri Apr 23 16:07:33 2010 +0000
description:
Use struct segment_descriptor for pcb_fsd and pcb_gsd instead of int[2].
diffstat:
sys/arch/i386/i386/machdep.c | 12 ++++++------
sys/arch/i386/include/pcb.h | 6 +++---
sys/arch/x86/x86/sys_machdep.c | 8 ++++----
sys/arch/x86/x86/vm_machdep.c | 8 ++++----
sys/compat/linux/arch/i386/linux_exec_machdep.c | 6 +++---
5 files changed, 20 insertions(+), 20 deletions(-)
diffs (147 lines):
diff -r 071917fd3a54 -r 9a95b8a676b1 sys/arch/i386/i386/machdep.c
--- a/sys/arch/i386/i386/machdep.c Fri Apr 23 15:52:26 2010 +0000
+++ b/sys/arch/i386/i386/machdep.c Fri Apr 23 16:07:33 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.685 2010/04/18 23:47:51 jym Exp $ */
+/* $NetBSD: machdep.c,v 1.686 2010/04/23 16:07:33 joerg Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.685 2010/04/18 23:47:51 jym Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.686 2010/04/23 16:07:33 joerg Exp $");
#include "opt_beep.h"
#include "opt_compat_ibcs2.h"
@@ -519,8 +519,8 @@
pcb->pcb_esp0 = uvm_lwp_getuarea(l) + KSTACK_SIZE - 16;
pcb->pcb_iopl = SEL_KPL;
l->l_md.md_regs = (struct trapframe *)pcb->pcb_esp0 - 1;
- memcpy(pcb->pcb_fsd, &gdt[GUDATA_SEL], sizeof(pcb->pcb_fsd));
- memcpy(pcb->pcb_gsd, &gdt[GUDATA_SEL], sizeof(pcb->pcb_gsd));
+ memcpy(&pcb->pcb_fsd, &gdt[GUDATA_SEL], sizeof(pcb->pcb_fsd));
+ memcpy(&pcb->pcb_gsd, &gdt[GUDATA_SEL], sizeof(pcb->pcb_gsd));
#ifndef XEN
lldt(pmap_kernel()->pm_ldt_sel);
@@ -1007,8 +1007,8 @@
pcb->pcb_savefpu.sv_xmm.sv_env.en_mxcsr = __INITIAL_MXCSR__;
} else
pcb->pcb_savefpu.sv_87.sv_env.en_cw = __NetBSD_NPXCW__;
- memcpy(pcb->pcb_fsd, &gdt[GUDATA_SEL], sizeof(pcb->pcb_fsd));
- memcpy(pcb->pcb_gsd, &gdt[GUDATA_SEL], sizeof(pcb->pcb_gsd));
+ memcpy(&pcb->pcb_fsd, &gdt[GUDATA_SEL], sizeof(pcb->pcb_fsd));
+ memcpy(&pcb->pcb_gsd, &gdt[GUDATA_SEL], sizeof(pcb->pcb_gsd));
tf = l->l_md.md_regs;
#ifndef XEN
diff -r 071917fd3a54 -r 9a95b8a676b1 sys/arch/i386/include/pcb.h
--- a/sys/arch/i386/include/pcb.h Fri Apr 23 15:52:26 2010 +0000
+++ b/sys/arch/i386/include/pcb.h Fri Apr 23 16:07:33 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pcb.h,v 1.47 2009/03/21 14:41:30 ad Exp $ */
+/* $NetBSD: pcb.h,v 1.48 2010/04/23 16:07:33 joerg Exp $ */
/*-
* Copyright (c) 1998, 2009 The NetBSD Foundation, Inc.
@@ -94,8 +94,8 @@
/* floating point state for FPU */
union savefpu pcb_savefpu __aligned(16);
- int pcb_fsd[2]; /* %fs descriptor */
- int pcb_gsd[2]; /* %gs descriptor */
+ struct segment_descriptor pcb_fsd; /* %fs descriptor */
+ struct segment_descriptor pcb_gsd; /* %gs descriptor */
void * pcb_onfault; /* copyin/out fault recovery */
int vm86_eflags; /* virtual eflags for vm86 mode */
int vm86_flagmask; /* flag mask for vm86 mode */
diff -r 071917fd3a54 -r 9a95b8a676b1 sys/arch/x86/x86/sys_machdep.c
--- a/sys/arch/x86/x86/sys_machdep.c Fri Apr 23 15:52:26 2010 +0000
+++ b/sys/arch/x86/x86/sys_machdep.c Fri Apr 23 16:07:33 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sys_machdep.c,v 1.22 2009/11/21 03:11:02 rmind Exp $ */
+/* $NetBSD: sys_machdep.c,v 1.23 2010/04/23 16:07:33 joerg Exp $ */
/*-
* Copyright (c) 1998, 2007, 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.22 2009/11/21 03:11:02 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.23 2010/04/23 16:07:33 joerg Exp $");
#include "opt_mtrr.h"
#include "opt_perfctrs.h"
@@ -641,10 +641,10 @@
switch (which) {
case 'f':
- sd = (struct segment_descriptor *)&curpcb->pcb_fsd;
+ sd = &curpcb->pcb_fsd;
break;
case 'g':
- sd = (struct segment_descriptor *)&curpcb->pcb_gsd;
+ sd = &curpcb->pcb_gsd;
break;
default:
panic("x86_get_sdbase");
diff -r 071917fd3a54 -r 9a95b8a676b1 sys/arch/x86/x86/vm_machdep.c
--- a/sys/arch/x86/x86/vm_machdep.c Fri Apr 23 15:52:26 2010 +0000
+++ b/sys/arch/x86/x86/vm_machdep.c Fri Apr 23 16:07:33 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vm_machdep.c,v 1.8 2009/11/29 04:15:43 rmind Exp $ */
+/* $NetBSD: vm_machdep.c,v 1.9 2010/04/23 16:07:33 joerg Exp $ */
/*-
* Copyright (c) 1982, 1986 The Regents of the University of California.
@@ -80,7 +80,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.8 2009/11/29 04:15:43 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.9 2010/04/23 16:07:33 joerg Exp $");
#include "opt_mtrr.h"
@@ -194,8 +194,8 @@
pcb2->pcb_esp0 = (uv + KSTACK_SIZE - 16);
tf = (struct trapframe *)pcb2->pcb_esp0 - 1;
- memcpy(&pcb2->pcb_fsd, pcb1->pcb_fsd, sizeof(pcb2->pcb_fsd));
- memcpy(&pcb2->pcb_gsd, pcb1->pcb_gsd, sizeof(pcb2->pcb_gsd));
+ memcpy(&pcb2->pcb_fsd, &pcb1->pcb_fsd, sizeof(pcb2->pcb_fsd));
+ memcpy(&pcb2->pcb_gsd, &pcb1->pcb_gsd, sizeof(pcb2->pcb_gsd));
pcb2->pcb_iomap = NULL;
#endif
l2->l_md.md_regs = tf;
diff -r 071917fd3a54 -r 9a95b8a676b1 sys/compat/linux/arch/i386/linux_exec_machdep.c
--- a/sys/compat/linux/arch/i386/linux_exec_machdep.c Fri Apr 23 15:52:26 2010 +0000
+++ b/sys/compat/linux/arch/i386/linux_exec_machdep.c Fri Apr 23 16:07:33 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_exec_machdep.c,v 1.14 2009/11/23 00:46:06 rmind Exp $ */
+/* $NetBSD: linux_exec_machdep.c,v 1.15 2010/04/23 16:07:33 joerg Exp $ */
/*-
* Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_exec_machdep.c,v 1.14 2009/11/23 00:46:06 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_exec_machdep.c,v 1.15 2010/04/23 16:07:33 joerg Exp $");
#if defined(_KERNEL_OPT)
#include "opt_vm86.h"
@@ -296,7 +296,7 @@
idx = GUGS_SEL;
(void)memset(&info, 0, sizeof(info));
- (void)memcpy(&sd, pcb->pcb_gsd, sizeof(sd));
+ (void)memcpy(&sd, &pcb->pcb_gsd, sizeof(sd));
(void)memcpy(&desc, &sd, sizeof(desc));
info.entry_number = idx;
Home |
Main Index |
Thread Index |
Old Index