This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Add common files for x86 XSAVE extended state


> Date: Tue, 2 Mar 2010 11:45:59 -0800
> From: "H.J. Lu" <hongjiu.lu@intel.com>
> 
> On Tue, Mar 02, 2010 at 07:28:26AM -0800, H.J. Lu wrote:
> > Hi,
> > 
> > This patch adds common files for x86 XSAVE extended state. They
> > are used by native x86 gdb and gdbserver to discover x86 XSAVE
> > extended state support. You can see IA32/Intel64 SDM at
> > 
> > http://developer.intel.com/products/processor/manuals/index.htm
> > 
> > for details. OK to install?
> > 
> > Thanks.
> > 
> > 
> > H.J.
> > ---
> > 2010-03-02  H.J. Lu  <hongjiu.lu@intel.com>
> > 
> > 	* common/i386-cpuid.h: New.
> > 	* common/i386-xstate.c: Likewise.
> > 	* common/i386-xstate.h: Likewise.
> > 
> 
> 
> Here is the updated patch to define macros used by native gdb and
> gdbserver.  There is no need for common/i386-xstate.c nor
> common/i386-cpuid.h.  OK to install?

Looks a lot less repulsive than the first diff.  But there are quite a
few oddities in there (what the heck are those strings good for?),
that make me question whether we want such a file at all.  Again,
difficult to review without seeing where and how this actually gets
used.

> 2010-03-02  H.J. Lu  <hongjiu.lu@intel.com>
> 
> 	* common/i386-xstate.h: New.
> 
> diff --git a/gdb/common/i386-xstate.h b/gdb/common/i386-xstate.h
> new file mode 100644
> index 0000000..41c7ce1
> --- /dev/null
> +++ b/gdb/common/i386-xstate.h
> @@ -0,0 +1,48 @@
> +/* Common code for i386 XSAVE extended state.
> +
> +   Copyright (C) 2010 Free Software Foundation, Inc.
> +
> +   This file is part of GDB.
> +
> +   This program is free software; you can redistribute it and/or modify
> +   it under the terms of the GNU General Public License as published by
> +   the Free Software Foundation; either version 3 of the License, or
> +   (at your option) any later version.
> +
> +   This program is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +   GNU General Public License for more details.
> +
> +   You should have received a copy of the GNU General Public License
> +   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
> +
> +#ifndef I386_XSTATE_H
> +#define I386_XSTATE_H 1
> +
> +/* The extended state feature bits.  */
> +#define bit_I386_XSTATE_X87		(1ULL << 0)
> +#define bit_I386_XSTATE_SSE		(1ULL << 1)
> +#define bit_I386_XSTATE_AVX		(1ULL << 2)
> +
> +/* Supported mask and size of the extended state.  */
> +#define I386_XSTATE_SSE_MASK	\
> +  (bit_I386_XSTATE_X87 | bit_I386_XSTATE_SSE)
> +#define I386_XSTATE_AVX_MASK	\
> +  (I386_XSTATE_SSE_MASK | bit_I386_XSTATE_AVX)
> +#define I386_XSTATE_MAX_MASK	\
> +  I386_XSTATE_AVX_MASK
> +
> +#define I386_XSTATE_SSE_MASK_STRING	"0x3"
> +#define I386_XSTATE_AVX_MASK_STRING	"0x7"
> +#define I386_XSTATE_MAX_MASK_STRING	"0x7"
> +
> +#define I386_XSTATE_SSE_SIZE		576
> +#define I386_XSTATE_AVX_SIZE		832
> +#define I386_XSTATE_MAX_SIZE		832
> +
> +#define I386_XSTATE_SSE_SIZE_STRING	"576"
> +#define I386_XSTATE_AVX_SIZE_STRING	"832"
> +#define I386_XSTATE_MAX_SIZE_STRING	"832"
> +
> +#endif /* I386_XSTATE_H */
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]