Skip to content

Commit

Permalink
Move the mmap size to a define, change it to the proper amount
Browse files Browse the repository at this point in the history
  • Loading branch information
clbr committed Jul 9, 2012
1 parent e0ab0e2 commit f2c42f4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion detect.c
Expand Up @@ -59,7 +59,7 @@ unsigned int init_pci(unsigned char bus) {
int mem = open("/dev/mem", O_RDONLY);
if (mem < 0) die(_("Can't open /dev/mem, are you root?"));

area = mmap(NULL, 4, PROT_READ, MAP_PRIVATE, mem,
area = mmap(NULL, MMAP_SIZE, PROT_READ, MAP_PRIVATE, mem,
dev->regions[2].base_addr + 0x8000);
if (area == MAP_FAILED) die(_("mmap failed"));

Expand Down
2 changes: 1 addition & 1 deletion radeontop.c
Expand Up @@ -109,6 +109,6 @@ int main(int argc, char **argv) {

present(ticks, cardname, color);

munmap((void *) area, 4);
munmap((void *) area, MMAP_SIZE);
return 0;
}
1 change: 1 addition & 0 deletions radeontop.h
Expand Up @@ -32,6 +32,7 @@
#include <string.h>

#define GRBM_STATUS 0x8010
#define MMAP_SIZE 0x14

// radeontop.c
void die(const char *why);
Expand Down

0 comments on commit f2c42f4

Please sign in to comment.