[Zrouter-src-freebsd] ZRouter.org: push to FreeBSD HEAD tree

zrouter-src-freebsd at zrouter.org zrouter-src-freebsd at zrouter.org
Wed Jul 25 14:36:33 UTC 2012


details:   http://zrouter.org/hg/FreeBSD/head//rev/dcbb0dea2fa3
changeset: 512:dcbb0dea2fa3
user:      Aleksandr Rybalko <ray at ddteam.net>
date:      Wed Jul 25 17:22:09 2012 +0300
description:
Lazy update

diffstat:

 head/sys/mips/conf/AP93               |  138 +++++++++++++++++++
 head/sys/mips/conf/AP93.hints         |  196 ++++++++++++++++++++++++++++
 head/sys/mips/conf/AP96               |    9 +-
 head/sys/mips/conf/AP96.hints         |   24 ++-
 head/sys/mips/conf/AR91XX_BASE        |    2 +-
 head/sys/mips/conf/BCM5354            |    1 -
 head/sys/mips/conf/GXEMUL             |   63 +++++++++
 head/sys/mips/conf/GXEMUL.hints       |    1 +
 head/sys/mips/conf/OCTEON1            |    4 +-
 head/sys/mips/conf/RSPRO              |    8 +-
 head/sys/mips/conf/RSPRO.hints        |   27 +++-
 head/sys/mips/conf/TP-WN1043ND        |   14 +-
 head/sys/mips/conf/TP-WN1043ND.hints  |   27 +++-
 head/sys/mips/gxemul/files.gxemul     |    8 +
 head/sys/mips/gxemul/gxemul_machdep.c |  238 ++++++++++++++++++++++++++++++++++
 head/sys/mips/gxemul/mpreg.h          |   55 +++++++
 head/sys/mips/gxemul/std.gxemul       |    4 +
 head/sys/mips/include/_stdint.h       |    8 +-
 head/sys/mips/include/_types.h        |    6 +-
 head/sys/mips/include/elf.h           |    3 +-
 head/sys/mips/include/in_cksum.h      |    6 +-
 head/sys/mips/include/pcb.h           |    4 +-
 head/sys/mips/include/pmap.h          |    3 +-
 head/sys/mips/include/vdso.h          |   41 +++++
 24 files changed, 854 insertions(+), 36 deletions(-)

diffs (1176 lines):

diff -r 9c6b1283f2d3 -r dcbb0dea2fa3 head/sys/mips/conf/AP93
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/sys/mips/conf/AP93	Wed Jul 25 17:22:09 2012 +0300
@@ -0,0 +1,138 @@
+#
+# AP93 -- Kernel configuration file for FreeBSD/mips for Atheros AP93 reference
+#         board (AR7240)
+#
+# $FreeBSD: head/sys/mips/conf/AP93 235320 2012-05-12 04:52:59Z adrian $
+#
+
+ident		AP93
+
+# XXX The default load address in the Uboot environment is 0x80010000
+makeoptions	KERNLOADADDR=0x80050000
+options		HZ=1000
+
+# The AP93 has 64mb of RAM; hard-code that
+options		AR71XX_REALMEM=64*1024*1024
+
+# It's UBOOT, not Redboot - without this, things will hang at startup
+options		AR71XX_ENV_UBOOT
+
+makeoptions	MODULES_OVERRIDE="ath ath_pci ath_ahb bridgestp if_bridge if_gif if_gre random wlan wlan_acl wlan_amrr wlan_ccmp wlan_rssadapt wlan_tkip wlan_wep wlan_xauth usb ar71xx"
+
+hints		"AP93.hints"
+include		"../atheros/std.ar71xx"
+
+makeoptions	DEBUG=-g		#Build kernel with gdb(1) debug symbols
+makeoptions	MODULES_OVERRIDE=""
+
+options		DDB
+options		KDB
+
+options		SCHED_4BSD		#4BSD scheduler
+options		INET			#InterNETworking
+# Can't do IPv6 - it just doesn't fit.
+# options		INET6
+# options		NFSCL			#Network Filesystem Client
+options		PSEUDOFS		#Pseudo-filesystem framework
+options		_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
+options		ALQ
+
+# Debugging for use in -current
+options		DEADLKRES
+options		INVARIANTS
+options		INVARIANT_SUPPORT
+options		WITNESS
+options		WITNESS_SKIPSPIN
+options         FFS                     #Berkeley Fast Filesystem
+
+# Support uncompress lzma rootfs
+device		geom_uncompress
+options		GEOM_UNCOMPRESS
+options		ROOTDEVNAME=\"ufs:/dev/map/rootfs.uncompress\"
+
+# PCI bus
+device		pci
+device		ar724x_pci
+# Enable the AR71xx EEPROM PCI(e) workaround
+options		AR71XX_ATH_EEPROM
+
+# NVRAM U-Boot Environment -> Kernel environment
+device		nvram2env
+
+# Wireless NIC cards
+options		IEEE80211_DEBUG
+options		IEEE80211_SUPPORT_MESH
+options		IEEE80211_SUPPORT_TDMA
+options		IEEE80211_ALQ
+
+device		wlan            # 802.11 support
+device		wlan_wep        # 802.11 WEP support
+device		wlan_ccmp       # 802.11 CCMP support
+device		wlan_tkip       # 802.11 TKIP support
+device		wlan_xauth	# 802.11 hostap support
+
+device		ath		# Atheros pci/cardbus NIC's
+device		ath_pci		# PCI/PCIe bus glue
+options 	ATH_DEBUG
+options		ATH_ENABLE_11N
+options		ATH_DIAGAPI
+device		firmware
+options		ATH_EEPROM_FIRMWARE
+
+device		ath_hal
+options		AH_SUPPORT_AR5416
+options		AH_DEBUG
+options		AH_DEBUG_ALQ
+
+device		ath_rate_sample
+
+device		mii
+device		arge
+device		miiproxy
+options		ARGE_DEBUG
+options		ARGE_MDIO
+device		etherswitch
+device		arswitch
+
+# USB devices - (todo: does AR7240 have OHCI, or just EHCI?)
+
+#device		usb
+options		USB_EHCI_BIG_ENDIAN_DESC        # handle big-endian byte order
+options		USB_DEBUG
+options		USB_HOST_ALIGN=32
+#device		ehci
+
+# Mass storage
+#device		scbus
+#device		umass
+#device		da
+
+# Read MSDOS formatted disks
+options		GEOM_PART_BSD
+options		GEOM_PART_MBR
+#options		MSDOSFS
+
+# GPIO Bus
+#device		gpio
+#device		gpioled
+
+# SPI and flash
+device		spibus
+device		ar71xx_spi
+device		mx25l
+
+# The flash is statically partitioned; add in that
+device		geom_map
+
+device		ar71xx_wdog
+
+# Serial
+device		uart
+
+# Network twiddling
+device		loop
+device		ether
+device		md
+device		bpf
+device		random
+device		if_bridge
diff -r 9c6b1283f2d3 -r dcbb0dea2fa3 head/sys/mips/conf/AP93.hints
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/sys/mips/conf/AP93.hints	Wed Jul 25 17:22:09 2012 +0300
@@ -0,0 +1,196 @@
+# $FreeBSD: head/sys/mips/conf/AP93.hints 235324 2012-05-12 05:27:14Z adrian $
+
+hint.apb.0.at="nexus0"
+hint.apb.0.irq=4
+
+# uart0
+hint.uart.0.at="apb0"
+# see atheros/uart_cpu_ar71xx.c why +3
+hint.uart.0.maddr=0x18020003
+hint.uart.0.msize=0x18
+hint.uart.0.irq=3
+
+# arge0 MDIO bus
+hint.argemdio.0.at="nexus0"
+hint.argemdio.0.maddr=0x19000000
+hint.argemdio.0.msize=0x1000
+hint.argemdio.0.order=0
+
+# arge1 MDIO bus doesn't exist on the AR7240
+
+# arge0: MII; dedicated PHY 4 on switch, connected via internal switch
+# MDIO bus.
+
+hint.arge.0.at="nexus0"
+hint.arge.0.maddr=0x19000000
+hint.arge.0.msize=0x1000
+hint.arge.0.irq=2
+# hint.arge.0.eeprommac=0x83fe9ff0
+hint.arge.0.phymask=0x10	# PHY 4
+# hint.arge.0.miimode=2		# MII
+hint.arge.0.mdio=mdioproxy1	# Hanging off the arswitch MDIO bus
+
+# arge1: connected to the LAN switch MAC, at 1000BaseTX / GMII.
+hint.arge.1.at="nexus0"
+hint.arge.1.maddr=0x1A000000
+hint.arge.1.msize=0x1000
+hint.arge.1.irq=3
+
+hint.arge.1.phymask=0x0
+# hint.arge.1.miimode=1		# GMII
+hint.arge.1.media=1000		# Force to 1000BaseTX/full
+hint.arge.1.fduplex=1
+
+#
+# AR7240 switch config
+#
+hint.arswitch.0.is_7240=1	# We need to be explicitly told this
+hint.arswitch.0.numphys=4	# 4 active switch PHYs (PHY 0 -> 3)
+hint.arswitch.0.phy4cpu=1	# Yes, PHY 4 == dedicated PHY
+hint.arswitch.0.is_rgmii=0	# No, not RGMII
+hint.arswitch.0.is_gmii=0	# No, not GMII
+
+# ath0 hint - pcie slot 0
+hint.pcib.0.bus.0.0.0.ath_fixup_addr=0x1fff1000
+hint.pcib.0.bus.0.0.0.ath_fixup_size=4096
+
+# ehci - note the 0x100 offset for the AR913x/AR724x
+hint.ehci.0.at="nexus0"
+hint.ehci.0.maddr=0x1b000100
+hint.ehci.0.msize=0x00ffff00
+hint.ehci.0.irq=1
+
+# pci
+hint.pcib.0.at="nexus0"
+hint.pcib.0.irq=0
+
+# ath
+hint.ath.0.eeprom_firmware="pcib.0.bus.0.0.0.eeprom_firmware"
+
+# GPIO
+hint.gpio.0.at="apb0"
+hint.gpio.0.maddr=0x18040000
+hint.gpio.0.msize=0x1000
+hint.gpio.0.irq=2
+
+# Signal leds
+hint.gpioled.0.at="gpiobus0"
+hint.gpioled.0.name="sig1"
+hint.gpioled.0.pins=0x0001	# pin 0
+hint.gpioled.1.at="gpiobus0"
+hint.gpioled.1.name="sig2"
+hint.gpioled.1.pins=0x0002	# pin 1
+hint.gpioled.2.at="gpiobus0"
+hint.gpioled.2.name="sig3"
+hint.gpioled.2.pins=0x0800	# pin 11
+hint.gpioled.3.at="gpiobus0"
+hint.gpioled.3.name="sig4"
+hint.gpioled.3.pins=0x0080	# pin 7
+
+# SPI controller/bus
+hint.spi.0.at="nexus0"
+hint.spi.0.maddr=0x1f000000
+hint.spi.0.msize=0x10
+
+# SPI flash
+hint.mx25l.0.at="spibus0"
+hint.mx25l.0.cs=0
+
+# Watchdog
+hint.ar71xx_wdog.0.at="nexus0"
+
+# nvram mapping - XXX ?
+hint.nvram.0.base=0x1f030000
+hint.nvram.0.maxsize=0x2000
+hint.nvram.0.flags=3 # 1 = No check, 2 = Format Generic
+hint.nvram.1.base=0x1f032000
+hint.nvram.1.maxsize=0x4000
+hint.nvram.1.flags=3 # 1 = No check, 2 = Format Generic
+
+# GEOM_MAP
+#
+# From my AP93 environment:
+#
+# 256k - uboot
+# 256k - uboot-env
+# 3072k - spare-rootfs
+# 1024k - spare-uImage
+# 3072k - rootfs
+# 1024k - uImage
+# 64k - mib0
+# 64k - mib1
+# 4096k - ct
+# 3392k - var
+# 64k - ART
+
+# To make it useful for FreeBSD for now, treat spare rootfs, spare
+# uimage and rootfs as 'rootfs'.
+
+hint.map.0.at="flash/spi0"
+hint.map.0.start=0x00000000
+hint.map.0.end=0x00040000
+hint.map.0.name="uboot"
+hint.map.0.readonly=1
+
+hint.map.1.at="flash/spi0"
+hint.map.1.start=0x00040000
+hint.map.1.end=0x00080000
+hint.map.1.name="uboot-env"
+hint.map.1.readonly=1
+
+hint.map.2.at="flash/spi0"
+hint.map.2.start=0x00080000
+# hint.map.2.end=0x00380000
+hint.map.2.end=0x00780000
+# hint.map.2.name="spare-rootfs"
+hint.map.2.name="rootfs"
+hint.map.2.readonly=1
+
+#hint.map.3.at="flash/spi0"
+#hint.map.3.start=0x00380000
+#hint.map.3.end=0x00480000
+#hint.map.3.name="spare-uImage"
+#hint.map.3.readonly=1
+
+#hint.map.4.at="flash/spi0"
+#hint.map.4.start=0x00480000
+#hint.map.4.end=0x00780000
+#hint.map.4.name="rootfs"
+#hint.map.4.readonly=1
+
+hint.map.3.at="flash/spi0"
+hint.map.3.start=0x00780000
+hint.map.3.end=0x00880000
+hint.map.3.name="uImage"
+hint.map.3.readonly=1
+
+hint.map.4.at="flash/spi0"
+hint.map.4.start=0x00880000
+hint.map.4.end=0x00890000
+hint.map.4.name="mib0"
+hint.map.4.readonly=1
+
+hint.map.5.at="flash/spi0"
+hint.map.5.start=0x00890000
+hint.map.5.end=0x008a0000
+hint.map.5.name="mib1"
+hint.map.5.readonly=1
+
+hint.map.6.at="flash/spi0"
+hint.map.6.start=0x008a0000
+hint.map.6.end=0x00ca0000
+hint.map.6.name="ct"
+hint.map.6.readonly=1
+
+hint.map.7.at="flash/spi0"
+hint.map.7.start=0x00ca0000
+hint.map.7.end=0x00ff0000
+hint.map.7.name="var"
+hint.map.7.readonly=1
+
+hint.map.8.at="flash/spi0"
+hint.map.8.start=0x00ff0000
+hint.map.8.end=0x01000000	# 64k ART
+hint.map.8.name="ART"
+hint.map.8.readonly=1
+
diff -r 9c6b1283f2d3 -r dcbb0dea2fa3 head/sys/mips/conf/AP96
--- a/head/sys/mips/conf/AP96	Wed Jul 25 17:21:12 2012 +0300
+++ b/head/sys/mips/conf/AP96	Wed Jul 25 17:22:09 2012 +0300
@@ -11,7 +11,7 @@
 # + 64mb RAM
 # + uboot environment
 
-# $FreeBSD: head/sys/mips/conf/AP96 234235 2012-04-13 20:23:32Z adrian $
+# $FreeBSD: head/sys/mips/conf/AP96 235290 2012-05-11 21:13:43Z adrian $
 
 include		"AR71XX_BASE"
 ident		"AP96"
@@ -40,3 +40,10 @@
 options 	AR71XX_ATH_EEPROM	# Fetch EEPROM/PCI config from flash
 options 	ATH_EEPROM_FIRMWARE	# Use EEPROM from flash
 device		firmware		# Used by the above
+
+# Options required for miiproxy and mdiobus
+options 	ARGE_MDIO		# Export an MDIO bus separate from arge
+device		miiproxy		# MDIO bus <-> MII PHY rendezvous
+
+device		etherswitch
+device		arswitch
diff -r 9c6b1283f2d3 -r dcbb0dea2fa3 head/sys/mips/conf/AP96.hints
--- a/head/sys/mips/conf/AP96.hints	Wed Jul 25 17:21:12 2012 +0300
+++ b/head/sys/mips/conf/AP96.hints	Wed Jul 25 17:22:09 2012 +0300
@@ -1,15 +1,29 @@
-# $FreeBSD: head/sys/mips/conf/AP96.hints 234327 2012-04-15 22:59:56Z adrian $
+# $FreeBSD: head/sys/mips/conf/AP96.hints 235290 2012-05-11 21:13:43Z adrian $
+
+# arge0 MDIO bus - there's no arge1 MDIO bus for AR71xx
+hint.argemdio.0.at="nexus0"
+hint.argemdio.0.maddr=0x19000000
+hint.argemdio.0.msize=0x1000
+hint.argemdio.0.order=0
+# This creates an automatic mdioproxy0!
+
+
+# The switch automatically probes off of mdio0, and will
+# create an mdioproxy1.
 
 # TODO: RGMII
-hint.arge.0.phymask=0x0f
+hint.arge.0.phymask=0x0		# Nothing attached here (XXX?)
 hint.arge.0.media=1000
 hint.arge.0.fduplex=1
+hint.arge.0.miimode=3		# RGMII
 
 # TODO: RGMII
-# TODO: pll_1000 = 0x1f000000
 hint.arge.1.phymask=0x10
-# hint.arge.1.media=1000
-# hint.arge.1.fduplex=1
+# hint.arge.1.pll_1000 = 0x1f000000
+# For now, rendezouvs this on the arge0 mdiobus.
+# Later, this will rendezvous via the AR8316 switch.
+hint.arge.1.miimode=3		# RGMII
+hint.arge.1.mdio=mdioproxy1	# off the switch mdiobus
 
 # ath0 - slot 17
 hint.pcib.0.bus.0.17.0.ath_fixup_addr=0x1fff1000
diff -r 9c6b1283f2d3 -r dcbb0dea2fa3 head/sys/mips/conf/AR91XX_BASE
--- a/head/sys/mips/conf/AR91XX_BASE	Wed Jul 25 17:21:12 2012 +0300
+++ b/head/sys/mips/conf/AR91XX_BASE	Wed Jul 25 17:22:09 2012 +0300
@@ -7,7 +7,7 @@
 # override the default options (adding devices as needed) and adding
 # hints as needed (for example, the GPIO and LAN PHY.)
 #
-# $FreeBSD: head/sys/mips/conf/AR91XX_BASE 233644 2012-03-29 02:54:35Z jmallett $
+# $FreeBSD: head/sys/mips/conf/AR91XX_BASE 235346 2012-05-12 17:42:22Z adrian $
 #
 
 machine         mips mips
diff -r 9c6b1283f2d3 -r dcbb0dea2fa3 head/sys/mips/conf/BCM5354
--- a/head/sys/mips/conf/BCM5354	Wed Jul 25 17:21:12 2012 +0300
+++ b/head/sys/mips/conf/BCM5354	Wed Jul 25 17:22:09 2012 +0300
@@ -5,7 +5,6 @@
 machine		mips mipsel
 ident		BCM5354
 cpu		CPU_MIPS4KC
-options 	ISA_MIPS32
 files		"../bcm47xx/files.bcm47xx"
 hints		"BCM5354.hints"
 
diff -r 9c6b1283f2d3 -r dcbb0dea2fa3 head/sys/mips/conf/GXEMUL
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/sys/mips/conf/GXEMUL	Wed Jul 25 17:22:09 2012 +0300
@@ -0,0 +1,63 @@
+#
+# GXEMUL "oldtestmips" sample kernel configuration.
+#
+# $FreeBSD: head/sys/mips/conf/GXEMUL 235118 2012-05-07 04:36:48Z jmallett $
+#
+
+ident		GXEMUL
+
+machine		mips mips64
+cpu		CPU_MIPS4KC
+
+options 	HZ=100
+
+makeoptions	ARCH_FLAGS="-march=mips64 -mabi=64"
+
+makeoptions 	KERNLOADADDR=0xffffffff80100000
+
+include		"../gxemul/std.gxemul"
+
+hints		"GXEMUL.hints"		#Default places to look for devices.
+
+makeoptions	DEBUG=-g		#Build kernel with gdb(1) debug symbols
+
+makeoptions	MODULES_OVERRIDE=""
+
+options 	DDB
+options 	KDB
+
+# Make an SMP-capable kernel by default
+options 	SMP			# Symmetric MultiProcessor Kernel
+
+options 	SCHED_ULE
+options 	INET			# InterNETworking
+options 	INET6			# IPv6 communications protocols
+
+options 	FFS			#Berkeley Fast Filesystem
+
+# Debugging for use in -current
+#options 	DEADLKRES		#Enable the deadlock resolver
+options 	INVARIANTS		#Enable calls of extra sanity checking
+options 	INVARIANT_SUPPORT	#Extra sanity checks of internal structures, required by INVARIANTS
+#options 	WITNESS			#Enable checks to detect deadlocks and cycles
+#options 	WITNESS_SKIPSPIN	#Don't run witness on spinlocks for speed
+
+options 	ROOTDEVNAME=\"ufs:gxemul_disk0\"
+
+device		gxemul_cons
+device		gxemul_disk
+device		gxemul_ether
+
+# Pseudo devices.
+device		loop		# Network loopback
+device		random		# Entropy device
+device		ether		# Ethernet support
+device		tun		# Packet tunnel.
+device		md		# Memory "disks"
+device		gif		# IPv6 and IPv4 tunneling
+device		faith		# IPv6-to-IPv4 relaying (translation)
+
+# The `bpf' device enables the Berkeley Packet Filter.
+# Be aware of the administrative consequences of enabling this!
+# Note that 'bpf' is required for DHCP.
+device		bpf		# Berkeley packet filter
diff -r 9c6b1283f2d3 -r dcbb0dea2fa3 head/sys/mips/conf/GXEMUL.hints
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/sys/mips/conf/GXEMUL.hints	Wed Jul 25 17:22:09 2012 +0300
@@ -0,0 +1,1 @@
+# $FreeBSD: head/sys/mips/conf/GXEMUL.hints 234920 2012-05-02 08:10:15Z rwatson $
diff -r 9c6b1283f2d3 -r dcbb0dea2fa3 head/sys/mips/conf/OCTEON1
--- a/head/sys/mips/conf/OCTEON1	Wed Jul 25 17:21:12 2012 +0300
+++ b/head/sys/mips/conf/OCTEON1	Wed Jul 25 17:22:09 2012 +0300
@@ -16,7 +16,7 @@
 # If you are in doubt as to the purpose or necessity of a line, check first
 # in NOTES.
 #
-# $FreeBSD: head/sys/mips/conf/OCTEON1 233271 2012-03-21 08:38:42Z ed $
+# $FreeBSD: head/sys/mips/conf/OCTEON1 235898 2012-05-24 11:20:51Z mav $
 
 ident		OCTEON1
 
@@ -155,7 +155,7 @@
 #device		sa		# Sequential Access (tape etc)
 device		cd		# CD
 device		pass		# Passthrough device (direct ATA/SCSI access)
-#device		ses		# SCSI Environmental Services (and SAF-TE)
+device		ses		# Enclosure Services (SES and SAF-TE)
 
 #x## RAID controllers interfaced to the SCSI subsystem
 #x#device		amr		# AMI MegaRAID
diff -r 9c6b1283f2d3 -r dcbb0dea2fa3 head/sys/mips/conf/RSPRO
--- a/head/sys/mips/conf/RSPRO	Wed Jul 25 17:21:12 2012 +0300
+++ b/head/sys/mips/conf/RSPRO	Wed Jul 25 17:22:09 2012 +0300
@@ -1,7 +1,7 @@
 #
 # Routerstation Pro: boot from on-board flash
 #
-# $FreeBSD: head/sys/mips/conf/RSPRO 228944 2011-12-29 05:51:48Z adrian $
+# $FreeBSD: head/sys/mips/conf/RSPRO 235661 2012-05-19 20:11:18Z adrian $
 #
 
 include		"AR71XX_BASE"
@@ -21,6 +21,12 @@
 options		GEOM_PART_MBR
 options		MSDOSFS
 
+# For etherswitch support
+options		ARGE_MDIO
+device		miiproxy
+device		etherswitch
+device		arswitch
+
 # Boot off of flash
 options		ROOTDEVNAME=\"ufs:redboot/rootfs.uzip\"
 
diff -r 9c6b1283f2d3 -r dcbb0dea2fa3 head/sys/mips/conf/RSPRO.hints
--- a/head/sys/mips/conf/RSPRO.hints	Wed Jul 25 17:21:12 2012 +0300
+++ b/head/sys/mips/conf/RSPRO.hints	Wed Jul 25 17:22:09 2012 +0300
@@ -1,10 +1,27 @@
-# $FreeBSD: head/sys/mips/conf/RSPRO.hints 228945 2011-12-29 06:07:24Z adrian $
+# $FreeBSD: head/sys/mips/conf/RSPRO.hints 235661 2012-05-19 20:11:18Z adrian $
 
-hint.arge.0.phymask=0x10
+# arge0 mdio bus
+hint.argemdio.0.at="nexus0"
+hint.argemdio.0.maddr=0x19000000
+hint.argemdio.0.msize=0x1000
+hint.argemdio.0.order=0
 
-hint.arge.1.media=1000
-hint.arge.1.fduplex=1
-hint.arge.1.phymask=0x0e
+# arge0: dedicated switch port
+hint.arge.0.phymask=0x10	# PHY4
+hint.arge.0.miimode=3		# RGMII
+hint.arge.0.mdio=mdioproxy1	# .. off of the switch mdiobus
+
+# arge1: nail to 1000/full, RGMII - connected to the switch
+hint.arge.1.media=1000		# Map to 1000/full
+hint.arge.1.fduplex=1		#
+hint.arge.1.phymask=0x0		# no directly mapped PHYs
+hint.arge.1.miimode=3		# RGMII
+
+hint.arswitch.0.is_7240=0
+hint.arswitch.0.numphys=4
+hint.arswitch.0.phy4cpu=1
+hint.arswitch.0.is_rgmii=1
+hint.arswitch.0.is_gmii=0
 
 # Don't flip on anything that isn't already enabled.
 # This includes leaving the SPI CS1/CS2 pins as GPIO pins as they're
diff -r 9c6b1283f2d3 -r dcbb0dea2fa3 head/sys/mips/conf/TP-WN1043ND
--- a/head/sys/mips/conf/TP-WN1043ND	Wed Jul 25 17:21:12 2012 +0300
+++ b/head/sys/mips/conf/TP-WN1043ND	Wed Jul 25 17:22:09 2012 +0300
@@ -1,7 +1,7 @@
 #
 # TP-1043ND -- Kernel configuration file for the TP-Link WR-1043ND
 #
-# $FreeBSD: head/sys/mips/conf/TP-WN1043ND 227925 2011-11-24 07:33:41Z adrian $
+# $FreeBSD: head/sys/mips/conf/TP-WN1043ND 235351 2012-05-12 19:43:22Z adrian $
 #
 
 # Include the default AR913x parameters common to all AR913x SoC users.
@@ -15,6 +15,18 @@
 # Force the board memory - 32mb
 options         AR71XX_REALMEM=32*1024*1024
 
+# i2c GPIO bus
+device		gpioiic
+device		iicbb
+device		iicbus
+device		iic
+
+# ethernet switch device
+device		etherswitch
+
+# RTL8366RB support
+device		rtl8366rb
+
 # read MSDOS formatted disks - USB
 options		MSDOSFS
 options		GEOM_PART_BSD
diff -r 9c6b1283f2d3 -r dcbb0dea2fa3 head/sys/mips/conf/TP-WN1043ND.hints
--- a/head/sys/mips/conf/TP-WN1043ND.hints	Wed Jul 25 17:21:12 2012 +0300
+++ b/head/sys/mips/conf/TP-WN1043ND.hints	Wed Jul 25 17:22:09 2012 +0300
@@ -1,10 +1,11 @@
 #
 # This file adds to the values in AR91XX_BASE.hints.
 #
-# $FreeBSD: head/sys/mips/conf/TP-WN1043ND.hints 228519 2011-12-15 01:05:38Z adrian $
+# $FreeBSD: head/sys/mips/conf/TP-WN1043ND.hints 235345 2012-05-12 17:41:42Z adrian $
 
 # Hard-code the PHY for now, until there's switch phy support.
-hint.arge.0.phymask=0x000c
+# hint.arge.0.phymask=0x000c
+hint.arge.0.phymask=0x0000
 hint.arge.0.media=1000
 hint.arge.0.fduplex=1
 # Where is the MAC address stored in flash for this particular unit.
@@ -81,7 +82,7 @@
 # Don't flip on anything that isn't already enabled.
 # This includes leaving the SPI CS1/CS2 pins as GPIO pins as they're
 # not used here.
-hint.gpio.0.function_set=0x00000000
+hint.gpio.0.function_set=0x00002000
 hint.gpio.0.function_clear=0x00000000
 
 # These are the GPIO LEDs and buttons which can be software controlled.
@@ -101,9 +102,9 @@
 # Pin 20 - "GPIO20"
 
 # LEDs are configured separately and driven by the LED device
-hint.gpioled.0.at="gpiobus0"
-hint.gpioled.0.name="usb"
-hint.gpioled.0.pins=0x0002
+#hint.gpioled.0.at="gpiobus0"
+#hint.gpioled.0.name="usb"
+#hint.gpioled.0.pins=0x0002
 
 hint.gpioled.1.at="gpiobus0"
 hint.gpioled.1.name="system"
@@ -116,3 +117,17 @@
 hint.gpioled.3.at="gpiobus0"
 hint.gpioled.3.name="wlan"
 hint.gpioled.3.pins=0x0200
