bzero->memset, bcopy->memcpy, bcmp->memcmp
This commit is contained in:
parent
54f97ab9d1
commit
c3579ce3f5
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: apm.c,v 1.31 1998/04/03 18:18:05 cgd Exp $ */
|
/* $NetBSD: apm.c,v 1.32 1998/08/05 02:45:08 perry Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
|
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
|
||||||
@ -1089,7 +1089,7 @@ apmattach(parent, self, aux)
|
|||||||
apm_powmgt_engage(1, APM_DEV_NETWORK(APM_DEV_ALLUNITS));
|
apm_powmgt_engage(1, APM_DEV_NETWORK(APM_DEV_ALLUNITS));
|
||||||
apm_powmgt_engage(1, APM_DEV_PCMCIA(APM_DEV_ALLUNITS));
|
apm_powmgt_engage(1, APM_DEV_PCMCIA(APM_DEV_ALLUNITS));
|
||||||
#endif
|
#endif
|
||||||
bzero(®s, sizeof(regs));
|
memset(®s, 0, sizeof(regs));
|
||||||
error = apm_get_powstat(®s);
|
error = apm_get_powstat(®s);
|
||||||
if (error == 0) {
|
if (error == 0) {
|
||||||
apm_power_print(apmsc, ®s);
|
apm_power_print(apmsc, ®s);
|
||||||
@ -1242,7 +1242,7 @@ apmioctl(dev, cmd, data, flag, p)
|
|||||||
return (EIO);
|
return (EIO);
|
||||||
}
|
}
|
||||||
|
|
||||||
bzero(powerp, sizeof(*powerp));
|
memset(powerp, 0, sizeof(*powerp));
|
||||||
if (APM_BATT_LIFE(®s) != APM_BATT_LIFE_UNKNOWN)
|
if (APM_BATT_LIFE(®s) != APM_BATT_LIFE_UNKNOWN)
|
||||||
powerp->battery_life = APM_BATT_LIFE(®s);
|
powerp->battery_life = APM_BATT_LIFE(®s);
|
||||||
powerp->ac_state = APM_AC_STATE(®s);
|
powerp->ac_state = APM_AC_STATE(®s);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: disksubr.c,v 1.30 1998/06/22 21:12:52 sommerfe Exp $ */
|
/* $NetBSD: disksubr.c,v 1.31 1998/08/05 02:45:08 perry Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
|
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
|
||||||
@ -122,11 +122,11 @@ readdisklabel(dev, strat, lp, osdep)
|
|||||||
} else {
|
} else {
|
||||||
struct dos_partition *ourdp = NULL;
|
struct dos_partition *ourdp = NULL;
|
||||||
|
|
||||||
if (bcmp(bp->b_data + MBRSIGOFS, mbrsig, sizeof(mbrsig)))
|
if (memcmp(bp->b_data + MBRSIGOFS, mbrsig, sizeof(mbrsig)))
|
||||||
goto nombrpart;
|
goto nombrpart;
|
||||||
|
|
||||||
/* XXX how do we check veracity/bounds of this? */
|
/* XXX how do we check veracity/bounds of this? */
|
||||||
bcopy(bp->b_data + DOSPARTOFF, dp,
|
memcpy(dp, bp->b_data + DOSPARTOFF,
|
||||||
NDOSPART * sizeof(*dp));
|
NDOSPART * sizeof(*dp));
|
||||||
|
|
||||||
/* look for NetBSD partition */
|
/* look for NetBSD partition */
|
||||||
@ -348,11 +348,11 @@ writedisklabel(dev, strat, lp, osdep)
|
|||||||
if ((error = biowait(bp)) == 0) {
|
if ((error = biowait(bp)) == 0) {
|
||||||
struct dos_partition *ourdp = NULL;
|
struct dos_partition *ourdp = NULL;
|
||||||
|
|
||||||
if (bcmp(bp->b_data + MBRSIGOFS, mbrsig, sizeof(mbrsig)))
|
if (memcmp(bp->b_data + MBRSIGOFS, mbrsig, sizeof(mbrsig)))
|
||||||
goto nombrpart;
|
goto nombrpart;
|
||||||
|
|
||||||
/* XXX how do we check veracity/bounds of this? */
|
/* XXX how do we check veracity/bounds of this? */
|
||||||
bcopy(bp->b_data + DOSPARTOFF, dp,
|
memcpy(dp, bp->b_data + DOSPARTOFF,
|
||||||
NDOSPART * sizeof(*dp));
|
NDOSPART * sizeof(*dp));
|
||||||
|
|
||||||
/* look for NetBSD partition */
|
/* look for NetBSD partition */
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: freebsd_machdep.c,v 1.17 1998/05/08 16:55:15 kleink Exp $ */
|
/* $NetBSD: freebsd_machdep.c,v 1.18 1998/08/05 02:45:08 perry Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1993, 1994, 1995, 1996 Charles M. Hannum. All rights reserved.
|
* Copyright (c) 1993, 1994, 1995, 1996 Charles M. Hannum. All rights reserved.
|
||||||
@ -292,7 +292,7 @@ netbsd_to_freebsd_ptrace_regs(nregs, nfpregs, fregs)
|
|||||||
|
|
||||||
fregs->freebsd_ptrace_fpregs.sv_env =
|
fregs->freebsd_ptrace_fpregs.sv_env =
|
||||||
*(struct freebsd_env87 *)&nframe->sv_env;
|
*(struct freebsd_env87 *)&nframe->sv_env;
|
||||||
bcopy(nframe->sv_ac, fregs->freebsd_ptrace_fpregs.sv_ac,
|
memcpy(fregs->freebsd_ptrace_fpregs.sv_ac, nframe->sv_ac,
|
||||||
sizeof(fregs->freebsd_ptrace_fpregs.sv_ac));
|
sizeof(fregs->freebsd_ptrace_fpregs.sv_ac));
|
||||||
fregs->freebsd_ptrace_fpregs.sv_ex_sw =
|
fregs->freebsd_ptrace_fpregs.sv_ex_sw =
|
||||||
nframe->sv_ex_sw;
|
nframe->sv_ex_sw;
|
||||||
@ -306,14 +306,15 @@ netbsd_to_freebsd_ptrace_regs(nregs, nfpregs, fregs)
|
|||||||
"sizeof(freebsd_save87) >= sizeof(save87)");
|
"sizeof(freebsd_save87) >= sizeof(save87)");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
bcopy(&nframe->sv_ex_tw, fregs->freebsd_ptrace_fpregs.sv_pad,
|
memcpy(fregs->freebsd_ptrace_fpregs.sv_pad, &nframe->sv_ex_tw,
|
||||||
sizeof(nframe->sv_ex_tw));
|
sizeof(nframe->sv_ex_tw));
|
||||||
bcopy(nframe->sv_pad,
|
memcpy((caddr_t)fregs->freebsd_ptrace_fpregs.sv_pad +
|
||||||
(caddr_t)fregs->freebsd_ptrace_fpregs.sv_pad +
|
|
||||||
sizeof(nframe->sv_ex_tw),
|
sizeof(nframe->sv_ex_tw),
|
||||||
|
nframe->sv_pad,
|
||||||
sizeof(nframe->sv_pad));
|
sizeof(nframe->sv_pad));
|
||||||
bzero((caddr_t)fregs->freebsd_ptrace_fpregs.sv_pad +
|
memset((caddr_t)fregs->freebsd_ptrace_fpregs.sv_pad +
|
||||||
sizeof(nframe->sv_ex_tw) + sizeof(nframe->sv_pad),
|
sizeof(nframe->sv_ex_tw) + sizeof(nframe->sv_pad),
|
||||||
|
0,
|
||||||
sizeof(fregs->freebsd_ptrace_fpregs.sv_pad) -
|
sizeof(fregs->freebsd_ptrace_fpregs.sv_pad) -
|
||||||
sizeof(nframe->sv_ex_tw) - sizeof(nframe->sv_pad));
|
sizeof(nframe->sv_ex_tw) - sizeof(nframe->sv_pad));
|
||||||
}
|
}
|
||||||
@ -345,18 +346,19 @@ freebsd_to_netbsd_ptrace_regs(fregs, nregs, nfpregs)
|
|||||||
|
|
||||||
nframe->sv_env =
|
nframe->sv_env =
|
||||||
*(struct env87 *)&fregs->freebsd_ptrace_fpregs.sv_env;
|
*(struct env87 *)&fregs->freebsd_ptrace_fpregs.sv_env;
|
||||||
bcopy(fregs->freebsd_ptrace_fpregs.sv_ac, nframe->sv_ac,
|
memcpy(nframe->sv_ac, fregs->freebsd_ptrace_fpregs.sv_ac,
|
||||||
sizeof(nframe->sv_ac));
|
sizeof(nframe->sv_ac));
|
||||||
nframe->sv_ex_sw =
|
nframe->sv_ex_sw =
|
||||||
fregs->freebsd_ptrace_fpregs.sv_ex_sw;
|
fregs->freebsd_ptrace_fpregs.sv_ex_sw;
|
||||||
/*
|
/*
|
||||||
* fortunately, sizeof(freebsd_save87) >= sizeof(save87)
|
* fortunately, sizeof(freebsd_save87) >= sizeof(save87)
|
||||||
*/
|
*/
|
||||||
bcopy(fregs->freebsd_ptrace_fpregs.sv_pad, &nframe->sv_ex_tw,
|
memcpy(&nframe->sv_ex_tw, fregs->freebsd_ptrace_fpregs.sv_pad,
|
||||||
sizeof(nframe->sv_ex_tw));
|
sizeof(nframe->sv_ex_tw));
|
||||||
bcopy((caddr_t)fregs->freebsd_ptrace_fpregs.sv_pad +
|
memcpy(nframe->sv_pad,
|
||||||
|
(caddr_t)fregs->freebsd_ptrace_fpregs.sv_pad +
|
||||||
sizeof(nframe->sv_ex_tw),
|
sizeof(nframe->sv_ex_tw),
|
||||||
nframe->sv_pad, sizeof(nframe->sv_pad));
|
sizeof(nframe->sv_pad));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* random value, except FREEBSD_U_AR0_OFFSET..., FREEBSD_U_SAVEFP_OFFSET... */
|
/* random value, except FREEBSD_U_AR0_OFFSET..., FREEBSD_U_SAVEFP_OFFSET... */
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: gdt.c,v 1.13 1998/02/10 14:11:02 mrg Exp $ */
|
/* $NetBSD: gdt.c,v 1.14 1998/08/05 02:45:08 perry Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
|
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
|
||||||
@ -184,7 +184,7 @@ gdt_init()
|
|||||||
vm_map_pageable(kernel_map, (vm_offset_t)gdt,
|
vm_map_pageable(kernel_map, (vm_offset_t)gdt,
|
||||||
(vm_offset_t)gdt + min_len, FALSE);
|
(vm_offset_t)gdt + min_len, FALSE);
|
||||||
#endif
|
#endif
|
||||||
bcopy(old_gdt, gdt, NGDT * sizeof(gdt[0]));
|
memcpy(gdt, old_gdt, NGDT * sizeof(gdt[0]));
|
||||||
|
|
||||||
setregion(®ion, gdt, max_len - 1);
|
setregion(®ion, gdt, max_len - 1);
|
||||||
lgdt(®ion);
|
lgdt(®ion);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: machdep.c,v 1.312 1998/07/17 21:10:00 thorpej Exp $ */
|
/* $NetBSD: machdep.c,v 1.313 1998/08/05 02:45:08 perry Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
|
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
|
||||||
@ -548,7 +548,7 @@ cpu_startup()
|
|||||||
VM_PROT_ALL, /* protection */
|
VM_PROT_ALL, /* protection */
|
||||||
TRUE); /* wired down */
|
TRUE); /* wired down */
|
||||||
#endif
|
#endif
|
||||||
bcopy(biostramp_image, (caddr_t)BIOSTRAMP_BASE, biostramp_image_size);
|
memcpy((caddr_t)BIOSTRAMP_BASE, biostramp_image, biostramp_image_size);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf("biostramp installed @ %x\n", BIOSTRAMP_BASE);
|
printf("biostramp installed @ %x\n", BIOSTRAMP_BASE);
|
||||||
#endif
|
#endif
|
||||||
@ -1398,7 +1398,7 @@ cpu_dump()
|
|||||||
|
|
||||||
dump = bdevsw[major(dumpdev)].d_dump;
|
dump = bdevsw[major(dumpdev)].d_dump;
|
||||||
|
|
||||||
bzero(buf, sizeof buf);
|
memset(buf, 0, sizeof buf);
|
||||||
segp = (kcore_seg_t *)buf;
|
segp = (kcore_seg_t *)buf;
|
||||||
cpuhdrp = (cpu_kcore_hdr_t *)&buf[ALIGN(sizeof(*segp))];
|
cpuhdrp = (cpu_kcore_hdr_t *)&buf[ALIGN(sizeof(*segp))];
|
||||||
memsegp = (phys_ram_seg_t *)&buf[ ALIGN(sizeof(*segp)) +
|
memsegp = (phys_ram_seg_t *)&buf[ ALIGN(sizeof(*segp)) +
|
||||||
@ -1812,7 +1812,7 @@ init386(first_avail)
|
|||||||
#if NBIOSCALL > 0
|
#if NBIOSCALL > 0
|
||||||
/* install page 2 (reserved above) as PT page for first 4M */
|
/* install page 2 (reserved above) as PT page for first 4M */
|
||||||
pmap_enter(pmap_kernel(), (u_long)vtopte(0), 2*NBPG, VM_PROT_ALL, TRUE);
|
pmap_enter(pmap_kernel(), (u_long)vtopte(0), 2*NBPG, VM_PROT_ALL, TRUE);
|
||||||
bzero(vtopte(0), NBPG); /* make sure it is clean before using */
|
memset(vtopte(0), 0, NBPG); /* make sure it is clean before using */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
pmap_enter(pmap_kernel(), idt_vaddr, idt_paddr, VM_PROT_ALL, TRUE);
|
pmap_enter(pmap_kernel(), idt_vaddr, idt_paddr, VM_PROT_ALL, TRUE);
|
||||||
@ -2211,7 +2211,7 @@ cpu_reset()
|
|||||||
* Try to cause a triple fault and watchdog reset by making the IDT
|
* Try to cause a triple fault and watchdog reset by making the IDT
|
||||||
* invalid and causing a fault.
|
* invalid and causing a fault.
|
||||||
*/
|
*/
|
||||||
bzero((caddr_t)idt, NIDT * sizeof(idt[0]));
|
memset((caddr_t)idt, 0, NIDT * sizeof(idt[0]));
|
||||||
__asm __volatile("divl %0,%1" : : "q" (0), "a" (0));
|
__asm __volatile("divl %0,%1" : : "q" (0), "a" (0));
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
@ -2219,7 +2219,7 @@ cpu_reset()
|
|||||||
* Try to cause a triple fault and watchdog reset by unmapping the
|
* Try to cause a triple fault and watchdog reset by unmapping the
|
||||||
* entire address space and doing a TLB flush.
|
* entire address space and doing a TLB flush.
|
||||||
*/
|
*/
|
||||||
bzero((caddr_t)PTD, NBPG);
|
memset((caddr_t)PTD, 0, NBPG);
|
||||||
pmap_update();
|
pmap_update();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -2556,7 +2556,7 @@ _bus_dmamap_create(t, size, nsegments, maxsegsz, boundary, flags, dmamp)
|
|||||||
(flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK)) == NULL)
|
(flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK)) == NULL)
|
||||||
return (ENOMEM);
|
return (ENOMEM);
|
||||||
|
|
||||||
bzero(mapstore, mapsize);
|
memset(mapstore, 0, mapsize);
|
||||||
map = (struct i386_bus_dmamap *)mapstore;
|
map = (struct i386_bus_dmamap *)mapstore;
|
||||||
map->_dm_size = size;
|
map->_dm_size = size;
|
||||||
map->_dm_segcnt = nsegments;
|
map->_dm_segcnt = nsegments;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: mainbus.c,v 1.26 1998/05/04 18:49:33 thorpej Exp $ */
|
/* $NetBSD: mainbus.c,v 1.27 1998/08/05 02:45:09 perry Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
|
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
|
||||||
@ -126,7 +126,7 @@ mainbus_attach(parent, self, aux)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (bcmp(ISA_HOLE_VADDR(EISA_ID_PADDR), EISA_ID, EISA_ID_LEN) == 0 &&
|
if (memcmp(ISA_HOLE_VADDR(EISA_ID_PADDR), EISA_ID, EISA_ID_LEN) == 0 &&
|
||||||
eisa_has_been_seen == 0) {
|
eisa_has_been_seen == 0) {
|
||||||
mba.mba_eba.eba_busname = "eisa";
|
mba.mba_eba.eba_busname = "eisa";
|
||||||
mba.mba_eba.eba_iot = I386_BUS_SPACE_IO;
|
mba.mba_eba.eba_iot = I386_BUS_SPACE_IO;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: mem.c,v 1.35 1998/07/05 08:49:35 jonathan Exp $ */
|
/* $NetBSD: mem.c,v 1.36 1998/08/05 02:45:09 perry Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1988 University of Utah.
|
* Copyright (c) 1988 University of Utah.
|
||||||
@ -194,7 +194,7 @@ mmrw(dev, uio, flags)
|
|||||||
if (zeropage == NULL) {
|
if (zeropage == NULL) {
|
||||||
zeropage = (caddr_t)
|
zeropage = (caddr_t)
|
||||||
malloc(CLBYTES, M_TEMP, M_WAITOK);
|
malloc(CLBYTES, M_TEMP, M_WAITOK);
|
||||||
bzero(zeropage, CLBYTES);
|
memset(zeropage, 0, CLBYTES);
|
||||||
}
|
}
|
||||||
c = min(iov->iov_len, CLBYTES);
|
c = min(iov->iov_len, CLBYTES);
|
||||||
error = uiomove(zeropage, c, uio);
|
error = uiomove(zeropage, c, uio);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: pmap.c,v 1.58 1998/07/08 05:41:59 thorpej Exp $ */
|
/* $NetBSD: pmap.c,v 1.59 1998/08/05 02:45:09 perry Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1993, 1994, 1995, 1997 Charles M. Hannum. All rights reserved.
|
* Copyright (c) 1993, 1994, 1995, 1997 Charles M. Hannum. All rights reserved.
|
||||||
@ -262,7 +262,7 @@ pmap_bootstrap(virtual_start)
|
|||||||
* Create Kernel page directory table and page maps.
|
* Create Kernel page directory table and page maps.
|
||||||
* [ currently done in locore. i have wild and crazy ideas -wfj ]
|
* [ currently done in locore. i have wild and crazy ideas -wfj ]
|
||||||
*/
|
*/
|
||||||
bzero(firstaddr, (1+nkpde)*NBPG);
|
memset(firstaddr, 0, (1+nkpde)*NBPG);
|
||||||
pmap_kernel()->pm_pdir = firstaddr + VM_MIN_KERNEL_ADDRESS;
|
pmap_kernel()->pm_pdir = firstaddr + VM_MIN_KERNEL_ADDRESS;
|
||||||
pmap_kernel()->pm_ptab = firstaddr + VM_MIN_KERNEL_ADDRESS + NBPG;
|
pmap_kernel()->pm_ptab = firstaddr + VM_MIN_KERNEL_ADDRESS + NBPG;
|
||||||
|
|
||||||
@ -742,7 +742,7 @@ pmap_create(size)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
pmap = (pmap_t) malloc(sizeof *pmap, M_VMPMAP, M_WAITOK);
|
pmap = (pmap_t) malloc(sizeof *pmap, M_VMPMAP, M_WAITOK);
|
||||||
bzero(pmap, sizeof(*pmap));
|
memset(pmap, 0, sizeof(*pmap));
|
||||||
pmap_pinit(pmap);
|
pmap_pinit(pmap);
|
||||||
return pmap;
|
return pmap;
|
||||||
}
|
}
|
||||||
@ -772,7 +772,7 @@ pmap_pinit(pmap)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* wire in kernel global address entries */
|
/* wire in kernel global address entries */
|
||||||
bcopy(&PTD[KPTDI], &pmap->pm_pdir[KPTDI], nkpde * sizeof(pd_entry_t));
|
memcpy(&pmap->pm_pdir[KPTDI], &PTD[KPTDI], nkpde * sizeof(pd_entry_t));
|
||||||
|
|
||||||
/* install self-referential address mapping entry */
|
/* install self-referential address mapping entry */
|
||||||
pmap->pm_pdir[PTDPTDI] =
|
pmap->pm_pdir[PTDPTDI] =
|
||||||
@ -1618,7 +1618,7 @@ pmap_dump_pvlist(phys, m)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* pmap_zero_page zeros the specified by mapping it into
|
* pmap_zero_page zeros the specified by mapping it into
|
||||||
* virtual memory and using bzero to clear its contents.
|
* virtual memory and using memset to clear its contents.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
pmap_zero_page(phys)
|
pmap_zero_page(phys)
|
||||||
@ -1633,12 +1633,12 @@ pmap_zero_page(phys)
|
|||||||
pmap_dump_pvlist(phys, "pmap_zero_page: phys");
|
pmap_dump_pvlist(phys, "pmap_zero_page: phys");
|
||||||
*CMAP2 = (phys & PG_FRAME) | PG_V | PG_KW /*| PG_N*/;
|
*CMAP2 = (phys & PG_FRAME) | PG_V | PG_KW /*| PG_N*/;
|
||||||
pmap_update();
|
pmap_update();
|
||||||
bzero(CADDR2, NBPG);
|
memset(CADDR2, 0, NBPG);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* pmap_copy_page copies the specified page by mapping
|
* pmap_copy_page copies the specified page by mapping
|
||||||
* it into virtual memory and using bcopy to copy its
|
* it into virtual memory and using memcpy to copy its
|
||||||
* contents.
|
* contents.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
@ -1656,7 +1656,7 @@ pmap_copy_page(src, dst)
|
|||||||
*CMAP1 = (src & PG_FRAME) | PG_V | PG_KR;
|
*CMAP1 = (src & PG_FRAME) | PG_V | PG_KR;
|
||||||
*CMAP2 = (dst & PG_FRAME) | PG_V | PG_KW /*| PG_N*/;
|
*CMAP2 = (dst & PG_FRAME) | PG_V | PG_KW /*| PG_N*/;
|
||||||
pmap_update();
|
pmap_update();
|
||||||
bcopy(CADDR1, CADDR2, NBPG);
|
memcpy(CADDR2, CADDR1, NBPG);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: pmap.new.c,v 1.14 1998/07/08 04:37:43 thorpej Exp $ */
|
/* $NetBSD: pmap.new.c,v 1.15 1998/08/05 02:45:09 perry Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
@ -796,7 +796,7 @@ vm_offset_t kva_start;
|
|||||||
TAILQ_INIT(&kpm->pm_obj.memq);
|
TAILQ_INIT(&kpm->pm_obj.memq);
|
||||||
kpm->pm_obj.uo_npages = 0;
|
kpm->pm_obj.uo_npages = 0;
|
||||||
kpm->pm_obj.uo_refs = 1;
|
kpm->pm_obj.uo_refs = 1;
|
||||||
bzero(&kpm->pm_list, sizeof(kpm->pm_list)); /* pm_list not used */
|
memset(&kpm->pm_list, 0, sizeof(kpm->pm_list)); /* pm_list not used */
|
||||||
kpm->pm_pdir = (pd_entry_t *)(proc0.p_addr->u_pcb.pcb_cr3 + KERNBASE);
|
kpm->pm_pdir = (pd_entry_t *)(proc0.p_addr->u_pcb.pcb_cr3 + KERNBASE);
|
||||||
kpm->pm_pdirpa = (u_int32_t) proc0.p_addr->u_pcb.pcb_cr3;
|
kpm->pm_pdirpa = (u_int32_t) proc0.p_addr->u_pcb.pcb_cr3;
|
||||||
kpm->pm_stats.wired_count = kpm->pm_stats.resident_count =
|
kpm->pm_stats.wired_count = kpm->pm_stats.resident_count =
|
||||||
@ -954,7 +954,7 @@ void pmap_init()
|
|||||||
panic("pmap_init: unable to allocate pv_heads");
|
panic("pmap_init: unable to allocate pv_heads");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* init all pv_head's and attrs in one bzero
|
* init all pv_head's and attrs in one memset
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* allocate pv_head stuff first */
|
/* allocate pv_head stuff first */
|
||||||
@ -1750,7 +1750,7 @@ struct pmap *pmap;
|
|||||||
|
|
||||||
/* init PDP */
|
/* init PDP */
|
||||||
/* zero init area */
|
/* zero init area */
|
||||||
bzero(pmap->pm_pdir, PDSLOT_PTE * sizeof(pd_entry_t));
|
memset(pmap->pm_pdir, 0, PDSLOT_PTE * sizeof(pd_entry_t));
|
||||||
/* put in recursive PDE to map the PTEs */
|
/* put in recursive PDE to map the PTEs */
|
||||||
pmap->pm_pdir[PDSLOT_PTE] = pmap->pm_pdirpa | PG_V | PG_KW;
|
pmap->pm_pdir[PDSLOT_PTE] = pmap->pm_pdirpa | PG_V | PG_KW;
|
||||||
|
|
||||||
@ -1762,10 +1762,10 @@ struct pmap *pmap;
|
|||||||
*/
|
*/
|
||||||
simple_lock(&pmaps_lock);
|
simple_lock(&pmaps_lock);
|
||||||
/* put in kernel VM PDEs */
|
/* put in kernel VM PDEs */
|
||||||
bcopy(&PDP_BASE[PDSLOT_KERN], &pmap->pm_pdir[PDSLOT_KERN],
|
memcpy(&pmap->pm_pdir[PDSLOT_KERN], &PDP_BASE[PDSLOT_KERN],
|
||||||
nkpde * sizeof(pd_entry_t));
|
nkpde * sizeof(pd_entry_t));
|
||||||
/* zero the rest */
|
/* zero the rest */
|
||||||
bzero(&pmap->pm_pdir[PDSLOT_KERN + nkpde],
|
memset(&pmap->pm_pdir[PDSLOT_KERN + nkpde], 0,
|
||||||
NBPG - ((PDSLOT_KERN + nkpde) * sizeof(pd_entry_t)));
|
NBPG - ((PDSLOT_KERN + nkpde) * sizeof(pd_entry_t)));
|
||||||
LIST_INSERT_HEAD(&pmaps, pmap, pm_list);
|
LIST_INSERT_HEAD(&pmaps, pmap, pm_list);
|
||||||
if (pmaps_hand == NULL)
|
if (pmaps_hand == NULL)
|
||||||
@ -1989,7 +1989,7 @@ vm_offset_t pa;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
*zero_pte = (pa & PG_FRAME) | PG_V | PG_RW; /* map in */
|
*zero_pte = (pa & PG_FRAME) | PG_V | PG_RW; /* map in */
|
||||||
bzero(zerop, NBPG); /* zero */
|
memset(zerop, 0, NBPG); /* zero */
|
||||||
*zero_pte = 0; /* zap! */
|
*zero_pte = 0; /* zap! */
|
||||||
pmap_update_pg((vm_offset_t)zerop); /* flush TLB */
|
pmap_update_pg((vm_offset_t)zerop); /* flush TLB */
|
||||||
simple_unlock(&pmap_zero_page_lock);
|
simple_unlock(&pmap_zero_page_lock);
|
||||||
@ -2012,7 +2012,7 @@ vm_offset_t srcpa, dstpa;
|
|||||||
|
|
||||||
*csrc_pte = (srcpa & PG_FRAME) | PG_V | PG_RW;
|
*csrc_pte = (srcpa & PG_FRAME) | PG_V | PG_RW;
|
||||||
*cdst_pte = (dstpa & PG_FRAME) | PG_V | PG_RW;
|
*cdst_pte = (dstpa & PG_FRAME) | PG_V | PG_RW;
|
||||||
bcopy(csrcp, cdstp, NBPG);
|
memcpy(cdstp, csrcp, NBPG);
|
||||||
*csrc_pte = *cdst_pte = 0; /* zap! */
|
*csrc_pte = *cdst_pte = 0; /* zap! */
|
||||||
pmap_update_2pg((vm_offset_t)csrcp, (vm_offset_t)cdstp);
|
pmap_update_2pg((vm_offset_t)csrcp, (vm_offset_t)cdstp);
|
||||||
simple_unlock(&pmap_copy_page_lock);
|
simple_unlock(&pmap_copy_page_lock);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: process_machdep.c,v 1.27 1998/01/24 14:22:44 mycroft Exp $ */
|
/* $NetBSD: process_machdep.c,v 1.28 1998/08/05 02:45:09 perry Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1995, 1996, 1997, 1998
|
* Copyright (c) 1995, 1996, 1997, 1998
|
||||||
@ -165,14 +165,14 @@ process_read_fpregs(p, regs)
|
|||||||
* save it temporarily.
|
* save it temporarily.
|
||||||
*/
|
*/
|
||||||
cw = frame->sv_env.en_cw;
|
cw = frame->sv_env.en_cw;
|
||||||
bzero(frame, sizeof(*regs));
|
memset(frame, 0, sizeof(*regs));
|
||||||
frame->sv_env.en_cw = cw;
|
frame->sv_env.en_cw = cw;
|
||||||
frame->sv_env.en_sw = 0x0000;
|
frame->sv_env.en_sw = 0x0000;
|
||||||
frame->sv_env.en_tw = 0xffff;
|
frame->sv_env.en_tw = 0xffff;
|
||||||
p->p_md.md_flags |= MDP_USEDFPU;
|
p->p_md.md_flags |= MDP_USEDFPU;
|
||||||
}
|
}
|
||||||
|
|
||||||
bcopy(frame, regs, sizeof(*regs));
|
memcpy(regs, frame, sizeof(*regs));
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -259,7 +259,7 @@ process_write_fpregs(p, regs)
|
|||||||
p->p_md.md_flags |= MDP_USEDFPU;
|
p->p_md.md_flags |= MDP_USEDFPU;
|
||||||
}
|
}
|
||||||
|
|
||||||
bcopy(regs, frame, sizeof(*regs));
|
memcpy(frame, regs, sizeof(*regs));
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: svr4_machdep.c,v 1.35 1998/05/08 16:55:16 kleink Exp $ */
|
/* $NetBSD: svr4_machdep.c,v 1.36 1998/08/05 02:45:09 perry Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1994 Christos Zoulas
|
* Copyright (c) 1994 Christos Zoulas
|
||||||
@ -88,7 +88,7 @@ svr4_getcontext(p, uc, mask, oonstack)
|
|||||||
struct svr4_sigaltstack *s = &uc->uc_stack;
|
struct svr4_sigaltstack *s = &uc->uc_stack;
|
||||||
struct sigaltstack *sf = &psp->ps_sigstk;
|
struct sigaltstack *sf = &psp->ps_sigstk;
|
||||||
|
|
||||||
bzero(uc, sizeof(struct svr4_ucontext));
|
memset(uc, 0, sizeof(struct svr4_ucontext));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set the general purpose registers
|
* Set the general purpose registers
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: sys_machdep.c,v 1.41 1998/02/25 21:41:56 perry Exp $ */
|
/* $NetBSD: sys_machdep.c,v 1.42 1998/08/05 02:45:09 perry Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1995, 1997
|
* Copyright (c) 1995, 1997
|
||||||
@ -261,8 +261,8 @@ i386_set_ldt(p, args, retval)
|
|||||||
#else
|
#else
|
||||||
new_ldt = (union descriptor *)kmem_alloc(kernel_map, new_len);
|
new_ldt = (union descriptor *)kmem_alloc(kernel_map, new_len);
|
||||||
#endif
|
#endif
|
||||||
bcopy(old_ldt, new_ldt, old_len);
|
memcpy(new_ldt, old_ldt, old_len);
|
||||||
bzero((caddr_t)new_ldt + old_len, new_len - old_len);
|
memset((caddr_t)new_ldt + old_len, 0, new_len - old_len);
|
||||||
pcb->pcb_ldt = new_ldt;
|
pcb->pcb_ldt = new_ldt;
|
||||||
|
|
||||||
if (pcb->pcb_flags & PCB_USER_LDT)
|
if (pcb->pcb_flags & PCB_USER_LDT)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: vm_machdep.c,v 1.69 1998/07/28 18:34:54 thorpej Exp $ */
|
/* $NetBSD: vm_machdep.c,v 1.70 1998/08/05 02:45:10 perry Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
|
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
|
||||||
@ -140,7 +140,7 @@ cpu_fork(p1, p2)
|
|||||||
#else
|
#else
|
||||||
new_ldt = (union descriptor *)kmem_alloc(kernel_map, len);
|
new_ldt = (union descriptor *)kmem_alloc(kernel_map, len);
|
||||||
#endif
|
#endif
|
||||||
bcopy(pcb->pcb_ldt, new_ldt, len);
|
memcpy(new_ldt, pcb->pcb_ldt, len);
|
||||||
pcb->pcb_ldt = new_ldt;
|
pcb->pcb_ldt = new_ldt;
|
||||||
ldt_alloc(pcb, new_ldt, len);
|
ldt_alloc(pcb, new_ldt, len);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user