Subject: port-hp300/2378: current hp300 kernel has problems with cpu.h and machdep.c
To: None <gnats-bugs@NetBSD.ORG>
From: Thorsten Frueauf <frueauf@i41am1.ira.uka.de>
List: netbsd-bugs
Date: 05/07/1996 11:27:30
>Number:         2378
>Category:       port-hp300
>Synopsis:       current hp300 kernel has problems with cpu.h and machdep.c
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue May  7 05:35:04 1996
>Last-Modified:
>Originator:     Thorsten Frueauf
>Organization:
private	
	
>Release:        NetBSD current 05.06.1996
>Environment:
	
NetBSD cybersil 1.1B NetBSD 1.1B (Milano) #1: Tue May  7 02:12:41 MET DST 1996     milano@cybersil:/amd/src/sys/arch/hp300/compile/Milano hp300


>Description:
	
/src/sys/arch/hp300/include/cpu.h defines false argument for doboot()
and /src/sys/arch/hp300/hp300/vm_machdep.c does an assignment for an integer
pointer without a cast and defines "size" as int instead as size_t.

>How-To-Repeat:
	
Try to make a current kernel on hp300 and watch:

cc  -O2 -Werror -msoft-float -I. -I../../../../arch -I../../../.. -DMILANO -DHP380 -DHP375 -DHP370 -DHP360 -DHP350 -DHP340 -DHP330 -DHP320 -DGENERIC -DDIAGNOSTIC -DDEBUG -DDDB -DCOMPAT_HPUX -DCOMPAT_NOLABEL -DUSELEDS -DFPSP -DTCP_COMPAT_42 -DMROUTING -DGATEWAY -DINET -DMFS -DPROCFS -DFDESC -DKERNFS -DUNION -DNFSCLIENT -DNFSSERVER -DCD9660 -DQUOTA -DFFS -DFIFO -DNKMEMCLUSTERS=1024 -DKTRACE -DSYSVMSG -DSYSVSEM -DSYSVSHM -DCOMPAT_10 -DCOMPAT_09 -DCOMPAT_44 -DCOMPAT_43 -DDEVPAGER -DVNODEPAGER -DSWAPPAGER -D_KERNEL -Dmc68020 -Dhp300 -DFPCOPROC  -DTIMEZONE=480 -DDST=1 -DMAXUSERS=32 -c ../../../../arch/hp300/hp300/machdep.c
../../../../arch/hp300/hp300/machdep.c: In function `boot':
../../../../arch/hp300/hp300/machdep.c:1182: too few arguments to function `doboot'
*** Error code 1

and after fixing that one watch:

cc  -O2 -Werror -msoft-float -I. -I../../../../arch -I../../../.. -DMILANO -DHP380 -DHP375 -DHP370 -DHP360 -DHP350 -DHP340 -DHP330 -DHP320 -DGENERIC -DDIAGNOSTIC -DDEBUG -DDDB -DCOMPAT_HPUX -DCOMPAT_NOLABEL -DUSELEDS -DFPSP -DTCP_COMPAT_42 -DMROUTING -DGATEWAY -DINET -DMFS -DPROCFS -DFDESC -DKERNFS -DUNION -DNFSCLIENT -DNFSSERVER -DCD9660 -DQUOTA -DFFS -DFIFO -DNKMEMCLUSTERS=1024 -DKTRACE -DSYSVMSG -DSYSVSEM -DSYSVSHM -DCOMPAT_10 -DCOMPAT_09 -DCOMPAT_44 -DCOMPAT_43 -DDEVPAGER -DVNODEPAGER -DSWAPPAGER -D_KERNEL -Dmc68020 -Dhp300 -DFPCOPROC  -c ../../../../arch/hp300/hp300/vm_machdep.c
cc1: warnings being treated as errors
../../../../arch/hp300/hp300/vm_machdep.c: In function `cpu_set_kpc':
../../../../arch/hp300/hp300/vm_machdep.c:109: warning: assignment makes integer from pointer without a cast
../../../../arch/hp300/hp300/vm_machdep.c: In function `pagemove':
../../../../arch/hp300/hp300/vm_machdep.c:207: argument `size' doesn't match prototype
../../../../vm/vm_extern.h:139: prototype declaration
*** Error code 1

>Fix:
	
Apply the following patches:

*** sys/arch/hp300/include/cpu.h-orig   Mon Apr 29 20:25:37 1996
--- sys/arch/hp300/include/cpu.h        Tue May  7 00:28:46 1996
***************
*** 218,224 ****
  extern        int machineid, mmutype, ectype;
  extern        char *intiobase, *intiolimit;
  
! void  doboot __P((int))
        __attribute__((__noreturn__));
  
  /* what is this supposed to do? i.e. how is it different than startrtclock? */--- 218,224 ----
  extern        int machineid, mmutype, ectype;
  extern        char *intiobase, *intiolimit;
  
! void  doboot __P((void))
        __attribute__((__noreturn__));
  
  /* what is this supposed to do? i.e. how is it different than startrtclock? */
*** sys/arch/hp300/hp300/vm_machdep.c-orig      Mon May  6 18:43:23 1996
--- sys/arch/hp300/hp300/vm_machdep.c   Tue May  7 02:12:23 1996
***************
*** 106,112 ****
        void (*pc) __P((struct proc *));
  {
  
!       p->p_addr->u_pcb.pcb_regs[6] = pc;      /* A2 */
  }
  
  /*
--- 106,112 ----
        void (*pc) __P((struct proc *));
  {
  
!       p->p_addr->u_pcb.pcb_regs[6] = (int) pc;        /* A2 */
  }
  
  /*
***************
*** 203,209 ****
  void
  pagemove(from, to, size)
        register caddr_t from, to;
!       int size;
  {
        register vm_offset_t pa;
  
--- 203,209 ----
  void
  pagemove(from, to, size)
        register caddr_t from, to;
!       size_t size;
  {
        register vm_offset_t pa;

>Audit-Trail:
>Unformatted:
current hp300 kernel has problems with cpu.h and machdep.c