FreeCalypso > hg > freecalypso-sw
changeset 437:1d78af921a5a
os_mem_ir.c: os_PartitionCheck() done
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Sun, 22 Jun 2014 21:01:32 +0000 |
parents | adfc04008d75 |
children | 0eb7c6389717 |
files | gsm-fw/gpf/osl/os_mem_ir.c |
diffstat | 1 files changed, 16 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/gsm-fw/gpf/osl/os_mem_ir.c Sun Jun 22 20:39:01 2014 +0000 +++ b/gsm-fw/gpf/osl/os_mem_ir.c Sun Jun 22 21:01:32 2014 +0000 @@ -33,3 +33,19 @@ } return(OS_ERROR); } + +GLOBAL LONG +os_PartitionCheck(ULONG *ptr) +{ + PM_HEADER *phdr; + PM_PCB *pool; + + phdr = (PM_HEADER *)(ptr - 2); + if (phdr->pm_next_available) + return(OS_PARTITION_FREE); + pool = phdr->pm_partition_pool; + if (ptr[(pool->pm_partition_size - 4) >> 2] == GUARD_PATTERN) + return(OS_OK); + else + return(OS_PARTITION_GUARD_PATTERN_DESTROYED); +}