These are changes to allow to use the Intel C/C++ compiler (lang/icc)
to build the kernel. It doesn't affect the operation if gcc. Most of the changes are just adding __INTEL_COMPILER to #ifdef's, as icc v8 may define __GNUC__ some parts may look strange but are necessary. Additional changes: - in_cksum.[ch]: * use a generic C version instead of the assembly version in the !gcc case (ASM code breaks with the optimizations icc does) -> no bad checksums with an icc compiled kernel Help from: andre, grehan, das Stolen from: alpha version via ppc version The entire checksum code should IMHO be replaced with the DragonFly version (because it isn't guaranteed future revisions of gcc will include similar optimizations) as in: ---snip--- Revision Changes Path 1.12 +1 -0 src/sys/conf/files.i386 1.4 +142 -558 src/sys/i386/i386/in_cksum.c 1.5 +33 -69 src/sys/i386/include/in_cksum.h 1.5 +2 -0 src/sys/netinet/igmp.c 1.6 +0 -1 src/sys/netinet/in.h 1.6 +2 -0 src/sys/netinet/ip_icmp.c 1.4 +3 -4 src/contrib/ipfilter/ip_compat.h 1.3 +1 -2 src/sbin/natd/icmp.c 1.4 +0 -1 src/sbin/natd/natd.c 1.48 +1 -0 src/sys/conf/files 1.2 +0 -1 src/sys/conf/files.amd64 1.13 +0 -1 src/sys/conf/files.i386 1.5 +0 -1 src/sys/conf/files.pc98 1.7 +1 -1 src/sys/contrib/ipfilter/netinet/fil.c 1.10 +2 -3 src/sys/contrib/ipfilter/netinet/ip_compat.h 1.10 +1 -1 src/sys/contrib/ipfilter/netinet/ip_fil.c 1.7 +1 -1 src/sys/dev/netif/txp/if_txp.c 1.7 +1 -1 src/sys/net/ip_mroute/ip_mroute.c 1.7 +1 -2 src/sys/net/ipfw/ip_fw2.c 1.6 +1 -2 src/sys/netinet/igmp.c 1.4 +158 -116 src/sys/netinet/in_cksum.c 1.6 +1 -1 src/sys/netinet/ip_gre.c 1.7 +1 -2 src/sys/netinet/ip_icmp.c 1.10 +1 -1 src/sys/netinet/ip_input.c 1.10 +1 -2 src/sys/netinet/ip_output.c 1.13 +1 -2 src/sys/netinet/tcp_input.c 1.9 +1 -2 src/sys/netinet/tcp_output.c 1.10 +1 -1 src/sys/netinet/tcp_subr.c 1.10 +1 -1 src/sys/netinet/tcp_syncache.c 1.9 +1 -2 src/sys/netinet/udp_usrreq.c 1.5 +1 -2 src/sys/netinet6/ipsec.c 1.5 +1 -2 src/sys/netproto/ipsec/ipsec.c 1.5 +1 -1 src/sys/netproto/ipsec/ipsec_input.c 1.4 +1 -2 src/sys/netproto/ipsec/ipsec_output.c and finally remove sys/i386/i386 in_cksum.c sys/i386/include in_cksum.h ---snip--- - endian.h: * DTRT in C++ mode - quad.h: * we don't use gcc v1 anymore, remove support for it Suggested by: bde (long ago) - assym.h: * avoid zero-length arrays (remove dependency on a gcc specific feature) This change changes the contents of the object file, but as it's only used to generate some values for a header, and the generator knows how to handle this, there's no impact in the gcc case. Explained by: bde Submitted by: Marius Strobl <marius@alchemy.franken.de> - aicasm.c: * minor change to teach it about the way icc spells "-nostdinc" Not approved by: gibbs (no reply to my mail) - bump __FreeBSD_version (lang/icc needs to know about the changes) Incarnations of this patch survive gcc compiles since a loooong time, I use it on my desktop. An icc compiled kernel works since Nov. 2003 (exceptions: snd_* if used as modules), it survives a build of the entire ports collection with icc. Parts of this commit contains suggestions or submissions from Marius Strobl <marius@alchemy.franken.de>. Reviewed by: -arch Submitted by: netchild
This commit is contained in:
parent
06d6e4fcfe
commit
a122cca953
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=126891
@ -69,7 +69,7 @@ static struct gmonparam saved_gmp;
|
||||
#endif
|
||||
#endif /* GUPROF */
|
||||
|
||||
#ifdef __GNUC__
|
||||
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
|
||||
__asm(" \n\
|
||||
GM_STATE = 0 \n\
|
||||
GMON_PROF_OFF = 3 \n\
|
||||
@ -122,9 +122,9 @@ __cyg_profile_func_enter: \n\
|
||||
.mcount_exit: \n\
|
||||
ret \n\
|
||||
");
|
||||
#else /* !__GNUC__ */
|
||||
#else /* !(__GNUC__ || __INTEL_COMPILER) */
|
||||
#error
|
||||
#endif /* __GNUC__ */
|
||||
#endif /* __GNUC__ || __INTEL_COMPILER */
|
||||
|
||||
#ifdef GUPROF
|
||||
/*
|
||||
@ -133,7 +133,7 @@ __cyg_profile_func_enter: \n\
|
||||
* dependent file together with cputime(), __mcount and [.]mcount. cputime()
|
||||
* can't just be put in machdep.c because it has to be compiled without -pg.
|
||||
*/
|
||||
#ifdef __GNUC__
|
||||
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
|
||||
__asm(" \n\
|
||||
.text \n\
|
||||
# \n\
|
||||
@ -168,9 +168,9 @@ __cyg_profile_func_exit: \n\
|
||||
.mexitcount_exit: \n\
|
||||
ret \n\
|
||||
");
|
||||
#else /* !__GNUC__ */
|
||||
#else /* !(__GNUC__ || __INTEL_COMPILER) */
|
||||
#error
|
||||
#endif /* __GNUC__ */
|
||||
#endif /* __GNUC__ || __INTEL_COMPILER */
|
||||
|
||||
/*
|
||||
* Return the time elapsed since the last call. The units are machine-
|
||||
@ -346,7 +346,7 @@ stopguprof(gp)
|
||||
}
|
||||
|
||||
#else /* !GUPROF */
|
||||
#ifdef __GNUC__
|
||||
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
|
||||
__asm(" \n\
|
||||
.text \n\
|
||||
.p2align 4,0x90 \n\
|
||||
@ -354,7 +354,7 @@ __asm(" \n\
|
||||
" __XSTRING(HIDENAME(mexitcount)) ": \n\
|
||||
ret \n\
|
||||
");
|
||||
#else /* !__GNUC__ */
|
||||
#else /* !(__GNUC__ || __INTEL_COMPILER) */
|
||||
#error
|
||||
#endif /* __GNUC__ */
|
||||
#endif /* __GNUC__ || __INTEL_COMPILER */
|
||||
#endif /* GUPROF */
|
||||
|
@ -27,7 +27,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef __GNUC__
|
||||
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
|
||||
#define INLINE inline
|
||||
#else
|
||||
#define INLINE /**/
|
||||
|
@ -139,7 +139,17 @@ static int xputc(int);
|
||||
static int xgetc(int);
|
||||
static int getc(int);
|
||||
|
||||
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
|
||||
#define memcpy __builtin_memcpy
|
||||
#else
|
||||
static void memcpy(char *, const char *, int);
|
||||
static void
|
||||
memcpy(char *dst, const char *src, int len)
|
||||
{
|
||||
while (len--)
|
||||
*dst++ = *src++;
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline int
|
||||
strcmp(const char *s1, const char *s2)
|
||||
|
@ -139,7 +139,17 @@ static int xputc(int);
|
||||
static int xgetc(int);
|
||||
static int getc(int);
|
||||
|
||||
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
|
||||
#define memcpy __builtin_memcpy
|
||||
#else
|
||||
static void memcpy(char *, const char *, int);
|
||||
static void
|
||||
memcpy(char *dst, const char *src, int len)
|
||||
{
|
||||
while (len--)
|
||||
*dst++ = *src++;
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline int
|
||||
strcmp(const char *s1, const char *s2)
|
||||
|
@ -143,7 +143,7 @@ main(int argc, char *argv[])
|
||||
yydebug = 0;
|
||||
mmdebug = 0;
|
||||
#endif
|
||||
while ((ch = getopt(argc, argv, "d:i:l:n:o:p:r:I:")) != -1) {
|
||||
while ((ch = getopt(argc, argv, "d:i:l:n:o:p:r:I:X")) != -1) {
|
||||
switch(ch) {
|
||||
case 'd':
|
||||
#if DEBUG
|
||||
@ -244,6 +244,9 @@ main(int argc, char *argv[])
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'X':
|
||||
/* icc version of -nostdinc */
|
||||
break;
|
||||
case '?':
|
||||
default:
|
||||
usage();
|
||||
@ -309,7 +312,7 @@ usage()
|
||||
{
|
||||
|
||||
(void)fprintf(stderr,
|
||||
"usage: %-16s [-nostdinc] [-I-] [-I directory] [-o output_file]\n"
|
||||
"usage: %-16s [-nostdinc|-X] [-I-] [-I directory] [-o output_file]\n"
|
||||
" [-r register_output_file [-p register_diag_file -i includefile]]\n"
|
||||
" [-l program_list_file]\n"
|
||||
" input_file\n", appname);
|
||||
|
@ -84,7 +84,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef inline
|
||||
# if __GNUC__ >= 2
|
||||
# if __GNUC__ >= 2 || defined(__INTEL_COMPILER)
|
||||
# define inline __inline__
|
||||
# else
|
||||
# define inline /**/
|
||||
|
@ -69,7 +69,7 @@ __FBSDID("$FreeBSD$");
|
||||
* Enable debugging by defining ICHSMB_DEBUG to a non-zero value.
|
||||
*/
|
||||
#define ICHSMB_DEBUG 0
|
||||
#if ICHSMB_DEBUG != 0 && defined(__GNUC__)
|
||||
#if ICHSMB_DEBUG != 0 && (defined(__GNUC__) || defined(__INTEL_COMPILER))
|
||||
#define DBG(fmt, args...) \
|
||||
do { log(LOG_DEBUG, "%s: " fmt, __func__ , ## args); } while (0)
|
||||
#else
|
||||
|
@ -697,7 +697,7 @@ void iir_free(struct gdt_softc *);
|
||||
void iir_attach(struct gdt_softc *);
|
||||
void iir_intr(void *arg);
|
||||
|
||||
#ifdef __GNUC__
|
||||
#if defined( __GNUC__) || defined(__INTEL_COMPILER)
|
||||
/* These all require correctly aligned buffers */
|
||||
static __inline__ void gdt_enc16(u_int8_t *, u_int16_t);
|
||||
static __inline__ void gdt_enc32(u_int8_t *, u_int32_t);
|
||||
|
@ -753,7 +753,7 @@ int isp_async(struct ispsoftc *, ispasync_t, void *);
|
||||
/*
|
||||
* Platform Dependent Error and Debug Printout
|
||||
*/
|
||||
#ifdef __GNUC__
|
||||
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
|
||||
void isp_prt(struct ispsoftc *, int level, const char *, ...)
|
||||
__attribute__((__format__(__printf__,3,4)));
|
||||
#else
|
||||
|
@ -47,8 +47,8 @@
|
||||
#ifndef MCD_H
|
||||
#define MCD_H
|
||||
|
||||
#ifdef __GNUC__
|
||||
#if __GNUC__ >= 2
|
||||
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
|
||||
#if __GNUC__ >= 2 || defined(__INTEL_COMPILER)
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
#endif
|
||||
@ -222,8 +222,8 @@ struct mcd_rawsector {
|
||||
u_char ecc_bits[280];
|
||||
};
|
||||
|
||||
#ifdef __GNUC__
|
||||
#if __GNUC__ >= 2
|
||||
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
|
||||
#if __GNUC__ >= 2 || defined(__INTEL_COMPILER)
|
||||
#pragma pack(4)
|
||||
#endif
|
||||
#endif
|
||||
|
@ -68,7 +68,7 @@ typedef unsigned char U8;
|
||||
typedef signed short S16;
|
||||
typedef unsigned short U16;
|
||||
|
||||
#if defined(unix) || defined(__arm) || defined(ALPHA) || defined(__GNUC__)
|
||||
#if defined(unix) || defined(__arm) || defined(ALPHA) || defined(__GNUC__) || defined(__INTEL_COMPILER)
|
||||
|
||||
typedef signed int S32;
|
||||
typedef unsigned int U32;
|
||||
|
@ -32,8 +32,8 @@
|
||||
#ifndef SCD_H
|
||||
#define SCD_H
|
||||
|
||||
#ifdef __GNUC__
|
||||
#if __GNUC__ >= 2
|
||||
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
|
||||
#if __GNUC__ >= 2 || defined(__INTEL_COMPILER)
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
#endif
|
||||
|
@ -81,7 +81,7 @@ static void acpi_alloc_wakeup_handler(void);
|
||||
extern int acpi_savecpu(void);
|
||||
extern int acpi_restorecpu(void);
|
||||
|
||||
#ifdef __GNUC__
|
||||
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
|
||||
__asm__(" \n\
|
||||
.text \n\
|
||||
.p2align 2, 0x90 \n\
|
||||
@ -148,7 +148,7 @@ acpi_savecpu: \n\
|
||||
movl $1,%eax \n\
|
||||
ret \n\
|
||||
");
|
||||
#endif /* __GNUC__ */
|
||||
#endif /* __GNUC__ || __INTEL_COMPILER */
|
||||
|
||||
static void
|
||||
acpi_printcpu(void)
|
||||
|
@ -64,9 +64,10 @@ static __inline u_short
|
||||
rss(void)
|
||||
{
|
||||
u_short ss;
|
||||
#ifdef __GNUC__
|
||||
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
|
||||
__asm __volatile("mov %%ss,%0" : "=r" (ss));
|
||||
#else
|
||||
#error Function rss() needs to get ported to this compiler.
|
||||
ss = 0; /* XXXX Fix for other compilers. */
|
||||
#endif
|
||||
return ss;
|
||||
|
@ -768,7 +768,7 @@ static volatile u_int trap_by_rdmsr;
|
||||
* be advanced.
|
||||
*/
|
||||
inthand_t bluetrap6;
|
||||
#ifdef __GNUC__
|
||||
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
|
||||
__asm
|
||||
(" \n\
|
||||
.text \n\
|
||||
@ -787,7 +787,7 @@ __asm
|
||||
* Accessing non-existent MSR generates general protection fault.
|
||||
*/
|
||||
inthand_t bluetrap13;
|
||||
#ifdef __GNUC__
|
||||
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
|
||||
__asm
|
||||
(" \n\
|
||||
.text \n\
|
||||
|
@ -61,8 +61,195 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#undef ADDCARRY
|
||||
#define ADDCARRY(x) if ((x) > 0xffff) (x) -= 0xffff
|
||||
#if !defined(__GNUC__) || defined(__INTEL_COMPILER)
|
||||
/* non gcc parts stolen from sys/alpha/alpha/in_cksum.c */
|
||||
#define REDUCE32 \
|
||||
{ \
|
||||
q_util.q = sum; \
|
||||
sum = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \
|
||||
}
|
||||
#define REDUCE16 \
|
||||
{ \
|
||||
q_util.q = sum; \
|
||||
l_util.l = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \
|
||||
sum = l_util.s[0] + l_util.s[1]; \
|
||||
ADDCARRY(sum); \
|
||||
}
|
||||
#endif
|
||||
#define REDUCE {sum = (sum & 0xffff) + (sum >> 16); ADDCARRY(sum);}
|
||||
|
||||
#if !defined(__GNUC__) || defined(__INTEL_COMPILER)
|
||||
static const u_int32_t in_masks[] = {
|
||||
/*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/
|
||||
0x00000000, 0x000000FF, 0x0000FFFF, 0x00FFFFFF, /* offset 0 */
|
||||
0x00000000, 0x0000FF00, 0x00FFFF00, 0xFFFFFF00, /* offset 1 */
|
||||
0x00000000, 0x00FF0000, 0xFFFF0000, 0xFFFF0000, /* offset 2 */
|
||||
0x00000000, 0xFF000000, 0xFF000000, 0xFF000000, /* offset 3 */
|
||||
};
|
||||
|
||||
union l_util {
|
||||
u_int16_t s[2];
|
||||
u_int32_t l;
|
||||
};
|
||||
union q_util {
|
||||
u_int16_t s[4];
|
||||
u_int32_t l[2];
|
||||
u_int64_t q;
|
||||
};
|
||||
|
||||
static u_int64_t
|
||||
in_cksumdata(const u_int32_t *lw, int len)
|
||||
{
|
||||
u_int64_t sum = 0;
|
||||
u_int64_t prefilled;
|
||||
int offset;
|
||||
union q_util q_util;
|
||||
|
||||
if ((3 & (long) lw) == 0 && len == 20) {
|
||||
sum = (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3] + lw[4];
|
||||
REDUCE32;
|
||||
return sum;
|
||||
}
|
||||
|
||||
if ((offset = 3 & (long) lw) != 0) {
|
||||
const u_int32_t *masks = in_masks + (offset << 2);
|
||||
lw = (u_int32_t *) (((long) lw) - offset);
|
||||
sum = *lw++ & masks[len >= 3 ? 3 : len];
|
||||
len -= 4 - offset;
|
||||
if (len <= 0) {
|
||||
REDUCE32;
|
||||
return sum;
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
/*
|
||||
* Force to cache line boundary.
|
||||
*/
|
||||
offset = 32 - (0x1f & (long) lw);
|
||||
if (offset < 32 && len > offset) {
|
||||
len -= offset;
|
||||
if (4 & offset) {
|
||||
sum += (u_int64_t) lw[0];
|
||||
lw += 1;
|
||||
}
|
||||
if (8 & offset) {
|
||||
sum += (u_int64_t) lw[0] + lw[1];
|
||||
lw += 2;
|
||||
}
|
||||
if (16 & offset) {
|
||||
sum += (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3];
|
||||
lw += 4;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* access prefilling to start load of next cache line.
|
||||
* then add current cache line
|
||||
* save result of prefilling for loop iteration.
|
||||
*/
|
||||
prefilled = lw[0];
|
||||
while ((len -= 32) >= 4) {
|
||||
u_int64_t prefilling = lw[8];
|
||||
sum += prefilled + lw[1] + lw[2] + lw[3]
|
||||
+ lw[4] + lw[5] + lw[6] + lw[7];
|
||||
lw += 8;
|
||||
prefilled = prefilling;
|
||||
}
|
||||
if (len >= 0) {
|
||||
sum += prefilled + lw[1] + lw[2] + lw[3]
|
||||
+ lw[4] + lw[5] + lw[6] + lw[7];
|
||||
lw += 8;
|
||||
} else {
|
||||
len += 32;
|
||||
}
|
||||
while ((len -= 16) >= 0) {
|
||||
sum += (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3];
|
||||
lw += 4;
|
||||
}
|
||||
len += 16;
|
||||
while ((len -= 4) >= 0) {
|
||||
sum += (u_int64_t) *lw++;
|
||||
}
|
||||
len += 4;
|
||||
if (len > 0)
|
||||
sum += (u_int64_t) (in_masks[len] & *lw);
|
||||
REDUCE32;
|
||||
return sum;
|
||||
}
|
||||
|
||||
u_short
|
||||
in_addword(u_short a, u_short b)
|
||||
{
|
||||
u_int64_t sum = a + b;
|
||||
|
||||
ADDCARRY(sum);
|
||||
return (sum);
|
||||
}
|
||||
|
||||
u_short
|
||||
in_pseudo(u_int32_t a, u_int32_t b, u_int32_t c)
|
||||
{
|
||||
u_int64_t sum;
|
||||
union q_util q_util;
|
||||
union l_util l_util;
|
||||
|
||||
sum = (u_int64_t) a + b + c;
|
||||
REDUCE16;
|
||||
return (sum);
|
||||
}
|
||||
|
||||
u_short
|
||||
in_cksum_skip(struct mbuf *m, int len, int skip)
|
||||
{
|
||||
u_int64_t sum = 0;
|
||||
int mlen = 0;
|
||||
int clen = 0;
|
||||
caddr_t addr;
|
||||
union q_util q_util;
|
||||
union l_util l_util;
|
||||
|
||||
len -= skip;
|
||||
for (; skip && m; m = m->m_next) {
|
||||
if (m->m_len > skip) {
|
||||
mlen = m->m_len - skip;
|
||||
addr = mtod(m, caddr_t) + skip;
|
||||
goto skip_start;
|
||||
} else {
|
||||
skip -= m->m_len;
|
||||
}
|
||||
}
|
||||
|
||||
for (; m && len; m = m->m_next) {
|
||||
if (m->m_len == 0)
|
||||
continue;
|
||||
mlen = m->m_len;
|
||||
addr = mtod(m, caddr_t);
|
||||
skip_start:
|
||||
if (len < mlen)
|
||||
mlen = len;
|
||||
if ((clen ^ (long) addr) & 1)
|
||||
sum += in_cksumdata((const u_int32_t *)addr, mlen) << 8;
|
||||
else
|
||||
sum += in_cksumdata((const u_int32_t *)addr, mlen);
|
||||
|
||||
clen += mlen;
|
||||
len -= mlen;
|
||||
}
|
||||
REDUCE16;
|
||||
return (~sum & 0xffff);
|
||||
}
|
||||
|
||||
u_int in_cksum_hdr(const struct ip *ip)
|
||||
{
|
||||
u_int64_t sum = in_cksumdata((const u_int32_t *)ip, sizeof(struct ip));
|
||||
union q_util q_util;
|
||||
union l_util l_util;
|
||||
|
||||
REDUCE16;
|
||||
return (~sum & 0xffff);
|
||||
}
|
||||
#else
|
||||
|
||||
/*
|
||||
* These asm statements require __volatile because they pass information
|
||||
* via the condition codes. GCC does not currently provide a way to specify
|
||||
@ -270,3 +457,4 @@ in_cksum_skip(m, len, skip)
|
||||
REDUCE;
|
||||
return (~sum & 0xffff);
|
||||
}
|
||||
#endif
|
||||
|
@ -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
|
||||
|
@ -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_ */
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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_ */
|
||||
|
@ -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
|
||||
|
@ -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_ */
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
@ -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 */
|
||||
|
@ -101,7 +101,7 @@ __FBSDID("$FreeBSD$");
|
||||
#define NPX_DISABLE_I586_OPTIMIZED_BZERO (1 << 1)
|
||||
#define NPX_DISABLE_I586_OPTIMIZED_COPYIO (1 << 2)
|
||||
|
||||
#if defined(__GNUC__) && !defined(lint)
|
||||
#if (defined(__GNUC__) && !defined(lint)) || defined(__INTEL_COMPILER)
|
||||
|
||||
#define fldcw(addr) __asm("fldcw %0" : : "m" (*(addr)))
|
||||
#define fnclex() __asm("fnclex")
|
||||
@ -119,7 +119,7 @@ __FBSDID("$FreeBSD$");
|
||||
: : "n" (CR0_TS) : "ax")
|
||||
#define stop_emulating() __asm("clts")
|
||||
|
||||
#else /* not __GNUC__ */
|
||||
#else /* !((__GNUC__ && !lint ) || __INTEL_COMPILER) */
|
||||
|
||||
void fldcw(caddr_t addr);
|
||||
void fnclex(void);
|
||||
@ -136,7 +136,7 @@ void fxrstor(caddr_t addr);
|
||||
void start_emulating(void);
|
||||
void stop_emulating(void);
|
||||
|
||||
#endif /* __GNUC__ */
|
||||
#endif /* (__GNUC__ && !lint ) || __INTEL_COMPILER */
|
||||
|
||||
#ifdef CPU_ENABLE_SSE
|
||||
#define GET_FPU_CW(thread) \
|
||||
|
@ -69,7 +69,7 @@ static struct gmonparam saved_gmp;
|
||||
#endif
|
||||
#endif /* GUPROF */
|
||||
|
||||
#ifdef __GNUC__
|
||||
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
|
||||
__asm(" \n\
|
||||
GM_STATE = 0 \n\
|
||||
GMON_PROF_OFF = 3 \n\
|
||||
@ -122,9 +122,9 @@ __cyg_profile_func_enter: \n\
|
||||
.mcount_exit: \n\
|
||||
ret \n\
|
||||
");
|
||||
#else /* !__GNUC__ */
|
||||
#else /* !(__GNUC__ || __INTEL_COMPILER) */
|
||||
#error
|
||||
#endif /* __GNUC__ */
|
||||
#endif /* __GNUC__ || __INTEL_COMPILER */
|
||||
|
||||
#ifdef GUPROF
|
||||
/*
|
||||
@ -133,7 +133,7 @@ __cyg_profile_func_enter: \n\
|
||||
* dependent file together with cputime(), __mcount and [.]mcount. cputime()
|
||||
* can't just be put in machdep.c because it has to be compiled without -pg.
|
||||
*/
|
||||
#ifdef __GNUC__
|
||||
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
|
||||
__asm(" \n\
|
||||
.text \n\
|
||||
# \n\
|
||||
@ -168,9 +168,9 @@ __cyg_profile_func_exit: \n\
|
||||
.mexitcount_exit: \n\
|
||||
ret \n\
|
||||
");
|
||||
#else /* !__GNUC__ */
|
||||
#else /* !(__GNUC__ || __INTEL_COMPILER) */
|
||||
#error
|
||||
#endif /* __GNUC__ */
|
||||
#endif /* __GNUC__ || __INTEL_COMPILER */
|
||||
|
||||
/*
|
||||
* Return the time elapsed since the last call. The units are machine-
|
||||
@ -346,7 +346,7 @@ stopguprof(gp)
|
||||
}
|
||||
|
||||
#else /* !GUPROF */
|
||||
#ifdef __GNUC__
|
||||
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
|
||||
__asm(" \n\
|
||||
.text \n\
|
||||
.p2align 4,0x90 \n\
|
||||
@ -354,7 +354,7 @@ __asm(" \n\
|
||||
" __XSTRING(HIDENAME(mexitcount)) ": \n\
|
||||
ret \n\
|
||||
");
|
||||
#else /* !__GNUC__ */
|
||||
#else /* !(__GNUC__ || __INTEL_COMPILER) */
|
||||
#error
|
||||
#endif /* __GNUC__ */
|
||||
#endif /* __GNUC__ || __INTEL_COMPILER */
|
||||
#endif /* GUPROF */
|
||||
|
@ -225,7 +225,7 @@ kmstartup(dummy)
|
||||
|
||||
startguprof(p);
|
||||
for (i = 0; i < CALIB_SCALE; i++)
|
||||
#if defined(__i386__) && __GNUC__ >= 2
|
||||
#if defined(__i386__) && (__GNUC__ >= 2 || defined(__INTEL_COMPILER))
|
||||
__asm("pushl %0; call __mcount; popl %%ecx"
|
||||
:
|
||||
: "i" (profil)
|
||||
@ -238,7 +238,7 @@ kmstartup(dummy)
|
||||
|
||||
startguprof(p);
|
||||
for (i = 0; i < CALIB_SCALE; i++)
|
||||
#if defined(__i386__) && __GNUC__ >= 2
|
||||
#if defined(__i386__) && (__GNUC__ >= 2 || defined(__INTEL_COMPILER))
|
||||
__asm("call " __XSTRING(HIDENAME(mexitcount)) "; 1:"
|
||||
: : : "ax", "bx", "cx", "dx", "memory");
|
||||
__asm("movl $1b,%0" : "=rm" (tmp_addr));
|
||||
@ -550,7 +550,7 @@ addupc_task(struct thread *td, uintptr_t pc, u_int ticks)
|
||||
PROC_UNLOCK(p);
|
||||
}
|
||||
|
||||
#if defined(__i386__) && __GNUC__ >= 2
|
||||
#if defined(__i386__) && __GNUC__ >= 2 && !defined(__INTEL_COMPILER)
|
||||
/*
|
||||
* Support for "--test-coverage --profile-arcs" in GCC.
|
||||
*
|
||||
|
@ -108,15 +108,5 @@ u_quad_t __udivdi3(u_quad_t a, u_quad_t b);
|
||||
u_quad_t __umoddi3(u_quad_t a, u_quad_t b);
|
||||
int __ucmpdi2(u_quad_t a, u_quad_t b);
|
||||
|
||||
/*
|
||||
* XXX
|
||||
* Compensate for gcc 1 vs gcc 2. Gcc 1 defines ?sh?di3's second argument
|
||||
* as u_quad_t, while gcc 2 correctly uses int. Unfortunately, we still use
|
||||
* both compilers.
|
||||
*/
|
||||
#if __GNUC__ >= 2
|
||||
typedef unsigned int qshift_t;
|
||||
#else
|
||||
typedef u_quad_t qshift_t;
|
||||
#endif
|
||||
#endif /* _LIBKERN_QUAD_H */
|
||||
|
@ -421,7 +421,7 @@ struct air_phy_stat_rsp {
|
||||
/*
|
||||
* PF_ATM ioctls
|
||||
*/
|
||||
#if !defined(__GNUC__)
|
||||
#if !(defined(__GNUC__) || defined(__INTEL_COMPILER))
|
||||
#define AIOCCFG _IOW(A, 128, struct atmcfgreq) /* Configure i/f */
|
||||
#define AIOCADD _IOW(A, 129, struct atmaddreq) /* Add (e.g. PVC) */
|
||||
#define AIOCDEL _IOW(A, 130, struct atmdelreq) /* Delete */
|
||||
|
@ -31,13 +31,14 @@
|
||||
#ifndef _SYS_ASSYM_H_
|
||||
#define _SYS_ASSYM_H_
|
||||
|
||||
#define ASSYM_BIAS 0x10000 /* avoid zero-length arrays */
|
||||
#define ASSYM_ABS(value) ((value) < 0 ? -((value) + 1) + 1ULL : (value))
|
||||
|
||||
#define ASSYM(name, value) \
|
||||
char name ## sign[(value) < 0 ? 1 : 0]; \
|
||||
char name ## w0[ASSYM_ABS(value) & 0xFFFFU]; \
|
||||
char name ## w1[(ASSYM_ABS(value) & 0xFFFF0000UL) >> 16]; \
|
||||
char name ## w2[(ASSYM_ABS(value) & 0xFFFF00000000ULL) >> 32]; \
|
||||
char name ## w3[(ASSYM_ABS(value) & 0xFFFF000000000000ULL) >> 48]
|
||||
#define ASSYM(name, value) \
|
||||
char name ## sign[((value) < 0 ? 1 : 0) + ASSYM_BIAS]; \
|
||||
char name ## w0[(ASSYM_ABS(value) & 0xFFFFU) + ASSYM_BIAS]; \
|
||||
char name ## w1[((ASSYM_ABS(value) & 0xFFFF0000UL) >> 16) + ASSYM_BIAS]; \
|
||||
char name ## w2[((ASSYM_ABS(value) & 0xFFFF00000000ULL) >> 32) + ASSYM_BIAS]; \
|
||||
char name ## w3[((ASSYM_ABS(value) & 0xFFFF000000000000ULL) >> 48) + ASSYM_BIAS]
|
||||
|
||||
#endif /* !_SYS_ASSYM_H_ */
|
||||
|
@ -51,7 +51,7 @@
|
||||
/*
|
||||
* Macro to test if we're using a specific version of gcc or later.
|
||||
*/
|
||||
#ifdef __GNUC__
|
||||
#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
|
||||
#define __GNUC_PREREQ__(ma, mi) \
|
||||
(__GNUC__ > (ma) || __GNUC__ == (ma) && __GNUC_MINOR__ >= (mi))
|
||||
#else
|
||||
@ -83,9 +83,9 @@
|
||||
#if defined(__cplusplus)
|
||||
#define __inline inline /* convert to C++ keyword */
|
||||
#else
|
||||
#ifndef __GNUC__
|
||||
#if !(defined(__GNUC__) || defined(__INTEL_COMPILER))
|
||||
#define __inline /* delete GCC keyword */
|
||||
#endif /* !__GNUC__ */
|
||||
#endif /* !(__GNUC__ || __INTEL_COMPILER) */
|
||||
#endif /* !__cplusplus */
|
||||
|
||||
#else /* !(__STDC__ || __cplusplus) */
|
||||
@ -93,7 +93,7 @@
|
||||
#define __CONCAT(x,y) x/**/y
|
||||
#define __STRING(x) "x"
|
||||
|
||||
#ifndef __GNUC__
|
||||
#if !(defined(__GNUC__) || defined(__INTEL_COMPILER))
|
||||
#define __const /* delete pseudo-ANSI C keywords */
|
||||
#define __inline
|
||||
#define __signed
|
||||
@ -112,7 +112,7 @@
|
||||
#define signed
|
||||
#define volatile
|
||||
#endif /* !NO_ANSI_KEYWORDS */
|
||||
#endif /* !__GNUC__ */
|
||||
#endif /* !(__GNUC__ || __INTEL_COMPILER) */
|
||||
#endif /* !(__STDC__ || __cplusplus) */
|
||||
|
||||
/*
|
||||
@ -132,12 +132,12 @@
|
||||
#define __aligned(x)
|
||||
#define __section(x)
|
||||
#else
|
||||
#if !__GNUC_PREREQ__(2, 5)
|
||||
#if !__GNUC_PREREQ__(2, 5) && !defined(__INTEL_COMPILER)
|
||||
#define __dead2
|
||||
#define __pure2
|
||||
#define __unused
|
||||
#endif
|
||||
#if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7
|
||||
#if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7 && !defined(__INTEL_COMPILER)
|
||||
#define __dead2 __attribute__((__noreturn__))
|
||||
#define __pure2 __attribute__((__const__))
|
||||
#define __unused
|
||||
@ -151,9 +151,17 @@
|
||||
#define __aligned(x) __attribute__((__aligned__(x)))
|
||||
#define __section(x) __attribute__((__section__(x)))
|
||||
#endif
|
||||
#if defined(__INTEL_COMPILER)
|
||||
#define __dead2 __attribute__((__noreturn__))
|
||||
#define __pure2 __attribute__((__const__))
|
||||
#define __unused __attribute__((__unused__))
|
||||
#define __packed __attribute__((__packed__))
|
||||
#define __aligned(x) __attribute__((__aligned__(x)))
|
||||
#define __section(x) __attribute__((__section__(x)))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if __GNUC_PREREQ__(3, 1)
|
||||
#if __GNUC_PREREQ__(3, 1) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 800)
|
||||
#define __always_inline __attribute__((__always_inline__))
|
||||
#else
|
||||
#define __always_inline
|
||||
@ -166,11 +174,11 @@
|
||||
#endif
|
||||
|
||||
/* XXX: should use `#if __STDC_VERSION__ < 199901'. */
|
||||
#if !__GNUC_PREREQ__(2, 7)
|
||||
#if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER)
|
||||
#define __func__ NULL
|
||||
#endif
|
||||
|
||||
#if __GNUC__ >= 2 && !defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901
|
||||
#if (defined(__INTEL_COMPILER) || (defined(__GNUC__) && __GNUC__ >= 2)) && !defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901
|
||||
#define __LONG_LONG_SUPPORTED
|
||||
#endif
|
||||
|
||||
@ -236,7 +244,7 @@
|
||||
* that are known to support the features properly (old versions of gcc-2
|
||||
* didn't permit keeping the keywords out of the application namespace).
|
||||
*/
|
||||
#if !__GNUC_PREREQ__(2, 7)
|
||||
#if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER)
|
||||
#define __printflike(fmtarg, firstvararg)
|
||||
#define __scanflike(fmtarg, firstvararg)
|
||||
#else
|
||||
@ -247,16 +255,18 @@
|
||||
#endif
|
||||
|
||||
/* Compiler-dependent macros that rely on FreeBSD-specific extensions. */
|
||||
#if __FreeBSD_cc_version >= 300001
|
||||
#if __FreeBSD_cc_version >= 300001 && defined(__GNUC__) && !defined(__INTEL_COMPILER)
|
||||
#define __printf0like(fmtarg, firstvararg) \
|
||||
__attribute__((__format__ (__printf0__, fmtarg, firstvararg)))
|
||||
#else
|
||||
#define __printf0like(fmtarg, firstvararg)
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
|
||||
#ifndef __INTEL_COMPILER
|
||||
#define __strong_reference(sym,aliassym) \
|
||||
extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym)));
|
||||
#endif
|
||||
#ifdef __STDC__
|
||||
#define __weak_reference(sym,alias) \
|
||||
__asm__(".weak " #alias); \
|
||||
@ -274,9 +284,9 @@
|
||||
__asm__(".asciz \"msg\""); \
|
||||
__asm__(".previous")
|
||||
#endif /* __STDC__ */
|
||||
#endif /* __GNUC__ */
|
||||
#endif /* __GNUC__ || __INTEL_COMPILER */
|
||||
|
||||
#ifdef __GNUC__
|
||||
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
|
||||
#define __IDSTRING(name,string) __asm__(".ident\t\"" string "\"")
|
||||
#else
|
||||
/*
|
||||
|
@ -37,7 +37,7 @@
|
||||
#ifndef _SYS_DIR_H_
|
||||
#define _SYS_DIR_H_
|
||||
|
||||
#if __GNUC__
|
||||
#if defined(__GNUC__) || defined (__INTEL_COMPILER)
|
||||
#warning "The information in this file should be obtained from <dirent.h>"
|
||||
#warning "and is provided solely (and temporarily) for backward compatibility."
|
||||
#endif
|
||||
|
@ -43,7 +43,7 @@
|
||||
#define _SYS_IOCTL_H_
|
||||
|
||||
#ifdef _KERNEL
|
||||
#if __GNUC__
|
||||
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
|
||||
#warning "Don't #include ioctl.h in the kernel. Include xxxio.h instead."
|
||||
#endif
|
||||
#endif
|
||||
|
@ -39,16 +39,16 @@
|
||||
/*
|
||||
* Private macros, not to be used outside this header file.
|
||||
*/
|
||||
#ifdef __GNUC__
|
||||
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
|
||||
#define __MAKE_SET(set, sym) \
|
||||
static void const * const __set_##set##_sym_##sym \
|
||||
__section("set_" #set) __unused = &sym
|
||||
#else /* !__GNUC__ */
|
||||
#else /* !(__GNUC__ || __INTEL_COMPILER) */
|
||||
#ifndef lint
|
||||
#error "This file needs to be compiled by GCC or lint"
|
||||
#error "This file needs to be compiled by GCC, an Intel compiler or lint"
|
||||
#endif /* lint */
|
||||
#define __MAKE_SET(set, sym) extern void const * const (__set_##set##_sym_##sym)
|
||||
#endif /* __GNUC__ */
|
||||
#endif /* __GNUC__ || __INTEL_COMPILER */
|
||||
|
||||
/*
|
||||
* Public macros.
|
||||
|
@ -59,7 +59,7 @@
|
||||
* scheme is: <major><two digit minor><0 if release branch, otherwise 1>xx
|
||||
*/
|
||||
#undef __FreeBSD_version
|
||||
#define __FreeBSD_version 502107 /* Master, propagated to newvers */
|
||||
#define __FreeBSD_version 502108 /* Master, propagated to newvers */
|
||||
|
||||
#ifndef LOCORE
|
||||
#include <sys/types.h>
|
||||
|
@ -521,7 +521,7 @@ struct quehead {
|
||||
struct quehead *qh_rlink;
|
||||
};
|
||||
|
||||
#ifdef __GNUC__
|
||||
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
|
||||
|
||||
static __inline void
|
||||
insque(void *a, void *b)
|
||||
@ -545,12 +545,12 @@ remque(void *a)
|
||||
element->qh_rlink = 0;
|
||||
}
|
||||
|
||||
#else /* !__GNUC__ */
|
||||
#else /* !(__GNUC__ || __INTEL_COMPILER) */
|
||||
|
||||
void insque(void *a, void *b);
|
||||
void remque(void *a);
|
||||
|
||||
#endif /* __GNUC__ */
|
||||
#endif /* __GNUC__ || __INTEL_COMPILER */
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
||||
|
@ -38,7 +38,7 @@
|
||||
#define _SYS_SYSLIMITS_H_
|
||||
|
||||
#if !defined(_KERNEL) && !defined(_LIMITS_H_) && !defined(_SYS_PARAM_H_)
|
||||
#if __GNUC__
|
||||
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
|
||||
#warning "No user-serviceable parts inside."
|
||||
#endif
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user