Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c3d4ed4e authored by Kyle McMartin's avatar Kyle McMartin Committed by Kyle McMartin
Browse files

[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: default avatarKyle McMartin <kyle@parisc-linux.org>
parent 3bb457af
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -295,8 +295,5 @@ os_hpmc_6:
	b .
	nop
ENDPROC(os_hpmc)

	/* this label used to compute os_hpmc checksum */
ENTRY(os_hpmc_end)

ENTRY(os_hpmc_end)	/* this label used to compute os_hpmc checksum */
	nop
+4 −3
Original line number Diff line number Diff line
@@ -802,13 +802,14 @@ void handle_interruption(int code, struct pt_regs *regs)

int __init check_ivt(void *iva)
{
	extern const u32 os_hpmc[];
	extern const u32 os_hpmc_end[];

	int i;
	u32 check = 0;
	u32 *ivap;
	u32 *hpmcp;
	u32 length;
	extern void os_hpmc(void);
	extern void os_hpmc_end(void);

	if (strcmp((char *)iva, "cows can fly"))
		return -1;
@@ -820,7 +821,7 @@ int __init check_ivt(void *iva)

	/* Compute Checksum for HPMC handler */

	length = (u32)((unsigned long)os_hpmc_end - (unsigned long)os_hpmc);
	length = os_hpmc_end - os_hpmc;
	ivap[7] = length;

	hpmcp = (u32 *)os_hpmc;