summaryrefslogtreecommitdiffstats
path: root/sys/i386/include
diff options
context:
space:
mode:
Diffstat (limited to 'sys/i386/include')
-rw-r--r--sys/i386/include/_types.h8
-rw-r--r--sys/i386/include/atomic.h22
-rw-r--r--sys/i386/include/bus_at386.h114
-rw-r--r--sys/i386/include/cpufunc.h6
-rw-r--r--sys/i386/include/critical.h6
-rw-r--r--sys/i386/include/endian.h24
-rw-r--r--sys/i386/include/ieeefp.h4
-rw-r--r--sys/i386/include/in_cksum.h10
-rw-r--r--sys/i386/include/ioctl_bt848.h2
-rw-r--r--sys/i386/include/ioctl_meteor.h2
-rw-r--r--sys/i386/include/pcpu.h2
-rw-r--r--sys/i386/include/profile.h8
-rw-r--r--sys/i386/include/stdarg.h11
13 files changed, 161 insertions, 58 deletions
diff --git a/sys/i386/include/_types.h b/sys/i386/include/_types.h
index 93c2a36..69f439d 100644
--- a/sys/i386/include/_types.h
+++ b/sys/i386/include/_types.h
@@ -54,7 +54,7 @@ typedef unsigned int __uint32_t;
typedef long long __int64_t;
/* LONGLONG */
typedef unsigned long long __uint64_t;
-#elif defined(__GNUC__)
+#elif defined(__GNUC__) || defined(__INTEL_COMPILER)
typedef int __attribute__((__mode__(__DI__))) __int64_t;
typedef unsigned int __attribute__((__mode__(__DI__))) __uint64_t;
#else
@@ -113,12 +113,12 @@ typedef __uint32_t __vm_size_t;
/*
* Unusual type definitions.
*/
-#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3)
+#if (defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3) && !defined(__INTEL_COMPILER))
typedef __builtin_va_list __va_list; /* internally known to gcc */
#else
typedef char * __va_list;
-#endif /* post GCC 2.95 */
-#if defined __GNUC__ && !defined(__GNUC_VA_LIST) && !defined(__NO_GNUC_VA_LIST)
+#endif /* ! (__GNUC__ post 2.95 || __INTEL_COMPILER) */
+#if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__GNUC_VA_LIST) && !defined(__NO_GNUC_VA_LIST)
#define __GNUC_VA_LIST
typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/
#endif
diff --git a/sys/i386/include/atomic.h b/sys/i386/include/atomic.h
index c05befa..feba606 100644
--- a/sys/i386/include/atomic.h
+++ b/sys/i386/include/atomic.h
@@ -75,7 +75,7 @@ void atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_##TYPE v)
#else /* !KLD_MODULE */
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
/*
* For userland, assume the SMP case and use lock prefixes so that
@@ -101,12 +101,12 @@ atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v)\
} \
struct __hack
-#else /* !__GNUC__ */
+#else /* !(__GNUC__ || __INTEL_COMPILER) */
#define ATOMIC_ASM(NAME, TYPE, OP, CONS, V) \
extern void atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v)
-#endif /* __GNUC__ */
+#endif /* __GNUC__ || __INTEL_COMPILER */
/*
* Atomic compare and set, used by the mutex functions
@@ -116,7 +116,7 @@ extern void atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v)
* Returns 0 on failure, non-zero on success
*/
-#if defined(__GNUC__)
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
#if defined(I386_CPU) || defined(CPU_DISABLE_CMPXCHG)
@@ -168,9 +168,9 @@ atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src)
#endif /* defined(I386_CPU) */
-#endif /* defined(__GNUC__) */
+#endif /* defined(__GNUC__) || defined(__INTEL_COMPILER) */
-#if defined(__GNUC__)
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
#if defined(I386_CPU)
@@ -226,7 +226,7 @@ struct __hack
#endif /* defined(I386_CPU) */
-#else /* !defined(__GNUC__) */
+#else /* !(defined(__GNUC__) || defined(__INTEL_COMPILER)) */
extern int atomic_cmpset_int(volatile u_int *, u_int, u_int);
@@ -234,7 +234,7 @@ extern int atomic_cmpset_int(volatile u_int *, u_int, u_int);
extern u_##TYPE atomic_load_acq_##TYPE(volatile u_##TYPE *p); \
extern void atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_##TYPE v)
-#endif /* defined(__GNUC__) */
+#endif /* defined(__GNUC__) || defined(__INTEL_COMPILER) */
#endif /* KLD_MODULE */
@@ -410,7 +410,7 @@ ATOMIC_PTR(subtract)
#undef ATOMIC_PTR
-#if defined(__GNUC__)
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
static __inline u_int
atomic_readandclear_int(volatile u_int *addr)
@@ -442,12 +442,12 @@ atomic_readandclear_long(volatile u_long *addr)
return (result);
}
-#else /* !defined(__GNUC__) */
+#else /* !(defined(__GNUC__) || defined(__INTEL_COMPILER)) */
extern u_long atomic_readandclear_long(volatile u_long *);
extern u_int atomic_readandclear_int(volatile u_int *);
-#endif /* defined(__GNUC__) */
+#endif /* defined(__GNUC__) || defined(__INTEL_COMPILER) */
#endif /* !defined(WANT_FUNCTIONS) */
#endif /* ! _MACHINE_ATOMIC_H_ */
diff --git a/sys/i386/include/bus_at386.h b/sys/i386/include/bus_at386.h
index 277badd..38c71ba 100644
--- a/sys/i386/include/bus_at386.h
+++ b/sys/i386/include/bus_at386.h
@@ -292,7 +292,7 @@ bus_space_read_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh,
else
#endif
{
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
__asm __volatile(" \n\
cld \n\
1: movb (%2),%%al \n\
@@ -301,6 +301,10 @@ bus_space_read_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh,
"=D" (addr), "=c" (count) :
"r" (bsh + offset), "0" (addr), "1" (count) :
"%eax", "memory");
+#else
+# ifndef lint
+# error "no assembler code for your compiler"
+# endif
#endif
}
#endif
@@ -321,7 +325,7 @@ bus_space_read_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh,
else
#endif
{
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
__asm __volatile(" \n\
cld \n\
1: movw (%2),%%ax \n\
@@ -330,6 +334,10 @@ bus_space_read_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh,
"=D" (addr), "=c" (count) :
"r" (bsh + offset), "0" (addr), "1" (count) :
"%eax", "memory");
+#else
+# ifndef lint
+# error "no assembler code for your compiler"
+# endif
#endif
}
#endif
@@ -350,7 +358,7 @@ bus_space_read_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh,
else
#endif
{
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
__asm __volatile(" \n\
cld \n\
1: movl (%2),%%eax \n\
@@ -359,6 +367,10 @@ bus_space_read_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh,
"=D" (addr), "=c" (count) :
"r" (bsh + offset), "0" (addr), "1" (count) :
"%eax", "memory");
+#else
+# ifndef lint
+# error "no assembler code for your compiler"
+# endif
#endif
}
#endif
@@ -399,7 +411,7 @@ bus_space_read_region_1(bus_space_tag_t tag, bus_space_handle_t bsh,
#endif
{
int _port_ = bsh + offset;
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
__asm __volatile(" \n\
cld \n\
1: inb %w2,%%al \n\
@@ -409,6 +421,10 @@ bus_space_read_region_1(bus_space_tag_t tag, bus_space_handle_t bsh,
"=D" (addr), "=c" (count), "=d" (_port_) :
"0" (addr), "1" (count), "2" (_port_) :
"%eax", "memory", "cc");
+#else
+# ifndef lint
+# error "no assembler code for your compiler"
+# endif
#endif
}
#endif
@@ -418,7 +434,7 @@ bus_space_read_region_1(bus_space_tag_t tag, bus_space_handle_t bsh,
#endif
{
int _port_ = bsh + offset;
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
__asm __volatile(" \n\
cld \n\
repne \n\
@@ -426,6 +442,10 @@ bus_space_read_region_1(bus_space_tag_t tag, bus_space_handle_t bsh,
"=D" (addr), "=c" (count), "=S" (_port_) :
"0" (addr), "1" (count), "2" (_port_) :
"memory", "cc");
+#else
+# ifndef lint
+# error "no assembler code for your compiler"
+# endif
#endif
}
#endif
@@ -441,7 +461,7 @@ bus_space_read_region_2(bus_space_tag_t tag, bus_space_handle_t bsh,
#endif
{
int _port_ = bsh + offset;
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
__asm __volatile(" \n\
cld \n\
1: inw %w2,%%ax \n\
@@ -451,6 +471,10 @@ bus_space_read_region_2(bus_space_tag_t tag, bus_space_handle_t bsh,
"=D" (addr), "=c" (count), "=d" (_port_) :
"0" (addr), "1" (count), "2" (_port_) :
"%eax", "memory", "cc");
+#else
+# ifndef lint
+# error "no assembler code for your compiler"
+# endif
#endif
}
#endif
@@ -460,7 +484,7 @@ bus_space_read_region_2(bus_space_tag_t tag, bus_space_handle_t bsh,
#endif
{
int _port_ = bsh + offset;
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
__asm __volatile(" \n\
cld \n\
repne \n\
@@ -468,6 +492,10 @@ bus_space_read_region_2(bus_space_tag_t tag, bus_space_handle_t bsh,
"=D" (addr), "=c" (count), "=S" (_port_) :
"0" (addr), "1" (count), "2" (_port_) :
"memory", "cc");
+#else
+# ifndef lint
+# error "no assembler code for your compiler"
+# endif
#endif
}
#endif
@@ -483,7 +511,7 @@ bus_space_read_region_4(bus_space_tag_t tag, bus_space_handle_t bsh,
#endif
{
int _port_ = bsh + offset;
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
__asm __volatile(" \n\
cld \n\
1: inl %w2,%%eax \n\
@@ -493,6 +521,10 @@ bus_space_read_region_4(bus_space_tag_t tag, bus_space_handle_t bsh,
"=D" (addr), "=c" (count), "=d" (_port_) :
"0" (addr), "1" (count), "2" (_port_) :
"%eax", "memory", "cc");
+#else
+# ifndef lint
+# error "no assembler code for your compiler"
+# endif
#endif
}
#endif
@@ -502,7 +534,7 @@ bus_space_read_region_4(bus_space_tag_t tag, bus_space_handle_t bsh,
#endif
{
int _port_ = bsh + offset;
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
__asm __volatile(" \n\
cld \n\
repne \n\
@@ -510,6 +542,10 @@ bus_space_read_region_4(bus_space_tag_t tag, bus_space_handle_t bsh,
"=D" (addr), "=c" (count), "=S" (_port_) :
"0" (addr), "1" (count), "2" (_port_) :
"memory", "cc");
+#else
+# ifndef lint
+# error "no assembler code for your compiler"
+# endif
#endif
}
#endif
@@ -631,7 +667,7 @@ bus_space_write_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh,
else
#endif
{
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
__asm __volatile(" \n\
cld \n\
1: lodsb \n\
@@ -640,6 +676,10 @@ bus_space_write_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh,
"=S" (addr), "=c" (count) :
"r" (bsh + offset), "0" (addr), "1" (count) :
"%eax", "memory", "cc");
+#else
+# ifndef lint
+# error "no assembler code for your compiler"
+# endif
#endif
}
#endif
@@ -660,7 +700,7 @@ bus_space_write_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh,
else
#endif
{
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
__asm __volatile(" \n\
cld \n\
1: lodsw \n\
@@ -669,6 +709,10 @@ bus_space_write_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh,
"=S" (addr), "=c" (count) :
"r" (bsh + offset), "0" (addr), "1" (count) :
"%eax", "memory", "cc");
+#else
+# ifndef lint
+# error "no assembler code for your compiler"
+# endif
#endif
}
#endif
@@ -689,7 +733,7 @@ bus_space_write_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh,
else
#endif
{
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
__asm __volatile(" \n\
cld \n\
1: lodsl \n\
@@ -698,6 +742,10 @@ bus_space_write_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh,
"=S" (addr), "=c" (count) :
"r" (bsh + offset), "0" (addr), "1" (count) :
"%eax", "memory", "cc");
+#else
+# ifndef lint
+# error "no assembler code for your compiler"
+# endif
#endif
}
#endif
@@ -739,7 +787,7 @@ bus_space_write_region_1(bus_space_tag_t tag, bus_space_handle_t bsh,
#endif
{
int _port_ = bsh + offset;
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
__asm __volatile(" \n\
cld \n\
1: lodsb \n\
@@ -749,6 +797,10 @@ bus_space_write_region_1(bus_space_tag_t tag, bus_space_handle_t bsh,
"=d" (_port_), "=S" (addr), "=c" (count) :
"0" (_port_), "1" (addr), "2" (count) :
"%eax", "memory", "cc");
+#else
+# ifndef lint
+# error "no assembler code for your compiler"
+# endif
#endif
}
#endif
@@ -758,7 +810,7 @@ bus_space_write_region_1(bus_space_tag_t tag, bus_space_handle_t bsh,
#endif
{
int _port_ = bsh + offset;
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
__asm __volatile(" \n\
cld \n\
repne \n\
@@ -766,6 +818,10 @@ bus_space_write_region_1(bus_space_tag_t tag, bus_space_handle_t bsh,
"=D" (_port_), "=S" (addr), "=c" (count) :
"0" (_port_), "1" (addr), "2" (count) :
"memory", "cc");
+#else
+# ifndef lint
+# error "no assembler code for your compiler"
+# endif
#endif
}
#endif
@@ -781,7 +837,7 @@ bus_space_write_region_2(bus_space_tag_t tag, bus_space_handle_t bsh,
#endif
{
int _port_ = bsh + offset;
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
__asm __volatile(" \n\
cld \n\
1: lodsw \n\
@@ -791,6 +847,10 @@ bus_space_write_region_2(bus_space_tag_t tag, bus_space_handle_t bsh,
"=d" (_port_), "=S" (addr), "=c" (count) :
"0" (_port_), "1" (addr), "2" (count) :
"%eax", "memory", "cc");
+#else
+# ifndef lint
+# error "no assembler code for your compiler"
+# endif
#endif
}
#endif
@@ -800,7 +860,7 @@ bus_space_write_region_2(bus_space_tag_t tag, bus_space_handle_t bsh,
#endif
{
int _port_ = bsh + offset;
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
__asm __volatile(" \n\
cld \n\
repne \n\
@@ -808,6 +868,10 @@ bus_space_write_region_2(bus_space_tag_t tag, bus_space_handle_t bsh,
"=D" (_port_), "=S" (addr), "=c" (count) :
"0" (_port_), "1" (addr), "2" (count) :
"memory", "cc");
+#else
+# ifndef lint
+# error "no assembler code for your compiler"
+# endif
#endif
}
#endif
@@ -823,7 +887,7 @@ bus_space_write_region_4(bus_space_tag_t tag, bus_space_handle_t bsh,
#endif
{
int _port_ = bsh + offset;
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
__asm __volatile(" \n\
cld \n\
1: lodsl \n\
@@ -833,6 +897,10 @@ bus_space_write_region_4(bus_space_tag_t tag, bus_space_handle_t bsh,
"=d" (_port_), "=S" (addr), "=c" (count) :
"0" (_port_), "1" (addr), "2" (count) :
"%eax", "memory", "cc");
+#else
+# ifndef lint
+# error "no assembler code for your compiler"
+# endif
#endif
}
#endif
@@ -842,7 +910,7 @@ bus_space_write_region_4(bus_space_tag_t tag, bus_space_handle_t bsh,
#endif
{
int _port_ = bsh + offset;
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
__asm __volatile(" \n\
cld \n\
repne \n\
@@ -850,6 +918,10 @@ bus_space_write_region_4(bus_space_tag_t tag, bus_space_handle_t bsh,
"=D" (_port_), "=S" (addr), "=c" (count) :
"0" (_port_), "1" (addr), "2" (count) :
"memory", "cc");
+#else
+# ifndef lint
+# error "no assembler code for your compiler"
+# endif
#endif
}
#endif
@@ -1221,11 +1293,15 @@ static __inline void
bus_space_barrier(bus_space_tag_t tag __unused, bus_space_handle_t bsh __unused,
bus_size_t offset __unused, bus_size_t len __unused, int flags)
{
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
if (flags & BUS_SPACE_BARRIER_READ)
__asm __volatile("lock; addl $0,0(%%esp)" : : : "memory");
else
__asm __volatile("" : : : "memory");
+#else
+# ifndef lint
+# error "no assembler code for your compiler"
+# endif
#endif
}
diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h
index 6d00fff..5b092f0 100644
--- a/sys/i386/include/cpufunc.h
+++ b/sys/i386/include/cpufunc.h
@@ -52,7 +52,7 @@ struct region_descriptor;
#define writew(va, d) (*(volatile u_int16_t *) (va) = (d))
#define writel(va, d) (*(volatile u_int32_t *) (va) = (d))
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
static __inline void
breakpoint(void)
@@ -614,7 +614,7 @@ intr_restore(register_t eflags)
write_eflags(eflags);
}
-#else /* !__GNUC__ */
+#else /* !(__GNUC__ || __INTEL_COMPILER) */
int breakpoint(void);
u_int bsfl(u_int mask);
@@ -679,7 +679,7 @@ void wbinvd(void);
void write_eflags(u_int ef);
void wrmsr(u_int msr, u_int64_t newval);
-#endif /* __GNUC__ */
+#endif /* __GNUC__ || __INTEL_COMPILER */
void reset_dbregs(void);
diff --git a/sys/i386/include/critical.h b/sys/i386/include/critical.h
index 17f75eb..8ddc7ef 100644
--- a/sys/i386/include/critical.h
+++ b/sys/i386/include/critical.h
@@ -46,7 +46,7 @@ __BEGIN_DECLS
*/
void cpu_critical_fork_exit(void);
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
/*
* cpu_critical_enter:
@@ -81,12 +81,12 @@ cpu_critical_exit(void)
intr_restore(curthread->td_md.md_savecrit);
}
-#else /* !__GNUC__ */
+#else /* !(__GNUC__ || __INTEL_COMPILER) */
void cpu_critical_enter(void);
void cpu_critical_exit(void);
-#endif /* __GNUC__ */
+#endif /* __GNUC__ || __INTEL_COMPILER */
__END_DECLS
diff --git a/sys/i386/include/endian.h b/sys/i386/include/endian.h
index dc924b1..1bdea69 100644
--- a/sys/i386/include/endian.h
+++ b/sys/i386/include/endian.h
@@ -40,6 +40,10 @@
#include <sys/cdefs.h>
#include <sys/_types.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Define the order of 32-bit words in 64-bit words.
*/
@@ -67,7 +71,17 @@
#define BYTE_ORDER _BYTE_ORDER
#endif
-#ifdef __GNUC__
+#if defined(__INTEL_COMPILER)
+#if defined(__cplusplus)
+#if __INTEL_COMPILER >= 800
+#define __INTEL_COMPILER_with_FreeBSD_endian 1
+#endif
+#else
+#define __INTEL_COMPILER_with_FreeBSD_endian 1
+#endif
+#endif
+
+#if defined(__GNUC__) || defined(__INTEL_COMPILER_with_FreeBSD_endian)
#define __word_swap_int_var(x) \
__extension__ ({ register __uint32_t __X = (x); \
@@ -168,7 +182,7 @@ __bswap16(__uint16_t _x)
#define __ntohl(x) __bswap32(x)
#define __ntohs(x) __bswap16(x)
-#else /* !__GNUC__ */
+#else /* !(__GNUC__ || __INTEL_COMPILER_with_FreeBSD_endian) */
/*
* No optimizations are available for this compiler. Fall back to
@@ -177,6 +191,10 @@ __bswap16(__uint16_t _x)
*/
#define _BYTEORDER_FUNC_DEFINED
-#endif /* __GNUC__ */
+#endif /* __GNUC__ || __INTEL_COMPILER_with_FreeBSD_endian */
+
+#ifdef __cplusplus
+}
+#endif
#endif /* !_MACHINE_ENDIAN_H_ */
diff --git a/sys/i386/include/ieeefp.h b/sys/i386/include/ieeefp.h
index ac67be1..48011f71 100644
--- a/sys/i386/include/ieeefp.h
+++ b/sys/i386/include/ieeefp.h
@@ -98,7 +98,7 @@ typedef enum {
#define FP_RND_OFF 10 /* round control offset */
#define FP_STKY_OFF 0 /* sticky flags offset */
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
#define __fldenv(addr) __asm __volatile("fldenv %0" : : "m" (*(addr)))
#define __fnstenv(addr) __asm __volatile("fnstenv %0" : "=m" (*(addr)))
@@ -151,7 +151,7 @@ __fpsetreg(int _m, int _reg, int _fld, int _off)
return _p;
}
-#endif /* __GNUC__ */
+#endif /* __GNUC__ || __INTEL_COMPILER */
/*
* SysV/386 FP control interface
diff --git a/sys/i386/include/in_cksum.h b/sys/i386/include/in_cksum.h
index b1cb3f8..69eb509 100644
--- a/sys/i386/include/in_cksum.h
+++ b/sys/i386/include/in_cksum.h
@@ -53,7 +53,7 @@
* in the normal case (where there are no options and the header length is
* therefore always exactly five 32-bit words.
*/
-#ifdef __GNUC__
+#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
static __inline u_int
in_cksum_hdr(const struct ip *ip)
{
@@ -115,7 +115,6 @@ in_pseudo(u_int sum, u_int b, u_int c)
}
#else
-u_int in_cksum_hdr(const struct ip *);
#define in_cksum_update(ip) \
do { \
int __tmpsum; \
@@ -126,7 +125,12 @@ u_int in_cksum_hdr(const struct ip *);
#endif
#ifdef _KERNEL
-u_short in_cksum_skip(struct mbuf *m, int len, int skip);
+#if !defined(__GNUC__) || defined(__INTEL_COMPILER)
+u_int in_cksum_hdr(const struct ip *ip);
+u_short in_addword(u_short sum, u_short b);
+u_short in_pseudo(u_int sum, u_int b, u_int c);
+#endif
+u_short in_cksum_skip(struct mbuf *m, int len, int skip);
#endif /* _KERNEL */
#endif /* _MACHINE_IN_CKSUM_H_ */
diff --git a/sys/i386/include/ioctl_bt848.h b/sys/i386/include/ioctl_bt848.h
index 7ef237b..c87c4b9 100644
--- a/sys/i386/include/ioctl_bt848.h
+++ b/sys/i386/include/ioctl_bt848.h
@@ -29,7 +29,7 @@
#ifndef _MACHINE_IOCTL_BT848_H_
#define _MACHINE_IOCTL_BT848_H_
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
#warning Include dev/bktr/ioctl_bt848.h instead of this header.
#endif
diff --git a/sys/i386/include/ioctl_meteor.h b/sys/i386/include/ioctl_meteor.h
index 69d033e..c9595de 100644
--- a/sys/i386/include/ioctl_meteor.h
+++ b/sys/i386/include/ioctl_meteor.h
@@ -29,7 +29,7 @@
#ifndef _MACHINE_IOCTL_METEOR_H_
#define _MACHINE_IOCTL_METEOR_H_
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
#warning Include dev/bktr/ioctl_meteor.h instead of this header.
#endif
diff --git a/sys/i386/include/pcpu.h b/sys/i386/include/pcpu.h
index 357f52e..6552ea9 100644
--- a/sys/i386/include/pcpu.h
+++ b/sys/i386/include/pcpu.h
@@ -59,7 +59,7 @@ extern struct pcpu *pcpup;
#define PCPU_PTR(member) (&pcpup->pc_ ## member)
#define PCPU_SET(member,value) (pcpup->pc_ ## member = (value))
-#elif defined(__GNUC__)
+#elif defined(__GNUC__) || defined (__INTEL_COMPILER)
/*
* Evaluates to the byte offset of the per-cpu variable name.
diff --git a/sys/i386/include/profile.h b/sys/i386/include/profile.h
index 4af8184..ecad115 100644
--- a/sys/i386/include/profile.h
+++ b/sys/i386/include/profile.h
@@ -82,7 +82,7 @@ extern int mcount_lock;
#define _MCOUNT_DECL static __inline void _mcount
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
#define MCOUNT \
void \
mcount() \
@@ -105,13 +105,13 @@ mcount() \
frompc = ((uintfptr_t *)frompc)[1]; \
_mcount(frompc, selfpc); \
}
-#else /* __GNUC__ */
+#else /* !(__GNUC__ || __INTEL_COMPILER) */
#define MCOUNT \
void \
mcount() \
{ \
}
-#endif /* __GNUC__ */
+#endif /* __GNUC__ || __INTEL_COMPILER */
typedef unsigned int uintfptr_t;
@@ -145,7 +145,7 @@ void stopguprof(struct gmonparam *p);
#include <sys/cdefs.h>
__BEGIN_DECLS
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
void mcount(void) __asm(".mcount");
#endif
__END_DECLS
diff --git a/sys/i386/include/stdarg.h b/sys/i386/include/stdarg.h
index 128fb33..ce59c7f 100644
--- a/sys/i386/include/stdarg.h
+++ b/sys/i386/include/stdarg.h
@@ -46,7 +46,7 @@
typedef __va_list va_list;
#endif
-#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3)
+#if (defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3) && !defined(__INTEL_COMPILER))
#define va_start(ap, last) \
__builtin_stdarg_start((ap), (last))
@@ -62,12 +62,12 @@ typedef __va_list va_list;
#define va_end(ap) \
__builtin_va_end(ap)
-#else /* ! __GNUC__ post GCC 2.95 */
+#else /* ! (__GNUC__ post GCC 2.95 || __INTEL_COMPILER) */
#define __va_size(type) \
(((sizeof(type) + sizeof(int) - 1) / sizeof(int)) * sizeof(int))
-#ifdef __GNUC__
+#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
#define va_start(ap, last) \
((ap) = (va_list)__builtin_next_arg(last))
#else /* non-GNU compiler */
@@ -78,6 +78,11 @@ typedef __va_list va_list;
#define va_arg(ap, type) \
(*(type *)((ap) += __va_size(type), (ap) - __va_size(type)))
+#if __ISO_C_VISIBLE >= 1999
+#define va_copy(dest, src) \
+ ((dest) = (src))
+#endif
+
#define va_end(ap)
#endif /* __GNUC__ post GCC 2.95 */
OpenPOWER on IntegriCloud