changeset 13634:44267816c977

2251 kernel inlines should support gcc 4 Reviewed by: Andrew Stormont <Andrew.Stormont@nexenta.com> Reviewed by: Milan Jurik <milan.jurik@xylab.cz> Reviewed by: Dan McDonald <danmcd@nexenta.com> Reviewed by: Joshua M. Clulow <josh@sysmgr.org> Reviewed by: Gordon Ross <gwr@nexenta.com> Approved by: Garrett D'Amore <garrett@damore.org>
author Richard Lowe <richlowe@richlowe.net>
date Sun, 15 May 2011 21:34:10 +0100
parents 7d8ad953b304
children 022f1af9e21c
files usr/src/uts/common/sys/ccompile.h usr/src/uts/intel/amd64/sys/privregs.h usr/src/uts/intel/asm/atomic.h usr/src/uts/intel/asm/bitmap.h usr/src/uts/intel/asm/byteorder.h usr/src/uts/intel/asm/clock.h usr/src/uts/intel/asm/cpu.h usr/src/uts/intel/asm/cpuvar.h usr/src/uts/intel/asm/htable.h usr/src/uts/intel/asm/mmu.h usr/src/uts/intel/asm/sunddi.h usr/src/uts/intel/asm/thread.h usr/src/uts/sparc/asm/cpu.h usr/src/uts/sparc/asm/flush.h usr/src/uts/sparc/asm/sunddi.h usr/src/uts/sparc/asm/thread.h
diffstat 16 files changed, 189 insertions(+), 148 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/sys/ccompile.h	Mon Mar 05 13:42:51 2012 +0300
+++ b/usr/src/uts/common/sys/ccompile.h	Sun May 15 21:34:10 2011 +0100
@@ -27,8 +27,6 @@
 #ifndef	_SYS_CCOMPILE_H
 #define	_SYS_CCOMPILE_H
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 /*
  * This file contains definitions designed to enable different compilers
  * to be used harmoniously on Solaris systems.
@@ -79,6 +77,17 @@
  */
 #define	__sun_attr___noreturn__ __attribute__((__noreturn__))
 
+/*
+ * The function is 'extern inline' and expects GNU C89 behaviour, not C99
+ * behaviour.
+ *
+ * Should only be used on 'extern inline' definitions for GCC.
+ */
+#if __GNUC_VERSION >= 40300
+#define	__sun_attr___gnu_inline__	__attribute__((__gnu_inline__))
+#else
+#define	__sun_attr___gnu_inline__
+#endif
 
 /*
  * This is an appropriate label for functions that do not
@@ -116,10 +125,10 @@
 #define	__KPRINTFLIKE(__n)	__sun_attr__((__KPRINTFLIKE__(__n)))
 #define	__KVPRINTFLIKE(__n)	__sun_attr__((__KVPRINTFLIKE__(__n)))
 #define	__NORETURN		__sun_attr__((__noreturn__))
+#define	__GNU_INLINE		__inline__ __sun_attr__((__gnu_inline__))
 #define	__CONST			__sun_attr__((__const__))
 #define	__PURE			__sun_attr__((__pure__))
 
-
 #ifdef	__cplusplus
 }
 #endif
--- a/usr/src/uts/intel/amd64/sys/privregs.h	Mon Mar 05 13:42:51 2012 +0300
+++ b/usr/src/uts/intel/amd64/sys/privregs.h	Sun May 15 21:34:10 2011 +0100
@@ -27,7 +27,7 @@
 #ifndef	_AMD64_SYS_PRIVREGS_H
 #define	_AMD64_SYS_PRIVREGS_H
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
+#include <sys/ccompile.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -255,7 +255,8 @@
 #if defined(_KERNEL) && !defined(_ASM)
 #if !defined(__lint) && defined(__GNUC__)
 
-extern __inline__ ulong_t getcr8(void)
+extern __GNU_INLINE ulong_t
+getcr8(void)
 {
 	uint64_t value;
 
@@ -265,7 +266,8 @@
 	return (value);
 }
 
-extern __inline__ void setcr8(ulong_t value)
+extern __GNU_INLINE void
+setcr8(ulong_t value)
 {
 	__asm__ __volatile__(
 	    "movq %0, %%cr8"
--- a/usr/src/uts/intel/asm/atomic.h	Mon Mar 05 13:42:51 2012 +0300
+++ b/usr/src/uts/intel/asm/atomic.h	Sun May 15 21:34:10 2011 +0100
@@ -27,8 +27,7 @@
 #ifndef _ASM_ATOMIC_H
 #define	_ASM_ATOMIC_H
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
+#include <sys/ccompile.h>
 #include <sys/types.h>
 
 #ifdef	__cplusplus
@@ -39,52 +38,57 @@
 
 #if defined(__amd64)
 
-extern __inline__ void atomic_or_long(ulong_t *target, ulong_t bits)
+extern __GNU_INLINE void
+atomic_or_long(ulong_t *target, ulong_t bits)
 {
 	__asm__ __volatile__(
-		"lock; orq %1, (%0)"
-		: /* no output */
-		: "r" (target), "r" (bits));
+	    "lock; orq %1, (%0)"
+	    : /* no output */
+	    : "r" (target), "r" (bits));
 }
 
