From: wangjiankun820624 Date: Fri, 23 May 2008 16:21:24 +0800 (CST) Subject: [U-Boot-Users] about ".set push" Message-ID: <11794564.592101211530884611.JavaMail.coremail@bj163app114.163.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello, the following codes below comes from the file of u-boot\lib_mips\octeon_boot.c. I don't know the function of the ".set push", and I don't know which type of the "push", symbol,dirctive or others? I read this section, but make me more confused. Please help me, thanks! set Syntax: .set symbol, expression Set the value of symbol to expression. This changes symbol's value and type to conform to expression. If symbol was flagged as external, it remains flagged (see Symbol Attributes). You may .set a symbol many times in the same assembly. If you .set a global symbol, the value stored in the object file is the last value stored into it. void octeon_write64(uint64_t csr_addr, uint64_t val) { volatile uint32_t val_low = val & 0xffffffff; volatile uint32_t val_high = val >> 32; volatile uint32_t addr_low = csr_addr & 0xffffffff; volatile uint32_t addr_high = csr_addr >> 32; asm volatile ( " .set push \n" " .set mips64 \n" " .set noreorder \n" /* Standard twin 32 bit -> 64 bit construction */ " dsll %[valh], 32 \n" " dsll %[vall], 32 \n" " dsrl %[vall], 32 \n" " daddu %[valh], %[valh], %[vall] \n" /* Combined value is in valh */ /* Standard twin 32 bit -> 64 bit construction */ " dsll %[addrh], 32 \n" " dsll %[addrl], 32 \n" " dsrl %[addrl], 32 \n" " daddu %[addrh], %[addrh], %[addrl] \n" /* Combined value is in addrh */ " sd %[valh], 0(%[addrh]) \n" " .set pop \n" : : [valh] "r" (val_high), [vall] "r" (val_low), [addrh] "r" (addr_high), [addrl] "r" (addr_low): "memory"); } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.denx.de/pipermail/u-boot/attachments/20080523/210de729/attachment.htm