diff options
author | marcel <marcel@FreeBSD.org> | 2015-08-02 01:09:30 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2015-08-02 01:09:30 +0000 |
commit | da99969eb727ae2cf19f925f08c3f965f9856b6d (patch) | |
tree | 389a014deed0f01fd66db730dc3f619a499a44cb /tools/bus_space/Python/lang.c | |
parent | 2878ab524794d3b961b0e950c6069afc7a77f795 (diff) | |
download | FreeBSD-src-da99969eb727ae2cf19f925f08c3f965f9856b6d.zip FreeBSD-src-da99969eb727ae2cf19f925f08c3f965f9856b6d.tar.gz |
Rename busdma_sync() to busdma_sync_range() and rename the
base and size parameters to ofs and len (resp). Add a new
busdma_sync() that makes the entire MD coherent.
Diffstat (limited to 'tools/bus_space/Python/lang.c')
-rw-r--r-- | tools/bus_space/Python/lang.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/tools/bus_space/Python/lang.c b/tools/bus_space/Python/lang.c index 48a112b..0fde8fc 100644 --- a/tools/bus_space/Python/lang.c +++ b/tools/bus_space/Python/lang.c @@ -384,12 +384,27 @@ busdma_seg_get_size(PyObject *self, PyObject *args) static PyObject * busdma_sync(PyObject *self, PyObject *args) { - u_long base, size; int error, mdid, op; - if (!PyArg_ParseTuple(args, "iikk", &mdid, &op, &base, &size)) + if (!PyArg_ParseTuple(args, "ii", &mdid, &op)) return (NULL); - error = bd_sync(mdid, op, base, size); + error = bd_sync(mdid, op, 0UL, ~0UL); + if (error) { + PyErr_SetString(PyExc_IOError, strerror(error)); + return (NULL); + } + Py_RETURN_NONE; +} + +static PyObject * +busdma_sync_range(PyObject *self, PyObject *args) +{ + u_long ofs, len; + int error, mdid, op; + + if (!PyArg_ParseTuple(args, "iikk", &mdid, &op, &ofs, &len)) + return (NULL); + error = bd_sync(mdid, op, ofs, len); if (error) { PyErr_SetString(PyExc_IOError, strerror(error)); return (NULL); @@ -448,7 +463,9 @@ static PyMethodDef busdma_methods[] = { "Return the size of the segment." }, { "sync", busdma_sync, METH_VARARGS, - "Keep memory/caches coherent WRT to DMA." }, + "Make the entire memory descriptor coherent WRT to DMA." }, + { "sync_range", busdma_sync_range, METH_VARARGS, + "Make part of the memory descriptor coherent WRT to DMA." }, { NULL, NULL, 0, NULL } }; |