Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/powerpc/include - Indent ifdefs, comment endif and ...
details: https://anonhg.NetBSD.org/src/rev/58270f6277bc
branches: trunk
changeset: 770628:58270f6277bc
user: christos <christos%NetBSD.org@localhost>
date: Wed Oct 26 01:46:11 2011 +0000
description:
- Indent ifdefs, comment endif and else cpp tags
- Add missing END macro for LP64
- Make whitespace consistent
diffstat:
sys/arch/powerpc/include/asm.h | 394 ++++++++++++++++++++--------------------
1 files changed, 193 insertions(+), 201 deletions(-)
diffs (truncated from 522 to 300 lines):
diff -r f80f1e009daa -r 58270f6277bc sys/arch/powerpc/include/asm.h
--- a/sys/arch/powerpc/include/asm.h Wed Oct 26 00:57:36 2011 +0000
+++ b/sys/arch/powerpc/include/asm.h Wed Oct 26 01:46:11 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: asm.h,v 1.38 2011/06/08 05:11:07 matt Exp $ */
+/* $NetBSD: asm.h,v 1.39 2011/10/26 01:46:11 christos Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -38,20 +38,20 @@
/* ppc64 is always PIC, r2 is always the TOC */
-#define PIC_PLT(x) .x
+# define PIC_PLT(x) .x
#else
-#ifdef PIC
-#define PIC_PROLOGUE XXX
-#define PIC_EPILOGUE XXX
-#define PIC_PLT(x) x+32768@plt
-#ifdef __STDC__
-#define PIC_TOCNAME(name) .LCTOC_##name
-#else
-#define PIC_TOCNAME(name) .LCTOC_/**/name
-#endif
-#define PIC_TOCSETUP(name, reg) \
+# ifdef PIC
+# define PIC_PROLOGUE XXX
+# define PIC_EPILOGUE XXX
+# define PIC_PLT(x) x+32768@plt
+# ifdef __STDC__
+# define PIC_TOCNAME(name) .LCTOC_##name
+# else
+# define PIC_TOCNAME(name) .LCTOC_/**/name
+# endif /* __STDC __*/
+# define PIC_TOCSETUP(name, reg) \
.pushsection ".got2","aw" ;\
PIC_TOCNAME(name) = . + 32768 ;\
.popsection ;\
@@ -59,29 +59,29 @@
1001: mflr reg ;\
addis reg,reg,PIC_TOCNAME(name)-1001b@ha ;\
addi reg,reg,PIC_TOCNAME(name)-1001b@l
-#define PIC_GOTSETUP(reg) \
+# define PIC_GOTSETUP(reg) \
bcl 20,31,2002f ;\
2002: mflr reg ;\
addis reg,reg,_GLOBAL_OFFSET_TABLE_-2002b@ha ;\
addi reg,reg,_GLOBAL_OFFSET_TABLE_-2002b@l
-#ifdef __STDC__
-#define PIC_GOT(x) XXX
-#define PIC_GOTOFF(x) XXX
-#else /* not __STDC__ */
-#define PIC_GOT(x) XXX
-#define PIC_GOTOFF(x) XXX
-#endif /* __STDC__ */
-#else
-#define PIC_PROLOGUE
-#define PIC_EPILOGUE
-#define PIC_PLT(x) x
-#define PIC_GOT(x) x
-#define PIC_GOTOFF(x) x
-#define PIC_GOTSETUP(r)
-#define PIC_TOCSETUP(n, r)
-#endif
+# ifdef __STDC__
+# define PIC_GOT(x) XXX
+# define PIC_GOTOFF(x) XXX
+# else /* not __STDC__ */
+# define PIC_GOT(x) XXX
+# define PIC_GOTOFF(x) XXX
+# endif /* __STDC__ */
+# else /* !PIC */
+# define PIC_PROLOGUE
+# define PIC_EPILOGUE
+# define PIC_PLT(x) x
+# define PIC_GOT(x) x
+# define PIC_GOTOFF(x) x
+# define PIC_GOTSETUP(r)
+# define PIC_TOCSETUP(n, r)
+# endif /* PIC */
-#endif
+#endif /* __LP64__ */
#define _C_LABEL(x) x
#define _ASM_LABEL(x) x
@@ -97,16 +97,16 @@
#ifdef _LP64
-#define SF_HEADER_SZ 48
-#define SF_PARAM_SZ 64
-#define SF_SZ (SF_HEADER_SZ + SF_PARAM_SZ)
+# define SF_HEADER_SZ 48
+# define SF_PARAM_SZ 64
+# define SF_SZ (SF_HEADER_SZ + SF_PARAM_SZ)
-#define SF_SP 0
-#define SF_CR 8
-#define SF_LR 16
-#define SF_PARAM SF_HEADER_SZ
+# define SF_SP 0
+# define SF_CR 8
+# define SF_LR 16
+# define SF_PARAM SF_HEADER_SZ
-#define ENTRY(y) \
+# define ENTRY(y) \
.globl y; \
.section ".opd","aw"; \
.align 3; \
@@ -118,27 +118,29 @@
.align 3; \
.y:
-#define CALL(y) \
+# define END(y)
+
+# define CALL(y) \
bl .y; \
nop
-#define ENTRY_NOPROFILE(y) ENTRY(y)
-#define ASENTRY(y) ENTRY(y)
-#else
+# define ENTRY_NOPROFILE(y) ENTRY(y)
+# define ASENTRY(y) ENTRY(y)
+#else /* !_LP64 */
-#define _ENTRY(x) \
+# define _ENTRY(x) \
.text; .align 2; .globl x; .type x,@function; x:
-#define ENTRY(y) _ENTRY(_C_LABEL(y)); _PROF_PROLOGUE
-#define END(y) .size _C_LABEL(y),.-_C_LABEL(y)
+# define ENTRY(y) _ENTRY(_C_LABEL(y)); _PROF_PROLOGUE
-#define ENTRY_NOPROFILE(y) _ENTRY(_C_LABEL(y))
+# define END(y) .size _C_LABEL(y),.-_C_LABEL(y)
-#define CALL(y) \
+# define CALL(y) \
bl y
-#define ASENTRY(y) _ENTRY(_ASM_LABEL(y)); _PROF_PROLOGUE
-#endif
+# define ENTRY_NOPROFILE(y) _ENTRY(_C_LABEL(y))
+# define ASENTRY(y) _ENTRY(_ASM_LABEL(y)); _PROF_PROLOGUE
+#endif /* __LP64__ */
#define GLOBAL(y) _GLOBAL(_C_LABEL(y))
@@ -149,10 +151,10 @@
#define __RCSID(x) .pushsection .ident; .asciz x; .popsection
#ifdef __ELF__
-#define WEAK_ALIAS(alias,sym) \
+# define WEAK_ALIAS(alias,sym) \
.weak alias; \
alias = sym
-#endif
+#endif /* __ELF__ */
/*
* STRONG_ALIAS: create a strong alias.
*/
@@ -161,12 +163,12 @@
alias = sym
#ifdef __STDC__
-#define WARN_REFERENCES(sym,msg) \
+# define WARN_REFERENCES(sym,msg) \
.pushsection .gnu.warning. ## sym; \
.ascii msg; \
.popsection
#else
-#define WARN_REFERENCES(sym,msg) \
+# define WARN_REFERENCES(sym,msg) \
.pushsection .gnu.warning./**/sym; \
.ascii msg; \
.popsection
@@ -176,7 +178,7 @@
/*
* Get cpu_info pointer for current processor. Always in SPRG0. *ALWAYS*
*/
-#define GET_CPUINFO(r) mfsprg r,0
+# define GET_CPUINFO(r) mfsprg r,0
/*
* IN:
* R4[er] = first free byte beyond end/esym.
@@ -186,18 +188,18 @@
* R4[er] = kernelend
*/
-#ifdef CI_INTSTK
-#define INIT_CPUINFO_INTSTK(er,tmp1) \
+# ifdef CI_INTSTK
+# define INIT_CPUINFO_INTSTK(er,tmp1) \
addi er,er,INTSTK; \
stptr er,CI_INTSTK(tmp1)
-#else
-#define INIT_CPUINFO_INTSTK(er,tmp1) /* nothing */
-#endif
+# else
+# define INIT_CPUINFO_INTSTK(er,tmp1) /* nothing */
+# endif /* CI_INTSTK */
/*
* We use lis/ori instead of lis/addi in case tmp2 is r0.
*/
-#define INIT_CPUINFO(er,sp,tmp1,tmp2) \
+# define INIT_CPUINFO(er,sp,tmp1,tmp2) \
li tmp1,PAGE_MASK; \
add er,er,tmp1; \
andc er,er,tmp1; /* page align */ \
@@ -223,166 +225,156 @@
stptr tmp2,-CALLFRAMELEN(er); /* end of stack chain */ \
stptru tmp2,-CALLFRAMELEN(sp) /* end of stack chain */
-#endif
-
-/* Condition Register Bit Fields */
+#endif /* _KERNEL */
-#if defined(_REGNAMES)
-#if defined(_KERNEL) || defined(_STANDALONE)
-#define cr0 0
-#define cr1 1
-#define cr2 2
-#define cr3 3
-#define cr4 4
-#define cr5 5
-#define cr6 6
-#define cr7 7
-#endif
-
-/* General Purpose Registers (GPRs) */
-#if defined(_KERNEL) || defined(_STANDALONE)
-#define r0 0
-#define r1 1
-#define r2 2
-#define r3 3
-#define r4 4
-#define r5 5
-#define r6 6
-#define r7 7
-#define r8 8
-#define r9 9
-#define r10 10
-#define r11 11
-#define r12 12
-#define r13 13
-#define r14 14
-#define r15 15
-#define r16 16
-#define r17 17
-#define r18 18
-#define r19 19
-#define r20 20
-#define r21 21
-#define r22 22
-#define r23 23
-#define r24 24
-#define r25 25
-#define r26 26
-#define r27 27
-#define r28 28
-#define r29 29
-#define r30 30
-#define r31 31
-#endif
-
-/* Floating Point Registers (FPRs) */
-
-#if defined(_KERNEL) || defined(_STANDALONE)
-#define fr0 0
-#define fr1 1
-#define fr2 2
-#define fr3 3
-#define fr4 4
-#define fr5 5
-#define fr6 6
-#define fr7 7
-#define fr8 8
-#define fr9 9
-#define fr10 10
-#define fr11 11
-#define fr12 12
-#define fr13 13
-#define fr14 14
-#define fr15 15
-#define fr16 16
-#define fr17 17
-#define fr18 18
-#define fr19 19
-#define fr20 20
-#define fr21 21
Home |
Main Index |
Thread Index |
Old Index