* [U-Boot-Users] [MIPS] cpu/mips/cache.S: Introduce NESTED(), LEAF() and END()
@ 2008-03-17 14:46 Shinya Kuribayashi
2008-03-17 21:12 ` Wolfgang Denk
0 siblings, 1 reply; 3+ messages in thread
From: Shinya Kuribayashi @ 2008-03-17 14:46 UTC (permalink / raw)
To: u-boot
These macros have been widely used by MIPS assemblers, and of course
make codes more readable and easily maintainable.
Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
---
cpu/mips/cache.S | 25 +++++++------------------
1 files changed, 7 insertions(+), 18 deletions(-)
diff --git a/cpu/mips/cache.S b/cpu/mips/cache.S
index 9d793bf..66fe47a 100644
--- a/cpu/mips/cache.S
+++ b/cpu/mips/cache.S
@@ -24,6 +24,7 @@
#include <config.h>
#include <version.h>
+#include <asm/asm.h>
#include <asm/regdef.h>
#include <asm/mipsregs.h>
#include <asm/addrspace.h>
@@ -119,10 +120,7 @@
* RETURNS: N/A
*
*/
- .globl mips_cache_reset
- .ent mips_cache_reset
-mips_cache_reset:
-
+NESTED(mips_cache_reset, 0, ra)
li t2, CFG_ICACHE_SIZE
li t3, CFG_DCACHE_SIZE
li t4, CFG_CACHELINE_SIZE
@@ -198,8 +196,7 @@ mips_cache_reset:
icacheop(a0,a1,a2,a3,Index_Store_Tag_D)
j ra
-
- .end mips_cache_reset
+ END(mips_cache_reset)
/*******************************************************************************
*
@@ -208,15 +205,11 @@ mips_cache_reset:
* RETURNS: 0 - cache disabled; 1 - cache enabled
*
*/
- .globl dcache_status
- .ent dcache_status
-dcache_status:
-
+LEAF(dcache_status)
mfc0 v0, CP0_CONFIG
andi v0, v0, 1
j ra
-
- .end dcache_status
+ END(dcache_status)
/*******************************************************************************
*
@@ -225,15 +218,11 @@ dcache_status:
* RETURNS: N/A
*
*/
- .globl dcache_disable
- .ent dcache_disable
-dcache_disable:
-
+LEAF(dcache_disable)
mfc0 t0, CP0_CONFIG
li t1, -8
and t0, t0, t1
ori t0, t0, CONF_CM_UNCACHED
mtc0 t0, CP0_CONFIG
j ra
-
- .end dcache_disable
+ END(dcache_disable)
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot-Users] [MIPS] cpu/mips/cache.S: Introduce NESTED(), LEAF() and END()
2008-03-17 14:46 [U-Boot-Users] [MIPS] cpu/mips/cache.S: Introduce NESTED(), LEAF() and END() Shinya Kuribayashi
@ 2008-03-17 21:12 ` Wolfgang Denk
2008-03-18 0:40 ` Shinya Kuribayashi
0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Denk @ 2008-03-17 21:12 UTC (permalink / raw)
To: u-boot
In message <47DE8444.3060603@ruby.dti.ne.jp> you wrote:
> These macros have been widely used by MIPS assemblers, and of course
> make codes more readable and easily maintainable.
I have to admit that for me the resulting code is NOT better
readable. Indead of just reading a single source file, I now have to
look up a header file for a number of macros.
Speaking for myself, I don't see an improvement.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Cigarette, n.: A fire at one end, a fool at the other, and a bit of
tobacco in between.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot-Users] [MIPS] cpu/mips/cache.S: Introduce NESTED(), LEAF() and END()
2008-03-17 21:12 ` Wolfgang Denk
@ 2008-03-18 0:40 ` Shinya Kuribayashi
0 siblings, 0 replies; 3+ messages in thread
From: Shinya Kuribayashi @ 2008-03-18 0:40 UTC (permalink / raw)
To: u-boot
Wolfgang Denk wrote:
> In message <47DE8444.3060603@ruby.dti.ne.jp> you wrote:
>> These macros have been widely used by MIPS assemblers, and of course
>> make codes more readable and easily maintainable.
>
> I have to admit that for me the resulting code is NOT better
> readable. Indead of just reading a single source file, I now have to
> look up a header file for a number of macros.
You need to look up a header file, true. But these macros are worth
doing so.
> Speaking for myself, I don't see an improvement.
as can be seen from macro definitions, they specify some more
information ecplicitly; alignment, type of symbols, stack frame info
which helps generating debug info.
These macros or their variants have been used in SGI or Algorithmics
early MIPS programming, PMON, YAMON and of course Linux. They are good
helper for MIPS assemblers, so I hope get them in.
Shinya
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-03-18 0:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-17 14:46 [U-Boot-Users] [MIPS] cpu/mips/cache.S: Introduce NESTED(), LEAF() and END() Shinya Kuribayashi
2008-03-17 21:12 ` Wolfgang Denk
2008-03-18 0:40 ` Shinya Kuribayashi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox