Commit 4c58ebed authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Fix compressed ROM support

When PhysRamTable was updated to store addresses in page units instead
of byte units (commit df4efb68), the code which allocates the ROM
decompression workspace didn't get updated, causing it to break. Add a
few extra shifts to the code in order to account for the changes.

Fixes issue reported on forums with (compressed) OMAP3 ROM failing to
boot: https://www.riscosopen.org/forum/forums/5/topics/16446
parent 46081bca
......@@ -1392,22 +1392,22 @@ ROMDecompAlign_$pt * 20
STR v7, [sp, #8] ; Overwrite stacked WS size
MOV v6, #ROMDecompWSAddr_$pt ; Current log addr
26
ADD v2, v2, v5
BIC v2, v2, v5 ; MB-aligned physram
ADD v2, v2, v5, LSR #12
BIC v2, v2, v5, LSR #12 ; MB-aligned physram
LDMIA v1, {a2, a3}
SUB a2, v2, a2 ; Amount of bank used
SUB a2, a3, a2 ; Amount of bank remaining
MOVS a2, a2, ASR #ROMDecompAlign_$pt ; Round down to nearest MB
SUB a2, v2, a2 ; Amount of bank used (page units)
RSB a2, a2, a3, LSR #12 ; Amount of bank remaining (page units)
MOVS a2, a2, ASR #ROMDecompAlign_$pt-12 ; Round down to nearest MB
LDRLE v2, [v1, #8]! ; Move to next bank if 0MB left
BLE %BT26
CMP a2, v7, LSR #ROMDecompAlign_$pt
MOVHS a4, v7
MOVLO a4, a2, LSL #ROMDecompAlign_$pt ; a4 = amount to take
MOV a1, v2 ; set up parameters for MapIn call
MOV a1, v2, LSL #12 ; set up parameters for MapIn call
MOV a2, v6
MOV a3, #OSAP_None
SUB v7, v7, a4 ; Decrease amount to allocate
ADD v2, v2, a4 ; Increase physram ptr
ADD v2, v2, a4, LSR #12 ; Increase physram ptr
ADD v6, v6, a4 ; Increase logram ptr
BL Init_MapIn_$pt
CMP v7, #0
......
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