]> rtime.felk.cvut.cz Git - sysless.git/blobdiff - arch/h8300/generic/libs/boot/boot_fn.c
h8300: Make bloader work with ELF toolchain
[sysless.git] / arch / h8300 / generic / libs / boot / boot_fn.c
index 31d4cb06a22787cb1bf76e76eaa813002dd5067f..f46f3af4352b5aa2deef1d5daad1dbfa987d00a9 100644 (file)
@@ -55,16 +55,6 @@ void wdg_clear()
 
 #define TO_TEXT __attribute__ ((section (".text")))
 
-#define PIC_ADR(_ptr,_var) \
-       { \
-         __asm__ ( \
-           "bsr 1f\n" \
-           "1:\tmov.l @sp+,%0\n" \
-           "\tadd.l %1-1b,%0\n" \
-           : "=r" (_ptr) : "i" (&(_var)) : "cc" \
-         ); \
-       }
-
 static const unsigned long
   flash_blocks[] TO_TEXT =
        {0x00000,0x01000,0x02000,0x03000,0x04000,0x05000,0x06000,0x07000,
@@ -91,7 +81,7 @@ __asm__ (
 ".global _FlWait\n"
 "_FlWait:\n"
 #if (CPU_SYS_HZ>16000000)
-"      shll.l  er0"
+"      shll.l  er0\n"
 #endif
 "      mov.w   #1,r1\n"
 "      bra     2f:8\n"
@@ -110,7 +100,7 @@ int FlAdr2Blk(unsigned long adr)
 {
   int bl=0;
   unsigned long *blocks;
-  PIC_ADR(blocks,flash_blocks[0]);
+  blocks = &flash_blocks[0];
 
   if(adr<blocks[0]) return -1;
   while(blocks[bl+1]){
@@ -125,7 +115,7 @@ int FlTest(int bl)
 {
   __u16 *p, *pe;
   unsigned long *blocks;
-  PIC_ADR(blocks,flash_blocks[0]);
+  blocks = &flash_blocks[0];
   
   if(bl>=flash_block_count) return -2;
   if(bl<0) return -2;