summaryrefslogtreecommitdiff
path: root/dump-nonzero.cpp
blob: 077b6eb2969bd8443cb4dbc814b2b4cb33537827 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "nvlib.h"

int main(int argc, char** argv)
{
	std::auto_ptr<nv_device> dev;
	dev.reset(nv_device::open_default());
	
	unsigned base = strtoul(argv[1], 0, 0);
	unsigned size = strtoul(argv[2], 0, 0);
	for(unsigned i = 0; i < size; i += 4) {
		unsigned v = dev->rd32(base + i);
		if(v)
			printf("%08x: %08x\n", base + i, v);
	}

	return 0;
}