2002-06-21 06:48:48

by jurriaan

[permalink] [raw]
Subject: 2.5.24 doesn't compile on Alpha

After applying this diff to get past the most obvious errors:

[yes, it applies clean against 2.5.24 still]

diff -Br -b -U 3 -N linux-2.5.20/drivers/char/rtc.c linux-2.5.20-jwk/drivers/char/rtc.c
--- linux-2.5.20/drivers/char/rtc.c Sat Jun 8 15:44:46 2002
+++ linux-2.5.20-jwk/drivers/char/rtc.c Sun Jun 9 08:28:23 2002
@@ -72,6 +72,7 @@
#include <linux/sysctl.h>

#include <asm/io.h>
+#include <asm/irq.h>
#include <asm/uaccess.h>
#include <asm/system.h>

diff -Br -b -U 3 -N linux-2.5.20/include/asm-alpha/bitops.h linux-2.5.20-jwk/include/asm-alpha/bitops.h
--- linux-2.5.20/include/asm-alpha/bitops.h Wed Apr 24 09:15:19 2002
+++ linux-2.5.20-jwk/include/asm-alpha/bitops.h Sun Jun 9 08:51:55 2002
@@ -451,6 +451,12 @@
}

/*
+ * fls: find last bit set.
+ */
+
+#define fls(x) generic_fls(x)
+
+/*
* The optimizer actually does good code for this case.
*/
#define find_first_zero_bit(addr, size) \
diff -Br -b -U 3 -N linux-2.5.20/include/asm-alpha/irq.h linux-2.5.20-jwk/include/asm-alpha/irq.h
--- linux-2.5.20/include/asm-alpha/irq.h Wed Apr 24 09:15:18 2002
+++ linux-2.5.20-jwk/include/asm-alpha/irq.h Sun Jun 9 08:51:56 2002
@@ -37,6 +37,7 @@
defined(CONFIG_ALPHA_RX164) || \
defined(CONFIG_ALPHA_NORITAKE)
# define NR_IRQS 48
+# define RTC_IRQ 8

#elif defined(CONFIG_ALPHA_SABLE) || \
defined(CONFIG_ALPHA_SX164)
diff -Br -b -U 3 -N linux-2.5.20/include/asm-alpha/page.h linux-2.5.20-jwk/include/asm-alpha/page.h
--- linux-2.5.20/include/asm-alpha/page.h Wed Apr 24 09:15:21 2002
+++ linux-2.5.20-jwk/include/asm-alpha/page.h Sun Jun 9 08:51:55 2002
@@ -15,10 +15,10 @@
#define STRICT_MM_TYPECHECKS

extern void clear_page(void *page);
-#define clear_user_page(page, vaddr) clear_page(page)
+#define clear_user_page(page, vaddr, pg) clear_page(page)

extern void copy_page(void * _to, void * _from);
-#define copy_user_page(to, from, vaddr) copy_page(to, from)
+#define copy_user_page(to, from, vaddr, pg) copy_page(to, from)

