Added platform osal malloc and free functions
authorHao Zhang <hzhang@ti.com>
Sat, 18 Jun 2011 16:47:44 +0000 (12:47 -0400)
committerHao Zhang <hzhang@ti.com>
Sat, 18 Jun 2011 16:47:44 +0000 (12:47 -0400)
boot_loader/examples/i2c/nand/src/i2c_boot_nand_example.c
boot_loader/examples/i2c/nor/src/i2c_boot_nor_example.c
boot_loader/examples/i2c/tftp/src/i2c_boot_tftp_example.c
boot_loader/examples/srio/srioboot_ddrinit/src/srioboot_ddrinit.c
boot_loader/examples/srio/srioboot_example/src/srioBootExample.c
boot_loader/examples/srio/srioboot_helloworld/src/srioboot_helloworld.c
post/src/post.c
writer/eeprom/src/eepromwriter.c
writer/nand/src/nandwriter.c
writer/nor/src/norwriter.c

index 6ebede1334082939649dbae9e159e2c56dedbe2c..6aa0d504e16113ed347a8704f0fbe626f9247f53 100644 (file)
 /* i2c_boot_nand_example version */
 char version[] = "01.00.00.00";
 
+/* OSAL functions for Platform Library */
+uint8_t *Osal_platformMalloc (uint32_t num_bytes, uint32_t alignment)
+{
+       return malloc(num_bytes);
+}
+
+void Osal_platformFree (uint8_t *dataPtr, uint32_t num_bytes)
+{
+    /* Free up the memory */
+    if (dataPtr)
+    {
+        free(dataPtr);
+    }
+}
+
 /******************************************************************************
  * Function:    print_platform_errno
  ******************************************************************************/
index 0b43d490500b65abd9aa495daedc7dfed528cdb7..7dceef22161d42b8dde0f62910ee353acfb5a6ca 100644 (file)
 /* i2c_boot_nor_example version */
 char version[] = "01.00.00.00";
 
+/* OSAL functions for Platform Library */
+uint8_t *Osal_platformMalloc (uint32_t num_bytes, uint32_t alignment)
+{
+       return malloc(num_bytes);
+}
+
+void Osal_platformFree (uint8_t *dataPtr, uint32_t num_bytes)
+{
+    /* Free up the memory */
+    if (dataPtr)
+    {
+        free(dataPtr);
+    }
+}
+
 /******************************************************************************
  * Function:    print_platform_errno
  ******************************************************************************/
index 55e447c61691df5833a8e46372253eeae8d495d3..771cf4ff80c4c7e27b00728480acb4c980b8aedc 100644 (file)
 /* i2c_boot_emac_example version */
 char version[] = "01.00.00.00";
 
+/* OSAL functions for Platform Library */
+uint8_t *Osal_platformMalloc (uint32_t num_bytes, uint32_t alignment)
+{
+       return malloc(num_bytes);
+}
+
+void Osal_platformFree (uint8_t *dataPtr, uint32_t num_bytes)
+{
+    /* Free up the memory */
+    if (dataPtr)
+    {
+        free(dataPtr);
+    }
+}
+
 /******************************************************************************
  * Function:    print_platform_errno
  ******************************************************************************/
index eb36d88c8514f67639d87e7444132f347f3c1392..db4c5943b96998882fcaa6c1201ebedf1b9c484f 100644 (file)
 
 #define BOOT_MAGIC_ADDR(x)  (MAGIC_ADDR + (1<<28) + (x<<24))
 