+
+# GPIO I2C bus
+hint.gpioiic.0.at="gpiobus0"
+hint.gpioiic.0.pins=0xc0000
+hint.gpioiic.0.scl=1
+hint.gpioiic.0.sda=0
+
+# I2C bus
+# Don't be strict about I2C protocol - the relaxed semantics are required
+# by the realtek switch PHY.
+hint.iicbus.0.strict=0
+
+# Bit bang bus - override default delay
+#hint.iicbb.0.udelay=3
diff -r 9c6b1283f2d3 -r dcbb0dea2fa3 head/sys/mips/gxemul/files.gxemul
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/sys/mips/gxemul/files.gxemul	Wed Jul 25 17:22:09 2012 +0300
@@ -0,0 +1,8 @@
+# $FreeBSD: head/sys/mips/gxemul/files.gxemul 235117 2012-05-07 04:15:46Z jmallett $
+dev/gxemul/cons/gxemul_cons.c		optional gxemul_cons
+mips/gxemul/gxemul_machdep.c		standard
+mips/mips/intr_machdep.c		standard
+mips/mips/tick.c			standard
+
+dev/gxemul/disk/gxemul_disk.c		optional gxemul_disk
+dev/gxemul/ether/if_gx.c		optional gxemul_ether
diff -r 9c6b1283f2d3 -r dcbb0dea2fa3 head/sys/mips/gxemul/gxemul_machdep.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/sys/mips/gxemul/gxemul_machdep.c	Wed Jul 25 17:22:09 2012 +0300
@@ -0,0 +1,238 @@
+/*-
+ * Copyright (c) 2006 Wojciech A. Koszek <wkoszek at FreeBSD.org>
+ * 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.
+ *
+ * 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.
+ */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: head/sys/mips/gxemul/gxemul_machdep.c 235118 2012-05-07 04:36:48Z jmallett $");
+
+#include "opt_ddb.h"
+
+#include <sys/param.h>
+#include <sys/conf.h>
+#include <sys/kernel.h>
+#include <sys/systm.h>
+#include <sys/imgact.h>
+#include <sys/bio.h>
+#include <sys/buf.h>
+#include <sys/bus.h>
+#include <sys/cpu.h>
+#include <sys/cons.h>
+#include <sys/exec.h>
+#include <sys/ucontext.h>
+#include <sys/proc.h>
+#include <sys/kdb.h>
+#include <sys/ptrace.h>
+#include <sys/reboot.h>
+#include <sys/signalvar.h>
+#include <sys/sysent.h>
+#include <sys/sysproto.h>
+#include <sys/user.h>
+
+#include <vm/vm.h>
+#include <vm/vm_object.h>
+#include <vm/vm_page.h>
+#include <vm/vm_pager.h>
+
+#include <machine/clock.h>
+#include <machine/cpu.h>
+#include <machine/cpuregs.h>
+#include <machine/hwfunc.h>
+#include <machine/md_var.h>
+#include <machine/pmap.h>
+#include <machine/trap.h>
+
+#ifdef SMP
+#include <sys/smp.h>
+#include <machine/smp.h>
+#endif
+
+#include <mips/gxemul/mpreg.h>
+
+extern int	*edata;
+extern int	*end;
+
+void
+platform_cpu_init()
+{
+	/* Nothing special */
+}
+
+static void
+mips_init(void)
+{
+	int i;
+
+	for (i = 0; i < 10; i++) {
+		phys_avail[i] = 0;
+	}
+
+	/* phys_avail regions are in bytes */
+	phys_avail[0] = MIPS_KSEG0_TO_PHYS(kernel_kseg0_end);
+	phys_avail[1] = ctob(realmem);
+
+	dump_avail[0] = phys_avail[0];
+	dump_avail[1] = phys_avail[1];
+
+	physmem = realmem;
+
+	init_param1();
+	init_param2(physmem);
+	mips_cpu_init();
+	pmap_bootstrap();
+	mips_proc0_init();
+	mutex_init();
+	kdb_init();
+#ifdef KDB
+	if (boothowto & RB_KDB)
+		kdb_enter(KDB_WHY_BOOTFLAGS, "Boot flags requested debugger");
+#endif
+}
+
+/*
+ * Perform a board-level soft-reset.
+ *
+ * XXXRW: Does gxemul have a moral equivalent to board-level reset?
+ */
+void
+platform_reset(void)
+{
+
+	panic("%s: not yet", __func__);
+}
+
+void
+platform_start(__register_t a0, __register_t a1,  __register_t a2, 
+    __register_t a3)
+{
+	vm_offset_t kernend;
+	uint64_t platform_counter_freq;
+	int argc = a0;
+	char **argv = (char **)a1;
+	char **envp = (char **)a2;
+	int i;
+
+	/* clear the BSS and SBSS segments */
+	kernend = (vm_offset_t)&end;
+	memset(&edata, 0, kernend - (vm_offset_t)(&edata));
+
+	mips_postboot_fixup();
+
+	mips_pcpu0_init();
+
+	/*
+	 * XXXRW: Support for the gxemul real-time clock required in order to
+	 * usefully determine our emulated timer frequency.  Go with something
+	 * classic as the default in the mean time.
+	 */
+	platform_counter_freq = MIPS_DEFAULT_HZ;
+	mips_timer_early_init(platform_counter_freq);
+
+	cninit();
+	printf("entry: platform_start()\n");
+
+	bootverbose = 1;
+	if (bootverbose) {
+		printf("cmd line: ");
+		for (i = 0; i < argc; i++)
+			printf("%s ", argv[i]);
+		printf("\n");
+
+		if (envp != NULL) {
+			printf("envp:\n");
+			for (i = 0; envp[i]; i += 2)
+				printf("\t%s = %s\n", envp[i], envp[i+1]);
+		} else {
+			printf("no envp.\n");
+		}
+	}
+
+	realmem = btoc(GXEMUL_MP_DEV_READ(GXEMUL_MP_DEV_MEMORY));
+	mips_init();
+
+	mips_timer_init_params(platform_counter_freq, 0);
+}
+
+#ifdef SMP
+void
+platform_ipi_send(int cpuid)
+{
+	GXEMUL_MP_DEV_WRITE(GXEMUL_MP_DEV_IPI_ONE, (1 << 16) | cpuid);
+}
+
+void
+platform_ipi_clear(void)
+{
+	GXEMUL_MP_DEV_WRITE(GXEMUL_MP_DEV_IPI_READ, 0);
+}
+
+int
+platform_ipi_intrnum(void)
+{
+	return (GXEMUL_MP_DEV_IPI_INTERRUPT - 2);
+}
+
+struct cpu_group *
+platform_smp_topo(void)
+{
+	return (smp_topo_none());
+}
+
+void
+platform_init_ap(int cpuid)
+{
+	int ipi_int_mask, clock_int_mask;
+
+	/*
+	 * Unmask the clock and ipi interrupts.
+	 */
+	clock_int_mask = hard_int_mask(5);
+	ipi_int_mask = hard_int_mask(platform_ipi_intrnum());
+	set_intr_mask(ipi_int_mask | clock_int_mask);
+}
+
+void
+platform_cpu_mask(cpuset_t *mask)
+{
+	unsigned i, n;
+
+	n = GXEMUL_MP_DEV_READ(GXEMUL_MP_DEV_NCPUS);
+	CPU_ZERO(mask);
+	for (i = 0; i < n; i++)
+		CPU_SET(i, mask);
+}
+
+int
+platform_processor_id(void)
+{
+	return (GXEMUL_MP_DEV_READ(GXEMUL_MP_DEV_WHOAMI));
+}
+
+int
+platform_start_ap(int cpuid)
+{
+	GXEMUL_MP_DEV_WRITE(GXEMUL_MP_DEV_STARTADDR, (intptr_t)mpentry);
+	GXEMUL_MP_DEV_WRITE(GXEMUL_MP_DEV_START, cpuid);
+	return (0);
+}
+#endif	/* SMP */
diff -r 9c6b1283f2d3 -r dcbb0dea2fa3 head/sys/mips/gxemul/mpreg.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/sys/mips/gxemul/mpreg.h	Wed Jul 25 17:22:09 2012 +0300
@@ -0,0 +1,55 @@
+/*-
+ * Copyright (c) 2004-2012 Juli Mallett <jmallett at FreeBSD.org>
+ * 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.
+ *
+ * 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: head/sys/mips/gxemul/mpreg.h 235118 2012-05-07 04:36:48Z jmallett $
+ */
+
+#ifndef	_MIPS_GXEMUL_MPREG_H_
+#define	_MIPS_GXEMUL_MPREG_H_
+
+#define	GXEMUL_MP_DEV_BASE	0x11000000
+
+#define	GXEMUL_MP_DEV_WHOAMI	0x0000
+#define	GXEMUL_MP_DEV_NCPUS	0x0010
+#define	GXEMUL_MP_DEV_START	0x0020
+#define	GXEMUL_MP_DEV_STARTADDR	0x0030
+#define	GXEMUL_MP_DEV_STACK	0x0070
+#define	GXEMUL_MP_DEV_RANDOM	0x0080
+#define	GXEMUL_MP_DEV_MEMORY	0x0090
+#define	GXEMUL_MP_DEV_IPI_ONE	0x00a0
+#define	GXEMUL_MP_DEV_IPI_MANY	0x00b0
+#define	GXEMUL_MP_DEV_IPI_READ	0x00c0
+#define	GXEMUL_MP_DEV_CYCLES	0x00d0
+
+#define	GXEMUL_MP_DEV_FUNCTION(f)					\
+	(volatile uint64_t *)MIPS_PHYS_TO_DIRECT_UNCACHED(GXEMUL_MP_DEV_BASE + (f))
+#define	GXEMUL_MP_DEV_READ(f)						\
+	(volatile uint64_t)*GXEMUL_MP_DEV_FUNCTION(f)
+#define	GXEMUL_MP_DEV_WRITE(f, v)					\
+	*GXEMUL_MP_DEV_FUNCTION(f) = (v)
+
+#define	GXEMUL_MP_DEV_IPI_INTERRUPT	(6)
+
+#endif /* !_MIPS_GXEMUL_MPREG_H */
diff -r 9c6b1283f2d3 -r dcbb0dea2fa3 head/sys/mips/gxemul/std.gxemul
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/sys/mips/gxemul/std.gxemul	Wed Jul 25 17:22:09 2012 +0300
@@ -0,0 +1,4 @@
+# $FreeBSD: head/sys/mips/gxemul/std.gxemul 234920 2012-05-02 08:10:15Z rwatson $
+files	"../gxemul/files.gxemul"
+
+cpu		CPU_MIPS4KC
diff -r 9c6b1283f2d3 -r dcbb0dea2fa3 head/sys/mips/include/_stdint.h
--- a/head/sys/mips/include/_stdint.h	Wed Jul 25 17:21:12 2012 +0300
+++ b/head/sys/mips/include/_stdint.h	Wed Jul 25 17:22:09 2012 +0300
@@ -35,7 +35,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  *
  *	from: src/sys/i386/include/_stdint.h,v 1.2 2004/05/18 16:04:57 stefanf
- * $FreeBSD: head/sys/mips/include/_stdint.h 229496 2012-01-04 16:07:16Z andreast $
+ * $FreeBSD: head/sys/mips/include/_stdint.h 237517 2012-06-24 04:15:58Z andrew $
  */
 
 #ifndef _MACHINE__STDINT_H_
@@ -186,12 +186,6 @@
 #define	SIG_ATOMIC_MIN	INT32_MIN
 #define	SIG_ATOMIC_MAX	INT32_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
diff -r 9c6b1283f2d3 -r dcbb0dea2fa3 head/sys/mips/include/_types.h
--- a/head/sys/mips/include/_types.h	Wed Jul 25 17:21:12 2012 +0300
+++ b/head/sys/mips/include/_types.h	Wed Jul 25 17:22:09 2012 +0300
@@ -34,7 +34,7 @@
  *	From: @(#)ansi.h	8.2 (Berkeley) 1/4/94
  *	From: @(#)types.h	8.3 (Berkeley) 1/5/94
  *	from: src/sys/i386/include/_types.h,v 1.12 2005/07/02 23:13:31 thompsa
- * $FreeBSD: head/sys/mips/include/_types.h 230229 2012-01-16 20:17:51Z das $
+ * $FreeBSD: head/sys/mips/include/_types.h 237517 2012-06-24 04:15:58Z andrew $
  */
 
 #ifndef _MACHINE__TYPES_H_
@@ -145,6 +145,10 @@
 
 typedef	__int64_t	__vm_ooffset_t;
 typedef	__uint64_t	__vm_pindex_t;
+typedef	int		__wchar_t;
+
+#define	__WCHAR_MIN	__INT_MIN	/* min value for a wchar_t */
+#define	__WCHAR_MAX	__INT_MAX	/* max value for a wchar_t */
 
 /*
  * Unusual type definitions.
diff -r 9c6b1283f2d3 -r dcbb0dea2fa3 head/sys/mips/include/elf.h
--- a/head/sys/mips/include/elf.h	Wed Jul 25 17:21:12 2012 +0300
+++ b/head/sys/mips/include/elf.h	Wed Jul 25 17:22:09 2012 +0300
@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  *	JNPR: elf.h,v 1.4 2006/12/02 09:53:40 katta
- * $FreeBSD: head/sys/mips/include/elf.h 232449 2012-03-03 08:19:18Z jmallett $
+ * $FreeBSD: head/sys/mips/include/elf.h 237430 2012-06-22 06:38:31Z kib $
  *
  */
 
@@ -278,6 +278,7 @@
 #define	AT_NCPUS	19	/* Number of CPUs. */
 #define	AT_PAGESIZES	20	/* Pagesizes. */
 #define	AT_PAGESIZESLEN	21	/* Number of pagesizes. */
+#define	AT_TIMEKEEP	22	/* Pointer to timehands. */
 #define	AT_STACKPROT	23	/* Initial stack protection. */
 
 #define	AT_COUNT	24	/* Count of defined aux entry types. */
diff -r 9c6b1283f2d3 -r dcbb0dea2fa3 head/sys/mips/include/in_cksum.h
--- a/head/sys/mips/include/in_cksum.h	Wed Jul 25 17:21:12 2012 +0300
+++ b/head/sys/mips/include/in_cksum.h	Wed Jul 25 17:22:09 2012 +0300
@@ -30,7 +30,7 @@
  *	from:		@(#)in_cksum.c	1.3 (Berkeley) 1/19/91
  *	from: Id: in_cksum.c,v 1.8 1995/12/03 18:35:19 bde Exp
  *	from: src/sys/alpha/include/in_cksum.h,v 1.7 2005/03/02 21:33:20 joerg
- * $FreeBSD$
+ * $FreeBSD: head/sys/mips/include/in_cksum.h 235941 2012-05-24 22:00:48Z bz $
  */
 
 #ifndef _MACHINE_IN_CKSUM_H_
@@ -40,6 +40,7 @@
 
 #define	in_cksum(m, len)	in_cksum_skip(m, len, 0)
 
+#if defined(IPVERSION) && (IPVERSION == 4)
 /*
  * It it useful to have an Internet checksum routine which is inlineable
  * and optimized specifically for the task of computing IP header checksums
@@ -66,9 +67,12 @@
 	} while(0)
 
 #endif
+#endif
 
 #ifdef _KERNEL
+#if defined(IPVERSION) && (IPVERSION == 4)
 u_int in_cksum_hdr(const struct ip *ip);
+#endif
 u_short in_addword(u_short sum, u_short b);
 u_short in_pseudo(u_int sum, u_int b, u_int c);
 u_short in_cksum_skip(struct mbuf *m, int len, int skip);
diff -r 9c6b1283f2d3 -r dcbb0dea2fa3 head/sys/mips/include/pcb.h
--- a/head/sys/mips/include/pcb.h	Wed Jul 25 17:21:12 2012 +0300
+++ b/head/sys/mips/include/pcb.h	Wed Jul 25 17:22:09 2012 +0300
@@ -36,7 +36,7 @@
  *	from: Utah Hdr: pcb.h 1.13 89/04/23
  *	from: @(#)pcb.h 8.1 (Berkeley) 6/10/93
  *	JNPR: pcb.h,v 1.2 2006/08/07 11:51:17 katta
- * $FreeBSD$
+ * $FreeBSD: head/sys/mips/include/pcb.h 234785 2012-04-29 11:04:31Z dim $
  */
 
 #ifndef _MACHINE_PCB_H_
@@ -78,7 +78,7 @@
 extern struct pcb *curpcb;		/* the current running pcb */
 
 void makectx(struct trapframe *, struct pcb *);
-int savectx(struct pcb *);
+int savectx(struct pcb *) __returns_twice;
 #endif
 
 #endif	/* !_MACHINE_PCB_H_ */
diff -r 9c6b1283f2d3 -r dcbb0dea2fa3 head/sys/mips/include/pmap.h
--- a/head/sys/mips/include/pmap.h	Wed Jul 25 17:21:12 2012 +0300
+++ b/head/sys/mips/include/pmap.h	Wed Jul 25 17:22:09 2012 +0300
@@ -40,7 +40,7 @@
  *	from: @(#)pmap.h	7.4 (Berkeley) 5/12/91
  *	from: src/sys/i386/include/pmap.h,v 1.65.2.2 2000/11/30 01:54:42 peter
  *	JNPR: pmap.h,v 1.7.2.1 2007/09/10 07:44:12 girish
- *      $FreeBSD: head/sys/mips/include/pmap.h 233381 2012-03-23 18:07:12Z gonzo $
+ *      $FreeBSD: head/sys/mips/include/pmap.h 237168 2012-06-16 18:56:19Z alc $
  */
 
 #ifndef _MACHINE_PMAP_H_
@@ -151,6 +151,7 @@
 
 #define	pmap_page_get_memattr(m)	VM_MEMATTR_DEFAULT
 #define	pmap_page_is_mapped(m)	(!TAILQ_EMPTY(&(m)->md.pv_list))
+#define	pmap_page_is_write_mapped(m)	(((m)->aflags & PGA_WRITEABLE) != 0)
 #define	pmap_page_set_memattr(m, ma)	(void)0
 
 void pmap_bootstrap(void);
diff -r 9c6b1283f2d3 -r dcbb0dea2fa3 head/sys/mips/include/vdso.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/sys/mips/include/vdso.h	Wed Jul 25 17:22:09 2012 +0300
@@ -0,0 +1,41 @@
+/*-
+ * Copyright 2012 Konstantin Belousov <kib at FreeBSD.ORG>.
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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/mips/include/vdso.h 237433 2012-06-22 07:06:40Z kib $
+ */
+
+#ifndef _MIPS_VDSO_H
+#define	_MIPS_VDSO_H
+
+#define	VDSO_TIMEHANDS_MD			\
+	uint32_t	th_res[8];
+
+#ifdef _KERNEL
+#ifdef COMPAT_FREEBSD32
+
+#define	VDSO_TIMEHANDS_MD32	VDSO_TIMEHANDS_MD
+
+#endif
+#endif
+#endif


More information about the Zrouter-src-freebsd mailing list