| 681 | */ |
| 682 | |
| 683 | static void call_timing_rule( TARGET * target, timing_info const * const time ) |
| 684 | { |
| 685 | LIST * timing_rule; |
| 686 | |
| 687 | pushsettings( root_module(), target->settings ); |
| 688 | timing_rule = var_get( root_module(), constant_TIMING_RULE ); |
| 689 | popsettings( root_module(), target->settings ); |
| 690 | |
| 691 | if ( !list_empty( timing_rule ) ) |
| 692 | { |
| 693 | /* rule timing-rule ( args * : target : start end user system ) */ |
| 694 | |
| 695 | /* Prepare the argument list. */ |
| 696 | FRAME frame[ 1 ]; |
| 697 | OBJECT * rulename = list_front( timing_rule ); |
| 698 | frame_init( frame ); |
| 699 | |
| 700 | /* args * :: $(__TIMING_RULE__[2-]) */ |
| 701 | lol_add( frame->args, list_copy_range( timing_rule, list_next( |
| 702 | list_begin( timing_rule ) ), list_end( timing_rule ) ) ); |
| 703 | |
| 704 | /* target :: the name of the target */ |
| 705 | lol_add( frame->args, list_new( object_copy( target->name ) ) ); |
| 706 | |
| 707 | /* start end user system :: info about the action command */ |
| 708 | lol_add( frame->args, list_push_back( list_push_back( list_push_back( list_new( |
| 709 | outf_time( &time->start ) ), |
| 710 | outf_time( &time->end ) ), |
| 711 | outf_double( time->user ) ), |
| 712 | outf_double( time->system ) ) ); |
| 713 | |
| 714 | /* Call the rule. */ |
| 715 | evaluate_rule( bindrule( rulename , root_module() ), rulename, frame ); |
| 716 | |
| 717 | /* Clean up. */ |
| 718 | frame_free( frame ); |
| 719 | } |
| 720 | } |
| 721 | |
| 722 | |
| 723 | /* |
no test coverage detected