Deleted Added
full compact
machdep.c (214681) machdep.c (214835)
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 *

--- 24 unchanged lines hidden (view full) ---

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 */
39
40#include <sys/cdefs.h>
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 *

--- 24 unchanged lines hidden (view full) ---

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 */
39
40#include <sys/cdefs.h>
41__FBSDID("$FreeBSD: head/sys/i386/i386/machdep.c 214681 2010-11-02 17:56:16Z jhb $");
41__FBSDID("$FreeBSD: head/sys/i386/i386/machdep.c 214835 2010-11-05 13:42:58Z jhb $");
42
43#include "opt_apic.h"
44#include "opt_atalk.h"
45#include "opt_compat.h"
46#include "opt_cpu.h"
47#include "opt_ddb.h"
48#include "opt_inet.h"
49#include "opt_ipx.h"

--- 2942 unchanged lines hidden (view full) ---

2992
2993 pcpu->pc_acpi_id = 0xffffffff;
2994}
2995
2996void
2997spinlock_enter(void)
2998{
2999 struct thread *td;
42
43#include "opt_apic.h"
44#include "opt_atalk.h"
45#include "opt_compat.h"
46#include "opt_cpu.h"
47#include "opt_ddb.h"
48#include "opt_inet.h"
49#include "opt_ipx.h"

--- 2942 unchanged lines hidden (view full) ---

2992
2993 pcpu->pc_acpi_id = 0xffffffff;
2994}
2995
2996void
2997spinlock_enter(void)
2998{
2999 struct thread *td;
3000 register_t flags;
3000
3001 td = curthread;
3001
3002 td = curthread;
3002 if (td->td_md.md_spinlock_count == 0)
3003 td->td_md.md_saved_flags = intr_disable();
3004 td->td_md.md_spinlock_count++;
3003 if (td->td_md.md_spinlock_count == 0) {
3004 flags = intr_disable();
3005 td->td_md.md_spinlock_count = 1;
3006 td->td_md.md_saved_flags = flags;
3007 } else
3008 td->td_md.md_spinlock_count++;
3005 critical_enter();
3006}
3007
3008void
3009spinlock_exit(void)
3010{
3011 struct thread *td;
3009 critical_enter();
3010}
3011
3012void
3013spinlock_exit(void)
3014{
3015 struct thread *td;
3016 register_t flags;
3012
3013 td = curthread;
3014 critical_exit();
3017
3018 td = curthread;
3019 critical_exit();
3020 flags = td->td_md.md_saved_flags;
3015 td->td_md.md_spinlock_count--;
3016 if (td->td_md.md_spinlock_count == 0)
3021 td->td_md.md_spinlock_count--;
3022 if (td->td_md.md_spinlock_count == 0)
3017 intr_restore(td->td_md.md_saved_flags);
3023 intr_restore(flags);
3018}
3019
3020#if defined(I586_CPU) && !defined(NO_F00F_HACK)
3021static void f00f_hack(void *unused);
3022SYSINIT(f00f_hack, SI_SUB_INTRINSIC, SI_ORDER_FIRST, f00f_hack, NULL);
3023
3024static void
3025f00f_hack(void *unused)

--- 705 unchanged lines hidden ---
3024}
3025
3026#if defined(I586_CPU) && !defined(NO_F00F_HACK)
3027static void f00f_hack(void *unused);
3028SYSINIT(f00f_hack, SI_SUB_INTRINSIC, SI_ORDER_FIRST, f00f_hack, NULL);
3029
3030static void
3031f00f_hack(void *unused)

--- 705 unchanged lines hidden ---