Andes Workshop

It is currently Thu Sep 19, 2019 5:30 am

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: no prologue option
PostPosted: Fri Nov 08, 2013 4:13 pm 
Offline
User avatar

Joined: Fri Mar 04, 2011 9:36 pm
Posts: 500
If your function doesn't need prologue, you can use the attribute "no_prologue"
This is an example:
Code:
void _nds32_init_mem(void) __attribute__((no_prologue, optimize("Os")));
void _nds32_init_mem(void) //The function is weak (optional)
{
#ifdef CFG_AG102   // AG102
#ifndef CFG_NORAM
   /* initialize DDR2 controller */
   do {
      NDS32_REG_WRITE(DDR2C_BASE + DDR2C_DCR_OFFSET, 0x000025cc);     // SDRAM configure
      NDS32_REG_WRITE(DDR2C_BASE + DDR2C_DTAR_OFFSET, 0x00100000);    // Data training addr.
      NDS32_REG_WRITE(DDR2C_BASE + DDR2C_DRR_OFFSET, 0x00034812);     // Set refresh
      NDS32_REG_WRITE(DDR2C_BASE + DDR2C_MR_OFFSET, 0x00000852);      // Set mode
      NDS32_REG_WRITE(DDR2C_BASE + DDR2C_IOCR_OFFSET, 0x0000000f);    // Set IOCR

      /*
       * Enable host ports and trigger initialization
       */
      NDS32_REG_WRITE(DDR2C_BASE + DDR2C_CCR_OFFSET, 0x80020000);

      /* Wait for ddr init state to be set */
      __nds32__isb();

      /* Wait until the config initialization is finish */
      while(NDS32_REG_READ(DDR2C_BASE + DDR2C_CSR_OFFSET) >> 23);
...
}


The objdump of _nds32_init_mem: (partial)
Code:
000004e4 <_nds32_init_mem>:
     4e4:   46 10 01 51    sethi $r1,#0x151
     4e8:   58 10 81 51    ori $r1,$r1,#0x151
     4ec:   46 00 0e 01    sethi $r0,#0xe01
     4f0:   a8 41          swi333 $r1,[$r0+#0x4]
     4f2:   46 10 00 10    sethi $r1,#0x10
     4f6:   80 21          mov55 $r1,$r1
     4f8:   46 20 0f 01    sethi $r2,#0xf01
     4fc:   58 21 00 30    ori $r2,$r2,#0x30
......


It contains no prologue and no epilogue.


Top
 Profile Send private message E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group