-extern __inline__ void atomic_and_long(ulong_t *target, ulong_t bits)
+extern __GNU_INLINE void
+atomic_and_long(ulong_t *target, ulong_t bits)
 {
 	__asm__ __volatile__(
-		"lock; andq %1, (%0)"
-		: /* no output */
-		: "r" (target), "r" (bits));
+	    "lock; andq %1, (%0)"
+	    : /* no output */
+	    : "r" (target), "r" (bits));
 }
 
 #ifdef notdef
-extern __inline__ uint64_t cas64(uint64_t *target, uint64_t cmp,
+extern __GNU_INLINE uint64_t
+cas64(uint64_t *target, uint64_t cmp,
 	uint64_t newval)
 {
 	uint64_t retval;
 
 	__asm__ __volatile__(
-		"movq %2, %%rax; lock; cmpxchgq %3, (%1)"
-		: "=a" (retval)
-		: "r" (target), "r" (cmp), "r" (newval));
+	    "movq %2, %%rax; lock; cmpxchgq %3, (%1)"
+	    : "=a" (retval)
+	    : "r" (target), "r" (cmp), "r" (newval));
 	return (retval);
 }
 #endif
 
 #elif defined(__i386)
 
-extern __inline__ void atomic_or_long(ulong_t *target, ulong_t bits)
+extern __GNU_INLINE void
+atomic_or_long(ulong_t *target, ulong_t bits)
 {
 	__asm__ __volatile__(
-		"lock; orl %1, (%0)"
-		: /* no output */
-		: "r" (target), "r" (bits));
+	    "lock; orl %1, (%0)"
+	    : /* no output */
+	    : "r" (target), "r" (bits));
 }
 
-extern __inline__ void atomic_and_long(ulong_t *target, ulong_t bits)
+extern __GNU_INLINE void
+atomic_and_long(ulong_t *target, ulong_t bits)
 {
 	__asm__ __volatile__(
-		"lock; andl %1, (%0)"
-		: /* no output */
-		: "r" (target), "r" (bits));
+	    "lock; andl %1, (%0)"
+	    : /* no output */
+	    : "r" (target), "r" (bits));
 }
 
 #else
--- a/usr/src/uts/intel/asm/bitmap.h	Mon Mar 05 13:42:51 2012 +0300
+++ b/usr/src/uts/intel/asm/bitmap.h	Sun May 15 21:34:10 2011 +0100
@@ -27,8 +27,7 @@
 #ifndef _ASM_BITMAP_H
 #define	_ASM_BITMAP_H
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
+#include <sys/ccompile.h>
 #include <sys/types.h>
 
 #ifdef	__cplusplus
@@ -37,73 +36,73 @@
 
 #if !defined(__lint) && defined(__GNUC__)
 
-extern __inline__ int
+extern __GNU_INLINE int
 highbit(ulong_t i)
 {
 	long __value = -1l;
 
 #if defined(__amd64)
 	__asm__(
-		"bsrq	%1,%0"
-		: "+r" (__value)
-		: "r" (i)
-		: "cc");
+	    "bsrq	%1,%0"
+	    : "+r" (__value)
+	    : "r" (i)
+	    : "cc");
 #elif defined(__i386)
 	__asm__(
-		"bsrl	%1,%0"
-		: "+r" (__value)
-		: "r" (i)
-		: "cc");
+	    "bsrl	%1,%0"
+	    : "+r" (__value)
+	    : "r" (i)
+	    : "cc");
 #else
 #error	"port me"
 #endif
 	return ((int)(__value + 1));
 }
 
-extern __inline__ int
+extern __GNU_INLINE int
 lowbit(ulong_t i)
 {
 	long __value = -1l;
 
 #if defined(__amd64)
 	__asm__(
-		"bsfq	%1,%0"
-		: "+r" (__value)
-		: "r" (i)
-		: "cc");
+	    "bsfq	%1,%0"
+	    : "+r" (__value)
+	    : "r" (i)
+	    : "cc");
 #elif defined(__i386)
 	__asm__(
-		"bsfl	%1,%0"
-		: "+r" (__value)
-		: "r" (i)
-		: "cc");
+	    "bsfl	%1,%0"
+	    : "+r" (__value)
+	    : "r" (i)
+	    : "cc");
 #else
 #error	"port me"
 #endif
 	return ((int)(__value + 1));
 }
 
-extern __inline__ uint_t
+extern __GNU_INLINE uint_t
 atomic_btr32(uint32_t *memory, uint_t bitnum)
 {
 	uint8_t __value;
 
 #if defined(__amd64)
 	__asm__ __volatile__(
-		"lock;"
-		"btrl %2, (%0);"
-		"setc %1"
-		: "+r" (memory), "+r" (__value)
-		: "ir" (bitnum)
-		: "cc");
+	    "lock;"
+	    "btrl %2, (%0);"
+	    "setc %1"
+	    : "+r" (memory), "+r" (__value)
+	    : "ir" (bitnum)
+	    : "cc");
 #elif defined(__i386)
 	__asm__ __volatile__(
-		"lock;"
-		"btrl %2, (%0);"
-		"setc %1"
-		: "+r" (memory), "=r" (__value)
-		: "ir" (bitnum)
-		: "cc");
+	    "lock;"
+	    "btrl %2, (%0);"
+	    "setc %1"
+	    : "+r" (memory), "=r" (__value)
+	    : "ir" (bitnum)
+	    : "cc");
 #else
 #error	"port me"
 #endif
--- a/usr/src/uts/intel/asm/byteorder.h	Mon Mar 05 13:42:51 2012 +0300
+++ b/usr/src/uts/intel/asm/byteorder.h	Sun May 15 21:34:10 2011 +0100
@@ -26,6 +26,7 @@
 #ifndef _ASM_BYTEORDER_H
 #define	_ASM_BYTEORDER_H
 
+#include <sys/ccompile.h>
 #include <sys/types.h>
 
 #ifdef	__cplusplus
@@ -44,7 +45,8 @@
 
 #if defined(__i386) || defined(__amd64)
 
-extern __inline__ uint16_t htons(uint16_t value)
+extern __GNU_INLINE uint16_t
+htons(uint16_t value)
 {
 #if defined(__amd64)
 	__asm__("xchgb %h0, %b0" : "+Q" (value));
@@ -54,7 +56,8 @@
 	return (value);
 }
 
