Add back Darwin/Mach/Apple portability
Quite a few of the changes against the MalcolmRobb/dump1090 fork are incompatible with OSX. This patch adds back that cross platform support back.
This commit is contained in:
parent
ef34c4ce0f
commit
ae126d1009
14 changed files with 324 additions and 10 deletions
31
compat/clock_gettime/README
Normal file
31
compat/clock_gettime/README
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* clock_gettime_stub.c
|
||||
* gcc -Wall -c clock_gettime_stub.c
|
||||
* posix realtime functions; MacOS user space glue
|
||||
*/
|
||||
|
||||
/* @comment
|
||||
* other possible implementation using intel builtin rdtsc
|
||||
* rdtsc-workaround: http://www.mcs.anl.gov/~kazutomo/rdtsc.html
|
||||
*
|
||||
* we could get the ticks by doing this
|
||||
*
|
||||
* __asm __volatile("mov %%ebx, %%esi\n\t"
|
||||
* "cpuid\n\t"
|
||||
* "xchg %%esi, %%ebx\n\t"
|
||||
* "rdtsc"
|
||||
* : "=a" (a),
|
||||
* "=d" (d)
|
||||
* );
|
||||
|
||||
* we could even replace our tricky sched_yield call by assembly code to get a better accurency,
|
||||
* anyway the following C stub will satisfy 99% of apps using posix clock_gettime call,
|
||||
* moreover, the setter version (clock_settime) could be easly written using mach primitives:
|
||||
* http://www.opensource.apple.com/source/xnu/xnu-${VERSION}/osfmk/man/ (clock_[set|get]_time)
|
||||
*
|
||||
* hackers don't be crackers, don't you use a flush toilet?
|
||||
*
|
||||
*
|
||||
* @see draft: ./posix-realtime-stub/posix-realtime-stub.c
|
||||
*
|
||||
*/
|
||||
Loading…
Add table
Add a link
Reference in a new issue