Change <machine/bus.h> to <sys/bus.h> throughout.

Split bus.h -> bus_{defs,funcs}.h.

Mark hpcsh/bus.h obsolete.
This commit is contained in:
dyoung 2011-07-19 15:30:51 +00:00
parent b7d02abb50
commit f48d88bf58
13 changed files with 168 additions and 38 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: md.hpcsh,v 1.25 2011/07/18 17:39:05 dyoung Exp $
# $NetBSD: md.hpcsh,v 1.26 2011/07/19 15:30:51 dyoung Exp $
./usr/include/hpcsh comp-c-include
./usr/include/hpcsh/_G_config.h comp-obsolete obsolete
./usr/include/hpcsh/ansi.h comp-c-include
@ -7,7 +7,7 @@
./usr/include/hpcsh/asm.h comp-c-include
./usr/include/hpcsh/bootinfo.h comp-c-include
./usr/include/hpcsh/bswap.h comp-c-include
./usr/include/hpcsh/bus.h comp-c-include
./usr/include/hpcsh/bus.h comp-obsolete obsolete
./usr/include/hpcsh/cdefs.h comp-c-include
./usr/include/hpcsh/coff_machdep.h comp-c-include
./usr/include/hpcsh/conf.h comp-obsolete obsolete

View File

@ -1,4 +1,4 @@
/* $NetBSD: hd64461.c,v 1.23 2010/05/13 18:07:40 kiyohara Exp $ */
/* $NetBSD: hd64461.c,v 1.24 2011/07/19 15:30:52 dyoung Exp $ */
/*-
* Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@ -30,14 +30,14 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: hd64461.c,v 1.23 2010/05/13 18:07:40 kiyohara Exp $");
__KERNEL_RCSID(0, "$NetBSD: hd64461.c,v 1.24 2011/07/19 15:30:52 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/reboot.h>
#include <sys/bus.h>
#include <machine/bus.h>
#include <machine/intr.h>
#include <machine/debug.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: hd64461_machdep.c,v 1.5 2008/04/28 20:23:22 martin Exp $ */
/* $NetBSD: hd64461_machdep.c,v 1.6 2011/07/19 15:30:52 dyoung Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -30,12 +30,12 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: hd64461_machdep.c,v 1.5 2008/04/28 20:23:22 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: hd64461_machdep.c,v 1.6 2011/07/19 15:30:52 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bus.h>
#include <machine/bus.h>
#include <machine/platid.h>
#include <machine/platid_mask.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: hd64461pcmcia.c,v 1.46 2009/04/05 00:56:20 uwe Exp $ */
/* $NetBSD: hd64461pcmcia.c,v 1.47 2011/07/19 15:30:52 dyoung Exp $ */
/*-
* Copyright (c) 2001, 2002, 2004 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: hd64461pcmcia.c,v 1.46 2009/04/05 00:56:20 uwe Exp $");
__KERNEL_RCSID(0, "$NetBSD: hd64461pcmcia.c,v 1.47 2011/07/19 15:30:52 dyoung Exp $");
#include "opt_hd64461pcmcia.h"
@ -40,8 +40,8 @@ __KERNEL_RCSID(0, "$NetBSD: hd64461pcmcia.c,v 1.46 2009/04/05 00:56:20 uwe Exp $
#include <sys/malloc.h>
#include <sys/kthread.h>
#include <sys/boot_flag.h>
#include <sys/bus.h>
#include <machine/bus.h>
#include <machine/intr.h>
#include <dev/pcmcia/pcmciareg.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: hd64461uart.c,v 1.27 2010/05/13 18:21:33 kiyohara Exp $ */
/* $NetBSD: hd64461uart.c,v 1.28 2011/07/19 15:30:52 dyoung Exp $ */
/*-
* Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: hd64461uart.c,v 1.27 2010/05/13 18:21:33 kiyohara Exp $");
__KERNEL_RCSID(0, "$NetBSD: hd64461uart.c,v 1.28 2011/07/19 15:30:52 dyoung Exp $");
#include "opt_kgdb.h"
@ -41,8 +41,8 @@ __KERNEL_RCSID(0, "$NetBSD: hd64461uart.c,v 1.27 2010/05/13 18:21:33 kiyohara Ex
#include <sys/termios.h>
#include <dev/cons.h>
#include <sys/conf.h>
#include <sys/bus.h>
#include <machine/bus.h>
#include <machine/intr.h>
#include <machine/console.h>
#include <machine/platid.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: hd64461video.c,v 1.52 2009/04/05 00:56:20 uwe Exp $ */
/* $NetBSD: hd64461video.c,v 1.53 2011/07/19 15:30:52 dyoung Exp $ */
/*-
* Copyright (c) 2001, 2002, 2004 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: hd64461video.c,v 1.52 2009/04/05 00:56:20 uwe Exp $");
__KERNEL_RCSID(0, "$NetBSD: hd64461video.c,v 1.53 2011/07/19 15:30:52 dyoung Exp $");
#include "opt_hd64461video.h"
// #define HD64461VIDEO_HWACCEL
@ -40,6 +40,7 @@ __KERNEL_RCSID(0, "$NetBSD: hd64461video.c,v 1.52 2009/04/05 00:56:20 uwe Exp $"
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/malloc.h>
#include <sys/bus.h>
#include <sys/conf.h> /* cdev_decl */
#include <dev/cons.h> /* consdev */
@ -49,7 +50,6 @@ __KERNEL_RCSID(0, "$NetBSD: hd64461video.c,v 1.52 2009/04/05 00:56:20 uwe Exp $"
#include <sys/buf.h>
#include <uvm/uvm_extern.h>
#include <machine/bus.h>
#include <machine/intr.h>
#include <hpcsh/dev/hd64461/hd64461var.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: hd64465.c,v 1.14 2011/06/06 17:27:42 matt Exp $ */
/* $NetBSD: hd64465.c,v 1.15 2011/07/19 15:30:52 dyoung Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -30,14 +30,14 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: hd64465.c,v 1.14 2011/06/06 17:27:42 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: hd64465.c,v 1.15 2011/07/19 15:30:52 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/boot_flag.h>
#include <sys/bus.h>
#include <machine/bus.h>
#include <machine/intr.h>
#include <machine/debug.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: hd64465pcmcia.c,v 1.26 2009/11/07 07:27:44 cegger Exp $ */
/* $NetBSD: hd64465pcmcia.c,v 1.27 2011/07/19 15:30:52 dyoung Exp $ */
/*-
* Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: hd64465pcmcia.c,v 1.26 2009/11/07 07:27:44 cegger Exp $");
__KERNEL_RCSID(0, "$NetBSD: hd64465pcmcia.c,v 1.27 2011/07/19 15:30:52 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -38,10 +38,10 @@ __KERNEL_RCSID(0, "$NetBSD: hd64465pcmcia.c,v 1.26 2009/11/07 07:27:44 cegger Ex
#include <sys/malloc.h>
#include <sys/kthread.h>
#include <sys/boot_flag.h>
#include <sys/bus.h>
#include <uvm/uvm_extern.h>
#include <machine/bus.h>
#include <machine/intr.h>
#include <dev/pcmcia/pcmciareg.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: hd64465uart.c,v 1.17 2008/04/28 20:23:22 martin Exp $ */
/* $NetBSD: hd64465uart.c,v 1.18 2011/07/19 15:30:52 dyoung Exp $ */
/*-
* Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: hd64465uart.c,v 1.17 2008/04/28 20:23:22 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: hd64465uart.c,v 1.18 2011/07/19 15:30:52 dyoung Exp $");
#include "opt_kgdb.h"
@ -37,12 +37,12 @@ __KERNEL_RCSID(0, "$NetBSD: hd64465uart.c,v 1.17 2008/04/28 20:23:22 martin Exp
#include <sys/malloc.h>
#include <sys/device.h>
#include <sys/kgdb.h>
#include <sys/bus.h>
#include <sys/termios.h>
#include <dev/cons.h>
#include <sys/conf.h>
#include <machine/bus.h>
#include <machine/intr.h>
#include <machine/console.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: pfckbd.c,v 1.27 2009/04/05 02:29:40 uwe Exp $ */
/* $NetBSD: pfckbd.c,v 1.28 2011/07/19 15:30:51 dyoung Exp $ */
/*-
* Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@ -34,7 +34,7 @@
* currently, HP Jornada 680/690, HITACHI PERSONA HPW-50PAD only.
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pfckbd.c,v 1.27 2009/04/05 02:29:40 uwe Exp $");
__KERNEL_RCSID(0, "$NetBSD: pfckbd.c,v 1.28 2011/07/19 15:30:51 dyoung Exp $");
#include "debug_hpcsh.h"
@ -42,8 +42,8 @@ __KERNEL_RCSID(0, "$NetBSD: pfckbd.c,v 1.27 2009/04/05 02:29:40 uwe Exp $");
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/callout.h>
#include <sys/bus.h>
#include <machine/bus.h>
#include <machine/platid.h>
#include <machine/platid_mask.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.24 2011/02/08 20:20:15 rmind Exp $ */
/* $NetBSD: autoconf.c,v 1.25 2011/07/19 15:30:53 dyoung Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.24 2011/02/08 20:20:15 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.25 2011/07/19 15:30:53 dyoung Exp $");
#include "opt_md.h"
@ -48,9 +48,9 @@ __KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.24 2011/02/08 20:20:15 rmind Exp $");
#include <sys/conf.h>
#include <sys/disklabel.h>
#include <sys/device.h>
#include <sys/bus.h>
#include <sh3/exception.h>
#include <machine/bus.h>
#include <machine/intr.h>
#include <machine/config_hook.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: bus_space.c,v 1.16 2010/06/28 11:18:44 kiyohara Exp $ */
/* $NetBSD: bus_space.c,v 1.17 2011/07/19 15:30:53 dyoung Exp $ */
/*-
* Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.16 2010/06/28 11:18:44 kiyohara Exp $");
__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.17 2011/07/19 15:30:53 dyoung Exp $");
#include "debug_hpcsh.h"
@ -35,8 +35,7 @@ __KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.16 2010/06/28 11:18:44 kiyohara Exp
#include <sys/systm.h>
#include <sys/malloc.h>
#include <sys/extent.h>
#include <machine/bus.h>
#include <sys/bus.h>
/* bus.h turn on BUS_SPACE_DEBUG if the global DEBUG option is enabled. */
#ifdef BUS_SPACE_DEBUG
@ -45,6 +44,137 @@ __KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.16 2010/06/28 11:18:44 kiyohara Exp
#endif
#include <machine/debug.h>
/*
* Utility macros; INTERNAL USE ONLY.
*/
#define __TYPENAME(BITS) u_int##BITS##_t
#define _BUS_SPACE_READ(PREFIX, BYTES, BITS) \
__TYPENAME(BITS) \
PREFIX##_read_##BYTES(void *, bus_space_handle_t, bus_size_t); \
__TYPENAME(BITS) \
PREFIX##_read_##BYTES(void *tag, bus_space_handle_t bsh, \
bus_size_t offset) \
{ \
_BUS_SPACE_ACCESS_HOOK(); \
return *(volatile __TYPENAME(BITS) *)(bsh + offset); \
}
#define _BUS_SPACE_READ_MULTI(PREFIX, BYTES, BITS) \
void \
PREFIX##_read_multi_##BYTES(void *, bus_space_handle_t, bus_size_t, \
__TYPENAME(BITS) *, bus_size_t); \
void \
PREFIX##_read_multi_##BYTES(void *tag, bus_space_handle_t bsh, \
bus_size_t offset, __TYPENAME(BITS) *addr, \
bus_size_t count) \
{ \
volatile __TYPENAME(BITS) *p = (void *)(bsh + offset); \
_BUS_SPACE_ACCESS_HOOK(); \
while (count--) \
*addr++ = *p; \
}
#define _BUS_SPACE_READ_REGION(PREFIX, BYTES, BITS) \
void \
PREFIX##_read_region_##BYTES(void *, bus_space_handle_t, bus_size_t, \
__TYPENAME(BITS) *, bus_size_t); \
void \
PREFIX##_read_region_##BYTES(void *tag, bus_space_handle_t bsh, \
bus_size_t offset, __TYPENAME(BITS) *addr, \
bus_size_t count) \
{ \
volatile __TYPENAME(BITS) *p = (void *)(bsh + offset); \
_BUS_SPACE_ACCESS_HOOK(); \
while (count--) \
*addr++ = *p++; \
}
#define _BUS_SPACE_WRITE(PREFIX, BYTES, BITS) \
void \
PREFIX##_write_##BYTES(void *, bus_space_handle_t, bus_size_t, \
__TYPENAME(BITS)); \
void \
PREFIX##_write_##BYTES(void *tag, bus_space_handle_t bsh, \
bus_size_t offset, __TYPENAME(BITS) value) \
{ \
_BUS_SPACE_ACCESS_HOOK(); \
*(volatile __TYPENAME(BITS) *)(bsh + offset) = value; \
}
#define _BUS_SPACE_WRITE_MULTI(PREFIX, BYTES, BITS) \
void \
PREFIX##_write_multi_##BYTES(void *, bus_space_handle_t, bus_size_t, \
const __TYPENAME(BITS) *, bus_size_t); \
void \
PREFIX##_write_multi_##BYTES(void *tag, bus_space_handle_t bsh, \
bus_size_t offset, \
const __TYPENAME(BITS) *addr, \
bus_size_t count) \
{ \
volatile __TYPENAME(BITS) *p = (void *)(bsh + offset); \
_BUS_SPACE_ACCESS_HOOK(); \
while (count--) \
*p = *addr++; \
}
#define _BUS_SPACE_WRITE_REGION(PREFIX, BYTES, BITS) \
void \
PREFIX##_write_region_##BYTES(void *, bus_space_handle_t, bus_size_t, \
const __TYPENAME(BITS) *, bus_size_t); \
void \
PREFIX##_write_region_##BYTES(void *tag, bus_space_handle_t bsh, \
bus_size_t offset, \
const __TYPENAME(BITS) *addr, \
bus_size_t count) \
{ \
volatile __TYPENAME(BITS) *p = (void *)(bsh + offset); \
_BUS_SPACE_ACCESS_HOOK(); \
while (count--) \
*p++ = *addr++; \
}
#define _BUS_SPACE_SET_MULTI(PREFIX, BYTES, BITS) \
void \
PREFIX##_set_multi_##BYTES(void *, bus_space_handle_t, bus_size_t, \
__TYPENAME(BITS), bus_size_t); \
void \
PREFIX##_set_multi_##BYTES(void *tag, bus_space_handle_t bsh, \
bus_size_t offset, __TYPENAME(BITS) value, \
bus_size_t count) \
{ \
volatile __TYPENAME(BITS) *p = (void *)(bsh + offset); \
_BUS_SPACE_ACCESS_HOOK(); \
while (count--) \
*p = value; \
}
#define _BUS_SPACE_COPY_REGION(PREFIX, BYTES, BITS) \
void \
PREFIX##_copy_region_##BYTES(void *, bus_space_handle_t, bus_size_t, \
bus_space_handle_t, bus_size_t, \
bus_size_t); \
void \
PREFIX##_copy_region_##BYTES(void *t, bus_space_handle_t h1, \
bus_size_t o1, bus_space_handle_t h2, \
bus_size_t o2, bus_size_t c) \
{ \
volatile __TYPENAME(BITS) *addr1 = (void *)(h1 + o1); \
volatile __TYPENAME(BITS) *addr2 = (void *)(h2 + o2); \
_BUS_SPACE_ACCESS_HOOK(); \
\
if (addr1 >= addr2) { /* src after dest: copy forward */ \
while (c--) \
*addr2++ = *addr1++; \
} else { /* dest after src: copy backwards */ \
addr1 += c - 1; \
addr2 += c - 1; \
while (c--) \
*addr2-- = *addr1--; \
} \
}
#define _BUS_SPACE_ACCESS_HOOK() ((void)0)
_BUS_SPACE_READ(_bus_space, 1, 8)
_BUS_SPACE_READ(_bus_space, 2, 16)

View File

@ -1,9 +1,9 @@
# $NetBSD: Makefile,v 1.18 2011/07/17 20:54:41 joerg Exp $
# $NetBSD: Makefile,v 1.19 2011/07/19 15:30:53 dyoung Exp $
INCSDIR= /usr/include/hpcsh
INCS= ansi.h aout_machdep.h apmvar.h asm.h \
bootinfo.h bswap.h bus.h \
bootinfo.h bswap.h \
cdefs.h coff_machdep.h cpu.h cputypes.h \
disklabel.h \
elf_machdep.h endian.h endian_machdep.h \