[PARISC] Fix kernel panic in check_ivt

check_ivt had some seriously broken code wrt function pointers on
parisc64. Instead of referencing the hpmc code via a function pointer,
export symbols and reference it as a const array.

Thanks to jda for pointing out the broken 64-bit func ptr handling.

Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>

authored by Kyle McMartin and committed by Kyle McMartin c3d4ed4e 3bb457af

+5 -7
+1 -4
arch/parisc/kernel/hpmc.S
··· 295 295 b . 296 296 nop 297 297 ENDPROC(os_hpmc) 298 - 299 - /* this label used to compute os_hpmc checksum */ 300 - ENTRY(os_hpmc_end) 301 - 298 + ENTRY(os_hpmc_end) /* this label used to compute os_hpmc checksum */ 302 299 nop
+4 -3
arch/parisc/kernel/traps.c
··· 802 802 803 803 int __init check_ivt(void *iva) 804 804 { 805 + extern const u32 os_hpmc[]; 806 + extern const u32 os_hpmc_end[]; 807 + 805 808 int i; 806 809 u32 check = 0; 807 810 u32 *ivap; 808 811 u32 *hpmcp; 809 812 u32 length; 810 - extern void os_hpmc(void); 811 - extern void os_hpmc_end(void); 812 813 813 814 if (strcmp((char *)iva, "cows can fly")) 814 815 return -1; ··· 821 820 822 821 /* Compute Checksum for HPMC handler */ 823 822 824 - length = (u32)((unsigned long)os_hpmc_end - (unsigned long)os_hpmc); 823 + length = os_hpmc_end - os_hpmc; 825 824 ivap[7] = length; 826 825 827 826 hpmcp = (u32 *)os_hpmc;