cpu_switch.S (237027) | cpu_switch.S (237037) |
---|---|
1/*- 2 * Copyright (c) 2003 Peter Wemm. 3 * Copyright (c) 1990 The Regents of the University of California. 4 * All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * William Jolitz. 8 * --- 16 unchanged lines hidden (view full) --- 25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * | 1/*- 2 * Copyright (c) 2003 Peter Wemm. 3 * Copyright (c) 1990 The Regents of the University of California. 4 * All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * William Jolitz. 8 * --- 16 unchanged lines hidden (view full) --- 25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * |
33 * $FreeBSD: head/sys/amd64/amd64/cpu_switch.S 237027 2012-06-13 21:03:01Z jkim $ | 33 * $FreeBSD: head/sys/amd64/amd64/cpu_switch.S 237037 2012-06-13 22:53:56Z jkim $ |
34 */ 35 36#include <machine/asmacros.h> 37#include <machine/specialreg.h> 38 39#include "assym.s" 40#include "opt_sched.h" 41 --- 347 unchanged lines hidden (view full) --- 389 3902: movq %rsi,%cr0 /* The previous %cr0 is saved in %rsi. */ 391 392 movl $1,%eax 393 ret 394END(savectx) 395 396/* | 34 */ 35 36#include <machine/asmacros.h> 37#include <machine/specialreg.h> 38 39#include "assym.s" 40#include "opt_sched.h" 41 --- 347 unchanged lines hidden (view full) --- 389 3902: movq %rsi,%cr0 /* The previous %cr0 is saved in %rsi. */ 391 392 movl $1,%eax 393 ret 394END(savectx) 395 396/* |
397 * resumectx(pcb, cr3) | 397 * resumectx(pcb) |
398 * Resuming processor state from pcb. 399 */ 400ENTRY(resumectx) 401 /* Switch to KPML4phys. */ | 398 * Resuming processor state from pcb. 399 */ 400ENTRY(resumectx) 401 /* Switch to KPML4phys. */ |
402 movq %rsi,%cr3 | 402 movq KPML4phys,%rax 403 movq %rax,%cr3 |
403 404 /* Force kernel segment registers. */ 405 movl $KDSEL,%eax 406 movw %ax,%ds 407 movw %ax,%es 408 movw %ax,%ss 409 movl $KUF32SEL,%eax 410 movw %ax,%fs --- 130 unchanged lines hidden --- | 404 405 /* Force kernel segment registers. */ 406 movl $KDSEL,%eax 407 movw %ax,%ds 408 movw %ax,%es 409 movw %ax,%ss 410 movl $KUF32SEL,%eax 411 movw %ax,%fs --- 130 unchanged lines hidden --- |