support.s (171916) | support.s (181430) |
---|---|
1/*- 2 * Copyright (c) 1993 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * | 1/*- 2 * Copyright (c) 1993 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * |
29 * $FreeBSD: head/sys/i386/i386/support.s 171916 2007-08-22 05:06:14Z jkoshy $ | 29 * $FreeBSD: head/sys/i386/i386/support.s 181430 2008-08-08 16:26:53Z stas $ |
30 */ 31 32#include "opt_npx.h" 33 34#include <machine/asmacros.h> 35#include <machine/cputypes.h> 36#include <machine/intr_machdep.h> 37#include <machine/pmap.h> --- 1525 unchanged lines hidden (view full) --- 1563 .text 1564NON_GPROF_ENTRY(__bb_init_func) 1565 movl 4(%esp),%eax 1566 movl $1,(%eax) 1567 movl bbhead,%edx 1568 movl %edx,16(%eax) 1569 movl %eax,bbhead 1570 NON_GPROF_RET | 30 */ 31 32#include "opt_npx.h" 33 34#include <machine/asmacros.h> 35#include <machine/cputypes.h> 36#include <machine/intr_machdep.h> 37#include <machine/pmap.h> --- 1525 unchanged lines hidden (view full) --- 1563 .text 1564NON_GPROF_ENTRY(__bb_init_func) 1565 movl 4(%esp),%eax 1566 movl $1,(%eax) 1567 movl bbhead,%edx 1568 movl %edx,16(%eax) 1569 movl %eax,bbhead 1570 NON_GPROF_RET |
1571 1572/* 1573 * Support for reading MSRs in the safe manner. 1574 */ 1575ENTRY(rdmsr_safe) 1576/* int rdmsr_safe(u_int msr, uint64_t *data) */ 1577 movl PCPU(CURPCB),%ecx 1578 movl $msr_onfault,PCB_ONFAULT(%ecx) 1579 1580 movl 4(%esp),%ecx 1581 rdmsr 1582 movl 8(%esp),%ecx 1583 movl %eax,(%ecx) 1584 movl %edx,4(%ecx) 1585 xorl %eax,%eax 1586 1587 movl PCPU(CURPCB),%ecx 1588 movl %eax,PCB_ONFAULT(%ecx) 1589 1590 ret 1591 1592/* 1593 * Support for writing MSRs in the safe manner. 1594 */ 1595ENTRY(wrmsr_safe) 1596/* int wrmsr_safe(u_int msr, uint64_t data) */ 1597 movl PCPU(CURPCB),%ecx 1598 movl $msr_onfault,PCB_ONFAULT(%ecx) 1599 1600 movl 4(%esp),%ecx 1601 movl 8(%esp),%eax 1602 movl 12(%esp),%edx 1603 wrmsr 1604 xorl %eax,%eax 1605 1606 movl PCPU(CURPCB),%ecx 1607 movl %eax,PCB_ONFAULT(%ecx) 1608 1609 ret 1610 1611/* 1612 * MSR operations fault handler 1613 */ 1614 ALIGN_TEXT 1615msr_onfault: 1616 movl PCPU(CURPCB),%ecx 1617 movl $0,PCB_ONFAULT(%ecx) 1618 movl $EFAULT,%eax 1619 ret |
|