From owner-p4-projects Fri Sep 20 19: 9:15 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 73AA637B404; Fri, 20 Sep 2002 19:09:11 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0572737B401 for ; Fri, 20 Sep 2002 19:09:11 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8024D43E6A for ; Fri, 20 Sep 2002 19:09:10 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from freefall.freebsd.org (perforce@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g8L29ACo084911 for ; Fri, 20 Sep 2002 19:09:10 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g8L29AqN084908 for perforce@freebsd.org; Fri, 20 Sep 2002 19:09:10 -0700 (PDT) Date: Fri, 20 Sep 2002 19:09:10 -0700 (PDT) Message-Id: <200209210209.g8L29AqN084908@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm Subject: PERFORCE change 17797 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://people.freebsd.org/~peter/p4db/chv.cgi?CH=17797 Change 17797 by peter@peter_daintree on 2002/09/20 19:08:21 chop out the evil -16 offset stuff for vm86 support (no vm86!!) Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#2 edit .. //depot/projects/hammer/sys/x86_64/x86_64/swtch.s#2 edit .. //depot/projects/hammer/sys/x86_64/x86_64/sys_machdep.c#2 edit .. //depot/projects/hammer/sys/x86_64/x86_64/vm_machdep.c#2 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#2 (text+ko) ==== @@ -1823,9 +1823,8 @@ initializecpu(); /* Initialize CPU registers */ /* make an initial tss so cpu can get interrupt stack on syscall! */ - /* Note: -16 is so we can grow the trapframe if we came from vm86 */ PCPU_SET(common_tss.tss_esp0, thread0.td_kstack + - KSTACK_PAGES * PAGE_SIZE - sizeof(struct pcb) - 16); + KSTACK_PAGES * PAGE_SIZE - sizeof(struct pcb)); PCPU_SET(common_tss.tss_ss0, GSEL(GDATA_SEL, SEL_KPL)); gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); private_tss = 0; ==== //depot/projects/hammer/sys/x86_64/x86_64/swtch.s#2 (text+ko) ==== @@ -199,9 +199,8 @@ 1: /* * Use the common default TSS instead of our own. * Set our stack pointer into the TSS, it's set to just - * below the PCB. In C, common_tss.tss_esp0 = &pcb - 16; + * below the PCB. In C, common_tss.tss_esp0 = &pcb; */ - leal -16(%edx), %ebx /* leave space for vm86 */ movl %ebx, PCPU(COMMON_TSS) + TSS_ESP0 /* ==== //depot/projects/hammer/sys/x86_64/x86_64/sys_machdep.c#2 (text+ko) ==== @@ -136,9 +136,8 @@ if (ext == 0) return (ENOMEM); bzero(ext, sizeof(struct pcb_ext)); - /* -16 is so we can convert a trapframe into vm86trapframe inplace */ ext->ext_tss.tss_esp0 = td->td_kstack + ctob(KSTACK_PAGES) - - sizeof(struct pcb) - 16; + sizeof(struct pcb); ext->ext_tss.tss_ss0 = GSEL(GDATA_SEL, SEL_KPL); /* * The last byte of the i/o map must be followed by an 0xff byte. ==== //depot/projects/hammer/sys/x86_64/x86_64/vm_machdep.c#2 (text+ko) ==== @@ -69,7 +69,6 @@ #include #include #include -#include #include #include @@ -174,9 +173,8 @@ * Create a new fresh stack for the new process. * Copy the trap frame for the return to user mode as if from a * syscall. This copies most of the user mode register values. - * The -16 is so we can expand the trapframe if we go to vm86. */ - td2->td_frame = (struct trapframe *)((caddr_t)td2->td_pcb - 16) - 1; + td2->td_frame = (struct trapframe *)td2->td_pcb - 1; bcopy(td1->td_frame, td2->td_frame, sizeof(struct trapframe)); td2->td_frame->tf_eax = 0; /* Child returns zero */ @@ -304,7 +302,7 @@ td->td_pcb = (struct pcb *)(td->td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1; - td->td_frame = (struct trapframe *)((caddr_t)td->td_pcb - 16) - 1; + td->td_frame = (struct trapframe *)td->td_pcb - 1; } /* @@ -336,13 +334,12 @@ /* * Create a new fresh stack for the new thread. - * The -16 is so we can expand the trapframe if we go to vm86. * Don't forget to set this stack value into whatever supplies * the address for the fault handlers. * The contexts are filled in at the time we actually DO the * upcall as only then do we know which KSE we got. */ - td->td_frame = (struct trapframe *)((caddr_t)pcb2 - 16) - 1; + td->td_frame = (struct trapframe *)pcb2 - 1; /* * Set registers for trampoline to user mode. Leave space for the @@ -381,7 +378,7 @@ * function. */ td->td_frame->tf_esp = - (int)ke->ke_stack.ss_sp + ke->ke_stack.ss_size - 16; + (int)ke->ke_stack.ss_sp + ke->ke_stack.ss_size; td->td_frame->tf_eip = (int)ke->ke_upcall; /* To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message