author | Christian Taedcke |
Thu, 09 Sep 2010 15:38:20 +0200 | |
changeset 635 | 30a0e926bb2e |
parent 391 | 7802a7d5584f |
permissions | -rw-r--r-- |
391
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
1 |
/* |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
2 |
This file is part of CanFestival, a library implementing CanOpen Stack. |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
3 |
|
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
4 |
Copyright (C): Edouard TISSERANT and Francis DUPIN |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
5 |
|
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
6 |
See COPYING file for copyrights details. |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
7 |
|
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
8 |
This library is free software; you can redistribute it and/or |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
9 |
modify it under the terms of the GNU Lesser General Public |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
10 |
License as published by the Free Software Foundation; either |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
11 |
version 2.1 of the License, or (at your option) any later version. |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
12 |
|
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
13 |
This library is distributed in the hope that it will be useful, |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
16 |
Lesser General Public License for more details. |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
17 |
|
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
18 |
You should have received a copy of the GNU Lesser General Public |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
19 |
License along with this library; if not, write to the Free Software |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
20 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
21 |
*/ |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
22 |
|
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
23 |
#ifndef __TIMERSCFG_H__ |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
24 |
#define __TIMERSCFG_H__ |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
25 |
|
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
26 |
#include <linux/param.h> |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
27 |
#include <linux/kthread.h> |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
28 |
|
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
29 |
/* Time unit : clock ticks (jiffies) */ |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
30 |
/* Time resolution : ticks per second (architecture-dependent value 'HZ' defined in linux/param.h) */ |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
31 |
|
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
32 |
#define TIMEVAL unsigned long |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
33 |
#define TIMEVAL_MAX (~(TIMEVAL)0) >> 1 |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
34 |
#define MS_TO_TIMEVAL(ms) ( (ms * HZ) / 1000 ) |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
35 |
#define US_TO_TIMEVAL(us) ( (us * HZ) / 1000000) |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
36 |
|
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
37 |
#define TASK_HANDLE struct task_struct* |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
38 |
|
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
diff
changeset
|
39 |
#endif |