PERFORCE change 182312 for review
Ana Kukec
anchie at FreeBSD.org
Thu Aug 12 11:23:45 UTC 2010
http://p4web.freebsd.org/@@182312?ac=10
Change 182312 by anchie at anchie_malimis on 2010/08/12 11:22:58
IFC @182307
Affected files ...
.. //depot/projects/soc2009/anchie_send/src/sys/amd64/acpica/acpi_wakeup.c#7 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/amd64/amd64/mp_machdep.c#8 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/amd64/amd64/mptable_pci.c#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/amd64/amd64/pmap.c#11 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/amd64/amd64/tsc.c#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/amd64/amd64/vm_machdep.c#6 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/amd64/conf/GENERIC#11 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/amd64/ia32/ia32_signal.c#7 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/amd64/include/smp.h#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/arm/include/pmap.h#5 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/boot/zfs/zfsimpl.c#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c#6 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/compat/freebsd32/freebsd32.h#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/compat/freebsd32/freebsd32_misc.c#9 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/compat/x86bios/x86bios.c#5 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/compat/x86bios/x86bios.h#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/conf/files#14 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/conf/files.i386#9 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/contrib/dev/acpica/changes.txt#7 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/contrib/dev/acpica/common/adisasm.c#6 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/contrib/dev/acpica/common/dmextern.c#5 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/contrib/dev/acpica/compiler/aslcompiler.h#8 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/contrib/dev/acpica/compiler/aslglobal.h#7 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/contrib/dev/acpica/compiler/aslmain.c#7 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/contrib/dev/acpica/compiler/aslstartup.c#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/contrib/dev/acpica/debugger/dbcmds.c#5 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/contrib/dev/acpica/debugger/dbinput.c#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/contrib/dev/acpica/events/evxfevnt.c#5 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/contrib/dev/acpica/executer/exfldio.c#5 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/contrib/dev/acpica/executer/exprep.c#5 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/contrib/dev/acpica/include/acdebug.h#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/contrib/dev/acpica/include/acdisasm.h#5 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/contrib/dev/acpica/include/acglobal.h#7 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/contrib/dev/acpica/include/aclocal.h#6 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/contrib/dev/acpica/include/acobject.h#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/contrib/dev/acpica/include/acpiosxf.h#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/contrib/dev/acpica/include/acpixf.h#7 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/contrib/dev/acpica/include/actypes.h#6 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/contrib/dev/acpica/include/acutils.h#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/contrib/dev/acpica/osunixxf.c#6 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/contrib/dev/acpica/utilities/uteval.c#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/contrib/dev/acpica/utilities/utglobal.c#6 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/contrib/dev/acpica/utilities/utinit.c#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/contrib/dev/acpica/utilities/utmutex.c#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/contrib/dev/acpica/utilities/utxface.c#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/acpica/Osd/OsdHardware.c#6 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/acpica/Osd/OsdMemory.c#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/acpica/acpi_ec.c#6 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/alc/if_alc.c#7 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/alc/if_alcreg.h#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/alc/if_alcvar.h#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/ath/ath_hal/ar5212/ar5212.h#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/ath/ath_hal/ar5416/ar5416.ini#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/ath/if_ath.c#10 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/cfe/cfe_env.c#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/e1000/if_igb.c#12 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/fb/vesa.c#5 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/iicbus/iic.h#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/iscsi/initiator/isc_cam.c#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/iscsi/initiator/isc_sm.c#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/iscsi/initiator/isc_soc.c#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/iscsi/initiator/isc_subr.c#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/iscsi/initiator/iscsi.c#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/iscsi/initiator/iscsi.h#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/iscsi/initiator/iscsi_subr.c#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/iscsi/initiator/iscsivar.h#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/mii/atphy.c#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/mii/e1000phy.c#7 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/mii/miidevs#7 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/mpt/mpt_pci.c#6 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/null/null.c#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/ste/if_ste.c#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/tpm/tpm.c#1 branch
.. //depot/projects/soc2009/anchie_send/src/sys/dev/tpm/tpm_acpi.c#1 branch
.. //depot/projects/soc2009/anchie_send/src/sys/dev/tpm/tpm_isa.c#1 branch
.. //depot/projects/soc2009/anchie_send/src/sys/dev/tpm/tpmvar.h#1 branch
.. //depot/projects/soc2009/anchie_send/src/sys/dev/usb/quirk/usb_quirk.c#10 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/usb/serial/uplcom.c#8 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/usb/serial/uslcom.c#7 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/usb/usbdevs#12 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/fs/coda/coda.h#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/fs/coda/coda_venus.c#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/fs/coda/coda_vnops.c#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/fs/devfs/devfs.h#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/fs/devfs/devfs_rule.c#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/fs/devfs/devfs_vfsops.c#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/fs/devfs/devfs_vnops.c#6 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/i386/conf/GENERIC#10 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/i386/i386/mp_machdep.c#6 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/i386/i386/mptable_pci.c#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/i386/i386/pmap.c#11 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/i386/i386/tsc.c#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/i386/i386/vm_machdep.c#6 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/i386/include/smp.h#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/i386/include/vm86.h#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/i386/pci/pci_bus.c#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/i386/xen/mp_machdep.c#6 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/i386/xen/pmap.c#11 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/ia64/ia32/ia32_signal.c#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/ia64/ia64/mp_machdep.c#8 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/ia64/include/smp.h#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/kern/init_main.c#8 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/kern/kern_conf.c#8 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/kern/kern_cons.c#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/kern/kern_jail.c#9 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/kern/kern_ktrace.c#5 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/kern/kern_malloc.c#5 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/kern/sched_4bsd.c#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/kern/sched_ule.c#6 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/kern/subr_param.c#6 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/kern/subr_smp.c#6 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/kern/tty.c#7 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/kern/uipc_socket.c#10 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/kern/vfs_bio.c#9 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/kern/vfs_cluster.c#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/kern/vfs_subr.c#11 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/mips/atheros/ar71xx_pci.c#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/mips/include/cpuregs.h#7 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/mips/include/endian.h#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/mips/include/pmap.h#8 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/mips/include/pte.h#5 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/mips/include/smp.h#7 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/mips/mips/locore.S#8 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/mips/mips/mp_machdep.c#10 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/mips/mips/mpboot.S#7 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/mips/mips/pmap.c#13 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/mips/mips/trap.c#7 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/mips/rmi/xlr_machdep.c#5 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/mips/sibyte/sb_machdep.c#7 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/mips/sibyte/sb_scd.c#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/mips/sibyte/sb_zbpci.c#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/modules/Makefile#18 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/modules/acpi/acpi/Makefile#8 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/modules/if_carp/Makefile#1 branch
.. //depot/projects/soc2009/anchie_send/src/sys/modules/tpm/Makefile#1 branch
.. //depot/projects/soc2009/anchie_send/src/sys/modules/x86bios/Makefile#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/net/if.c#11 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/net/if_bridge.c#7 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/net/if_ethersubr.c#6 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/net/if_vlan.c#8 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/netinet/if_ether.c#9 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/netinet/in.c#10 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/netinet/in_proto.c#8 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/netinet/ip_carp.c#5 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/netinet/ip_carp.h#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/netinet/ip_input.c#8 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/netinet/libalias/alias_db.c#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/netinet6/in6_proto.c#9 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/netinet6/nd6_nbr.c#23 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/opencrypto/cryptodev.c#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/powerpc/include/pmap.h#6 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/powerpc/include/smp.h#5 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/powerpc/powerpc/mp_machdep.c#6 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sparc64/include/cache.h#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sparc64/include/pmap.h#5 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sparc64/include/smp.h#6 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sparc64/sparc64/cache.c#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sparc64/sparc64/genassym.c#5 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sparc64/sparc64/mem.c#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sparc64/sparc64/mp_exception.S#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sparc64/sparc64/mp_machdep.c#7 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sparc64/sparc64/pmap.c#10 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sparc64/sparc64/tick.c#5 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sparc64/sparc64/uio_machdep.c#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sparc64/sparc64/vm_machdep.c#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sun4v/include/smp.h#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sun4v/sun4v/mp_machdep.c#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sun4v/sun4v/pmap.c#8 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sys/conf.h#8 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sys/vnode.h#9 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/teken/teken_subr.h#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/ufs/ffs/ffs_softdep.c#9 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/vm/device_pager.c#7 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/vm/memguard.c#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/vm/memguard.h#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/vm/vm_extern.h#7 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/vm/vm_kern.c#5 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/vm/vm_mmap.c#10 integrate
Differences ...
==== //depot/projects/soc2009/anchie_send/src/sys/amd64/acpica/acpi_wakeup.c#7 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/acpica/acpi_wakeup.c,v 1.33 2010/08/02 17:35:00 jkim Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/acpica/acpi_wakeup.c,v 1.36 2010/08/12 00:20:46 jkim Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -71,7 +71,7 @@
static struct pcb **susppcbs;
#endif
-int acpi_restorecpu(struct pcb *, vm_offset_t);
+int acpi_restorecpu(vm_offset_t, struct pcb *);
static void *acpi_alloc_wakeup_handler(void);
static void acpi_stop_beep(void *);
@@ -176,7 +176,6 @@
acpi_wakeup_cpus(struct acpi_softc *sc, cpumask_t wakeup_cpus)
{
uint32_t mpbioswarmvec;
- cpumask_t map;
int cpu;
u_char mpbiosreason;
@@ -193,8 +192,7 @@
/* Wake up each AP. */
for (cpu = 1; cpu < mp_ncpus; cpu++) {
- map = 1ul << cpu;
- if ((wakeup_cpus & map) != map)
+ if ((wakeup_cpus & (1 << cpu)) == 0)
continue;
if (acpi_wakeup_ap(sc, cpu) == 0) {
/* restore the warmstart vector */
@@ -280,11 +278,13 @@
for (;;)
ia32_pause();
} else {
+ acpi_resync_clock(sc);
+ PCPU_SET(switchtime, cpu_ticks());
+ PCPU_SET(switchticks, ticks);
#ifdef SMP
if (wakeup_cpus != 0)
acpi_wakeup_cpus(sc, wakeup_cpus);
#endif
- acpi_resync_clock(sc);
ret = 0;
}
==== //depot/projects/soc2009/anchie_send/src/sys/amd64/amd64/mp_machdep.c#8 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.321 2010/08/02 17:35:00 jkim Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.328 2010/08/12 00:20:46 jkim Exp $");
#include "opt_cpu.h"
#include "opt_kstack_pages.h"
@@ -127,7 +127,7 @@
* Local data and functions.
*/
-static u_int logical_cpus;
+static cpumask_t logical_cpus;
static volatile cpumask_t ipi_nmi_pending;
/* used to hold the AP's until we are ready to release them */
@@ -162,8 +162,8 @@
static int start_ap(int apic_id);
static void release_aps(void *dummy);
-static int hlt_logical_cpus;
-static u_int hyperthreading_cpus;
+static cpumask_t hlt_logical_cpus;
+static cpumask_t hyperthreading_cpus;
static cpumask_t hyperthreading_cpus_mask;
static int hyperthreading_allowed = 1;
static struct sysctl_ctx_list logical_cpu_clist;
@@ -1053,7 +1053,7 @@
int ncpu, othercpus;
othercpus = mp_ncpus - 1;
- if (mask == (u_int)-1) {
+ if (mask == (cpumask_t)-1) {
ncpu = othercpus;
if (ncpu < 1)
return;
@@ -1078,7 +1078,7 @@
smp_tlb_addr1 = addr1;
smp_tlb_addr2 = addr2;
atomic_store_rel_int(&smp_tlb_wait, 0);
- if (mask == (u_int)-1)
+ if (mask == (cpumask_t)-1)
ipi_all_but_self(vector);
else
ipi_selected(mask, vector);
@@ -1087,6 +1087,30 @@
mtx_unlock_spin(&smp_ipi_mtx);
}
+/*
+ * Send an IPI to specified CPU handling the bitmap logic.
+ */
+static void
+ipi_send_cpu(int cpu, u_int ipi)
+{
+ u_int bitmap, old_pending, new_pending;
+
+ KASSERT(cpu_apic_ids[cpu] != -1, ("IPI to non-existent CPU %d", cpu));
+
+ if (IPI_IS_BITMAPED(ipi)) {
+ bitmap = 1 << ipi;
+ ipi = IPI_BITMAP_VECTOR;
+ do {
+ old_pending = cpu_ipi_pending[cpu];
+ new_pending = old_pending | bitmap;
+ } while (!atomic_cmpset_int(&cpu_ipi_pending[cpu],
+ old_pending, new_pending));
+ if (old_pending)
+ return;
+ }
+ lapic_ipi_vectored(ipi, cpu_apic_ids[cpu]);
+}
+
void
smp_cache_flush(void)
{
@@ -1210,14 +1234,6 @@
ipi_selected(cpumask_t cpus, u_int ipi)
{
int cpu;
- u_int bitmap = 0;
- u_int old_pending;
- u_int new_pending;
-
- if (IPI_IS_BITMAPED(ipi)) {
- bitmap = 1 << ipi;
- ipi = IPI_BITMAP_VECTOR;
- }
/*
* IPI_STOP_HARD maps to a NMI and the trap handler needs a bit
@@ -1231,23 +1247,27 @@
while ((cpu = ffs(cpus)) != 0) {
cpu--;
cpus &= ~(1 << cpu);
+ ipi_send_cpu(cpu, ipi);
+ }
+}
- KASSERT(cpu_apic_ids[cpu] != -1,
- ("IPI to non-existent CPU %d", cpu));
+/*
+ * send an IPI to a specific CPU.
+ */
+void
+ipi_cpu(int cpu, u_int ipi)
+{
- if (bitmap) {
- do {
- old_pending = cpu_ipi_pending[cpu];
- new_pending = old_pending | bitmap;
- } while (!atomic_cmpset_int(&cpu_ipi_pending[cpu],old_pending, new_pending));
+ /*
+ * IPI_STOP_HARD maps to a NMI and the trap handler needs a bit
+ * of help in order to understand what is the source.
+ * Set the mask of receiving CPUs for this purpose.
+ */
+ if (ipi == IPI_STOP_HARD)
+ atomic_set_int(&ipi_nmi_pending, 1 << cpu);
- if (old_pending)
- continue;
- }
-
- lapic_ipi_vectored(ipi, cpu_apic_ids[cpu]);
- }
-
+ CTR3(KTR_SMP, "%s: cpu: %d ipi: %x", __func__, cpu, ipi);
+ ipi_send_cpu(cpu, ipi);
}
/*
@@ -1301,8 +1321,13 @@
void
cpustop_handler(void)
{
- int cpu = PCPU_GET(cpuid);
- int cpumask = PCPU_GET(cpumask);
+ cpumask_t cpumask;
+ u_int cpu;
+
+ sched_pin();
+ cpu = PCPU_GET(cpuid);
+ cpumask = PCPU_GET(cpumask);
+ sched_unpin();
savectx(&stoppcbs[cpu]);
@@ -1329,9 +1354,14 @@
void
cpususpend_handler(void)
{
+ cpumask_t cpumask;
register_t cr3, rf;
- int cpu = PCPU_GET(cpuid);
- int cpumask = PCPU_GET(cpumask);
+ u_int cpu;
+
+ sched_pin();
+ cpu = PCPU_GET(cpuid);
+ cpumask = PCPU_GET(cpumask);
+ sched_unpin();
rf = intr_disable();
cr3 = rcr3();
@@ -1339,6 +1369,9 @@
if (savectx(susppcbs[cpu])) {
wbinvd();
atomic_set_int(&stopped_cpus, cpumask);
+ } else {
+ PCPU_SET(switchtime, cpu_ticks());
+ PCPU_SET(switchticks, ticks);
}
/* Wait for resume */
@@ -1503,19 +1536,27 @@
int
mp_grab_cpu_hlt(void)
{
- u_int mask = PCPU_GET(cpumask);
+ cpumask_t mask;
#ifdef MP_WATCHDOG
- u_int cpuid = PCPU_GET(cpuid);
+ u_int cpuid;
#endif
int retval;
#ifdef MP_WATCHDOG
+ sched_pin();
+ mask = PCPU_GET(cpumask);
+ cpuid = PCPU_GET(cpuid);
+ sched_unpin();
ap_watchdog(cpuid);
+#else
+ mask = PCPU_GET(cpumask);
#endif
- retval = mask & hlt_cpus_mask;
- while (mask & hlt_cpus_mask)
+ retval = 0;
+ while (mask & hlt_cpus_mask) {
+ retval = 1;
__asm __volatile("sti; hlt" : : : "memory");
+ }
return (retval);
}
==== //depot/projects/soc2009/anchie_send/src/sys/amd64/amd64/mptable_pci.c#2 (text+ko) ====
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/mptable_pci.c,v 1.8 2007/05/02 17:50:34 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/mptable_pci.c,v 1.9 2010/08/05 17:48:37 jhb Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -163,38 +163,15 @@
static device_method_t mptable_pcib_pci_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, mptable_pcib_probe),
- DEVMETHOD(device_attach, pcib_attach),
- DEVMETHOD(device_shutdown, bus_generic_shutdown),
- DEVMETHOD(device_suspend, bus_generic_suspend),
- DEVMETHOD(device_resume, bus_generic_resume),
- /* Bus interface */
- DEVMETHOD(bus_print_child, bus_generic_print_child),
- DEVMETHOD(bus_read_ivar, pcib_read_ivar),
- DEVMETHOD(bus_write_ivar, pcib_write_ivar),
- DEVMETHOD(bus_alloc_resource, pcib_alloc_resource),
- DEVMETHOD(bus_release_resource, bus_generic_release_resource),
- DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
- DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
- DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
- DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
-
/* pcib interface */
- DEVMETHOD(pcib_maxslots, pcib_maxslots),
- DEVMETHOD(pcib_read_config, pcib_read_config),
- DEVMETHOD(pcib_write_config, pcib_write_config),
DEVMETHOD(pcib_route_interrupt, mptable_pci_route_interrupt),
- DEVMETHOD(pcib_alloc_msi, pcib_alloc_msi),
- DEVMETHOD(pcib_release_msi, pcib_release_msi),
- DEVMETHOD(pcib_alloc_msix, pcib_alloc_msix),
- DEVMETHOD(pcib_release_msix, pcib_release_msix),
- DEVMETHOD(pcib_map_msi, pcib_map_msi),
{0, 0}
};
static devclass_t pcib_devclass;
-DEFINE_CLASS_0(pcib, mptable_pcib_driver, mptable_pcib_pci_methods,
- sizeof(struct pcib_softc));
+DEFINE_CLASS_1(pcib, mptable_pcib_driver, mptable_pcib_pci_methods,
+ sizeof(struct pcib_softc), pcib_driver);
DRIVER_MODULE(mptable_pcib, pci, mptable_pcib_driver, pcib_devclass, 0, 0);
==== //depot/projects/soc2009/anchie_send/src/sys/amd64/amd64/pmap.c#11 (text+ko) ====
@@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.709 2010/07/15 16:25:51 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.710 2010/08/10 16:14:10 attilio Exp $");
/*
* Manages physical address maps.
@@ -926,8 +926,7 @@
void
pmap_invalidate_page(pmap_t pmap, vm_offset_t va)
{
- u_int cpumask;
- u_int other_cpus;
+ cpumask_t cpumask, other_cpus;
sched_pin();
if (pmap == kernel_pmap || pmap->pm_active == all_cpus) {
@@ -947,8 +946,7 @@
void
pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
{
- u_int cpumask;
- u_int other_cpus;
+ cpumask_t cpumask, other_cpus;
vm_offset_t addr;
sched_pin();
@@ -972,8 +970,7 @@
void
pmap_invalidate_all(pmap_t pmap)
{
- u_int cpumask;
- u_int other_cpus;
+ cpumask_t cpumask, other_cpus;
sched_pin();
if (pmap == kernel_pmap || pmap->pm_active == all_cpus) {
==== //depot/projects/soc2009/anchie_send/src/sys/amd64/amd64/tsc.c#2 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/tsc.c,v 1.209 2008/10/21 00:38:00 jkim Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/tsc.c,v 1.210 2010/08/08 20:34:53 dwmalone Exp $");
#include "opt_clock.h"
@@ -222,7 +222,7 @@
}
SYSCTL_PROC(_machdep, OID_AUTO, tsc_freq, CTLTYPE_QUAD | CTLFLAG_RW,
- 0, sizeof(u_int), sysctl_machdep_tsc_freq, "QU", "");
+ 0, 0, sysctl_machdep_tsc_freq, "QU", "");
static unsigned
tsc_get_timecount(struct timecounter *tc)
==== //depot/projects/soc2009/anchie_send/src/sys/amd64/amd64/vm_machdep.c#6 (text+ko) ====
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/vm_machdep.c,v 1.270 2010/06/15 09:19:33 kib Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/vm_machdep.c,v 1.271 2010/08/11 23:22:53 jhb Exp $");
#include "opt_isa.h"
#include "opt_cpu.h"
@@ -527,7 +527,8 @@
cpu_reset()
{
#ifdef SMP
- u_int cnt, map;
+ cpumask_t map;
+ u_int cnt;
if (smp_active) {
map = PCPU_GET(other_cpus) & ~stopped_cpus;
==== //depot/projects/soc2009/anchie_send/src/sys/amd64/conf/GENERIC#11 (text+ko) ====
@@ -16,7 +16,7 @@
# If you are in doubt as to the purpose or necessity of a line, check first
# in NOTES.
#
-# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.546 2010/07/28 15:36:12 mdf Exp $
+# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.547 2010/08/06 18:46:27 bschmidt Exp $
cpu HAMMER
ident GENERIC
@@ -62,7 +62,7 @@
options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4)
options AUDIT # Security event auditing
options MAC # TrustedBSD MAC Framework
-options FLOWTABLE # per-cpu routing cache
+options FLOWTABLE # per-cpu routing cache
#options KDTRACE_FRAME # Ensure frames are compiled in
#options KDTRACE_HOOKS # Kernel DTrace hooks
options INCLUDE_CONFIG_FILE # Include this file in kernel
==== //depot/projects/soc2009/anchie_send/src/sys/amd64/ia32/ia32_signal.c#7 (text+ko) ====
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/ia32/ia32_signal.c,v 1.30 2010/06/30 18:03:42 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/ia32/ia32_signal.c,v 1.31 2010/08/07 11:57:13 kib Exp $");
#include "opt_compat.h"
@@ -391,7 +391,7 @@
}
regs->tf_rsp = (uintptr_t)sfp;
- regs->tf_rip = FREEBSD32_PS_STRINGS - sz_freebsd4_ia32_sigcode;
+ regs->tf_rip = p->p_sysent->sv_psstrings - sz_freebsd4_ia32_sigcode;
regs->tf_rflags &= ~(PSL_T | PSL_D);
regs->tf_cs = _ucode32sel;
regs->tf_ss = _udatasel;
@@ -512,7 +512,7 @@
}
regs->tf_rsp = (uintptr_t)sfp;
- regs->tf_rip = FREEBSD32_PS_STRINGS - *(p->p_sysent->sv_szsigcode);
+ regs->tf_rip = p->p_sysent->sv_psstrings - *(p->p_sysent->sv_szsigcode);
regs->tf_rflags &= ~(PSL_T | PSL_D);
regs->tf_cs = _ucode32sel;
regs->tf_ss = _udatasel;
==== //depot/projects/soc2009/anchie_send/src/sys/amd64/include/smp.h#4 (text+ko) ====
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $FreeBSD: src/sys/amd64/include/smp.h,v 1.98 2010/06/17 11:54:49 mav Exp $
+ * $FreeBSD: src/sys/amd64/include/smp.h,v 1.99 2010/08/06 15:36:59 jhb Exp $
*
*/
@@ -60,10 +60,11 @@
void cpustop_handler(void);
void cpususpend_handler(void);
void init_secondary(void);
+void ipi_all_but_self(u_int ipi);
+void ipi_bitmap_handler(struct trapframe frame);
+void ipi_cpu(int cpu, u_int ipi);
int ipi_nmi_handler(void);
void ipi_selected(cpumask_t cpus, u_int ipi);
-void ipi_all_but_self(u_int ipi);
-void ipi_bitmap_handler(struct trapframe frame);
u_int mp_bootaddress(u_int);
int mp_grab_cpu_hlt(void);
void smp_cache_flush(void);
==== //depot/projects/soc2009/anchie_send/src/sys/arm/include/pmap.h#5 (text+ko) ====
@@ -44,7 +44,7 @@
* from: @(#)pmap.h 7.4 (Berkeley) 5/12/91
* from: FreeBSD: src/sys/i386/include/pmap.h,v 1.70 2000/11/30
*
- * $FreeBSD: src/sys/arm/include/pmap.h,v 1.34 2010/04/30 00:46:43 kmacy Exp $
+ * $FreeBSD: src/sys/arm/include/pmap.h,v 1.35 2010/08/11 23:22:53 jhb Exp $
*/
#ifndef _MACHINE_PMAP_H_
@@ -136,7 +136,7 @@
pd_entry_t *pm_pdir; /* KVA of page directory */
uint32_t pm_gen_count; /* generation count (pmap lock dropped) */
u_int pm_retries;
- int pm_active; /* active on cpus */
+ cpumask_t pm_active; /* active on cpus */
struct pmap_statistics pm_stats; /* pmap statictics */
TAILQ_HEAD(,pv_entry) pm_pvlist; /* list of mappings in pmap */
};
==== //depot/projects/soc2009/anchie_send/src/sys/boot/zfs/zfsimpl.c#4 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/zfs/zfsimpl.c,v 1.10 2010/05/28 07:34:20 avg Exp $");
+__FBSDID("$FreeBSD: src/sys/boot/zfs/zfsimpl.c,v 1.11 2010/08/09 06:36:11 mm Exp $");
/*
* Stand-alone ZFS file reader.
@@ -328,6 +328,9 @@
size_t psize;
int rc;
+ if (!vdev->v_phys_read)
+ return (EIO);
+
if (bp) {
psize = BP_GET_PSIZE(bp);
} else {
==== //depot/projects/soc2009/anchie_send/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c#6 (text+ko) ====
@@ -357,7 +357,7 @@
* quota on things *under* (ie. contained by)
* the thing they own.
*/
- if (dsl_prop_get_integer(name, "zoned", &zoned,
+ if (dsl_prop_get_integer(name, "jailed", &zoned,
setpoint))
return (EPERM);
if (!zoned || strlen(name) <= strlen(setpoint))
==== //depot/projects/soc2009/anchie_send/src/sys/compat/freebsd32/freebsd32.h#4 (text+ko) ====
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32.h,v 1.13 2010/04/21 19:32:00 kib Exp $
+ * $FreeBSD: src/sys/compat/freebsd32/freebsd32.h,v 1.14 2010/08/07 11:53:38 kib Exp $
*/
#ifndef _COMPAT_FREEBSD32_FREEBSD32_H_
@@ -157,6 +157,24 @@
unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec32));
};
+struct ostat32 {
+ __uint16_t st_dev;
+ ino_t st_ino;
+ mode_t st_mode;
+ nlink_t st_nlink;
+ __uint16_t st_uid;
+ __uint16_t st_gid;
+ __uint16_t st_rdev;
+ __int32_t st_size;
+ struct timespec32 st_atim;
+ struct timespec32 st_mtim;
+ struct timespec32 st_ctim;
+ __int32_t st_blksize;
+ __int32_t st_blocks;
+ u_int32_t st_flags;
+ __uint32_t st_gen;
+};
+
struct jail32_v0 {
u_int32_t version;
uint32_t path;
==== //depot/projects/soc2009/anchie_send/src/sys/compat/freebsd32/freebsd32_misc.c#9 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/freebsd32/freebsd32_misc.c,v 1.113 2010/08/04 14:38:20 kib Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/freebsd32/freebsd32_misc.c,v 1.114 2010/08/07 11:57:13 kib Exp $");
#include "opt_compat.h"
#include "opt_inet.h"
@@ -2541,7 +2541,8 @@
execpath_len = strlen(imgp->execpath) + 1;
else
execpath_len = 0;
- arginfo = (struct freebsd32_ps_strings *)FREEBSD32_PS_STRINGS;
+ arginfo = (struct freebsd32_ps_strings *)curproc->p_sysent->
+ sv_psstrings;
szsigcode = *(imgp->proc->p_sysent->sv_szsigcode);
destp = (caddr_t)arginfo - szsigcode - SPARE_USRSPACE -
roundup(execpath_len, sizeof(char *)) -
==== //depot/projects/soc2009/anchie_send/src/sys/compat/x86bios/x86bios.c#5 (text+ko) ====
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/x86bios/x86bios.c,v 1.18 2010/06/23 17:20:51 jkim Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/x86bios/x86bios.c,v 1.30 2010/08/10 15:22:48 jkim Exp $");
#include "opt_x86bios.h"
@@ -37,7 +37,6 @@
#include <sys/malloc.h>
#include <sys/module.h>
#include <sys/mutex.h>
-#include <sys/proc.h>
#include <sys/sysctl.h>
#include <contrib/x86emu/x86emu.h>
@@ -47,36 +46,236 @@
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
-#include <machine/iodev.h>
-
#include <vm/vm.h>
#include <vm/pmap.h>
-#if defined(__amd64__) || defined(__i386__)
+#ifdef __amd64__
#define X86BIOS_NATIVE_ARCH
#endif
+#ifdef __i386__
+#define X86BIOS_NATIVE_VM86
+#endif
+
+#define X86BIOS_MEM_SIZE 0x00100000 /* 1M */
+
+#define X86BIOS_TRACE(h, n, r) do { \
+ printf(__STRING(h) \
+ " (ax=0x%04x bx=0x%04x cx=0x%04x dx=0x%04x es=0x%04x di=0x%04x)\n",\
+ (n), (r)->R_AX, (r)->R_BX, (r)->R_CX, (r)->R_DX, \
+ (r)->R_ES, (r)->R_DI); \
+} while (0)
+
+static struct mtx x86bios_lock;
+
+SYSCTL_NODE(_debug, OID_AUTO, x86bios, CTLFLAG_RD, NULL, "x86bios debugging");
+static int x86bios_trace_call;
+TUNABLE_INT("debug.x86bios.call", &x86bios_trace_call);
+SYSCTL_INT(_debug_x86bios, OID_AUTO, call, CTLFLAG_RW, &x86bios_trace_call, 0,
+ "Trace far function calls");
+static int x86bios_trace_int;
+TUNABLE_INT("debug.x86bios.int", &x86bios_trace_int);
+SYSCTL_INT(_debug_x86bios, OID_AUTO, int, CTLFLAG_RW, &x86bios_trace_int, 0,
+ "Trace software interrupt handlers");
+
+#ifdef X86BIOS_NATIVE_VM86
+
+#include <machine/vm86.h>
+#include <machine/vmparam.h>
+#include <machine/pc/bios.h>
+
+struct vm86context x86bios_vmc;
+
+static void
+x86bios_emu2vmf(struct x86emu_regs *regs, struct vm86frame *vmf)
+{
+
+ vmf->vmf_ds = regs->R_DS;
+ vmf->vmf_es = regs->R_ES;
+ vmf->vmf_ax = regs->R_AX;
+ vmf->vmf_bx = regs->R_BX;
+ vmf->vmf_cx = regs->R_CX;
+ vmf->vmf_dx = regs->R_DX;
+ vmf->vmf_bp = regs->R_BP;
+ vmf->vmf_si = regs->R_SI;
+ vmf->vmf_di = regs->R_DI;
+}
+
+static void
+x86bios_vmf2emu(struct vm86frame *vmf, struct x86emu_regs *regs)
+{
+ regs->R_DS = vmf->vmf_ds;
+ regs->R_ES = vmf->vmf_es;
+ regs->R_FLG = vmf->vmf_flags;
+ regs->R_AX = vmf->vmf_ax;
+ regs->R_BX = vmf->vmf_bx;
+ regs->R_CX = vmf->vmf_cx;
+ regs->R_DX = vmf->vmf_dx;
+ regs->R_BP = vmf->vmf_bp;
+ regs->R_SI = vmf->vmf_si;
+ regs->R_DI = vmf->vmf_di;
+}
+
+void *
+x86bios_alloc(uint32_t *offset, size_t size, int flags)
+{
+ void *vaddr;
+ int i;
+
+ if (offset == NULL || size == 0)
+ return (NULL);
+ vaddr = contigmalloc(size, M_DEVBUF, flags, 0, X86BIOS_MEM_SIZE,
+ PAGE_SIZE, 0);
+ if (vaddr != NULL) {
+ *offset = vtophys(vaddr);
+ mtx_lock(&x86bios_lock);
+ for (i = 0; i < atop(round_page(size)); i++)
+ vm86_addpage(&x86bios_vmc, atop(*offset) + i,
+ (vm_offset_t)vaddr + ptoa(i));
+ mtx_unlock(&x86bios_lock);
+ }
+
+ return (vaddr);
+}
+
+void
+x86bios_free(void *addr, size_t size)
+{
+ vm_paddr_t paddr;
+ int i, nfree;
+
+ if (addr == NULL || size == 0)
+ return;
+ paddr = vtophys(addr);
+ if (paddr >= X86BIOS_MEM_SIZE || (paddr & PAGE_MASK) != 0)
+ return;
+ mtx_lock(&x86bios_lock);
+ for (i = 0; i < x86bios_vmc.npages; i++)
+ if (x86bios_vmc.pmap[i].kva == (vm_offset_t)addr)
+ break;
+ if (i >= x86bios_vmc.npages) {
+ mtx_unlock(&x86bios_lock);
+ return;
+ }
+ nfree = atop(round_page(size));
+ bzero(x86bios_vmc.pmap + i, sizeof(*x86bios_vmc.pmap) * nfree);
+ if (i + nfree == x86bios_vmc.npages) {
+ x86bios_vmc.npages -= nfree;
+ while (--i >= 0 && x86bios_vmc.pmap[i].kva == 0)
+ x86bios_vmc.npages--;
+ }
+ mtx_unlock(&x86bios_lock);
+ contigfree(addr, size, M_DEVBUF);
+}
+
+void
+x86bios_init_regs(struct x86regs *regs)
+{
+
+ bzero(regs, sizeof(*regs));
+}
+
+void
+x86bios_call(struct x86regs *regs, uint16_t seg, uint16_t off)
+{
+ struct vm86frame vmf;
+
+ if (x86bios_trace_call)
+ X86BIOS_TRACE(Calling 0x%06x, (seg << 4) + off, regs);
+
+ bzero(&vmf, sizeof(vmf));
+ x86bios_emu2vmf((struct x86emu_regs *)regs, &vmf);
+ vmf.vmf_cs = seg;
+ vmf.vmf_ip = off;
+ mtx_lock(&x86bios_lock);
+ vm86_datacall(-1, &vmf, &x86bios_vmc);
+ mtx_unlock(&x86bios_lock);
+ x86bios_vmf2emu(&vmf, (struct x86emu_regs *)regs);
+
+ if (x86bios_trace_call)
+ X86BIOS_TRACE(Exiting 0x%06x, (seg << 4) + off, regs);
+}
+
+uint32_t
+x86bios_get_intr(int intno)
+{
+
+ return (readl(BIOS_PADDRTOVADDR(intno * 4)));
+}
+
+void
+x86bios_intr(struct x86regs *regs, int intno)
+{
+ struct vm86frame vmf;
+
+ if (x86bios_trace_int)
+ X86BIOS_TRACE(Calling INT 0x%02x, intno, regs);
+
+ bzero(&vmf, sizeof(vmf));
+ x86bios_emu2vmf((struct x86emu_regs *)regs, &vmf);
+ mtx_lock(&x86bios_lock);
+ vm86_datacall(intno, &vmf, &x86bios_vmc);
+ mtx_unlock(&x86bios_lock);
+ x86bios_vmf2emu(&vmf, (struct x86emu_regs *)regs);
+
+ if (x86bios_trace_int)
+ X86BIOS_TRACE(Exiting INT 0x%02x, intno, regs);
+}
+
+void *
+x86bios_offset(uint32_t offset)
+{
+ vm_offset_t addr;
+
+ addr = vm86_getaddr(&x86bios_vmc, X86BIOS_PHYSTOSEG(offset),
+ X86BIOS_PHYSTOOFF(offset));
+ if (addr == 0)
+ addr = BIOS_PADDRTOVADDR(offset);
+
+ return ((void *)addr);
+}
+
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list