NetBSD Problem Report #6096

Received: (qmail 16740 invoked from network); 3 Sep 1998 20:07:25 -0000
Message-Id: <199809032009.WAA21283@q610.ebe.uni-c.dk>
Date: Thu, 3 Sep 1998 22:09:12 +0200 (MEST)
From: Erik Bertelsen <erik@q610.ebe.uni-c.dk>
Reply-To: erik@mediator.uni-c.dk
To: gnats-bugs@gnats.netbsd.org
Subject: bcopy->memcpy changes for arch/macppc
X-Send-Pr-Version: 3.95

>Number:         6096
>Category:       port-macppc
>Synopsis:       bcopy->memcpy changes for arch/macppc
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    port-macppc-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Sep 03 13:20:00 +0000 1998
>Closed-Date:    Thu Jul 26 16:11:15 +0000 2001
>Last-Modified:  Thu Jul 26 16:11:15 +0000 2001
>Originator:     Erik Bertelsen
>Release:        NetBSD-current 3 Sep 1998
>Organization:

>Environment:

System: NetBSD q610.ebe.uni-c.dk 1.3H NetBSD 1.3H (Q610) #: Wed Sep 2 20:49:28 MEST 1998 erik@q610.ebe.uni-c.dk:/home/src/sys/arch/mac68k/compile/Q610 mac68k


>Description:
	As a follow-up to the recent changes of parts of the NetBSD kernel
	to use memcpy (and friends) instead of bcopy, etc., please find the
	arch/macppc related changes. These patches were developed while
	building a macppc kernel without bcopy.
>How-To-Repeat:
>Fix:
Index: dev/adb_direct.c
===================================================================
RCS file: /home/cvs-base/src/sys/arch/macppc/dev/adb_direct.c,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 adb_direct.c
*** adb_direct.c	1998/06/27 17:35:19	1.1.1.2
--- adb_direct.c	1998/09/03 20:03:11
***************
*** 1816,1822 ****
  			;

  		/* *time = (long)(*(long *)(output + 1)) - 2082844800; */
! 		bcopy(output + 1, time, 4);
  		*time -= 2082844800;
  		return 0;

--- 1816,1822 ----
  			;

  		/* *time = (long)(*(long *)(output + 1)) - 2082844800; */
! 		memcpy(time, output + 1, 4);
  		*time -= 2082844800;
  		return 0;

