From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24241 invoked by alias); 2 Mar 2010 19:47:39 -0000 Received: (qmail 24135 invoked by uid 22791); 2 Mar 2010 19:47:37 -0000 X-SWARE-Spam-Status: No, hits=-0.7 required=5.0 tests=AWL,BAYES_00,NO_DNS_FOR_FROM X-Spam-Check-By: sourceware.org Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 02 Mar 2010 19:46:41 +0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 02 Mar 2010 11:44:46 -0800 X-ExtLoop1: 1 Received: from unknown (HELO gnu-6.sc.intel.com) ([10.3.194.107]) by orsmga002.jf.intel.com with ESMTP; 02 Mar 2010 11:46:02 -0800 Received: by gnu-6.sc.intel.com (Postfix, from userid 500) id 8D3F881239A; Tue, 2 Mar 2010 11:45:59 -0800 (PST) Date: Tue, 02 Mar 2010 19:47:00 -0000 From: "H.J. Lu" To: GDB Subject: Re: PATCH: Add common files for x86 XSAVE extended state Message-ID: <20100302194559.GA14466@intel.com> Reply-To: "H.J. Lu" References: <20100302152826.GA28158@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100302152826.GA28158@intel.com> User-Agent: Mutt/1.5.20 (2009-08-17) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-03/txt/msg00071.txt.bz2 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 > > * 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? Thanks. H.J. --- 2010-03-02 H.J. Lu * 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 . */ + +#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 */