POK
/home/jaouen/pok_official/pok/trunk/libpok/include/core/time.h
00001 /*
00002  *                               POK header
00003  * 
00004  * The following file is a part of the POK project. Any modification should
00005  * made according to the POK licence. You CANNOT use this file or a part of
00006  * this file is this part of a file for your own project
00007  *
00008  * For more information on the POK licence, please see our LICENCE FILE
00009  *
00010  * Please follow the coding guidelines described in doc/CODING_GUIDELINES
00011  *
00012  *                                      Copyright (c) 2007-2009 POK team 
00013  *
00014  * Created by julien on Thu Jan 15 23:34:13 2009 
00015  */
00016 
00017 
00018 #ifndef __POK_TIME_H__
00019 #define __POK_TIME_H__
00020 
00021 #include <core/dependencies.h>
00022 
00023 #include <types.h>
00024 #include <errno.h>
00025 #include <core/syscall.h>
00026 
00027 #define pok_time_get(v) pok_time_gettick(v)
00028 /*
00029  * Get the amount of milliseconds expired since the system starts.
00030  */
00031 
00032 #define pok_time_milliseconds(value) value
00033 /*
00034  * Build a time according to the amount of time given in the first
00035  * parameter
00036  * Similar to: pok_time_t pok_time_milliseconds (const uint32_t ms);
00037  */
00038 
00039 #define pok_time_seconds(s) s*1000;
00040 /*
00041  * Build a time value according to the time given in the first
00042  * parameter
00043  * Could be considered as: pok_time_t pok_time_seconds (const uint32_t s);
00044  */
00045 
00046 pok_ret_t pok_time_compute_deadline (const pok_time_t relative, pok_time_t* absolute);
00047 /*
00048  * Compute a deadline from now according to the first parameter.
00049  * This function is a facility to compute tasks' deadline.
00050  */
00051 
00052 #define pok_time_gettick(value) pok_syscall2(POK_SYSCALL_GETTICK,(uint32_t)value,0);
00053 /*
00054  * Get number of ticks that passed since the system starts
00055  * Similar to : pok_ret_t   pok_time_gettick (uint64_t* value);
00056  */
00057 
00058 #endif  /* __POK_TIME_H__ */