[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [microblaze-uclinux] [patch] errno corruption



Hi John,

At Fri, 19 Mar 2004 11:58:29 +1000,
John Williams wrote:
[...]
> > btw, I'm not using SYSCALL_ARG# macro in the patch, are you ok with
> > it, John?
> 
> I like the macros (inherited from the v850 port, upon which microblaze 
> is based), simply for improved readability and maintainability.  Also, 
> it's a favour to arch ports yet-to-come, if they have some nice role 
> models it makes the job so much easier (been there, done that, bought 
> the T-shirt! :)
> 
> Are there technical reasons against them?  If not, would you mind 
> putting them back in (also the SYSCALL_RET and SYSCALL_NUMBER)?

it's nothing technical, I just don't know how to make it readable

IMHO, it's more readable this way

        __asm__ __volatile__ ("addk	r5, r0, %2	\n\t"           \
                              "addk	r6, r0, %3	\n\t"           \
                              "bralid	r17, 0x8	\n\t"           \
                              "addik	r12, r0, %1	\n\t"           \
                              "addk	%0, r3, r0	\n\t"           \

than like this

        __asm__ __volatile__ ("addk	"SYSCALL_ARG0", r0, %2	\n\t"           \
                              "addk	"SYSCALL_ARG1", r0, %3	\n\t"           \
                              "bralid	"SYSCALL_LINK", 0x8	\n\t"           \
                              "addik	"SYSCALL_NUM", r0, %1	\n\t"           \
                              "addk	%0, "SYSCALL_RET", r0	\n\t"           \

or, like arm

#define _sysnum(name) (macrology_stringify(macrology_past(__NR_, name)))

#define _syscall(name)        "bralid	"SYSCALL_LINK", 0x8	\n\t"           \
                              "addik	"SYSCALL_NUM", r0, "_sysnum(name)"	\n\t"           \
                              "addk	%0, "SYSCALL_RET", r0	\n\t"

        __asm__ __volatile__ ("addk	"SYSCALL_ARG0", r0, %2	\n\t"           \
                              "addk	"SYSCALL_ARG1", r0, %3	\n\t"           \
                              _syscall                                          \

maybe it's too much, huh? ;)

could you enlighten me on this?

# hmm.. the second one is not bad after all

> Thanks for your work and patience Yashi!  Arigatoo gozaimasu-yo!

any time!
--
         yashi
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@itee.uq.edu.au
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/