Skip to content

Commit

Permalink
Fix chip memory allocation / ptplayer when VBR is moved.
Browse files Browse the repository at this point in the history
  • Loading branch information
cahirwpz committed Dec 16, 2023
1 parent 3ba95e6 commit 284862c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/libpt/pt.asm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ _PtPatternPos set mt_data+mt_PatternPos
_PtInstallCIA:
movem.l d2-d7/a2-a6,-(sp)
st.b d0
suba.l a0,a0
move.l _ExcVecBase,a0
lea $dff000,a6
bsr _mt_install_cia
movem.l (sp)+,d2-d7/a2-a6
Expand Down
1 change: 1 addition & 0 deletions system/kernel/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ void AddMemory(void *ptr, u_int size, u_int attributes) {
u_int sz = (uintptr_t)end - (uintptr_t)ar->start;
WordT *bt = ar->start;

Assume(ar != NULL);
Assume(end > (void *)ar->start + FREEBLK_SZ);

ar->succ = NULL;
Expand Down
3 changes: 2 additions & 1 deletion system/loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ void Loader(BootDataT *bd) {

for (i = 0; i < bd->bd_nregions; i++) {
MemRegionT *mr = &bd->bd_region[i];
AddMemory((void *)mr->mr_lower, mr->mr_upper - mr->mr_lower, mr->mr_attr);
uintptr_t lower = mr->mr_lower ? mr->mr_lower : 1;
AddMemory((void *)lower, mr->mr_upper - lower, mr->mr_attr);
}
}

Expand Down

0 comments on commit 284862c

Please sign in to comment.