1 /***************************************************************************
2 platform.h - Platoform dependent utilities
4 begin : Fri Sep 28 2007
5 copyright : (C) 2007 by Maurizio Monge
6 email : monge@linuz.sns.it
7 ***************************************************************************/
9 /***************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
16 ***************************************************************************/
18 #ifndef __PLATFORM_H__
19 #define __PLATFORM_H__
24 /* map and unmap a file in memory. */
25 // void *map_file(const char *file_name, uint32_t* size);
26 // void unmap_file(void*addr, uint32_t size);
28 /* return the current time in centiseconds */
31 /* Initialize some information about stdin */
34 /* return if there is input available */
35 bool input_available();
37 /* execute and initialize another xboard engine (only for testing) */
38 bool start_engine(const char *prog
, FILE **in
, FILE **out
);
40 /* get the cycle counter (only for profiling) */
41 inline uint64_t rdtsc()
44 asm volatile ("rdtsc\n\t" : "=A" (r
));
48 #endif //__PLATFORM_H__