Fix cvwait hangs

This commit is contained in:
Lubos Dolezel 2017-08-19 23:06:31 +02:00
parent aef0882331
commit abed0c399d
4 changed files with 11 additions and 2 deletions

View File

@ -6,7 +6,7 @@
#include "../../../../lkm/api.h"
#include "../simple.h"
long sys_psynch_cvwait(void* cv, uint32_t cvgen, uint32_t cvugen, void* mutex, uint32_t mgen,
long sys_psynch_cvwait(void* cv, uint32_t cvgen, uint32_t cvugen, void* mutex, uint64_t mgen,
uint32_t ugen, uint64_t sec, uint32_t usec)
{
struct psynch_cvwait_args args = {

View File

@ -2,7 +2,7 @@
#define LINUX_PSYNCH_CVWAIT_H
#include <stdint.h>
long sys_psynch_cvwait(void* cv, uint32_t cvgen, uint32_t cvugen, void* mutex, uint32_t mgen,
long sys_psynch_cvwait(void* cv, uint32_t cvgen, uint32_t cvugen, void* mutex, uint64_t mgen,
uint32_t ugen, uint64_t sec, uint32_t usec);
#endif

View File

@ -20,6 +20,11 @@ long sys_ulock_wait(uint32_t operation, void* addr, uint64_t value, uint32_t tim
struct timespec ts;
bool no_errno = operation & ULF_NO_ERRNO;
char dbg[100];
__simple_sprintf(dbg, "ulock_wait on %p for %d ns", addr, timeout / 1000);
lkm_call(0x1028, dbg);
if (timeout > 0)
{
ts.tv_sec = timeout / 1000*1000;

View File

@ -12,6 +12,10 @@ long sys_ulock_wake(uint32_t operation, void* addr, uint64_t wake_value)
int ret, op;
bool no_errno = operation & ULF_NO_ERRNO;
char buf[100];
__simple_sprintf(buf, "ulock_wake on %p", addr);
lkm_call(0x1024, buf);
op = operation & UL_OPCODE_MASK;
if (op == UL_COMPARE_AND_WAIT || op == UL_UNFAIR_LOCK)
{