From: Kenn H. <ke...@us...> - 2005-05-15 14:32:46
|
Update of /cvsroot/linux-vax/kernel-2.5/arch/vax/boot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27503 Modified Files: cpu_sel.c head.S Log Message: At boot time, don't refer to $_stext in C code. GCC 2.95 generates a relative addressing mode, but GCC 4.1 uses absolute mode, which breaks the re-calculation of the machine vector address. Instead, we explicitly pass in the kernel load address from head.S. Index: head.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/arch/vax/boot/head.S,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- head.S 23 Apr 2005 19:50:21 -0000 1.19 +++ head.S 15 May 2005 14:32:36 -0000 1.20 @@ -53,7 +53,8 @@ # movzbl $0x42,%r2 # jsb 0x20040058 - calls $0, idcpu # Identify CPU and put the mv ptr into mv + pushal start + calls $1, idcpu # Identify CPU and put the mv ptr into mv movl %r0, mv # now fix up the machine vector entries. (They currently contain Index: cpu_sel.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/arch/vax/boot/cpu_sel.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- cpu_sel.c 25 Apr 2005 22:56:58 -0000 1.16 +++ cpu_sel.c 15 May 2005 14:32:36 -0000 1.17 @@ -14,16 +14,14 @@ * in the loaded kernel before we relocate (which depends on the * exact load address) */ -void * -s0vmaddr_to_load_addr(void *vaddr) +static void * +s0vmaddr_to_load_addr(void *vaddr, unsigned int kernel_load_addr) { - extern char _stext; - - return (char *) vaddr - PAGE_OFFSET - KERNEL_START_PHYS + (unsigned int) &_stext; + return (char *) vaddr - PAGE_OFFSET - KERNEL_START_PHYS + kernel_load_addr; } struct vax_mv * -idcpu (void) +idcpu (unsigned int kernel_load_addr) { extern struct cpu_match __init_cpumatch_start, __init_cpumatch_end; struct cpu_match *match = &__init_cpumatch_start; @@ -45,14 +43,14 @@ * entries with weaker/shorter masks */ if (!match[i].sidex_addr) - return s0vmaddr_to_load_addr(match[i].mv); + return s0vmaddr_to_load_addr(match[i].mv, kernel_load_addr); /* * If a SIDEX match was supplied, too, check it! */ sidex = * ((unsigned long *) match[i].sidex_addr); if ((sidex & match[i].sidex_mask) == match[i].sidex_match) { - retmv = s0vmaddr_to_load_addr(match[i].mv); + retmv = s0vmaddr_to_load_addr(match[i].mv, kernel_load_addr); retmv->sidex = sidex; return retmv; } |