#ifdef STRICT_MM_TYPECHECKS
/*


I still get errors:

alpha:/usr/src/linux-2.5.24# make boot
make[1]: Entering directory `/usr/src/linux-2.5.24/scripts'
make[1]: Leaving directory `/usr/src/linux-2.5.24/scripts'
make[1]: Entering directory `/usr/src/linux-2.5.24/arch/alpha/kernel'
gcc -Wp,-MD,./.asm-offsets.s.d -D__KERNEL__ -I/usr/src/linux-2.5.24/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-fra
me-pointer -fno-strict-aliasing -fno-common -pipe -mno-fp-regs -ffixed-8 -mcpu=ev56 -Wa,-mev6 -nostdinc -iwithprefix include -DKBU
ILD_BASENAME=asm_offsets -S -o asm-offsets.s asm-offsets.c
make[1]: Leaving directory `/usr/src/linux-2.5.24/arch/alpha/kernel'
Generating include/asm-alpha/asm_offsets.h (unchanged)
Starting the build. KBUILD_BUILTIN=1 KBUILD_MODULES=
make[1]: Entering directory `/usr/src/linux-2.5.24/init'
gcc -Wp,-MD,./.main.o.d -D__KERNEL__ -I/usr/src/linux-2.5.24/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-poin
ter -fno-strict-aliasing -fno-common -pipe -mno-fp-regs -ffixed-8 -mcpu=ev56 -Wa,-mev6 -nostdinc -iwithprefix include -DKBUILD_BAS
ENAME=main -c -o main.o main.c
Generating /usr/src/linux-2.5.24/include/linux/compile.h (updated)
gcc -Wp,-MD,./.version.o.d -D__KERNEL__ -I/usr/src/linux-2.5.24/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-p
ointer -fno-strict-aliasing -fno-common -pipe -mno-fp-regs -ffixed-8 -mcpu=ev56 -Wa,-mev6 -nostdinc -iwithprefix include -DKBUILD_
BASENAME=version -c -o version.o version.c
gcc -Wp,-MD,./.do_mounts.o.d -D__KERNEL__ -I/usr/src/linux-2.5.24/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame
-pointer -fno-strict-aliasing -fno-common -pipe -mno-fp-regs -ffixed-8 -mcpu=ev56 -Wa,-mev6 -nostdinc -iwithprefix include -DKBUIL
D_BASENAME=do_mounts -c -o do_mounts.o do_mounts.c
ld -r -o init.o main.o version.o do_mounts.o
make[1]: Leaving directory `/usr/src/linux-2.5.24/init'
make[1]: Entering directory `/usr/src/linux-2.5.24/kernel'
gcc -Wp,-MD,./.sched.o.d -D__KERNEL__ -I/usr/src/linux-2.5.24/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-poi
nter -fno-strict-aliasing -fno-common -pipe -mno-fp-regs -ffixed-8 -mcpu=ev56 -Wa,-mev6 -nostdinc -iwithprefix include -fno-omit-f
rame-pointer -DKBUILD_BASENAME=sched -c -o sched.o sched.c
sched.c:469: macro `switch_to' used with too many (3) args
In file included from sched.c:25:
/usr/src/linux-2.5.24/include/asm/mmu_context.h: In function `init_new_context':
/usr/src/linux-2.5.24/include/asm/mmu_context.h:230: `smp_num_cpus' undeclared (first use in this function)
/usr/src/linux-2.5.24/include/asm/mmu_context.h:230: (Each undeclared identifier is reported only once
/usr/src/linux-2.5.24/include/asm/mmu_context.h:230: for each function it appears in.)
/usr/src/linux-2.5.24/include/asm/mmu_context.h:231: warning: implicit declaration of function `cpu_logical_map'
sched.c: In function `schedule':
sched.c:819: warning: implicit declaration of function `prepare_arch_schedule'
sched.c:876: warning: implicit declaration of function `prepare_arch_switch'
sched.c:880: warning: implicit declaration of function `finish_arch_switch'
sched.c:883: warning: implicit declaration of function `finish_arch_schedule'
make[1]: *** [sched.o] Error 1
make[1]: Leaving directory `/usr/src/linux-2.5.24/kernel'
make: *** [kernel] Error 2
alpha:/usr/src/linux-2.5.24#

I know I can fix the smp_num_cpus thing, but the prepare_arch_switch()
etc. things are another matter. Every now and again I see a post to lkml
for the Alpha, which suggest some people succeed in compiling it. Any
hints?

Thanks,
Jurriaan
--
I'm a mean green mother from outer space.
Audrey II, The Little Shop of Horrors
Debian GNU/Linux 2.4.19p10 on Alpha 990 bogomips load:0.66 0.17 0.36


2002-06-21 12:43:10

by Oliver Falk

[permalink] [raw]
Subject: 2.5.24 on alpha; fls redefined!? HELP NEEDED

Hi all!

Where comes this from and _why_???

/usr/src/linux-2.5.24/include/asm/bitops.h:471:1: warning: "fls"
redefined

^^^^^^^^^^^^^^^^^^^^^^^^
/usr/src/linux-2.5.24/include/asm/bitops.h:329:1: warning: this is the
location of the previous definition
gcc -Wp,-MD,./.capability.o.d -D__KERNEL__
-I/usr/src/linux-2.5.24/include -Wall -Wstrict-prototypes -Wno-trigraphs
-O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe
-mno-fp-regs -ffixed-8 -msmall-data -mcpu=ev5 -Wa,-mev6 -nostdinc
-iwithprefix include -DKBUILD_BASENAME=capability -c -o
capability.o capability.c
In file included from /usr/src/linux-2.5.24/include/linux/bitops.h:3,
from
/usr/src/linux-2.5.24/include/linux/thread_info.h:10,
from /usr/src/linux-2.5.24/include/linux/spinlock.h:7,
from
/usr/src/linux-2.5.24/include/linux/capability.h:44,
from /usr/src/linux-2.5.24/include/linux/sched.h:9,
from /usr/src/linux-2.5.24/include/linux/mm.h:4,
from capability.c:10:

I get this error very often... I guess in all files in
include/asm-alpha/ ...

-Oliver


2002-06-21 12:55:31

by Oliver Falk

[permalink] [raw]
Subject: RE: 2.5.24 on alpha; fls redefined!? HELP NEEDED

Oliver Pitzeier wrote:
> Where comes this from and _why_???
>
> /usr/src/linux-2.5.24/include/asm/bitops.h:471:1: warning:
> "fls" redefined
> ^^^^^^^^^^^^^^^^^^^^^^^^

OK. Found it... Here...
467 /*
468 * fls: find last bit set.
469 */
470
471 #define fls(x) generic_fls(x)

I took it out. I guess it's not needed anymore because of this:

318 /*
319 * fls: find last bit set.
320 */
321 #if defined(__alpha_cix__) && defined(__alpha_fix__)
322 static inline int fls(int word)
323 {
324 long result;
325 __asm__("ctlz %1,%0" : "=r"(result) : "r"(word &
0xffffffff));
326 return 64 - result;
327 }
328 #else
329 #define fls generic_fls
330 #endif

Right? :o)

Greetz,
Oliver


2002-06-21 14:20:11

by jurriaan

[permalink] [raw]
Subject: Re: 2.5.24 doesn't compile on Alpha

From: Oliver Pitzeier <[email protected]>
Date: Fri, Jun 21, 2002 at 02:22:42PM +0200
> Hi Thunder!
> [ ... ]
> > `smp_num_cpus' undeclared (first use in this function)
> [ .... ]
> >
> > I know I can fix the smp_num_cpus thing [ ... ]
>
> Yes!? How????
>
I tried #define smp_num_cpus 1 in include/asm-alpha/smp.h (the non-smp
section) but the same line in include/asm/mmu_context.h works - for a
while.

ALPHA :diff -Br -b -U 3 -N mmu_context.org mmu_context.h
--- mmu_context.org Fri Jun 21 16:16:56 2002
+++ mmu_context.h Fri Jun 21 16:09:33 2002
@@ -89,6 +89,7 @@
#define cpu_last_asn(cpuid) (cpu_data[cpuid].last_asn)
#else
extern unsigned long last_asn;
+#define smp_num_cpus 1
#define cpu_last_asn(cpuid) last_asn
#endif /* CONFIG_SMP */

But after that while:

make[1]: Entering directory `/usr/src/linux-2.5.24/mm'
gcc -Wp,-MD,./.memory.o.d -D__KERNEL__ -I/usr/src/linux-2.5.24/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-po
inter -fno-strict-aliasing -fno-common -pipe -mno-fp-regs -ffixed-8 -mcpu=ev56 -Wa,-mev6 -nostdinc -iwithprefix include -DKBUILD_B
ASENAME=memory -c -o memory.o memory.c
In file included from /usr/src/linux-2.5.24/include/asm/tlb.h:1,
from memory.c:50:
/usr/src/linux-2.5.24/include/asm-generic/tlb.h: In function `tlb_gather_mmu':
/usr/src/linux-2.5.24/include/asm-generic/tlb.h:57: warning: large integer implicitly truncated to unsigned type
/usr/src/linux-2.5.24/include/asm-generic/tlb.h: In function `tlb_flush_mmu':
/usr/src/linux-2.5.24/include/asm-generic/tlb.h:69: warning: implicit declaration of function `tlb_flush'
memory.c: In function `free_one_pmd':
memory.c:93: warning: implicit declaration of function `pte_free_tlb'
memory.c: In function `free_one_pgd':
memory.c:114: warning: implicit declaration of function `pmd_free_tlb'
memory.c: In function `copy_page_range':
memory.c:267: warning: implicit declaration of function `pte_pfn'
memory.c:268: warning: implicit declaration of function `pfn_valid'
memory.c:270: warning: implicit declaration of function `pfn_to_page'
memory.c:270: warning: assignment makes pointer from integer without a cast
memory.c: In function `zap_pte_range':
memory.c:338: warning: implicit declaration of function `tlb_remove_tlb_entry'
memory.c:340: warning: initialization makes pointer from integer without a cast
memory.c: In function `unmap_page_range':
memory.c:386: warning: implicit declaration of function `tlb_start_vma'
memory.c:392: warning: implicit declaration of function `tlb_end_vma'
memory.c: In function `follow_page':
memory.c:458: warning: return makes pointer from integer without a cast
memory.c: In function `remap_pte_range':
memory.c:845: invalid type argument of `->'
memory.c:846: warning: implicit declaration of function `pfn_pte'
memory.c:846: incompatible types in assignment
memory.c: In function `do_wp_page':
memory.c:961: warning: assignment makes pointer from integer without a cast
make[1]: *** [memory.o] Error 1
make[1]: Leaving directory `/usr/src/linux-2.5.24/mm'
make: *** [mm] Error 2
alpha:/usr/src/linux-2.5.24#

Jurriaan
--
I believe in coincidence. Coincidences happen every day. But I don't
trust coincidences.
Garak - DS9
Debian GNU/Linux 2.4.19p10 on Alpha 990 bogomips load:0.52 0.48 0.46

2002-06-21 15:24:17

by Ivan Kokshaysky

[permalink] [raw]
Subject: Re: 2.5.24 doesn't compile on Alpha

On Fri, Jun 21, 2002 at 04:19:57PM +0200, Jurriaan on Alpha wrote:
> I tried #define smp_num_cpus 1 in include/asm-alpha/smp.h (the non-smp
> section) but the same line in include/asm/mmu_context.h works - for a
> while.

I'm running 2.5.24 on sx164 with following (unfinished - SMP is broken)
patch.

Ivan.

--- 2.5.24/drivers/char/rtc.c Mon Jun 3 05:44:47 2002
+++ linux/drivers/char/rtc.c Fri Jun 21 18:07:57 2002
@@ -870,7 +870,9 @@ no_irq:

if (misc_register(&rtc_dev))
{
+#if RTC_IRQ
free_irq(RTC_IRQ, NULL);
+#endif
release_region(RTC_PORT(0), RTC_IO_EXTENT);
return -ENODEV;
}
--- 2.5.24/arch/alpha/lib/stxcpy.S Mon Jun 3 05:44:44 2002
+++ linux/arch/alpha/lib/stxcpy.S Fri Jun 21 18:07:57 2002
@@ -20,7 +20,7 @@
* Furthermore, v0, a3-a5, t11, and t12 are untouched.
*/

-#include <alpha/regdef.h>
+#include <asm/regdef.h>

.set noat
.set noreorder
--- 2.5.24/arch/alpha/lib/ev6-stxcpy.S Mon Jun 3 05:44:37 2002
+++ linux/arch/alpha/lib/ev6-stxcpy.S Fri Jun 21 18:07:57 2002
@@ -30,7 +30,7 @@
* Try not to change the actual algorithm if possible for consistency.
*/

-#include <alpha/regdef.h>
+#include <asm/regdef.h>

.set noat
.set noreorder
--- 2.5.24/arch/alpha/lib/ev6-stxncpy.S Mon Jun 3 05:44:52 2002
+++ linux/arch/alpha/lib/ev6-stxncpy.S Fri Jun 21 18:07:57 2002
@@ -38,7 +38,7 @@
* Try not to change the actual algorithm if possible for consistency.
*/

-#include <alpha/regdef.h>
+#include <asm/regdef.h>

.set noat
.set noreorder
--- 2.5.24/arch/alpha/lib/strncpy_from_user.S Mon Jun 3 05:44:41 2002
+++ linux/arch/alpha/lib/strncpy_from_user.S Fri Jun 21 18:07:57 2002
@@ -12,7 +12,7 @@


#include <asm/errno.h>
-#include <alpha/regdef.h>
+#include <asm/regdef.h>


/* Allow an exception for an insn; exit if we get one. */
--- 2.5.24/arch/alpha/lib/stxncpy.S Mon Jun 3 05:44:48 2002
+++ linux/arch/alpha/lib/stxncpy.S Fri Jun 21 18:07:57 2002
@@ -28,7 +28,7 @@
* Furthermore, v0, a3-a5, t11, t12, and $at are untouched.
*/

-#include <alpha/regdef.h>
+#include <asm/regdef.h>

