2006-08-18 17:32:18 +04:00
|
|
|
; Include file for dumping user apps' memory through new debug BOARD
|
|
|
|
|
|
|
|
; Max amount of bytes to be dumped
|
|
|
|
IPC_BUF equ 160
|
|
|
|
|
|
|
|
; Dump macro parameters:
|
|
|
|
; ptr - pointer to memory dumped
|
|
|
|
; len - dump length
|
|
|
|
; workarea - any work area for sysfunc 9
|
|
|
|
; run_new - if not empty, run BOARD unless it is running already
|
|
|
|
|
|
|
|
macro Dump ptr, len, workarea,run_new
|
|
|
|
{
|
|
|
|
local .exist,.lt
|
|
|
|
pusha
|
|
|
|
mov ebx,workarea
|
|
|
|
call Board_seek
|
|
|
|
if ~ run_new eq
|
|
|
|
test edx,edx
|
|
|
|
jne .exist
|
2006-08-28 17:34:54 +04:00
|
|
|
mcall 70,Board_seek.board_fn,0
|
2006-08-18 17:32:18 +04:00
|
|
|
mov edx,eax
|
|
|
|
mcall 5,20
|
|
|
|
end if
|
|
|
|
.exist:
|
|
|
|
mov esi,len
|
|
|
|
cmp esi,IPC_BUF
|
|
|
|
jbe .lt
|
|
|
|
mov esi,IPC_BUF
|
|
|
|
.lt:
|
|
|
|
mcall 60,2,edx,ptr
|
|
|
|
popa
|
|
|
|
}
|
|
|
|
|
|
|
|
if used Board_seek
|
|
|
|
Board_seek:
|
|
|
|
; ebx - prcinfo
|
|
|
|
xor edx,edx
|
|
|
|
mcall 9,,-1
|
|
|
|
mov ecx,eax
|
|
|
|
mov esi,dword[.board_fn]
|
|
|
|
.lp:
|
|
|
|
mcall 9
|
|
|
|
cmp dword[ebx+10],esi
|
|
|
|
; jne .no
|
|
|
|
; cmp dword[ebx+42],399
|
|
|
|
je .ok
|
|
|
|
.no:
|
|
|
|
loop .lp
|
|
|
|
ret
|
|
|
|
.ok:
|
|
|
|
mov edx,[ebx+30]
|
|
|
|
ret
|
2006-08-28 17:34:54 +04:00
|
|
|
.board_fn:
|
|
|
|
dd 7
|
|
|
|
dd 0
|
|
|
|
dd 0
|
|
|
|
dd 0
|
|
|
|
dd 0
|
2007-06-08 19:54:05 +04:00
|
|
|
db '/sys/develop/BOARD',0
|
2006-08-18 17:32:18 +04:00
|
|
|
end if
|