patch-2.3.99-pre7 linux/arch/ppc/kernel/misc.S
Next file: linux/arch/ppc/kernel/pmac_nvram.c
Previous file: linux/arch/ppc/kernel/m8xx_setup.c
Back to the patch index
Back to the overall index
- Lines: 61
- Date:
Tue May 2 13:05:39 2000
- Orig file:
v2.3.99-pre6/linux/arch/ppc/kernel/misc.S
- Orig date:
Wed Apr 26 16:34:07 2000
diff -u --recursive --new-file v2.3.99-pre6/linux/arch/ppc/kernel/misc.S linux/arch/ppc/kernel/misc.S
@@ -18,6 +18,7 @@
#include <asm/errno.h>
#include <asm/processor.h>
#include <asm/page.h>
+#include <asm/cache.h>
#include "ppc_asm.h"
#if defined(CONFIG_4xx) || defined(CONFIG_8xx)
@@ -165,6 +166,11 @@
* This is a no-op on the 601.
*/
_GLOBAL(flush_instruction_cache)
+#ifdef CONFIG_8xx
+ isync
+ lis r5, IDC_INVALL@h
+ mtspr IC_CST, r5
+#else
mfspr r3,PVR
rlwinm r3,r3,16,16,31
cmpi 0,r3,1
@@ -173,6 +179,7 @@
mfspr r3,HID0
ori r3,r3,HID0_ICFI
mtspr HID0,r3
+#endif /* CONFIG_8xx */
SYNC
blr
@@ -241,8 +248,7 @@
rlwinm r5,r5,16,16,31
cmpi 0,r5,1
beqlr /* for 601, do nothing */
- li r4,0x0FFF
- andc r3,r3,r4 /* Get page base address */
+ rlwinm r3,r3,0,0,19 /* Get page base address */
li r4,4096/CACHE_LINE_SIZE /* Number of lines in a page */
mtctr r4
mr r6,r3
@@ -373,6 +379,7 @@
* void atomic_clear_mask(atomic_t mask, atomic_t *addr)
* void atomic_set_mask(atomic_t mask, atomic_t *addr);
*/
+#if 0 /* now inline - paulus */
_GLOBAL(atomic_add)
10: lwarx r5,0,r4 /* Fetch old value & reserve */
add r5,r5,r3 /* Perform 'add' operation */
@@ -423,11 +430,10 @@
subi r5,r5,1 /* Perform 'add' operation */
stwcx. r5,0,r3 /* Update with new value */
bne- 10b /* Retry if "reservation" (i.e. lock) lost */
- cmpi 0,r5,0 /* Return 'true' IFF 0 */
- li r3,1
- beqlr
- li r3,0
+ cntlzw r3,r5
+ srwi r3,r3,5
blr
+#endif /* 0 */
_GLOBAL(atomic_clear_mask)
10: lwarx r5,0,r4
andc r5,r5,r3
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)