diff options
author | marcel <marcel@FreeBSD.org> | 2015-06-06 16:14:03 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2015-06-06 16:14:03 +0000 |
commit | 9d7393a25cad6018b12d73a6304241272dc1ffb4 (patch) | |
tree | e8dd5a23810c7542cf1d51522936bc172bbfe980 /tools/bus_space/C/libbus_space.h | |
parent | 58f25d3df4c4b55a3af3128ba66239f1ed92efcd (diff) | |
download | FreeBSD-src-9d7393a25cad6018b12d73a6304241272dc1ffb4.zip FreeBSD-src-9d7393a25cad6018b12d73a6304241272dc1ffb4.tar.gz |
Add DMA tag management to the C library and Python binding.
Diffstat (limited to 'tools/bus_space/C/libbus_space.h')
-rw-r--r-- | tools/bus_space/C/libbus_space.h | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/tools/bus_space/C/libbus_space.h b/tools/bus_space/C/libbus_space.h index 3e8860f..c7ff06c 100644 --- a/tools/bus_space/C/libbus_space.h +++ b/tools/bus_space/C/libbus_space.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014 Marcel Moolenaar + * Copyright (c) 2014, 2015 Marcel Moolenaar * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,14 +29,28 @@ #ifndef _LIBBUS_SPACE_H_ #define _LIBBUS_SPACE_H_ -int bus_space_map(const char *dev); -int bus_space_read_1(int rid, long ofs); -int bus_space_read_2(int rid, long ofs); +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_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); + +typedef unsigned long bus_addr_t; +typedef unsigned long bus_size_t; +typedef int busdma_tag_t; + +int busdma_tag_create(const char *dev, bus_addr_t align, bus_addr_t bndry, + bus_addr_t maxaddr, bus_size_t maxsz, u_int nsegs, + bus_size_t maxsegsz, u_int datarate, u_int flags, + busdma_tag_t *out_p); +int busdma_tag_derive(busdma_tag_t tag, bus_addr_t align, bus_addr_t bndry, + bus_addr_t maxaddr, bus_size_t maxsz, u_int nsegs, + bus_size_t maxsegsz, u_int datarate, u_int flags, + busdma_tag_t *out_p); +int busdma_tag_destroy(busdma_tag_t tag); #endif /* _LIBBUS_SPACE_H_ */ |