changeset 436:adfc04008d75

OSL: os_mem_ir.c started
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sun, 22 Jun 2014 20:39:01 +0000
parents c6e1c813e7f0
children 1d78af921a5a
files gsm-fw/gpf/osl/Makefile gsm-fw/gpf/osl/os_mem_ir.c
diffstat 2 files changed, 36 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gsm-fw/gpf/osl/Makefile	Sun Jun 22 01:40:59 2014 +0000
+++ b/gsm-fw/gpf/osl/Makefile	Sun Jun 22 20:39:01 2014 +0000
@@ -3,7 +3,7 @@
 IOPTS=	-DRUN_INT_RAM
 XOPTS=	-DRUN_FLASH -mthumb
 
-IOBJS=	os_com_ir.o os_pro_ir.o
+IOBJS=	os_com_ir.o os_mem_ir.o os_pro_ir.o
 XOBJS=	os_com_fl.o os_drv.o os_isr.o os_mem_fl.o os_pro_fl.o
 
 all:	${IOBJS} ${XOBJS}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsm-fw/gpf/osl/os_mem_ir.c	Sun Jun 22 20:39:01 2014 +0000
@@ -0,0 +1,35 @@
+/*
+ * This C module is a reconstruction based on the disassembly of
+ * os_mem.obj in frame_na7_db_ir.lib from the Leonardo package.
+ */
+
+/* set of included headers from COFF symtab: */
+#include <stdio.h>
+#include <string.h>
+#include "gpfconf.h"	/* FreeCalypso addition */
+#include "../../nucleus/nucleus.h"
+#include "typedefs.h"
+#include "os.h"
+#include "gdi.h"
+#include "os_types.h"
+#include "os_glob.h"
+
+extern T_OS_PART_GRP_TABLE_ENTRY PartGrpTable[];
+extern T_OS_POOL_BORDER PoolBorder[];
+
+GLOBAL LONG
+os_is_valid_partition(T_VOID_STRUCT *Buffer)
+{
+	int i;
+
+	for (i = 0; i <= MaxPoolGroups; i++) {
+		if (PoolBorder[i].End == 0)
+			return(OS_ERROR);
+		if ((char *)Buffer < PoolBorder[i].Start)
+			continue;
+		if ((char *)Buffer >= PoolBorder[i].End)
+			continue;
+		return(OS_OK);
+	}
+	return(OS_ERROR);
+}