
ARCHITECTURE(ADSP-2191)

$OBJECTS = $COMMAND_LINE_OBJECTS;
// This memory map is set up to facilite testing of the tool
// chain -- code and data area are as large as possible. 

MEMORY
{
    seg_dmy    { TYPE(PM RAM) START(0x000000) END(0x000003) WIDTH(24) }
    seg_itab   { TYPE(PM RAM) START(0x000004) END(0x00003f) WIDTH(24) }
    seg_code   { TYPE(PM RAM) START(0x000040) END(0x003fff) WIDTH(24) }

	seg_buf2   { TYPE(DM RAM) START(0x008000) END(0x008fff) WIDTH(16) }
	seg_buf1   { TYPE(DM RAM) START(0x009000) END(0x0095ff) WIDTH(16) }
    seg_data1  { TYPE(DM RAM) START(0x009600) END(0x00afff) WIDTH(16) }
    seg_data2  { TYPE(PM RAM) START(0x004000) END(0x006bff) WIDTH(24) }
    seg_heap   { TYPE(DM RAM) START(0x00f200) END(0x00f9ff) WIDTH(16) }
    seg_stack  { TYPE(DM RAM) START(0x00fa00) END(0x00ffff) WIDTH(16) }
}

PROCESSOR p0
{
    LINK_AGAINST( $COMMAND_LINE_LINK_AGAINST)
    OUTPUT( $COMMAND_LINE_OUTPUT_FILE )

    SECTIONS
    {
		sec_dmy
		{
			INPUT_SECTIONS( $OBJECTS(IVreset))
		} > seg_dmy

        sec_itab
        {
			INPUT_SECTIONS( $OBJECTS(IVpwrdwn))
			. = .+0x1;
			INPUT_SECTIONS( $OBJECTS(IVkernel))
			. = .+0x1;
			INPUT_SECTIONS( $OBJECTS(IVstackint))
			. = .+0x1;
			INPUT_SECTIONS( $OBJECTS(IVmailboxint))
			. = .+0x1;
			INPUT_SECTIONS( $OBJECTS(IVtimerint))
			. = .+0x1;
			INPUT_SECTIONS( $OBJECTS(IVringint))
			. = .+0x1;
			INPUT_SECTIONS( $OBJECTS(IVpcibmint))
			. = .+0x1;
			INPUT_SECTIONS( $OBJECTS(IVdspdspint))
			. = .+0x1;
			INPUT_SECTIONS( $OBJECTS(IVfifo0tmitint))
			. = .+0x1;
			INPUT_SECTIONS( $OBJECTS(IVfifo0rcveint))
			. = .+0x1;
			INPUT_SECTIONS( $OBJECTS(IVfifo1tmitint))
			. = .+0x1;
			INPUT_SECTIONS( $OBJECTS(IVfifo1rcveint))
			. = .+0x1;
			INPUT_SECTIONS( $OBJECTS(IVint13))
			. = .+0x1;
			INPUT_SECTIONS( $OBJECTS(IVint14))
			. = .+0x1;
			INPUT_SECTIONS( $OBJECTS(IVac97frint))
			. = .+0x1;
		} > seg_itab
        seg_code
        {
            INPUT_SECTIONS( $OBJECTS(program) )
        } >seg_code

		sec_buf1
		{
			INPUT_SECTIONS($OBJECTS(seg_buf1) )
		}>seg_buf1		

		sec_buf2
		{
			INPUT_SECTIONS($OBJECTS(seg_buf2) )
		}>seg_buf2

        sec_data1
        {
            INPUT_SECTIONS( $OBJECTS(data1) )
        } >seg_data1

        sec_data2
        {
            INPUT_SECTIONS( $OBJECTS(data2) )
            INPUT_SECTIONS( $OBJECTS(program2) )
        } >seg_data2


        // support for initialization, including C++
        sec_ctor
        {
            INPUT_SECTIONS( $OBJECTS(ctor))
        } >seg_data1

        // provide linker variables describing the stack (grows down)
        //   ldf_stack_limit is the lowest address in the stack
        //   ldf_stack_base is the highest address in the stack 
        sec_stack
        {
            ldf_stack_limit = .;
            ldf_stack_base = . + MEMORY_SIZEOF(seg_stack) - 1;
        } >seg_stack
        sec_heap
        {
            .heap = .;
	    .heap_size = MEMORY_SIZEOF(seg_heap);
            .heap_end = . + MEMORY_SIZEOF(seg_heap) - 1;
        } >seg_heap
    }
}
