Sun Jan 23 15:51:07 2011 UTC ()
Some ports use %r0 as tmp2 to INIT_CPUINFO which has adverse effects so
never use tmp2 to hold an address.


(matt)
diff -r1.34 -r1.35 src/sys/arch/powerpc/include/asm.h

cvs diff -r1.34 -r1.35 src/sys/arch/powerpc/include/asm.h (expand / switch to unified diff)

--- src/sys/arch/powerpc/include/asm.h 2011/01/18 01:02:54 1.34
+++ src/sys/arch/powerpc/include/asm.h 2011/01/23 15:51:07 1.35
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: asm.h,v 1.34 2011/01/18 01:02:54 matt Exp $ */ 1/* $NetBSD: asm.h,v 1.35 2011/01/23 15:51:07 matt Exp $ */
2 2
3/* 3/*
4 * Copyright (C) 1995, 1996 Wolfgang Solfrank. 4 * Copyright (C) 1995, 1996 Wolfgang Solfrank.
5 * Copyright (C) 1995, 1996 TooLs GmbH. 5 * Copyright (C) 1995, 1996 TooLs GmbH.
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
11 * 1. Redistributions of source code must retain the above copyright 11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer. 12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
@@ -201,32 +201,32 @@ y: .quad .y,.TOC.@tocbase,0; \ @@ -201,32 +201,32 @@ y: .quad .y,.TOC.@tocbase,0; \
201 li tmp1,PAGE_MASK; \ 201 li tmp1,PAGE_MASK; \
202 add er,er,tmp1; \ 202 add er,er,tmp1; \
203 andc er,er,tmp1; /* page align */ \ 203 andc er,er,tmp1; /* page align */ \
204 lis tmp1,_C_LABEL(cpu_info)@ha; \ 204 lis tmp1,_C_LABEL(cpu_info)@ha; \
205 addi tmp1,tmp1,_C_LABEL(cpu_info)@l; \ 205 addi tmp1,tmp1,_C_LABEL(cpu_info)@l; \
206 mtsprg0 tmp1; /* save for later use */ \ 206 mtsprg0 tmp1; /* save for later use */ \
207 INIT_CPUINFO_INTSTK(er,tmp1); \ 207 INIT_CPUINFO_INTSTK(er,tmp1); \
208 lis tmp2,_C_LABEL(emptyidlespin)@h; \ 208 lis tmp2,_C_LABEL(emptyidlespin)@h; \
209 ori tmp2,tmp2,_C_LABEL(emptyidlespin)@l; \ 209 ori tmp2,tmp2,_C_LABEL(emptyidlespin)@l; \
210 stptr tmp2,CI_IDLESPIN(tmp1); \ 210 stptr tmp2,CI_IDLESPIN(tmp1); \
211 li tmp2,-1; \ 211 li tmp2,-1; \
212 stint tmp2,CI_IDEPTH(tmp1); \ 212 stint tmp2,CI_IDEPTH(tmp1); \
213 li tmp2,0; \ 213 li tmp2,0; \
214 lis tmp2,_C_LABEL(lwp0)@h; \ 214 lis tmp1,_C_LABEL(lwp0)@h; \
215 ori tmp2,tmp2,_C_LABEL(lwp0)@l; \ 215 ori tmp1,tmp1,_C_LABEL(lwp0)@l; \
216 stptr er,L_PCB(tmp2); /* XXXuvm_lwp_getuarea */ \ 216 stptr er,L_PCB(tmp1); /* XXXuvm_lwp_getuarea */ \
217 addi er,er,USPACE; /* stackpointer for lwp0 */ \ 217 addi er,er,USPACE; /* stackpointer for lwp0 */ \
218 addi sp,er,-FRAMELEN-CALLFRAMELEN; /* stackpointer for lwp0 */ \ 218 addi sp,er,-FRAMELEN-CALLFRAMELEN; /* stackpointer for lwp0 */ \
219 stptr sp,L_MD_UTF(tmp2); /* save in lwp0.l_md.md_utf */ \ 219 stptr sp,L_MD_UTF(tmp1); /* save in lwp0.l_md.md_utf */ \
220 /* er = end of mem reserved for kernel */ \ 220 /* er = end of mem reserved for kernel */ \
221 li tmp2,0; \ 221 li tmp2,0; \
222 stptr tmp2,-CALLFRAMELEN(er); /* end of stack chain */ \ 222 stptr tmp2,-CALLFRAMELEN(er); /* end of stack chain */ \
223 stptru tmp2,-CALLFRAMELEN(sp) /* end of stack chain */ 223 stptru tmp2,-CALLFRAMELEN(sp) /* end of stack chain */
224 224
225#endif 225#endif
226 226
227/* Condition Register Bit Fields */ 227/* Condition Register Bit Fields */
228 228
229#if defined(_REGNAMES) 229#if defined(_REGNAMES)
230#if defined(_KERNEL) || defined(_STANDALONE) 230#if defined(_KERNEL) || defined(_STANDALONE)
231#define cr0 0 231#define cr0 0
232#define cr1 1 232#define cr1 1