Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1219449

[PATCH 05/15] x86/headers: Use ABI types consistently in sigcontext*.h

From Ingo Molnar <mingo@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 05/15] x86/headers: Use ABI types consistently in sigcontext*.h
Date 2015-09-05 09:40 +0200
Message-ID <q5geS-2go-29@gated-at.bofh.it> (permalink)
References <q5geR-2go-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Use the __u16/32/64 types we standardized on in ABI definitions - and which most
of this header was already using.

This will allow us to more obviously unify the compat header
into the main header.

No change in functionality.

Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mikko Rapeli <mikko.rapeli@iki.fi>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/include/uapi/asm/sigcontext.h   | 82 ++++++++++++++++----------------
 arch/x86/include/uapi/asm/sigcontext32.h | 58 +++++++++++-----------
 2 files changed, 70 insertions(+), 70 deletions(-)

diff --git a/arch/x86/include/uapi/asm/sigcontext.h b/arch/x86/include/uapi/asm/sigcontext.h
index 40d6cbac08c6..07b0e32a1d23 100644
--- a/arch/x86/include/uapi/asm/sigcontext.h
+++ b/arch/x86/include/uapi/asm/sigcontext.h
@@ -78,48 +78,48 @@ struct _fpx_sw_bytes {
 
 /* 10-byte legacy floating point register: */
 struct _fpreg {
-	unsigned short			significand[4];
-	unsigned short			exponent;
+	__u16				significand[4];
+	__u16				exponent;
 };
 
 /* 16-byte floating point register: */
 struct _fpxreg {
-	unsigned short			significand[4];
-	unsigned short			exponent;
-	unsigned short			padding[3];
+	__u16				significand[4];
+	__u16				exponent;
+	__u16				padding[3];
 };
 
 /* 16-byte XMM register: */
 struct _xmmreg {
-	unsigned long			element[4];
+	__u32				element[4];
 };
 
 #define X86_FXSR_MAGIC			0x0000
 
 struct _fpstate {
 	/* Legacy FPU environment: */
-	unsigned long			cw;
-	unsigned long			sw;
-	unsigned long			tag;
-	unsigned long			ipoff;
-	unsigned long			cssel;
-	unsigned long			dataoff;
-	unsigned long			datasel;
+	__u32				cw;
+	__u32				sw;
+	__u32				tag;
+	__u32				ipoff;
+	__u32				cssel;
+	__u32				dataoff;
+	__u32				datasel;
 	struct _fpreg			_st[8];
-	unsigned short			status;
-	unsigned short			magic;		/* 0xffff: regular FPU data only */
+	__u16				status;
+	__u16				magic;		/* 0xffff: regular FPU data only */
 							/* 0x0000: FXSR FPU data */
 
 	/* FXSR FPU environment */
-	unsigned long			_fxsr_env[6];	/* FXSR FPU env is ignored */
-	unsigned long			mxcsr;
-	unsigned long			reserved;
+	__u32				_fxsr_env[6];	/* FXSR FPU env is ignored */
+	__u32				mxcsr;
+	__u32				reserved;
 	struct _fpxreg			_fxsr_st[8];	/* FXSR FPU reg data is ignored */
 	struct _xmmreg			_xmm[8];	/* First 8 XMM registers */
-	unsigned long			padding1[44];	/* Second 8 XMM registers plus padding */
+	__u32				padding1[44];	/* Second 8 XMM registers plus padding */
 
 	union {
-		unsigned long		padding2[12];
+		__u32			padding2[12];
 		struct _fpx_sw_bytes	sw_reserved;	/* Potential extended state is encoded here */
 	};
 };
@@ -191,28 +191,28 @@ struct _xstate {
 #ifndef __KERNEL__
 # ifdef __i386__
 struct sigcontext {
-	unsigned short			gs, __gsh;
-	unsigned short			fs, __fsh;
-	unsigned short			es, __esh;
-	unsigned short			ds, __dsh;
-	unsigned long			edi;
-	unsigned long			esi;
-	unsigned long			ebp;
-	unsigned long			esp;
-	unsigned long			ebx;
-	unsigned long			edx;
-	unsigned long			ecx;
-	unsigned long			eax;
-	unsigned long			trapno;
-	unsigned long			err;
-	unsigned long			eip;
-	unsigned short			cs, __csh;
-	unsigned long			eflags;
-	unsigned long			esp_at_signal;
-	unsigned short			ss, __ssh;
+	__u16				gs, __gsh;
+	__u16				fs, __fsh;
+	__u16				es, __esh;
+	__u16				ds, __dsh;
+	__u32				edi;
+	__u32				esi;
+	__u32				ebp;
+	__u32				esp;
+	__u32				ebx;
+	__u32				edx;
+	__u32				ecx;
+	__u32				eax;
+	__u32				trapno;
+	__u32				err;
+	__u32				eip;
+	__u16				cs, __csh;
+	__u32				eflags;
+	__u32				esp_at_signal;
+	__u16				ss, __ssh;
 	struct _fpstate __user		*fpstate;
-	unsigned long			oldmask;
-	unsigned long			cr2;
+	__u32				oldmask;
+	__u32				cr2;
 };
 # else /* __x86_64__: */
 struct sigcontext {
diff --git a/arch/x86/include/uapi/asm/sigcontext32.h b/arch/x86/include/uapi/asm/sigcontext32.h
index 6ff4fbab650e..939a84885673 100644
--- a/arch/x86/include/uapi/asm/sigcontext32.h
+++ b/arch/x86/include/uapi/asm/sigcontext32.h
@@ -9,15 +9,15 @@
 
 /* 10-byte legacy floating point register: */
 struct _fpreg {
-	unsigned short			significand[4];
-	unsigned short			exponent;
+	__u16				significand[4];
+	__u16				exponent;
 };
 
 /* 16-byte floating point register: */
 struct _fpxreg {
-	unsigned short			significand[4];
-	unsigned short			exponent;
-	unsigned short			padding[3];
+	__u16				significand[4];
+	__u16				exponent;
+	__u16				padding[3];
 };
 
 /* 16-byte XMM vector register: */
@@ -38,8 +38,8 @@ struct _fpstate_ia32 {
 	__u32				dataoff;
 	__u32				datasel;
 	struct _fpreg			_st[8];
-	unsigned short			status;
-	unsigned short			magic;		/* 0xffff: regular FPU data only */
+	__u16				status;
+	__u16				magic;		/* 0xffff: regular FPU data only */
 							/* 0x0000: FXSR data */
 
 	/* Extended FXSR FPU environment: */
@@ -58,28 +58,28 @@ struct _fpstate_ia32 {
 
 /* 32-bit compat sigcontext: */
 struct sigcontext_ia32 {
-       unsigned short			gs, __gsh;
-       unsigned short			fs, __fsh;
-       unsigned short			es, __esh;
-       unsigned short			ds, __dsh;
-       unsigned int			di;
-       unsigned int			si;
-       unsigned int			bp;
-       unsigned int			sp;
-       unsigned int			bx;
-       unsigned int			dx;
-       unsigned int			cx;
-       unsigned int			ax;
-       unsigned int			trapno;
-       unsigned int			err;
-       unsigned int			ip;
-       unsigned short			cs, __csh;
-       unsigned int			flags;
-       unsigned int			sp_at_signal;
-       unsigned short			ss, __ssh;
-       unsigned int			fpstate;	/* Pointer to 'struct _fpstate_ia32' */
-       unsigned int			oldmask;
-       unsigned int			cr2;
+       __u16				gs, __gsh;
+       __u16				fs, __fsh;
+       __u16				es, __esh;
+       __u16				ds, __dsh;
+       __u32				di;
+       __u32				si;
+       __u32				bp;
+       __u32				sp;
+       __u32				bx;
+       __u32				dx;
+       __u32				cx;
+       __u32				ax;
+       __u32				trapno;
+       __u32				err;
+       __u32				ip;
+       __u16				cs, __csh;
+       __u32				flags;
+       __u32				sp_at_signal;
+       __u16				ss, __ssh;
+       __u32				fpstate;	/* Pointer to 'struct _fpstate_ia32' */
+       __u32				oldmask;
+       __u32				cr2;
 };
 
 #endif /* _ASM_X86_SIGCONTEXT32_H */
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/15] x86/headers: Clean up sigcontext types and headers Ingo Molnar <mingo@kernel.org> - 2015-09-05 09:40 +0200
  [PATCH 07/15] x86/headers: Unify 'struct _fpstate_ia32' and i386 struct _fpstate Ingo Molnar <mingo@kernel.org> - 2015-09-05 09:40 +0200
  [PATCH 08/15] x86/headers: Convert uses of _fpstate_ia32 to _fpstate_32 Ingo Molnar <mingo@kernel.org> - 2015-09-05 09:40 +0200
  [PATCH 06/15] x86/headers: Unify register type definitions between 32-bit compat and i386 Ingo Molnar <mingo@kernel.org> - 2015-09-05 09:40 +0200
  [PATCH 12/15] x86/headers: Unify 'struct sigcontext_ia32' and 'struct sigcontext_32' Ingo Molnar <mingo@kernel.org> - 2015-09-05 09:40 +0200
  [PATCH 05/15] x86/headers: Use ABI types consistently in sigcontext*.h Ingo Molnar <mingo@kernel.org> - 2015-09-05 09:40 +0200
  [PATCH 10/15] x86/headers: Move the 'struct sigcontext' definitions into the UAPI header Ingo Molnar <mingo@kernel.org> - 2015-09-05 09:40 +0200
  [PATCH 15/15] x86/headers: Remove <asm/sigcontext.h> Ingo Molnar <mingo@kernel.org> - 2015-09-05 09:40 +0200
    Re: [PATCH 15/15] x86/headers: Remove <asm/sigcontext.h> Mikko Rapeli <mikko.rapeli@iki.fi> - 2015-09-05 13:00 +0200
      Re: [PATCH 15/15] x86/headers: Remove <asm/sigcontext.h> Ingo Molnar <mingo@kernel.org> - 2015-09-05 14:10 +0200
        Re: [PATCH 15/15] x86/headers: Remove <asm/sigcontext.h> Mikko Rapeli <mikko.rapeli@iki.fi> - 2015-09-05 14:20 +0200
          Re: [PATCH 15/15] x86/headers: Remove <asm/sigcontext.h> Ingo Molnar <mingo@kernel.org> - 2015-09-06 08:50 +0200
            Re: [PATCH 15/15] x86/headers: Remove <asm/sigcontext.h> Mikko Rapeli <mikko.rapeli@iki.fi> - 2015-09-06 22:30 +0200
              Re: [PATCH 15/15] x86/headers: Remove <asm/sigcontext.h> Ingo Molnar <mingo@kernel.org> - 2015-09-07 09:40 +0200
                Re: [PATCH 15/15] x86/headers: Remove <asm/sigcontext.h> Mikko Rapeli <mikko.rapeli@iki.fi> - 2015-09-07 10:20 +0200
  [PATCH 04/15] x86/headers: Separate out legacy user-space structure definitions Ingo Molnar <mingo@kernel.org> - 2015-09-05 09:40 +0200
  [PATCH 01/15] x86/headers: Fix (old) header file dependency bug in uapi/asm/sigcontext32.h Ingo Molnar <mingo@kernel.org> - 2015-09-05 09:40 +0200
  [PATCH 09/15] x86/headers: Clean up the kernel's struct sigcontext types to be ABI-clean Ingo Molnar <mingo@kernel.org> - 2015-09-05 09:40 +0200

csiph-web