diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/asm-v850/v850e_utils.h |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'include/asm-v850/v850e_utils.h')
-rw-r--r-- | include/asm-v850/v850e_utils.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/include/asm-v850/v850e_utils.h b/include/asm-v850/v850e_utils.h new file mode 100644 index 000000000000..52eb72822d3d --- /dev/null +++ b/include/asm-v850/v850e_utils.h | |||
@@ -0,0 +1,35 @@ | |||
1 | /* | ||
2 | * include/asm-v850/v850e_utils.h -- Utility functions associated with | ||
3 | * V850E CPUs | ||
4 | * | ||
5 | * Copyright (C) 2001,03 NEC Electronics Corporation | ||
6 | * Copyright (C) 2001,03 Miles Bader <miles@gnu.org> | ||
7 | * | ||
8 | * This file is subject to the terms and conditions of the GNU General | ||
9 | * Public License. See the file COPYING in the main directory of this | ||
10 | * archive for more details. | ||
11 | * | ||
12 | * Written by Miles Bader <miles@gnu.org> | ||
13 | */ | ||
14 | |||
15 | #ifndef __V850_V850E_UTILS_H__ | ||
16 | #define __V850_V850E_UTILS_H__ | ||
17 | |||
18 | /* Calculate counter clock-divider and count values to attain the | ||
19 | desired frequency RATE from the base frequency BASE_FREQ. The | ||
20 | counter is expected to have a clock-divider, which can divide the | ||
21 | system cpu clock by a power of two value from MIN_DIVLOG2 to | ||
22 | MAX_DIV_LOG2, and a word-size of COUNTER_SIZE bits (the counter | ||
23 | counts up and resets whenever it's equal to the compare register, | ||
24 | generating an interrupt or whatever when it does so). The returned | ||
25 | values are: *DIVLOG2 -- log2 of the desired clock divider and *COUNT | ||
26 | -- the counter compare value to use. Returns true if it was possible | ||
27 | to find a reasonable value, otherwise false (and the other return | ||
28 | values will be set to be as good as possible). */ | ||
29 | extern int calc_counter_params (unsigned long base_freq, | ||
30 | unsigned long rate, | ||
31 | unsigned min_divlog2, unsigned max_divlog2, | ||
32 | unsigned counter_size, | ||
33 | unsigned *divlog2, unsigned *count); | ||
34 | |||
35 | #endif /* __V850_V850E_UTILS_H__ */ | ||