Subject: sgimips64
To: None <port-mips@netbsd.org>
From: Emmanuel Dreyfus <manu@netbsd.org>
List: port-mips
Date: 01/05/2002 18:40:43
I'm trying to build something such as a sgimips64 kernel. At a glance,
there are a few issues:

1) in sys/arch/mips/mips/locore_mips3.S
mips3_ld and mips3_sd need an adjustement. It seems that thoses two
routines need to disable and re-enable the interrupts, and that this is
not done the same way for O32 and N32/LP64.

Where can I find information about this? I've got a MIPS assembly
manual, but I found nothing about interrupts in it.

Here is the offending code:

        mfc0    t0, MIPS_COP_0_STATUS           # turn off interrupts
        and     t1, t0, ~(MIPS_SR_INT_IE)
        mtc0    t1, MIPS_COP_0_STATUS
        COP0_SYNC
        nop 
        nop
        nop

        ...

        mtc0    t0, MIPS_COP_0_STATUS           # restore intr status.
        COP0_SYNC
        nop

Speaking about this, what are mips3_ld and mips3_sd for? 

2) in sys/arch/mips/include/stdarg.h
There is an #error which says that the whole file is unsuitable for
N32/LP64. Anyone can give me information about it? How is this file
made? In IRIX's stdarg.h, I can read that 64 bit ABI uses the ANSI
stdarg.h. Standard? Cool, I'll be able to copy it from somewhere else!
:o) But where from?

N32 stdarg.h could be a problem, but as I understand, we only need this
to build N32 binaries, not to run them, right? 

3) in sys/kern/exec_elf32.c
When incuding this from sys/kern/exec_elf64.c, I get some troubles with
this:
epp->ep_taddr = epp->ep_tsize = ELFDEFNNAME(NO_ADDR);
This triggers a warning: large integer implicitely truncated to unsigned
type. Probably a bad ELFSIZE somewhere, but I fail to see where. This is
probably a minor problem, even if I'll spend a lot of time finding where
is the typo that caused it ;o)

For the organisation of the sgimips64 directories: I've made this, I'd
like know if it's okay or if I missed something in the way it should be
set up.

sys/arch/sgimips64/conf/files.sgimips64
        is a plain copy of its sgimips counterpart
sys/arch/sgimips64/conf/std.sgimips64
        copy of std.sgimips with adjustement to define LP64 options
sys/arch/sgimips64/include/*.h
        most files just include their mips/sgimips counterparts
        we also have a few defines for LP64
sys/arch/sgimips64/sgimips64/locore_machdep.S
        just include sys/arch/sgimips/sgimips/locore_machdep.S

I include sgimips using <arch/sgimips/include/xxx.h>, It seems sparc64
uses <sparc/xxx.h>, but I have not figured out how it sets up the sparc
directory in the build directory.

Last question: should I import this sgimips64 thing in the tree?

-- 
Emmanuel Dreyfus.
"Of course, it runs NetBSD" -- http://www.netbsd.org
manu@netbsd.org