#include "testthreadcall.h"
#include <kern/thread_call.h>
+#include <pexpert/pexpert.h>
#define super IOService
OSDefineMetaClassAndStructors(testthreadcall, super);
}
+static int my_event;
+
bool
testthreadcall::start( IOService * provider )
{
- boolean_t ret;
- uint64_t deadline;
- int sleepret;
+ boolean_t ret;
+ uint64_t deadline;
+ int sleepret;
+ uint32_t kernel_configuration;
IOLog("%s\n", __PRETTY_FUNCTION__);
if (!super::start(provider)) {
return false;
}
+
+ kernel_configuration = PE_i_can_has_kernel_configuration();
+ IOLog("%s: Assertions %s\n", __PRETTY_FUNCTION__,
+ (kernel_configuration & kPEICanHasAssertions) ? "enabled" : "disabled");
+ IOLog("%s: Statistics %s\n", __PRETTY_FUNCTION__,
+ (kernel_configuration & kPEICanHasStatistics) ? "enabled" : "disabled");
+ IOLog("%s: Diagnostic API %s\n", __PRETTY_FUNCTION__,
+ (kernel_configuration & kPEICanHasDiagnosticAPI) ? "enabled" : "disabled");
IOLog("Attempting thread_call_allocate\n");
tcall = thread_call_allocate(thread_call_test_func, this);
clock_interval_to_deadline(3, NSEC_PER_SEC, &deadline);
IOLog("%d sec deadline is %llu\n", 3, deadline);
- sleepret = IOLockSleepDeadline(tlock2, NULL, deadline, THREAD_INTERRUPTIBLE);
- IOLog("IOLockSleepDeadline(NULL, %llu) returned %d, expected 0\n", deadline, sleepret);
+ sleepret = IOLockSleepDeadline(tlock2, &my_event, deadline, THREAD_INTERRUPTIBLE);
+ IOLog("IOLockSleepDeadline(&my_event, %llu) returned %d, expected 0\n", deadline, sleepret);
IOLockUnlock(tlock2);
clock_interval_to_deadline(3, NSEC_PER_SEC, &deadline);
IOLog("%d sec deadline is %llu\n", 3, deadline);
- sleepret = IOLockSleepDeadline(tlock2, NULL, deadline, THREAD_INTERRUPTIBLE);
- IOLog("IOLockSleepDeadline(NULL, %llu) returned %d, expected 1\n", deadline, sleepret);
+ sleepret = IOLockSleepDeadline(tlock2, &my_event, deadline, THREAD_INTERRUPTIBLE);
+ IOLog("IOLockSleepDeadline(&my_event, %llu) returned %d, expected 1\n", deadline, sleepret);
IOLockUnlock(tlock2);
IOLog("thread_call_test_func2 %p %p\n", param0, param1);
- IOLockWakeup(self->tlock2, NULL, false);
+ IOLockWakeup(self->tlock2, &my_event, false);
}