svn commit: r215164 - in user/nwhitehorn/ps3: amd64/acpica
amd64/amd64 amd64/include arm/arm arm/conf arm/include
arm/xscale/ixp425 boot/arm/ixp425/boot2 boot/common
boot/fdt/dts boot/forth boot/i3...
Nathan Whitehorn
nwhitehorn at FreeBSD.org
Fri Nov 12 05:13:47 UTC 2010
Author: nwhitehorn
Date: Fri Nov 12 05:13:46 2010
New Revision: 215164
URL: http://svn.freebsd.org/changeset/base/215164
Log:
IFC @ r215163 in order to loop back recent merges from this branch.
Added:
user/nwhitehorn/ps3/arm/xscale/ixp425/avila_gpio.c
- copied unchanged from r215160, head/sys/arm/xscale/ixp425/avila_gpio.c
user/nwhitehorn/ps3/arm/xscale/ixp425/cambria_gpio.c
- copied unchanged from r215160, head/sys/arm/xscale/ixp425/cambria_gpio.c
user/nwhitehorn/ps3/mips/conf/std.SWARM
- copied unchanged from r215160, head/sys/mips/conf/std.SWARM
user/nwhitehorn/ps3/mips/mips/minidump_machdep.c
- copied unchanged from r215160, head/sys/mips/mips/minidump_machdep.c
user/nwhitehorn/ps3/powerpc/ofw/ofw_machdep.c
- copied unchanged from r215163, head/sys/powerpc/ofw/ofw_machdep.c
user/nwhitehorn/ps3/x86/acpica/OsdEnvironment.c
- copied unchanged from r215160, head/sys/x86/acpica/OsdEnvironment.c
user/nwhitehorn/ps3/x86/acpica/acpi_apm.c
- copied unchanged from r215160, head/sys/x86/acpica/acpi_apm.c
user/nwhitehorn/ps3/x86/acpica/madt.c
- copied unchanged from r215160, head/sys/x86/acpica/madt.c
user/nwhitehorn/ps3/x86/include/apm_bios.h
- copied unchanged from r215160, head/sys/x86/include/apm_bios.h
user/nwhitehorn/ps3/x86/include/mptable.h
- copied unchanged from r215160, head/sys/x86/include/mptable.h
Deleted:
user/nwhitehorn/ps3/amd64/acpica/OsdEnvironment.c
user/nwhitehorn/ps3/amd64/acpica/madt.c
user/nwhitehorn/ps3/amd64/include/mptable.h
user/nwhitehorn/ps3/amd64/include/mutex.h
user/nwhitehorn/ps3/arm/include/mutex.h
user/nwhitehorn/ps3/i386/acpica/OsdEnvironment.c
user/nwhitehorn/ps3/i386/acpica/madt.c
user/nwhitehorn/ps3/i386/include/mptable.h
user/nwhitehorn/ps3/i386/include/mutex.h
user/nwhitehorn/ps3/ia64/include/mutex.h
user/nwhitehorn/ps3/mips/conf/SWARM_COMMON
user/nwhitehorn/ps3/mips/include/mutex.h
user/nwhitehorn/ps3/pc98/include/mptable.h
user/nwhitehorn/ps3/pc98/include/mutex.h
user/nwhitehorn/ps3/powerpc/aim/ofw_machdep.c
user/nwhitehorn/ps3/powerpc/include/mutex.h
user/nwhitehorn/ps3/sparc64/include/mutex.h
user/nwhitehorn/ps3/sun4v/include/mutex.h
Modified:
user/nwhitehorn/ps3/amd64/acpica/acpi_machdep.c
user/nwhitehorn/ps3/amd64/amd64/amd64_mem.c
user/nwhitehorn/ps3/amd64/amd64/machdep.c
user/nwhitehorn/ps3/amd64/amd64/minidump_machdep.c
user/nwhitehorn/ps3/amd64/amd64/mp_machdep.c
user/nwhitehorn/ps3/amd64/include/apm_bios.h
user/nwhitehorn/ps3/amd64/include/minidump.h
user/nwhitehorn/ps3/arm/arm/machdep.c
user/nwhitehorn/ps3/arm/conf/AVILA
user/nwhitehorn/ps3/arm/conf/AVILA.hints
user/nwhitehorn/ps3/arm/conf/BWCT.hints
user/nwhitehorn/ps3/arm/conf/CAMBRIA
user/nwhitehorn/ps3/arm/conf/CAMBRIA.hints
user/nwhitehorn/ps3/arm/include/cpuconf.h
user/nwhitehorn/ps3/arm/xscale/ixp425/files.avila
user/nwhitehorn/ps3/arm/xscale/ixp425/ixp425_qmgr.c
user/nwhitehorn/ps3/arm/xscale/ixp425/ixp425reg.h
user/nwhitehorn/ps3/boot/arm/ixp425/boot2/ixp425_board.c
user/nwhitehorn/ps3/boot/common/loader.8
user/nwhitehorn/ps3/boot/fdt/dts/mpc8555cds.dts
user/nwhitehorn/ps3/boot/forth/beastie.4th
user/nwhitehorn/ps3/boot/i386/libi386/biosacpi.c
user/nwhitehorn/ps3/boot/i386/libi386/i386_module.c
user/nwhitehorn/ps3/boot/i386/loader/help.i386
user/nwhitehorn/ps3/cam/cam_periph.c
user/nwhitehorn/ps3/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
user/nwhitehorn/ps3/compat/linprocfs/linprocfs.c
user/nwhitehorn/ps3/compat/ndis/kern_ndis.c
user/nwhitehorn/ps3/compat/ndis/subr_ndis.c
user/nwhitehorn/ps3/compat/ndis/subr_ntoskrnl.c
user/nwhitehorn/ps3/conf/Makefile.mips
user/nwhitehorn/ps3/conf/files.amd64
user/nwhitehorn/ps3/conf/files.i386
user/nwhitehorn/ps3/conf/files.mips
user/nwhitehorn/ps3/conf/files.powerpc
user/nwhitehorn/ps3/contrib/octeon-sdk/cvmx-app-init.h
user/nwhitehorn/ps3/contrib/octeon-sdk/cvmx-helper-board.c
user/nwhitehorn/ps3/contrib/octeon-sdk/cvmx-helper.c
user/nwhitehorn/ps3/dev/acpica/acpi.c
user/nwhitehorn/ps3/dev/acpica/acpi_pci_link.c
user/nwhitehorn/ps3/dev/acpica/acpivar.h
user/nwhitehorn/ps3/dev/ahci/ahci.c
user/nwhitehorn/ps3/dev/ata/ata-all.c
user/nwhitehorn/ps3/dev/ata/ata-disk.c
user/nwhitehorn/ps3/dev/ata/ata-lowlevel.c
user/nwhitehorn/ps3/dev/bwi/if_bwi.c
user/nwhitehorn/ps3/dev/bwn/if_bwn.c
user/nwhitehorn/ps3/dev/drm/r300_reg.h
user/nwhitehorn/ps3/dev/gpio/gpiobus.c
user/nwhitehorn/ps3/dev/gpio/gpioc.c
user/nwhitehorn/ps3/dev/gpio/gpioled.c
user/nwhitehorn/ps3/dev/iicbus/iiconf.c
user/nwhitehorn/ps3/dev/isp/isp_freebsd.c
user/nwhitehorn/ps3/dev/iwn/if_iwn.c
user/nwhitehorn/ps3/dev/ixgbe/ixgbe.c
user/nwhitehorn/ps3/dev/mii/brgphy.c
user/nwhitehorn/ps3/dev/mii/miidevs
user/nwhitehorn/ps3/dev/msk/if_msk.c
user/nwhitehorn/ps3/dev/nfe/if_nfe.c
user/nwhitehorn/ps3/dev/nfe/if_nfereg.h
user/nwhitehorn/ps3/dev/nfe/if_nfevar.h
user/nwhitehorn/ps3/dev/ofw/ofw_fdt.c
user/nwhitehorn/ps3/dev/ofw/openfirm.c
user/nwhitehorn/ps3/dev/pccard/pccardvar.h
user/nwhitehorn/ps3/dev/ral/rt2560.c
user/nwhitehorn/ps3/dev/ral/rt2661.c
user/nwhitehorn/ps3/dev/re/if_re.c
user/nwhitehorn/ps3/dev/siis/siis.c
user/nwhitehorn/ps3/dev/sk/if_sk.c
user/nwhitehorn/ps3/dev/sound/sbus/cs4231.c
user/nwhitehorn/ps3/dev/syscons/schistory.c
user/nwhitehorn/ps3/dev/uart/uart_subr.c
user/nwhitehorn/ps3/dev/usb/net/uhso.c
user/nwhitehorn/ps3/dev/usb/quirk/usb_quirk.c
user/nwhitehorn/ps3/dev/usb/quirk/usb_quirk.h
user/nwhitehorn/ps3/dev/usb/serial/u3g.c
user/nwhitehorn/ps3/dev/usb/serial/uark.c
user/nwhitehorn/ps3/dev/usb/serial/ubsa.c
user/nwhitehorn/ps3/dev/usb/serial/ubser.c
user/nwhitehorn/ps3/dev/usb/serial/uchcom.c
user/nwhitehorn/ps3/dev/usb/serial/ucycom.c
user/nwhitehorn/ps3/dev/usb/serial/ufoma.c
user/nwhitehorn/ps3/dev/usb/serial/uftdi.c
user/nwhitehorn/ps3/dev/usb/serial/ugensa.c
user/nwhitehorn/ps3/dev/usb/serial/uipaq.c
user/nwhitehorn/ps3/dev/usb/serial/umct.c
user/nwhitehorn/ps3/dev/usb/serial/umodem.c
user/nwhitehorn/ps3/dev/usb/serial/umoscom.c
user/nwhitehorn/ps3/dev/usb/serial/uplcom.c
user/nwhitehorn/ps3/dev/usb/serial/usb_serial.c
user/nwhitehorn/ps3/dev/usb/serial/usb_serial.h
user/nwhitehorn/ps3/dev/usb/serial/uslcom.c
user/nwhitehorn/ps3/dev/usb/serial/uvisor.c
user/nwhitehorn/ps3/dev/usb/serial/uvscom.c
user/nwhitehorn/ps3/dev/usb/usb_device.c
user/nwhitehorn/ps3/dev/usb/usb_request.c
user/nwhitehorn/ps3/dev/usb/usb_request.h
user/nwhitehorn/ps3/dev/usb/usbdevs
user/nwhitehorn/ps3/dev/usb/wlan/if_rum.c
user/nwhitehorn/ps3/dev/usb/wlan/if_run.c
user/nwhitehorn/ps3/dev/usb/wlan/if_ural.c
user/nwhitehorn/ps3/dev/usb/wlan/if_zyd.c
user/nwhitehorn/ps3/dev/wb/if_wb.c
user/nwhitehorn/ps3/dev/wpi/if_wpi.c
user/nwhitehorn/ps3/dev/xl/if_xl.c
user/nwhitehorn/ps3/fs/nwfs/nwfs_vnops.c
user/nwhitehorn/ps3/geom/geom_event.c
user/nwhitehorn/ps3/geom/part/g_part.c
user/nwhitehorn/ps3/i386/acpica/acpi_machdep.c
user/nwhitehorn/ps3/i386/bios/apm.c
user/nwhitehorn/ps3/i386/i386/machdep.c
user/nwhitehorn/ps3/i386/i386/mp_machdep.c
user/nwhitehorn/ps3/i386/i386/pmap.c
user/nwhitehorn/ps3/i386/include/apm_bios.h
user/nwhitehorn/ps3/i386/xen/mptable.c
user/nwhitehorn/ps3/ia64/acpica/OsdEnvironment.c
user/nwhitehorn/ps3/ia64/ia64/db_machdep.c
user/nwhitehorn/ps3/ia64/ia64/genassym.c
user/nwhitehorn/ps3/ia64/ia64/machdep.c
user/nwhitehorn/ps3/kern/kern_clocksource.c
user/nwhitehorn/ps3/kern/kern_conf.c
user/nwhitehorn/ps3/kern/kern_mutex.c
user/nwhitehorn/ps3/kern/kern_proc.c
user/nwhitehorn/ps3/kern/kern_timeout.c
user/nwhitehorn/ps3/kern/link_elf.c
user/nwhitehorn/ps3/kern/sched_ule.c
user/nwhitehorn/ps3/kern/subr_lock.c
user/nwhitehorn/ps3/kern/subr_taskqueue.c
user/nwhitehorn/ps3/mips/cavium/octopci.c
user/nwhitehorn/ps3/mips/conf/SWARM
user/nwhitehorn/ps3/mips/conf/SWARM64
user/nwhitehorn/ps3/mips/conf/SWARM64_SMP
user/nwhitehorn/ps3/mips/conf/SWARM_SMP
user/nwhitehorn/ps3/mips/conf/XLR
user/nwhitehorn/ps3/mips/conf/XLR64
user/nwhitehorn/ps3/mips/conf/XLRN32
user/nwhitehorn/ps3/mips/include/cpuregs.h
user/nwhitehorn/ps3/mips/include/md_var.h
user/nwhitehorn/ps3/mips/include/pmap.h
user/nwhitehorn/ps3/mips/mips/dump_machdep.c
user/nwhitehorn/ps3/mips/mips/gdb_machdep.c
user/nwhitehorn/ps3/mips/mips/machdep.c
user/nwhitehorn/ps3/mips/mips/vm_machdep.c
user/nwhitehorn/ps3/modules/acpi/Makefile
user/nwhitehorn/ps3/modules/acpi/acpi/Makefile
user/nwhitehorn/ps3/net/vnet.h
user/nwhitehorn/ps3/net80211/ieee80211.c
user/nwhitehorn/ps3/net80211/ieee80211_node.c
user/nwhitehorn/ps3/net80211/ieee80211_ratectl.c
user/nwhitehorn/ps3/net80211/ieee80211_ratectl.h
user/nwhitehorn/ps3/net80211/ieee80211_sta.c
user/nwhitehorn/ps3/net80211/ieee80211_var.h
user/nwhitehorn/ps3/netinet/in_pcb.c
user/nwhitehorn/ps3/netinet/libalias/alias.c
user/nwhitehorn/ps3/netinet/libalias/alias_sctp.c
user/nwhitehorn/ps3/netinet/libalias/alias_sctp.h
user/nwhitehorn/ps3/netinet/sctp.h
user/nwhitehorn/ps3/netinet/sctp_indata.c
user/nwhitehorn/ps3/netinet/sctp_input.c
user/nwhitehorn/ps3/netinet/sctp_os_bsd.h
user/nwhitehorn/ps3/netinet/sctp_output.c
user/nwhitehorn/ps3/netinet/sctp_pcb.c
user/nwhitehorn/ps3/netinet/sctp_timer.c
user/nwhitehorn/ps3/netinet/sctp_timer.h
user/nwhitehorn/ps3/netinet/sctp_uio.h
user/nwhitehorn/ps3/netinet/sctp_usrreq.c
user/nwhitehorn/ps3/netinet/sctputil.c
user/nwhitehorn/ps3/netinet/sctputil.h
user/nwhitehorn/ps3/netinet/siftr.c
user/nwhitehorn/ps3/nfsserver/nfs_serv.c
user/nwhitehorn/ps3/pc98/include/apm_bios.h
user/nwhitehorn/ps3/pc98/pc98/machdep.c
user/nwhitehorn/ps3/pci/if_rlreg.h
user/nwhitehorn/ps3/powerpc/aim/clock.c
user/nwhitehorn/ps3/powerpc/aim/copyinout.c
user/nwhitehorn/ps3/powerpc/aim/machdep.c
user/nwhitehorn/ps3/powerpc/aim/mmu_oea.c
user/nwhitehorn/ps3/powerpc/aim/mmu_oea64.c
user/nwhitehorn/ps3/powerpc/aim/nexus.c
user/nwhitehorn/ps3/powerpc/aim/trap.c
user/nwhitehorn/ps3/powerpc/aim/trap_subr32.S
user/nwhitehorn/ps3/powerpc/booke/clock.c
user/nwhitehorn/ps3/powerpc/booke/locore.S
user/nwhitehorn/ps3/powerpc/booke/machdep.c
user/nwhitehorn/ps3/powerpc/booke/pmap.c
user/nwhitehorn/ps3/powerpc/booke/trap_subr.S
user/nwhitehorn/ps3/powerpc/include/tlb.h
user/nwhitehorn/ps3/powerpc/powermac/smu.c
user/nwhitehorn/ps3/powerpc/powerpc/cpu.c
user/nwhitehorn/ps3/security/mac_portacl/mac_portacl.c
user/nwhitehorn/ps3/sparc64/include/vmparam.h
user/nwhitehorn/ps3/sparc64/sparc64/machdep.c
user/nwhitehorn/ps3/sparc64/sparc64/pmap.c
user/nwhitehorn/ps3/sun4v/include/pmap.h
user/nwhitehorn/ps3/sun4v/include/smp.h
user/nwhitehorn/ps3/sun4v/sun4v/machdep.c
user/nwhitehorn/ps3/sun4v/sun4v/mp_machdep.c
user/nwhitehorn/ps3/sys/cdefs.h
user/nwhitehorn/ps3/sys/interrupt.h
user/nwhitehorn/ps3/sys/kernel.h
user/nwhitehorn/ps3/sys/kerneldump.h
user/nwhitehorn/ps3/sys/linker_set.h
user/nwhitehorn/ps3/sys/mutex.h
user/nwhitehorn/ps3/sys/param.h
user/nwhitehorn/ps3/sys/pcpu.h
user/nwhitehorn/ps3/sys/taskqueue.h
user/nwhitehorn/ps3/teken/sequences
user/nwhitehorn/ps3/teken/teken_subr_compat.h
user/nwhitehorn/ps3/ufs/ffs/ffs_inode.c
user/nwhitehorn/ps3/ufs/ffs/ffs_softdep.c
user/nwhitehorn/ps3/ufs/ffs/fs.h
user/nwhitehorn/ps3/ufs/ufs/ufs_vnops.c
user/nwhitehorn/ps3/vm/uma_core.c
user/nwhitehorn/ps3/vm/vm_map.c
user/nwhitehorn/ps3/vm/vm_page.c
user/nwhitehorn/ps3/vm/vm_reserv.c
user/nwhitehorn/ps3/x86/cpufreq/hwpstate.c
user/nwhitehorn/ps3/x86/x86/local_apic.c
user/nwhitehorn/ps3/x86/x86/mptable.c
user/nwhitehorn/ps3/x86/x86/mptable_pci.c
Directory Properties:
user/nwhitehorn/ps3/ (props changed)
user/nwhitehorn/ps3/amd64/include/xen/ (props changed)
user/nwhitehorn/ps3/boot/powerpc/ps3/ (props changed)
user/nwhitehorn/ps3/cddl/contrib/opensolaris/ (props changed)
user/nwhitehorn/ps3/contrib/dev/acpica/ (props changed)
user/nwhitehorn/ps3/contrib/pf/ (props changed)
user/nwhitehorn/ps3/contrib/x86emu/ (props changed)
user/nwhitehorn/ps3/dev/xen/xenpci/ (props changed)
user/nwhitehorn/ps3/powerpc/ps3/ (props changed)
Modified: user/nwhitehorn/ps3/amd64/acpica/acpi_machdep.c
==============================================================================
--- user/nwhitehorn/ps3/amd64/acpica/acpi_machdep.c Fri Nov 12 05:12:38 2010 (r215163)
+++ user/nwhitehorn/ps3/amd64/acpica/acpi_machdep.c Fri Nov 12 05:13:46 2010 (r215164)
@@ -44,24 +44,6 @@ __FBSDID("$FreeBSD$");
#include <machine/nexusvar.h>
-/*
- * APM driver emulation
- */
-
-#include <sys/condvar.h>
-#include <sys/conf.h>
-#include <sys/fcntl.h>
-#include <sys/malloc.h>
-#include <sys/poll.h>
-#include <sys/uio.h>
-
-#include <dev/acpica/acpiio.h>
-
-#include <machine/apm_bios.h>
-#include <i386/include/pc/bios.h>
-
-#include <i386/bios/apm.h>
-
SYSCTL_DECL(_debug_acpi);
int acpi_resume_beep;
@@ -73,445 +55,15 @@ int acpi_reset_video;
TUNABLE_INT("hw.acpi.reset_video", &acpi_reset_video);
static int intr_model = ACPI_INTR_PIC;
-static int apm_active;
-static struct clonedevs *apm_clones;
-
-MALLOC_DEFINE(M_APMDEV, "apmdev", "APM device emulation");
-
-static d_open_t apmopen;
-static d_close_t apmclose;
-static d_write_t apmwrite;
-static d_ioctl_t apmioctl;
-static d_poll_t apmpoll;
-static d_kqfilter_t apmkqfilter;
-static void apmreadfiltdetach(struct knote *kn);
-static int apmreadfilt(struct knote *kn, long hint);
-static struct filterops apm_readfiltops = {
- .f_isfd = 1,
- .f_detach = apmreadfiltdetach,
- .f_event = apmreadfilt,
-};
-
-static struct cdevsw apm_cdevsw = {
- .d_version = D_VERSION,
- .d_flags = D_TRACKCLOSE | D_NEEDMINOR,
- .d_open = apmopen,
- .d_close = apmclose,
- .d_write = apmwrite,
- .d_ioctl = apmioctl,
- .d_poll = apmpoll,
- .d_name = "apm",
- .d_kqfilter = apmkqfilter
-};
-
-static int
-acpi_capm_convert_battstate(struct acpi_battinfo *battp)
-{
- int state;
-
- state = APM_UNKNOWN;
-
- if (battp->state & ACPI_BATT_STAT_DISCHARG) {
- if (battp->cap >= 50)
- state = 0; /* high */
- else
- state = 1; /* low */
- }
- if (battp->state & ACPI_BATT_STAT_CRITICAL)
- state = 2; /* critical */
- if (battp->state & ACPI_BATT_STAT_CHARGING)
- state = 3; /* charging */
-
- /* If still unknown, determine it based on the battery capacity. */
- if (state == APM_UNKNOWN) {
- if (battp->cap >= 50)
- state = 0; /* high */
- else
- state = 1; /* low */
- }
-
- return (state);
-}
-
-static int
-acpi_capm_convert_battflags(struct acpi_battinfo *battp)
-{
- int flags;
-
- flags = 0;
-
- if (battp->cap >= 50)
- flags |= APM_BATT_HIGH;
- else {
- if (battp->state & ACPI_BATT_STAT_CRITICAL)
- flags |= APM_BATT_CRITICAL;
- else
- flags |= APM_BATT_LOW;
- }
- if (battp->state & ACPI_BATT_STAT_CHARGING)
- flags |= APM_BATT_CHARGING;
- if (battp->state == ACPI_BATT_STAT_NOT_PRESENT)
- flags = APM_BATT_NOT_PRESENT;
-
- return (flags);
-}
-
-static int
-acpi_capm_get_info(apm_info_t aip)
-{
- int acline;
- struct acpi_battinfo batt;
-
- aip->ai_infoversion = 1;
- aip->ai_major = 1;
- aip->ai_minor = 2;
- aip->ai_status = apm_active;
- aip->ai_capabilities= 0xff00; /* unknown */
-
- if (acpi_acad_get_acline(&acline))
- aip->ai_acline = APM_UNKNOWN; /* unknown */
- else
- aip->ai_acline = acline; /* on/off */
-
- if (acpi_battery_get_battinfo(NULL, &batt) != 0) {
- aip->ai_batt_stat = APM_UNKNOWN;
- aip->ai_batt_life = APM_UNKNOWN;
- aip->ai_batt_time = -1; /* unknown */
- aip->ai_batteries = ~0U; /* unknown */
- } else {
- aip->ai_batt_stat = acpi_capm_convert_battstate(&batt);
- aip->ai_batt_life = batt.cap;
- aip->ai_batt_time = (batt.min == -1) ? -1 : batt.min * 60;
- aip->ai_batteries = acpi_battery_get_units();
- }
-
- return (0);
-}
-
-static int
-acpi_capm_get_pwstatus(apm_pwstatus_t app)
-{
- device_t dev;
- int acline, unit, error;
- struct acpi_battinfo batt;
-
- if (app->ap_device != PMDV_ALLDEV &&
- (app->ap_device < PMDV_BATT0 || app->ap_device > PMDV_BATT_ALL))
- return (1);
-
- if (app->ap_device == PMDV_ALLDEV)
- error = acpi_battery_get_battinfo(NULL, &batt);
- else {
- unit = app->ap_device - PMDV_BATT0;
- dev = devclass_get_device(devclass_find("battery"), unit);
- if (dev != NULL)
- error = acpi_battery_get_battinfo(dev, &batt);
- else
- error = ENXIO;
- }
- if (error)
- return (1);
-
- app->ap_batt_stat = acpi_capm_convert_battstate(&batt);
- app->ap_batt_flag = acpi_capm_convert_battflags(&batt);
- app->ap_batt_life = batt.cap;
- app->ap_batt_time = (batt.min == -1) ? -1 : batt.min * 60;
-
- if (acpi_acad_get_acline(&acline))
- app->ap_acline = APM_UNKNOWN;
- else
- app->ap_acline = acline; /* on/off */
-
- return (0);
-}
-
-/* Create single-use devices for /dev/apm and /dev/apmctl. */
-static void
-apm_clone(void *arg, struct ucred *cred, char *name, int namelen,
- struct cdev **dev)
-{
- int ctl_dev, unit;
-
- if (*dev != NULL)
- return;
- if (strcmp(name, "apmctl") == 0)
- ctl_dev = TRUE;
- else if (strcmp(name, "apm") == 0)
- ctl_dev = FALSE;
- else
- return;
-
- /* Always create a new device and unit number. */
- unit = -1;
- if (clone_create(&apm_clones, &apm_cdevsw, &unit, dev, 0)) {
- if (ctl_dev) {
- *dev = make_dev(&apm_cdevsw, unit,
- UID_ROOT, GID_OPERATOR, 0660, "apmctl%d", unit);
- } else {
- *dev = make_dev(&apm_cdevsw, unit,
- UID_ROOT, GID_OPERATOR, 0664, "apm%d", unit);
- }
- if (*dev != NULL) {
- dev_ref(*dev);
- (*dev)->si_flags |= SI_CHEAPCLONE;
- }
- }
-}
-
-/* Create a struct for tracking per-device suspend notification. */
-static struct apm_clone_data *
-apm_create_clone(struct cdev *dev, struct acpi_softc *acpi_sc)
-{
- struct apm_clone_data *clone;
-
- clone = malloc(sizeof(*clone), M_APMDEV, M_WAITOK);
- clone->cdev = dev;
- clone->acpi_sc = acpi_sc;
- clone->notify_status = APM_EV_NONE;
- bzero(&clone->sel_read, sizeof(clone->sel_read));
- knlist_init_mtx(&clone->sel_read.si_note, &acpi_mutex);
-
- /*
- * The acpi device is always managed by devd(8) and is considered
- * writable (i.e., ack is required to allow suspend to proceed.)
- */
- if (strcmp("acpi", devtoname(dev)) == 0)
- clone->flags = ACPI_EVF_DEVD | ACPI_EVF_WRITE;
- else
- clone->flags = ACPI_EVF_NONE;
-
- ACPI_LOCK(acpi);
- STAILQ_INSERT_TAIL(&acpi_sc->apm_cdevs, clone, entries);
- ACPI_UNLOCK(acpi);
- return (clone);
-}
-
-static int
-apmopen(struct cdev *dev, int flag, int fmt, struct thread *td)
-{
- struct acpi_softc *acpi_sc;
- struct apm_clone_data *clone;
-
- acpi_sc = devclass_get_softc(devclass_find("acpi"), 0);
- clone = apm_create_clone(dev, acpi_sc);
- dev->si_drv1 = clone;
-
- /* If the device is opened for write, record that. */
- if ((flag & FWRITE) != 0)
- clone->flags |= ACPI_EVF_WRITE;
-
- return (0);
-}
-
-static int
-apmclose(struct cdev *dev, int flag, int fmt, struct thread *td)
-{
- struct apm_clone_data *clone;
- struct acpi_softc *acpi_sc;
-
- clone = dev->si_drv1;
- acpi_sc = clone->acpi_sc;
-
- /* We are about to lose a reference so check if suspend should occur */
- if (acpi_sc->acpi_next_sstate != 0 &&
- clone->notify_status != APM_EV_ACKED)
- acpi_AckSleepState(clone, 0);
-
- /* Remove this clone's data from the list and free it. */
- ACPI_LOCK(acpi);
- STAILQ_REMOVE(&acpi_sc->apm_cdevs, clone, apm_clone_data, entries);
- knlist_destroy(&clone->sel_read.si_note);
- ACPI_UNLOCK(acpi);
- free(clone, M_APMDEV);
- destroy_dev_sched(dev);
- return (0);
-}
-
-static int
-apmioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
-{
- int error;
- struct apm_clone_data *clone;
- struct acpi_softc *acpi_sc;
- struct apm_info info;
- struct apm_event_info *ev_info;
- apm_info_old_t aiop;
-
- error = 0;
- clone = dev->si_drv1;
- acpi_sc = clone->acpi_sc;
-
- switch (cmd) {
- case APMIO_SUSPEND:
- if ((flag & FWRITE) == 0)
- return (EPERM);
- if (acpi_sc->acpi_next_sstate == 0) {
- if (acpi_sc->acpi_suspend_sx != ACPI_STATE_S5) {
- error = acpi_ReqSleepState(acpi_sc,
- acpi_sc->acpi_suspend_sx);
- } else {
- printf(
- "power off via apm suspend not supported\n");
- error = ENXIO;
- }
- } else
- error = acpi_AckSleepState(clone, 0);
- break;
- case APMIO_STANDBY:
- if ((flag & FWRITE) == 0)
- return (EPERM);
- if (acpi_sc->acpi_next_sstate == 0) {
- if (acpi_sc->acpi_standby_sx != ACPI_STATE_S5) {
- error = acpi_ReqSleepState(acpi_sc,
- acpi_sc->acpi_standby_sx);
- } else {
- printf(
- "power off via apm standby not supported\n");
- error = ENXIO;
- }
- } else
- error = acpi_AckSleepState(clone, 0);
- break;
- case APMIO_NEXTEVENT:
- printf("apm nextevent start\n");
- ACPI_LOCK(acpi);
- if (acpi_sc->acpi_next_sstate != 0 && clone->notify_status ==
- APM_EV_NONE) {
- ev_info = (struct apm_event_info *)addr;
- if (acpi_sc->acpi_next_sstate <= ACPI_STATE_S3)
- ev_info->type = PMEV_STANDBYREQ;
- else
- ev_info->type = PMEV_SUSPENDREQ;
- ev_info->index = 0;
- clone->notify_status = APM_EV_NOTIFIED;
- printf("apm event returning %d\n", ev_info->type);
- } else
- error = EAGAIN;
- ACPI_UNLOCK(acpi);
- break;
- case APMIO_GETINFO_OLD:
- if (acpi_capm_get_info(&info))
- error = ENXIO;
- aiop = (apm_info_old_t)addr;
- aiop->ai_major = info.ai_major;
- aiop->ai_minor = info.ai_minor;
- aiop->ai_acline = info.ai_acline;
- aiop->ai_batt_stat = info.ai_batt_stat;
- aiop->ai_batt_life = info.ai_batt_life;
- aiop->ai_status = info.ai_status;
- break;
- case APMIO_GETINFO:
- if (acpi_capm_get_info((apm_info_t)addr))
- error = ENXIO;
- break;
- case APMIO_GETPWSTATUS:
- if (acpi_capm_get_pwstatus((apm_pwstatus_t)addr))
- error = ENXIO;
- break;
- case APMIO_ENABLE:
- if ((flag & FWRITE) == 0)
- return (EPERM);
- apm_active = 1;
- break;
- case APMIO_DISABLE:
- if ((flag & FWRITE) == 0)
- return (EPERM);
- apm_active = 0;
- break;
- case APMIO_HALTCPU:
- break;
- case APMIO_NOTHALTCPU:
- break;
- case APMIO_DISPLAY:
- if ((flag & FWRITE) == 0)
- return (EPERM);
- break;
- case APMIO_BIOS:
- if ((flag & FWRITE) == 0)
- return (EPERM);
- bzero(addr, sizeof(struct apm_bios_arg));
- break;
- default:
- error = EINVAL;
- break;
- }
-
- return (error);
-}
-
-static int
-apmwrite(struct cdev *dev, struct uio *uio, int ioflag)
-{
- return (uio->uio_resid);
-}
-
-static int
-apmpoll(struct cdev *dev, int events, struct thread *td)
-{
- struct apm_clone_data *clone;
- int revents;
-
- revents = 0;
- ACPI_LOCK(acpi);
- clone = dev->si_drv1;
- if (clone->acpi_sc->acpi_next_sstate)
- revents |= events & (POLLIN | POLLRDNORM);
- else
- selrecord(td, &clone->sel_read);
- ACPI_UNLOCK(acpi);
- return (revents);
-}
-
-static int
-apmkqfilter(struct cdev *dev, struct knote *kn)
-{
- struct apm_clone_data *clone;
-
- ACPI_LOCK(acpi);
- clone = dev->si_drv1;
- kn->kn_hook = clone;
- kn->kn_fop = &apm_readfiltops;
- knlist_add(&clone->sel_read.si_note, kn, 0);
- ACPI_UNLOCK(acpi);
- return (0);
-}
-
-static void
-apmreadfiltdetach(struct knote *kn)
-{
- struct apm_clone_data *clone;
-
- ACPI_LOCK(acpi);
- clone = kn->kn_hook;
- knlist_remove(&clone->sel_read.si_note, kn, 0);
- ACPI_UNLOCK(acpi);
-}
-
-static int
-apmreadfilt(struct knote *kn, long hint)
-{
- struct apm_clone_data *clone;
- int sleeping;
-
- ACPI_LOCK(acpi);
- clone = kn->kn_hook;
- sleeping = clone->acpi_sc->acpi_next_sstate ? 1 : 0;
- ACPI_UNLOCK(acpi);
- return (sleeping);
-}
int
acpi_machdep_init(device_t dev)
{
- struct acpi_softc *sc;
+ struct acpi_softc *sc;
- sc = devclass_get_softc(devclass_find("acpi"), 0);
+ sc = device_get_softc(dev);
- /* Create a clone for /dev/acpi also. */
- STAILQ_INIT(&sc->apm_cdevs);
- sc->acpi_clone = apm_create_clone(sc->acpi_dev_t, sc);
- clone_setup(&apm_clones);
- EVENTHANDLER_REGISTER(dev_clone, apm_clone, 0, 1000);
+ acpi_apm_init(sc);
if (intr_model != ACPI_INTR_PIC)
acpi_SetIntrModel(intr_model);
@@ -534,12 +86,14 @@ acpi_SetDefaultIntrModel(int model)
int
acpi_machdep_quirks(int *quirks)
{
+
return (0);
}
void
acpi_cpu_c1()
{
+
__asm __volatile("sti; hlt");
}
Modified: user/nwhitehorn/ps3/amd64/amd64/amd64_mem.c
==============================================================================
--- user/nwhitehorn/ps3/amd64/amd64/amd64_mem.c Fri Nov 12 05:12:38 2010 (r215163)
+++ user/nwhitehorn/ps3/amd64/amd64/amd64_mem.c Fri Nov 12 05:13:46 2010 (r215164)
@@ -583,7 +583,7 @@ amd64_mrset(struct mem_range_softc *sc,
i = (sc->mr_cap & MR686_FIXMTRR) ? MTRR_N64K + MTRR_N16K + MTRR_N4K : 0;
mrd = sc->mr_desc + i;
for (; i < sc->mr_ndesc; i++, mrd++) {
- if (mrd->mr_flags & MDF_ACTIVE)
+ if ((mrd->mr_flags & (MDF_ACTIVE | MDF_BOGUS)) == MDF_ACTIVE)
pmap_demote_DMAP(mrd->mr_base, mrd->mr_len, FALSE);
}
@@ -688,7 +688,7 @@ amd64_mrinit(struct mem_range_softc *sc)
i = (sc->mr_cap & MR686_FIXMTRR) ? MTRR_N64K + MTRR_N16K + MTRR_N4K : 0;
mrd = sc->mr_desc + i;
for (; i < sc->mr_ndesc; i++, mrd++) {
- if (mrd->mr_flags & MDF_ACTIVE)
+ if ((mrd->mr_flags & (MDF_ACTIVE | MDF_BOGUS)) == MDF_ACTIVE)
pmap_demote_DMAP(mrd->mr_base, mrd->mr_len, TRUE);
}
}
Modified: user/nwhitehorn/ps3/amd64/amd64/machdep.c
==============================================================================
--- user/nwhitehorn/ps3/amd64/amd64/machdep.c Fri Nov 12 05:12:38 2010 (r215163)
+++ user/nwhitehorn/ps3/amd64/amd64/machdep.c Fri Nov 12 05:13:46 2010 (r215164)
@@ -1762,11 +1762,15 @@ void
spinlock_enter(void)
{
struct thread *td;
+ register_t flags;
td = curthread;
- if (td->td_md.md_spinlock_count == 0)
- td->td_md.md_saved_flags = intr_disable();
- td->td_md.md_spinlock_count++;
+ if (td->td_md.md_spinlock_count == 0) {
+ flags = intr_disable();
+ td->td_md.md_spinlock_count = 1;
+ td->td_md.md_saved_flags = flags;
+ } else
+ td->td_md.md_spinlock_count++;
critical_enter();
}
@@ -1774,12 +1778,14 @@ void
spinlock_exit(void)
{
struct thread *td;
+ register_t flags;
td = curthread;
critical_exit();
+ flags = td->td_md.md_saved_flags;
td->td_md.md_spinlock_count--;
if (td->td_md.md_spinlock_count == 0)
- intr_restore(td->td_md.md_saved_flags);
+ intr_restore(flags);
}
/*
Modified: user/nwhitehorn/ps3/amd64/amd64/minidump_machdep.c
==============================================================================
--- user/nwhitehorn/ps3/amd64/amd64/minidump_machdep.c Fri Nov 12 05:12:38 2010 (r215163)
+++ user/nwhitehorn/ps3/amd64/amd64/minidump_machdep.c Fri Nov 12 05:13:46 2010 (r215164)
@@ -167,63 +167,91 @@ blk_write(struct dumperinfo *di, char *p
}
/* A fake page table page, to avoid having to handle both 4K and 2M pages */
-static pt_entry_t fakept[NPTEPG];
+static pd_entry_t fakepd[NPDEPG];
void
minidumpsys(struct dumperinfo *di)
{
uint64_t dumpsize;
- uint32_t ptesize;
+ uint32_t pmapsize;
vm_offset_t va;
int error;
uint64_t bits;
uint64_t *pdp, *pd, *pt, pa;
- int i, j, k, bit;
+ int i, j, k, n, bit;
+ int retry_count;
struct minidumphdr mdhdr;
+ retry_count = 0;
+ retry:
+ retry_count++;
counter = 0;
/* Walk page table pages, set bits in vm_page_dump */
- ptesize = 0;
+ pmapsize = 0;
pdp = (uint64_t *)PHYS_TO_DMAP(KPDPphys);
for (va = VM_MIN_KERNEL_ADDRESS; va < MAX(KERNBASE + NKPT * NBPDR,
- kernel_vm_end); va += NBPDR) {
- i = (va >> PDPSHIFT) & ((1ul << NPDPEPGSHIFT) - 1);
+ kernel_vm_end); ) {
/*
* We always write a page, even if it is zero. Each
- * page written corresponds to 2MB of space
+ * page written corresponds to 1GB of space
*/
- ptesize += PAGE_SIZE;
- if ((pdp[i] & PG_V) == 0)
+ pmapsize += PAGE_SIZE;
+ i = (va >> PDPSHIFT) & ((1ul << NPDPEPGSHIFT) - 1);
+ if ((pdp[i] & PG_V) == 0) {
+ va += NBPDP;
continue;
- pd = (uint64_t *)PHYS_TO_DMAP(pdp[i] & PG_FRAME);
- j = ((va >> PDRSHIFT) & ((1ul << NPDEPGSHIFT) - 1));
- if ((pd[j] & (PG_PS | PG_V)) == (PG_PS | PG_V)) {
- /* This is an entire 2M page. */
- pa = pd[j] & PG_PS_FRAME;
- for (k = 0; k < NPTEPG; k++) {
+ }
+
+ /*
+ * 1GB page is represented as 512 2MB pages in a dump.
+ */
+ if ((pdp[i] & PG_PS) != 0) {
+ va += NBPDP;
+ pa = pdp[i] & PG_PS_FRAME;
+ for (n = 0; n < NPDEPG * NPTEPG; n++) {
if (is_dumpable(pa))
dump_add_page(pa);
pa += PAGE_SIZE;
}
continue;
}
- if ((pd[j] & PG_V) == PG_V) {
- /* set bit for each valid page in this 2MB block */
- pt = (uint64_t *)PHYS_TO_DMAP(pd[j] & PG_FRAME);
- for (k = 0; k < NPTEPG; k++) {
- if ((pt[k] & PG_V) == PG_V) {
- pa = pt[k] & PG_FRAME;
+
+ pd = (uint64_t *)PHYS_TO_DMAP(pdp[i] & PG_FRAME);
+ for (n = 0; n < NPDEPG; n++, va += NBPDR) {
+ j = (va >> PDRSHIFT) & ((1ul << NPDEPGSHIFT) - 1);
+
+ if ((pd[j] & PG_V) == 0)
+ continue;
+
+ if ((pd[j] & PG_PS) != 0) {
+ /* This is an entire 2M page. */
+ pa = pd[j] & PG_PS_FRAME;
+ for (k = 0; k < NPTEPG; k++) {
if (is_dumpable(pa))
dump_add_page(pa);
+ pa += PAGE_SIZE;
}
+ continue;
+ }
+
+ pa = pd[j] & PG_FRAME;
+ /* set bit for this PTE page */
+ if (is_dumpable(pa))
+ dump_add_page(pa);
+ /* and for each valid page in this 2MB block */
+ pt = (uint64_t *)PHYS_TO_DMAP(pd[j] & PG_FRAME);
+ for (k = 0; k < NPTEPG; k++) {
+ if ((pt[k] & PG_V) == 0)
+ continue;
+ pa = pt[k] & PG_FRAME;
+ if (is_dumpable(pa))
+ dump_add_page(pa);
}
- } else {
- /* nothing, we're going to dump a null page */
}
}
/* Calculate dump size. */
- dumpsize = ptesize;
+ dumpsize = pmapsize;
dumpsize += round_page(msgbufp->msg_size);
dumpsize += round_page(vm_page_dump_size);
for (i = 0; i < vm_page_dump_size / sizeof(*vm_page_dump); i++) {
@@ -244,7 +272,7 @@ minidumpsys(struct dumperinfo *di)
/* Determine dump offset on device. */
if (di->mediasize < SIZEOF_METADATA + dumpsize + sizeof(kdh) * 2) {
- error = ENOSPC;
+ error = E2BIG;
goto fail;
}
dumplo = di->mediaoffset + di->mediasize - dumpsize;
@@ -257,7 +285,7 @@ minidumpsys(struct dumperinfo *di)
mdhdr.version = MINIDUMP_VERSION;
mdhdr.msgbufsize = msgbufp->msg_size;
mdhdr.bitmapsize = vm_page_dump_size;
- mdhdr.ptesize = ptesize;
+ mdhdr.pmapsize = pmapsize;
mdhdr.kernbase = VM_MIN_KERNEL_ADDRESS;
mdhdr.dmapbase = DMAP_MIN_ADDRESS;
mdhdr.dmapend = DMAP_MAX_ADDRESS;
@@ -274,9 +302,9 @@ minidumpsys(struct dumperinfo *di)
dumplo += sizeof(kdh);
/* Dump my header */
- bzero(&fakept, sizeof(fakept));
- bcopy(&mdhdr, &fakept, sizeof(mdhdr));
- error = blk_write(di, (char *)&fakept, 0, PAGE_SIZE);
+ bzero(&fakepd, sizeof(fakepd));
+ bcopy(&mdhdr, &fakepd, sizeof(mdhdr));
+ error = blk_write(di, (char *)&fakepd, 0, PAGE_SIZE);
if (error)
goto fail;
@@ -290,55 +318,49 @@ minidumpsys(struct dumperinfo *di)
if (error)
goto fail;
- /* Dump kernel page table pages */
+ /* Dump kernel page directory pages */
+ bzero(fakepd, sizeof(fakepd));
pdp = (uint64_t *)PHYS_TO_DMAP(KPDPphys);
for (va = VM_MIN_KERNEL_ADDRESS; va < MAX(KERNBASE + NKPT * NBPDR,
- kernel_vm_end); va += NBPDR) {
+ kernel_vm_end); va += NBPDP) {
i = (va >> PDPSHIFT) & ((1ul << NPDPEPGSHIFT) - 1);
+
/* We always write a page, even if it is zero */
if ((pdp[i] & PG_V) == 0) {
- bzero(fakept, sizeof(fakept));
- error = blk_write(di, (char *)&fakept, 0, PAGE_SIZE);
+ error = blk_write(di, (char *)&fakepd, 0, PAGE_SIZE);
if (error)
goto fail;
- /* flush, in case we reuse fakept in the same block */
+ /* flush, in case we reuse fakepd in the same block */
error = blk_flush(di);
if (error)
goto fail;
continue;
}
- pd = (uint64_t *)PHYS_TO_DMAP(pdp[i] & PG_FRAME);
- j = ((va >> PDRSHIFT) & ((1ul << NPDEPGSHIFT) - 1));
- if ((pd[j] & (PG_PS | PG_V)) == (PG_PS | PG_V)) {
- /* This is a single 2M block. Generate a fake PTP */
- pa = pd[j] & PG_PS_FRAME;
- for (k = 0; k < NPTEPG; k++) {
- fakept[k] = (pa + (k * PAGE_SIZE)) | PG_V | PG_RW | PG_A | PG_M;
- }
- error = blk_write(di, (char *)&fakept, 0, PAGE_SIZE);
+
+ /* 1GB page is represented as 512 2MB pages in a dump */
+ if ((pdp[i] & PG_PS) != 0) {
+ /* PDPE and PDP have identical layout in this case */
+ fakepd[0] = pdp[i];
+ for (j = 1; j < NPDEPG; j++)
+ fakepd[j] = fakepd[j - 1] + NBPDR;
+ error = blk_write(di, (char *)&fakepd, 0, PAGE_SIZE);
if (error)
goto fail;
- /* flush, in case we reuse fakept in the same block */
+ /* flush, in case we reuse fakepd in the same block */
error = blk_flush(di);
if (error)
goto fail;
+ bzero(fakepd, sizeof(fakepd));
continue;
}
- if ((pd[j] & PG_V) == PG_V) {
- pt = (uint64_t *)PHYS_TO_DMAP(pd[j] & PG_FRAME);
- error = blk_write(di, (char *)pt, 0, PAGE_SIZE);
- if (error)
- goto fail;
- } else {
- bzero(fakept, sizeof(fakept));
- error = blk_write(di, (char *)&fakept, 0, PAGE_SIZE);
- if (error)
- goto fail;
- /* flush, in case we reuse fakept in the same block */
- error = blk_flush(di);
- if (error)
- goto fail;
- }
+
+ pd = (uint64_t *)PHYS_TO_DMAP(pdp[i] & PG_FRAME);
+ error = blk_write(di, (char *)pd, 0, PAGE_SIZE);
+ if (error)
+ goto fail;
+ error = blk_flush(di);
+ if (error)
+ goto fail;
}
/* Dump memory chunks */
@@ -374,12 +396,21 @@ minidumpsys(struct dumperinfo *di)
if (error < 0)
error = -error;
- if (error == ECANCELED)
- printf("\nDump aborted\n");
- else if (error == ENOSPC)
- printf("\nDump failed. Partition too small.\n");
+ printf("\n");
+ if (error == ENOSPC) {
+ printf("Dump map grown while dumping. ");
+ if (retry_count < 5) {
+ printf("Retrying...\n");
+ goto retry;
+ }
+ printf("Dump failed.\n");
+ }
+ else if (error == ECANCELED)
+ printf("Dump aborted\n");
+ else if (error == E2BIG)
+ printf("Dump failed. Partition too small.\n");
else
- printf("\n** DUMP FAILED (ERROR %d) **\n", error);
+ printf("** DUMP FAILED (ERROR %d) **\n", error);
}
void
Modified: user/nwhitehorn/ps3/amd64/amd64/mp_machdep.c
==============================================================================
--- user/nwhitehorn/ps3/amd64/amd64/mp_machdep.c Fri Nov 12 05:12:38 2010 (r215163)
+++ user/nwhitehorn/ps3/amd64/amd64/mp_machdep.c Fri Nov 12 05:13:46 2010 (r215164)
@@ -239,6 +239,9 @@ topo_probe_0x4(void)
cpu_logical++;
}
+ KASSERT(cpu_cores >= 1 && cpu_logical >= 1,
+ ("topo_probe_0x4 couldn't find BSP"));
+
cpu_cores /= cpu_logical;
hyperthreading_cpus = cpu_logical;
}
@@ -310,7 +313,9 @@ topo_probe(void)
return;
logical_cpus_mask = 0;
- if (cpu_vendor_id == CPU_VENDOR_AMD)
+ if (mp_ncpus <= 1)
+ cpu_cores = cpu_logical = 1;
+ else if (cpu_vendor_id == CPU_VENDOR_AMD)
topo_probe_amd();
else if (cpu_vendor_id == CPU_VENDOR_INTEL) {
/*
@@ -332,10 +337,8 @@ topo_probe(void)
* Fallback: assume each logical CPU is in separate
* physical package. That is, no multi-core, no SMT.
*/
- if (cpu_cores == 0)
- cpu_cores = 1;
- if (cpu_logical == 0)
- cpu_logical = 1;
+ if (cpu_cores == 0 || cpu_logical == 0)
+ cpu_cores = cpu_logical = 1;
cpu_topo_probed = 1;
}
@@ -419,7 +422,7 @@ cpu_add(u_int apic_id, char boot_cpu)
}
if (mp_ncpus < MAXCPU) {
mp_ncpus++;
- mp_maxid = mp_ncpus -1;
+ mp_maxid = mp_ncpus - 1;
}
if (bootverbose)
printf("SMP: Added CPU %d (%s)\n", apic_id, boot_cpu ? "BSP" :
@@ -442,7 +445,7 @@ cpu_mp_setmaxid(void)
else
KASSERT(mp_maxid >= mp_ncpus - 1,
("%s: counters out of sync: max %d, count %d", __func__,
- mp_maxid, mp_ncpus));
+ mp_maxid, mp_ncpus));
}
int
Modified: user/nwhitehorn/ps3/amd64/include/apm_bios.h
==============================================================================
--- user/nwhitehorn/ps3/amd64/include/apm_bios.h Fri Nov 12 05:12:38 2010 (r215163)
+++ user/nwhitehorn/ps3/amd64/include/apm_bios.h Fri Nov 12 05:13:46 2010 (r215164)
@@ -1,264 +1,6 @@
/*-
- * APM (Advanced Power Management) BIOS Device Driver
- *
- * Copyright (c) 1994-1995 by HOSOKAWA, Tatsumi <hosokawa at mt.cs.keio.ac.jp>
- *
- * This software may be used, modified, copied, and distributed, in
- * both source and binary form provided that the above copyright and
- * these terms are retained. Under no circumstances is the author
- * responsible for the proper functioning of this software, nor does
- * the author assume any responsibility for damages incurred with its
- * use.
- *
- * Aug, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD)
- *
- * $FreeBSD$
+ * This file is in the public domain.
*/
+/* $FreeBSD$ */
-#ifndef _MACHINE_APM_BIOS_H_
-#define _MACHINE_APM_BIOS_H_
-
-#ifndef _KERNEL
-#include <sys/types.h>
-#endif
-#include <sys/ioccom.h>
-
-/* BIOS id */
-#define APM_BIOS 0x53
-#define APM_INT 0x15
-
-/* APM flags */
-#define APM_16BIT_SUPPORT 0x01
-#define APM_32BIT_SUPPORT 0x02
-#define APM_CPUIDLE_SLOW 0x04
-#define APM_DISABLED 0x08
-#define APM_DISENGAGED 0x10
-
-/* APM initializer physical address */
-#define APM_OURADDR 0x00080000
-
-/* APM functions */
-#define APM_INSTCHECK 0x00
-#define APM_REALCONNECT 0x01
-#define APM_PROT16CONNECT 0x02
-#define APM_PROT32CONNECT 0x03
-#define APM_DISCONNECT 0x04
-#define APM_CPUIDLE 0x05
-#define APM_CPUBUSY 0x06
-#define APM_SETPWSTATE 0x07
-#define APM_ENABLEDISABLEPM 0x08
-#define APM_RESTOREDEFAULT 0x09
-#define APM_GETPWSTATUS 0x0a
-#define APM_GETPMEVENT 0x0b
-#define APM_GETPWSTATE 0x0c
-#define APM_ENABLEDISABLEDPM 0x0d
-#define APM_DRVVERSION 0x0e
-#define APM_ENGAGEDISENGAGEPM 0x0f
-#define APM_GETCAPABILITIES 0x10
-#define APM_RESUMETIMER 0x11
-#define APM_RESUMEONRING 0x12
-#define APM_TIMERREQUESTS 0x13
-#define APM_OEMFUNC 0x80
-
-/* error code */
-#define APME_OK 0x00
-#define APME_PMDISABLED 0x01
-#define APME_REALESTABLISHED 0x02
-#define APME_NOTCONNECTED 0x03
-#define APME_PROT16ESTABLISHED 0x05
-#define APME_PROT16NOTSUPPORTED 0x06
-#define APME_PROT32ESTABLISHED 0x07
-#define APME_PROT32NOTDUPPORTED 0x08
-#define APME_UNKNOWNDEVICEID 0x09
-#define APME_OUTOFRANGE 0x0a
-#define APME_NOTENGAGED 0x0b
-#define APME_CANTENTERSTATE 0x60
-#define APME_NOPMEVENT 0x80
-#define APME_NOAPMPRESENT 0x86
-
-
-/* device code */
-#define PMDV_APMBIOS 0x0000
-#define PMDV_ALLDEV 0x0001
-#define PMDV_DISP0 0x0100
-#define PMDV_DISP1 0x0101
-#define PMDV_DISPALL 0x01ff
-#define PMDV_2NDSTORAGE0 0x0200
-#define PMDV_2NDSTORAGE1 0x0201
-#define PMDV_2NDSTORAGE2 0x0202
-#define PMDV_2NDSTORAGE3 0x0203
-#define PMDV_PARALLEL0 0x0300
-#define PMDV_PARALLEL1 0x0301
-#define PMDV_SERIAL0 0x0400
-#define PMDV_SERIAL1 0x0401
-#define PMDV_SERIAL2 0x0402
-#define PMDV_SERIAL3 0x0403
-#define PMDV_SERIAL4 0x0404
-#define PMDV_SERIAL5 0x0405
-#define PMDV_SERIAL6 0x0406
-#define PMDV_SERIAL7 0x0407
-#define PMDV_NET0 0x0500
-#define PMDV_NET1 0x0501
-#define PMDV_NET2 0x0502
-#define PMDV_NET3 0x0503
-#define PMDV_PCMCIA0 0x0600
-#define PMDV_PCMCIA1 0x0601
-#define PMDV_PCMCIA2 0x0602
-#define PMDV_PCMCIA3 0x0603
-/* 0x0700 - 0x7fff Reserved */
-#define PMDV_BATT_BASE 0x8000
-#define PMDV_BATT0 0x8001
-#define PMDV_BATT1 0x8002
-#define PMDV_BATT_ALL 0x80ff
-/* 0x8100 - 0xdfff Reserved */
-/* 0xe000 - 0xefff OEM-defined power device IDs */
-/* 0xf000 - 0xffff Reserved */
-
-/* Power state */
-#define PMST_APMENABLED 0x0000
-#define PMST_STANDBY 0x0001
-#define PMST_SUSPEND 0x0002
-#define PMST_OFF 0x0003
-#define PMST_LASTREQNOTIFY 0x0004
-#define PMST_LASTREQREJECT 0x0005
-/* 0x0006 - 0x001f Reserved system states */
-/* 0x0020 - 0x003f OEM-defined system states */
-/* 0x0040 - 0x007f OEM-defined device states */
-/* 0x0080 - 0xffff Reserved device states */
-
-#if !defined(ASSEMBLER) && !defined(INITIALIZER)
-
-/* C definitions */
-struct apmhook {
- struct apmhook *ah_next;
- int (*ah_fun)(void *ah_arg);
- void *ah_arg;
- const char *ah_name;
- int ah_order;
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-user
mailing list