.set noat
.set noreorder
--- 2.5.24/arch/alpha/lib/ev67-strlen_user.S Mon Jun 3 05:44:48 2002
+++ linux/arch/alpha/lib/ev67-strlen_user.S Fri Jun 21 18:07:57 2002
@@ -23,7 +23,7 @@
* Try not to change the actual algorithm if possible for consistency.
*/

-#include <alpha/regdef.h>
+#include <asm/regdef.h>


/* Allow an exception for an insn; exit if we get one. */
--- 2.5.24/arch/alpha/lib/strchr.S Mon Jun 3 05:44:49 2002
+++ linux/arch/alpha/lib/strchr.S Fri Jun 21 18:07:57 2002
@@ -6,7 +6,7 @@
* string, or null if it is not found.
*/

-#include <alpha/regdef.h>
+#include <asm/regdef.h>

.set noreorder
.set noat
--- 2.5.24/arch/alpha/lib/strlen_user.S Mon Jun 3 05:44:50 2002
+++ linux/arch/alpha/lib/strlen_user.S Fri Jun 21 18:07:57 2002
@@ -12,7 +12,7 @@
* boundary when doing so.
*/

-#include <alpha/regdef.h>
+#include <asm/regdef.h>


/* Allow an exception for an insn; exit if we get one. */
--- 2.5.24/arch/alpha/lib/ev67-strrchr.S Mon Jun 3 05:44:50 2002
+++ linux/arch/alpha/lib/ev67-strrchr.S Fri Jun 21 18:07:57 2002
@@ -19,7 +19,7 @@
*/


-#include <alpha/regdef.h>
+#include <asm/regdef.h>

.set noreorder
.set noat
--- 2.5.24/arch/alpha/lib/ev67-strchr.S Mon Jun 3 05:44:50 2002
+++ linux/arch/alpha/lib/ev67-strchr.S Fri Jun 21 18:07:57 2002
@@ -16,7 +16,7 @@
* Try not to change the actual algorithm if possible for consistency.
*/

-#include <alpha/regdef.h>
+#include <asm/regdef.h>

.set noreorder
.set noat
--- 2.5.24/arch/alpha/lib/strrchr.S Mon Jun 3 05:44:52 2002
+++ linux/arch/alpha/lib/strrchr.S Fri Jun 21 18:07:57 2002
@@ -6,7 +6,7 @@
* within a null-terminated string, or null if it is not found.
*/

-#include <alpha/regdef.h>
+#include <asm/regdef.h>

.set noreorder
.set noat
--- 2.5.24/arch/alpha/lib/ev6-strncpy_from_user.S Mon Jun 3 05:44:53 2002
+++ linux/arch/alpha/lib/ev6-strncpy_from_user.S Fri Jun 21 18:07:57 2002
@@ -27,7 +27,7 @@


#include <asm/errno.h>
-#include <alpha/regdef.h>
+#include <asm/regdef.h>


/* Allow an exception for an insn; exit if we get one. */
--- 2.5.24/arch/alpha/kernel/pci.c Mon Jun 3 05:44:41 2002
+++ linux/arch/alpha/kernel/pci.c Fri Jun 21 18:07:58 2002
@@ -190,12 +190,12 @@ pcibios_align_resource(void *data, struc
#undef MB
#undef GB

-static void __init
+static int __init
pcibios_init(void)
{
- if (!alpha_mv.init_pci)
- return;
- alpha_mv.init_pci();
+ if (alpha_mv.init_pci)
+ alpha_mv.init_pci();
+ return 0;
}

subsys_initcall(pcibios_init);
--- 2.5.24/arch/alpha/kernel/signal.c Mon Jun 10 14:25:18 2002
+++ linux/arch/alpha/kernel/signal.c Fri Jun 21 18:07:57 2002
@@ -18,6 +18,7 @@
#include <linux/smp_lock.h>
#include <linux/stddef.h>
#include <linux/tty.h>
+#include <linux/binfmts.h>

#include <asm/bitops.h>
#include <asm/uaccess.h>
--- 2.5.24/arch/alpha/kernel/osf_sys.c Mon Jun 10 14:25:18 2002
+++ linux/arch/alpha/kernel/osf_sys.c Fri Jun 21 18:07:57 2002
@@ -33,6 +33,7 @@
#include <linux/file.h>
#include <linux/types.h>
#include <linux/ipc.h>
+#include <linux/namei.h>

#include <asm/fpu.h>
#include <asm/io.h>
--- 2.5.24/arch/alpha/kernel/alpha_ksyms.c Mon Jun 3 05:44:41 2002
+++ linux/arch/alpha/kernel/alpha_ksyms.c Fri Jun 21 18:07:58 2002
@@ -214,7 +214,6 @@ EXPORT_SYMBOL(flush_tlb_page);
EXPORT_SYMBOL(smp_imb);
EXPORT_SYMBOL(cpu_data);
EXPORT_SYMBOL(__cpu_number_map);
-EXPORT_SYMBOL(smp_num_cpus);
EXPORT_SYMBOL(smp_call_function);
EXPORT_SYMBOL(smp_call_function_on_cpu);
EXPORT_SYMBOL(global_irq_holder);
--- 2.5.24/arch/alpha/kernel/setup.c Thu Jun 20 14:27:39 2002
+++ linux/arch/alpha/kernel/setup.c Fri Jun 21 18:09:36 2002
@@ -1109,7 +1109,7 @@ show_cpuinfo(struct seq_file *f, void *s
#ifdef CONFIG_SMP
seq_printf(f, "cpus active\t\t: %d\n"
"cpu active mask\t\t: %016lx\n",
- smp_num_cpus, cpu_present_mask);
+ num_online_cpus(), cpu_present_mask);
#endif

return 0;
--- 2.5.24/include/asm-alpha/page.h Mon Jun 3 05:44:52 2002
+++ linux/include/asm-alpha/page.h Fri Jun 21 18:07:58 2002
@@ -15,10 +15,10 @@
#define STRICT_MM_TYPECHECKS

extern void clear_page(void *page);
-#define clear_user_page(page, vaddr) clear_page(page)
+#define clear_user_page(page, vaddr, pg) clear_page(page)

extern void copy_page(void * _to, void * _from);
-#define copy_user_page(to, from, vaddr) copy_page(to, from)
+#define copy_user_page(to, from, vaddr, pg) copy_page(to, from)

#ifdef STRICT_MM_TYPECHECKS
/*
@@ -95,8 +95,12 @@ extern __inline__ int get_order(unsigned
#define __pa(x) ((unsigned long) (x) - PAGE_OFFSET)
#define __va(x) ((void *)((unsigned long) (x) + PAGE_OFFSET))
#ifndef CONFIG_DISCONTIGMEM
-#define virt_to_page(kaddr) (mem_map + (__pa(kaddr) >> PAGE_SHIFT))
-#define VALID_PAGE(page) (((page) - mem_map) < max_mapnr)
+#define pfn_to_page(pfn) (mem_map + (pfn))
+#define page_to_pfn(page) ((unsigned long)((page) - mem_map))
+#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
+
+#define pfn_valid(pfn) ((pfn) < max_mapnr)
+#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
#endif /* CONFIG_DISCONTIGMEM */

#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
--- 2.5.24/include/asm-alpha/pgtable.h Mon Jun 3 05:44:45 2002
+++ linux/include/asm-alpha/pgtable.h Fri Jun 21 18:07:58 2002
@@ -179,11 +179,12 @@ extern unsigned long __zero_page(void);
#endif
#if defined(CONFIG_ALPHA_GENERIC) || \
(defined(CONFIG_ALPHA_EV6) && !defined(USE_48_BIT_KSEG))
-#define PHYS_TWIDDLE(phys) \
- ((((phys) & 0xc0000000000UL) == 0x40000000000UL) \
- ? ((phys) ^= 0xc0000000000UL) : (phys))
+#define KSEG_PFN (0xc0000000000UL >> PAGE_SHIFT)
+#define PHYS_TWIDDLE(pfn) \
+ ((((pfn) & KSEG_PFN) == (0x40000000000UL >> PAGE_SHIFT)) \
+ ? ((pfn) ^= KSEG_PFN) : (pfn))
#else
-#define PHYS_TWIDDLE(phys) (phys)
+#define PHYS_TWIDDLE(pfn) (pfn)
#endif

/*
@@ -199,12 +200,13 @@ extern unsigned long __zero_page(void);
#endif

#ifndef CONFIG_DISCONTIGMEM
+#define pte_pfn(pte) (pte_val(pte) >> 32)
+#define pte_page(pte) pfn_to_page(pte_pfn(pte))
#define mk_pte(page, pgprot) \
({ \
pte_t pte; \
\
- pte_val(pte) = ((unsigned long)(page - mem_map) << 32) | \
- pgprot_val(pgprot); \
+ pte_val(pte) = (page_to_pfn(page) << 32) | pgprot_val(pgprot); \
pte; \
})
#else
@@ -219,10 +221,20 @@ extern unsigned long __zero_page(void);
\
pte; \
})
+#define pte_page(x) \
+({ \
+ unsigned long kvirt; \
+ struct page * __xx; \
+ \
+ kvirt = (unsigned long)__va(pte_val(x) >> (32-PAGE_SHIFT)); \
+ __xx = virt_to_page(kvirt); \
+ \
+ __xx; \
+})
#endif

-extern inline pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot)
-{ pte_t pte; pte_val(pte) = (PHYS_TWIDDLE(physpage) << (32-PAGE_SHIFT)) | pgprot_val(pgprot); return pte; }
+extern inline pte_t pfn_pte(unsigned long physpfn, pgprot_t pgprot)
+{ pte_t pte; pte_val(pte) = (PHYS_TWIDDLE(physpfn) << 32) | pgprot_val(pgprot); return pte; }

extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
{ pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot); return pte; }
@@ -233,20 +245,6 @@ extern inline void pmd_set(pmd_t * pmdp,
extern inline void pgd_set(pgd_t * pgdp, pmd_t * pmdp)
{ pgd_val(*pgdp) = _PAGE_TABLE | ((((unsigned long) pmdp) - PAGE_OFFSET) << (32-PAGE_SHIFT)); }

-#ifndef CONFIG_DISCONTIGMEM
-#define pte_page(x) (mem_map+(unsigned long)((pte_val(x) >> 32)))
-#else
-#define pte_page(x) \
-({ \
- unsigned long kvirt; \
- struct page * __xx; \
- \
- kvirt = (unsigned long)__va(pte_val(x) >> (32-PAGE_SHIFT)); \
- __xx = virt_to_page(kvirt); \
- \
- __xx; \
-})
-#endif

extern inline unsigned long
pmd_page_kernel(pmd_t pmd)
--- 2.5.24/include/asm-alpha/tlb.h Mon Jun 3 05:44:48 2002
+++ linux/include/asm-alpha/tlb.h Fri Jun 21 18:07:58 2002
@@ -1 +1,15 @@
+#ifndef _ALPHA_TLB_H
+#define _ALPHA_TLB_H
+
+#define tlb_start_vma(tlb, vma) do { } while (0)
+#define tlb_end_vma(tlb, vma) do { } while (0)
+#define tlb_remove_tlb_entry(tlb, pte, addr) do { } while (0)
+
+#define tlb_flush(tlb) flush_tlb_mm((tlb)->mm)
+
#include <asm-generic/tlb.h>
+
+#define pte_free_tlb(tlb,pte) pte_free(pte)
+#define pmd_free_tlb(tlb,pmd) pmd_free(pmd)
+
+#endif
--- 2.5.24/include/asm-alpha/bitops.h Mon Jun 3 05:44:49 2002
+++ linux/include/asm-alpha/bitops.h Fri Jun 21 18:07:58 2002
@@ -315,6 +315,20 @@ static inline int ffs(int word)
return word ? result+1 : 0;
}

+/*
+ * fls: find last bit set.
+ */
+#if defined(__alpha_cix__) && defined(__alpha_fix__)
+static inline int fls(int word)
+{
+ long result;
+ __asm__("ctlz %1,%0" : "=r"(result) : "r"(word & 0xffffffff));
+ return 64 - result;
+}
+#else
+#define fls generic_fls
+#endif
+
/* Compute powers of two for the given integer. */
static inline int floor_log2(unsigned long word)
{
--- 2.5.24/include/asm-alpha/regdef.h Thu Jan 1 00:00:00 1970
+++ linux/include/asm-alpha/regdef.h Fri Jun 21 18:07:58 2002
@@ -0,0 +1,44 @@
+#ifndef __alpha_regdef_h__
+#define __alpha_regdef_h__
+
+#define v0 $0 /* function return value */
+
+#define t0 $1 /* temporary registers (caller-saved) */
+#define t1 $2
+#define t2 $3
+#define t3 $4
+#define t4 $5
+#define t5 $6
+#define t6 $7
+#define t7 $8
+
+#define s0 $9 /* saved-registers (callee-saved registers) */
+#define s1 $10
+#define s2 $11
+#define s3 $12
+#define s4 $13
+#define s5 $14
+#define s6 $15
+#define fp s6 /* frame-pointer (s6 in frame-less procedures) */
+
+#define a0 $16 /* argument registers (caller-saved) */
+#define a1 $17
+#define a2 $18
+#define a3 $19
+#define a4 $20
+#define a5 $21
+
+#define t8 $22 /* more temps (caller-saved) */
+#define t9 $23
+#define t10 $24
+#define t11 $25
+#define ra $26 /* return address register */
+#define t12 $27
+
+#define pv t12 /* procedure-variable register */
+#define AT $at /* assembler temporary */
+#define gp $29 /* global pointer */
+#define sp $30 /* stack pointer */
+#define zero $31 /* reads as zero, writes are noops */
+
+#endif /* __alpha_regdef_h__ */
--- 2.5.24/include/asm-alpha/hardirq.h Mon Jun 3 05:44:41 2002
+++ linux/include/asm-alpha/hardirq.h Fri Jun 21 18:07:58 2002
@@ -56,7 +56,7 @@ static inline int irqs_running (void)
{
int i;

- for (i = 0; i < smp_num_cpus; i++)
+ for (i = 0; i < NR_CPUS; i++)
if (local_irq_count(i))
return 1;
return 0;
--- 2.5.24/include/asm-alpha/mmu_context.h Mon Jun 3 05:44:50 2002
+++ linux/include/asm-alpha/mmu_context.h Fri Jun 21 18:07:58 2002
@@ -227,8 +227,9 @@ init_new_context(struct task_struct *tsk
{
int i;

- for (i = 0; i < smp_num_cpus; i++)
- mm->context[cpu_logical_map(i)] = 0;
+ for (i = 0; i < NR_CPUS; i++)
+ if (cpu_online(i))
+ mm->context[i] = 0;
tsk->thread_info->pcb.ptbr
= ((unsigned long)mm->pgd - IDENT_ADDR) >> PAGE_SHIFT;
return 0;
--- 2.5.24/include/asm-alpha/smp.h Mon Jun 3 05:44:47 2002
+++ linux/include/asm-alpha/smp.h Fri Jun 21 18:07:58 2002
@@ -42,15 +42,6 @@ extern struct cpuinfo_alpha cpu_data[NR_

#define PROC_CHANGE_PENALTY 20

-/* Map from cpu id to sequential logical cpu number. This will only
- not be idempotent when cpus failed to come on-line. */
-extern int __cpu_number_map[NR_CPUS];
-#define cpu_number_map(cpu) __cpu_number_map[cpu]
-
-/* The reverse map from sequential logical cpu number to cpu id. */
-extern int __cpu_logical_map[NR_CPUS];
-#define cpu_logical_map(cpu) __cpu_logical_map[cpu]
-
#define hard_smp_processor_id() __hard_smp_processor_id()
#define smp_processor_id() (current_thread_info()->cpu)

--- 2.5.24/include/asm-alpha/system.h Mon Jun 3 05:44:51 2002
+++ linux/include/asm-alpha/system.h Fri Jun 21 18:07:58 2002
@@ -130,8 +130,12 @@ struct el_common_EV6_mcheck {
extern void halt(void) __attribute__((noreturn));
#define __halt() __asm__ __volatile__ ("call_pal %0 #halt" : : "i" (PAL_halt))

-#define prepare_to_switch() do { } while(0)
-#define switch_to(prev,next) \
+#define prepare_arch_schedule(prev) do { } while(0)
+#define finish_arch_schedule(prev) do { } while(0)
+#define prepare_arch_switch(rq) do { } while(0)
+#define finish_arch_switch(rq) spin_unlock_irq(&(rq)->lock)
+
+#define switch_to(prev,next,last) \
do { \
alpha_switch_to(virt_to_phys(&(next)->thread_info->pcb), (prev)); \
check_mmu_context(); \

2002-06-21 20:37:34

by jurriaan

[permalink] [raw]
Subject: Re: 2.5.24 doesn't compile on Alpha

From: Ivan Kokshaysky <[email protected]>
Date: Fri, Jun 21, 2002 at 07:24:05PM +0400
> On Fri, Jun 21, 2002 at 04:19:57PM +0200, Jurriaan on Alpha wrote:
> > I tried #define smp_num_cpus 1 in include/asm-alpha/smp.h (the non-smp
> > section) but the same line in include/asm/mmu_context.h works - for a
> > while.
>
> I'm running 2.5.24 on sx164 with following (unfinished - SMP is broken)
> patch.
>
This patchs helps a lot; now I get:

make[1]: Entering directory `/usr/src/linux-2.5.24/init'
Generating /usr/src/linux-2.5.24/include/linux/compile.h (updated)
gcc -Wp,-MD,./.version.o.d -D__KERNEL__ -I/usr/src/linux-2.5.24/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-p
ointer -fno-strict-aliasing -fno-common -pipe -mno-fp-regs -ffixed-8 -mcpu=ev56 -Wa,-mev6 -nostdinc -iwithprefix include -DKBUILD_
BASENAME=version -c -o version.o version.c
ld -r -o init.o main.o version.o do_mounts.o
make[1]: Leaving directory `/usr/src/linux-2.5.24/init'
ld -static -T arch/alpha/vmlinux.lds -N arch/alpha/kernel/head.o init/init.o --start-group arch/alpha/kernel/kernel.o arch/alpha/m
m/mm.o kernel/kernel.o mm/mm.o fs/fs.o ipc/ipc.o arch/alpha/math-emu/built-in.o /usr/src/linux-2.5.24/arch/alpha/lib/lib.a lib/lib.a
/usr/src/linux-2.5.24/arch/alpha/lib/lib.a drivers/built-in.o sound/sound.o net/network.o --end-group -o vmlinux
drivers/built-in.o(.data+0x37118): undefined reference to `local symbols in discarded section .text.exit'
net/network.o: In function `ip_conntrack_helper_register':
net/network.o(.text+0x5e68c): undefined reference to `__this_module'
net/network.o: In function `ip_conntrack_helper_unregister':
net/network.o(.text+0x5e76c): undefined reference to `__this_module'
net/network.o: In function `ip_nat_helper_register':
net/network.o(.text+0x62894): undefined reference to `__this_module'
net/network.o: In function `ip_nat_helper_unregister':
net/network.o(.text+0x62b5c): undefined reference to `__this_module'
make: *** [vmlinux] Error 1
alpha:/usr/src/linux-2.5.24#

I'll probably have to fiddle with my .config to solve this.

Thanks,
Jurriaan
--
Our music has many faces and many moods like the land we live in.
It is a fusion of energy and serenity
Kansas
Debian GNU/Linux 2.4.19p10 on Alpha 990 bogomips load:0.54 0.74 0.77

2002-06-21 20:57:43

by Jan-Benedict Glaw

[permalink] [raw]
Subject: Re: 2.5.24 doesn't compile on Alpha

On Fri, 2002-06-21 22:37:26 +0200, Jurriaan on Alpha <[email protected]>
wrote in message <[email protected]>:
> From: Ivan Kokshaysky <[email protected]>
> Date: Fri, Jun 21, 2002 at 07:24:05PM +0400
> > On Fri, Jun 21, 2002 at 04:19:57PM +0200, Jurriaan on Alpha wrote:
> > > I tried #define smp_num_cpus 1 in include/asm-alpha/smp.h (the non-smp
> > > section) but the same line in include/asm/mmu_context.h works - for a
> > > while.
> >
> > I'm running 2.5.24 on sx164 with following (unfinished - SMP is broken)
> > patch.
> >
> This patchs helps a lot; now I get:
> drivers/built-in.o(.data+0x37118): undefined reference to `local symbols in discarded section .text.exit'

I think this "bug" appears with some binutils some weeks/months old. Try
to upgrade them.

I'm not hitting this bug, but for me, ./arch/alpha/kernel/head.o isn't
build (actually, there aren't any .o files in that directory), even if
I try to explicitely compile head.o by 'make arch/alpha/kernel/head.o'.
Any hints there?

MfG, JBG

--
Jan-Benedict Glaw . [email protected] . +49-172-7608481
-- New APT-Proxy written in shell script --
http://lug-owl.de/~jbglaw/software/ap2/


Attachments:
(No filename) (1.17 kB)
(No filename) (189.00 B)
Download all attachments

2002-06-22 06:18:01

by jurriaan

[permalink] [raw]
Subject: Re: 2.5.24 doesn't compile on Alpha

From: Jan-Benedict Glaw <[email protected]>
Date: Fri, Jun 21, 2002 at 10:57:41PM +0200
> On Fri, 2002-06-21 22:37:26 +0200, Jurriaan on Alpha <[email protected]>
> wrote in message <[email protected]>:
>>
>> This patchs helps a lot; now I get:
>> drivers/built-in.o(.data+0x37118): undefined reference to `local symbols in discarded section .text.exit'
>
> I think this "bug" appears with some binutils some weeks/months old. Try
> to upgrade them.
>
Hmm, I had an up-to-date debian testing system.
So I upgraded to the latest binutils from unstable, that didn't work.
Then I downloaded binutils-2.12.1 from source and installed that - still
doesn't work.
The latest from unstable was 2.12.90.0.9.

make[1]: Leaving directory `/usr/src/linux-2.5.24/init'
ld -static -T arch/alpha/vmlinux.lds -N arch/alpha/kernel/head.o init/init.o --start-group arch/alpha/kernel/kernel.o arch/alpha/m
m/mm.o kernel/kernel.o mm/mm.o fs/fs.o ipc/ipc.o arch/alpha/math-emu/built-in.o /usr/src/linux-2.5.24/arch/alpha/lib/lib.a lib/lib.a
/usr/src/linux-2.5.24/arch/alpha/lib/lib.a drivers/built-in.o sound/sound.o net/network.o --end-group -o vmlinux
drivers/built-in.o(.data+0x37118): undefined reference to `local symbols in discarded section .text.exit'
make: *** [vmlinux] Error 1
alpha:/usr/src/linux-2.5.24# ld -v
GNU ld version 2.12.90.0.9 20020526 Debian GNU/Linux
alpha:/usr/src/linux-2.5.24# ld -static -T arch/alpha/vmlinux.lds -N arch/alpha/kernel/head.o init/init.o --start-group arch/alpha/k
ernel/kernel.o arch/alpha/mm/mm.o kernel/kernel.o mm/mm.o fs/fs.o ipc/ipc.o arch/alpha/math-emu/built-in.o /usr/src/linux-2.5.24/arch
/alpha/lib/lib.a lib/lib.a /usr/src/linux-2.5.24/arch/alpha/lib/lib.a drivers/built-in.o sound/sound.o net/network.o --end-group -o v
mlinux
drivers/built-in.o(.data+0x37118): undefined reference to `local symbols in discarded section .text.exit'
alpha:/usr/src/linux-2.5.24# ld -v
GNU ld version 2.12.1
alpha:/usr/src/linux-2.5.24#

> I'm not hitting this bug, but for me, ./arch/alpha/kernel/head.o isn't
> build (actually, there aren't any .o files in that directory), even if
> I try to explicitely compile head.o by 'make arch/alpha/kernel/head.o'.
> Any hints there?
>
None, but could you please tell me what version of binutils you're
using?

Thanks,
Jurriaan
--
"A cat's got her own opinion of human beings. She don't say much, but you
can tell enough to make you anxious not to hear the whole of it."
Jerome K. Jerome (1859 - 1927)
Debian GNU/Linux 2.4.19p10 on Alpha 990 bogomips 5 users load:2.45 2.33 1.71

2002-06-23 14:13:18

by Oliver Falk

[permalink] [raw]
Subject: RE: 2.5.24 doesn't compile on Alpha

Ivan Kokshaysky wrote:
> On Fri, Jun 21, 2002 at 04:19:57PM +0200, Jurriaan on Alpha wrote:
> > I tried #define smp_num_cpus 1 in include/asm-alpha/smp.h
> (the non-smp
> > section) but the same line in include/asm/mmu_context.h
> works - for a
> > while.
>
> I'm running 2.5.24 on sx164 with following (unfinished - SMP
> is broken) patch.

The patch worked well and did what my patch did not yet. :o)
I compiles without problems. I'll try to boot the machine
tommorow (at work).

I'll send you the results. :o)

Greetz,
Oliver


2002-06-23 14:12:32

by Oliver Falk

[permalink] [raw]
Subject: RE: 2.5.24 doesn't compile on Alpha

Juriaan on Alpha wrote:
[ ... ]
> None, but could you please tell me what version of binutils
> you're using?

I'm working with binutils-2.12.90.0.7-3 from Rawhide, because
my base-system is RedHat. And this version worked well.
I'm also using gcc-3.1-6 and glibc-2.2.4-24.

I hope this helps...

-Oliver


2002-06-24 09:07:29

by Oliver Falk

[permalink] [raw]
Subject: Boot problems (WAS: RE: 2.5.24 doesn't compile on Alpha)

Hi Ivan!

Oliver Pitzeier wrote:
> Ivan Kokshaysky wrote:
> > On Fri, Jun 21, 2002 at 04:19:57PM +0200, Jurriaan on Alpha wrote:
> > > I tried #define smp_num_cpus 1 in include/asm-alpha/smp.h
> > (the non-smp
> > > section) but the same line in include/asm/mmu_context.h
> > works - for a
> > > while.
> >
> > I'm running 2.5.24 on sx164 with following (unfinished - SMP
> > is broken) patch.
>
> The patch worked well and did what my patch did not yet. :o)
> I compiles without problems. I'll try to boot the machine
> tommorow (at work).
>
> I'll send you the results. :o)

I cannot boot the kernel... Here's the problem... But what does this
mean? "swapper"? Has this something to do with swap?

EXT3-fs: mounted filesystem with ordered data mode.
VFS: Mounted root (ext3 filesystem) readonly.
Freeing unused kernel memory: 304k freed
Kernel bug at ll_rw_blk.c:1639
swapper(1): Kernel Bug 1
pc = [<fffffc00003f7bb8>] ra = [<fffffc00003f7cdc>] ps = 0000 Not
tainted
v0 = 0000000000000000 t0 = 0000000000000001 t1 = 0000000000000040
t2 = fffffc000fdcbae0 t3 = fffffc00005514e8 t4 = 0000000000000001
t5 = fffffc000e6e0120 t6 = fffffc000e6e00c0 t7 = fffffc00007e8000
a0 = fffffc000fec3da0 a1 = fffffc000fec3da0 a2 = fffffc00007eb498
a3 = fffffc00007eb4a8 a4 = fffffc00007eb490 a5 = fffffc00005260b0
t8 = 0000000000000000 t9 = 0000000000000000 t10= 0000000000007370
t11= 8e38e38e38e38e39 pv = fffffc00003f7c80 at = fffffc00007a1798
gp = fffffc000054b6c8 sp = fffffc00007eb530
Trace:fffffc00003f7cdc fffffc00003794a4 fffffc00003797f4
fffffc0000379af8 fffffc000031fbb0 fffffc00003c4040 fffffc00003c4074
fffffc000033c694 fffffc000033c878 fffffc000038d490 fffffc000038e8ec
fffffc000038d490 fffffc000035073c fffffc0000350824 fffffc000033d3cc
fffffc000033dad8 fffffc000033d970 fffffc000035f3c4 fffffc0000360178
fffffc000031085c fffffc0000310214 fffffc00003107d8 fffffc0000310cc8
fffffc000032466c fffffc000031008c fffffc00003100b0 fffffc00003107c0
Code: 00000081 00000616 0050e86a fffffc00 c3ffffe7 00000081
<00000667> 0050e86a
Kernel panic: Attempted to kill init!

Greetz,
Oliver