Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm add a fpu_used sysarch
details: https://anonhg.NetBSD.org/src/rev/f50072b8884e
branches: trunk
changeset: 784538:f50072b8884e
user: matt <matt%NetBSD.org@localhost>
date: Thu Jan 31 14:58:51 2013 +0000
description:
add a fpu_used sysarch
diffstat:
sys/arch/arm/arm32/sys_machdep.c | 17 +++++++++++++++--
sys/arch/arm/include/sysarch.h | 7 ++++++-
2 files changed, 21 insertions(+), 3 deletions(-)
diffs (80 lines):
diff -r 25432a6668b5 -r f50072b8884e sys/arch/arm/arm32/sys_machdep.c
--- a/sys/arch/arm/arm32/sys_machdep.c Thu Jan 31 14:56:32 2013 +0000
+++ b/sys/arch/arm/arm32/sys_machdep.c Thu Jan 31 14:58:51 2013 +0000
@@ -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 @@
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 @@
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 @@
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;
diff -r 25432a6668b5 -r f50072b8884e sys/arch/arm/include/sysarch.h
--- a/sys/arch/arm/include/sysarch.h Thu Jan 31 14:56:32 2013 +0000
+++ b/sys/arch/arm/include/sysarch.h Thu Jan 31 14:58:51 2013 +0000
@@ -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 @@
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);
Home |
Main Index |
Thread Index |
Old Index