Subject: pmax caddr_t fallouts
To: None <port-pmax@netbsd.org>
From: Erik Bertelsen <bertelsen.erik@gmail.com>
List: port-pmax
Date: 03/06/2007 20:28:55
My DS5000/133 does not compile today after the caddr_t update.

Please consider something along the following which seems to make a
compilable and bootable kernel:

Index: pmax/disksubr.c
===================================================================
RCS file: /cvsroot/src/sys/arch/pmax/pmax/disksubr.c,v
retrieving revision 1.44
diff -u -r1.44 disksubr.c
--- pmax/disksubr.c     25 Nov 2006 11:59:57 -0000      1.44
+++ pmax/disksubr.c     6 Mar 2007 19:24:22 -0000
@@ -88,7 +88,7 @@
        if (biowait(bp)) {
                msg = "I/O error";
        } else for (dlp = (struct disklabel *)bp->b_data;
-           dlp <= (struct disklabel *)(bp->b_data+DEV_BSIZE-sizeof(*dlp));
+           dlp <= (struct disklabel *)((char
*)bp->b_data+DEV_BSIZE-sizeof(*dlp));
            dlp = (struct disklabel *)((char *)dlp + sizeof(long))) {
                if (dlp->d_magic != DISKMAGIC || dlp->d_magic2 != DISKMAGIC) {
                        if (msg == NULL)
@@ -274,7 +274,7 @@
                goto done;
        for (dlp = (struct disklabel *)bp->b_data;
            dlp <= (struct disklabel *)
-             (bp->b_data + lp->d_secsize - sizeof(*dlp));
+             ((char *)bp->b_data + lp->d_secsize - sizeof(*dlp));
            dlp = (struct disklabel *)((char *)dlp + sizeof(long))) {
                if (dlp->d_magic == DISKMAGIC && dlp->d_magic2 == DISKMAGIC &&
                    dkcksum(dlp) == 0) {
Index: pmax/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/pmax/pmax/machdep.c,v
retrieving revision 1.217
diff -u -r1.217 machdep.c
--- pmax/machdep.c      4 Mar 2007 06:00:33 -0000       1.217
+++ pmax/machdep.c      6 Mar 2007 19:24:22 -0000
@@ -251,7 +251,7 @@
 #endif
        {
                kernend = (void *)mips_round_page(end);
-               memset(edata, 0, kernend - edata);
+               memset(edata, 0, (char *)kernend - edata);
        }

        /* Initialize callv so we can do PROM output... */
@@ -343,12 +343,12 @@
         * Alloc u pages for proc0 stealing KSEG0 memory.
         */
        lwp0.l_addr = proc0paddr = (struct user *)kernend;
-       lwp0.l_md.md_regs = (struct frame *)(kernend + USPACE) - 1;
+       lwp0.l_md.md_regs = (struct frame *)((char *)kernend + USPACE) - 1;
        memset(lwp0.l_addr, 0, USPACE);
        curpcb = &lwp0.l_addr->u_pcb;
        curpcb->pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */

-       kernend += USPACE;
+       kernend = (char *)kernend + USPACE;

        /*
         * Initialize physmem_boardmax; assume no SIMM-bank limits.
Index: tc/asc_ioasic.c
===================================================================
RCS file: /cvsroot/src/sys/arch/pmax/tc/asc_ioasic.c,v
retrieving revision 1.17
diff -u -r1.17 asc_ioasic.c
--- tc/asc_ioasic.c     4 Mar 2007 06:00:33 -0000       1.17
+++ tc/asc_ioasic.c     6 Mar 2007 19:24:23 -0000
@@ -407,7 +407,7 @@
        asc->sc_flags &= ~ASC_MAPLOADED;

        *asc->sc_dmalen -= trans;
-       *asc->sc_dmaaddr += trans;
+       *asc->sc_dmaaddr = (char *)(*asc->sc_dmaaddr) + trans;

        return 0;
 }


The changes are done quick&dirty and may not all be done optimally, so
please review before comitting :-)

- Erik