From: Jan-Benedict G. <jb...@us...> - 2005-04-25 22:57:28
|
Update of /cvsroot/linux-vax/kernel-2.5/arch/vax/boot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18448 Modified Files: cpu_sel.c Log Message: - Access cpu_matches as an array, not by pointer arithmetic. Index: cpu_sel.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/arch/vax/boot/cpu_sel.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- cpu_sel.c 25 Apr 2005 22:25:04 -0000 1.15 +++ cpu_sel.c 25 Apr 2005 22:56:58 -0000 1.16 @@ -18,45 +18,41 @@ s0vmaddr_to_load_addr(void *vaddr) { extern char _stext; - return (char *)vaddr - PAGE_OFFSET - KERNEL_START_PHYS + (unsigned int) &_stext; + + return (char *) vaddr - PAGE_OFFSET - KERNEL_START_PHYS + (unsigned int) &_stext; } struct vax_mv * idcpu (void) { + extern struct cpu_match __init_cpumatch_start, __init_cpumatch_end; + struct cpu_match *match = &__init_cpumatch_start; unsigned long sid; unsigned long sidex; - struct cpu_match *match; unsigned int i; unsigned int num_matches; struct vax_mv *retmv; - extern struct cpu_match __init_cpumatch_start, __init_cpumatch_end; - sid = __mfpr (PR_SID); - num_matches = &__init_cpumatch_end - &__init_cpumatch_start; for (i = 0; i < num_matches; i++) { - - match = &__init_cpumatch_start + i; - - if ((sid & match->sid_mask) == match->sid_match) { + if ((sid & match[i].sid_mask) == match[i].sid_match) { /* * No sidex known? Accept the vector. * FIXME: Maybe sort the metch structs to have * those with "long" masks first, then the loose * entries with weaker/shorter masks */ - if (!match->sidex_addr) - return s0vmaddr_to_load_addr(match->mv); + if (!match[i].sidex_addr) + return s0vmaddr_to_load_addr(match[i].mv); /* * If a SIDEX match was supplied, too, check it! */ - sidex = * ((unsigned long *) match->sidex_addr); - if ((sidex & match->sidex_mask) == match->sidex_match) { - retmv = s0vmaddr_to_load_addr(match->mv); + 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->sidex = sidex; return retmv; } |