summaryrefslogtreecommitdiffstats
path: root/tools/bus_space/C/libbus_space.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/bus_space/C/libbus_space.h')
-rw-r--r--tools/bus_space/C/libbus_space.h32
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_ */
OpenPOWER on IntegriCloud