/*
 * module_init.c
 *
 *  Created on: 11-Jun-2022
 *      Author: Invcuser52
 */


#include "api_list.h"
#include "module_init.h"



extern uint32_t _static_ram_alloc_addrs;


//#define SKIP_GOT_UPDTE
//#define MANUAL

void heap_init_freertos();



s_os_api_list_def moduleapi __attribute__((section(".jumptbl_module"))) =
{
  (&module_test_api),
  0x5a5a
};

void module_api_binder(unsigned int module_offset);


void module_got_table_update(unsigned long data_ram_memory, unsigned long flash_memory);



//RAM      (xrw)      : ORIGIN = 0x00000000,   LENGTH = 128K
//VECTOR_FLASH  (rx)  : ORIGIN = 0x0000000,    LENGTH = 64K
//FLASH    (rx)       : ORIGIN = 0x10000,    LENGTH = 256K


//RAM      (xrw)      : ORIGIN = 0x200230C0,   LENGTH = 128K
//VECTOR_FLASH  (rx)  : ORIGIN = 0x08100000,    LENGTH = 64K
//FLASH    (rx)       : ORIGIN = 0x08110000,    LENGTH = 256K

void data_got_bss_jumptable_init_func(unsigned long flash_memory, unsigned long ram_memory) //, uint8_t ram_relocation_sts)
{



}



void module_got_table_update(unsigned long data_ram_memory, unsigned long flash_memory)
{



}






void module_api_binder(unsigned int module_offset)
{
	module_offset = module_offset - 0x4000000;
	moduleapi.module_tst 				 = moduleapi.module_tst + module_offset;

}


