Module Name:    src
Committed By:   matt
Date:           Thu Jan 31 14:58:52 UTC 2013

Modified Files:
        src/sys/arch/arm/arm32: sys_machdep.c
        src/sys/arch/arm/include: sysarch.h

Log Message:
add a fpu_used sysarch


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/arm32/sys_machdep.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/include/sysarch.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/arm32/sys_machdep.c
diff -u src/sys/arch/arm/arm32/sys_machdep.c:1.15 src/sys/arch/arm/arm32/sys_machdep.c:1.16
--- src/sys/arch/arm/arm32/sys_machdep.c:1.15	Sun Aug 12 05:05:47 2012
+++ src/sys/arch/arm/arm32/sys_machdep.c	Thu Jan 31 14:58:51 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_machdep.c,v 1.15 2012/08/12 05:05:47 matt Exp $	*/
+/*	$NetBSD: sys_machdep.c,v 1.16 2013/01/31 14:58:51 matt Exp $	*/
 
 /*
  * Copyright (c) 1995-1997 Mark Brinicombe.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.15 2012/08/12 05:05:47 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.16 2013/01/31 14:58:51 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -61,6 +61,7 @@ __KERNEL_RCSID(0, "$NetBSD: sys_machdep.
 static int arm32_sync_icache(struct lwp *, const void *, register_t *);
 static int arm32_drain_writebuf(struct lwp *, const void *, register_t *);
 static int arm32_vfp_fpscr(struct lwp *, const void *, register_t *);
+static int arm32_fpu_used(struct lwp *, const void *, register_t *);
 
 static int
 arm32_sync_icache(struct lwp *l, const void *args, register_t *retval)
@@ -117,6 +118,14 @@ arm32_vfp_fpscr(struct lwp *l, const voi
 	return 0;
 }
 
+static int
+arm32_fpu_used(struct lwp *l, const void *uap, register_t *retval)
+{
+	/* No args */
+	retval[0] = (curlwp->l_md.md_flags & MDLWP_VFPUSED) != 0;
+	return 0;
+}
+
 int
 sys_sysarch(struct lwp *l, const struct sys_sysarch_args *uap, register_t *retval)
 {
@@ -139,6 +148,10 @@ sys_sysarch(struct lwp *l, const struct 
 		error = arm32_vfp_fpscr(l, SCARG(uap, parms), retval);
 		break;
 
+	case ARM_FPU_USED :
+		error = arm32_fpu_used(l, SCARG(uap, parms), retval);
+		break;
+
 	default:
 		error = EINVAL;
 		break;

Index: src/sys/arch/arm/include/sysarch.h
diff -u src/sys/arch/arm/include/sysarch.h:1.8 src/sys/arch/arm/include/sysarch.h:1.9
--- src/sys/arch/arm/include/sysarch.h:1.8	Sun Aug 12 05:05:47 2012
+++ src/sys/arch/arm/include/sysarch.h	Thu Jan 31 14:58:51 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: sysarch.h,v 1.8 2012/08/12 05:05:47 matt Exp $	*/
+/*	$NetBSD: sysarch.h,v 1.9 2013/01/31 14:58:51 matt Exp $	*/
 
 /*
  * Copyright (c) 1996-1997 Mark Brinicombe.
@@ -49,6 +49,7 @@
 #define ARM_SYNC_ICACHE		0
 #define ARM_DRAIN_WRITEBUF	1
 #define ARM_VFP_FPSCR		2
+#define ARM_FPU_USED		3
 
 struct arm_sync_icache_args {
 	uintptr_t	addr;		/* Virtual start address */
@@ -60,6 +61,10 @@ struct arm_vfp_fpscr_args {
 	uint32_t	fpscr_set;	/* bits to set */
 };
 
+struct arm_unaligned_faults_args {
+	bool		enabled;	/* unaligned faults are enabled */ 
+};
+
 #ifndef _KERNEL
 __BEGIN_DECLS
 int	arm_sync_icache(u_int addr, int len);

Reply via email to