Skip to content
Permalink
Browse files

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>.
  • Loading branch information...
mgorny committed May 10, 2019
1 parent 95bfedc commit bbc3f184d470ce691340d3a7ceec77464883258f
Showing with 6 additions and 11 deletions.
  1. +6 −11 sys/arch/i386/include/reg.h
@@ -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

0 comments on commit bbc3f18

Please sign in to comment.
You can’t perform that action at this time.