PERFORCE change 108184 for review
Matt Jacob
mjacob at FreeBSD.org
Fri Oct 20 12:35:15 PDT 2006
http://perforce.freebsd.org/chv.cgi?CH=108184
Change 108184 by mjacob at newisp on 2006/10/20 19:31:29
IFC
Affected files ...
.. //depot/projects/newisp/amd64/amd64/busdma_machdep.c#2 integrate
.. //depot/projects/newisp/amd64/amd64/db_trace.c#2 integrate
.. //depot/projects/newisp/amd64/amd64/intr_machdep.c#3 integrate
.. //depot/projects/newisp/amd64/amd64/support.S#3 integrate
.. //depot/projects/newisp/amd64/conf/NOTES#3 integrate
.. //depot/projects/newisp/amd64/linux32/linux.h#2 integrate
.. //depot/projects/newisp/amd64/linux32/linux32_machdep.c#4 integrate
.. //depot/projects/newisp/amd64/linux32/linux32_proto.h#3 integrate
.. //depot/projects/newisp/amd64/linux32/linux32_syscall.h#3 integrate
.. //depot/projects/newisp/amd64/linux32/linux32_sysent.c#3 integrate
.. //depot/projects/newisp/amd64/linux32/syscalls.master#3 integrate
.. //depot/projects/newisp/arm/arm/fusu.S#4 integrate
.. //depot/projects/newisp/arm/arm/trap.c#2 integrate
.. //depot/projects/newisp/arm/at91/at91_mci.c#1 branch
.. //depot/projects/newisp/arm/at91/at91_mcireg.h#1 branch
.. //depot/projects/newisp/arm/at91/at91_spi.c#2 integrate
.. //depot/projects/newisp/arm/at91/at91_ssc.c#2 integrate
.. //depot/projects/newisp/arm/at91/at91_sscreg.h#2 integrate
.. //depot/projects/newisp/arm/at91/at91_twi.c#3 integrate
.. //depot/projects/newisp/arm/at91/if_ate.c#2 integrate
.. //depot/projects/newisp/arm/at91/kb920x_machdep.c#3 integrate
.. //depot/projects/newisp/boot/arm/at91/boot2/Makefile#1 branch
.. //depot/projects/newisp/boot/arm/at91/boot2/boot2.c#1 branch
.. //depot/projects/newisp/boot/arm/at91/boot2/kb920x_board.c#1 branch
.. //depot/projects/newisp/boot/arm/at91/libat91/Makefile#2 integrate
.. //depot/projects/newisp/boot/arm/at91/libat91/at91rm9200.h#2 integrate
.. //depot/projects/newisp/boot/arm/at91/libat91/at91rm9200_lowlevel.c#2 integrate
.. //depot/projects/newisp/boot/arm/at91/libat91/emac.c#2 integrate
.. //depot/projects/newisp/boot/arm/at91/libat91/emac.h#2 integrate
.. //depot/projects/newisp/boot/arm/at91/libat91/emac_init.c#2 integrate
.. //depot/projects/newisp/boot/arm/at91/libat91/lib.h#2 integrate
.. //depot/projects/newisp/boot/arm/at91/libat91/lib_AT91RM9200.h#2 integrate
.. //depot/projects/newisp/boot/arm/at91/libat91/mci_device.c#2 integrate
.. //depot/projects/newisp/boot/arm/at91/libat91/mci_device.h#2 integrate
.. //depot/projects/newisp/boot/arm/at91/libat91/memcmp.c#1 branch
.. //depot/projects/newisp/boot/arm/at91/libat91/memcpy.c#1 branch
.. //depot/projects/newisp/boot/arm/at91/libat91/memset.c#1 branch
.. //depot/projects/newisp/boot/arm/at91/libat91/p_string.c#2 integrate
.. //depot/projects/newisp/boot/arm/at91/libat91/printf.c#2 integrate
.. //depot/projects/newisp/boot/arm/at91/libat91/putchar.c#2 integrate
.. //depot/projects/newisp/boot/arm/at91/libat91/sd-card.c#2 integrate
.. //depot/projects/newisp/boot/arm/at91/libat91/spi_flash.c#2 integrate
.. //depot/projects/newisp/boot/arm/at91/libat91/strcmp.c#1 branch
.. //depot/projects/newisp/boot/arm/at91/libat91/strcpy.c#1 branch
.. //depot/projects/newisp/boot/arm/at91/libat91/strcvt.c#1 branch
.. //depot/projects/newisp/boot/arm/at91/libat91/strlen.c#1 branch
.. //depot/projects/newisp/boot/common/help.common#2 integrate
.. //depot/projects/newisp/boot/common/loader.8#2 integrate
.. //depot/projects/newisp/boot/forth/support.4th#2 integrate
.. //depot/projects/newisp/compat/freebsd32/freebsd32_proto.h#9 integrate
.. //depot/projects/newisp/compat/freebsd32/freebsd32_syscall.h#9 integrate
.. //depot/projects/newisp/compat/freebsd32/freebsd32_syscalls.c#9 integrate
.. //depot/projects/newisp/compat/freebsd32/freebsd32_sysent.c#9 integrate
.. //depot/projects/newisp/compat/freebsd32/syscalls.master#9 integrate
.. //depot/projects/newisp/compat/linux/linux_aio.c#1 branch
.. //depot/projects/newisp/compat/linux/linux_aio.h#1 branch
.. //depot/projects/newisp/compat/linux/linux_signal.c#2 integrate
.. //depot/projects/newisp/compat/linux/linux_signal.h#2 integrate
.. //depot/projects/newisp/conf/NOTES#8 integrate
.. //depot/projects/newisp/conf/files#7 integrate
.. //depot/projects/newisp/conf/files.amd64#4 integrate
.. //depot/projects/newisp/conf/files.i386#3 integrate
.. //depot/projects/newisp/conf/files.pc98#2 integrate
.. //depot/projects/newisp/conf/kern.post.mk#2 integrate
.. //depot/projects/newisp/conf/kern.pre.mk#3 integrate
.. //depot/projects/newisp/conf/kmod.mk#2 integrate
.. //depot/projects/newisp/dev/awi/if_awi_pccard.c#2 integrate
.. //depot/projects/newisp/dev/bce/if_bce.c#5 integrate
.. //depot/projects/newisp/dev/bce/if_bcereg.h#2 integrate
.. //depot/projects/newisp/dev/mfi/mfi.c#7 integrate
.. //depot/projects/newisp/dev/mfi/mfi_debug.c#3 integrate
.. //depot/projects/newisp/dev/mfi/mfi_disk.c#2 integrate
.. //depot/projects/newisp/dev/mfi/mfireg.h#3 integrate
.. //depot/projects/newisp/dev/mfi/mfivar.h#4 integrate
.. //depot/projects/newisp/dev/mmc/bridge.h#1 branch
.. //depot/projects/newisp/dev/mmc/mmc.c#1 branch
.. //depot/projects/newisp/dev/mmc/mmcbr_if.m#1 branch
.. //depot/projects/newisp/dev/mmc/mmcbrvar.h#1 branch
.. //depot/projects/newisp/dev/mmc/mmcbus_if.m#1 branch
.. //depot/projects/newisp/dev/mmc/mmcreg.h#1 branch
.. //depot/projects/newisp/dev/mmc/mmcsd.c#1 branch
.. //depot/projects/newisp/dev/mmc/mmcvar.h#1 branch
.. //depot/projects/newisp/dev/mxge/if_mxge.c#3 integrate
.. //depot/projects/newisp/dev/nfe/if_nfe.c#4 integrate
.. //depot/projects/newisp/dev/nfe/if_nfereg.h#3 integrate
.. //depot/projects/newisp/dev/ray/if_ray.c#2 integrate
.. //depot/projects/newisp/dev/sound/midi/sequencer.c#3 integrate
.. //depot/projects/newisp/dev/sound/pci/hda/hdac.c#3 integrate
.. //depot/projects/newisp/dev/spibus/spibus.c#2 integrate
.. //depot/projects/newisp/dev/usb/ehci.c#4 integrate
.. //depot/projects/newisp/dev/usb/if_axe.c#3 integrate
.. //depot/projects/newisp/dev/usb/if_udav.c#3 integrate
.. //depot/projects/newisp/dev/usb/if_ural.c#4 integrate
.. //depot/projects/newisp/dev/usb/ohci.c#4 integrate
.. //depot/projects/newisp/dev/usb/uhci.c#3 integrate
.. //depot/projects/newisp/dev/usb/usb.c#3 integrate
.. //depot/projects/newisp/dev/usb/usbdi.h#3 integrate
.. //depot/projects/newisp/fs/devfs/devfs.h#3 integrate
.. //depot/projects/newisp/fs/devfs/devfs_devs.c#3 integrate
.. //depot/projects/newisp/fs/devfs/devfs_int.h#2 integrate
.. //depot/projects/newisp/fs/devfs/devfs_vnops.c#3 integrate
.. //depot/projects/newisp/i386/acpica/Makefile#3 integrate
.. //depot/projects/newisp/i386/conf/NOTES#4 integrate
.. //depot/projects/newisp/i386/i386/db_trace.c#2 integrate
.. //depot/projects/newisp/i386/i386/support.s#3 integrate
.. //depot/projects/newisp/i386/linux/linux.h#2 integrate
.. //depot/projects/newisp/i386/linux/linux_machdep.c#4 integrate
.. //depot/projects/newisp/i386/linux/linux_proto.h#4 integrate
.. //depot/projects/newisp/i386/linux/linux_syscall.h#4 integrate
.. //depot/projects/newisp/i386/linux/linux_sysent.c#4 integrate
.. //depot/projects/newisp/i386/linux/syscalls.master#4 integrate
.. //depot/projects/newisp/ia64/conf/NOTES#2 integrate
.. //depot/projects/newisp/ia64/ia64/busdma_machdep.c#2 integrate
.. //depot/projects/newisp/ia64/ia64/clock.c#3 integrate
.. //depot/projects/newisp/ia64/ia64/support.S#3 integrate
.. //depot/projects/newisp/kern/init_sysent.c#7 integrate
.. //depot/projects/newisp/kern/kern_conf.c#2 integrate
.. //depot/projects/newisp/kern/kern_intr.c#2 integrate
.. //depot/projects/newisp/kern/kern_sig.c#3 integrate
.. //depot/projects/newisp/kern/kern_umtx.c#8 integrate
.. //depot/projects/newisp/kern/subr_trap.c#2 integrate
.. //depot/projects/newisp/kern/sys_generic.c#3 integrate
.. //depot/projects/newisp/kern/sys_process.c#2 integrate
.. //depot/projects/newisp/kern/syscalls.c#7 integrate
.. //depot/projects/newisp/kern/syscalls.master#7 integrate
.. //depot/projects/newisp/kern/systrace_args.c#7 integrate
.. //depot/projects/newisp/kern/vfs_aio.c#4 integrate
.. //depot/projects/newisp/modules/aio/Makefile#2 integrate
.. //depot/projects/newisp/modules/linux/Makefile#2 integrate
.. //depot/projects/newisp/modules/mem/Makefile#2 integrate
.. //depot/projects/newisp/modules/mmc/Makefile#1 branch
.. //depot/projects/newisp/modules/mmcsd/Makefile#1 branch
.. //depot/projects/newisp/modules/uart/Makefile#2 integrate
.. //depot/projects/newisp/netgraph/netgraph.h#2 integrate
.. //depot/projects/newisp/netgraph/ng_message.h#2 integrate
.. //depot/projects/newisp/netgraph/ng_nat.c#2 integrate
.. //depot/projects/newisp/netgraph/ng_socket.c#2 integrate
.. //depot/projects/newisp/netgraph/ng_socket.h#2 integrate
.. //depot/projects/newisp/netinet6/in6_ifattach.c#3 integrate
.. //depot/projects/newisp/netinet6/in6_proto.c#2 integrate
.. //depot/projects/newisp/nfsclient/nfs.h#2 integrate
.. //depot/projects/newisp/nfsclient/nfs_vnops.c#4 integrate
.. //depot/projects/newisp/pc98/conf/NOTES#2 integrate
.. //depot/projects/newisp/pci/agp.c#2 integrate
.. //depot/projects/newisp/pci/nfsmb.c#3 integrate
.. //depot/projects/newisp/powerpc/powerpc/copyinout.c#3 integrate
.. //depot/projects/newisp/sparc64/conf/NOTES#2 integrate
.. //depot/projects/newisp/sparc64/sparc64/support.S#3 integrate
.. //depot/projects/newisp/sun4v/conf/NOTES#2 integrate
.. //depot/projects/newisp/sun4v/sun4v/genassym.c#2 delete
.. //depot/projects/newisp/sun4v/sun4v/hvcons.c#2 integrate
.. //depot/projects/newisp/sun4v/sun4v/support.S#2 integrate
.. //depot/projects/newisp/sun4v/sun4v/trap.c#2 integrate
.. //depot/projects/newisp/sys/conf.h#2 integrate
.. //depot/projects/newisp/sys/elf32.h#3 integrate
.. //depot/projects/newisp/sys/elf64.h#3 integrate
.. //depot/projects/newisp/sys/rwlock.h#2 integrate
.. //depot/projects/newisp/sys/sem.h#2 integrate
.. //depot/projects/newisp/sys/syscall.h#7 integrate
.. //depot/projects/newisp/sys/syscall.mk#7 integrate
.. //depot/projects/newisp/sys/sysproto.h#7 integrate
.. //depot/projects/newisp/sys/systm.h#4 integrate
.. //depot/projects/newisp/sys/umtx.h#4 integrate
.. //depot/projects/newisp/vm/vnode_pager.c#3 integrate
Differences ...
==== //depot/projects/newisp/amd64/amd64/busdma_machdep.c#2 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/busdma_machdep.c,v 1.77 2006/06/01 04:49:29 silby Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/busdma_machdep.c,v 1.78 2006/10/15 16:52:59 hrs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -520,7 +520,7 @@
__func__, dmat, dmat->flags, ENOMEM);
return (ENOMEM);
} else if ((uintptr_t)*vaddr & (dmat->alignment - 1)) {
- printf("bus_dmamem_alloc failed to align memory properly.");
+ printf("bus_dmamem_alloc failed to align memory properly.\n");
}
CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d",
__func__, dmat, dmat->flags, ENOMEM);
==== //depot/projects/newisp/amd64/amd64/db_trace.c#2 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/db_trace.c,v 1.75 2006/07/12 21:22:42 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/db_trace.c,v 1.76 2006/10/20 09:44:20 bde Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -91,6 +91,7 @@
{ "r15", DB_OFFSET(tf_r15), db_frame },
{ "rip", DB_OFFSET(tf_rip), db_frame },
{ "rflags", DB_OFFSET(tf_rflags), db_frame },
+#define DB_N_SHOW_REGS 20 /* Don't show registers after here. */
{ "dr0", NULL, db_dr0 },
{ "dr1", NULL, db_dr1 },
{ "dr2", NULL, db_dr2 },
@@ -100,7 +101,7 @@
{ "dr6", NULL, db_dr6 },
{ "dr7", NULL, db_dr7 },
};
-struct db_variable *db_eregs = db_regs + sizeof(db_regs)/sizeof(db_regs[0]);
+struct db_variable *db_eregs = db_regs + DB_N_SHOW_REGS;
#define DB_DRX_FUNC(reg) \
static int \
==== //depot/projects/newisp/amd64/amd64/intr_machdep.c#3 (text+ko) ====
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/amd64/amd64/intr_machdep.c,v 1.23 2006/10/13 04:53:22 jb Exp $
+ * $FreeBSD: src/sys/amd64/amd64/intr_machdep.c,v 1.25 2006/10/16 21:40:46 jhb Exp $
*/
/*
@@ -52,15 +52,16 @@
#include <sys/systm.h>
#include <machine/clock.h>
#include <machine/intr_machdep.h>
-#include <machine/segments.h>
-#include <amd64/isa/isa.h>
#ifdef DDB
#include <ddb/ddb.h>
#endif
#ifndef DEV_ATPIC
+#include <machine/segments.h>
+#include <machine/frame.h>
#include <dev/ic/i8259.h>
#include <amd64/isa/icu.h>
+#include <amd64/isa/isa.h>
#endif
#define MAX_STRAY_LOG 5
==== //depot/projects/newisp/amd64/amd64/support.S#3 (text+ko) ====
@@ -27,7 +27,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/amd64/amd64/support.S,v 1.120 2006/08/28 02:28:14 davidxu Exp $
+ * $FreeBSD: src/sys/amd64/amd64/support.S,v 1.121 2006/10/17 02:24:45 davidxu Exp $
*/
#include "opt_ddb.h"
@@ -342,10 +342,10 @@
ret
/*
- * casuptr. Compare and set user pointer. Returns -1 or the current value.
+ * casuword. Compare and set user word. Returns -1 or the current value.
* dst = %rdi, old = %rsi, new = %rdx
*/
-ENTRY(casuptr)
+ENTRY(casuword)
movq PCPU(CURPCB),%rcx
movq $fusufault,PCB_ONFAULT(%rcx)
==== //depot/projects/newisp/amd64/conf/NOTES#3 (text+ko) ====
@@ -4,7 +4,7 @@
# This file contains machine dependent kernel configuration notes. For
# machine independent notes, look in /sys/conf/NOTES.
#
-# $FreeBSD: src/sys/amd64/conf/NOTES,v 1.59 2006/09/22 22:11:28 jhb Exp $
+# $FreeBSD: src/sys/amd64/conf/NOTES,v 1.62 2006/10/20 09:52:26 des Exp $
#
#
@@ -103,7 +103,7 @@
#
# sio: serial ports (see sio(4)), including support for various
-# PC Card devices, such as Modem and NICs (see etc/defaults/pccard.conf)
+# PC Card devices, such as Modem and NICs
#
device sio
hint.sio.0.at="isa"
@@ -202,6 +202,63 @@
# Optional devices:
#
+# PS/2 mouse
+device psm
+hint.psm.0.at="atkbdc"
+hint.psm.0.irq="12"
+
+# Options for psm:
+options PSM_HOOKRESUME #hook the system resume event, useful
+ #for some laptops
+options PSM_RESETAFTERSUSPEND #reset the device at the resume event
+
+# The keyboard controller; it controls the keyboard and the PS/2 mouse.
+device atkbdc
+hint.atkbdc.0.at="isa"
+hint.atkbdc.0.port="0x060"
+
+# The AT keyboard
+device atkbd
+hint.atkbd.0.at="atkbdc"
+hint.atkbd.0.irq="1"
+
+# Options for atkbd:
+options ATKBD_DFLT_KEYMAP # specify the built-in keymap
+makeoptions ATKBD_DFLT_KEYMAP=jp.106
+
+# `flags' for atkbd:
+# 0x01 Force detection of keyboard, else we always assume a keyboard
+# 0x02 Don't reset keyboard, useful for some newer ThinkPads
+# 0x03 Force detection and avoid reset, might help with certain
+# dockingstations
+# 0x04 Old-style (XT) keyboard support, useful for older ThinkPads
+
+# Video card driver for VGA adapters.
+device vga
+hint.vga.0.at="isa"
+
+# Options for vga:
+# Try the following option if the mouse pointer is not drawn correctly
+# or font does not seem to be loaded properly. May cause flicker on
+# some systems.
+options VGA_ALT_SEQACCESS
+
+# If you can dispense with some vga driver features, you may want to
+# use the following options to save some memory.
+#options VGA_NO_FONT_LOADING # don't save/load font
+#options VGA_NO_MODE_CHANGE # don't change video modes
+
+# Older video cards may require this option for proper operation.
+options VGA_SLOW_IOACCESS # do byte-wide i/o's to TS and GDC regs
+
+# The following option probably won't work with the LCD displays.
+options VGA_WIDTH90 # support 90 column modes
+
+# Debugging.
+options VGA_DEBUG
+
+device splash # Splash screen and screen saver support
+
# 3Dfx Voodoo Graphics, Voodoo II /dev/3dfx CDEV support. This will create
# the /dev/3dfx0 device to work with glide implementations. This should get
# linked to /dev/3dfx and /dev/voodoo. Note that this is not the same as
@@ -257,7 +314,7 @@
# ath: Atheros a/b/g WiFi adapters (requires ath_hal and wlan)
# ed: Western Digital and SMC 80xx; Novell NE1000 and NE2000; 3Com 3C503
-# HP PC Lan+, various PC Card devices (refer to etc/defaults/pccard.conf)
+# HP PC Lan+, various PC Card devices
# (requires miibus)
# ipw: Intel PRO/Wireless 2100 IEEE 802.11 adapter
# iwi: Intel PRO/Wireless 2200BG/2225BG/2915ABG IEEE 802.11 adapters
@@ -609,7 +666,3 @@
# Enable NDIS binary driver support
options NDISAPI
device ndis
-
-
-# The I/O device
-device io
==== //depot/projects/newisp/amd64/linux32/linux.h#2 (text+ko) ====
@@ -27,7 +27,7 @@
* (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: src/sys/amd64/linux32/linux.h,v 1.5 2006/08/19 15:13:01 netchild Exp $
+ * $FreeBSD: src/sys/amd64/linux32/linux.h,v 1.7 2006/10/15 14:22:12 netchild Exp $
*/
#ifndef _AMD64_LINUX_LINUX_H_
@@ -830,6 +830,7 @@
#define CLONE_FILES 0x400
#define CLONE_SIGHAND 0x800
#define CLONE_PID 0x1000 /* this flag does not exist in linux anymore */
+#define CLONE_VFORK 0x4000
#define CLONE_PARENT 0x00008000
#define CLONE_THREAD 0x10000
#define CLONE_SETTLS 0x80000
@@ -839,4 +840,6 @@
#define THREADING_FLAGS (CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND)
+#include <compat/linux/linux_aio.h>
+
#endif /* !_AMD64_LINUX_LINUX_H_ */
==== //depot/projects/newisp/amd64/linux32/linux32_machdep.c#4 (text+ko) ====
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.18 2006/10/02 12:59:55 phk Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.22 2006/10/15 13:39:39 netchild Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -530,7 +530,13 @@
ff |= RFMEM;
if (args->flags & CLONE_SIGHAND)
ff |= RFSIGSHARE;
- if (!(args->flags & CLONE_FILES))
+ /*
+ * XXX: in linux sharing of fs info (chroot/cwd/umask)
+ * and open files is independant. in fbsd its in one
+ * structure but in reality it doesnt make any problems
+ * because both this flags are set at once usually.
+ */
+ if (!(args->flags & (CLONE_FILES | CLONE_FS)))
ff |= RFFDG;
/*
@@ -634,6 +640,16 @@
td->td_retval[0] = p2->p_pid;
td->td_retval[1] = 0;
+
+ if (args->flags & CLONE_VFORK) {
+ /* wait for the children to exit, ie. emulate vfork */
+ PROC_LOCK(p2);
+ p2->p_flag |= P_PPWAIT;
+ while (p2->p_flag & P_PPWAIT)
+ msleep(td->td_proc, &p2->p_mtx, PWAIT, "ppwait", 0);
+ PROC_UNLOCK(p2);
+ }
+
return (0);
}
==== //depot/projects/newisp/amd64/linux32/linux32_proto.h#3 (text+ko) ====
@@ -2,8 +2,8 @@
* System call prototypes.
*
* DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/amd64/linux32/linux32_proto.h,v 1.22 2006/08/27 08:58:00 netchild Exp $
- * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.20 2006/08/27 08:56:53 netchild Exp
+ * $FreeBSD: src/sys/amd64/linux32/linux32_proto.h,v 1.23 2006/10/15 14:24:09 netchild Exp $
+ * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.21 2006/10/15 14:22:12 netchild Exp
*/
#ifndef _LINUX_SYSPROTO_H_
@@ -724,6 +724,30 @@
char uaddr2_l_[PADL_(void *)]; void * uaddr2; char uaddr2_r_[PADR_(void *)];
char val3_l_[PADL_(int)]; int val3; char val3_r_[PADR_(int)];
};
+struct linux_io_setup_args {
+ char nr_reqs_l_[PADL_(l_uint)]; l_uint nr_reqs; char nr_reqs_r_[PADR_(l_uint)];
+ char ctxp_l_[PADL_(linux_aio_context_t *)]; linux_aio_context_t * ctxp; char ctxp_r_[PADR_(linux_aio_context_t *)];
+};
+struct linux_io_destroy_args {
+ char ctx_l_[PADL_(linux_aio_context_t)]; linux_aio_context_t ctx; char ctx_r_[PADR_(linux_aio_context_t)];
+};
+struct linux_io_getevents_args {
+ char ctx_id_l_[PADL_(linux_aio_context_t)]; linux_aio_context_t ctx_id; char ctx_id_r_[PADR_(linux_aio_context_t)];
+ char min_nr_l_[PADL_(l_long)]; l_long min_nr; char min_nr_r_[PADR_(l_long)];
+ char nr_l_[PADL_(l_long)]; l_long nr; char nr_r_[PADR_(l_long)];
+ char events_l_[PADL_(struct linux_io_event *)]; struct linux_io_event * events; char events_r_[PADR_(struct linux_io_event *)];
+ char timeout_l_[PADL_(struct l_timespec *)]; struct l_timespec * timeout; char timeout_r_[PADR_(struct l_timespec *)];
+};
+struct linux_io_submit_args {
+ char ctx_id_l_[PADL_(linux_aio_context_t)]; linux_aio_context_t ctx_id; char ctx_id_r_[PADR_(linux_aio_context_t)];
+ char nr_l_[PADL_(l_long)]; l_long nr; char nr_r_[PADR_(l_long)];
+ char iocbpp_l_[PADL_(struct linux_iocb **)]; struct linux_iocb ** iocbpp; char iocbpp_r_[PADR_(struct linux_iocb **)];
+};
+struct linux_io_cancel_args {
+ char ctx_id_l_[PADL_(linux_aio_context_t)]; linux_aio_context_t ctx_id; char ctx_id_r_[PADR_(linux_aio_context_t)];
+ char iocb_l_[PADL_(struct linux_iocb *)]; struct linux_iocb * iocb; char iocb_r_[PADR_(struct linux_iocb *)];
+ char result_l_[PADL_(struct linux_io_event *)]; struct linux_io_event * result; char result_r_[PADR_(struct linux_io_event *)];
+};
struct linux_fadvise64_args {
register_t dummy;
};
@@ -1081,6 +1105,11 @@
int linux_fremovexattr(struct thread *, struct linux_fremovexattr_args *);
int linux_tkill(struct thread *, struct linux_tkill_args *);
int linux_sys_futex(struct thread *, struct linux_sys_futex_args *);
+int linux_io_setup(struct thread *, struct linux_io_setup_args *);
+int linux_io_destroy(struct thread *, struct linux_io_destroy_args *);
+int linux_io_getevents(struct thread *, struct linux_io_getevents_args *);
+int linux_io_submit(struct thread *, struct linux_io_submit_args *);
+int linux_io_cancel(struct thread *, struct linux_io_cancel_args *);
int linux_fadvise64(struct thread *, struct linux_fadvise64_args *);
int linux_exit_group(struct thread *, struct linux_exit_group_args *);
int linux_lookup_dcookie(struct thread *, struct linux_lookup_dcookie_args *);
@@ -1326,6 +1355,11 @@
#define LINUX_SYS_AUE_linux_fremovexattr AUE_NULL
#define LINUX_SYS_AUE_linux_tkill AUE_NULL
#define LINUX_SYS_AUE_linux_sys_futex AUE_NULL
+#define LINUX_SYS_AUE_linux_io_setup AUE_NULL
+#define LINUX_SYS_AUE_linux_io_destroy AUE_NULL
+#define LINUX_SYS_AUE_linux_io_getevents AUE_NULL
+#define LINUX_SYS_AUE_linux_io_submit AUE_NULL
+#define LINUX_SYS_AUE_linux_io_cancel AUE_NULL
#define LINUX_SYS_AUE_linux_fadvise64 AUE_NULL
#define LINUX_SYS_AUE_linux_exit_group AUE_EXIT
#define LINUX_SYS_AUE_linux_lookup_dcookie AUE_NULL
==== //depot/projects/newisp/amd64/linux32/linux32_syscall.h#3 (text+ko) ====
@@ -2,8 +2,8 @@
* System call numbers.
*
* DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/amd64/linux32/linux32_syscall.h,v 1.22 2006/08/27 08:58:00 netchild Exp $
- * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.20 2006/08/27 08:56:53 netchild Exp
+ * $FreeBSD: src/sys/amd64/linux32/linux32_syscall.h,v 1.23 2006/10/15 14:24:09 netchild Exp $
+ * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.21 2006/10/15 14:22:12 netchild Exp
*/
#define LINUX_SYS_exit 1
@@ -221,6 +221,11 @@
#define LINUX_SYS_linux_fremovexattr 237
#define LINUX_SYS_linux_tkill 238
#define LINUX_SYS_linux_sys_futex 240
+#define LINUX_SYS_linux_io_setup 245
+#define LINUX_SYS_linux_io_destroy 246
+#define LINUX_SYS_linux_io_getevents 247
+#define LINUX_SYS_linux_io_submit 248
+#define LINUX_SYS_linux_io_cancel 249
#define LINUX_SYS_linux_fadvise64 250
#define LINUX_SYS_linux_exit_group 252
#define LINUX_SYS_linux_lookup_dcookie 253
==== //depot/projects/newisp/amd64/linux32/linux32_sysent.c#3 (text+ko) ====
@@ -2,8 +2,8 @@
* System call switch table.
*
* DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/amd64/linux32/linux32_sysent.c,v 1.22 2006/08/27 08:58:00 netchild Exp $
- * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.20 2006/08/27 08:56:53 netchild Exp
+ * $FreeBSD: src/sys/amd64/linux32/linux32_sysent.c,v 1.23 2006/10/15 14:24:09 netchild Exp $
+ * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.21 2006/10/15 14:22:12 netchild Exp
*/
#include <bsm/audit_kevents.h>
@@ -265,11 +265,11 @@
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 242 = linux_sched_getaffinity */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 243 = linux_set_thread_area */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 244 = linux_get_thread_area */
- { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 245 = linux_io_setup */
- { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 246 = linux_io_destroy */
- { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 247 = linux_io_getevents */
- { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 248 = linux_io_submit */
- { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 249 = linux_io_cancel */
+ { AS(linux_io_setup_args), (sy_call_t *)linux_io_setup, AUE_NULL, NULL, 0, 0 }, /* 245 = linux_io_setup */
+ { AS(linux_io_destroy_args), (sy_call_t *)linux_io_destroy, AUE_NULL, NULL, 0, 0 }, /* 246 = linux_io_destroy */
+ { AS(linux_io_getevents_args), (sy_call_t *)linux_io_getevents, AUE_NULL, NULL, 0, 0 }, /* 247 = linux_io_getevents */
+ { AS(linux_io_submit_args), (sy_call_t *)linux_io_submit, AUE_NULL, NULL, 0, 0 }, /* 248 = linux_io_submit */
+ { AS(linux_io_cancel_args), (sy_call_t *)linux_io_cancel, AUE_NULL, NULL, 0, 0 }, /* 249 = linux_io_cancel */
{ 0, (sy_call_t *)linux_fadvise64, AUE_NULL, NULL, 0, 0 }, /* 250 = linux_fadvise64 */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 251 = */
{ AS(linux_exit_group_args), (sy_call_t *)linux_exit_group, AUE_EXIT, NULL, 0, 0 }, /* 252 = linux_exit_group */
==== //depot/projects/newisp/amd64/linux32/syscalls.master#3 (text+ko) ====
@@ -1,4 +1,4 @@
- $FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.20 2006/08/27 08:56:53 netchild Exp $
+ $FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.21 2006/10/15 14:22:12 netchild Exp $
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
; System call name/number master file (or rather, slave, from LINUX).
@@ -406,11 +406,11 @@
242 AUE_NULL UNIMPL linux_sched_getaffinity
243 AUE_NULL UNIMPL linux_set_thread_area
244 AUE_NULL UNIMPL linux_get_thread_area
-245 AUE_NULL UNIMPL linux_io_setup
-246 AUE_NULL UNIMPL linux_io_destroy
-247 AUE_NULL UNIMPL linux_io_getevents
-248 AUE_NULL UNIMPL linux_io_submit
-249 AUE_NULL UNIMPL linux_io_cancel
+245 AUE_NULL STD { int linux_io_setup(l_uint nr_reqs, linux_aio_context_t *ctxp); }
+246 AUE_NULL STD { int linux_io_destroy(linux_aio_context_t ctx); }
+247 AUE_NULL STD { int linux_io_getevents(linux_aio_context_t ctx_id, l_long min_nr, l_long nr, struct linux_io_event *events, struct l_timespec *timeout); }
+248 AUE_NULL STD { int linux_io_submit(linux_aio_context_t ctx_id, l_long nr, struct linux_iocb **iocbpp); }
+249 AUE_NULL STD { int linux_io_cancel(linux_aio_context_t ctx_id, struct linux_iocb *iocb, struct linux_io_event *result); }
250 AUE_NULL STD { int linux_fadvise64(void); }
251 AUE_NULL UNIMPL
252 AUE_EXIT STD { int linux_exit_group(int error_code); }
==== //depot/projects/newisp/arm/arm/fusu.S#4 (text+ko) ====
@@ -37,7 +37,7 @@
#include <machine/asmacros.h>
#include <machine/armreg.h>
#include "assym.s"
-__FBSDID("$FreeBSD: src/sys/arm/arm/fusu.S,v 1.10 2006/08/30 11:44:37 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/arm/fusu.S,v 1.11 2006/10/17 02:24:46 davidxu Exp $");
#ifdef MULTIPROCESSOR
.Lcpu_info:
@@ -53,7 +53,7 @@
*/
ENTRY_NP(casuword32)
-ENTRY(casuptr)
+ENTRY(casuword)
#ifdef MULTIPROCESSOR
/* XXX Probably not appropriate for non-Hydra SMPs */
stmfd sp!, {r0, r14}
@@ -72,7 +72,7 @@
beq .Lfusupcbfault
#endif
stmfd sp!, {r4, r5}
- adr r4, .Lcasuptrfault
+ adr r4, .Lcasuwordfault
str r4, [r3, #PCB_ONFAULT]
ldrt r5, [r0]
cmp r5, r1
@@ -85,10 +85,10 @@
RET
/*
- * Handle faults from casuptr. Clean up and return -1.
+ * Handle faults from casuword. Clean up and return -1.
*/
-.Lcasuptrfault:
+.Lcasuwordfault:
mov r0, #0x00000000
str r0, [r3, #PCB_ONFAULT]
mvn r0, #0x00000000
==== //depot/projects/newisp/arm/arm/trap.c#2 (text+ko) ====
@@ -82,7 +82,7 @@
#include "opt_ktrace.h"
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/arm/trap.c,v 1.27 2006/07/28 20:22:57 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/arm/trap.c,v 1.28 2006/10/20 11:00:03 cognet Exp $");
#include <sys/types.h>
@@ -940,22 +940,8 @@
}
switch (error) {
case 0:
-#ifdef __ARMEB__
- if ((insn & 0x000fffff) &&
- (code != SYS_lseek)) {
- /*
- * 64-bit return, 32-bit syscall. Fixup byte order
- */
- frame->tf_r0 = 0;
- frame->tf_r1 = td->td_retval[0];
- } else {
- frame->tf_r0 = td->td_retval[0];
- frame->tf_r1 = td->td_retval[1];
- }
-#else
frame->tf_r0 = td->td_retval[0];
frame->tf_r1 = td->td_retval[1];
-#endif
frame->tf_spsr &= ~PSR_C_bit; /* carry bit */
break;
==== //depot/projects/newisp/arm/at91/at91_spi.c#2 (text) ====
@@ -23,14 +23,13 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/at91/at91_spi.c,v 1.2 2006/07/14 21:35:59 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/at91/at91_spi.c,v 1.3 2006/10/20 07:10:13 imp Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bus.h>
#include <sys/conf.h>
#include <sys/kernel.h>
-#include <sys/lock.h>
#include <sys/mbuf.h>
#include <sys/malloc.h>
#include <sys/module.h>
@@ -50,9 +49,9 @@
void *intrhand; /* Interrupt handle */
struct resource *irq_res; /* IRQ resource */
struct resource *mem_res; /* Memory resource */
- struct mtx sc_mtx; /* basically a perimeter lock */
bus_dma_tag_t dmatag; /* bus dma tag for mbufs */
bus_dmamap_t map[4]; /* Maps for the transaction */
+ int rxdone;
};
static inline uint32_t
@@ -67,19 +66,7 @@
bus_write_4(sc->mem_res, off, val);
}
-#define AT91_SPI_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx)
-#define AT91_SPI_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx)
-#define AT91_SPI_LOCK_INIT(_sc) \
- mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->dev), \
- "spi", MTX_DEF)
-#define AT91_SPI_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx);
-#define AT91_SPI_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED);
-#define AT91_SPI_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED);
-
-static devclass_t at91_spi_devclass;
-
/* bus entry points */
-
static int at91_spi_probe(device_t dev);
static int at91_spi_attach(device_t dev);
static int at91_spi_detach(device_t dev);
@@ -87,6 +74,7 @@
/* helper routines */
static int at91_spi_activate(device_t dev);
static void at91_spi_deactivate(device_t dev);
+static void at91_spi_intr(void *arg);
static int
at91_spi_probe(device_t dev)
@@ -106,8 +94,6 @@
if (err)
goto out;
- AT91_SPI_LOCK_INIT(sc);
-
/*
* Allocate DMA tags and maps
*/
@@ -124,6 +110,7 @@
// reset the SPI
WR4(sc, SPI_CR, SPI_CR_SWRST);
+ WR4(sc, SPI_IDR, 0xffffffff);
WR4(sc, SPI_MR, (0xf << 24) | SPI_MR_MSTR | SPI_MR_MODFDIS |
(0xE << 16));
@@ -141,8 +128,6 @@
WR4(sc, PDC_RCR, 0);
WR4(sc, PDC_TPR, 0);
WR4(sc, PDC_TCR, 0);
- WR4(sc, PDC_PTCR, PDC_PTCR_RXTEN);
- WR4(sc, PDC_PTCR, PDC_PTCR_TXTEN);
RD4(sc, SPI_RDR);
RD4(sc, SPI_SR);
@@ -164,7 +149,7 @@
at91_spi_activate(device_t dev)
{
struct at91_spi_softc *sc;
- int rid;
+ int rid, err = ENOMEM;
sc = device_get_softc(dev);
rid = 0;
@@ -175,12 +160,16 @@
rid = 0;
sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
RF_ACTIVE);
- if (sc->mem_res == NULL)
+ if (sc->irq_res == NULL)
+ goto errout;
+ err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_MPSAFE,
+ at91_spi_intr, sc, &sc->intrhand);
+ if (err != 0)
goto errout;
return (0);
errout:
at91_spi_deactivate(dev);
- return (ENOMEM);
+ return (err);
}
static void
@@ -216,7 +205,7 @@
at91_spi_transfer(device_t dev, device_t child, struct spi_command *cmd)
{
struct at91_spi_softc *sc;
- int i;
+ int i, j, rxdone, err, mode[4];
bus_addr_t addr;
sc = device_get_softc(dev);
@@ -228,49 +217,73 @@
WR4(sc, PDC_TPR, addr);
WR4(sc, PDC_TCR, cmd->tx_cmd_sz);
bus_dmamap_sync(sc->dmatag, sc->map[i], BUS_DMASYNC_PREWRITE);
- i++;
- if (bus_dmamap_load(sc->dmatag, sc->map[i], cmd->tx_data,
- cmd->tx_data_sz, at91_getaddr, &addr, 0) != 0)
- goto out;
- WR4(sc, PDC_TNPR, addr);
- WR4(sc, PDC_TNCR, cmd->tx_cmd_sz);
- bus_dmamap_sync(sc->dmatag, sc->map[i], BUS_DMASYNC_PREWRITE);
- i++;
+ mode[i++] = BUS_DMASYNC_POSTWRITE;
+ if (cmd->tx_data_sz > 0) {
+ if (bus_dmamap_load(sc->dmatag, sc->map[i], cmd->tx_data,
+ cmd->tx_data_sz, at91_getaddr, &addr, 0) != 0)
+ goto out;
+ WR4(sc, PDC_TNPR, addr);
+ WR4(sc, PDC_TNCR, cmd->tx_cmd_sz);
+ bus_dmamap_sync(sc->dmatag, sc->map[i], BUS_DMASYNC_PREWRITE);
+ mode[i++] = BUS_DMASYNC_POSTWRITE;
+ }
if (bus_dmamap_load(sc->dmatag, sc->map[i], cmd->rx_cmd,
cmd->tx_cmd_sz, at91_getaddr, &addr, 0) != 0)
goto out;
WR4(sc, PDC_RPR, addr);
WR4(sc, PDC_RCR, cmd->tx_cmd_sz);
bus_dmamap_sync(sc->dmatag, sc->map[i], BUS_DMASYNC_PREREAD);
- i++;
- if (bus_dmamap_load(sc->dmatag, sc->map[i], cmd->rx_data,
- cmd->tx_data_sz, at91_getaddr, &addr, 0) != 0)
- goto out;
- WR4(sc, PDC_RNPR, addr);
- WR4(sc, PDC_RNCR, cmd->tx_data_sz);
- bus_dmamap_sync(sc->dmatag, sc->map[i], BUS_DMASYNC_PREREAD);
-
+ mode[i++] = BUS_DMASYNC_POSTREAD;
+ if (cmd->tx_data_sz > 0) {
+ if (bus_dmamap_load(sc->dmatag, sc->map[i], cmd->rx_data,
+ cmd->tx_data_sz, at91_getaddr, &addr, 0) != 0)
+ goto out;
+ WR4(sc, PDC_RNPR, addr);
+ WR4(sc, PDC_RNCR, cmd->tx_data_sz);
+ bus_dmamap_sync(sc->dmatag, sc->map[i], BUS_DMASYNC_PREREAD);
+ mode[i++] = BUS_DMASYNC_POSTREAD;
+ }
+ WR4(sc, SPI_IER, SPI_SR_ENDRX);
WR4(sc, PDC_PTCR, PDC_PTCR_TXTEN | PDC_PTCR_RXTEN);
- // wait for completion
- // XXX should be done as an ISR of some sort.
- while (RD4(sc, SPI_SR) & SPI_SR_ENDRX)
- DELAY(700);
-
- // Sync the buffers after the DMA is done, and unload them.
- bus_dmamap_sync(sc->dmatag, sc->map[0], BUS_DMASYNC_POSTWRITE);
- bus_dmamap_sync(sc->dmatag, sc->map[1], BUS_DMASYNC_POSTWRITE);
- bus_dmamap_sync(sc->dmatag, sc->map[2], BUS_DMASYNC_POSTREAD);
- bus_dmamap_sync(sc->dmatag, sc->map[3], BUS_DMASYNC_POSTREAD);
- for (i = 0; i < 4; i++)
- bus_dmamap_unload(sc->dmatag, sc->map[i]);
- return (0);
+ rxdone = sc->rxdone;
+ do {
+ err = msleep(&sc->rxdone, NULL, PCATCH | PZERO, "spi", hz);
+ } while (rxdone == sc->rxdone && err != EINTR);
+ WR4(sc, PDC_PTCR, PDC_PTCR_TXTDIS | PDC_PTCR_RXTDIS);
+ if (err == 0) {
+ for (j = 0; j < i; j++)
+ bus_dmamap_sync(sc->dmatag, sc->map[j], mode[j]);
+ }
+ for (j = 0; j < i; j++)
+ bus_dmamap_unload(sc->dmatag, sc->map[j]);
+ return (err);
out:;
- while (i-- > 0)
- bus_dmamap_unload(sc->dmatag, sc->map[i]);
+ for (j = 0; j < i; j++)
+ bus_dmamap_unload(sc->dmatag, sc->map[j]);
return (EIO);
}
+static void
+at91_spi_intr(void *arg)
+{
+ struct at91_spi_softc *sc = (struct at91_spi_softc*)arg;
+ uint32_t sr;
+
+ sr = RD4(sc, SPI_SR) & RD4(sc, SPI_IMR);
+ if (sr & SPI_SR_ENDRX) {
+ sc->rxdone++;
+ WR4(sc, SPI_IDR, SPI_SR_ENDRX);
+ wakeup(&sc->rxdone);
+ }
+ if (sr & ~SPI_SR_ENDRX) {
+ device_printf(sc->dev, "Unexpected ISR %#x\n", sr);
+ WR4(sc, SPI_IDR, sr & ~SPI_SR_ENDRX);
+ }
+}
+
+static devclass_t at91_spi_devclass;
+
static device_method_t at91_spi_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, at91_spi_probe),
==== //depot/projects/newisp/arm/at91/at91_ssc.c#2 (text) ====
@@ -23,7 +23,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/at91/at91_ssc.c,v 1.2 2006/07/14 22:30:44 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/at91/at91_ssc.c,v 1.3 2006/10/20 07:08:59 imp Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -88,14 +88,16 @@
/* cdev routines */
static d_open_t at91_ssc_open;
static d_close_t at91_ssc_close;
-static d_ioctl_t at91_ssc_ioctl;
+static d_read_t at91_ssc_read;
+static d_write_t at91_ssc_write;
static struct cdevsw at91_ssc_cdevsw =
{
.d_version = D_VERSION,
.d_open = at91_ssc_open,
.d_close = at91_ssc_close,
- .d_ioctl = at91_ssc_ioctl
+ .d_read = at91_ssc_read,
+ .d_write = at91_ssc_write,
};
static int
@@ -134,6 +136,19 @@
goto out;
}
sc->cdev->si_drv1 = sc;
+
+ // Init for TSC needs
+ WR4(sc, SSC_CR, SSC_CR_SWRST);
+ WR4(sc, SSC_CMR, 0); // clock divider unused
+ WR4(sc, SSC_RCMR,
+ SSC_RCMR_CKS_RK | SSC_RCMR_CKO_NONE | SSC_RCMR_START_FALL_EDGE_RF);
+ WR4(sc, SSC_RFMR,
+ 0x1f | SSC_RFMR_MSFBF | SSC_RFMR_FSOS_NONE);
+ WR4(sc, SSC_TCMR,
+ SSC_TCMR_CKS_TK | SSC_TCMR_CKO_NONE | SSC_RCMR_START_CONT);
+ WR4(sc, SSC_TFMR,
+ 0x1f | SSC_TFMR_DATDEF | SSC_TFMR_MSFBF | SSC_TFMR_FSOS_NEG_PULSE);
+
out:;
if (err)
at91_ssc_deactivate(dev);
@@ -161,7 +176,7 @@
rid = 0;
sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
RF_ACTIVE);
- if (sc->mem_res == NULL)
+ if (sc->irq_res == NULL)
goto errout;
return (0);
errout:
@@ -241,10 +256,15 @@
}
static int
-at91_ssc_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag,
- struct thread *td)
+at91_ssc_read(struct cdev *dev, struct uio *uio, int flag)
+{
+ return EIO;
+}
+
+static int
+at91_ssc_write(struct cdev *dev, struct uio *uio, int flag)
{
- return (ENXIO);
+ return EIO;
}
static device_method_t at91_ssc_methods[] = {
==== //depot/projects/newisp/arm/at91/at91_sscreg.h#2 (text) ====
@@ -22,9 +22,114 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/* $FreeBSD: src/sys/arm/at91/at91_sscreg.h,v 1.1 2006/03/24 07:42:33 imp Exp $ */
+/* $FreeBSD: src/sys/arm/at91/at91_sscreg.h,v 1.2 2006/10/20 07:08:15 imp Exp $ */
#ifndef ARM_AT91_AT91_SSCREG_H
#define ARM_AT91_AT91_SSCREG_H
+/* Registers */
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list