Commit 0745d19a authored by Jiri Slaby's avatar Jiri Slaby Committed by Greg Kroah-Hartman

hpsim, fix SAL handling in fw-emu

The switch-cases of SAL_FREQ_BASE generate non-relocatable code. The
same as for the ifs one level upper. This causes oopses early in boot
because the kernel jumps to the hell instead of the offset in sal
callback.

So use ifs here for SAL_FREQ_BASE decision too.

Isn't there any compiler directive or settings to solve that cleanly?
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fef21073
...@@ -160,28 +160,19 @@ sal_emulator (long index, unsigned long in1, unsigned long in2, ...@@ -160,28 +160,19 @@ sal_emulator (long index, unsigned long in1, unsigned long in2,
*/ */
status = 0; status = 0;
if (index == SAL_FREQ_BASE) { if (index == SAL_FREQ_BASE) {
switch (in1) { if (in1 == SAL_FREQ_BASE_PLATFORM)
case SAL_FREQ_BASE_PLATFORM:
r9 = 200000000; r9 = 200000000;
break; else if (in1 == SAL_FREQ_BASE_INTERVAL_TIMER) {
case SAL_FREQ_BASE_INTERVAL_TIMER:
/* /*
* Is this supposed to be the cr.itc frequency * Is this supposed to be the cr.itc frequency
* or something platform specific? The SAL * or something platform specific? The SAL
* doc ain't exactly clear on this... * doc ain't exactly clear on this...
*/ */
r9 = 700000000; r9 = 700000000;
break; } else if (in1 == SAL_FREQ_BASE_REALTIME_CLOCK)
case SAL_FREQ_BASE_REALTIME_CLOCK:
r9 = 1; r9 = 1;
break; else
default:
status = -1; status = -1;
break;
}
} else if (index == SAL_SET_VECTORS) { } else if (index == SAL_SET_VECTORS) {
; ;
} else if (index == SAL_GET_STATE_INFO) { } else if (index == SAL_GET_STATE_INFO) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment