test.c:
#define VIC0INTENABLE (*(volatile unsigned long *)0x71200010)
#define VIC0INTSELECT (*(volatile unsigned long *)0x7120000C)#define VIC0SOFTINT (*(volatile unsigned long *)0x71200018)
int (*printf)(char *,...) = (void *)0x57e11d4c;//0x57e11d4c u-boot中的打印函数。
int main()
{
__asm__ __volatile__(
"mrs r0,cpsr\n"
"bic r0,r0,#0x80\n"
"msr cpsr,r0\n"
:
:
:"r0","memory"
);
VIC0INTENABLE |=(1<<26);
VIC0INTSELECT &=~(1<<26);
VIC0SOFTINT |=(1<<26);
}
*******************************************************************
makefile:
all:
arm-none-linux-gnueabi-gcc -c vector.s -o vector.o
arm-none-linux-gnueabi-ld -Ttext=0 vector.o -o vector
arm-none-linux-gnueabi-objcopy -Ielf32-littlearm -O binary vector vector.bin
cp vector.bin /tftpboot/
arm-none-linux-gnueabi-gcc -c test.c -o test.o
arm-none-linux-gnueabi-ld -Ttext=0x50000000 test.o -o test
arm-none-linux-gnueabi-objcopy -Ielf32-littlearm -O binary test test.bin
cp test.bin /tftpboot/
clean:
rm -rf *.o *.bin /tftpboot/*.bin