[Zrouter-src-freebsd] ZRouter.org: push to FreeBSD HEAD tree
zrouter-src-freebsd at zrouter.org
zrouter-src-freebsd at zrouter.org
Fri Mar 2 15:39:03 UTC 2012
details: http://zrouter.org/hg/FreeBSD/head//rev/b0485aae1c00
changeset: 380:b0485aae1c00
user: ray at terran.dlink.ua
date: Fri Mar 02 17:08:15 2012 +0200
description:
Update to FreeBSD-HEAD @232391
diffstat:
head/sys/amd64/acpica/acpi_switch.S | 29 ++--
head/sys/amd64/acpica/acpi_wakecode.S | 26 +++-
head/sys/amd64/acpica/acpi_wakeup.c | 42 +++----
head/sys/amd64/amd64/apic_vector.S | 9 +-
head/sys/amd64/amd64/cpu_switch.S | 4 +-
head/sys/amd64/amd64/machdep.c | 17 ++-
head/sys/amd64/amd64/mp_machdep.c | 11 +-
head/sys/amd64/amd64/vm_machdep.c | 4 +-
head/sys/amd64/include/_limits.h | 87 +----------------
head/sys/amd64/include/_stdint.h | 171 +---------------------------------
head/sys/amd64/include/_types.h | 116 +----------------------
head/sys/amd64/include/cpufunc.h | 4 +-
head/sys/amd64/include/endian.h | 145 +----------------------------
head/sys/amd64/include/segments.h | 4 +-
head/sys/amd64/include/setjmp.h | 50 +---------
head/sys/amd64/include/stdarg.h | 75 +--------------
16 files changed, 98 insertions(+), 696 deletions(-)
diffs (1148 lines):
diff -r b327ef2f7331 -r b0485aae1c00 head/sys/amd64/acpica/acpi_switch.S
--- a/head/sys/amd64/acpica/acpi_switch.S Fri Mar 02 17:07:54 2012 +0200
+++ b/head/sys/amd64/acpica/acpi_switch.S Fri Mar 02 17:08:15 2012 +0200
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: head/sys/amd64/acpica/acpi_switch.S 230830 2012-01-31 17:51:30Z jkim $
+ * $FreeBSD: head/sys/amd64/acpica/acpi_switch.S 230958 2012-02-03 21:24:28Z jkim $
*/
#include <machine/asmacros.h>
@@ -120,15 +120,6 @@
#undef SDT_SYSTSS
#undef SDT_SYSBSY
- /* Restore other callee saved registers. */
- movq PCB_R15(%rdi), %r15
- movq PCB_R14(%rdi), %r14
- movq PCB_R13(%rdi), %r13
- movq PCB_R12(%rdi), %r12
- movq PCB_RBP(%rdi), %rbp
- movq PCB_RSP(%rdi), %rsp
- movq PCB_RBX(%rdi), %rbx
-
/* Restore debug registers. */
movq PCB_DR0(%rdi), %rax
movq %rax, %dr0
@@ -145,6 +136,7 @@
/* Restore FPU state. */
fninit
+ movq WAKEUP_CTX(fpusave), %rbx
movq WAKEUP_CTX(xsmask), %rax
testq %rax, %rax
jz 1f
@@ -153,19 +145,26 @@
movl $XCR0, %ecx
/* xsetbv */
.byte 0x0f, 0x01, 0xd1
- movq WAKEUP_CTX(fpusave), %rcx
-/* xrstor (%rcx) */
- .byte 0x0f, 0xae, 0x29
+/* xrstor (%rbx) */
+ .byte 0x0f, 0xae, 0x2b
jmp 2f
1:
- movq WAKEUP_CTX(fpusave), %rcx
- fxrstor (%rcx)
+ fxrstor (%rbx)
2:
/* Reload CR0. */
movq PCB_CR0(%rdi), %rax
movq %rax, %cr0
+ /* Restore other callee saved registers. */
+ movq PCB_R15(%rdi), %r15
+ movq PCB_R14(%rdi), %r14
+ movq PCB_R13(%rdi), %r13
+ movq PCB_R12(%rdi), %r12
+ movq PCB_RBP(%rdi), %rbp
+ movq PCB_RSP(%rdi), %rsp
+ movq PCB_RBX(%rdi), %rbx
+
/* Restore return address. */
movq PCB_RIP(%rdi), %rax
movq %rax, (%rsp)
diff -r b327ef2f7331 -r b0485aae1c00 head/sys/amd64/acpica/acpi_wakecode.S
--- a/head/sys/amd64/acpica/acpi_wakecode.S Fri Mar 02 17:07:54 2012 +0200
+++ b/head/sys/amd64/acpica/acpi_wakecode.S Fri Mar 02 17:08:15 2012 +0200
@@ -26,11 +26,13 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: head/sys/amd64/acpica/acpi_wakecode.S 230830 2012-01-31 17:51:30Z jkim $
+ * $FreeBSD: head/sys/amd64/acpica/acpi_wakecode.S 231787 2012-02-15 22:10:33Z jkim $
*/
#include <machine/asmacros.h>
+#include <machine/ppireg.h>
#include <machine/specialreg.h>
+#include <machine/timerreg.h>
#include "assym.s"
@@ -71,13 +73,21 @@
testb $~0, resume_beep - wakeup_start
jz 1f
movb $0, resume_beep - wakeup_start
- movb $0xc0, %al
- outb %al, $0x42
- movb $0x04, %al
- outb %al, $0x42
- inb $0x61, %al
- orb $0x3, %al
- outb %al, $0x61
+
+ /* Set PIC timer2 to beep. */
+ movb $(TIMER_SEL2 | TIMER_SQWAVE | TIMER_16BIT), %al
+ outb %al, $TIMER_MODE
+
+ /* Turn on speaker. */
+ inb $IO_PPI, %al
+ orb $PIT_SPKR, %al
+ outb %al, $IO_PPI
+
+ /* Set frequency. */
+ movw $0x4c0, %ax
+ outb %al, $TIMER_CNTR2
+ shrw $8, %ax
+ outb %al, $TIMER_CNTR2
1:
/* Re-initialize video BIOS if the reset_video tunable is set. */
diff -r b327ef2f7331 -r b0485aae1c00 head/sys/amd64/acpica/acpi_wakeup.c
--- a/head/sys/amd64/acpica/acpi_wakeup.c Fri Mar 02 17:07:54 2012 +0200
+++ b/head/sys/amd64/acpica/acpi_wakeup.c Fri Mar 02 17:08:15 2012 +0200
@@ -28,10 +28,11 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/amd64/acpica/acpi_wakeup.c 230830 2012-01-31 17:51:30Z jkim $");
+__FBSDID("$FreeBSD: head/sys/amd64/acpica/acpi_wakeup.c 231840 2012-02-16 22:28:17Z jkim $");
#include <sys/param.h>
#include <sys/bus.h>
+#include <sys/eventhandler.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/memrange.h>
@@ -40,6 +41,7 @@
#include <vm/vm.h>
#include <vm/pmap.h>
+#include <machine/clock.h>
#include <machine/intr_machdep.h>
#include <x86/mca.h>
#include <machine/pcb.h>
@@ -74,7 +76,7 @@
static void **suspfpusave;
#endif
-int acpi_restorecpu(vm_offset_t, struct pcb *);
+int acpi_restorecpu(uint64_t, vm_offset_t);
static void *acpi_alloc_wakeup_handler(void);
static void acpi_stop_beep(void *);
@@ -92,11 +94,12 @@
*addr = val; \
} while (0)
-/* Turn off bits 1&2 of the PIT, stopping the beep. */
static void
acpi_stop_beep(void *arg)
{
- outb(0x61, inb(0x61) & ~0x3);
+
+ if (acpi_resume_beep != 0)
+ timer_spkr_release();
}
#ifdef SMP
@@ -220,7 +223,6 @@
#ifdef SMP
cpuset_t wakeup_cpus;
#endif
- register_t cr3, rf;
ACPI_STATUS status;
int ret;
@@ -234,19 +236,14 @@
CPU_CLR(PCPU_GET(cpuid), &wakeup_cpus);
#endif
+ if (acpi_resume_beep != 0)
+ timer_spkr_acquire();
+
AcpiSetFirmwareWakingVector(WAKECODE_PADDR(sc));
- rf = intr_disable();
+ spinlock_enter();
intr_suspend();
- /*
- * Temporarily switch to the kernel pmap because it provides
- * an identity mapping (setup at boot) for the low physical
- * memory region containing the wakeup code.
- */
- cr3 = rcr3();
- load_cr3(KPML4phys);
-
if (savectx(susppcbs[0])) {
ctx_fpusave(suspfpusave[0]);
#ifdef SMP
@@ -285,13 +282,13 @@
ia32_pause();
} else {
pmap_init_pat();
+ load_cr3(susppcbs[0]->pcb_cr3);
PCPU_SET(switchtime, 0);
PCPU_SET(switchticks, ticks);
#ifdef SMP
if (!CPU_EMPTY(&wakeup_cpus))
acpi_wakeup_cpus(sc, &wakeup_cpus);
#endif
- acpi_resync_clock(sc);
ret = 0;
}
@@ -301,10 +298,9 @@
restart_cpus(wakeup_cpus);
#endif
- load_cr3(cr3);
mca_resume();
intr_resume();
- intr_restore(rf);
+ spinlock_exit();
AcpiSetFirmwareWakingVector(0);
@@ -312,10 +308,6 @@
mem_range_softc.mr_op->reinit != NULL)
mem_range_softc.mr_op->reinit(&mem_range_softc);
- /* If we beeped, turn it off after a delay. */
- if (acpi_resume_beep)
- timeout(acpi_stop_beep, NULL, 3 * hz);
-
return (ret);
}
@@ -332,12 +324,18 @@
* and ROM area (0xa0000 and above). The temporary page tables must be
* page-aligned.
*/
- wakeaddr = contigmalloc(4 * PAGE_SIZE, M_DEVBUF, M_NOWAIT, 0x500,
+ wakeaddr = contigmalloc(4 * PAGE_SIZE, M_DEVBUF, M_WAITOK, 0x500,
0xa0000, PAGE_SIZE, 0ul);
if (wakeaddr == NULL) {
printf("%s: can't alloc wake memory\n", __func__);
return (NULL);
}
+ if (EVENTHANDLER_REGISTER(power_resume, acpi_stop_beep, NULL,
+ EVENTHANDLER_PRI_LAST) == NULL) {
+ printf("%s: can't register event handler\n", __func__);
+ contigfree(wakeaddr, 4 * PAGE_SIZE, M_DEVBUF);
+ return (NULL);
+ }
susppcbs = malloc(mp_ncpus * sizeof(*susppcbs), M_DEVBUF, M_WAITOK);
suspfpusave = malloc(mp_ncpus * sizeof(void *), M_DEVBUF, M_WAITOK);
for (i = 0; i < mp_ncpus; i++) {
diff -r b327ef2f7331 -r b0485aae1c00 head/sys/amd64/amd64/apic_vector.S
--- a/head/sys/amd64/amd64/apic_vector.S Fri Mar 02 17:07:54 2012 +0200
+++ b/head/sys/amd64/amd64/apic_vector.S Fri Mar 02 17:08:15 2012 +0200
@@ -28,7 +28,7 @@
* SUCH DAMAGE.
*
* from: vector.s, 386BSD 0.1 unknown origin
- * $FreeBSD$
+ * $FreeBSD: head/sys/amd64/amd64/apic_vector.S 231169 2012-02-07 23:24:29Z jkim $
*/
/*
@@ -300,13 +300,10 @@
IDTVEC(cpususpend)
PUSH_FRAME
+ call cpususpend_handler
movq lapic, %rax
movl $0, LA_EOI(%rax) /* End Of Interrupt to APIC */
-
- call cpususpend_handler
-
- POP_FRAME
- jmp doreti_iret
+ jmp doreti
/*
* Executed by a CPU when it receives a RENDEZVOUS IPI from another CPU.
diff -r b327ef2f7331 -r b0485aae1c00 head/sys/amd64/amd64/cpu_switch.S
--- a/head/sys/amd64/amd64/cpu_switch.S Fri Mar 02 17:07:54 2012 +0200
+++ b/head/sys/amd64/amd64/cpu_switch.S Fri Mar 02 17:08:15 2012 +0200
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: head/sys/amd64/amd64/cpu_switch.S 230426 2012-01-21 17:45:27Z kib $
+ * $FreeBSD: head/sys/amd64/amd64/cpu_switch.S 232226 2012-02-27 17:28:22Z jhb $
*/
#include <machine/asmacros.h>
@@ -76,7 +76,7 @@
movq PCPU(CURPMAP),%rdx
LK btrl %eax,PM_ACTIVE(%rdx) /* clear old */
1:
- movq TD_PCB(%rsi),%r8 /* newtd->td_proc */
+ movq TD_PCB(%rsi),%r8 /* newtd->td_pcb */
movq PCB_CR3(%r8),%rdx
movq %rdx,%cr3 /* new address space */
jmp swact
diff -r b327ef2f7331 -r b0485aae1c00 head/sys/amd64/amd64/machdep.c
--- a/head/sys/amd64/amd64/machdep.c Fri Mar 02 17:07:54 2012 +0200
+++ b/head/sys/amd64/amd64/machdep.c Fri Mar 02 17:08:15 2012 +0200
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/amd64/amd64/machdep.c 230426 2012-01-21 17:45:27Z kib $");
+__FBSDID("$FreeBSD: head/sys/amd64/amd64/machdep.c 231781 2012-02-15 21:32:05Z jkim $");
#include "opt_atalk.h"
#include "opt_atpic.h"
@@ -1381,7 +1381,7 @@
{
int i, physmap_idx, pa_indx, da_indx;
vm_paddr_t pa, physmap[PHYSMAP_SIZE];
- u_long physmem_tunable, memtest;
+ u_long physmem_start, physmem_tunable, memtest;
pt_entry_t *pte;
struct bios_smap *smapbase, *smap, *smapend;
u_int32_t smapsize;
@@ -1469,8 +1469,19 @@
/*
* Size up each available chunk of physical memory.
+ *
+ * XXX Some BIOSes corrupt low 64KB between suspend and resume.
+ * By default, mask off the first 16 pages unless we appear to be
+ * running in a VM.
*/
- physmap[0] = PAGE_SIZE; /* mask off page 0 */
+ physmem_start = (vm_guest > VM_GUEST_NO ? 1 : 16) << PAGE_SHIFT;
+ TUNABLE_ULONG_FETCH("hw.physmem.start", &physmem_start);
+ if (physmem_start < PAGE_SIZE)
+ physmap[0] = PAGE_SIZE;
+ else if (physmem_start >= physmap[1])
+ physmap[0] = round_page(physmap[1] - PAGE_SIZE);
+ else
+ physmap[0] = round_page(physmem_start);
pa_indx = 0;
da_indx = 1;
phys_avail[pa_indx++] = physmap[0];
diff -r b327ef2f7331 -r b0485aae1c00 head/sys/amd64/amd64/mp_machdep.c
--- a/head/sys/amd64/amd64/mp_machdep.c Fri Mar 02 17:07:54 2012 +0200
+++ b/head/sys/amd64/amd64/mp_machdep.c Fri Mar 02 17:08:15 2012 +0200
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/amd64/amd64/mp_machdep.c 230426 2012-01-21 17:45:27Z kib $");
+__FBSDID("$FreeBSD: head/sys/amd64/amd64/mp_machdep.c 231797 2012-02-15 23:33:22Z jkim $");
#include "opt_cpu.h"
#include "opt_kstack_pages.h"
@@ -1414,20 +1414,17 @@
void
cpususpend_handler(void)
{
- register_t cr3, rf;
u_int cpu;
cpu = PCPU_GET(cpuid);
- rf = intr_disable();
- cr3 = rcr3();
-
if (savectx(susppcbs[cpu])) {
ctx_fpusave(suspfpusave[cpu]);
wbinvd();
CPU_SET_ATOMIC(cpu, &stopped_cpus);
} else {
pmap_init_pat();
+ load_cr3(susppcbs[cpu]->pcb_cr3);
PCPU_SET(switchtime, 0);
PCPU_SET(switchticks, ticks);
}
@@ -1439,11 +1436,9 @@
CPU_CLR_ATOMIC(cpu, &started_cpus);
CPU_CLR_ATOMIC(cpu, &stopped_cpus);
- /* Restore CR3 and enable interrupts */
- load_cr3(cr3);
+ /* Resume MCA and local APIC */
mca_resume();
lapic_setup(0);
- intr_restore(rf);
}
/*
diff -r b327ef2f7331 -r b0485aae1c00 head/sys/amd64/amd64/vm_machdep.c
--- a/head/sys/amd64/amd64/vm_machdep.c Fri Mar 02 17:07:54 2012 +0200
+++ b/head/sys/amd64/amd64/vm_machdep.c Fri Mar 02 17:08:15 2012 +0200
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/amd64/amd64/vm_machdep.c 230426 2012-01-21 17:45:27Z kib $");
+__FBSDID("$FreeBSD: head/sys/amd64/amd64/vm_machdep.c 231441 2012-02-10 21:26:25Z kib $");
#include "opt_isa.h"
#include "opt_cpu.h"
@@ -552,6 +552,7 @@
return (EINVAL);
pcb = td->td_pcb;
+ set_pcb_flags(pcb, PCB_FULL_IRET);
#ifdef COMPAT_FREEBSD32
if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) {
pcb->pcb_gsbase = (register_t)tls_base;
@@ -559,7 +560,6 @@
}
#endif
pcb->pcb_fsbase = (register_t)tls_base;
- set_pcb_flags(pcb, PCB_FULL_IRET);
return (0);
}
diff -r b327ef2f7331 -r b0485aae1c00 head/sys/amd64/include/_limits.h
--- a/head/sys/amd64/include/_limits.h Fri Mar 02 17:07:54 2012 +0200
+++ b/head/sys/amd64/include/_limits.h Fri Mar 02 17:08:15 2012 +0200
@@ -1,87 +1,6 @@
/*-
- * Copyright (c) 1988, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)limits.h 8.3 (Berkeley) 1/4/94
- * $FreeBSD$
+ * This file is in the public domain.
*/
+/* $FreeBSD: head/sys/amd64/include/_limits.h 232262 2012-02-28 18:24:28Z tijl $ */
-#ifndef _MACHINE__LIMITS_H_
-#define _MACHINE__LIMITS_H_
-
-/*
- * According to ANSI (section 2.2.4.2), the values below must be usable by
- * #if preprocessing directives. Additionally, the expression must have the
- * same type as would an expression that is an object of the corresponding
- * type converted according to the integral promotions. The subtraction for
- * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an
- * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2).
- */
-
-#define __CHAR_BIT 8 /* number of bits in a char */
-
-#define __SCHAR_MAX 0x7f /* max value for a signed char */
-#define __SCHAR_MIN (-0x7f - 1) /* min value for a signed char */
-
-#define __UCHAR_MAX 0xff /* max value for an unsigned char */
-
-#define __USHRT_MAX 0xffff /* max value for an unsigned short */
-#define __SHRT_MAX 0x7fff /* max value for a short */
-#define __SHRT_MIN (-0x7fff - 1) /* min value for a short */
-
-#define __UINT_MAX 0xffffffff /* max value for an unsigned int */
-#define __INT_MAX 0x7fffffff /* max value for an int */
-#define __INT_MIN (-0x7fffffff - 1) /* min value for an int */
-
-#define __ULONG_MAX 0xffffffffffffffff /* max for an unsigned long */
-#define __LONG_MAX 0x7fffffffffffffff /* max for a long */
-#define __LONG_MIN (-0x7fffffffffffffff - 1) /* min for a long */
-
- /* max value for an unsigned long long */
-#define __ULLONG_MAX 0xffffffffffffffffULL
-#define __LLONG_MAX 0x7fffffffffffffffLL /* max value for a long long */
-#define __LLONG_MIN (-0x7fffffffffffffffLL - 1) /* min for a long long */
-
-#define __SSIZE_MAX __LONG_MAX /* max value for a ssize_t */
-
-#define __SIZE_T_MAX __ULONG_MAX /* max value for a size_t */
-
-#define __OFF_MAX __LONG_MAX /* max value for an off_t */
-#define __OFF_MIN __LONG_MIN /* min value for an off_t */
-
-/* Quads and longs are the same on the amd64. Ensure they stay in sync. */
-#define __UQUAD_MAX __ULONG_MAX /* max value for a uquad_t */
-#define __QUAD_MAX __LONG_MAX /* max value for a quad_t */
-#define __QUAD_MIN __LONG_MIN /* min value for a quad_t */
-
-#define __LONG_BIT 64
-#define __WORD_BIT 32
-
-/* Minimum signal stack size. */
-#define __MINSIGSTKSZ (512 * 4)
-
-#endif /* !_MACHINE__LIMITS_H_ */
+#include <x86/_limits.h>
diff -r b327ef2f7331 -r b0485aae1c00 head/sys/amd64/include/_stdint.h
--- a/head/sys/amd64/include/_stdint.h Fri Mar 02 17:07:54 2012 +0200
+++ b/head/sys/amd64/include/_stdint.h Fri Mar 02 17:08:15 2012 +0200
@@ -1,171 +1,6 @@
/*-
- * Copyright (c) 2001, 2002 Mike Barcroft <mike at FreeBSD.org>
- * Copyright (c) 2001 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Klaus Klein.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * $FreeBSD: head/sys/amd64/include/_stdint.h 227474 2011-11-12 20:16:06Z theraven $
+ * This file is in the public domain.
*/
+/* $FreeBSD: head/sys/amd64/include/_stdint.h 232264 2012-02-28 18:38:33Z tijl $ */
-#ifndef _MACHINE__STDINT_H_
-#define _MACHINE__STDINT_H_
-
-#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)
-
-#define INT8_C(c) (c)
-#define INT16_C(c) (c)
-#define INT32_C(c) (c)
-#define INT64_C(c) (c ## L)
-
-#define UINT8_C(c) (c)
-#define UINT16_C(c) (c)
-#define UINT32_C(c) (c ## U)
-#define UINT64_C(c) (c ## UL)
-
-#define INTMAX_C(c) INT64_C(c)
-#define UINTMAX_C(c) UINT64_C(c)
-
-#endif /* !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) */
-
-#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
-
-/*
- * ISO/IEC 9899:1999
- * 7.18.2.1 Limits of exact-width integer types
- */
-/* Minimum values of exact-width signed integer types. */
-#define INT8_MIN (-0x7f-1)
-#define INT16_MIN (-0x7fff-1)
-#define INT32_MIN (-0x7fffffff-1)
-#define INT64_MIN (-0x7fffffffffffffffL-1)
-
-/* Maximum values of exact-width signed integer types. */
-#define INT8_MAX 0x7f
-#define INT16_MAX 0x7fff
-#define INT32_MAX 0x7fffffff
-#define INT64_MAX 0x7fffffffffffffffL
-
-/* Maximum values of exact-width unsigned integer types. */
-#define UINT8_MAX 0xff
-#define UINT16_MAX 0xffff
-#define UINT32_MAX 0xffffffffU
-#define UINT64_MAX 0xffffffffffffffffUL
-
-/*
- * ISO/IEC 9899:1999
- * 7.18.2.2 Limits of minimum-width integer types
- */
-/* Minimum values of minimum-width signed integer types. */
-#define INT_LEAST8_MIN INT8_MIN
-#define INT_LEAST16_MIN INT16_MIN
-#define INT_LEAST32_MIN INT32_MIN
-#define INT_LEAST64_MIN INT64_MIN
-
-/* Maximum values of minimum-width signed integer types. */
-#define INT_LEAST8_MAX INT8_MAX
-#define INT_LEAST16_MAX INT16_MAX
-#define INT_LEAST32_MAX INT32_MAX
-#define INT_LEAST64_MAX INT64_MAX
-
-/* Maximum values of minimum-width unsigned integer types. */
-#define UINT_LEAST8_MAX UINT8_MAX
-#define UINT_LEAST16_MAX UINT16_MAX
-#define UINT_LEAST32_MAX UINT32_MAX
-#define UINT_LEAST64_MAX UINT64_MAX
-
-/*
- * ISO/IEC 9899:1999
- * 7.18.2.3 Limits of fastest minimum-width integer types
- */
-/* Minimum values of fastest minimum-width signed integer types. */
-#define INT_FAST8_MIN INT32_MIN
-#define INT_FAST16_MIN INT32_MIN
-#define INT_FAST32_MIN INT32_MIN
-#define INT_FAST64_MIN INT64_MIN
-
-/* Maximum values of fastest minimum-width signed integer types. */
-#define INT_FAST8_MAX INT32_MAX
-#define INT_FAST16_MAX INT32_MAX
-#define INT_FAST32_MAX INT32_MAX
-#define INT_FAST64_MAX INT64_MAX
-
-/* Maximum values of fastest minimum-width unsigned integer types. */
-#define UINT_FAST8_MAX UINT32_MAX
-#define UINT_FAST16_MAX UINT32_MAX
-#define UINT_FAST32_MAX UINT32_MAX
-#define UINT_FAST64_MAX UINT64_MAX
-
-/*
- * ISO/IEC 9899:1999
- * 7.18.2.4 Limits of integer types capable of holding object pointers
- */
-#define INTPTR_MIN INT64_MIN
-#define INTPTR_MAX INT64_MAX
-#define UINTPTR_MAX UINT64_MAX
-
-/*
- * ISO/IEC 9899:1999
- * 7.18.2.5 Limits of greatest-width integer types
- */
-#define INTMAX_MIN INT64_MIN
-#define INTMAX_MAX INT64_MAX
-#define UINTMAX_MAX UINT64_MAX
-
-/*
- * ISO/IEC 9899:1999
- * 7.18.3 Limits of other integer types
- */
-/* Limits of ptrdiff_t. */
-#define PTRDIFF_MIN INT64_MIN
-#define PTRDIFF_MAX INT64_MAX
-
-/* Limits of sig_atomic_t. */
-#define SIG_ATOMIC_MIN LONG_MIN
-#define SIG_ATOMIC_MAX LONG_MAX
-
-/* Limit of size_t. */
-#define SIZE_MAX UINT64_MAX
-
-#ifndef WCHAR_MIN /* Also possibly defined in <wchar.h> */
-/* Limits of wchar_t. */
-#define WCHAR_MIN INT32_MIN
-#define WCHAR_MAX INT32_MAX
-#endif
-
-/* Limits of wint_t. */
-#define WINT_MIN INT32_MIN
-#define WINT_MAX INT32_MAX
-
-#endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */
-
-#endif /* !_MACHINE__STDINT_H_ */
+#include <x86/_stdint.h>
diff -r b327ef2f7331 -r b0485aae1c00 head/sys/amd64/include/_types.h
--- a/head/sys/amd64/include/_types.h Fri Mar 02 17:07:54 2012 +0200
+++ b/head/sys/amd64/include/_types.h Fri Mar 02 17:08:15 2012 +0200
@@ -1,116 +1,6 @@
/*-
- * Copyright (c) 2002 Mike Barcroft <mike at FreeBSD.org>
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * From: @(#)ansi.h 8.2 (Berkeley) 1/4/94
- * From: @(#)types.h 8.3 (Berkeley) 1/5/94
- * $FreeBSD: head/sys/amd64/include/_types.h 228469 2011-12-13 13:38:03Z ed $
+ * This file is in the public domain.
*/
+/* $FreeBSD: head/sys/amd64/include/_types.h 232261 2012-02-28 18:15:28Z tijl $ */
-#ifndef _MACHINE__TYPES_H_
-#define _MACHINE__TYPES_H_
-
-#ifndef _SYS_CDEFS_H_
-#error this file needs sys/cdefs.h as a prerequisite
-#endif
-
-#define __NO_STRICT_ALIGNMENT
-
-/*
- * Basic types upon which most other types are built.
- */
-typedef signed char __int8_t;
-typedef unsigned char __uint8_t;
-typedef short __int16_t;
-typedef unsigned short __uint16_t;
-typedef int __int32_t;
-typedef unsigned int __uint32_t;
-typedef long __int64_t;
-typedef unsigned long __uint64_t;
-
-/*
- * Standard type definitions.
- */
-typedef __int32_t __clock_t; /* clock()... */
-typedef __int64_t __critical_t;
-typedef double __double_t;
-typedef float __float_t;
-typedef __int64_t __intfptr_t;
-typedef __int64_t __intmax_t;
-typedef __int64_t __intptr_t;
-typedef __int32_t __int_fast8_t;
-typedef __int32_t __int_fast16_t;
-typedef __int32_t __int_fast32_t;
-typedef __int64_t __int_fast64_t;
-typedef __int8_t __int_least8_t;
-typedef __int16_t __int_least16_t;
-typedef __int32_t __int_least32_t;
-typedef __int64_t __int_least64_t;
-typedef __int64_t __ptrdiff_t; /* ptr1 - ptr2 */
-typedef __int64_t __register_t;
-typedef __int64_t __segsz_t; /* segment size (in pages) */
-typedef __uint64_t __size_t; /* sizeof() */
-typedef __int64_t __ssize_t; /* byte count or error */
-typedef __int64_t __time_t; /* time()... */
-typedef __uint64_t __uintfptr_t;
-typedef __uint64_t __uintmax_t;
-typedef __uint64_t __uintptr_t;
-typedef __uint32_t __uint_fast8_t;
-typedef __uint32_t __uint_fast16_t;
-typedef __uint32_t __uint_fast32_t;
-typedef __uint64_t __uint_fast64_t;
-typedef __uint8_t __uint_least8_t;
-typedef __uint16_t __uint_least16_t;
-typedef __uint32_t __uint_least32_t;
-typedef __uint64_t __uint_least64_t;
-typedef __uint64_t __u_register_t;
-typedef __uint64_t __vm_offset_t;
-typedef __int64_t __vm_ooffset_t;
-typedef __uint64_t __vm_paddr_t;
-typedef __uint64_t __vm_pindex_t;
-typedef __uint64_t __vm_size_t;
-
-/*
- * Unusual type definitions.
- */
-#ifdef __GNUCLIKE_BUILTIN_VARARGS
-typedef __builtin_va_list __va_list; /* internally known to gcc */
-#elif defined(lint)
-typedef char * __va_list; /* pretend */
-#endif
-#if defined(__GNUC_VA_LIST_COMPATIBILITY) && !defined(__GNUC_VA_LIST) \
- && !defined(__NO_GNUC_VA_LIST)
-#define __GNUC_VA_LIST
-typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/
-#endif
-
-#endif /* !_MACHINE__TYPES_H_ */
+#include <x86/_types.h>
diff -r b327ef2f7331 -r b0485aae1c00 head/sys/amd64/include/cpufunc.h
--- a/head/sys/amd64/include/cpufunc.h Fri Mar 02 17:07:54 2012 +0200
+++ b/head/sys/amd64/include/cpufunc.h Fri Mar 02 17:08:15 2012 +0200
@@ -27,7 +27,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: head/sys/amd64/include/cpufunc.h 230766 2012-01-30 07:53:33Z kib $
+ * $FreeBSD: head/sys/amd64/include/cpufunc.h 232227 2012-02-27 17:28:47Z jhb $
*/
/*
@@ -727,7 +727,7 @@
uint64_t rdr6(void);
uint64_t rdr7(void);
uint64_t rdtsc(void);
-u_int read_rflags(void);
+u_long read_rflags(void);
u_int rfs(void);
u_int rgs(void);
void wbinvd(void);
diff -r b327ef2f7331 -r b0485aae1c00 head/sys/amd64/include/endian.h
--- a/head/sys/amd64/include/endian.h Fri Mar 02 17:07:54 2012 +0200
+++ b/head/sys/amd64/include/endian.h Fri Mar 02 17:08:15 2012 +0200
@@ -1,145 +1,6 @@
/*-
- * Copyright (c) 1987, 1991 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)endian.h 7.8 (Berkeley) 4/3/91
- * $FreeBSD$
+ * This file is in the public domain.
*/
+/* $FreeBSD: head/sys/amd64/include/endian.h 232266 2012-02-28 19:39:54Z tijl $ */
-#ifndef _MACHINE_ENDIAN_H_
-#define _MACHINE_ENDIAN_H_
-
-#include <sys/cdefs.h>
-#include <sys/_types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Define the order of 32-bit words in 64-bit words.
- */
-#define _QUAD_HIGHWORD 1
-#define _QUAD_LOWWORD 0
-
-/*
- * Definitions for byte order, according to byte significance from low
- * address to high.
- */
-#define _LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
-#define _BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
-#define _PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
-
-#define _BYTE_ORDER _LITTLE_ENDIAN
-
-/*
- * Deprecated variants that don't have enough underscores to be useful in more
- * strict namespaces.
- */
-#if __BSD_VISIBLE
-#define LITTLE_ENDIAN _LITTLE_ENDIAN
-#define BIG_ENDIAN _BIG_ENDIAN
-#define PDP_ENDIAN _PDP_ENDIAN
-#define BYTE_ORDER _BYTE_ORDER
-#endif
-
-#if defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE_BUILTIN_CONSTANT_P)
-
-#define __bswap64_const(_x) \
- (((_x) >> 56) | \
- (((_x) >> 40) & (0xffUL << 8)) | \
- (((_x) >> 24) & (0xffUL << 16)) | \
- (((_x) >> 8) & (0xffUL << 24)) | \
- (((_x) << 8) & (0xffUL << 32)) | \
- (((_x) << 24) & (0xffUL << 40)) | \
- (((_x) << 40) & (0xffUL << 48)) | \
- ((_x) << 56))
-
-#define __bswap32_const(_x) \
- (((_x) >> 24) | \
- (((_x) & (0xff << 16)) >> 8) | \
- (((_x) & (0xff << 8)) << 8) | \
- ((_x) << 24))
-
-#define __bswap16_const(_x) (__uint16_t)((_x) << 8 | (_x) >> 8)
-
-static __inline __uint64_t
-__bswap64_var(__uint64_t _x)
-{
-
- __asm ("bswap %0" : "+r" (_x));
- return (_x);
-}
-
-static __inline __uint32_t
-__bswap32_var(__uint32_t _x)
-{
-
- __asm ("bswap %0" : "+r" (_x));
- return (_x);
-}
-
-static __inline __uint16_t
-__bswap16_var(__uint16_t _x)
-{
-
- return (__bswap16_const(_x));
-}
-
-#define __bswap64(_x) \
- (__builtin_constant_p(_x) ? \
- __bswap64_const((__uint64_t)(_x)) : __bswap64_var(_x))
-
-#define __bswap32(_x) \
- (__builtin_constant_p(_x) ? \
- __bswap32_const((__uint32_t)(_x)) : __bswap32_var(_x))
-
-#define __bswap16(_x) \
- (__builtin_constant_p(_x) ? \
- __bswap16_const((__uint16_t)(_x)) : __bswap16_var(_x))
-
-#define __htonl(x) __bswap32(x)
-#define __htons(x) __bswap16(x)
-#define __ntohl(x) __bswap32(x)
-#define __ntohs(x) __bswap16(x)
-
-#else /* !(__GNUCLIKE_ASM && __GNUCLIKE_BUILTIN_CONSTANT_P) */
-
-/*
- * No optimizations are available for this compiler. Fall back to
- * non-optimized functions by defining the constant usually used to prevent
- * redefinition.
- */
-#define _BYTEORDER_FUNC_DEFINED
-
-#endif /* __GNUCLIKE_ASM && __GNUCLIKE_BUILTIN_CONSTANT_P */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !_MACHINE_ENDIAN_H_ */
+#include <x86/endian.h>
diff -r b327ef2f7331 -r b0485aae1c00 head/sys/amd64/include/segments.h
--- a/head/sys/amd64/include/segments.h Fri Mar 02 17:07:54 2012 +0200
+++ b/head/sys/amd64/include/segments.h Fri Mar 02 17:08:15 2012 +0200
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)segments.h 7.1 (Berkeley) 5/9/91
- * $FreeBSD: head/sys/amd64/include/segments.h 227290 2011-11-07 01:53:25Z rstone $
+ * $FreeBSD: head/sys/amd64/include/segments.h 232228 2012-02-27 17:29:37Z jhb $
*/
#ifndef _MACHINE_SEGMENTS_H_
@@ -213,8 +213,8 @@
#define IDT_MC 18 /* #MC: Machine Check */
#define IDT_XF 19 /* #XF: SIMD Floating-Point Exception */
#define IDT_IO_INTS NRSVIDT /* Base of IDT entries for I/O interrupts. */
+#define IDT_DTRACE_RET 0x20 /* DTrace pid provider Interrupt Vector */
#define IDT_SYSCALL 0x80 /* System Call Interrupt Vector */
-#define IDT_DTRACE_RET 0x20 /* DTrace pid provider Interrupt Vector */
/*
* Entries in the Global Descriptor Table (GDT)
diff -r b327ef2f7331 -r b0485aae1c00 head/sys/amd64/include/setjmp.h
--- a/head/sys/amd64/include/setjmp.h Fri Mar 02 17:07:54 2012 +0200
+++ b/head/sys/amd64/include/setjmp.h Fri Mar 02 17:08:15 2012 +0200
@@ -1,50 +1,6 @@
/*-
- * Copyright (c) 1998 John Birrell <jb at cimlogic.com.au>.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
+ * This file is in the public domain.
*/
+/* $FreeBSD: head/sys/amd64/include/setjmp.h 232275 2012-02-28 22:17:52Z tijl $ */
-#ifndef _MACHINE_SETJMP_H_
-#define _MACHINE_SETJMP_H_
-
-#include <sys/cdefs.h>
-
-#define _JBLEN 12 /* Size of the jmp_buf on AMD64. */
-
-/*
- * jmp_buf and sigjmp_buf are encapsulated in different structs to force
- * compile-time diagnostics for mismatches. The structs are the same
- * internally to avoid some run-time errors for mismatches.
- */
-#if __BSD_VISIBLE || __POSIX_VISIBLE || __XSI_VISIBLE
-typedef struct _sigjmp_buf { long _sjb[_JBLEN]; } sigjmp_buf[1];
-#endif
-
-typedef struct _jmp_buf { long _jb[_JBLEN]; } jmp_buf[1];
-
-#endif /* !_MACHINE_SETJMP_H_ */
+#include <x86/setjmp.h>
diff -r b327ef2f7331 -r b0485aae1c00 head/sys/amd64/include/stdarg.h
--- a/head/sys/amd64/include/stdarg.h Fri Mar 02 17:07:54 2012 +0200
+++ b/head/sys/amd64/include/stdarg.h Fri Mar 02 17:08:15 2012 +0200
@@ -1,75 +1,6 @@
/*-
- * Copyright (c) 2002 David E. O'Brien. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
+ * This file is in the public domain.
*/
+/* $FreeBSD: head/sys/amd64/include/stdarg.h 232276 2012-02-28 22:30:58Z tijl $ */
-#ifndef _MACHINE_STDARG_H_
-#define _MACHINE_STDARG_H_
-
-#include <sys/cdefs.h>
-#include <sys/_types.h>
-
-#ifndef _VA_LIST_DECLARED
-#define _VA_LIST_DECLARED
-typedef __va_list va_list;
-#endif
-
-#ifdef __GNUCLIKE_BUILTIN_STDARG
-
-#define va_start(ap, last) \
- __builtin_va_start((ap), (last))
-
-#define va_arg(ap, type) \
- __builtin_va_arg((ap), type)
-
-#define __va_copy(dest, src) \
- __builtin_va_copy((dest), (src))
-
-#if __ISO_C_VISIBLE >= 1999
-#define va_copy(dest, src) \
- __va_copy(dest, src)
-#endif
-
-#define va_end(ap) \
- __builtin_va_end(ap)
-
-#elif defined(lint)
-/* Provide a fake implementation for lint's benefit */
-#define __va_size(type) \
- (((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long))
-#define va_start(ap, last) \
- ((ap) = (va_list)&(last) + __va_size(last))
-#define va_arg(ap, type) \
- (*(type *)((ap) += __va_size(type), (ap) - __va_size(type)))
-#define va_end(ap)
-
-#else
-#error this file needs to be ported to your compiler
-#endif
-
-#endif /* !_MACHINE_STDARG_H_ */
+#include <x86/stdarg.h>
More information about the Zrouter-src-freebsd
mailing list