View | Details | Raw Unified | Return to bug 205458 | Differences between
and this patch

Collapse All | Expand All

(-)sys/powerpc/ofw/ofw_machdep.c (-1 / +14 lines)
Lines 111-116 Link Here
111
	 * Assume that interrupt are disabled at this point, or
111
	 * Assume that interrupt are disabled at this point, or
112
	 * SPRG1-3 could be trashed
112
	 * SPRG1-3 could be trashed
113
	 */
113
	 */
114
#ifdef __powerpc64__
115
	__asm __volatile("mtsprg1 %1\n\t"
116
	    		 "mtsprg2 %2\n\t"
117
			 "mtsprg3 %3\n\t"
118
			 :
119
			 : "r"(ofmsr[2]),
120
			 "r"(ofmsr[3]),
121
			 "r"(ofmsr[4]));
122
#else
114
	__asm __volatile("mfsprg0 %0\n\t"
123
	__asm __volatile("mfsprg0 %0\n\t"
115
			 "mtsprg0 %1\n\t"
124
			 "mtsprg0 %1\n\t"
116
	    		 "mtsprg1 %2\n\t"
125
	    		 "mtsprg1 %2\n\t"
Lines 121-126 Link Here
121
			 "r"(ofmsr[2]),
130
			 "r"(ofmsr[2]),
122
			 "r"(ofmsr[3]),
131
			 "r"(ofmsr[3]),
123
			 "r"(ofmsr[4]));
132
			 "r"(ofmsr[4]));
133
#endif
124
}
134
}
125
135
126
static __inline void
136
static __inline void
Lines 136-142 Link Here
136
	 *
146
	 *
137
	 * PCPU data cannot be used until this routine is called !
147
	 * PCPU data cannot be used until this routine is called !
138
	 */
148
	 */
149
#ifndef __powerpc64__
139
	__asm __volatile("mtsprg0 %0" :: "r"(ofw_sprg0_save));
150
	__asm __volatile("mtsprg0 %0" :: "r"(ofw_sprg0_save));
151
#endif
140
}
152
}
141
#endif
153
#endif
142
154
Lines 344-351 Link Here
344
	ofmsr[0] = mfmsr();
356
	ofmsr[0] = mfmsr();
345
	#ifdef __powerpc64__
357
	#ifdef __powerpc64__
346
	ofmsr[0] &= ~PSL_SF;
358
	ofmsr[0] &= ~PSL_SF;
359
	#else
360
	__asm __volatile("mfsprg0 %0" : "=&r"(ofmsr[1]));
347
	#endif
361
	#endif
348
	__asm __volatile("mfsprg0 %0" : "=&r"(ofmsr[1]));
349
	__asm __volatile("mfsprg1 %0" : "=&r"(ofmsr[2]));
362
	__asm __volatile("mfsprg1 %0" : "=&r"(ofmsr[2]));
350
	__asm __volatile("mfsprg2 %0" : "=&r"(ofmsr[3]));
363
	__asm __volatile("mfsprg2 %0" : "=&r"(ofmsr[3]));
351
	__asm __volatile("mfsprg3 %0" : "=&r"(ofmsr[4]));
364
	__asm __volatile("mfsprg3 %0" : "=&r"(ofmsr[4]));

Return to bug 205458