aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2005-03-11 22:16:09 +0000
committerPeter Wemm <peter@FreeBSD.org>2005-03-11 22:16:09 +0000
commitcf4e1c4613cfe253ceb3ca9f19809d9e16176458 (patch)
treeddbe8c86d2a04265c84a057694ee46c3a70acd8b /sys/amd64
parent9e647d96292be1ea40e5f8022e44b8207cca57bd (diff)
downloadsrc-cf4e1c4613cfe253ceb3ca9f19809d9e16176458.tar.gz
src-cf4e1c4613cfe253ceb3ca9f19809d9e16176458.zip
Remove diffs to i386 version that came in via the compiler support ifdefs.
This changes things like whitespace, inconsistent use of #ifndef vs #if !defined(), different macro argument orders, mismatched comments, etc.
Notes
Notes: svn path=/head/; revision=143434
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/fpu.c4
-rw-r--r--sys/amd64/include/_types.h4
-rw-r--r--sys/amd64/include/bus_amd64.h32
-rw-r--r--sys/amd64/include/cpufunc.h4
-rw-r--r--sys/amd64/include/critical.h4
-rw-r--r--sys/amd64/include/in_cksum.h4
-rw-r--r--sys/amd64/include/pcpu.h4
-rw-r--r--sys/amd64/include/profile.h4
-rw-r--r--sys/amd64/include/stdarg.h3
-rw-r--r--sys/amd64/include/varargs.h2
10 files changed, 37 insertions, 28 deletions
diff --git a/sys/amd64/amd64/fpu.c b/sys/amd64/amd64/fpu.c
index d727a4191d0e..eeb39e808c43 100644
--- a/sys/amd64/amd64/fpu.c
+++ b/sys/amd64/amd64/fpu.c
@@ -77,7 +77,7 @@ __FBSDID("$FreeBSD$");
: : "n" (CR0_TS) : "ax")
#define stop_emulating() __asm("clts")
-#else /* !__GNUCLIKE_ASM */
+#else /* !(__GNUCLIKE_ASM && !lint) */
void fldcw(caddr_t addr);
void fnclex(void);
@@ -89,7 +89,7 @@ void fxrstor(caddr_t addr);
void start_emulating(void);
void stop_emulating(void);
-#endif /* __GNUCLIKE_ASM */
+#endif /* __GNUCLIKE_ASM && !lint */
#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)
diff --git a/sys/amd64/include/_types.h b/sys/amd64/include/_types.h
index 709cc161665f..ab19b6c060c6 100644
--- a/sys/amd64/include/_types.h
+++ b/sys/amd64/include/_types.h
@@ -108,8 +108,8 @@ typedef char * __va_list; /* pretend */
#endif
#if defined(__GNUC_VA_LIST_COMPATIBILITY) && !defined(__GNUC_VA_LIST) \
&& !defined(__NO_GNUC_VA_LIST)
-#define __GNUC_VA_LIST
-typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/
+#define __GNUC_VA_LIST
+typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/
#endif
#endif /* !_MACHINE__TYPES_H_ */
diff --git a/sys/amd64/include/bus_amd64.h b/sys/amd64/include/bus_amd64.h
index 9e0bc45085af..b3b53fb3f753 100644
--- a/sys/amd64/include/bus_amd64.h
+++ b/sys/amd64/include/bus_amd64.h
@@ -72,6 +72,10 @@
#ifndef _AMD64_BUS_AMD64_H_
#define _AMD64_BUS_AMD64_H_
+#ifndef _SYS_CDEFS_H_
+#error this file needs sys/cdefs.h as a prerequisite
+#endif
+
#include <machine/cpufunc.h>
#ifndef _SYS_CDEFS_H_
@@ -437,7 +441,7 @@ bus_space_read_region_2(bus_space_tag_t tag, bus_space_handle_t bsh,
#endif
{
int _port_ = bsh + offset;
-#ifdef __GNUCLIKE_ASM
+#ifdef __GNUCLIKE_ASM
__asm __volatile(" \n\
cld \n\
1: inw %w2,%%ax \n\
@@ -456,7 +460,7 @@ bus_space_read_region_2(bus_space_tag_t tag, bus_space_handle_t bsh,
#endif
{
bus_space_handle_t _port_ = bsh + offset;
-#ifdef __GNUCLIKE_ASM
+#ifdef __GNUCLIKE_ASM
__asm __volatile(" \n\
cld \n\
repne \n\
@@ -479,7 +483,7 @@ bus_space_read_region_4(bus_space_tag_t tag, bus_space_handle_t bsh,
#endif
{
int _port_ = bsh + offset;
-#ifdef __GNUCLIKE_ASM
+#ifdef __GNUCLIKE_ASM
__asm __volatile(" \n\
cld \n\
1: inl %w2,%%eax \n\
@@ -498,7 +502,7 @@ bus_space_read_region_4(bus_space_tag_t tag, bus_space_handle_t bsh,
#endif
{
bus_space_handle_t _port_ = bsh + offset;
-#ifdef __GNUCLIKE_ASM
+#ifdef __GNUCLIKE_ASM
__asm __volatile(" \n\
cld \n\
repne \n\
@@ -627,7 +631,7 @@ bus_space_write_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh,
else
#endif
{
-#ifdef __GNUCLIKE_ASM
+#ifdef __GNUCLIKE_ASM
__asm __volatile(" \n\
cld \n\
1: lodsb \n\
@@ -656,7 +660,7 @@ bus_space_write_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh,
else
#endif
{
-#ifdef __GNUCLIKE_ASM
+#ifdef __GNUCLIKE_ASM
__asm __volatile(" \n\
cld \n\
1: lodsw \n\
@@ -685,7 +689,7 @@ bus_space_write_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh,
else
#endif
{
-#ifdef __GNUCLIKE_ASM
+#ifdef __GNUCLIKE_ASM
__asm __volatile(" \n\
cld \n\
1: lodsl \n\
@@ -735,7 +739,7 @@ bus_space_write_region_1(bus_space_tag_t tag, bus_space_handle_t bsh,
#endif
{
int _port_ = bsh + offset;
-#ifdef __GNUCLIKE_ASM
+#ifdef __GNUCLIKE_ASM
__asm __volatile(" \n\
cld \n\
1: lodsb \n\
@@ -754,7 +758,7 @@ bus_space_write_region_1(bus_space_tag_t tag, bus_space_handle_t bsh,
#endif
{
bus_space_handle_t _port_ = bsh + offset;
-#ifdef __GNUCLIKE_ASM
+#ifdef __GNUCLIKE_ASM
__asm __volatile(" \n\
cld \n\
repne \n\
@@ -777,7 +781,7 @@ bus_space_write_region_2(bus_space_tag_t tag, bus_space_handle_t bsh,
#endif
{
int _port_ = bsh + offset;
-#ifdef __GNUCLIKE_ASM
+#ifdef __GNUCLIKE_ASM
__asm __volatile(" \n\
cld \n\
1: lodsw \n\
@@ -796,7 +800,7 @@ bus_space_write_region_2(bus_space_tag_t tag, bus_space_handle_t bsh,
#endif
{
bus_space_handle_t _port_ = bsh + offset;
-#ifdef __GNUCLIKE_ASM
+#ifdef __GNUCLIKE_ASM
__asm __volatile(" \n\
cld \n\
repne \n\
@@ -819,7 +823,7 @@ bus_space_write_region_4(bus_space_tag_t tag, bus_space_handle_t bsh,
#endif
{
int _port_ = bsh + offset;
-#ifdef __GNUCLIKE_ASM
+#ifdef __GNUCLIKE_ASM
__asm __volatile(" \n\
cld \n\
1: lodsl \n\
@@ -838,7 +842,7 @@ bus_space_write_region_4(bus_space_tag_t tag, bus_space_handle_t bsh,
#endif
{
bus_space_handle_t _port_ = bsh + offset;
-#ifdef __GNUCLIKE_ASM
+#ifdef __GNUCLIKE_ASM
__asm __volatile(" \n\
cld \n\
repne \n\
@@ -1217,7 +1221,7 @@ 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 __GNUCLIKE_ASM
+#ifdef __GNUCLIKE_ASM
if (flags & BUS_SPACE_BARRIER_READ)
__asm __volatile("lock; addl $0,0(%%rsp)" : : : "memory");
else
diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h
index 4c596a02ebe1..60231fb482ab 100644
--- a/sys/amd64/include/cpufunc.h
+++ b/sys/amd64/include/cpufunc.h
@@ -161,7 +161,7 @@ halt(void)
#define inb(port) inbv(port)
#define outb(port, data) outbv(port, data)
-#else /* __GNUCLIKE_BUILTIN_CONSTANT_P && __GNUCLIKE_ASM >= 3 */
+#else /* __GNUCLIKE_BUILTIN_CONSTANT_P && __GNUCLIKE_ASM >= 3 */
/*
* The following complications are to get around gcc not having a
@@ -208,7 +208,7 @@ outbc(u_int port, u_char data)
__asm __volatile("outb %0,%1" : : "a" (data), "id" ((u_short)(port)));
}
-#endif /* __GNUCLIKE_BUILTIN_CONSTANT_P */
+#endif /* __GNUCLIKE_BUILTIN_CONSTANT_P && __GNUCLIKE_ASM >= 3*/
static __inline u_char
inbv(u_int port)
diff --git a/sys/amd64/include/critical.h b/sys/amd64/include/critical.h
index 37ba264b38d8..ac85f2f452c2 100644
--- a/sys/amd64/include/critical.h
+++ b/sys/amd64/include/critical.h
@@ -46,7 +46,7 @@ __BEGIN_DECLS
*/
void cpu_critical_fork_exit(void);
-#ifdef __CC_SUPPORTS___INLINE
+#ifdef __CC_SUPPORTS___INLINE
/*
* cpu_critical_enter:
@@ -79,7 +79,7 @@ cpu_critical_exit(struct thread *td)
void cpu_critical_enter(struct thread *td);
void cpu_critical_exit(struct thread *td);
-#endif /* __CC_SUPPORTS___INLINE */
+#endif /* __CC_SUPPORTS___INLINE */
__END_DECLS
diff --git a/sys/amd64/include/in_cksum.h b/sys/amd64/include/in_cksum.h
index 09920062a0ae..adfde8f22d1b 100644
--- a/sys/amd64/include/in_cksum.h
+++ b/sys/amd64/include/in_cksum.h
@@ -35,6 +35,10 @@
#ifndef _MACHINE_IN_CKSUM_H_
#define _MACHINE_IN_CKSUM_H_ 1
+#ifndef _SYS_CDEFS_H_
+#error this file needs sys/cdefs.h as a prerequisite
+#endif
+
#include <sys/cdefs.h>
#define in_cksum(m, len) in_cksum_skip(m, len, 0)
diff --git a/sys/amd64/include/pcpu.h b/sys/amd64/include/pcpu.h
index b9d4a6171911..414bd9335aa1 100644
--- a/sys/amd64/include/pcpu.h
+++ b/sys/amd64/include/pcpu.h
@@ -59,8 +59,8 @@ extern struct pcpu *pcpup;
#define PCPU_PTR(member) (&pcpup->pc_ ## member)
#define PCPU_SET(member,value) (pcpup->pc_ ## member = (value))
-#elif defined(__GNUCLIKE___TYPEOF) && defined(__GNUCLIKE___OFFSETOF) \
- && defined(__GNUCLIKE_ASM)
+#elif defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE___TYPEOF) \
+ && defined(__GNUCLIKE___OFFSETOF)
/*
* Evaluates to the byte offset of the per-cpu variable name.
diff --git a/sys/amd64/include/profile.h b/sys/amd64/include/profile.h
index 93e8614523f3..44bb6e7c4b97 100644
--- a/sys/amd64/include/profile.h
+++ b/sys/amd64/include/profile.h
@@ -75,7 +75,7 @@
#define MEXITCOUNT_OVERHEAD_GETLABEL()
#else
#error this file needs to be ported to your compiler
-#endif /* __GNUCLIKE_ASM */
+#endif /* !__GNUCLIKE_ASM */
#else /* !GUPROF */
#define MCOUNT_DECL(s) u_long s;
#ifdef SMP
@@ -112,7 +112,7 @@ void user(void);
static void _mcount(uintfptr_t frompc, uintfptr_t selfpc) __used; \
static void _mcount
-#ifdef __GNUCLIKE_ASM
+#ifdef __GNUCLIKE_ASM
#define MCOUNT __asm(" \n\
.globl .mcount \n\
.type .mcount @function \n\
diff --git a/sys/amd64/include/stdarg.h b/sys/amd64/include/stdarg.h
index d3612d21e830..a0c1662ce74b 100644
--- a/sys/amd64/include/stdarg.h
+++ b/sys/amd64/include/stdarg.h
@@ -39,7 +39,8 @@
typedef __va_list va_list;
#endif
-#if defined(__GNUCLIKE_BUILTIN_STDARG)
+#ifdef __GNUCLIKE_BUILTIN_STDARG
+
#define va_start(ap, last) \
__builtin_stdarg_start((ap), (last))
diff --git a/sys/amd64/include/varargs.h b/sys/amd64/include/varargs.h
index 3b9f542f28fd..93faac6a84dd 100644
--- a/sys/amd64/include/varargs.h
+++ b/sys/amd64/include/varargs.h
@@ -71,7 +71,7 @@ typedef char *va_list;
#define __va_size(type) \
(((sizeof(type) + sizeof(int) - 1) / sizeof(int)) * sizeof(int))
-#ifdef __GNUCLIKE_BUILTIN_VAALIST
+#if defined(__GNUCLIKE_BUILTIN_VAALIST)
#define va_alist __builtin_va_alist
#endif
#define va_dcl int va_alist; ...