.provide _NUMBER_OF_CORES, 4

.provide _SR_Setting, 	0x3e4000c	; The value to set the SR after reset:
                                    ; exception mode
                                    ; interrupt level 31
                                    ; saturation on
                                    ; rounding mode: nearest even


; This mapping will be done by startup file

; Virtual local memory definitions
.provide _VIRTUAL_MEM_start, 0
.provide _VIRTUAL_MEM_size, 0x10000
.provide _VIRTUAL_MEM_end, _VIRTUAL_MEM_start + _VIRTUAL_MEM_size - 1 

.provide _LocalData_b, _VIRTUAL_MEM_start
.provide _LocalData_size, 0x8000
.provide _LocalData_e, _LocalData_b + _LocalData_size - 1

.provide _User_LocalData_b, _LocalData_e + 1
.provide _User_LocalData_size,	_VIRTUAL_MEM_size - _LocalData_size
.provide _User_LocalData_e,	_User_LocalData_b + _User_LocalData_size - 1
.assert (_LocalData_size < _VIRTUAL_MEM_size)

.provide _StackSize, 0x2000
.provide _StackStart, _LocalData_e + 1 - _StackSize
.provide _TopOfStack, _LocalData_e + 1

.provide __BottomOfHeap,  _StackStart  ; A dynamic configuration for stack and heap is defined when the __BottomOfHeap,  _StackStart symbols have the same value. 
									  ; A static configuration is defined when values for __BottomOfHeap and _StackStart symbols are different.
									  ; The value of __BottomOfHeap is the lowest address that is used by heap when a static configuration is used.

.provide __TopOfHeap,  _TopOfStack     ; By default, this serves as the heap start address. The heap grows downwards.

.assert (((__TopOfHeap == _TopOfStack) && (__BottomOfHeap == _StackStart)) ||  ((__TopOfHeap != _TopOfStack) && (__BottomOfHeap != _StackStart)))


; Physical memory definitions
.provide _M2_start, 	0xC0000000
.provide _M2_size,  	0x00080000      				; M2 size. (512K)
.provide _M2_end, 		_M2_start + _M2_size - 1

.provide _LocalData_Phys_b, _M2_start
.provide _LocalData_Phys_start, _M2_start + _ID_CORE * _LocalData_size
.provide _LocalData_Phys_end, _M2_start + (_ID_CORE + 1) * _LocalData_size -1

.provide _User_LocalData_Phys_start, _LocalData_Phys_end + 1
.provide _User_LocalData_Phys_end, _User_LocalData_Phys_start + _User_LocalData_size -1

; Private memory from M2 size. (64K)
.memory _LocalData_Phys_start , _LocalData_Phys_end - _StackSize, "rwx"		; Reserve the space for stack and heap
.memory _User_LocalData_Phys_start , _User_LocalData_Phys_end, "rwx"	

.provide _M2_SHARED_start, _M2_start + _NUMBER_OF_CORES * _VIRTUAL_MEM_size
.memory _M2_SHARED_start, _M2_end, "rwx"		; Shared memory from M2 size. (256K)

.provide _M3_start, 	0xD0000000   	 		; M3 beginning
.provide _M3_size,  	0x00a00000      		; M3 size. (10M)
.provide _M3_end, 	_M3_start + _M3_size - 1
.memory _M3_start, _M3_end, "rwx"

.provide _DDR_start, 0x40000000
.provide _DDR_size, 0x20000000
.provide _DDR_end, _DDR_start + _DDR_size -1	; DDR size (512MB)
.memory _DDR_start, _DDR_end, "rwx"

.provide _PCI_start, 0xE0000000
.provide _PCI_size,  0x20000000
.provide _PCI_end,   _PCI_start + _PCI_size - 1
.memory  _PCI_start, _PCI_end, "rwx"

.provide _osvecb, _M2_SHARED_start       ; OS interrupt vectors
.provide _osvec_size, 0x1000
.provide _osvece, _osvecb + _osvec_size
						  
.provide _VBAddr, _osvecb

; Local Memory
; Put all the local memory sections to "local_data" 
.concatenate "local_data", ".rom_init_tables", ".bsstab", ".exception", ".exception_index", ".staticinit",  "reserved_crt_tls", ".att_mmu", ".oskernel_local_data",".data", ".zdata", ".ovltab", ".bss", ".oskernel_bss"

