mirror of https://github.com/mpv-player/mpv
added proper includes
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4472 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
bb4ab0c82b
commit
b7e384634b
|
@ -1,8 +1,11 @@
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <sys/ioctl.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
|
|
||||||
#include "dhahelper.h"
|
#include "dhahelper.h"
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
|
@ -19,13 +22,13 @@ int main(int argc, char *argv[])
|
||||||
printf("incompatible api!\n");
|
printf("incompatible api!\n");
|
||||||
|
|
||||||
{
|
{
|
||||||
dhahelper_memory_t mem;
|
dhahelper_memory_t mem;
|
||||||
|
|
||||||
mem.operation = MEMORY_OP_MAP;
|
mem.operation = MEMORY_OP_MAP;
|
||||||
//mem.start = 0xe0000000;
|
//mem.start = 0xe0000000;
|
||||||
mem.start = 0xe4000008;
|
mem.start = 0xe4000008;
|
||||||
mem.offset = 0;
|
mem.offset = 0;
|
||||||
mem.size = 0x4000;
|
mem.size = 0x4000;
|
||||||
mem.ret = 0;
|
mem.ret = 0;
|
||||||
|
|
||||||
ret = ioctl(fd, DHAHELPER_MEMORY, &mem);
|
ret = ioctl(fd, DHAHELPER_MEMORY, &mem);
|
||||||
|
@ -33,13 +36,13 @@ int main(int argc, char *argv[])
|
||||||
printf("ret: %s\n", strerror(errno));
|
printf("ret: %s\n", strerror(errno));
|
||||||
|
|
||||||
mem.ret = (int)mmap(NULL, (size_t)mem.size, PROT_READ, MAP_SHARED, fd, (off_t)0);
|
mem.ret = (int)mmap(NULL, (size_t)mem.size, PROT_READ, MAP_SHARED, fd, (off_t)0);
|
||||||
printf("allocated to %p\n", mem.ret);
|
printf("allocated to %x\n", mem.ret);
|
||||||
|
|
||||||
if (argc > 1)
|
if (argc > 1)
|
||||||
if (mem.ret != 0)
|
if (mem.ret != 0)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < 256; i++)
|
for (i = 0; i < 256; i++)
|
||||||
printf("[%x] ", *(int *)(mem.ret+i));
|
printf("[%x] ", *(int *)(mem.ret+i));
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
@ -52,4 +55,6 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
ioctl(fd, DHAHELPER_MEMORY, &mem);
|
ioctl(fd, DHAHELPER_MEMORY, &mem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue