OSDN Git Service

1311558f9688e0cf1c4996ed5e8d1d65529b0d8d
[trx-305dsp/dsp.git] / trx305 / kernel / utils / ldr2sh
1 #! /bin/bash
2
3 # Prepare the headder part of the source code for SH2. 
4 cat > $2 <<_EOD_
5         .CPU            SH2
6         .SECTION        DSP,CODE
7 ;==========================================================================
8         .EXPORT BlackfinBytes
9         .ALIGN  4
10 BlackfinBytes:
11         .DATA.L BlackfinEnd-BlackfinStart
12 BlackfinStart:
13 _EOD_
14
15 # convert the Blackfin LDR file as first parameter to the SH2 Assembler data format.
16 od  -v -t x1 $1 | sed "s/ /\,/g" |sed "s/^[0-9]*\,/.DATA.B ,/" | sed "s/,/,H\'/g" | sed "/^[0-9]*$/d" | sed "s/[0-9a-f]H//" | sed "s/,//" | sed "s/^/\t/" >> $2
17
18 # Add the tail part to the source code for SH2.
19 cat >>$2 <<_EOD_
20 BlackfinEnd:
21         .END
22 _EOD_