Deleted Added
full compact
cpu_machdep.c (219673) cpu_machdep.c (220404)
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 219673 2011-03-15 17:19:52Z jkim $");
41__FBSDID("$FreeBSD: head/sys/i386/i386/machdep.c 220404 2011-04-06 23:59:59Z jkim $");
42
43#include "opt_atalk.h"
44#include "opt_compat.h"
45#include "opt_cpu.h"
46#include "opt_ddb.h"
47#include "opt_inet.h"
48#include "opt_ipx.h"
49#include "opt_isa.h"

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

1492 return (0);
1493 }
1494 return (EINVAL);
1495}
1496
1497SYSCTL_PROC(_machdep, OID_AUTO, idle, CTLTYPE_STRING | CTLFLAG_RW, 0, 0,
1498 idle_sysctl, "A", "currently selected idle function");
1499
42
43#include "opt_atalk.h"
44#include "opt_compat.h"
45#include "opt_cpu.h"
46#include "opt_ddb.h"
47#include "opt_inet.h"
48#include "opt_ipx.h"
49#include "opt_isa.h"

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

1492 return (0);
1493 }
1494 return (EINVAL);
1495}
1496
1497SYSCTL_PROC(_machdep, OID_AUTO, idle, CTLTYPE_STRING | CTLFLAG_RW, 0, 0,
1498 idle_sysctl, "A", "currently selected idle function");
1499
1500uint64_t (*atomic_load_acq_64)(volatile uint64_t *) =
1501 atomic_load_acq_64_i386;
1502void (*atomic_store_rel_64)(volatile uint64_t *, uint64_t) =
1503 atomic_store_rel_64_i386;
1504
1505static void
1506cpu_probe_cmpxchg8b(void)
1507{
1508
1509 if ((cpu_feature & CPUID_CX8) != 0 ||
1510 cpu_vendor_id == CPU_VENDOR_RISE) {
1511 atomic_load_acq_64 = atomic_load_acq_64_i586;
1512 atomic_store_rel_64 = atomic_store_rel_64_i586;
1513 }
1514}
1515
1500/*
1501 * Reset registers to default values on exec.
1502 */
1503void
1504exec_setregs(struct thread *td, struct image_params *imgp, u_long stack)
1505{
1506 struct trapframe *regs = td->td_frame;
1507 struct pcb *pcb = td->td_pcb;

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

2725 thread0.td_pcb->pcb_cr3 = (int)IdlePTD;
2726#endif
2727 thread0.td_pcb->pcb_ext = 0;
2728 thread0.td_frame = &proc0_tf;
2729 thread0.td_pcb->pcb_fsd = PCPU_GET(fsgs_gdt)[0];
2730 thread0.td_pcb->pcb_gsd = PCPU_GET(fsgs_gdt)[1];
2731
2732 cpu_probe_amdc1e();
1516/*
1517 * Reset registers to default values on exec.
1518 */
1519void
1520exec_setregs(struct thread *td, struct image_params *imgp, u_long stack)
1521{
1522 struct trapframe *regs = td->td_frame;
1523 struct pcb *pcb = td->td_pcb;

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

2741 thread0.td_pcb->pcb_cr3 = (int)IdlePTD;
2742#endif
2743 thread0.td_pcb->pcb_ext = 0;
2744 thread0.td_frame = &proc0_tf;
2745 thread0.td_pcb->pcb_fsd = PCPU_GET(fsgs_gdt)[0];
2746 thread0.td_pcb->pcb_gsd = PCPU_GET(fsgs_gdt)[1];
2747
2748 cpu_probe_amdc1e();
2749 cpu_probe_cmpxchg8b();
2733}
2734
2735#else
2736void
2737init386(first)
2738 int first;
2739{
2740 struct gate_descriptor *gdp;

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

3001 thread0.td_pcb->pcb_cr3 = (int)IdlePDPT;
3002#else
3003 thread0.td_pcb->pcb_cr3 = (int)IdlePTD;
3004#endif
3005 thread0.td_pcb->pcb_ext = 0;
3006 thread0.td_frame = &proc0_tf;
3007
3008 cpu_probe_amdc1e();
2750}
2751
2752#else
2753void
2754init386(first)
2755 int first;
2756{
2757 struct gate_descriptor *gdp;

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

3018 thread0.td_pcb->pcb_cr3 = (int)IdlePDPT;
3019#else
3020 thread0.td_pcb->pcb_cr3 = (int)IdlePTD;
3021#endif
3022 thread0.td_pcb->pcb_ext = 0;
3023 thread0.td_frame = &proc0_tf;
3024
3025 cpu_probe_amdc1e();
3026 cpu_probe_cmpxchg8b();
3009}
3010#endif
3011
3012void
3013cpu_pcpu_init(struct pcpu *pcpu, int cpuid, size_t size)
3014{
3015
3016 pcpu->pc_acpi_id = 0xffffffff;

--- 618 unchanged lines hidden ---
3027}
3028#endif
3029
3030void
3031cpu_pcpu_init(struct pcpu *pcpu, int cpuid, size_t size)
3032{
3033
3034 pcpu->pc_acpi_id = 0xffffffff;

--- 618 unchanged lines hidden ---