+/* OSAL functions for Platform Library */
+uint8_t *Osal_platformMalloc (uint32_t num_bytes, uint32_t alignment)
+{
+       return malloc(num_bytes);
+}
+
+void Osal_platformFree (uint8_t *dataPtr, uint32_t num_bytes)
+{
+    /* Free up the memory */
+    if (dataPtr)
+    {
+        free(dataPtr);
+    }
+}
+
+
 void
 start_boot
 (
index 4bed23ba3dea392e5e04a50bbfee9d6f1f6410fd..bd72c4696e8df96635c922273c80d00ffb099e1c 100644 (file)
@@ -76,6 +76,21 @@ volatile uint32_t bootEntryAddr = BOOT_ENTRY_ADDR;  /* Base address of MSMC */
 /* Port error status registers */
 #define SRIO_PORT_ERR_STATUS_REG(x)    (0x290b158 + x*0x20)
 
+/* OSAL functions for Platform Library */
+uint8_t *Osal_platformMalloc (uint32_t num_bytes, uint32_t alignment)
+{
+       return malloc(num_bytes);
+}
+
+void Osal_platformFree (uint8_t *dataPtr, uint32_t num_bytes)
+{
+    /* Free up the memory */
+    if (dataPtr)
+    {
+        free(dataPtr);
+    }
+}
+
 /* Convert bytes to 32 bits */
 uint32_t byteto32bits(uint8_t *pDspCode)
 {
index ead430cb7632acf6bf8f52942de4307a71de269e..7c4390f921963d79a597fe9afc7f0d10af49b62f 100644 (file)
 /* srioboot_helloworld version */
 char version[] = "01.00.00.01";
 
+/* OSAL functions for Platform Library */
+uint8_t *Osal_platformMalloc (uint32_t num_bytes, uint32_t alignment)
+{
+       return malloc(num_bytes);
+}
+
+void Osal_platformFree (uint8_t *dataPtr, uint32_t num_bytes)
+{
+    /* Free up the memory */
+    if (dataPtr)
+    {
+        free(dataPtr);
+    }
+}
+
 /******************************************************************************
  * Function:    write_uart
  ******************************************************************************/
index 1044dc9dfe0dc664237d0c554e7196e43504b4ef..17de6fd1e52109fabf087ab77316bd09ab273ac8 100644 (file)
 #pragma DATA_ALIGN(post_version, 16)
 char post_version[] = POST_VERSION;
 
+/* OSAL functions for Platform Library */
+uint8_t *Osal_platformMalloc (uint32_t num_bytes, uint32_t alignment)
+{
+       return malloc(num_bytes);
+}
+
+void Osal_platformFree (uint8_t *dataPtr, uint32_t num_bytes)
+{
+    /* Free up the memory */
+    if (dataPtr)
+    {
+        free(dataPtr);
+    }
+}
+
 /******************************************************************************
  * Function:    post_display_led_error
  ******************************************************************************/
index 90b9eaa5d3c566b775c970b77a3d171ff426876b..5646a0e1b53d974e0b53f534682e1404083afb97 100644 (file)
@@ -84,6 +84,21 @@ typedef struct EEPROM_WRITER_INFO_tag
 
 EEPROM_WRITER_INFO_T eepromWriterInfo;
 
+/* OSAL functions for Platform Library */
+uint8_t *Osal_platformMalloc (uint32_t num_bytes, uint32_t alignment)
+{
+       return malloc(num_bytes);
+}
+
+void Osal_platformFree (uint8_t *dataPtr, uint32_t num_bytes)
+{
+    /* Free up the memory */
+    if (dataPtr)
+    {
+        free(dataPtr);
+    }
+}
+
 /******************************************************************************
  * Function:    print_platform_errno
  ******************************************************************************/
index df325aee73e77740cb08af2828e53c6a729ab541..21692de8628772b69fc7866542da25c13fa54597 100644 (file)
@@ -85,6 +85,21 @@ typedef struct NAND_WRITER_INFO_tag
 
 NAND_WRITER_INFO_T nandWriterInfo;
 
+/* OSAL functions for Platform Library */
+uint8_t *Osal_platformMalloc (uint32_t num_bytes, uint32_t alignment)
+{
+       return malloc(num_bytes);
+}
+
+void Osal_platformFree (uint8_t *dataPtr, uint32_t num_bytes)
+{
+    /* Free up the memory */
+    if (dataPtr)
+    {
+        free(dataPtr);
+    }
+}
+
 /******************************************************************************
  * Function:    print_platform_errno
  ******************************************************************************/
index ca32b96053ac93ace4de6fc678c3484e35a473ff..c27e2289bf6f461ad577050f9eda1ea87a223b5f 100644 (file)
@@ -82,6 +82,21 @@ typedef struct NOR_WRITER_INFO_tag
 
 NOR_WRITER_INFO_T norWriterInfo;
 
+/* OSAL functions for Platform Library */
+uint8_t *Osal_platformMalloc (uint32_t num_bytes, uint32_t alignment)
+{
+       return malloc(num_bytes);
+}
+
+void Osal_platformFree (uint8_t *dataPtr, uint32_t num_bytes)
+{
+    /* Free up the memory */
+    if (dataPtr)
+    {
+        free(dataPtr);
+    }
+}
+
 /******************************************************************************
  * Function:    print_platform_errno
  ******************************************************************************/