Commit 6bb6d31d authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig

Use extended open for replays

parent aff101df
......@@ -32,6 +32,7 @@
#include <mali-ioctl.h>
#include <mali-props.h>
#include <list.h>
#include <config.h>
#include "panwrap.h"
static pthread_mutex_t l;
......@@ -65,13 +66,10 @@ static struct device_info mali_info = {
.name = "mali",
.info = {
IOCTL_TYPE(0x80) {
IOCTL_INFO(GET_VERSION),
},
IOCTL_TYPE(0x82) {
IOCTL_INFO(MEM_ALLOC),
IOCTL_INFO(MEM_IMPORT),
IOCTL_INFO(GET_VERSION_NEW),
IOCTL_INFO(SET_FLAGS),
IOCTL_INFO(JOB_SUBMIT),
},
},
......@@ -360,15 +358,6 @@ dump_debugfs(unsigned int request) {
close(outd_fd);
}
static inline void
ioctl_decode_pre_get_version(unsigned long int request, void *ptr)
{
const struct mali_ioctl_get_version *args = ptr;
panwrap_prop("major = %3d", args->major);
panwrap_prop("minor = %3d", args->minor);
}
static inline void
ioctl_decode_pre_mem_alloc(unsigned long int request, void *ptr)
{
......@@ -398,14 +387,6 @@ ioctl_decode_pre_mem_import(unsigned long int request, void *ptr)
panwrap_log_cont(",\n");
}
static inline void
ioctl_decode_pre_set_flags(unsigned long int request, void *ptr)
{
const struct mali_ioctl_set_flags *args = ptr;
panwrap_prop("create_flags = %08x", args->create_flags);
}
static int job_count = 0;
static void emit_atoms(void *ptr, bool bifrost) {
......@@ -528,18 +509,12 @@ static inline void
ioctl_decode_pre(unsigned long int request, void *ptr)
{
switch (IOCTL_CASE(request)) {
case IOCTL_CASE(MALI_IOCTL_GET_VERSION):
ioctl_decode_pre_get_version(request, ptr);
break;
case IOCTL_CASE(MALI_IOCTL_MEM_ALLOC):
ioctl_decode_pre_mem_alloc(request, ptr);
break;
case IOCTL_CASE(MALI_IOCTL_MEM_IMPORT):
ioctl_decode_pre_mem_import(request, ptr);
break;
case IOCTL_CASE(MALI_IOCTL_SET_FLAGS):
ioctl_decode_pre_set_flags(request, ptr);
break;
case IOCTL_CASE(MALI_IOCTL_JOB_SUBMIT):
ioctl_decode_pre_job_submit(request, ptr);
break;
......@@ -726,7 +701,7 @@ panwrap_open_wrap(open_func *func, const char *path, int flags, va_list args)
return ret;
}
//#ifdef IS_OPEN64_SEPERATE_SYMBOL
#ifdef IS_OPEN64_SEPERATE_SYMBOL
int
open(const char *path, int flags, ...)
{
......@@ -737,7 +712,7 @@ open(const char *path, int flags, ...)
va_end(args);
return o;
}
//#endif
#endif
int
open64(const char *path, int flags, ...)
......@@ -958,8 +933,7 @@ static inline void *panwrap_mmap_wrap(mmap_func *func,
switch (offset) { /* offset == gpu_va */
case MALI_MEM_MAP_TRACKING_HANDLE:
panwrap_log("pandev_map_mtp(fd);\n");
panwrap_log("\n");
panwrap_msg("MTP map\n");
break;
default:
panwrap_track_mmap(offset, ret, length, prot, flags);
......@@ -979,7 +953,7 @@ void *mmap64(void *addr, size_t length, int prot, int flags, int fd,
offset);
}
//#ifdef IS_MMAP64_SEPERATE_SYMBOL
#ifdef IS_MMAP64_SEPERATE_SYMBOL
void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset)
{
#ifdef __LP64__
......@@ -991,7 +965,7 @@ void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset)
return mmap64(addr, length, prot, flags, fd, (loff_t) offset);
#endif
}
//#endif
#endif
int munmap(void *addr, size_t length)
{
......
......@@ -341,13 +341,8 @@ PANLOADER_CONSTRUCTOR {
panwrap_log("void main(void) {\n");
panwrap_indent++;
panwrap_log("int fd = pandev_raw_open(), rc;\n");
panwrap_log("int fd = pandev_open(), rc;\n");
panwrap_log("\n");
panwrap_log("if (fd < 0) {\n");
panwrap_indent++;
panwrap_log("printf(\"Error opening kernel\\n\");\n");
panwrap_indent--;
panwrap_log("}\n");
panwrap_log("\n");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment