summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Barbieri <luca@luca-barbieri.com>2010-03-28 19:15:29 +0200
committerLuca Barbieri <luca@luca-barbieri.com>2010-03-28 19:15:29 +0200
commit7730f2e4401b36d9d46e7612ec87970b523b874f (patch)
tree51331ed49e668519acf700230e060c2437060bd4
parent48d962a103328f2c7c17c136f30eeca24497d900 (diff)
add channels, remove fifos
-rw-r--r--Makefile2
-rw-r--r--channels.cpp20
-rw-r--r--fifos.cpp19
3 files changed, 21 insertions, 20 deletions
diff --git a/Makefile b/Makefile
index 6ff0259..5d19a46 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
CXXFLAGS = -g -O0 -Wall -fmessage-length=0 -fno-inline-functions -fno-inline
LIBS = -lpciaccess
-TARGETS = nvexec_raw ramfc fifos ramht pgraph peek poke dump dump-nonzero
+TARGETS = nvexec_raw ramfc channels ramht pgraph peek poke dump dump-nonzero
all: $(TARGETS)
diff --git a/channels.cpp b/channels.cpp
new file mode 100644
index 0000000..4757ace
--- /dev/null
+++ b/channels.cpp
@@ -0,0 +1,20 @@
+#include "nvlib.h"
+using namespace std;
+
+int main(int argc, char** argv)
+{
+ std::auto_ptr<nv_device> dev;
+ dev.reset(nv_device::open_default());
+
+ for(unsigned i = 0; i < dev->channels; ++i) {
+ if(i)
+ printf("\n");
+ printf("Channel %i\n", i);
+ printf(" enabled = %i\n", dev->is_channel_enabled(i));
+ printf(" dma = %08x\n", dev->ramfc->fc[i]->rd32(dev->ramfc->fc_fifo) << 4);
+ printf(" get = %08x\n", dev->users->user[i]->rd_get());
+ printf(" put = %08x\n", dev->users->user[i]->rd_get());
+ }
+ return 0;
+}
+
diff --git a/fifos.cpp b/fifos.cpp
deleted file mode 100644
index 05ae2d0..0000000
--- a/fifos.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
-#include "nvlib.h"
-using namespace std;
-
-int main(int argc, char** argv)
-{
- std::auto_ptr<nv_device> dev;
- dev.reset(nv_device::open_default());
-
- for(unsigned i = 0; i < dev->channels; ++i) {
- cout << "Channel " << i << endl;
- uint32_t instance = dev->ramfc->fc[i]->rd32(dev->ramfc->fc_fifo) << 4;
- cout << hex << dev->ramin->rd32(instance + 0) << endl;
- cout << hex << dev->ramin->rd32(instance + 4) << endl;
- cout << hex << dev->ramin->rd32(instance + 8) << endl;
- cout << hex << dev->ramin->rd32(instance + 12) << endl;
- }
- return 0;
-}
-