- use POSIX integer types

- ansify functions
This commit is contained in:
cegger 2008-04-14 13:38:03 +00:00
parent 3e3ad32c16
commit 7f5c40b741
14 changed files with 73 additions and 73 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: hypervisor.h,v 1.24 2007/11/22 16:16:57 bouyer Exp $ */
/* $NetBSD: hypervisor.h,v 1.25 2008/04/14 13:38:03 cegger Exp $ */
/*
* Copyright (c) 2006 Manuel Bouyer.
@ -140,7 +140,7 @@ void hypervisor_unmask_event(unsigned int);
void hypervisor_mask_event(unsigned int);
void hypervisor_clear_event(unsigned int);
void hypervisor_enable_ipl(unsigned int);
void hypervisor_set_ipending(u_int32_t, int, int);
void hypervisor_set_ipending(uint32_t, int, int);
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: i82093var.h,v 1.1 2006/09/28 18:53:15 bouyer Exp $ */
/* $NetBSD: i82093var.h,v 1.2 2008/04/14 13:38:03 cegger Exp $ */
#include "opt_xen.h"
#define _IOAPIC_CUSTOM_RW
@ -7,7 +7,7 @@
#ifdef XEN3
static inline u_int32_t
static inline uint32_t
ioapic_read_ul(struct ioapic_softc *sc, int regid)
{
physdev_op_t op;
@ -25,7 +25,7 @@ ioapic_read_ul(struct ioapic_softc *sc, int regid)
}
static inline void
ioapic_write_ul(struct ioapic_softc *sc, int regid, u_int32_t val)
ioapic_write_ul(struct ioapic_softc *sc, int regid, uint32_t val)
{
physdev_op_t op;
int ret;

View File

@ -1,4 +1,4 @@
/* $NetBSD: intr.h,v 1.23 2008/02/19 19:50:53 bouyer Exp $ */
/* $NetBSD: intr.h,v 1.24 2008/04/14 13:38:03 cegger Exp $ */
/* NetBSD intr.h,v 1.15 2004/10/31 10:39:34 yamt Exp */
/*-
@ -57,7 +57,7 @@
struct evtsource {
int ev_maxlevel; /* max. IPL for this source */
u_int32_t ev_imask; /* interrupt mask */
uint32_t ev_imask; /* interrupt mask */
struct intrhand *ev_handlers; /* handler chain */
struct evcnt ev_evcnt; /* interrupt counter */
char ev_evname[32]; /* event counter name */

View File

@ -1,4 +1,4 @@
/* $NetBSD: pci_machdep.h,v 1.7 2006/09/28 18:53:15 bouyer Exp $ */
/* $NetBSD: pci_machdep.h,v 1.8 2008/04/14 13:38:03 cegger Exp $ */
/*
* Copyright (c) 2006 Manuel Bouyer.
@ -75,11 +75,11 @@ extern struct x86_bus_dma_tag pci_bus_dma64_tag;
#ifdef XEN3
union x86_pci_tag_u {
u_int32_t mode1;
uint32_t mode1;
struct {
u_int16_t port;
u_int8_t enable;
u_int8_t forward;
uint16_t port;
uint8_t enable;
uint8_t forward;
} mode2;
};
@ -87,16 +87,16 @@ typedef union x86_pci_tag_u pcitag_t;
#else /* XEN3 */
extern u_int32_t pci_bus_attached[];
extern uint32_t pci_bus_attached[];
#define PCI_MACHDEP_ENUMERATE_BUS xen_pci_enumerate_bus
/* types provided to MI PCI */
struct xen_pci_tag {
u_int8_t bus;
u_int8_t device;
u_int8_t function;
u_int8_t _pad; /* pad to 32bits */
uint8_t bus;
uint8_t device;
uint8_t function;
uint8_t _pad; /* pad to 32bits */
};
typedef struct xen_pci_tag pcitag_t;

View File

@ -1,4 +1,4 @@
/* $NetBSD: hypervisor_machdep.c,v 1.6 2008/02/19 19:50:53 bouyer Exp $ */
/* $NetBSD: hypervisor_machdep.c,v 1.7 2008/04/14 13:38:03 cegger Exp $ */
/*
*
@ -59,7 +59,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: hypervisor_machdep.c,v 1.6 2008/02/19 19:50:53 bouyer Exp $");
__KERNEL_RCSID(0, "$NetBSD: hypervisor_machdep.c,v 1.7 2008/04/14 13:38:03 cegger Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -75,7 +75,7 @@ __KERNEL_RCSID(0, "$NetBSD: hypervisor_machdep.c,v 1.6 2008/02/19 19:50:53 bouye
int stipending(void);
int
stipending()
stipending(void)
{
unsigned long l1;
unsigned long l2;
@ -333,7 +333,7 @@ hypervisor_enable_ipl(unsigned int ipl)
}
void
hypervisor_set_ipending(u_int32_t iplmask, int l1, int l2)
hypervisor_set_ipending(uint32_t iplmask, int l1, int l2)
{
int ipl;
struct cpu_info *ci = curcpu();

View File

@ -1,4 +1,4 @@
/* $NetBSD: x86_xpmap.c,v 1.7 2008/02/17 17:39:42 bouyer Exp $ */
/* $NetBSD: x86_xpmap.c,v 1.8 2008/04/14 13:38:03 cegger Exp $ */
/*
* Copyright (c) 2006 Mathieu Ropert <mro@adviseo.fr>
@ -79,7 +79,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: x86_xpmap.c,v 1.7 2008/02/17 17:39:42 bouyer Exp $");
__KERNEL_RCSID(0, "$NetBSD: x86_xpmap.c,v 1.8 2008/04/14 13:38:03 cegger Exp $");
#include "opt_xen.h"
#include "opt_ddb.h"
@ -180,21 +180,21 @@ static mmu_update_t xpq_queue[XPQUEUE_SIZE];
static int xpq_idx = 0;
void
xpq_flush_queue()
xpq_flush_queue(void)
{
int i, ok;
XENPRINTK2(("flush queue %p entries %d\n", xpq_queue, xpq_idx));
for (i = 0; i < xpq_idx; i++)
XENPRINTK2(("%d: %p %08" PRIx64 "\n", i,
(u_int64_t)xpq_queue[i].ptr, (u_int64_t)xpq_queue[i].val));
(uint64_t)xpq_queue[i].ptr, (uint64_t)xpq_queue[i].val));
if (xpq_idx != 0 &&
HYPERVISOR_mmu_update_self(xpq_queue, xpq_idx, &ok) < 0) {
printf("xpq_flush_queue: %d entries \n", xpq_idx);
for (i = 0; i < xpq_idx; i++)
printf("0x%016" PRIx64 ": 0x%016" PRIx64 "\n",
(u_int64_t)xpq_queue[i].ptr,
(u_int64_t)xpq_queue[i].val);
(uint64_t)xpq_queue[i].ptr,
(uint64_t)xpq_queue[i].val);
panic("HYPERVISOR_mmu_update failed\n");
}
xpq_idx = 0;
@ -316,7 +316,7 @@ xpq_queue_set_ldt(vaddr_t va, uint32_t entries)
}
void
xpq_queue_tlb_flush()
xpq_queue_tlb_flush(void)
{
struct mmuext_op op;
xpq_flush_queue();
@ -328,7 +328,7 @@ xpq_queue_tlb_flush()
}
void
xpq_flush_cache()
xpq_flush_cache(void)
{
struct mmuext_op op;
int s = splvm();
@ -410,7 +410,7 @@ xpq_queue_set_ldt(vaddr_t va, uint32_t entries)
}
void
xpq_queue_tlb_flush()
xpq_queue_tlb_flush(void)
{
XENPRINTK2(("xpq_queue_tlb_flush\n"));
@ -420,7 +420,7 @@ xpq_queue_tlb_flush()
}
void
xpq_flush_cache()
xpq_flush_cache(void)
{
int s = splvm();
@ -459,23 +459,23 @@ xpq_update_foreign(paddr_t ptr, pt_entry_t val, int dom)
#ifdef XENDEBUG
void
xpq_debug_dump()
xpq_debug_dump(void)
{
int i;
XENPRINTK2(("idx: %d\n", xpq_idx));
for (i = 0; i < xpq_idx; i++) {
sprintf(XBUF, "%" PRIx64 " %08" PRIx64,
(u_int64_t)xpq_queue[i].ptr, (u_int64_t)xpq_queue[i].val);
(uint64_t)xpq_queue[i].ptr, (uint64_t)xpq_queue[i].val);
if (++i < xpq_idx)
sprintf(XBUF + strlen(XBUF), "%" PRIx64 " %08" PRIx64,
(u_int64_t)xpq_queue[i].ptr, (u_int64_t)xpq_queue[i].val);
(uint64_t)xpq_queue[i].ptr, (uint64_t)xpq_queue[i].val);
if (++i < xpq_idx)
sprintf(XBUF + strlen(XBUF), "%" PRIx64 " %08" PRIx64,
(u_int64_t)xpq_queue[i].ptr, (u_int64_t)xpq_queue[i].val);
(uint64_t)xpq_queue[i].ptr, (uint64_t)xpq_queue[i].val);
if (++i < xpq_idx)
sprintf(XBUF + strlen(XBUF), "%" PRIx64 " %08" PRIx64,
(u_int64_t)xpq_queue[i].ptr, (u_int64_t)xpq_queue[i].val);
(uint64_t)xpq_queue[i].ptr, (uint64_t)xpq_queue[i].val);
XENPRINTK2(("%d: %s\n", xpq_idx, XBUF));
}
}
@ -520,7 +520,7 @@ static const int l2_4_count = PTP_LEVELS - 1;
#endif
vaddr_t
xen_pmap_bootstrap()
xen_pmap_bootstrap(void)
{
int count, oldcount;
long mapsize;
@ -703,7 +703,7 @@ xen_bootstrap_tables (vaddr_t old_pgd, vaddr_t new_pgd,
xpmap_ptom_masked(addr) | PG_k | PG_RW | PG_V;
__PRINTK(("L3 va 0x%lx pa 0x%" PRIx64 " entry 0x%" PRIx64 " -> L4[0x%x]\n",
pdtpe, (u_int64_t)addr, (u_int64_t)bt_pgd[pl4_pi(KERNTEXTOFF)],
pdtpe, (uint64_t)addr, (uint64_t)bt_pgd[pl4_pi(KERNTEXTOFF)],
pl4_pi(KERNTEXTOFF)));
#else
pdtpe = bt_pgd;

View File

@ -1,4 +1,4 @@
/* $NetBSD: xen_intr.c,v 1.2 2007/11/22 16:17:05 bouyer Exp $ */
/* $NetBSD: xen_intr.c,v 1.3 2008/04/14 13:38:03 cegger Exp $ */
/*-
* Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: xen_intr.c,v 1.2 2007/11/22 16:17:05 bouyer Exp $");
__KERNEL_RCSID(0, "$NetBSD: xen_intr.c,v 1.3 2008/04/14 13:38:03 cegger Exp $");
#include <sys/param.h>
@ -68,7 +68,7 @@ void
spllower(int nlevel)
{
struct cpu_info *ci = curcpu();
u_int32_t imask;
uint32_t imask;
u_long psl;
__insn_barrier();

View File

@ -1,4 +1,4 @@
/* $NetBSD: clock.c,v 1.44 2008/01/17 01:56:02 lukem Exp $ */
/* $NetBSD: clock.c,v 1.45 2008/04/14 13:38:03 cegger Exp $ */
/*
*
@ -34,7 +34,7 @@
#include "opt_xen.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.44 2008/01/17 01:56:02 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.45 2008/04/14 13:38:03 cegger Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -333,7 +333,7 @@ xen_rtc_set(todr_chip_handle_t todr, volatile struct timeval *tvp)
}
void
startrtclock()
startrtclock(void)
{
static struct todr_chip_handle tch;
tch.todr_gettime = xen_rtc_get;
@ -355,11 +355,11 @@ xen_delay(unsigned int n)
* precise enouth for short delays. Use the CPU counter
* instead. We assume it's working at this point.
*/
u_int64_t cc, cc2, when;
uint64_t cc, cc2, when;
struct cpu_info *ci = curcpu();
cc = cpu_counter();
when = cc + (u_int64_t)n * cpu_frequency(ci) / 1000000LL;
when = cc + (uint64_t)n * cpu_frequency(ci) / 1000000LL;
if (when < cc) {
/* wait for counter to wrap */
cc2 = cpu_counter();
@ -443,7 +443,7 @@ xen_get_timecount(struct timecounter *tc)
}
void
xen_initclocks()
xen_initclocks(void)
{
int evtch;

View File

@ -1,4 +1,4 @@
/* $NetBSD: evtchn.c,v 1.34 2008/04/06 07:24:20 cegger Exp $ */
/* $NetBSD: evtchn.c,v 1.35 2008/04/14 13:38:03 cegger Exp $ */
/*
* Copyright (c) 2006 Manuel Bouyer.
@ -64,7 +64,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.34 2008/04/06 07:24:20 cegger Exp $");
__KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.35 2008/04/14 13:38:03 cegger Exp $");
#include "opt_xen.h"
#include "isa.h"
@ -100,7 +100,7 @@ static struct simplelock irq_mapping_update_lock = SIMPLELOCK_INITIALIZER;
struct evtsource *evtsource[NR_EVENT_CHANNELS];
/* Reference counts for bindings to event channels */
static u_int8_t evtch_bindcount[NR_EVENT_CHANNELS];
static uint8_t evtch_bindcount[NR_EVENT_CHANNELS];
/* event-channel <-> VIRQ mapping. */
static int virq_to_evtch[NR_VIRQS];
@ -110,7 +110,7 @@ static int virq_to_evtch[NR_VIRQS];
/* event-channel <-> PIRQ mapping */
static int pirq_to_evtch[NR_PIRQS];
/* PIRQ needing notify */
static u_int32_t pirq_needs_unmask_notify[NR_EVENT_CHANNELS / 32];
static uint32_t pirq_needs_unmask_notify[NR_EVENT_CHANNELS / 32];
int pirq_interrupt(void *);
physdev_op_t physdev_op_notify = {
.cmd = PHYSDEVOP_IRQ_UNMASK_NOTIFY,
@ -189,9 +189,9 @@ evtchn_do_event(int evtch, struct intrframe *regs)
struct intrhand *ih;
int (*ih_fun)(void *, void *);
extern struct uvmexp uvmexp;
u_int32_t iplmask;
uint32_t iplmask;
int i;
u_int32_t iplbit;
uint32_t iplbit;
#ifdef DIAGNOSTIC
if (evtch >= NR_EVENT_CHANNELS) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: hypervisor.c,v 1.34 2008/04/06 07:24:20 cegger Exp $ */
/* $NetBSD: hypervisor.c,v 1.35 2008/04/14 13:38:03 cegger Exp $ */
/*
* Copyright (c) 2005 Manuel Bouyer.
@ -63,7 +63,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: hypervisor.c,v 1.34 2008/04/06 07:24:20 cegger Exp $");
__KERNEL_RCSID(0, "$NetBSD: hypervisor.c,v 1.35 2008/04/14 13:38:03 cegger Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -330,9 +330,9 @@ hypervisor_attach(parent, self, aux)
printf("0x%x ", physdev_op.u.pci_probe_root_buses.busmask[i]);
printf("\n");
#endif
memset(pci_bus_attached, 0, sizeof(u_int32_t) * 256 / 32);
memset(pci_bus_attached, 0, sizeof(uint32_t) * 256 / 32);
for (i = 0, busnum = 0; i < 256/32; i++) {
u_int32_t mask =
uint32_t mask =
physdev_op.u.pci_probe_root_buses.busmask[i];
for (j = 0; j < 32; j++, busnum++) {
if ((mask & (1 << j)) == 0)

View File

@ -1,4 +1,4 @@
/* $NetBSD: pci_machdep.c,v 1.12 2008/02/17 14:03:16 bouyer Exp $ */
/* $NetBSD: pci_machdep.c,v 1.13 2008/04/14 13:38:03 cegger Exp $ */
/*
* Copyright (c) 2005 Manuel Bouyer.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.12 2008/02/17 14:03:16 bouyer Exp $");
__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.13 2008/04/14 13:38:03 cegger Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -47,7 +47,7 @@ __KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.12 2008/02/17 14:03:16 bouyer Exp
#include "opt_ddb.h"
/* mask of already-known busses */
u_int32_t pci_bus_attached[256 / 32];
uint32_t pci_bus_attached[256 / 32];
struct x86_bus_dma_tag pci_bus_dma_tag = {
0, /* _tag_needs_free */

View File

@ -1,4 +1,4 @@
/* $NetBSD: xenevt.c,v 1.25 2008/03/22 14:28:10 ad Exp $ */
/* $NetBSD: xenevt.c,v 1.26 2008/04/14 13:38:03 cegger Exp $ */
/*
* Copyright (c) 2005 Manuel Bouyer.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: xenevt.c,v 1.25 2008/03/22 14:28:10 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: xenevt.c,v 1.26 2008/04/14 13:38:03 cegger Exp $");
#include "opt_xen.h"
#include <sys/param.h>
@ -141,8 +141,8 @@ static void xenevt_record(struct xenevt_d *, evtchn_port_t);
long xenevt_ev1;
long xenevt_ev2[NR_EVENT_CHANNELS];
#else
u_int32_t xenevt_ev1;
u_int32_t xenevt_ev2[NR_EVENT_CHANNELS];
uint32_t xenevt_ev1;
uint32_t xenevt_ev2[NR_EVENT_CHANNELS];
#endif
static int xenevt_processevt(void *);
@ -476,15 +476,15 @@ xenevt_fwrite(struct file *fp, off_t *offp, struct uio *uio,
kauth_cred_t cred, int flags)
{
struct xenevt_d *d = fp->f_data;
u_int16_t *chans;
uint16_t *chans;
int i, nentries, error;
if (uio->uio_resid == 0)
return (0);
nentries = uio->uio_resid / sizeof(u_int16_t);
nentries = uio->uio_resid / sizeof(uint16_t);
if (nentries > NR_EVENT_CHANNELS)
return EMSGSIZE;
chans = kmem_alloc(nentries * sizeof(u_int16_t), KM_SLEEP);
chans = kmem_alloc(nentries * sizeof(uint16_t), KM_SLEEP);
if (chans == NULL)
return ENOMEM;
error = uiomove(chans, uio->uio_resid, uio);
@ -497,7 +497,7 @@ xenevt_fwrite(struct file *fp, off_t *offp, struct uio *uio,
}
}
out:
kmem_free(chans, nentries * sizeof(u_int16_t));
kmem_free(chans, nentries * sizeof(uint16_t));
return 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: xennetback.c,v 1.31 2008/02/17 14:03:16 bouyer Exp $ */
/* $NetBSD: xennetback.c,v 1.32 2008/04/14 13:38:03 cegger Exp $ */
/*
* Copyright (c) 2005 Manuel Bouyer.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: xennetback.c,v 1.31 2008/02/17 14:03:16 bouyer Exp $");
__KERNEL_RCSID(0, "$NetBSD: xennetback.c,v 1.32 2008/04/14 13:38:03 cegger Exp $");
#include "opt_xen.h"
@ -127,7 +127,7 @@ struct xnetback_instance {
/* network interface stuff */
struct ethercom xni_ec;
struct callout xni_restart;
u_int8_t xni_enaddr[ETHER_ADDR_LEN];
uint8_t xni_enaddr[ETHER_ADDR_LEN];
/* remote domain communication stuff */
unsigned int xni_evtchn;

View File

@ -1,4 +1,4 @@
/* $NetBSD: xennetback_xenbus.c,v 1.21 2007/12/03 15:34:31 ad Exp $ */
/* $NetBSD: xennetback_xenbus.c,v 1.22 2008/04/14 13:38:03 cegger Exp $ */
/*
* Copyright (c) 2006 Manuel Bouyer.
@ -114,7 +114,7 @@ struct xnetback_instance {
/* network interface stuff */
struct ethercom xni_ec;
struct callout xni_restart;
u_int8_t xni_enaddr[ETHER_ADDR_LEN];
uint8_t xni_enaddr[ETHER_ADDR_LEN];
/* remote domain communication stuff */
unsigned int xni_evtchn; /* our even channel */