Module Name:    src
Committed By:   mgorny
Date:           Fri May 10 16:27:03 UTC 2019

Modified Files:
        src/sys/arch/i386/include: reg.h

Log Message:
Fill 'struct fpreg' & 'struct xmmregs' in

The 'struct fpreg' data type used by PT_GETFPREGS, and 'struct xmmregs'
used by PT_GETXMMREGS are currently opaque.  Define them to contain
correct data structs instead, the same way they are defined for amd64.
For 'struct fpreg' this means 'struct save87', and for 'struct xmmregs'
this means 'struct fxsave'.  This makes it more transparent for
consumers how the data is formatted, and allows using it without need
for explicit casts.

Reviewed by <kamil>.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/i386/include/reg.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/i386/include/reg.h
diff -u src/sys/arch/i386/include/reg.h:1.20 src/sys/arch/i386/include/reg.h:1.21
--- src/sys/arch/i386/include/reg.h:1.20	Thu Feb 23 03:34:22 2017
+++ src/sys/arch/i386/include/reg.h	Fri May 10 16:27:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: reg.h,v 1.20 2017/02/23 03:34:22 kamil Exp $	*/
+/*	$NetBSD: reg.h,v 1.21 2019/05/10 16:27:03 mgorny Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -37,6 +37,7 @@
 #ifndef _I386_REG_H_
 #define _I386_REG_H_
 
+#include <x86/fpu.h>
 #include <machine/frame.h>
 
 /*
@@ -92,20 +93,14 @@ struct reg {
 };
 
 struct fpreg {
-	/*
-	 * XXX
-	 * Fill this in with real info.
-	 */
-	char	__data[108];
+	struct save87 fstate;
 };
+__CTASSERT(sizeof(struct fpreg) == 108);
 
 struct xmmregs {
-	/*
-	 * XXX
-	 * Fill this in with real info.
-	 */
-	char	__data[512];
+	struct fxsave fxstate;
 };
+__CTASSERT(sizeof(struct xmmregs) == 512);
 
 /*
  * Debug Registers

Reply via email to