site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Hi Markus, // carlos On Sep 4, 2007, at 5:22 AM, Markus Hanauska wrote: Hi everyone! http://developer.apple.com/documentation/Porting/Conceptual/PortingDrivers/o... Nice, but it does not work! I can't even compile it. int nanoseconds_to_delay = 1000000; # 1 msec for an example AbsoluteTime absinterval, deadline; . . . nanoseconds_to_absolutetime(nanoseconds_to_delay, &absinterval); clock_absolutetime_interval_to_deadline(absinterval, &deadline); IOLockSleepDeadline(lock, event, deadline, THREAD_UNINT); extern void nanoseconds_to_absolutetime( uint64_t nanoseconds, uint64_t *result); and extern void clock_absolutetime_interval_to_deadline( uint64_t abstime, uint64_t *result); But AbsoluteTime is defined as typedef UnsignedWide AbsoluteTime; And UnsignedWide is #if defined(__BIG_ENDIAN__) typedef struct UnsignedWide { UInt32 hi; UInt32 lo; } UnsignedWide; #elif defined(__LITTLE_ENDIAN__) typedef struct UnsignedWide { UInt32 lo; UInt32 hi; } UnsignedWide; #else #error Unknown endianess. #endif AbsoluteTime deadlineTime; memcpy(&deadlineTime, deadline, sizeof(deadline)); correct? -- Best Regards, Markus Hanauska _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... Are you perchance trying to compile this sample code on a Leopard seed build? I'm trying to sleep within my KEXT. I found the following source code sample on Appel's side: nanoseconds_to_absolutetime and clock_absolutetime_interval_to_deadline work with uint64_t and not with AbsoluteTime. I can't cast a number to a struct. Publishing source code that is supposed to not even compile is not only silly and confusing programmers, it's outreight useless. Seeing that the struct is endian safe, I assume I can do the following: _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/carlos %40apple.com This email sent to carlos@apple.com This email sent to site_archiver@lists.apple.com