; This contains the CPU-dependant variants of some routines. ; (C) 2005 Andreas Rumpf ; This code was inspired by the Freepascal compiler's sources ; All routines here have the _cdecl calling convention because ; that is the only convention any C compiler supports. \python{ # as usual I use my own preprocessor :-) import os def c(name): if os.name == 'posix': return name else: return "_" + name def arg: if os.name == 'posix': return 'rdi' else: return 'rcx' # on win64 uses its own calling convention; this sucks! } segment code global \c{cpu_inc_locked} global \c{cpu_dec_locked} \c{cpu_dec_locked}: lock dec [\arg] setz al ret \c{cpu_inc_locked}: lock inc [\arg] setz al ret