0ad/source/lib/sysdep/ia32/ia32_asm.h
janwas 623e649acb # big refactoring in CPU-specific code, fix for dual core vs. HT detection
all cpu-related stuff is now defined in cpu.h (with cpu_ prefix and
fully encapsulated). fix quite brittle core/HT unit/package detection.
implement mkdir on VC8, where it is deprecated
add strdup on MacOSX
move ia32 code into separate subdir. functions implemented in asm are
called ia32_asm_*.
add some unix versions of sysdep functions (cannot test them)
timer: fix for amd64 linux

This was SVN commit r4995.
2007-04-25 18:19:35 +00:00

45 lines
1.3 KiB
C

#ifndef INCLUDED_IA32_ASM
#define INCLUDED_IA32_ASM
#ifdef __cplusplus
extern "C" {
#endif
extern void ia32_asm_cpuid_init();
// try to call the specified CPUID sub-function. returns true on success or
// false on failure (i.e. CPUID or the specific function not supported).
// returns eax, ebx, ecx, edx registers in above order.
extern bool ia32_asm_cpuid(u32 func, u32* regs);
extern void ia32_asm_atomic_add(intptr_t* location, intptr_t increment);
extern bool ia32_asm_CAS(uintptr_t* location, uintptr_t expected, uintptr_t new_value);
extern uint ia32_asm_control87(uint new_val, uint mask);
extern uint ia32_asm_fpclassify(double d);
extern uint ia32_asm_fpclassifyf(float f);
extern float ia32_asm_rintf(float);
extern double ia32_asm_rint(double);
extern float ia32_asm_fminf(float, float);
extern float ia32_asm_fmaxf(float, float);
extern i32 ia32_asm_i32_from_float(float f);
extern i32 ia32_asm_i32_from_double(double d);
extern i64 ia32_asm_i64_from_double(double d);
extern u64 ia32_asm_rdtsc_edx_eax(void);
// write the current execution state (e.g. all register values) into
// (Win32::CONTEXT*)pcontext (defined as void* to avoid dependency).
extern void ia32_asm_get_current_context(void* pcontext);
#ifdef __cplusplus
}
#endif
#endif // #ifndef INCLUDED_IA32_ASM