De-lint, cleanup.

This commit is contained in:
thorpej 2001-07-17 17:46:42 +00:00
parent 36faa88260
commit f9c5bef128
4 changed files with 76 additions and 106 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: alpha_bus_window.c,v 1.1 2000/02/26 18:59:36 thorpej Exp $ */ /* $NetBSD: alpha_bus_window.c,v 1.2 2001/07/17 17:46:42 thorpej Exp $ */
/*- /*-
* Copyright (c) 2000 The NetBSD Foundation, Inc. * Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -54,9 +54,7 @@
#include <unistd.h> #include <unistd.h>
int int
alpha_bus_getwindows(type, abwp) alpha_bus_getwindows(int type, struct alpha_bus_window **abwp)
int type;
struct alpha_bus_window **abwp;
{ {
struct alpha_bus_get_window_count_args count_args; struct alpha_bus_get_window_count_args count_args;
struct alpha_bus_get_window_args window_args; struct alpha_bus_get_window_args window_args;
@ -87,8 +85,7 @@ alpha_bus_getwindows(type, abwp)
} }
int int
alpha_bus_mapwindow(abw) alpha_bus_mapwindow(struct alpha_bus_window *abw)
struct alpha_bus_window *abw;
{ {
struct alpha_bus_space_translation *abst = &abw->abw_abst; struct alpha_bus_space_translation *abst = &abw->abw_abst;
void *addr; void *addr;
@ -117,8 +114,7 @@ alpha_bus_mapwindow(abw)
} }
void void
alpha_bus_unmapwindow(abw) alpha_bus_unmapwindow(struct alpha_bus_window *abw)
struct alpha_bus_window *abw;
{ {
(void) munmap(abw->abw_addr, abw->abw_size); (void) munmap(abw->abw_addr, abw->abw_size);

View File

@ -1,4 +1,4 @@
/* $NetBSD: alpha_pci_conf.c,v 1.1 2000/02/26 18:59:36 thorpej Exp $ */ /* $NetBSD: alpha_pci_conf.c,v 1.2 2001/07/17 17:46:42 thorpej Exp $ */
/*- /*-
* Copyright (c) 2000 The NetBSD Foundation, Inc. * Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -46,9 +46,8 @@
#include <machine/sysarch.h> #include <machine/sysarch.h>
u_int32_t uint32_t
alpha_pci_conf_read(bus, device, func, reg) alpha_pci_conf_read(u_int bus, u_int device, u_int func, u_int reg)
u_int bus, device, func, reg;
{ {
struct alpha_pci_conf_readwrite_args args; struct alpha_pci_conf_readwrite_args args;
@ -65,9 +64,8 @@ alpha_pci_conf_read(bus, device, func, reg)
} }
void void
alpha_pci_conf_write(bus, device, func, reg, val) alpha_pci_conf_write(u_int bus, u_int device, u_int func, u_int reg,
u_int bus, device, func, reg; uint32_t val)
u_int32_t val;
{ {
struct alpha_pci_conf_readwrite_args args; struct alpha_pci_conf_readwrite_args args;

View File

@ -1,4 +1,4 @@
/* $NetBSD: alpha_pci_io.c,v 1.1 2000/02/26 18:59:36 thorpej Exp $ */ /* $NetBSD: alpha_pci_io.c,v 1.2 2001/07/17 17:46:42 thorpej Exp $ */
/*- /*-
* Copyright (c) 2000 The NetBSD Foundation, Inc. * Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -54,15 +54,12 @@
struct alpha_bus_window *alpha_pci_io_windows; struct alpha_bus_window *alpha_pci_io_windows;
int alpha_pci_io_window_count; int alpha_pci_io_window_count;
__inline struct alpha_bus_window *alpha_pci_io_findwindow __P((bus_addr_t)); uint8_t alpha_pci_io_swiz_inb(bus_addr_t);
__inline u_int32_t *alpha_pci_io_swiz __P((bus_addr_t, int)); uint16_t alpha_pci_io_swiz_inw(bus_addr_t);
uint32_t alpha_pci_io_swiz_inl(bus_addr_t);
u_int8_t alpha_pci_io_swiz_inb __P((bus_addr_t)); void alpha_pci_io_swiz_outb(bus_addr_t, uint8_t);
u_int16_t alpha_pci_io_swiz_inw __P((bus_addr_t)); void alpha_pci_io_swiz_outw(bus_addr_t, uint16_t);
u_int32_t alpha_pci_io_swiz_inl __P((bus_addr_t)); void alpha_pci_io_swiz_outl(bus_addr_t, uint32_t);
void alpha_pci_io_swiz_outb __P((bus_addr_t, u_int8_t));
void alpha_pci_io_swiz_outw __P((bus_addr_t, u_int16_t));
void alpha_pci_io_swiz_outl __P((bus_addr_t, u_int32_t));
const struct alpha_pci_io_ops alpha_pci_io_swiz_ops = { const struct alpha_pci_io_ops alpha_pci_io_swiz_ops = {
alpha_pci_io_swiz_inb, alpha_pci_io_swiz_inb,
@ -73,12 +70,12 @@ const struct alpha_pci_io_ops alpha_pci_io_swiz_ops = {
alpha_pci_io_swiz_outl, alpha_pci_io_swiz_outl,
}; };
u_int8_t alpha_pci_io_bwx_inb __P((bus_addr_t)); uint8_t alpha_pci_io_bwx_inb(bus_addr_t);
u_int16_t alpha_pci_io_bwx_inw __P((bus_addr_t)); uint16_t alpha_pci_io_bwx_inw(bus_addr_t);
u_int32_t alpha_pci_io_bwx_inl __P((bus_addr_t)); uint32_t alpha_pci_io_bwx_inl(bus_addr_t);
void alpha_pci_io_bwx_outb __P((bus_addr_t, u_int8_t)); void alpha_pci_io_bwx_outb(bus_addr_t, uint8_t);
void alpha_pci_io_bwx_outw __P((bus_addr_t, u_int16_t)); void alpha_pci_io_bwx_outw(bus_addr_t, uint16_t);
void alpha_pci_io_bwx_outl __P((bus_addr_t, u_int32_t)); void alpha_pci_io_bwx_outl(bus_addr_t, uint32_t);
const struct alpha_pci_io_ops alpha_pci_io_bwx_ops = { const struct alpha_pci_io_ops alpha_pci_io_bwx_ops = {
alpha_pci_io_bwx_inb, alpha_pci_io_bwx_inb,
@ -92,8 +89,7 @@ const struct alpha_pci_io_ops alpha_pci_io_bwx_ops = {
const struct alpha_pci_io_ops *alpha_pci_io_switch; const struct alpha_pci_io_ops *alpha_pci_io_switch;
int int
alpha_pci_io_enable(onoff) alpha_pci_io_enable(int onoff)
int onoff;
{ {
struct alpha_bus_window *abw; struct alpha_bus_window *abw;
int i, count; int i, count;
@ -133,9 +129,8 @@ alpha_pci_io_enable(onoff)
return (0); return (0);
} }
__inline struct alpha_bus_window * static __inline struct alpha_bus_window *
alpha_pci_io_findwindow(ioaddr) alpha_pci_io_findwindow(bus_addr_t ioaddr)
bus_addr_t ioaddr;
{ {
struct alpha_bus_window *abw; struct alpha_bus_window *abw;
int i; int i;
@ -152,17 +147,17 @@ alpha_pci_io_findwindow(ioaddr)
warnx("alpha_pci_io_findwindow: no window for 0x%lx, ABORTING!", warnx("alpha_pci_io_findwindow: no window for 0x%lx, ABORTING!",
(u_long) ioaddr); (u_long) ioaddr);
abort(); abort();
/* NOTREACHED */
} }
__inline u_int32_t * static __inline uint32_t *
alpha_pci_io_swiz(ioaddr, size) alpha_pci_io_swiz(bus_addr_t ioaddr, int size)
bus_addr_t ioaddr;
int size;
{ {
struct alpha_bus_window *abw = alpha_pci_io_findwindow(ioaddr); struct alpha_bus_window *abw = alpha_pci_io_findwindow(ioaddr);
u_int32_t *port; uint32_t *port;
port = (u_int32_t *) (abw->abw_addr + /* LINTED */
port = (uint32_t *) (abw->abw_addr +
(((ioaddr - abw->abw_abst.abst_bus_start) << (((ioaddr - abw->abw_abst.abst_bus_start) <<
abw->abw_abst.abst_addr_shift) | abw->abw_abst.abst_addr_shift) |
(size << abw->abw_abst.abst_size_shift))); (size << abw->abw_abst.abst_size_shift)));
@ -170,35 +165,32 @@ alpha_pci_io_swiz(ioaddr, size)
return (port); return (port);
} }
u_int8_t uint8_t
alpha_pci_io_swiz_inb(ioaddr) alpha_pci_io_swiz_inb(bus_addr_t ioaddr)
bus_addr_t ioaddr;
{ {
u_int32_t *port = alpha_pci_io_swiz(ioaddr, 0); uint32_t *port = alpha_pci_io_swiz(ioaddr, 0);
int offset = ioaddr & 3; bus_addr_t offset = ioaddr & 3;
alpha_mb(); alpha_mb();
return ((*port >> (8 * offset)) & 0xff); return ((*port >> (8 * offset)) & 0xff);
} }
u_int16_t uint16_t
alpha_pci_io_swiz_inw(ioaddr) alpha_pci_io_swiz_inw(bus_addr_t ioaddr)
bus_addr_t ioaddr;
{ {
u_int32_t *port = alpha_pci_io_swiz(ioaddr, 1); uint32_t *port = alpha_pci_io_swiz(ioaddr, 1);
int offset = ioaddr & 3; bus_addr_t offset = ioaddr & 3;
alpha_mb(); alpha_mb();
return ((*port >> (8 * offset)) & 0xffff); return ((*port >> (8 * offset)) & 0xffff);
} }
u_int32_t uint32_t
alpha_pci_io_swiz_inl(ioaddr) alpha_pci_io_swiz_inl(bus_addr_t ioaddr)
bus_addr_t ioaddr;
{ {
u_int32_t *port = alpha_pci_io_swiz(ioaddr, 3); uint32_t *port = alpha_pci_io_swiz(ioaddr, 3);
alpha_mb(); alpha_mb();
@ -206,37 +198,31 @@ alpha_pci_io_swiz_inl(ioaddr)
} }
void void
alpha_pci_io_swiz_outb(ioaddr, val) alpha_pci_io_swiz_outb(bus_addr_t ioaddr, uint8_t val)
bus_addr_t ioaddr;
u_int8_t val;
{ {
u_int32_t *port = alpha_pci_io_swiz(ioaddr, 0); uint32_t *port = alpha_pci_io_swiz(ioaddr, 0);
int offset = ioaddr & 3; bus_addr_t offset = ioaddr & 3;
u_int32_t nval = val << (8 * offset); uint32_t nval = ((uint32_t)val) << (8 * offset);
*port = nval; *port = nval;
alpha_mb(); alpha_mb();
} }
void void
alpha_pci_io_swiz_outw(ioaddr, val) alpha_pci_io_swiz_outw(bus_addr_t ioaddr, uint16_t val)
bus_addr_t ioaddr;
u_int16_t val;
{ {
u_int32_t *port = alpha_pci_io_swiz(ioaddr, 1); uint32_t *port = alpha_pci_io_swiz(ioaddr, 1);
int offset = ioaddr & 3; bus_addr_t offset = ioaddr & 3;
u_int32_t nval = val << (8 * offset); uint32_t nval = ((uint32_t)val) << (8 * offset);
*port = nval; *port = nval;
alpha_mb(); alpha_mb();
} }
void void
alpha_pci_io_swiz_outl(ioaddr, val) alpha_pci_io_swiz_outl(bus_addr_t ioaddr, uint32_t val)
bus_addr_t ioaddr;
u_int32_t val;
{ {
u_int32_t *port = alpha_pci_io_swiz(ioaddr, 3); uint32_t *port = alpha_pci_io_swiz(ioaddr, 3);
*port = val; *port = val;
alpha_mb(); alpha_mb();
@ -249,12 +235,11 @@ alpha_pci_io_swiz_outl(ioaddr, val)
*/ */
__asm(".arch ev56"); __asm(".arch ev56");
u_int8_t uint8_t
alpha_pci_io_bwx_inb(ioaddr) alpha_pci_io_bwx_inb(bus_addr_t ioaddr)
bus_addr_t ioaddr;
{ {
struct alpha_bus_window *abw = alpha_pci_io_findwindow(ioaddr); struct alpha_bus_window *abw = alpha_pci_io_findwindow(ioaddr);
u_int8_t *port = (u_int8_t *) (abw->abw_addr + uint8_t *port = (uint8_t *) (abw->abw_addr +
(ioaddr - abw->abw_abst.abst_bus_start)); (ioaddr - abw->abw_abst.abst_bus_start));
alpha_mb(); alpha_mb();
@ -262,12 +247,12 @@ alpha_pci_io_bwx_inb(ioaddr)
return (alpha_ldbu(port)); return (alpha_ldbu(port));
} }
u_int16_t uint16_t
alpha_pci_io_bwx_inw(ioaddr) alpha_pci_io_bwx_inw(bus_addr_t ioaddr)
bus_addr_t ioaddr;
{ {
struct alpha_bus_window *abw = alpha_pci_io_findwindow(ioaddr); struct alpha_bus_window *abw = alpha_pci_io_findwindow(ioaddr);
u_int16_t *port = (u_int16_t *) (abw->abw_addr + /* LINTED */
uint16_t *port = (uint16_t *) (abw->abw_addr +
(ioaddr - abw->abw_abst.abst_bus_start)); (ioaddr - abw->abw_abst.abst_bus_start));
alpha_mb(); alpha_mb();
@ -275,12 +260,12 @@ alpha_pci_io_bwx_inw(ioaddr)
return (alpha_ldwu(port)); return (alpha_ldwu(port));
} }
u_int32_t uint32_t
alpha_pci_io_bwx_inl(ioaddr) alpha_pci_io_bwx_inl(bus_addr_t ioaddr)
bus_addr_t ioaddr;
{ {
struct alpha_bus_window *abw = alpha_pci_io_findwindow(ioaddr); struct alpha_bus_window *abw = alpha_pci_io_findwindow(ioaddr);
u_int32_t *port = (u_int32_t *) (abw->abw_addr + /* LINTED */
uint32_t *port = (uint32_t *) (abw->abw_addr +
(ioaddr - abw->abw_abst.abst_bus_start)); (ioaddr - abw->abw_abst.abst_bus_start));
alpha_mb(); alpha_mb();
@ -289,12 +274,10 @@ alpha_pci_io_bwx_inl(ioaddr)
} }
void void
alpha_pci_io_bwx_outb(ioaddr, val) alpha_pci_io_bwx_outb(bus_addr_t ioaddr, uint8_t val)
bus_addr_t ioaddr;
u_int8_t val;
{ {
struct alpha_bus_window *abw = alpha_pci_io_findwindow(ioaddr); struct alpha_bus_window *abw = alpha_pci_io_findwindow(ioaddr);
u_int8_t *port = (u_int8_t *) (abw->abw_addr + uint8_t *port = (uint8_t *) (abw->abw_addr +
(ioaddr - abw->abw_abst.abst_bus_start)); (ioaddr - abw->abw_abst.abst_bus_start));
alpha_stb(port, val); alpha_stb(port, val);
@ -302,12 +285,11 @@ alpha_pci_io_bwx_outb(ioaddr, val)
} }
void void
alpha_pci_io_bwx_outw(ioaddr, val) alpha_pci_io_bwx_outw(bus_addr_t ioaddr, uint16_t val)
bus_addr_t ioaddr;
u_int16_t val;
{ {
struct alpha_bus_window *abw = alpha_pci_io_findwindow(ioaddr); struct alpha_bus_window *abw = alpha_pci_io_findwindow(ioaddr);
u_int16_t *port = (u_int16_t *) (abw->abw_addr + /* LINTED */
uint16_t *port = (uint16_t *) (abw->abw_addr +
(ioaddr - abw->abw_abst.abst_bus_start)); (ioaddr - abw->abw_abst.abst_bus_start));
alpha_stw(port, val); alpha_stw(port, val);
@ -315,12 +297,11 @@ alpha_pci_io_bwx_outw(ioaddr, val)
} }
void void
alpha_pci_io_bwx_outl(ioaddr, val) alpha_pci_io_bwx_outl(bus_addr_t ioaddr, uint32_t val)
bus_addr_t ioaddr;
u_int32_t val;
{ {
struct alpha_bus_window *abw = alpha_pci_io_findwindow(ioaddr); struct alpha_bus_window *abw = alpha_pci_io_findwindow(ioaddr);
u_int32_t *port = (u_int32_t *) (abw->abw_addr + /* LINTED */
uint32_t *port = (uint32_t *) (abw->abw_addr +
(ioaddr - abw->abw_abst.abst_bus_start)); (ioaddr - abw->abw_abst.abst_bus_start));
*port = val; *port = val;

View File

@ -1,4 +1,4 @@
/* $NetBSD: alpha_pci_mem.c,v 1.2 2000/06/30 18:19:28 simonb Exp $ */ /* $NetBSD: alpha_pci_mem.c,v 1.3 2001/07/17 17:46:42 thorpej Exp $ */
/*- /*-
* Copyright (c) 2000 The NetBSD Foundation, Inc. * Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -57,11 +57,8 @@ struct alpha_bus_window *alpha_pci_mem_windows;
int alpha_pci_mem_window_count; int alpha_pci_mem_window_count;
void * void *
alpha_pci_mem_map(memaddr, memsize, flags, rabst) alpha_pci_mem_map(bus_addr_t memaddr, bus_size_t memsize, int flags,
bus_addr_t memaddr; struct alpha_bus_space_translation *rabst)
bus_size_t memsize;
int flags;
struct alpha_bus_space_translation *rabst;
{ {
struct alpha_bus_window *abw; struct alpha_bus_window *abw;
void *addr; void *addr;
@ -124,10 +121,8 @@ alpha_pci_mem_map(memaddr, memsize, flags, rabst)
} }
void void
alpha_pci_mem_unmap(abst, addr, size) alpha_pci_mem_unmap(struct alpha_bus_space_translation *abst, void *addr,
struct alpha_bus_space_translation *abst; bus_size_t size)
void *addr;
bus_size_t size;
{ {
(void) munmap(addr, size << abst->abst_addr_shift); (void) munmap(addr, size << abst->abst_addr_shift);