MOXA linux-2.6.x / linux-2.6.19-uc1 from UC-7110-LX-BOOTLOADER-1.9_VERSION-4.2.tgz
[linux-2.6.19-moxart.git] / arch / nios2nommu / scripts / nios2_system.h / altera_avalon_timer.pm
blob495ccdcfc0974e5b6c6a54db7a6b7ad1fbe3a20b
1 package altera_avalon_timer;
3 use base qw(BasicModule);
4 use strict;
6 sub required_class_name {
7 "altera_avalon_timer";
10 sub required_module_names {
11 "timer0"
14 sub print_prefix {
15 my ($class, $system) = @_;
17 print "\n";
18 print "#ifndef __ASSEMBLY__\n";
19 print "#include <asm/timer_struct.h>\n";
20 print "#endif\n";
21 print "\n";
24 sub base_address_cast {
25 "np_timer"
28 # only timers with a non-fixed-period are valid
29 sub is_module_valid {
30 my ($class, $system, $module_name) = @_;
32 my $module = $system->getModule ($module_name);
33 my $fixed_period = $module->getWSAAssignment ('fixed_period');
35 if ($fixed_period eq '0') {
36 return 1;
37 } else {
38 return 0;
42 sub run {
43 altera_avalon_timer->run2 (@_);