- ANSIfy
- KNF - u_intXX_t -> uintXX_t
This commit is contained in:
parent
825f80c59c
commit
da447cc3ab
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: autoconf.c,v 1.16 2006/02/25 17:37:14 thorpej Exp $ */
|
||||
/* $NetBSD: autoconf.c,v 1.17 2006/04/05 15:03:27 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2000 Soren S. Jorvang. All rights reserved.
|
||||
@ -26,7 +26,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.16 2006/02/25 17:37:14 thorpej Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.17 2006/04/05 15:03:27 tsutsui Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -44,7 +44,7 @@ extern int bootpart;
|
||||
int cpuspeed = 100; /* Until we know more precisely. */
|
||||
|
||||
void
|
||||
cpu_configure()
|
||||
cpu_configure(void)
|
||||
{
|
||||
|
||||
softintr_init();
|
||||
@ -58,10 +58,11 @@ cpu_configure()
|
||||
}
|
||||
|
||||
void
|
||||
cpu_rootconf()
|
||||
cpu_rootconf(void)
|
||||
{
|
||||
|
||||
printf("boot device: %s\n",
|
||||
booted_device ? booted_device->dv_xname : "<unknown>");
|
||||
booted_device ? booted_device->dv_xname : "<unknown>");
|
||||
|
||||
setroot(booted_device, booted_partition);
|
||||
}
|
||||
@ -69,10 +70,9 @@ cpu_rootconf()
|
||||
static int hd_iterate = -1;
|
||||
|
||||
void
|
||||
device_register(dev, aux)
|
||||
struct device *dev;
|
||||
void *aux;
|
||||
device_register(struct device *dev, void *aux)
|
||||
{
|
||||
|
||||
if (booted_device)
|
||||
return;
|
||||
|
||||
@ -88,9 +88,9 @@ device_register(dev, aux)
|
||||
}
|
||||
}
|
||||
/*
|
||||
* XXX Match up MBR boot specification with BSD disklabel for root?
|
||||
* XXX Match up MBR boot specification with BSD disklabel
|
||||
* for root?
|
||||
*/
|
||||
booted_partition = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: bus.c,v 1.25 2006/04/05 14:03:04 tsutsui Exp $ */
|
||||
/* $NetBSD: bus.c,v 1.26 2006/04/05 15:03:27 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
@ -38,7 +38,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.25 2006/04/05 14:03:04 tsutsui Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.26 2006/04/05 15:03:27 tsutsui Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -75,12 +75,8 @@ struct cobalt_bus_dma_tag cobalt_default_bus_dma_tag = {
|
||||
};
|
||||
|
||||
int
|
||||
bus_space_map(t, bpa, size, flags, bshp)
|
||||
bus_space_tag_t t;
|
||||
bus_addr_t bpa;
|
||||
bus_size_t size;
|
||||
int flags;
|
||||
bus_space_handle_t *bshp;
|
||||
bus_space_map(bus_space_tag_t t, bus_addr_t bpa, bus_size_t size, int flags,
|
||||
bus_space_handle_t *bshp)
|
||||
{
|
||||
int cacheable = flags & BUS_SPACE_MAP_CACHEABLE;
|
||||
|
||||
@ -97,41 +93,31 @@ bus_space_map(t, bpa, size, flags, bshp)
|
||||
}
|
||||
|
||||
int
|
||||
bus_space_alloc(t, rstart, rend, size, alignment, boundary, flags, bpap, bshp)
|
||||
bus_space_tag_t t;
|
||||
bus_addr_t rstart, rend;
|
||||
bus_size_t size, alignment, boundary;
|
||||
int flags;
|
||||
bus_addr_t *bpap;
|
||||
bus_space_handle_t *bshp;
|
||||
bus_space_alloc(bus_space_tag_t t, bus_addr_t rstart, bus_addr_t rend,
|
||||
bus_size_t size, bus_size_t alignment, bus_size_t boundary, int flags,
|
||||
bus_addr_t *bpap, bus_space_handle_t *bshp)
|
||||
{
|
||||
|
||||
panic("bus_space_alloc: not implemented");
|
||||
}
|
||||
|
||||
void
|
||||
bus_space_free(t, bsh, size)
|
||||
bus_space_tag_t t;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t size;
|
||||
bus_space_free(bus_space_tag_t t, bus_space_handle_t bsh, bus_size_t size)
|
||||
{
|
||||
|
||||
panic("bus_space_free: not implemented");
|
||||
}
|
||||
|
||||
void
|
||||
bus_space_unmap(t, bsh, size)
|
||||
bus_space_tag_t t;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t size;
|
||||
bus_space_unmap(bus_space_tag_t t, bus_space_handle_t bsh, bus_size_t size)
|
||||
{
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
int
|
||||
bus_space_subregion(t, bsh, offset, size, nbshp)
|
||||
bus_space_tag_t t;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t offset, size;
|
||||
bus_space_handle_t *nbshp;
|
||||
bus_space_subregion(bus_space_tag_t t, bus_space_handle_t bsh,
|
||||
bus_size_t offset, bus_size_t size, bus_space_handle_t *nbshp)
|
||||
{
|
||||
|
||||
*nbshp = bsh + offset;
|
||||
@ -143,14 +129,8 @@ bus_space_subregion(t, bsh, offset, size, nbshp)
|
||||
* DMA map creation functions.
|
||||
*/
|
||||
int
|
||||
_bus_dmamap_create(t, size, nsegments, maxsegsz, boundary, flags, dmamp)
|
||||
bus_dma_tag_t t;
|
||||
bus_size_t size;
|
||||
int nsegments;
|
||||
bus_size_t maxsegsz;
|
||||
bus_size_t boundary;
|
||||
int flags;
|
||||
bus_dmamap_t *dmamp;
|
||||
_bus_dmamap_create(bus_dma_tag_t t, bus_size_t size, int nsegments,
|
||||
bus_size_t maxsegsz, bus_size_t boundary, int flags, bus_dmamap_t *dmamp)
|
||||
{
|
||||
struct cobalt_bus_dmamap *map;
|
||||
void *mapstore;
|
||||
@ -195,13 +175,12 @@ _bus_dmamap_create(t, size, nsegments, maxsegsz, boundary, flags, dmamp)
|
||||
* DMA map destruction functions.
|
||||
*/
|
||||
void
|
||||
_bus_dmamap_destroy(t, map)
|
||||
bus_dma_tag_t t;
|
||||
bus_dmamap_t map;
|
||||
_bus_dmamap_destroy(bus_dma_tag_t t, bus_dmamap_t map)
|
||||
{
|
||||
|
||||
free(map, M_DMAMAP);
|
||||
}
|
||||
|
||||
extern paddr_t kvtophys(vaddr_t); /* XXX */
|
||||
|
||||
/*
|
||||
@ -211,16 +190,8 @@ extern paddr_t kvtophys(vaddr_t); /* XXX */
|
||||
* first indicates if this is the first invocation of this function.
|
||||
*/
|
||||
int
|
||||
_bus_dmamap_load_buffer(map, buf, buflen, vm, flags,
|
||||
lastaddrp, segp, first)
|
||||
bus_dmamap_t map;
|
||||
void *buf;
|
||||
bus_size_t buflen;
|
||||
struct vmspace *vm;
|
||||
int flags;
|
||||
vaddr_t *lastaddrp;
|
||||
int *segp;
|
||||
int first;
|
||||
_bus_dmamap_load_buffer(bus_dmamap_t map, void *buf, bus_size_t buflen,
|
||||
struct vmspace *vm, int flags, vaddr_t *lastaddrp, int *segp, int first)
|
||||
{
|
||||
bus_size_t sgsize;
|
||||
bus_addr_t curaddr, lastaddr, baddr, bmask;
|
||||
@ -235,7 +206,7 @@ _bus_dmamap_load_buffer(map, buf, buflen, vm, flags,
|
||||
* Get the physical address for this segment.
|
||||
*/
|
||||
if (!VMSPACE_IS_KERNEL_P(vm))
|
||||
(void) pmap_extract(vm_map_pmap(&vm->vm_map),
|
||||
(void)pmap_extract(vm_map_pmap(&vm->vm_map),
|
||||
vaddr, &curaddr);
|
||||
else
|
||||
curaddr = kvtophys(vaddr);
|
||||
@ -304,13 +275,8 @@ _bus_dmamap_load_buffer(map, buf, buflen, vm, flags,
|
||||
* buffer.
|
||||
*/
|
||||
int
|
||||
_bus_dmamap_load(t, map, buf, buflen, p, flags)
|
||||
bus_dma_tag_t t;
|
||||
bus_dmamap_t map;
|
||||
void *buf;
|
||||
bus_size_t buflen;
|
||||
struct proc *p;
|
||||
int flags;
|
||||
_bus_dmamap_load(bus_dma_tag_t t, bus_dmamap_t map, void *buf,
|
||||
bus_size_t buflen, struct proc *p, int flags)
|
||||
{
|
||||
vaddr_t lastaddr;
|
||||
int seg, error;
|
||||
@ -357,11 +323,8 @@ _bus_dmamap_load(t, map, buf, buflen, p, flags)
|
||||
* Like _bus_dmamap_load(), but for mbufs.
|
||||
*/
|
||||
int
|
||||
_bus_dmamap_load_mbuf(t, map, m0, flags)
|
||||
bus_dma_tag_t t;
|
||||
bus_dmamap_t map;
|
||||
struct mbuf *m0;
|
||||
int flags;
|
||||
_bus_dmamap_load_mbuf(bus_dma_tag_t t, bus_dmamap_t map, struct mbuf *m0,
|
||||
int flags)
|
||||
{
|
||||
vaddr_t lastaddr;
|
||||
int seg, error, first;
|
||||
@ -404,11 +367,8 @@ _bus_dmamap_load_mbuf(t, map, m0, flags)
|
||||
* Like _bus_dmamap_load(), but for uios.
|
||||
*/
|
||||
int
|
||||
_bus_dmamap_load_uio(t, map, uio, flags)
|
||||
bus_dma_tag_t t;
|
||||
bus_dmamap_t map;
|
||||
struct uio *uio;
|
||||
int flags;
|
||||
_bus_dmamap_load_uio(bus_dma_tag_t t, bus_dmamap_t map, struct uio *uio,
|
||||
int flags)
|
||||
{
|
||||
vaddr_t lastaddr;
|
||||
int seg, i, error, first;
|
||||
@ -455,13 +415,8 @@ _bus_dmamap_load_uio(t, map, uio, flags)
|
||||
* Like _bus_dmamap_load(), but for raw memory.
|
||||
*/
|
||||
int
|
||||
_bus_dmamap_load_raw(t, map, segs, nsegs, size, flags)
|
||||
bus_dma_tag_t t;
|
||||
bus_dmamap_t map;
|
||||
bus_dma_segment_t *segs;
|
||||
int nsegs;
|
||||
bus_size_t size;
|
||||
int flags;
|
||||
_bus_dmamap_load_raw(bus_dma_tag_t t, bus_dmamap_t map, bus_dma_segment_t *segs,
|
||||
int nsegs, bus_size_t size, int flags)
|
||||
{
|
||||
|
||||
panic("_bus_dmamap_load_raw: not implemented");
|
||||
@ -472,9 +427,7 @@ _bus_dmamap_load_raw(t, map, segs, nsegs, size, flags)
|
||||
* chipset-specific DMA map unload functions.
|
||||
*/
|
||||
void
|
||||
_bus_dmamap_unload(t, map)
|
||||
bus_dma_tag_t t;
|
||||
bus_dmamap_t map;
|
||||
_bus_dmamap_unload(bus_dma_tag_t t, bus_dmamap_t map)
|
||||
{
|
||||
|
||||
/*
|
||||
@ -496,12 +449,8 @@ _bus_dmamap_unload(t, map)
|
||||
* cache found on Cobalt systems.
|
||||
*/
|
||||
void
|
||||
_bus_dmamap_sync(t, map, offset, len, ops)
|
||||
bus_dma_tag_t t;
|
||||
bus_dmamap_t map;
|
||||
bus_addr_t offset;
|
||||
bus_size_t len;
|
||||
int ops;
|
||||
_bus_dmamap_sync(bus_dma_tag_t t, bus_dmamap_t map, bus_addr_t offset,
|
||||
bus_size_t len, int ops)
|
||||
{
|
||||
bus_size_t minlen;
|
||||
bus_addr_t addr;
|
||||
@ -637,13 +586,9 @@ _bus_dmamap_sync(t, map, offset, len, ops)
|
||||
* by bus-specific DMA memory allocation functions.
|
||||
*/
|
||||
int
|
||||
_bus_dmamem_alloc(t, size, alignment, boundary, segs, nsegs, rsegs, flags)
|
||||
bus_dma_tag_t t;
|
||||
bus_size_t size, alignment, boundary;
|
||||
bus_dma_segment_t *segs;
|
||||
int nsegs;
|
||||
int *rsegs;
|
||||
int flags;
|
||||
_bus_dmamem_alloc(bus_dma_tag_t t, bus_size_t size, bus_size_t alignment,
|
||||
bus_size_t boundary, bus_dma_segment_t *segs, int nsegs, int *rsegs,
|
||||
int flags)
|
||||
{
|
||||
extern paddr_t avail_start, avail_end;
|
||||
vaddr_t curaddr, lastaddr;
|
||||
@ -704,10 +649,7 @@ _bus_dmamem_alloc(t, size, alignment, boundary, segs, nsegs, rsegs, flags)
|
||||
* bus-specific DMA memory free functions.
|
||||
*/
|
||||
void
|
||||
_bus_dmamem_free(t, segs, nsegs)
|
||||
bus_dma_tag_t t;
|
||||
bus_dma_segment_t *segs;
|
||||
int nsegs;
|
||||
_bus_dmamem_free(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs)
|
||||
{
|
||||
struct vm_page *m;
|
||||
bus_addr_t addr;
|
||||
@ -735,13 +677,8 @@ _bus_dmamem_free(t, segs, nsegs)
|
||||
* bus-specific DMA memory map functions.
|
||||
*/
|
||||
int
|
||||
_bus_dmamem_map(t, segs, nsegs, size, kvap, flags)
|
||||
bus_dma_tag_t t;
|
||||
bus_dma_segment_t *segs;
|
||||
int nsegs;
|
||||
size_t size;
|
||||
caddr_t *kvap;
|
||||
int flags;
|
||||
_bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs,
|
||||
size_t size, caddr_t *kvap, int flags)
|
||||
{
|
||||
vaddr_t va;
|
||||
bus_addr_t addr;
|
||||
@ -793,10 +730,7 @@ _bus_dmamem_map(t, segs, nsegs, size, kvap, flags)
|
||||
* bus-specific DMA memory unmapping functions.
|
||||
*/
|
||||
void
|
||||
_bus_dmamem_unmap(t, kva, size)
|
||||
bus_dma_tag_t t;
|
||||
caddr_t kva;
|
||||
size_t size;
|
||||
_bus_dmamem_unmap(bus_dma_tag_t t, caddr_t kva, size_t size)
|
||||
{
|
||||
|
||||
#ifdef DIAGNOSTIC
|
||||
@ -823,12 +757,8 @@ _bus_dmamem_unmap(t, kva, size)
|
||||
* bus-specific DMA mmap(2)'ing functions.
|
||||
*/
|
||||
paddr_t
|
||||
_bus_dmamem_mmap(t, segs, nsegs, off, prot, flags)
|
||||
bus_dma_tag_t t;
|
||||
bus_dma_segment_t *segs;
|
||||
int nsegs;
|
||||
off_t off;
|
||||
int prot, flags;
|
||||
_bus_dmamem_mmap(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs,
|
||||
off_t off, int prot, int flags)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: clock.c,v 1.9 2005/12/11 12:17:05 christos Exp $ */
|
||||
/* $NetBSD: clock.c,v 1.10 2006/04/05 15:03:27 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2000 Soren S. Jorvang. All rights reserved.
|
||||
@ -26,7 +26,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.9 2005/12/11 12:17:05 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.10 2006/04/05 15:03:27 tsutsui Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/proc.h>
|
||||
@ -45,7 +45,7 @@ long (*timer_read)(void *);
|
||||
void *timer_cookie;
|
||||
|
||||
void
|
||||
cpu_initclocks()
|
||||
cpu_initclocks(void)
|
||||
{
|
||||
|
||||
/* start timer */
|
||||
@ -57,27 +57,23 @@ cpu_initclocks()
|
||||
}
|
||||
|
||||
u_int
|
||||
mc146818_read(sc, reg)
|
||||
void *sc;
|
||||
u_int reg;
|
||||
mc146818_read(void *sc, u_int reg)
|
||||
{
|
||||
|
||||
(*(volatile u_int8_t *)(MIPS_PHYS_TO_KSEG1(0x10000070))) = reg;
|
||||
return (*(volatile u_int8_t *)(MIPS_PHYS_TO_KSEG1(0x10000071)));
|
||||
}
|
||||
|
||||
void
|
||||
mc146818_write(sc, reg, datum)
|
||||
void *sc;
|
||||
u_int reg;
|
||||
u_int datum;
|
||||
mc146818_write(void *sc, u_int reg, u_int datum)
|
||||
{
|
||||
|
||||
(*(volatile u_int8_t *)(MIPS_PHYS_TO_KSEG1(0x10000070))) = reg;
|
||||
(*(volatile u_int8_t *)(MIPS_PHYS_TO_KSEG1(0x10000071))) = datum;
|
||||
}
|
||||
|
||||
void
|
||||
inittodr(base)
|
||||
time_t base;
|
||||
inittodr(time_t base)
|
||||
{
|
||||
struct clock_ymdhms dt;
|
||||
mc_todregs regs;
|
||||
@ -101,7 +97,7 @@ inittodr(base)
|
||||
}
|
||||
|
||||
void
|
||||
resettodr()
|
||||
resettodr(void)
|
||||
{
|
||||
mc_todregs regs;
|
||||
struct clock_ymdhms dt;
|
||||
@ -131,8 +127,7 @@ resettodr()
|
||||
}
|
||||
|
||||
void
|
||||
setstatclockrate(arg)
|
||||
int arg;
|
||||
setstatclockrate(int arg)
|
||||
{
|
||||
/* XXX */
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: console.c,v 1.9 2005/12/11 12:17:05 christos Exp $ */
|
||||
/* $NetBSD: console.c,v 1.10 2006/04/05 15:03:27 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2000 Soren S. Jorvang. All rights reserved.
|
||||
@ -26,7 +26,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: console.c,v 1.9 2005/12/11 12:17:05 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: console.c,v 1.10 2006/04/05 15:03:27 tsutsui Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -59,7 +59,7 @@ struct consdev constab[] = {
|
||||
};
|
||||
|
||||
void
|
||||
consinit()
|
||||
consinit(void)
|
||||
{
|
||||
static int initted;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: cpu.c,v 1.7 2005/12/11 12:17:05 christos Exp $ */
|
||||
/* $NetBSD: cpu.c,v 1.8 2006/04/05 15:03:27 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
|
||||
@ -28,7 +28,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.7 2005/12/11 12:17:05 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.8 2006/04/05 15:03:27 tsutsui Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/device.h>
|
||||
@ -47,7 +47,7 @@ int
|
||||
cpu_match(struct device *parent, struct cfdata *cf, void *aux)
|
||||
{
|
||||
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: disksubr.c,v 1.16 2005/12/11 12:17:05 christos Exp $ */
|
||||
/* $NetBSD: disksubr.c,v 1.17 2006/04/05 15:03:27 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
|
||||
@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.16 2005/12/11 12:17:05 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.17 2006/04/05 15:03:27 tsutsui Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -49,20 +49,17 @@ mbr_findslice(struct mbr_partition* dp, struct buf *bp);
|
||||
* Otherwise, copy valid MBR partition-table into dp, and if a NetBSD
|
||||
* partition is found, return a pointer to it; else return NULL.
|
||||
*/
|
||||
static
|
||||
struct mbr_partition *
|
||||
mbr_findslice(dp, bp)
|
||||
struct mbr_partition *dp;
|
||||
struct buf *bp;
|
||||
static struct mbr_partition *
|
||||
mbr_findslice(struct mbr_partition *dp, struct buf *bp)
|
||||
{
|
||||
struct mbr_partition *ourdp = NULL;
|
||||
u_int16_t *mbrmagicp;
|
||||
uint16_t *mbrmagicp;
|
||||
int i;
|
||||
|
||||
/* Note: Magic number is little-endian. */
|
||||
mbrmagicp = (u_int16_t *)(bp->b_data + MBR_MAGIC_OFFSET);
|
||||
mbrmagicp = (uint16_t *)(bp->b_data + MBR_MAGIC_OFFSET);
|
||||
if (*mbrmagicp != MBR_MAGIC)
|
||||
return (NO_MBR_SIGNATURE);
|
||||
return NO_MBR_SIGNATURE;
|
||||
|
||||
/* XXX how do we check veracity/bounds of this? */
|
||||
memcpy(dp, bp->b_data + MBR_PART_OFFSET, MBR_PART_COUNT * sizeof(*dp));
|
||||
@ -75,7 +72,7 @@ mbr_findslice(dp, bp)
|
||||
}
|
||||
}
|
||||
|
||||
return (ourdp);
|
||||
return ourdp;
|
||||
}
|
||||
|
||||
|
||||
@ -95,11 +92,8 @@ mbr_findslice(dp, bp)
|
||||
* Returns null on success and an error string on failure.
|
||||
*/
|
||||
const char *
|
||||
readdisklabel(dev, strat, lp, osdep)
|
||||
dev_t dev;
|
||||
void (*strat) __P((struct buf *));
|
||||
struct disklabel *lp;
|
||||
struct cpu_disklabel *osdep;
|
||||
readdisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp,
|
||||
struct cpu_disklabel *osdep)
|
||||
{
|
||||
struct mbr_partition *dp;
|
||||
struct partition *pp;
|
||||
@ -117,10 +111,11 @@ readdisklabel(dev, strat, lp, osdep)
|
||||
#if 0
|
||||
if (lp->d_ncylinders == 16383) {
|
||||
printf("disklabel: Disk > 8G ... readjusting chs %d/%d/%d to ",
|
||||
lp->d_ncylinders, lp->d_ntracks, lp->d_nsectors);
|
||||
lp->d_ncylinders = lp->d_secperunit / lp->d_ntracks / lp->d_nsectors;
|
||||
lp->d_ncylinders, lp->d_ntracks, lp->d_nsectors);
|
||||
lp->d_ncylinders =
|
||||
lp->d_secperunit / lp->d_ntracks / lp->d_nsectors;
|
||||
printf("%d/%d/%d\n",
|
||||
lp->d_ncylinders, lp->d_ntracks, lp->d_nsectors);
|
||||
lp->d_ncylinders, lp->d_ntracks, lp->d_nsectors);
|
||||
}
|
||||
#endif
|
||||
lp->d_npartitions = RAW_PART + 1;
|
||||
@ -189,7 +184,7 @@ readdisklabel(dev, strat, lp, osdep)
|
||||
lp->d_npartitions = RAW_PART + 1 + i;
|
||||
}
|
||||
|
||||
nombrpart:
|
||||
nombrpart:
|
||||
/* next, dig out disk label */
|
||||
bp->b_blkno = dospartoff + LABELSECTOR;
|
||||
bp->b_cylinder = cyl;
|
||||
@ -204,7 +199,8 @@ nombrpart:
|
||||
goto done;
|
||||
}
|
||||
for (dlp = (struct disklabel *)bp->b_data;
|
||||
dlp <= (struct disklabel *)(bp->b_data + lp->d_secsize - sizeof(*dlp));
|
||||
dlp <= (struct disklabel *)(bp->b_data + lp->d_secsize -
|
||||
sizeof(*dlp));
|
||||
dlp = (struct disklabel *)((char *)dlp + sizeof(long))) {
|
||||
if (dlp->d_magic != DISKMAGIC || dlp->d_magic2 != DISKMAGIC) {
|
||||
if (msg == NULL)
|
||||
@ -256,12 +252,12 @@ nombrpart:
|
||||
msg = "bad sector table corrupted";
|
||||
}
|
||||
} while ((bp->b_flags & B_ERROR) && (i += 2) < 10 &&
|
||||
i < lp->d_nsectors);
|
||||
i < lp->d_nsectors);
|
||||
}
|
||||
|
||||
done:
|
||||
brelse(bp);
|
||||
return (msg);
|
||||
return msg;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -269,28 +265,26 @@ done:
|
||||
* before setting it.
|
||||
*/
|
||||
int
|
||||
setdisklabel(olp, nlp, openmask, osdep)
|
||||
struct disklabel *olp, *nlp;
|
||||
u_long openmask;
|
||||
struct cpu_disklabel *osdep;
|
||||
setdisklabel(struct disklabel *olp, struct disklabel *nlp, u_long openmask,
|
||||
struct cpu_disklabel *osdep)
|
||||
{
|
||||
int i;
|
||||
struct partition *opp, *npp;
|
||||
|
||||
/* sanity clause */
|
||||
if (nlp->d_secpercyl == 0 || nlp->d_secsize == 0
|
||||
|| (nlp->d_secsize % DEV_BSIZE) != 0)
|
||||
return(EINVAL);
|
||||
if (nlp->d_secpercyl == 0 || nlp->d_secsize == 0 ||
|
||||
(nlp->d_secsize % DEV_BSIZE) != 0)
|
||||
return EINVAL;
|
||||
|
||||
/* special case to allow disklabel to be invalidated */
|
||||
if (nlp->d_magic == 0xffffffff) {
|
||||
*olp = *nlp;
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (nlp->d_magic != DISKMAGIC || nlp->d_magic2 != DISKMAGIC ||
|
||||
dkcksum(nlp) != 0)
|
||||
return (EINVAL);
|
||||
return EINVAL;
|
||||
|
||||
/* XXX missing check if other dos partitions will be overwritten */
|
||||
|
||||
@ -298,11 +292,11 @@ setdisklabel(olp, nlp, openmask, osdep)
|
||||
i = ffs(openmask) - 1;
|
||||
openmask &= ~(1 << i);
|
||||
if (nlp->d_npartitions <= i)
|
||||
return (EBUSY);
|
||||
return EBUSY;
|
||||
opp = &olp->d_partitions[i];
|
||||
npp = &nlp->d_partitions[i];
|
||||
if (npp->p_offset != opp->p_offset || npp->p_size < opp->p_size)
|
||||
return (EBUSY);
|
||||
return EBUSY;
|
||||
/*
|
||||
* Copy internally-set partition information
|
||||
* if new label doesn't include it. XXX
|
||||
@ -317,7 +311,7 @@ setdisklabel(olp, nlp, openmask, osdep)
|
||||
nlp->d_checksum = 0;
|
||||
nlp->d_checksum = dkcksum(nlp);
|
||||
*olp = *nlp;
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -325,11 +319,8 @@ setdisklabel(olp, nlp, openmask, osdep)
|
||||
* Write disk label back to device after modification.
|
||||
*/
|
||||
int
|
||||
writedisklabel(dev, strat, lp, osdep)
|
||||
dev_t dev;
|
||||
void (*strat) __P((struct buf *));
|
||||
struct disklabel *lp;
|
||||
struct cpu_disklabel *osdep;
|
||||
writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp,
|
||||
struct cpu_disklabel *osdep)
|
||||
{
|
||||
struct mbr_partition *dp;
|
||||
struct buf *bp;
|
||||
@ -369,7 +360,7 @@ writedisklabel(dev, strat, lp, osdep)
|
||||
}
|
||||
}
|
||||
|
||||
nombrpart:
|
||||
nombrpart:
|
||||
/* next, dig out disk label */
|
||||
bp->b_blkno = dospartoff + LABELSECTOR;
|
||||
bp->b_cylinder = cyl;
|
||||
@ -382,7 +373,8 @@ nombrpart:
|
||||
if ((error = biowait(bp)) != 0)
|
||||
goto done;
|
||||
for (dlp = (struct disklabel *)bp->b_data;
|
||||
dlp <= (struct disklabel *)(bp->b_data + lp->d_secsize - sizeof(*dlp));
|
||||
dlp <= (struct disklabel *)(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) {
|
||||
@ -396,9 +388,9 @@ nombrpart:
|
||||
}
|
||||
error = ESRCH;
|
||||
|
||||
done:
|
||||
done:
|
||||
brelse(bp);
|
||||
return (error);
|
||||
return error;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -407,10 +399,7 @@ done:
|
||||
* if needed, and signal errors or early completion.
|
||||
*/
|
||||
int
|
||||
bounds_check_with_label(dk, bp, wlabel)
|
||||
struct disk *dk;
|
||||
struct buf *bp;
|
||||
int wlabel;
|
||||
bounds_check_with_label(struct disk *dk, struct buf *bp, int wlabel)
|
||||
{
|
||||
struct disklabel *lp = dk->dk_label;
|
||||
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
|
||||
@ -424,7 +413,7 @@ bounds_check_with_label(dk, bp, wlabel)
|
||||
if (sz == 0) {
|
||||
/* If exactly at end of disk, return EOF. */
|
||||
bp->b_resid = bp->b_bcount;
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
if (sz < 0) {
|
||||
/* If past end of disk, return EINVAL. */
|
||||
@ -448,9 +437,9 @@ bounds_check_with_label(dk, bp, wlabel)
|
||||
/* calculate cylinder for disksort to order transfers with */
|
||||
bp->b_cylinder = (bp->b_blkno + p->p_offset) /
|
||||
(lp->d_secsize / DEV_BSIZE) / lp->d_secpercyl;
|
||||
return (1);
|
||||
return 1;
|
||||
|
||||
bad:
|
||||
bad:
|
||||
bp->b_flags |= B_ERROR;
|
||||
return (-1);
|
||||
return -1;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: machdep.c,v 1.56 2005/12/24 20:06:58 perry Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.57 2006/04/05 15:03:27 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2000 Soren S. Jorvang. All rights reserved.
|
||||
@ -26,7 +26,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.56 2005/12/24 20:06:58 perry Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.57 2006/04/05 15:03:27 tsutsui Exp $");
|
||||
|
||||
#include "opt_ddb.h"
|
||||
#include "opt_kgdb.h"
|
||||
@ -127,10 +127,7 @@ extern struct user *proc0paddr;
|
||||
* Do all the stuff that locore normally does before calling main().
|
||||
*/
|
||||
void
|
||||
mach_init(memsize, bim, bip)
|
||||
unsigned int memsize;
|
||||
u_int bim;
|
||||
char *bip;
|
||||
mach_init(unsigned int memsize, u_int bim, char *bip)
|
||||
{
|
||||
caddr_t kernend, v;
|
||||
u_long first, last;
|
||||
@ -238,7 +235,7 @@ mach_init(memsize, bim, bip)
|
||||
first = round_page(MIPS_KSEG0_TO_PHYS(kernend));
|
||||
last = mem_clusters[0].start + mem_clusters[0].size;
|
||||
uvm_page_physload(atop(first), atop(last), atop(first), atop(last),
|
||||
VM_FREELIST_DEFAULT);
|
||||
VM_FREELIST_DEFAULT);
|
||||
|
||||
/*
|
||||
* Initialize error message buffer (at end of core).
|
||||
@ -261,7 +258,7 @@ mach_init(memsize, bim, bip)
|
||||
* Allocate memory for variable-sized tables,
|
||||
*/
|
||||
void
|
||||
cpu_startup()
|
||||
cpu_startup(void)
|
||||
{
|
||||
vaddr_t minaddr, maxaddr;
|
||||
char pbuf[9];
|
||||
@ -279,12 +276,12 @@ cpu_startup()
|
||||
* limits the number of processes exec'ing at any time.
|
||||
*/
|
||||
exec_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
|
||||
16 * NCARGS, VM_MAP_PAGEABLE, FALSE, NULL);
|
||||
16 * NCARGS, VM_MAP_PAGEABLE, FALSE, NULL);
|
||||
/*
|
||||
* Allocate a submap for physio.
|
||||
*/
|
||||
phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
|
||||
VM_PHYS_SIZE, 0, FALSE, NULL);
|
||||
VM_PHYS_SIZE, 0, FALSE, NULL);
|
||||
|
||||
/*
|
||||
* (No need to allocate an mbuf cluster submap. Mbuf clusters
|
||||
@ -299,10 +296,9 @@ cpu_startup()
|
||||
int waittime = -1;
|
||||
|
||||
void
|
||||
cpu_reboot(howto, bootstr)
|
||||
int howto;
|
||||
char *bootstr;
|
||||
cpu_reboot(int howto, char *bootstr)
|
||||
{
|
||||
|
||||
/* Take a snapshot before clobbering any registers. */
|
||||
if (curlwp)
|
||||
savectx((struct user *)curpcb);
|
||||
@ -333,7 +329,7 @@ cpu_reboot(howto, bootstr)
|
||||
if (howto & RB_DUMP)
|
||||
dumpsys();
|
||||
|
||||
haltsys:
|
||||
haltsys:
|
||||
doshutdownhooks();
|
||||
|
||||
if (howto & RB_HALT) {
|
||||
@ -351,14 +347,14 @@ haltsys:
|
||||
*(volatile char *)MIPS_PHYS_TO_KSEG1(LED_ADDR) = LED_RESET;
|
||||
printf("WARNING: reboot failed!\n");
|
||||
|
||||
for (;;);
|
||||
for (;;)
|
||||
;
|
||||
}
|
||||
|
||||
unsigned long cpuspeed;
|
||||
|
||||
inline void
|
||||
delay(n)
|
||||
unsigned long n;
|
||||
delay(unsigned long n)
|
||||
{
|
||||
volatile register long N = cpuspeed * n;
|
||||
|
||||
@ -369,7 +365,7 @@ delay(n)
|
||||
|
||||
static struct cobalt_intrhand intrtab[NINTR];
|
||||
|
||||
const u_int32_t mips_ipl_si_to_sr[_IPL_NSOFT] = {
|
||||
const uint32_t mips_ipl_si_to_sr[_IPL_NSOFT] = {
|
||||
MIPS_SOFT_INT_MASK_0, /* IPL_SOFT */
|
||||
MIPS_SOFT_INT_MASK_0, /* IPL_SOFTCLOCK */
|
||||
MIPS_SOFT_INT_MASK_1, /* IPL_SOFTNET */
|
||||
@ -377,12 +373,9 @@ const u_int32_t mips_ipl_si_to_sr[_IPL_NSOFT] = {
|
||||
};
|
||||
|
||||
void *
|
||||
cpu_intr_establish(level, ipl, func, arg)
|
||||
int level;
|
||||
int ipl;
|
||||
int (*func)(void *);
|
||||
void *arg;
|
||||
cpu_intr_establish(int level, int ipl, int (*func)(void *), void *arg)
|
||||
{
|
||||
|
||||
if (level < 0 || level >= NINTR)
|
||||
panic("invalid interrupt level");
|
||||
|
||||
@ -397,8 +390,7 @@ cpu_intr_establish(level, ipl, func, arg)
|
||||
}
|
||||
|
||||
void
|
||||
cpu_intr_disestablish(cookie)
|
||||
void *cookie;
|
||||
cpu_intr_disestablish(void *cookie)
|
||||
{
|
||||
struct cobalt_intrhand *ih = cookie;
|
||||
|
||||
@ -409,21 +401,17 @@ cpu_intr_disestablish(cookie)
|
||||
}
|
||||
|
||||
void
|
||||
cpu_intr(status, cause, pc, ipending)
|
||||
u_int32_t status;
|
||||
u_int32_t cause;
|
||||
u_int32_t pc;
|
||||
u_int32_t ipending;
|
||||
cpu_intr(uint32_t status, uint32_t cause, uint32_t pc, uint32_t ipending)
|
||||
{
|
||||
struct clockframe cf;
|
||||
static u_int32_t cycles;
|
||||
static uint32_t cycles;
|
||||
int i;
|
||||
|
||||
uvmexp.intrs++;
|
||||
|
||||
if (ipending & MIPS_INT_MASK_0) {
|
||||
volatile u_int32_t *irq_src =
|
||||
(u_int32_t *)MIPS_PHYS_TO_KSEG1(0x14000c18);
|
||||
volatile uint32_t *irq_src =
|
||||
(uint32_t *)MIPS_PHYS_TO_KSEG1(0x14000c18);
|
||||
|
||||
if (*irq_src & 0x00000100) {
|
||||
*irq_src = 0;
|
||||
@ -472,8 +460,8 @@ cpu_intr(status, cause, pc, ipending)
|
||||
void
|
||||
decode_bootstring(void)
|
||||
{
|
||||
char * work;
|
||||
char * equ;
|
||||
char *work;
|
||||
char *equ;
|
||||
int i;
|
||||
|
||||
/* break apart bootstring on ' ' boundries and itterate*/
|
||||
@ -523,13 +511,11 @@ decode_bootstring(void)
|
||||
|
||||
|
||||
static char *
|
||||
strtok_light(str, sep)
|
||||
char * str;
|
||||
const char sep;
|
||||
strtok_light(char *str, const char sep)
|
||||
{
|
||||
static char * proc;
|
||||
char * head;
|
||||
char * work;
|
||||
static char *proc;
|
||||
char *head;
|
||||
char *work;
|
||||
|
||||
if (str != NULL)
|
||||
proc = str;
|
||||
@ -553,8 +539,7 @@ strtok_light(str, sep)
|
||||
* Look up information in bootinfo of boot loader.
|
||||
*/
|
||||
void *
|
||||
lookup_bootinfo(type)
|
||||
int type;
|
||||
lookup_bootinfo(int type)
|
||||
{
|
||||
struct btinfo_common *bt;
|
||||
char *help = bootinfo;
|
||||
@ -562,17 +547,17 @@ lookup_bootinfo(type)
|
||||
/* Check for a bootinfo record first. */
|
||||
if (help == NULL) {
|
||||
printf("##### help == NULL\n");
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
do {
|
||||
bt = (struct btinfo_common *)help;
|
||||
printf("Type %d @0x%x\n", bt->type, (u_int)bt);
|
||||
if (bt->type == type)
|
||||
return ((void *)help);
|
||||
return (void *)help;
|
||||
help += bt->next;
|
||||
} while (bt->next != 0 &&
|
||||
(size_t)help < (size_t)bootinfo + BOOTINFO_SIZE);
|
||||
(size_t)help < (size_t)bootinfo + BOOTINFO_SIZE);
|
||||
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: mainbus.c,v 1.13 2005/12/11 12:17:05 christos Exp $ */
|
||||
/* $NetBSD: mainbus.c,v 1.14 2006/04/05 15:03:27 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2000 Soren S. Jorvang. All rights reserved.
|
||||
@ -26,7 +26,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.13 2005/12/11 12:17:05 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.14 2006/04/05 15:03:27 tsutsui Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -48,19 +48,14 @@ CFATTACH_DECL(mainbus, sizeof(struct device),
|
||||
mainbus_match, mainbus_attach, NULL, NULL);
|
||||
|
||||
static int
|
||||
mainbus_match(parent, match, aux)
|
||||
struct device *parent;
|
||||
struct cfdata *match;
|
||||
void *aux;
|
||||
mainbus_match(struct device *parent, struct cfdata *match, void *aux)
|
||||
{
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
mainbus_attach(parent, self, aux)
|
||||
struct device *parent;
|
||||
struct device *self;
|
||||
void *aux;
|
||||
mainbus_attach(struct device *parent, struct device *self, void *aux)
|
||||
{
|
||||
struct mainbus_attach_args ma;
|
||||
|
||||
@ -74,11 +69,8 @@ mainbus_attach(parent, self, aux)
|
||||
}
|
||||
|
||||
static int
|
||||
mainbus_search(parent, cf, ldesc, aux)
|
||||
struct device *parent;
|
||||
struct cfdata *cf;
|
||||
const int *ldesc;
|
||||
void *aux;
|
||||
mainbus_search(struct device *parent, struct cfdata *cf, const int *ldesc,
|
||||
void *aux)
|
||||
{
|
||||
struct mainbus_attach_args *ma = aux;
|
||||
|
||||
@ -95,9 +87,7 @@ mainbus_search(parent, cf, ldesc, aux)
|
||||
}
|
||||
|
||||
int
|
||||
mainbus_print(aux, pnp)
|
||||
void *aux;
|
||||
const char *pnp;
|
||||
mainbus_print(void *aux, const char *pnp)
|
||||
{
|
||||
struct mainbus_attach_args *ma = aux;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user