From: Richard Henderson <richard@stommel.tamu.edu>
Subject: alpha patches for 2.1.36
Date: Sat, 26 Apr 1997 21:20:22 -0500 (CDT) [thread overview]
Message-ID: <199704270220.VAA12311@stommel.tamu.edu> (raw)
Whee. Two problems.
(1) Binutils 2.7.0.16 seems to have odd problems with the link
script. The problem being that I can't seem to catch it
doing anything in particular wrong. Nevertheless, it'll
hard-hang before getting going.
Oddly, the problem seems to go away when "-N" is removed.
I tested this solution successfully with both 2.7.0.2 and
2.7.0.16. Let me know if it goes awry for you.
(2) The gnifty ll/sc branch optimization I did hardcoded
changing back to .text, which really does bad things when
you start moving code to .text.init. Unfortunately the
assembler has a teeny bug in that you can't use .previous
after .text 2, so we simply have to back the change out
for now.
In any case, I'm currently running 2.1.36 and saving 16k worth
of initialization code and data. What fun!
r~
diff -up linux-2.1.36/include/asm-alpha/atomic.h.orig linux-2.1.36/include/asm-alpha/atomic.h
--- linux-2.1.36/include/asm-alpha/atomic.h.orig Sat Apr 26 20:23:46 1997
+++ linux-2.1.36/include/asm-alpha/atomic.h Sat Apr 26 20:27:22 1997
@@ -40,10 +40,7 @@ extern __inline__ void atomic_add(int i,
"1: ldl_l %0,%1\n"
" addl %0,%2,%0\n"
" stl_c %0,%1\n"
- " beq %0,2f\n"
- ".text 2\n"
- "2: br 1b\n"
- ".text"
+ " beq %0,1b\n"
:"=&r" (temp), "=m" (__atomic_fool_gcc(v))
:"Ir" (i), "m" (__atomic_fool_gcc(v)));
}
@@ -55,10 +52,7 @@ extern __inline__ void atomic_sub(int i,
"1: ldl_l %0,%1\n"
" subl %0,%2,%0\n"
" stl_c %0,%1\n"
- " beq %0,2f\n"
- ".text 2\n"
- "2: br 1b\n"
- ".text"
+ " beq %0,1b\n"
:"=&r" (temp), "=m" (__atomic_fool_gcc(v))
:"Ir" (i), "m" (__atomic_fool_gcc(v)));
}
@@ -74,10 +68,7 @@ extern __inline__ long atomic_add_return
" addl %0,%3,%0\n"
" mov %0,%2\n"
" stl_c %0,%1\n"
- " beq %0,2f\n"
- ".text 2\n"
- "2: br 1b\n"
- ".text"
+ " beq %0,1b\n"
:"=&r" (temp), "=m" (__atomic_fool_gcc(v)), "=&r" (result)
:"Ir" (i), "m" (__atomic_fool_gcc(v)));
return result;
@@ -91,10 +82,7 @@ extern __inline__ long atomic_sub_return
" subl %0,%3,%0\n"
" mov %0,%2\n"
" stl_c %0,%1\n"
- " beq %0,2f\n"
- ".text 2\n"
- "2: br 1b\n"
- ".text"
+ " beq %0,1b\n"
:"=&r" (temp), "=m" (__atomic_fool_gcc(v)), "=&r" (result)
:"Ir" (i), "m" (__atomic_fool_gcc(v)));
return result;
diff -up linux-2.1.36/include/asm-alpha/bitops.h.orig linux-2.1.36/include/asm-alpha/bitops.h
--- linux-2.1.36/include/asm-alpha/bitops.h.orig Sat Apr 26 20:23:54 1997
+++ linux-2.1.36/include/asm-alpha/bitops.h Sat Apr 26 20:28:07 1997
@@ -29,11 +29,8 @@ extern __inline__ unsigned long set_bit(
" bne %2,2f\n"
" xor %0,%3,%0\n"
" stl_c %0,%1\n"
- " beq %0,3f\n"
+ " beq %0,1b\n"
"2:\n"
- ".text 2\n"
- "3: br 1b\n"
- ".text"
:"=&r" (temp), "=m" (*m), "=&r" (oldbit)
:"Ir" (1UL << (nr & 31)), "m" (*m));
@@ -52,11 +49,8 @@ extern __inline__ unsigned long clear_bi
" beq %2,2f\n\t"
" xor %0,%3,%0\n\t"
" stl_c %0,%1\n\t"
- " beq %0,3f\n"
+ " beq %0,1b\n"
"2:\n"
- ".text 2\n"
- "3: br 1b\n"
- ".text"
:"=&r" (temp), "=m" (*m), "=&r" (oldbit)
:"Ir" (1UL << (nr & 31)), "m" (*m));
@@ -74,10 +68,7 @@ extern __inline__ unsigned long change_b
" and %0,%3,%2\n\t"
" xor %0,%3,%0\n\t"
" stl_c %0,%1\n\t"
- " beq %0,3f\n"
- ".text 2\n"
- "3: br 1b\n"
- ".text"
+ " beq %0,1b\n"
:"=&r" (temp), "=m" (*m), "=&r" (oldbit)
:"Ir" (1UL << (nr & 31)), "m" (*m));
diff -up linux-2.1.36/include/asm-alpha/semaphore.h.orig linux-2.1.36/include/asm-alpha/semaphore.h
--- linux-2.1.36/include/asm-alpha/semaphore.h.orig Sat Apr 26 20:23:59 1997
+++ linux-2.1.36/include/asm-alpha/semaphore.h Sat Apr 26 20:28:52 1997
@@ -45,11 +45,8 @@ static inline int waking_non_zero(struct
" ble %1,2f\n"
" subl %1,1,%0\n"
" stl_c %0,%2\n"
- " beq %0,3f\n"
+ " beq %0,1b\n"
"2:\n"
- ".text 2\n"
- "3: br 1b\n"
- ".text"
: "=r"(ret), "=r"(tmp), "=m"(__atomic_fool_gcc(&sem->waking))
: "0"(0));
diff -up linux-2.1.36/include/asm-alpha/softirq.h.orig linux-2.1.36/include/asm-alpha/softirq.h
--- linux-2.1.36/include/asm-alpha/softirq.h.orig Sat Apr 26 20:24:04 1997
+++ linux-2.1.36/include/asm-alpha/softirq.h Sat Apr 26 20:29:27 1997
@@ -16,10 +16,7 @@ static inline void clear_active_bhs(unsi
"1: ldq_l %0,%1\n"
" and %0,%2,%0\n"
" stq_c %0,%1\n"
- " beq %0,2f\n"
- ".text 2\n"
- "2: br 1b\n"
- ".text"
+ " beq %0,1b\n"
:"=&r" (temp), "=m" (bh_active)
:"Ir" (x), "m" (bh_active));
}
diff -up linux-2.1.36/include/asm-alpha/spinlock.h.orig linux-2.1.36/include/asm-alpha/spinlock.h
--- linux-2.1.36/include/asm-alpha/spinlock.h.orig Sat Apr 26 20:24:09 1997
+++ linux-2.1.36/include/asm-alpha/spinlock.h Sat Apr 26 20:30:10 1997
@@ -39,10 +39,10 @@ typedef struct { } rwlock_t;
#define write_lock_irq(lock) cli()
#define write_unlock_irq(lock) sti()
-#define read_lock_irqsave(lock, flags) save_and_cli(flags)
-#define read_unlock_irqrestore(lock, flags) restore_flags(flags)
-#define write_lock_irqsave(lock, flags) save_and_cli(flags)
-#define write_unlock_irqrestore(lock, flags) restore_flags(flags)
+#define read_lock_irqsave(lock, flags) swpipl(flags,7)
+#define read_unlock_irqrestore(lock, flags) setipl(flags)
+#define write_lock_irqsave(lock, flags) swpipl(flags,7)
+#define write_unlock_irqrestore(lock, flags) setipl(flags)
#else
diff -up linux-2.1.36/include/asm-alpha/system.h.orig linux-2.1.36/include/asm-alpha/system.h
--- linux-2.1.36/include/asm-alpha/system.h.orig Sat Apr 26 20:24:14 1997
+++ linux-2.1.36/include/asm-alpha/system.h Sat Apr 26 20:30:38 1997
@@ -128,10 +128,7 @@ extern __inline__ unsigned long xchg_u32
"1: ldl_l %0,%2\n"
" bis %3,%3,%1\n"
" stl_c %1,%2\n"
- " beq %1,2f\n"
- ".text 2\n"
- "2: br 1b\n"
- ".text"
+ " beq %1,1b\n"
: "=&r" (val), "=&r" (dummy), "=m" (*m)
: "r" (val), "m" (*m));
@@ -146,10 +143,7 @@ extern __inline__ unsigned long xchg_u64
"1: ldq_l %0,%2\n"
" bis %3,%3,%1\n"
" stq_c %1,%2\n"
- " beq %1,2f\n"
- ".text 2\n"
- "2: br 1b\n"
- ".text"
+ " beq %1,1b\n"
: "=&r" (val), "=&r" (dummy), "=m" (*m)
: "r" (val), "m" (*m));
diff -up linux-2.1.36/arch/alpha/Makefile.orig linux-2.1.36/arch/alpha/Makefile
--- linux-2.1.36/arch/alpha/Makefile.orig Sat Apr 26 20:23:23 1997
+++ linux-2.1.36/arch/alpha/Makefile Sat Apr 26 20:22:57 1997
@@ -10,7 +10,7 @@
NM := nm -B
-LINKFLAGS = -static -T arch/alpha/vmlinux.lds -N
+LINKFLAGS = -static -T arch/alpha/vmlinux.lds
CFLAGS := $(CFLAGS) -pipe -mno-fp-regs -ffixed-8
HEAD := arch/alpha/kernel/head.o
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
next reply other threads:[~1997-04-27 2:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-04-27 2:20 Richard Henderson [this message]
[not found] <richard@stommel.tamu.edu>
1997-04-27 5:19 ` alpha patches for 2.1.36 Bryan W. Headley
1997-04-27 6:35 ` Richard Henderson
1997-04-27 8:41 ` Matthew Geier
1997-04-27 18:56 ` D. Champion
1997-04-27 17:08 ` Bryan W. Headley
1997-04-27 20:44 ` Bryan W. Headley
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox