/************************************************************************* * * * © 1995 BY * * EDS DEFENCE LIMITED * * * * THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED * * ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE * * INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER * * COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY * * OTHER PERSON. NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY * * TRANSFERRED. * * * * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE * * AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT * * CORPORATION OR EDS. * * * * NEITHER DIGITAL NOR EDS ASSUME ANY RESPONSIBILITY FOR THE USE OR * * RELIABILITY OF THIS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY * * DIGITAL. * * * *************************************************************************/ #include static int name_len; static char *asciz_string; extern char *ascic_to_asciz (); extern unsigned int demo_entry$user_routine (); extern unsigned int demo_exit$user_routine (); char *ascic_to_asciz( ascic_string ) char *ascic_string; { name_len = ascic_string[ 0 ]; asciz_string = (char *)malloc(name_len+1); strncpy( asciz_string, &ascic_string[1], name_len ); asciz_string[ name_len ] = 0; return( asciz_string ); } unsigned int demo_entry$user_routine ( unsigned int ap_pointer, unsigned int pdr_id, unsigned int cpu_time, char ascic_string[], unsigned int index, unsigned int * user_routine_buffer) { char *name; name = ascic_to_asciz (ascic_string); printf ( "Start Service: %s, %X; AP: %X; CPU:%u; ID: %u; UR: %X; Entry: %X; Exit: %X\n", name, index, ap_pointer, cpu_time, pdr_id, *user_routine_buffer, &demo_entry$user_routine, &demo_exit$user_routine); free(name); *user_routine_buffer = (unsigned int) &demo_entry$user_routine; return 1; } unsigned int demo_exit$user_routine ( unsigned int ap_pointer, unsigned int pdr_id, unsigned int cpu_time, char ascic_string[], unsigned int index, unsigned int *user_routine_buffer) { char *name; name = ascic_to_asciz (ascic_string); printf ( "End Service: %s, %X; AP: %X; CPU:%u; ID: %u; UR: %X; Entry: %X; Exit: %X\n", name, index, ap_pointer, cpu_time, pdr_id, *user_routine_buffer, &demo_entry$user_routine, &demo_exit$user_routine); free(name); *user_routine_buffer = (unsigned int) &demo_exit$user_routine; return 1; }