Index: dev/grf.c
===================================================================
RCS file: /home/cvs-base/src/sys/arch/macppc/dev/grf.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 grf.c
*** grf.c	1998/05/20 19:01:17	1.1.1.1
--- grf.c	1998/09/03 20:03:11
***************
*** 207,213 ****

  	switch (cmd) {
  	case GRFIOCGINFO:
! 		bcopy(gm, data, sizeof(struct grfinfo));
  		break;
  	case GRFIOCON:
  		error = grfon(dev);
--- 207,213 ----

  	switch (cmd) {
  	case GRFIOCGINFO:
! 		memcpy(data, gm, sizeof(struct grfinfo));
  		break;
  	case GRFIOCON:
  		error = grfon(dev);
Index: dev/zs.c
===================================================================
RCS file: /home/cvs-base/src/sys/arch/macppc/dev/zs.c,v
retrieving revision 1.1.1.6
diff -c -r1.1.1.6 zs.c
*** zs.c	1998/08/27 15:49:54	1.1.1.6
--- zs.c	1998/09/03 20:03:11
***************
*** 307,314 ****
  		cs->cs_reg_csr  = &zc->zc_csr;
  		cs->cs_reg_data = &zc->zc_data;

! 		bcopy(zs_init_reg, cs->cs_creg, 16);
! 		bcopy(zs_init_reg, cs->cs_preg, 16);

  		/* Current BAUD rate generator clock. */
  		cs->cs_brg_clk = ZS_STD_BRG;	/* RTxC is 230400*16, so use 230400 */
--- 307,314 ----
  		cs->cs_reg_csr  = &zc->zc_csr;
  		cs->cs_reg_data = &zc->zc_data;

! 		memcpy(cs->cs_creg, zs_init_reg, 16);
! 		memcpy(cs->cs_preg, zs_init_reg, 16);

  		/* Current BAUD rate generator clock. */
  		cs->cs_brg_clk = ZS_STD_BRG;	/* RTxC is 230400*16, so use 230400 */
Index: macppc/disksubr.c
===================================================================
RCS file: /home/cvs-base/src/sys/arch/macppc/macppc/disksubr.c,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 disksubr.c
*** disksubr.c	1998/09/02 16:01:35	1.1.1.2
--- disksubr.c	1998/09/03 20:03:11
***************
*** 323,329 ****

  	bp->b_flags = B_BUSY | B_WRITE;

! 	bcopy((caddr_t)lp, (caddr_t)bp->b_data + LABELOFFSET, sizeof *lp);

  	(*strat)(bp);
  	error = biowait(bp);
--- 323,329 ----

  	bp->b_flags = B_BUSY | B_WRITE;

! 	memcpy(bp->b_data + LABELOFFSET, lp, sizeof *lp);

  	(*strat)(bp);
  	error = biowait(bp);
Index: macppc/machdep.c
===================================================================
RCS file: /home/cvs-base/src/sys/arch/macppc/macppc/machdep.c,v
retrieving revision 1.1.1.10
diff -c -r1.1.1.10 machdep.c
*** machdep.c	1998/08/22 14:45:07	1.1.1.10
--- machdep.c	1998/09/03 20:03:11
***************
*** 258,264 ****
  	for (exc = EXC_RSVD; exc <= EXC_LAST; exc += 0x100)
  		switch (exc) {
  		default:
! 			bcopy(&trapcode, (void *)exc, (size_t)&trapsize);
  			break;
  		case EXC_EXI:
  			/*
--- 258,264 ----
  	for (exc = EXC_RSVD; exc <= EXC_LAST; exc += 0x100)
  		switch (exc) {
  		default:
! 			memcpy((void *)exc, &trapcode, (size_t)&trapsize);
  			break;
  		case EXC_EXI:
  			/*
***************
*** 266,296 ****
  			 */
  			break;
  		case EXC_DSI:
! 			bcopy(&dsitrap, (void *)EXC_DSI, (size_t)&dsisize);
  			break;
  		case EXC_ISI:
! 			bcopy(&isitrap, (void *)EXC_ISI, (size_t)&isisize);
  			break;
  		case EXC_DECR:
! 			bcopy(&decrint, (void *)EXC_DECR, (size_t)&decrsize);
  			break;
  		case EXC_IMISS:
! 			bcopy(&tlbimiss, (void *)EXC_IMISS, (size_t)&tlbimsize);
  			break;
  		case EXC_DLMISS:
! 			bcopy(&tlbdlmiss, (void *)EXC_DLMISS, (size_t)&tlbdlmsize);
  			break;
  		case EXC_DSMISS:
! 			bcopy(&tlbdsmiss, (void *)EXC_DSMISS, (size_t)&tlbdsmsize);
  			break;
  #if defined(DDB) || NIPKDB > 0
  		case EXC_PGM:
  		case EXC_TRC:
  		case EXC_BPT:
  #if defined(DDB)
! 			bcopy(&ddblow, (void *)exc, (size_t)&ddbsize);
  #else
! 			bcopy(&ipkdblow, (void *)exc, (size_t)&ipkdbsize);
  #endif
  			break;
  #endif /* DDB || NIPKDB > 0 */
--- 266,296 ----
  			 */
  			break;
  		case EXC_DSI:
! 			memcpy((void *)EXC_DSI, &dsitrap, (size_t)&dsisize);
  			break;
  		case EXC_ISI:
! 			memcpy((void *)EXC_ISI, &isitrap, (size_t)&isisize);
  			break;
  		case EXC_DECR:
! 			memcpy((void *)EXC_DECR, &decrint, (size_t)&decrsize);
  			break;
  		case EXC_IMISS:
! 			memcpy((void *)EXC_IMISS, &tlbimiss, (size_t)&tlbimsize);
  			break;
  		case EXC_DLMISS:
! 			memcpy((void *)EXC_DLMISS, &tlbdlmiss, (size_t)&tlbdlmsize);
  			break;
  		case EXC_DSMISS:
! 			memcpy((void *)EXC_DSMISS, &tlbdsmiss, (size_t)&tlbdsmsize);
  			break;
  #if defined(DDB) || NIPKDB > 0
  		case EXC_PGM:
  		case EXC_TRC:
  		case EXC_BPT:
  #if defined(DDB)
! 			memcpy((void *)exc, &ddblow, (size_t)&ddbsize);
  #else
! 			memcpy((void *)exc, &ipkdblow, (size_t)&ipkdbsize);
  #endif
  			break;
  #endif /* DDB || NIPKDB > 0 */
***************
*** 425,431 ****
  	asm volatile ("mfmsr %0; andi. %1,%0,%2; mtmsr %1"
  		      : "=r"(omsr), "=r"(msr) : "K"((u_short)~PSL_EE));
  	extint_call = (extint_call & 0xfc000003) | offset;
! 	bcopy(&extint, (void *)EXC_EXI, (size_t)&extsize);
  	syncicache((void *)&extint_call, sizeof extint_call);
  	syncicache((void *)EXC_EXI, (int)&extsize);
  	asm volatile ("mtmsr %0" :: "r"(omsr));
--- 425,431 ----
  	asm volatile ("mfmsr %0; andi. %1,%0,%2; mtmsr %1"
  		      : "=r"(omsr), "=r"(msr) : "K"((u_short)~PSL_EE));
  	extint_call = (extint_call & 0xfc000003) | offset;
! 	memcpy((void *)EXC_EXI, &extint, (size_t)&extsize);
  	syncicache((void *)&extint_call, sizeof extint_call);
  	syncicache((void *)EXC_EXI, (int)&extsize);
  	asm volatile ("mtmsr %0" :: "r"(omsr));
***************
*** 748,754 ****
  	 */
  	frame.sf_sc.sc_onstack = oldonstack;
  	frame.sf_sc.sc_mask = mask;
! 	bcopy(tf, &frame.sf_sc.sc_frame, sizeof *tf);
  	if (copyout(&frame, fp, sizeof frame) != 0)
  		sigexit(p, SIGILL);

--- 748,754 ----
  	 */
  	frame.sf_sc.sc_onstack = oldonstack;
  	frame.sf_sc.sc_mask = mask;
! 	memcpy(&frame.sf_sc.sc_frame, tf, sizeof *tf);
  	if (copyout(&frame, fp, sizeof frame) != 0)
  		sigexit(p, SIGILL);

***************
*** 782,788 ****
  	tf = trapframe(p);
  	if ((sc.sc_frame.srr1 & PSL_USERSTATIC) != (tf->srr1 & PSL_USERSTATIC))
  		return EINVAL;
! 	bcopy(&sc.sc_frame, tf, sizeof *tf);
  	if (sc.sc_onstack & 1)
  		p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK;
  	else
--- 782,788 ----
  	tf = trapframe(p);
  	if ((sc.sc_frame.srr1 & PSL_USERSTATIC) != (tf->srr1 & PSL_USERSTATIC))
  		return EINVAL;
! 	memcpy(tf, &sc.sc_frame, sizeof *tf);
  	if (sc.sc_onstack & 1)
  		p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK;
  	else

regards
Erik Bertelsen.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: gnats-admin->port-macppc-maintainer 
Responsible-Changed-By: fair 
Responsible-Changed-When: Mon Dec 28 09:39:39 PST 1998 
Responsible-Changed-Why:  
This PR is the responsibility of the portmaster, 
not the GNATS database administrator. 
State-Changed-From-To: open->closed 
State-Changed-By: wiz 
State-Changed-When: Thu Jul 26 09:10:52 PDT 2001 
State-Changed-Why:  
memcpy has been purged from arch/macppc. Thanks for the PR! 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.