diff options
author | marcel <marcel@FreeBSD.org> | 2015-06-10 16:00:09 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2015-06-10 16:00:09 +0000 |
commit | 4559857c8ee5605e66907b97f02fd450cd9249db (patch) | |
tree | 3f4e959211da4decf8a23aafbb9d69406f35ea96 | |
parent | 1383b5af089a66e2c7d9e70772826e70b69651a2 (diff) | |
download | FreeBSD-src-4559857c8ee5605e66907b97f02fd450cd9249db.zip FreeBSD-src-4559857c8ee5605e66907b97f02fd450cd9249db.tar.gz |
Rename bus_space to bus (i.e. drop _space). This makes the
API match the convenience macros in <sys/bus.h>. Bus space
can now reference both bus and busdma.
-rw-r--r-- | tools/bus_space/C/Makefile | 4 | ||||
-rw-r--r-- | tools/bus_space/C/lang.c | 22 | ||||
-rw-r--r-- | tools/bus_space/C/libbus.h (renamed from tools/bus_space/C/libbus_space.h) | 18 | ||||
-rw-r--r-- | tools/bus_space/Makefile.inc | 2 | ||||
-rw-r--r-- | tools/bus_space/Python/Makefile | 2 | ||||
-rw-r--r-- | tools/bus_space/Python/lang.c | 8 | ||||
-rw-r--r-- | tools/bus_space/bus.c (renamed from tools/bus_space/bus_space.c) | 2 | ||||
-rw-r--r-- | tools/bus_space/bus.h (renamed from tools/bus_space/bus_space.h) | 0 |
8 files changed, 29 insertions, 29 deletions
diff --git a/tools/bus_space/C/Makefile b/tools/bus_space/C/Makefile index cb4d43f..5fd64c7 100644 --- a/tools/bus_space/C/Makefile +++ b/tools/bus_space/C/Makefile @@ -1,9 +1,9 @@ # $FreeBSD$ -LIB= bus_space +LIB= bus SHLIB_MAJOR= 0 SRCS= lang.c -INCS= libbus_space.h +INCS= libbus.h CFLAGS+= -I${.CURDIR}/.. diff --git a/tools/bus_space/C/lang.c b/tools/bus_space/C/lang.c index 9d3c7fb..bbb2bc7 100644 --- a/tools/bus_space/C/lang.c +++ b/tools/bus_space/C/lang.c @@ -30,12 +30,12 @@ __FBSDID("$FreeBSD$"); #include <sys/types.h> #include <errno.h> -#include "bus_space.h" +#include "bus.h" #include "busdma.h" -#include "libbus_space.h" +#include "libbus.h" int16_t -bus_space_read_1(int rid, long ofs) +bus_read_1(int rid, long ofs) { uint8_t val; @@ -43,7 +43,7 @@ bus_space_read_1(int rid, long ofs) } int32_t -bus_space_read_2(int rid, long ofs) +bus_read_2(int rid, long ofs) { uint16_t val; @@ -51,7 +51,7 @@ bus_space_read_2(int rid, long ofs) } int64_t -bus_space_read_4(int rid, long ofs) +bus_read_4(int rid, long ofs) { uint32_t val; @@ -59,42 +59,42 @@ bus_space_read_4(int rid, long ofs) } int -bus_space_write_1(int rid, long ofs, uint8_t val) +bus_write_1(int rid, long ofs, uint8_t val) { return ((!bs_write(rid, ofs, &val, sizeof(val))) ? errno : 0); } int -bus_space_write_2(int rid, long ofs, uint16_t val) +bus_write_2(int rid, long ofs, uint16_t val) { return ((!bs_write(rid, ofs, &val, sizeof(val))) ? errno : 0); } int -bus_space_write_4(int rid, long ofs, uint32_t val) +bus_write_4(int rid, long ofs, uint32_t val) { return ((!bs_write(rid, ofs, &val, sizeof(val))) ? errno : 0); } int -bus_space_map(const char *dev) +bus_map(const char *dev) { return (bs_map(dev)); } int -bus_space_unmap(int rid) +bus_unmap(int rid) { return ((!bs_unmap(rid)) ? errno : 0); } int -bus_space_subregion(int rid, long ofs, long sz) +bus_subregion(int rid, long ofs, long sz) { return (bs_subregion(rid, ofs, sz)); diff --git a/tools/bus_space/C/libbus_space.h b/tools/bus_space/C/libbus.h index 5522238..3574372 100644 --- a/tools/bus_space/C/libbus_space.h +++ b/tools/bus_space/C/libbus.h @@ -29,15 +29,15 @@ #ifndef _LIBBUS_SPACE_H_ #define _LIBBUS_SPACE_H_ -int bus_space_map(const char *dev); -int16_t bus_space_read_1(int rid, long ofs); -int32_t bus_space_read_2(int rid, long ofs); -int64_t bus_space_read_4(int rid, long ofs); -int bus_space_subregion(int rid, long ofs, long sz); -int bus_space_unmap(int rid); -int bus_space_write_1(int rid, long ofs, uint8_t val); -int bus_space_write_2(int rid, long ofs, uint16_t val); -int bus_space_write_4(int rid, long ofs, uint32_t val); +int bus_map(const char *dev); +int16_t bus_read_1(int rid, long ofs); +int32_t bus_read_2(int rid, long ofs); +int64_t bus_read_4(int rid, long ofs); +int bus_subregion(int rid, long ofs, long sz); +int bus_unmap(int rid); +int bus_write_1(int rid, long ofs, uint8_t val); +int bus_write_2(int rid, long ofs, uint16_t val); +int bus_write_4(int rid, long ofs, uint32_t val); typedef unsigned long bus_addr_t; typedef unsigned long bus_size_t; diff --git a/tools/bus_space/Makefile.inc b/tools/bus_space/Makefile.inc index 947c85f..080689a 100644 --- a/tools/bus_space/Makefile.inc +++ b/tools/bus_space/Makefile.inc @@ -1,4 +1,4 @@ # $FreeBSD$ .PATH: ${.CURDIR}/.. -SRCS+= bus_space.c busdma.c +SRCS+= bus.c busdma.c diff --git a/tools/bus_space/Python/Makefile b/tools/bus_space/Python/Makefile index 8e38ed3..5bc9b77 100644 --- a/tools/bus_space/Python/Makefile +++ b/tools/bus_space/Python/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -SHLIB_NAME= bus_space.so +SHLIB_NAME= bus.so SRCS= lang.c CFLAGS+= -I${.CURDIR}/.. -I/usr/local/include/python2.7 diff --git a/tools/bus_space/Python/lang.c b/tools/bus_space/Python/lang.c index 2247360..d119b99 100644 --- a/tools/bus_space/Python/lang.c +++ b/tools/bus_space/Python/lang.c @@ -29,7 +29,7 @@ __FBSDID("$FreeBSD$"); #include <Python.h> -#include "bus_space.h" +#include "bus.h" #include "busdma.h" static PyObject * @@ -259,7 +259,7 @@ busdma_mem_free(PyObject *self, PyObject *args) Py_RETURN_NONE; } -static PyMethodDef bus_space_methods[] = { +static PyMethodDef bus_methods[] = { { "read_1", bus_read_1, METH_VARARGS, "Read a 1-byte data item." }, { "read_2", bus_read_2, METH_VARARGS, "Read a 2-byte data item." }, { "read_4", bus_read_4, METH_VARARGS, "Read a 4-byte data item." }, @@ -293,9 +293,9 @@ static PyMethodDef busdma_methods[] = { }; PyMODINIT_FUNC -initbus_space(void) +initbus(void) { - Py_InitModule("bus_space", bus_space_methods); + Py_InitModule("bus", bus_methods); Py_InitModule("busdma", busdma_methods); } diff --git a/tools/bus_space/bus_space.c b/tools/bus_space/bus.c index 260222c..01b7693 100644 --- a/tools/bus_space/bus_space.c +++ b/tools/bus_space/bus.c @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); #include <stdlib.h> #include <unistd.h> -#include "bus_space.h" +#include "bus.h" #include "../../sys/dev/proto/proto_dev.h" diff --git a/tools/bus_space/bus_space.h b/tools/bus_space/bus.h index d347106..d347106 100644 --- a/tools/bus_space/bus_space.h +++ b/tools/bus_space/bus.h |