machdep.c (92770) | machdep.c (93264) |
---|---|
1/*- 2 * Copyright (c) 1992 Terrence R. Lambert. 3 * Copyright (c) 1982, 1987, 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 * --- 21 unchanged lines hidden (view full) --- 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 * 37 * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 | 1/*- 2 * Copyright (c) 1992 Terrence R. Lambert. 3 * Copyright (c) 1982, 1987, 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 * --- 21 unchanged lines hidden (view full) --- 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 * 37 * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 |
38 * $FreeBSD: head/sys/i386/i386/machdep.c 92770 2002-03-20 08:56:31Z alfred $ | 38 * $FreeBSD: head/sys/i386/i386/machdep.c 93264 2002-03-27 05:39:23Z dillon $ |
39 */ 40 41#include "opt_atalk.h" 42#include "opt_compat.h" 43#include "opt_cpu.h" 44#include "opt_ddb.h" 45#include "opt_inet.h" 46#include "opt_ipx.h" --- 750 unchanged lines hidden (view full) --- 797 * is a runnable process. 798 */ 799void 800cpu_idle(void) 801{ 802#ifndef SMP 803 if (cpu_idle_hlt) { 804 disable_intr(); | 39 */ 40 41#include "opt_atalk.h" 42#include "opt_compat.h" 43#include "opt_cpu.h" 44#include "opt_ddb.h" 45#include "opt_inet.h" 46#include "opt_ipx.h" --- 750 unchanged lines hidden (view full) --- 797 * is a runnable process. 798 */ 799void 800cpu_idle(void) 801{ 802#ifndef SMP 803 if (cpu_idle_hlt) { 804 disable_intr(); |
805 if (procrunnable()) | 805 if (procrunnable()) { |
806 enable_intr(); | 806 enable_intr(); |
807 else { 808 enable_intr(); 809 __asm __volatile("hlt"); | 807 } else { 808 /* 809 * we must absolutely guarentee that hlt is the 810 * absolute next instruction after sti or we 811 * introduce a timing window. 812 */ 813 __asm __volatile("sti; hlt"); |
810 } 811 } 812#endif 813} 814 815/* 816 * Clear registers on exec 817 */ --- 870 unchanged lines hidden (view full) --- 1688 1689 /* setup curproc so that mutexes work */ 1690 PCPU_SET(curthread, &thread0); 1691 1692 LIST_INIT(&thread0.td_contested); 1693 1694 /* 1695 * Initialize mutexes. | 814 } 815 } 816#endif 817} 818 819/* 820 * Clear registers on exec 821 */ --- 870 unchanged lines hidden (view full) --- 1692 1693 /* setup curproc so that mutexes work */ 1694 PCPU_SET(curthread, &thread0); 1695 1696 LIST_INIT(&thread0.td_contested); 1697 1698 /* 1699 * Initialize mutexes. |
1700 * 1701 * icu_lock: in order to allow an interrupt to occur in a critical 1702 * section, to set pcpu->ipending (etc...) properly, we 1703 * must be able to get the icu lock, so it can't be 1704 * under witness. |
|
1696 */ 1697 mtx_init(&Giant, "Giant", MTX_DEF | MTX_RECURSE); 1698 mtx_init(&sched_lock, "sched lock", MTX_SPIN | MTX_RECURSE); 1699 mtx_init(&proc0.p_mtx, "process lock", MTX_DEF); 1700 mtx_init(&clock_lock, "clk", MTX_SPIN | MTX_RECURSE); | 1705 */ 1706 mtx_init(&Giant, "Giant", MTX_DEF | MTX_RECURSE); 1707 mtx_init(&sched_lock, "sched lock", MTX_SPIN | MTX_RECURSE); 1708 mtx_init(&proc0.p_mtx, "process lock", MTX_DEF); 1709 mtx_init(&clock_lock, "clk", MTX_SPIN | MTX_RECURSE); |
1701 mtx_init(&icu_lock, "icu", MTX_SPIN); | 1710 mtx_init(&icu_lock, "icu", MTX_SPIN | MTX_NOWITNESS); |
1702 mtx_lock(&Giant); 1703 1704 /* make ldt memory segments */ 1705 /* 1706 * XXX - VM_MAXUSER_ADDRESS is an end address, not a max. And it 1707 * should be spelled ...MAX_USER... 1708 */ 1709 ldt_segs[LUCODE_SEL].ssd_limit = atop(VM_MAXUSER_ADDRESS - 1); --- 641 unchanged lines hidden --- | 1711 mtx_lock(&Giant); 1712 1713 /* make ldt memory segments */ 1714 /* 1715 * XXX - VM_MAXUSER_ADDRESS is an end address, not a max. And it 1716 * should be spelled ...MAX_USER... 1717 */ 1718 ldt_segs[LUCODE_SEL].ssd_limit = atop(VM_MAXUSER_ADDRESS - 1); --- 641 unchanged lines hidden --- |