Date: Sat, 13 Mar 2004 14:11:14 -0800 (PST) From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 48913 for review Message-ID: <200403132211.i2DMBERV061813@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=48913 Change 48913 by peter@peter_overcee on 2004/03/13 14:10:47 On second throughts, I'm not going to commit this. Affected files ... .. //depot/projects/hammer/sys/amd64/amd64/db_interface.c#17 edit .. //depot/projects/hammer/sys/amd64/amd64/fpu.c#10 edit .. //depot/projects/hammer/sys/amd64/include/atomic.h#11 edit .. //depot/projects/hammer/sys/amd64/include/bus_amd64.h#9 edit .. //depot/projects/hammer/sys/amd64/include/cpufunc.h#24 edit .. //depot/projects/hammer/sys/amd64/include/critical.h#15 edit .. //depot/projects/hammer/sys/amd64/include/endian.h#7 edit .. //depot/projects/hammer/sys/amd64/include/ieeefp.h#12 edit .. //depot/projects/hammer/sys/amd64/include/pcpu.h#19 edit .. //depot/projects/hammer/sys/amd64/include/profile.h#11 edit Differences ... ==== //depot/projects/hammer/sys/amd64/amd64/db_interface.c#17 (text+ko) ==== @@ -61,10 +61,9 @@ rss(void) { u_short ss; -#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#ifdef __GNUC__ __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; ==== //depot/projects/hammer/sys/amd64/amd64/fpu.c#10 (text+ko) ==== @@ -68,7 +68,7 @@ * Floating point support. */ -#if (defined(__GNUC__) && !defined(lint)) || defined(__INTEL_COMPILER) +#if defined(__GNUC__) && !defined(lint) #define fldcw(addr) __asm("fldcw %0" : : "m" (*(addr))) #define fnclex() __asm("fnclex") @@ -81,7 +81,7 @@ : : "n" (CR0_TS) : "ax") #define stop_emulating() __asm("clts") -#else /* !((__GNUC__ && !lint ) || __INTEL_COMPILER) */ +#else /* not __GNUC__ */ void fldcw(caddr_t addr); void fnclex(void); @@ -93,7 +93,7 @@ void start_emulating(void); void stop_emulating(void); -#endif /* (__GNUC__ && !lint ) || __INTEL_COMPILER */ +#endif /* __GNUC__ */ #define GET_FPU_CW(thread) ((thread)->td_pcb->pcb_save.sv_env.en_cw) #define GET_FPU_SW(thread) ((thread)->td_pcb->pcb_save.sv_env.en_sw) ==== //depot/projects/hammer/sys/amd64/include/atomic.h#11 (text+ko) ==== @@ -76,7 +76,7 @@ #else /* !KLD_MODULE */ -#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#ifdef __GNUC__ /* * For userland, assume the SMP case and use lock prefixes so that @@ -102,12 +102,12 @@ } \ struct __hack -#else /* !(__GNUC__ || __INTEL_COMPILER) */ +#else /* !__GNUC__ */ #define ATOMIC_ASM(NAME, TYPE, OP, CONS, V) \ extern void atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v) -#endif /* __GNUC__ || __INTEL_COMPILER */ +#endif /* __GNUC__ */ /* * Atomic compare and set, used by the mutex functions @@ -117,7 +117,7 @@ * Returns 0 on failure, non-zero on success */ -#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#if defined(__GNUC__) static __inline int atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src) @@ -158,9 +158,9 @@ return (res); } -#endif /* defined(__GNUC__) || defined(__INTEL_COMPILER) */ +#endif /* defined(__GNUC__) */ -#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#if defined(__GNUC__) #define ATOMIC_STORE_LOAD(TYPE, LOP, SOP) \ static __inline u_##TYPE \ @@ -189,7 +189,7 @@ } \ struct __hack -#else /* !(defined(__GNUC__) || defined(__INTEL_COMPILER)) */ +#else /* !defined(__GNUC__) */ extern int atomic_cmpset_int(volatile u_int *, u_int, u_int); extern int atomic_cmpset_long(volatile u_long *, u_long, u_long); @@ -198,7 +198,7 @@ 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__) || defined(__INTEL_COMPILER) */ +#endif /* defined(__GNUC__) */ #endif /* KLD_MODULE */ @@ -371,7 +371,7 @@ #undef ATOMIC_PTR -#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#if defined(__GNUC__) static __inline u_int atomic_readandclear_int(volatile u_int *addr) @@ -403,12 +403,12 @@ return (result); } -#else /* !(defined(__GNUC__) || defined(__INTEL_COMPILER)) */ +#else /* !defined(__GNUC__) */ extern u_long atomic_readandclear_long(volatile u_long *); extern u_int atomic_readandclear_int(volatile u_int *); -#endif /* defined(__GNUC__) || defined(__INTEL_COMPILER) */ +#endif /* defined(__GNUC__) */ #endif /* !defined(WANT_FUNCTIONS) */ #endif /* ! _MACHINE_ATOMIC_H_ */ ==== //depot/projects/hammer/sys/amd64/include/bus_amd64.h#9 (text+ko) ==== @@ -284,7 +284,7 @@ else #endif { -#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#ifdef __GNUC__ __asm __volatile(" \n\ cld \n\ 1: movb (%2),%%al \n\ @@ -293,10 +293,6 @@ "=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 @@ -317,7 +313,7 @@ else #endif { -#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#ifdef __GNUC__ __asm __volatile(" \n\ cld \n\ 1: movw (%2),%%ax \n\ @@ -326,10 +322,6 @@ "=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 +342,7 @@ else #endif { -#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#ifdef __GNUC__ __asm __volatile(" \n\ cld \n\ 1: movl (%2),%%eax \n\ @@ -359,10 +351,6 @@ "=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 @@ -403,7 +391,7 @@ #endif { int _port_ = bsh + offset; -#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#ifdef __GNUC__ __asm __volatile(" \n\ cld \n\ 1: inb %w2,%%al \n\ @@ -413,10 +401,6 @@ "=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 @@ -426,7 +410,7 @@ #endif { bus_space_handle_t _port_ = bsh + offset; -#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#ifdef __GNUC__ __asm __volatile(" \n\ cld \n\ repne \n\ @@ -434,10 +418,6 @@ "=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 @@ -453,7 +433,7 @@ #endif { int _port_ = bsh + offset; -#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#ifdef __GNUC__ __asm __volatile(" \n\ cld \n\ 1: inw %w2,%%ax \n\ @@ -463,10 +443,6 @@ "=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 @@ -476,7 +452,7 @@ #endif { bus_space_handle_t _port_ = bsh + offset; -#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#ifdef __GNUC__ __asm __volatile(" \n\ cld \n\ repne \n\ @@ -484,10 +460,6 @@ "=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 @@ -503,7 +475,7 @@ #endif { int _port_ = bsh + offset; -#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#ifdef __GNUC__ __asm __volatile(" \n\ cld \n\ 1: inl %w2,%%eax \n\ @@ -513,10 +485,6 @@ "=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 @@ -526,7 +494,7 @@ #endif { bus_space_handle_t _port_ = bsh + offset; -#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#ifdef __GNUC__ __asm __volatile(" \n\ cld \n\ repne \n\ @@ -534,10 +502,6 @@ "=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 @@ -659,7 +623,7 @@ else #endif { -#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#ifdef __GNUC__ __asm __volatile(" \n\ cld \n\ 1: lodsb \n\ @@ -668,10 +632,6 @@ "=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 @@ -692,7 +652,7 @@ else #endif { -#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#ifdef __GNUC__ __asm __volatile(" \n\ cld \n\ 1: lodsw \n\ @@ -701,10 +661,6 @@ "=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 @@ -725,7 +681,7 @@ else #endif { -#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#ifdef __GNUC__ __asm __volatile(" \n\ cld \n\ 1: lodsl \n\ @@ -734,10 +690,6 @@ "=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 @@ -779,7 +731,7 @@ #endif { int _port_ = bsh + offset; -#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#ifdef __GNUC__ __asm __volatile(" \n\ cld \n\ 1: lodsb \n\ @@ -789,10 +741,6 @@ "=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 @@ -802,7 +750,7 @@ #endif { bus_space_handle_t _port_ = bsh + offset; -#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#ifdef __GNUC__ __asm __volatile(" \n\ cld \n\ repne \n\ @@ -810,10 +758,6 @@ "=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 @@ -829,7 +773,7 @@ #endif { int _port_ = bsh + offset; -#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#ifdef __GNUC__ __asm __volatile(" \n\ cld \n\ 1: lodsw \n\ @@ -839,10 +783,6 @@ "=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 @@ -852,7 +792,7 @@ #endif { bus_space_handle_t _port_ = bsh + offset; -#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#ifdef __GNUC__ __asm __volatile(" \n\ cld \n\ repne \n\ @@ -860,10 +800,6 @@ "=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 @@ -879,7 +815,7 @@ #endif { int _port_ = bsh + offset; -#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#ifdef __GNUC__ __asm __volatile(" \n\ cld \n\ 1: lodsl \n\ @@ -889,10 +825,6 @@ "=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 @@ -902,7 +834,7 @@ #endif { bus_space_handle_t _port_ = bsh + offset; -#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#ifdef __GNUC__ __asm __volatile(" \n\ cld \n\ repne \n\ @@ -910,10 +842,6 @@ "=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 @@ -1285,15 +1213,11 @@ 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) { -#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#ifdef __GNUC__ if (flags & BUS_SPACE_BARRIER_READ) __asm __volatile("lock; addl $0,0(%%rsp)" : : : "memory"); else __asm __volatile("" : : : "memory"); -#else -# ifndef lint -# error "no assembler code for your compiler" -# endif #endif } ==== //depot/projects/hammer/sys/amd64/include/cpufunc.h#24 (text+ko) ==== @@ -55,7 +55,7 @@ #define writel(va, d) (*(volatile u_int32_t *) (va) = (d)) #define writeq(va, d) (*(volatile u_int64_t *) (va) = (d)) -#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#ifdef __GNUC__ static __inline void breakpoint(void) @@ -708,7 +708,7 @@ write_rflags(rflags); } -#else /* !(__GNUC__ || __INTEL_COMPILER) */ +#else /* !__GNUC__ */ int breakpoint(void); u_int bsfl(u_int mask); @@ -773,7 +773,7 @@ void write_rflags(u_int rf); void wrmsr(u_int msr, u_int64_t newval); -#endif /* __GNUC__ || __INTEL_COMPILER */ +#endif /* __GNUC__ */ void reset_dbregs(void); ==== //depot/projects/hammer/sys/amd64/include/critical.h#15 (text+ko) ==== @@ -46,7 +46,7 @@ */ void cpu_critical_fork_exit(void); -#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#ifdef __GNUC__ /* * cpu_critical_enter: @@ -73,12 +73,12 @@ intr_restore(curthread->td_md.md_savecrit); } -#else /* !(__GNUC__ || __INTEL_COMPILER) */ +#else /* !__GNUC__ */ void cpu_critical_enter(void); void cpu_critical_exit(void); -#endif /* __GNUC__ || __INTEL_COMPILER */ +#endif /* __GNUC__ */ __END_DECLS ==== //depot/projects/hammer/sys/amd64/include/endian.h#7 (text+ko) ==== @@ -40,10 +40,6 @@ #include <sys/cdefs.h> #include <sys/_types.h> -#ifdef __cplusplus -extern "C" { -#endif - /* * Define the order of 32-bit words in 64-bit words. */ @@ -71,17 +67,7 @@ #define BYTE_ORDER _BYTE_ORDER #endif -#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) +#ifdef __GNUC__ #define __word_swap_int_var(x) \ __extension__ ({ register __uint32_t __X = (x); \ @@ -195,7 +181,7 @@ #define __ntohl(x) __bswap32(x) #define __ntohs(x) __bswap16(x) -#else /* !(__GNUC__ || __INTEL_COMPILER_with_FreeBSD_endian) */ +#else /* !__GNUC__ */ /* * No optimizations are available for this compiler. Fall back to @@ -204,10 +190,6 @@ */ #define _BYTEORDER_FUNC_DEFINED -#endif /* __GNUC__ || __INTEL_COMPILER_with_FreeBSD_endian */ - -#ifdef __cplusplus -} -#endif +#endif /* __GNUC__ */ #endif /* !_MACHINE_ENDIAN_H_ */ ==== //depot/projects/hammer/sys/amd64/include/ieeefp.h#12 (text+ko) ==== @@ -117,7 +117,7 @@ #define SSE_RND_OFF 13 /* rounding control offset */ #define SSE_FZ_OFF 15 /* flush to zero offset */ -#if (defined(__GNUC__) || defined(__INTEL_COMPILER)) && !defined(__cplusplus) +#if defined(__GNUC__) && !defined(__cplusplus) #define __fldenv(addr) __asm __volatile("fldenv %0" : : "m" (*(addr))) #define __fnstenv(addr) __asm __volatile("fnstenv %0" : "=m" (*(addr))) @@ -263,7 +263,7 @@ return (_p); } -#endif /* (__GNUC__ || __INTEL_COMPILER) && !__cplusplus */ +#endif /* __GNUC__ && !__cplusplus */ #if !defined(__IEEEFP_NOINLINES__) && !defined(__cplusplus) && defined(__GNUC__) ==== //depot/projects/hammer/sys/amd64/include/pcpu.h#19 (text+ko) ==== @@ -55,7 +55,7 @@ #define PCPU_PTR(member) (&pcpup->pc_ ## member) #define PCPU_SET(member,value) (pcpup->pc_ ## member = (value)) -#elif defined(__GNUC__) || defined (__INTEL_COMPILER) +#elif defined(__GNUC__) /* * Evaluates to the byte offset of the per-cpu variable name. ==== //depot/projects/hammer/sys/amd64/include/profile.h#11 (text+ko) ==== @@ -82,7 +82,7 @@ #define _MCOUNT_DECL static __inline void _mcount -#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#ifdef __GNUC__ #define MCOUNT \ void \ mcount() \ @@ -105,13 +105,13 @@ frompc = ((uintfptr_t *)frompc)[1]; \ _mcount(frompc, selfpc); \ } -#else /* !(__GNUC__ || __INTEL_COMPILER) */ +#else /* __GNUC__ */ #define MCOUNT \ void \ mcount() \ { \ } -#endif /* __GNUC__ || __INTEL_COMPILER */ +#endif /* __GNUC__ */ typedef unsigned long uintfptr_t; @@ -145,7 +145,7 @@ #include <sys/cdefs.h> __BEGIN_DECLS -#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#ifdef __GNUC__ void mcount(void) __asm(".mcount"); #endif __END_DECLS
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200403132211.i2DMBERV061813>