Use struct segment_descriptor for pcb_fsd and pcb_gsd instead of int[2].

This commit is contained in:
joerg 2010-04-23 16:07:33 +00:00
parent f6ac0eab50
commit f5b7f56dbd
5 changed files with 20 additions and 20 deletions

View File

@ -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 @@ i386_proc0_tss_ldt_init(void)
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 @@ setregs(struct lwp *l, struct exec_package *pack, vaddr_t stack)
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

View File

@ -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 @@ struct pcb {
/* 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 */

View File

@ -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 @@ x86_get_sdbase(void *arg, char which)
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");

View File

@ -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 @@ cpu_lwp_fork(struct lwp *l1, struct lwp *l2, void *stack, size_t stacksize,
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;

View File

@ -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 @@ linux_sys_get_thread_area(struct lwp *l,
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;