changeset 493:2e73bbc0648e

OSL: os_mem_fl.c compiles
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 24 Jun 2018 18:59:22 +0000
parents 10c059efb3d1
children e9bdc8184d50
files components/frame_na7_db_fl src/gpf2/osl/os_mem_fl.c
diffstat 2 files changed, 24 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/components/frame_na7_db_fl	Sun Jun 24 18:21:48 2018 +0000
+++ b/components/frame_na7_db_fl	Sun Jun 24 18:59:22 2018 +0000
@@ -44,3 +44,4 @@
 cfile_plain $SRCDIR/os_com_fl.c
 cfile_plain $SRCDIR/os_drv.c
 cfile_plain $SRCDIR/os_isr.c
+cfile_plain $SRCDIR/os_mem_fl.c
--- a/src/gpf2/osl/os_mem_fl.c	Sun Jun 24 18:21:48 2018 +0000
+++ b/src/gpf2/osl/os_mem_fl.c	Sun Jun 24 18:59:22 2018 +0000
@@ -6,8 +6,7 @@
 /* set of included headers from COFF symtab: */
 #include <stdio.h>
 #include <string.h>
-#include "gpfconf.h"	/* FreeCalypso addition */
-#include "../../nucleus/nucleus.h"
+#include "nucleus.h"
 #include "typedefs.h"
 #include "os.h"
 #include "gdi.h"
@@ -259,8 +258,8 @@
 		Suspend = 1;
 	ret = OS_OK;
 	for (;;) {
-		sts = NU_Allocate_Memory(MemPoolTable[PoolHandle].pcb, Buffer,
-					 Size, Suspend);
+		sts = NU_Allocate_Memory(MemPoolTable[PoolHandle].pcb,
+					 (VOID **) Buffer, Size, Suspend);
 		switch (sts) {
 		case NU_SUCCESS:
 			return(ret);
@@ -348,13 +347,19 @@
 	sprintf(PoolName, "POOL%1d%1d", part_group + 1, j);
 	Size &= ~3;
 	npool->pool_mem = Addr;
+#if 0
 	/*
-	 * FreeCalypso: we need to bzero the PM_PCB before calling
-	 * NU_Create_Partition_Pool() to prevent the possibility of
-	 * Nucleus error checker failing the call because the
-	 * signature word happens to be there already.
+	 * FreeCalypso: in our first-attempt gcc-built firmwares we needed to
+	 * bzero the PM_PCB before calling NU_Create_Partition_Pool() to
+	 * prevent the possibility of Nucleus error checker failing the call
+	 * because the signature word happens to be there already.  The issue
+	 * arose because we were using "raw" memory sections that weren't
+	 * zeroed out on boot like standard .bss, but in TI's original
+	 * architecture everything is zeroed out on boot, so we don't need
+	 * this additional zeroing here.
 	 */
 	bzero(&npool->pcb, sizeof(NU_PARTITION_POOL));
+#endif
 	if (NU_Create_Partition_Pool(&npool->pcb, PoolName, npool->pool_mem,
 				     POOL_SIZE(Num, Size), Size + 4, NU_FIFO)
 			!= NU_SUCCESS)
@@ -419,13 +424,20 @@
 				      sizeof(NU_MEMORY_POOL), OS_NO_SUSPEND,
 				      os_ext_pool_handle) != OS_OK)
 			goto release_sem_return_err;
+#if 0
 		/*
-		 * FreeCalypso: we need to bzero the DM_PCB before calling
+		 * FreeCalypso: in our first-attempt gcc-built firmwares we
+		 * needed to bzero the DM_PCB before calling
 		 * NU_Create_Memory_Pool() to prevent the possibility of
-		 * Nucleus error checker failing the call because the
-		 * signature word happens to be there already.
+		 * Nucleus error checker failing the call because the signature
+		 * word happens to be there already.  The issue arose because
+		 * we were using "raw" memory sections that weren't zeroed out
+		 * on boot like standard .bss, but in TI's original architecture
+		 * everything is zeroed out on boot, so we don't need this
+		 * additional zeroing here.
 		 */
 		bzero(MemPoolTable[i].pcb, sizeof(NU_MEMORY_POOL));
+#endif
 	}
 	if (NU_Create_Memory_Pool(MemPoolTable[i].pcb, Name, Addr, PoolSize,
 				  4, NU_FIFO) != NU_SUCCESS)