Get rid of manual HEAP_BASE align, finally
This commit is contained in:
41
umka.asm
41
umka.asm
@@ -97,7 +97,7 @@ macro int n {
|
|||||||
end if
|
end if
|
||||||
}
|
}
|
||||||
|
|
||||||
section '.text' executable align 32
|
section '.text' executable align 64
|
||||||
|
|
||||||
coverage_begin:
|
coverage_begin:
|
||||||
|
|
||||||
@@ -105,7 +105,9 @@ include 'macros.inc'
|
|||||||
|
|
||||||
macro diff16 msg,blah2,blah3 {
|
macro diff16 msg,blah2,blah3 {
|
||||||
if msg eq "end of .data segment"
|
if msg eq "end of .data segment"
|
||||||
section '.bss' writeable align 64
|
; fasm doesn't align on 65536, but ld script does
|
||||||
|
section '.bss.aligned65k' writeable align 65536
|
||||||
|
bss_base:
|
||||||
end if
|
end if
|
||||||
}
|
}
|
||||||
include 'proc32.inc'
|
include 'proc32.inc'
|
||||||
@@ -191,10 +193,22 @@ macro call target {
|
|||||||
call target
|
call target
|
||||||
end if
|
end if
|
||||||
}
|
}
|
||||||
|
macro mov r, v {
|
||||||
|
if r eq byte [current_slot_idx] & v eq bh
|
||||||
|
push eax
|
||||||
|
mov eax, ebx
|
||||||
|
sub eax, SLOT_BASE
|
||||||
|
shr eax, BSF sizeof.APPDATA
|
||||||
|
mov [current_slot_idx], eax
|
||||||
|
pop eax
|
||||||
|
else
|
||||||
|
mov r, v
|
||||||
|
end if
|
||||||
|
}
|
||||||
do_change_task equ hjk
|
do_change_task equ hjk
|
||||||
irq0 equ jhg
|
irq0 equ jhg
|
||||||
include 'core/sched.inc'
|
include 'core/sched.inc'
|
||||||
purge call
|
purge call, mov
|
||||||
restore irq0
|
restore irq0
|
||||||
include 'core/syscall.inc'
|
include 'core/syscall.inc'
|
||||||
;include 'core/fpu.inc'
|
;include 'core/fpu.inc'
|
||||||
@@ -277,21 +291,12 @@ proc kos_time_to_epoch c uses ebx esi edi ebp, _time
|
|||||||
endp
|
endp
|
||||||
|
|
||||||
proc umka._.check_alignment
|
proc umka._.check_alignment
|
||||||
mov eax, SLOT_BASE
|
|
||||||
and eax, 0xffff ; 65k
|
|
||||||
jz @f
|
|
||||||
mov ecx, 0x10000
|
|
||||||
sub ecx, eax
|
|
||||||
DEBUGF 4, "SLOT_BASE must be aligned on 0x10000: 0x%x", SLOT_BASE
|
|
||||||
DEBUGF 4, ", add 0x%x or sub 0x%x\n", ecx, eax
|
|
||||||
int3
|
|
||||||
@@:
|
|
||||||
mov eax, HEAP_BASE
|
mov eax, HEAP_BASE
|
||||||
and eax, 0xfff ; page
|
and eax, PAGE_SIZE - 1
|
||||||
jz @f
|
jz @f
|
||||||
mov ecx, 0x1000
|
mov ecx, PAGE_SIZE
|
||||||
sub ecx, eax
|
sub ecx, eax
|
||||||
DEBUGF 4, "HEAP_BASE must be aligned on 0x1000: 0x%x", HEAP_BASE
|
DEBUGF 4, "HEAP_BASE must be aligned on PAGE_SIZE: 0x%x", HEAP_BASE
|
||||||
DEBUGF 4, ", add 0x%x or sub 0x%x\n", ecx, eax
|
DEBUGF 4, ", add 0x%x or sub 0x%x\n", ecx, eax
|
||||||
int3
|
int3
|
||||||
@@:
|
@@:
|
||||||
@@ -734,11 +739,11 @@ BTN_ADDR dd ?
|
|||||||
MEM_AMOUNT rd 0x1d
|
MEM_AMOUNT rd 0x1d
|
||||||
SYS_SHUTDOWN db ?
|
SYS_SHUTDOWN db ?
|
||||||
sys_proc rd 0x800
|
sys_proc rd 0x800
|
||||||
rb 0xb102 ; align SLOT_BASE on 0x10000
|
|
||||||
SLOT_BASE: rd 0x8000
|
SLOT_BASE: rd 0x8000
|
||||||
VGABasePtr rb 640*480
|
VGABasePtr rb 640*480
|
||||||
;rb 0x582 ; align HEAP_BASE on page boundary
|
rb PAGE_SIZE - (($-bss_base) AND (PAGE_SIZE-1)) ; align on page
|
||||||
HEAP_BASE rb UMKA_MEMORY_BYTES - (HEAP_BASE-os_base+4096*sizeof.MEM_BLOCK)
|
HEAP_BASE rb UMKA_MEMORY_BYTES - (HEAP_BASE - os_base + \
|
||||||
|
PAGE_SIZE * sizeof.MEM_BLOCK)
|
||||||
endg
|
endg
|
||||||
|
|
||||||
uglobal
|
uglobal
|
||||||
|
Reference in New Issue
Block a user