summaryrefslogtreecommitdiffstats
path: root/pcilib/bar.h
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2015-11-18 03:24:04 +0100
committerSuren A. Chilingaryan <csa@suren.me>2015-11-18 03:24:04 +0100
commitec667d49f84c45c261f050313d64f89ce88e4302 (patch)
treec016cba088cc680f5d7d43e06031bfd9b635ae2e /pcilib/bar.h
parent52e32b2c9f0e5ac7cfb31fd2306e6536340955e1 (diff)
downloadpcitool-ec667d49f84c45c261f050313d64f89ce88e4302.tar.gz
pcitool-ec667d49f84c45c261f050313d64f89ce88e4302.tar.bz2
pcitool-ec667d49f84c45c261f050313d64f89ce88e4302.tar.xz
pcitool-ec667d49f84c45c261f050313d64f89ce88e4302.zip
Provide pcilib_get_bar_info & pcilib_get_bar_list API calls, remove obsolete pcilib_resolve_register_address
Diffstat (limited to 'pcilib/bar.h')
-rw-r--r--pcilib/bar.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/pcilib/bar.h b/pcilib/bar.h
index deb6f81..3c0eef6 100644
--- a/pcilib/bar.h
+++ b/pcilib/bar.h
@@ -1,6 +1,15 @@
#ifndef _PCILIB_BAR_H
#define _PCILIB_BAR_H
+
+typedef struct {
+ pcilib_bar_t bar;
+ size_t size;
+ uintptr_t phys_addr;
+ void *virt_addr;
+} pcilib_bar_info_t;
+
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -63,17 +72,9 @@ int pcilib_detect_address(pcilib_t *ctx, pcilib_bar_t *bar, uintptr_t *addr, siz
*/
char *pcilib_resolve_data_space(pcilib_t *ctx, uintptr_t addr, size_t *size);
+const pcilib_bar_info_t *pcilib_get_bar_info(pcilib_t *ctx, pcilib_bar_t bar);
+const pcilib_bar_info_t *pcilib_get_bar_list(pcilib_t *ctx);
-/**
- * The wrapper arround pcilib_resolve_bar_address() provided for backward compatibility.
- * If bar is not specified, it first checks the first BAR with registers, before searching
- * in other available BARs.
- * @param[in,out] ctx - pcilib context
- * @param[in] bar - specifies the BAR address belong to, use PCILIB_BAR_DETECT for autodetection
- * @param[in] addr - specifies the physical address on the PCI bus or offset in the BAR if \a bar is specified
- * @return - the virtual address in the process address space or NULL in case of error
- */
-char *pcilib_resolve_register_address(pcilib_t *ctx, pcilib_bar_t bar, uintptr_t addr);
#ifdef __cplusplus
}