Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F101976271
D42969.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D42969.diff
View Options
diff --git a/sys/arm/arm/vfp.c b/sys/arm/arm/vfp.c
--- a/sys/arm/arm/vfp.c
+++ b/sys/arm/arm/vfp.c
@@ -30,10 +30,10 @@
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/kernel.h>
#include <sys/limits.h>
+#include <sys/malloc.h>
#include <sys/proc.h>
-#include <sys/imgact_elf.h>
-#include <sys/kernel.h>
#include <machine/armreg.h>
#include <machine/elf.h>
@@ -52,6 +52,9 @@
/* If true the VFP unit has 32 double registers, otherwise it has 16 */
static int is_d32;
+static MALLOC_DEFINE(M_FPUKERN_CTX, "fpukern_ctx",
+ "Kernel contexts for VFP state");
+
struct fpu_kern_ctx {
struct vfp_state *prev;
#define FPU_KERN_CTX_DUMMY 0x01 /* avoided save for the kern thread */
@@ -407,6 +410,21 @@
critical_exit();
}
+struct fpu_kern_ctx *
+fpu_kern_alloc_ctx(u_int flags)
+{
+ return (malloc(sizeof(struct fpu_kern_ctx), M_FPUKERN_CTX,
+ ((flags & FPU_KERN_NOWAIT) ? M_NOWAIT : M_WAITOK) | M_ZERO));
+}
+
+void
+fpu_kern_free_ctx(struct fpu_kern_ctx *ctx)
+{
+ KASSERT((ctx->flags & FPU_KERN_CTX_INUSE) == 0, ("freeing in-use ctx"));
+
+ free(ctx, M_FPUKERN_CTX);
+}
+
void
fpu_kern_enter(struct thread *td, struct fpu_kern_ctx *ctx, u_int flags)
{
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 7, 1:38 AM (20 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14502962
Default Alt Text
D42969.diff (1 KB)
Attached To
Mode
D42969: arm: Add fpu_kern_alloc_ctx()
Attached
Detach File
Event Timeline
Log In to Comment