-extern __inline__ uint16_t ntohs(uint16_t value)
+extern __GNU_INLINE uint16_t
+ntohs(uint16_t value)
 {
 #if defined(__amd64)
 	__asm__("xchgb %h0, %b0" : "+Q" (value));
@@ -64,26 +67,30 @@
 	return (value);
 }
 
-extern __inline__ uint32_t htonl(uint32_t value)
+extern __GNU_INLINE uint32_t
+htonl(uint32_t value)
 {
 	__asm__("bswap %0" : "+r" (value));
 	return (value);
 }
 
-extern __inline__ uint32_t ntohl(uint32_t value)
+extern __GNU_INLINE uint32_t
+ntohl(uint32_t value)
 {
 	__asm__("bswap %0" : "+r" (value));
 	return (value);
 }
 
 #if defined(__amd64)
-extern __inline__ uint64_t htonll(uint64_t value)
+extern __GNU_INLINE uint64_t
+htonll(uint64_t value)
 {
 	__asm__("bswapq %0" : "+r" (value));
 	return (value);
 }
 
-extern __inline__ uint64_t ntohll(uint64_t value)
+extern __GNU_INLINE uint64_t
+ntohll(uint64_t value)
 {
 	__asm__("bswapq %0" : "+r" (value));
 	return (value);
@@ -91,12 +98,14 @@
 
 #elif defined(__i386)
 /* Use the htonl() and ntohl() inline functions defined above */
-extern __inline__ uint64_t htonll(uint64_t value)
+extern __GNU_INLINE uint64_t
+htonll(uint64_t value)
 {
 	return (htonl(value >> 32) | ((uint64_t)htonl(value) << 32));
 }
 
-extern __inline__ uint64_t ntohll(uint64_t value)
+extern __GNU_INLINE uint64_t
+ntohll(uint64_t value)
 {
 	return (ntohl(value >> 32) | (uint64_t)ntohl(value) << 32);
 }
--- a/usr/src/uts/intel/asm/clock.h	Mon Mar 05 13:42:51 2012 +0300
+++ b/usr/src/uts/intel/asm/clock.h	Sun May 15 21:34:10 2011 +0100
@@ -26,8 +26,7 @@
 #ifndef _ASM_CLOCK_H
 #define	_ASM_CLOCK_H
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
+#include <sys/ccompile.h>
 #include <sys/types.h>
 #include <sys/time.h>
 
@@ -39,7 +38,8 @@
 
 #include <sys/machlock.h>
 
-extern __inline__ void unlock_hres_lock(void)
+extern __GNU_INLINE void
+unlock_hres_lock(void)
 {
 	__asm__ __volatile__(
 	    "lock; incl %0"
@@ -50,7 +50,8 @@
 
 #if defined(__xpv)
 
-extern __inline__ hrtime_t __rdtsc_insn(void)
+extern __GNU_INLINE hrtime_t
+__rdtsc_insn(void)
 {
 #if defined(__amd64)
 	uint32_t lobits, hibits;
--- a/usr/src/uts/intel/asm/cpu.h	Mon Mar 05 13:42:51 2012 +0300
+++ b/usr/src/uts/intel/asm/cpu.h	Sun May 15 21:34:10 2011 +0100
@@ -26,6 +26,8 @@
 #ifndef _ASM_CPU_H
 #define	_ASM_CPU_H
 
+#include <sys/ccompile.h>
+
 #ifdef	__cplusplus
 extern "C" {
 #endif
@@ -34,7 +36,7 @@
 
 #if defined(__i386) || defined(__amd64)
 
-extern __inline__ void
+extern __GNU_INLINE void
 ht_pause(void)
 {
 	__asm__ __volatile__(
@@ -48,7 +50,7 @@
  * older 32-bit processors, so define this as a no-op for now
  */
 
-extern __inline__ void
+extern __GNU_INLINE void
 prefetch_read_many(void *addr)
 {
 #if defined(__amd64)
@@ -60,8 +62,8 @@
 #endif	/* __amd64 */
 }
 
-extern __inline__ void
-prefetch_read_once(void *addr)
+extern __GNU_INLINE void
+refetch_read_once(void *addr)
 {
 #if defined(__amd64)
 	__asm__(
@@ -72,7 +74,7 @@
 #endif	/* __amd64 */
 }
 
-extern __inline__ void
+extern __GNU_INLINE void
 prefetch_write_many(void *addr)
 {
 #if defined(__amd64)
@@ -84,7 +86,7 @@
 #endif	/* __amd64 */
 }
 
-extern __inline__ void
+extern __GNU_INLINE void
 prefetch_write_once(void *addr)
 {
 #if defined(__amd64)
@@ -98,21 +100,21 @@
 
 #if !defined(__xpv)
 
-extern __inline__ void
+extern __GNU_INLINE void
 cli(void)
 {
 	__asm__ __volatile__(
 	    "cli" : : : "memory");
 }
 
-extern __inline__ void
+extern __GNU_INLINE void
 sti(void)
 {
 	__asm__ __volatile__(
 	    "sti");
 }
 
-extern __inline__ void
+extern __GNU_INLINE void
 i86_halt(void)
 {
 	__asm__ __volatile__(
@@ -125,7 +127,7 @@
 
 #if defined(__amd64)
 
-extern __inline__ void
+extern __GNU_INLINE void
 __set_ds(selector_t value)
 {
 	__asm__ __volatile__(
@@ -134,7 +136,7 @@
 	    : "r" (value));
 }
 
-extern __inline__ void
+extern __GNU_INLINE void
 __set_es(selector_t value)
 {
 	__asm__ __volatile__(
@@ -143,7 +145,7 @@
 	    : "r" (value));
 }
 
-extern __inline__ void
+extern __GNU_INLINE void
 __set_fs(selector_t value)
 {
 	__asm__ __volatile__(
@@ -152,7 +154,7 @@
 	    : "r" (value));
 }
 
-extern __inline__ void
+extern __GNU_INLINE void
 __set_gs(selector_t value)
 {
 	__asm__ __volatile__(
@@ -163,7 +165,7 @@
 
 #if !defined(__xpv)
 
-extern __inline__ void
+extern __GNU_INLINE void
 __swapgs(void)
 {
 	__asm__ __volatile__(
--- a/usr/src/uts/intel/asm/cpuvar.h	Mon Mar 05 13:42:51 2012 +0300
+++ b/usr/src/uts/intel/asm/cpuvar.h	Sun May 15 21:34:10 2011 +0100
@@ -27,8 +27,7 @@
 #ifndef _ASM_CPUVAR_H
 #define	_ASM_CPUVAR_H
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
+#include <sys/ccompile.h>
 #include <sys/types.h>
 
 #ifdef	__cplusplus
@@ -39,7 +38,8 @@
 
 struct cpu;
 
-extern __inline__ struct cpu *curcpup(void)
+extern __GNU_INLINE struct cpu *
+curcpup(void)
 {
 	struct cpu *__value;
 
--- a/usr/src/uts/intel/asm/htable.h	Mon Mar 05 13:42:51 2012 +0300
+++ b/usr/src/uts/intel/asm/htable.h	Sun May 15 21:34:10 2011 +0100
@@ -27,8 +27,7 @@
 #ifndef _ASM_HTABLE_H
 #define	_ASM_HTABLE_H
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
+#include <sys/ccompile.h>
 #include <sys/types.h>
 
 #ifdef	__cplusplus
@@ -44,7 +43,8 @@
  * for some ia32 hat layer operations.
  */
 
-extern __inline__ void atomic_orb(uint8_t *addr, uint8_t value)
+extern __GNU_INLINE void
+atomic_orb(uint8_t *addr, uint8_t value)
 {
 	__asm__ __volatile__(
 	    "lock; orb %%dl,%0"
@@ -53,7 +53,8 @@
 	    : "cc");
 }
 
-extern __inline__ void atomic_andb(uint8_t *addr, uint8_t value)
+extern __GNU_INLINE void
+atomic_andb(uint8_t *addr, uint8_t value)
 {
 	__asm__ __volatile__(
 	    "lock; andb %%dl,%0"
@@ -62,7 +63,8 @@
 	    : "cc");
 }
 
-extern __inline__ void atomic_inc16(uint16_t *addr)
+extern __GNU_INLINE void
+atomic_inc16(uint16_t *addr)
 {
 	__asm__ __volatile__(
 	    "lock; incw %0"
@@ -71,7 +73,8 @@
 	    : "cc");
 }
 
-extern __inline__ void atomic_dec16(uint16_t *addr)
+extern __GNU_INLINE void
+atomic_dec16(uint16_t *addr)
 {
 	__asm__ __volatile__(
 	    "lock; decw %0"
@@ -80,7 +83,8 @@
 	    : "cc");
 }
 
-extern __inline__ void mmu_tlbflush_entry(caddr_t addr)
+extern __GNU_INLINE void
+mmu_tlbflush_entry(caddr_t addr)
 {
 	__asm__ __volatile__(
 	    "invlpg %0"
--- a/usr/src/uts/intel/asm/mmu.h	Mon Mar 05 13:42:51 2012 +0300
+++ b/usr/src/uts/intel/asm/mmu.h	Sun May 15 21:34:10 2011 +0100
@@ -26,8 +26,7 @@
 #ifndef _ASM_MMU_H
 #define	_ASM_MMU_H
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
+#include <sys/ccompile.h>
 #include <sys/types.h>
 
 #ifdef	__cplusplus
@@ -38,7 +37,8 @@
 
 #if defined(__amd64)
 
-extern __inline__ ulong_t getcr3(void)
+extern __GNU_INLINE ulong_t
+getcr3(void)
 {
 	uint64_t value;
 
@@ -48,7 +48,8 @@
 	return (value);
 }
 
-extern __inline__ void setcr3(ulong_t value)
+extern __GNU_INLINE void
+setcr3(ulong_t value)
 {
 	__asm__ __volatile__(
 	    "movq %0, %%cr3"
@@ -56,14 +57,16 @@
 	    : "r" (value));
 }
 
-extern __inline__ void reload_cr3(void)
+extern __GNU_INLINE void
+reload_cr3(void)
 {
 	setcr3(getcr3());
 }
 
 #elif defined(__i386)
 
-extern __inline__ ulong_t getcr3(void)
+extern __GNU_INLINE ulong_t
+getcr3(void)
 {
 	uint32_t value;
 
@@ -73,7 +76,8 @@
 	return (value);
 }
 
-extern __inline__ void setcr3(ulong_t value)
+extern __GNU_INLINE void
+setcr3(ulong_t value)
 {
 	__asm__ __volatile__(
 	    "movl %0, %%cr3"
@@ -81,7 +85,8 @@
 	    : "r" (value));
 }
 
-extern __inline__ void reload_cr3(void)
+extern __GNU_INLINE void
+reload_cr3(void)
 {
 	setcr3(getcr3());
 }
--- a/usr/src/uts/intel/asm/sunddi.h	Mon Mar 05 13:42:51 2012 +0300
+++ b/usr/src/uts/intel/asm/sunddi.h	Sun May 15 21:34:10 2011 +0100
@@ -27,8 +27,7 @@
 #ifndef _ASM_SUNDDI_H
 #define	_ASM_SUNDDI_H
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
+#include <sys/ccompile.h>
 #include <sys/types.h>
 
 #ifdef	__cplusplus
@@ -39,75 +38,82 @@
 
 #if defined(__i386) || defined(__amd64)
 
-extern __inline__ uint8_t inb(int port)
+extern __GNU_INLINE uint8_t
+inb(int port)
 {
 	uint16_t port16 = (uint16_t)port;
 	uint8_t value;
 
 	__asm__ __volatile__(
-		"inb (%1)"		/* value in %al */
-		: "=a" (value)
-		: "d" (port16));
+	    "inb (%1)"		/* value in %al */
+	    : "=a" (value)
+	    : "d" (port16));
 	return (value);
 }
 
-extern __inline__ uint16_t inw(int port)
+extern __GNU_INLINE uint16_t
+inw(int port)
 {
 	uint16_t port16 = (uint16_t)port;
 	uint16_t value;
 
 	__asm__ __volatile__(
-		"inw (%1)"		/* value in %ax */
-		: "=a" (value)
-		: "d" (port16));
+	    "inw (%1)"		/* value in %ax */
+	    : "=a" (value)
+	    : "d" (port16));
 	return (value);
 }
 
-extern __inline__ uint32_t inl(int port)
+extern __GNU_INLINE uint32_t
+inl(int port)
 {
 	uint16_t port16 = (uint16_t)port;
 	uint32_t value;
 
 	__asm__ __volatile__(
-		"inl (%1)"		/* value in %eax */
-		: "=a" (value)
-		: "d" (port16));
+	    "inl (%1)"		/* value in %eax */
+	    : "=a" (value)
+	    : "d" (port16));
 	return (value);
 }
 
-extern __inline__ void outb(int port, uint8_t value)
+extern __GNU_INLINE void
+outb(int port, uint8_t value)
 {
 	uint16_t port16 = (uint16_t)port;
 
 	__asm__ __volatile__(
-		"outb (%1)"
-		: /* no output */
-		: "a" (value), "d" (port16));
+	    "outb (%1)"
+	    : /* no output */
+	    : "a" (value), "d" (port16));
 }
 
-extern __inline__ void outw(int port, uint16_t value)
+extern __GNU_INLINE void
+outw(int port, uint16_t value)
 {
 	uint16_t port16 = (uint16_t)port;
 
 	__asm__ __volatile__(
-		"outw (%1)"
-		: /* no output */
-		: "a" (value), "d" (port16));
+	    "outw (%1)"
+	    : /* no output */
+	    : "a" (value), "d" (port16));
 }
 
-extern __inline__ void outl(int port, uint32_t value)
+extern __GNU_INLINE void
+outl(int port, uint32_t value)
 {
 	uint16_t port16 = (uint16_t)port;
 
 	__asm__ __volatile__(
-		"outl (%1)"
-		: /* no output */
-		: "a" (value), "d" (port16));
+	    "outl (%1)"
+	    : /* no output */
+	    : "a" (value), "d" (port16));
 }
 
 #if defined(_BOOT)
 
-extern __inline__ void sync_instruction_memory(caddr_t v, size_t len)
+extern __GNU_INLINE void
+sync_instruction_memory(caddr_t v, size_t len)
 {
 	__asm__ __volatile__("nop");
 }
--- a/usr/src/uts/intel/asm/thread.h	Mon Mar 05 13:42:51 2012 +0300
+++ b/usr/src/uts/intel/asm/thread.h	Sun May 15 21:34:10 2011 +0100
@@ -27,8 +27,7 @@
 #ifndef _ASM_THREAD_H
 #define	_ASM_THREAD_H
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
+#include <sys/ccompile.h>
 #include <sys/types.h>
 
 #ifdef	__cplusplus
@@ -46,7 +45,8 @@
  * Yuck.
  */
 
-extern __inline__ struct _kthread *threadp(void)
+extern __GNU_INLINE struct _kthread
+*threadp(void)
 {
 	void *__value;
 
--- a/usr/src/uts/sparc/asm/cpu.h	Mon Mar 05 13:42:51 2012 +0300
+++ b/usr/src/uts/sparc/asm/cpu.h	Sun May 15 21:34:10 2011 +0100
@@ -27,6 +27,7 @@
 #ifndef _ASM_CPU_H
 #define	_ASM_CPU_H
 
+#include <sys/ccompile.h>
 #include <sys/types.h>
 
 #ifdef	__cplusplus
@@ -35,7 +36,7 @@
 
 #if !defined(__lint) && defined(__GNUC__)
 
-extern __inline__ void
+extern __GNU_INLINE void
 prefetch_read_many(void *addr)
 {
 #if defined(__sparcv9)
@@ -48,7 +49,7 @@
 #endif
 }
 
-extern __inline__ void
+extern __GNU_INLINE void
 prefetch_read_once(void *addr)
 {
 #if defined(__sparcv9)
@@ -61,7 +62,7 @@
 #endif
 }
 
-extern __inline__ void
+extern __GNU_INLINE void
 prefetch_write_many(void *addr)
 {
 #if defined(__sparcv9)
@@ -74,7 +75,7 @@
 #endif
 }
 
-extern __inline__ void
+extern __GNU_INLINE void
 prefetch_write_once(void *addr)
 {
 #if defined(__sparcv9)
--- a/usr/src/uts/sparc/asm/flush.h	Mon Mar 05 13:42:51 2012 +0300
+++ b/usr/src/uts/sparc/asm/flush.h	Sun May 15 21:34:10 2011 +0100
@@ -27,6 +27,7 @@
 #ifndef _ASM_FLUSH_H
 #define	_ASM_FLUSH_H
 
+#include <sys/ccompile.h>
 #include <sys/types.h>
 
 #ifdef	__cplusplus
@@ -35,7 +36,7 @@
 
 #if !defined(__lint) && defined(__GNUC__)
 
-extern __inline__ void
+extern __GNU_INLINE void
 doflush(void *addr)
 {
 #if defined(__sparcv9)
--- a/usr/src/uts/sparc/asm/sunddi.h	Mon Mar 05 13:42:51 2012 +0300
+++ b/usr/src/uts/sparc/asm/sunddi.h	Sun May 15 21:34:10 2011 +0100
@@ -27,8 +27,7 @@
 #ifndef _ASM_SUNDDI_H
 #define	_ASM_SUNDDI_H
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
+#include <sys/ccompile.h>
 #include <sys/types.h>
 
 #ifdef	__cplusplus
@@ -39,7 +38,7 @@
 
 #if defined(_BOOT)
 
-extern __inline__ void
+extern __GNU_INLINE void
 sync_instruction_memory(caddr_t v, size_t len)
 {
 	__asm__ __volatile__("nop");
--- a/usr/src/uts/sparc/asm/thread.h	Mon Mar 05 13:42:51 2012 +0300
+++ b/usr/src/uts/sparc/asm/thread.h	Sun May 15 21:34:10 2011 +0100
@@ -27,8 +27,7 @@
 #ifndef _ASM_THREAD_H
 #define	_ASM_THREAD_H
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
+#include <sys/ccompile.h>
 #include <sys/types.h>
 
 #ifdef	__cplusplus
@@ -39,7 +38,7 @@
 
 struct _kthread;
 
-extern __inline__ struct _kthread *
+extern __GNU_INLINE struct _kthread *
 threadp(void)
 {
 	void *__value;
@@ -55,7 +54,7 @@
 	return (__value);
 }
 
-extern __inline__ caddr_t
+extern __GNU_INLINE caddr_t
 caller(void)
 {
 	caddr_t __value;
@@ -70,7 +69,7 @@
 	return (__value);
 }
 
-extern __inline__ caddr_t
+extern __GNU_INLINE caddr_t
 callee(void)
 {
 	caddr_t __value;