Port-i386 archive

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

Re: Merging few files from i386/amd64 into x86

David Young <dyoung%pobox.com@localhost> wrote:
> Can you avoid using new #ifdefs, or else confine them to the top of the
> file?  They make even straightforward code hard to read. :-/

More about this:


        if (stack != NULL) {
#ifdef __x86_64__
                tf->tf_rsp = (uint64_t)stack + stacksize;
                tf->tf_esp = (u_int)stack + stacksize;

With these macros, such code would become:

        if (stack != NULL)
                X86_TF_RSP(tf) = (uintptr_t)stack + stacksize;

This would make merge of trap.c and syscall.c into x86 quite nice.


- Any reason why we would want to keep the type size in MD (instead of
  abstracting it out, eg. with uintptr_t)?  By the way:
  Why these and others are not unsigned, eg. uint32_t?

- Naming of macros could be better. Suggestions?


Best regards,

Home | Main Index | Thread Index | Old Index