mirror of
https://github.com/vivier/EMILE.git
synced 2025-01-02 21:30:29 +00:00
add check_full_in_bank()
This commit is contained in:
parent
40876f5e73
commit
3d3d43c373
@ -221,6 +221,27 @@ unsigned long bank_mem_avail()
|
||||
return size;
|
||||
}
|
||||
|
||||
int check_full_in_bank(unsigned long start, unsigned long size)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < memory_map.bank_number; i++)
|
||||
{
|
||||
if ( ( (memory_map.bank[i].logiAddr <= start) &&
|
||||
(start < memory_map.bank[i].logiAddr + memory_map.bank[i].size) ) &&
|
||||
! ( (memory_map.bank[i].logiAddr <= start + size) &&
|
||||
(start + size < memory_map.bank[i].logiAddr + memory_map.bank[i].size) ) )
|
||||
{
|
||||
printf("0x%lx in 0x%lx : 0x%lx\n", start,
|
||||
memory_map.bank[i].logiAddr,
|
||||
memory_map.bank[i].logiAddr + memory_map.bank[i].size);
|
||||
printf("0x%lx out of bound\n", start + size);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef BANK_DUMP
|
||||
void bank_dump()
|
||||
{
|
||||
|
@ -26,3 +26,4 @@ extern unsigned long bank_mem_avail();
|
||||
extern void bank_dump();
|
||||
extern int logical2physical(unsigned long logical, unsigned long *physical);
|
||||
extern int physical2logical(unsigned long physical, unsigned long *logical);
|
||||
extern int check_full_in_bank(unsigned long start, unsigned long size);
|
||||
|
Loading…
Reference in New Issue
Block a user