X-Git-Url: https://git.kernelconcepts.de/?a=blobdiff_plain;f=packages%2Fservices%2Fobjloader%2Fv2_0%2Ftests%2Ftest_mods.c;h=b9b1b81348f8d91b76a1f3ae4a11f68957a073eb;hb=7a4ea0a4d67744fd3f6b5f207d857005fc707b46;hp=1be38085b48e43ec7f91cdd3cf0db4be30d85656;hpb=29ac1edaf5f12d706179ec87816ee1506ba4c9a1;p=karo-tx-redboot.git diff --git a/packages/services/objloader/v2_0/tests/test_mods.c b/packages/services/objloader/v2_0/tests/test_mods.c index 1be38085..b9b1b813 100644 --- a/packages/services/objloader/v2_0/tests/test_mods.c +++ b/packages/services/objloader/v2_0/tests/test_mods.c @@ -42,7 +42,7 @@ * ================================================================= * #####DESCRIPTIONBEGIN#### * - * Author(s): atonizzo@lycos.com + * Author(s): Anthony Tonizzo (atonizzo@gmail.com) * Date: 2005-05-13 * Purpose: * Description: @@ -82,11 +82,11 @@ //========================================================================== -MTAB_ENTRY( romfs_mte1, +MTAB_ENTRY(romfs_mte1, "/", "romfs", "", - (CYG_ADDRWORD) &filedata[0] ); + (CYG_ADDRWORD) &filedata[0]); //========================================================================== @@ -102,78 +102,78 @@ cyg_thread thread_b_obj; cyg_handle_t thread_a_hdl; cyg_handle_t thread_b_hdl; -#define SHOW_RESULT( _fn, _res ) \ +#define SHOW_RESULT(_fn, _res) \ diag_printf(": " #_fn "() returned %d %s\n", _res, _res<0?strerror(errno):""); int weak_fn_called = 0; -void weak_function( void ) +void weak_function(void) { - CYG_TEST_PASS( "Applications weak function called" ); + CYG_TEST_PASS("Applications weak function called"); weak_fn_called++; } -void (*thread_a)( cyg_addrword_t ); -void (*thread_b)( cyg_addrword_t ); +void (*thread_a)(cyg_addrword_t); +void (*thread_b)(cyg_addrword_t); // This is the main starting point for our example application. -void cyg_user_start( void ) +void cyg_user_start(void) { int err; void* lib_handle; - void (*fn)( void ); + void (*fn)(void); CYG_TEST_INIT(); - CYG_TEST_INFO( "Object loader module test started" ); + CYG_TEST_INFO("Object loader module test started"); - err = chdir( "/" ); + err = chdir("/"); - if( err < 0 ) - SHOW_RESULT( chdir, err ); + if(err < 0) + SHOW_RESULT(chdir, err); - lib_handle = cyg_ldr_open_library( (CYG_ADDRWORD)"/hello.o", 0 ); - CYG_TEST_CHECK( lib_handle , "Unable to load object file to load" ); + lib_handle = cyg_ldr_open_library((CYG_ADDRWORD)"/hello.o", 0); + CYG_TEST_CHECK(lib_handle , "Unable to load object file to load"); - fn = cyg_ldr_find_symbol( lib_handle, "print_message" ); - CYG_TEST_CHECK( fn , "Unable to find print_message function" ); + fn = cyg_ldr_find_symbol(lib_handle, "print_message"); + CYG_TEST_CHECK(fn , "Unable to find print_message function"); fn(); - fn = cyg_ldr_find_symbol( lib_handle, "weak_function" ); - CYG_TEST_CHECK( fn , "Unable to find weak_function" ); + fn = cyg_ldr_find_symbol(lib_handle, "weak_function"); + CYG_TEST_CHECK(fn , "Unable to find weak_function"); fn(); - fn = cyg_ldr_find_symbol ( lib_handle, "unresolvable_symbol" ); - CYG_TEST_CHECK( !fn , "Found none existing symbol!" ); + fn = cyg_ldr_find_symbol (lib_handle, "unresolvable_symbol"); + CYG_TEST_CHECK(!fn , "Found none existing symbol!"); - thread_a = cyg_ldr_find_symbol( lib_handle, "thread_a" ); - thread_b = cyg_ldr_find_symbol( lib_handle, "thread_b" ); - CYG_TEST_CHECK( thread_a && thread_b , "Unable to find thread functions" ); + thread_a = cyg_ldr_find_symbol(lib_handle, "thread_a"); + thread_b = cyg_ldr_find_symbol(lib_handle, "thread_b"); + CYG_TEST_CHECK(thread_a && thread_b , "Unable to find thread functions"); // Create our two threads. - cyg_thread_create( THREAD_PRIORITY, + cyg_thread_create(THREAD_PRIORITY, thread_a, (cyg_addrword_t) 75, "Thread A", (void *)thread_a_stack, THREAD_STACK_SIZE, &thread_a_hdl, - &thread_a_obj ); + &thread_a_obj); - cyg_thread_create( THREAD_PRIORITY + 1, + cyg_thread_create(THREAD_PRIORITY + 1, thread_b, (cyg_addrword_t) 68, "Thread B", (void *)thread_b_stack, THREAD_STACK_SIZE, &thread_b_hdl, - &thread_b_obj ); + &thread_b_obj); // Resume the threads so they start when the scheduler begins. - cyg_thread_resume( thread_a_hdl ); - cyg_thread_resume( thread_b_hdl ); + cyg_thread_resume(thread_a_hdl); + cyg_thread_resume(thread_b_hdl); cyg_scheduler_start(); } @@ -200,11 +200,11 @@ CYG_LDR_TABLE_STDIO() CYG_LDR_TABLE_INFRA_DIAG() // Test case infrastructure function -CYG_LDR_TABLE_ENTRY( cyg_test_output_entry, "cyg_test_output", cyg_test_output ); -CYG_LDR_TABLE_ENTRY( cyg_test_exit_entry, "cyg_test_exit", cyg_test_exit ); +CYG_LDR_TABLE_ENTRY(cyg_test_output_entry, "cyg_test_output", cyg_test_output); +CYG_LDR_TABLE_ENTRY(cyg_test_exit_entry, "cyg_test_exit", cyg_test_exit); // Test function -CYG_LDR_TABLE_ENTRY( weak_function_entry, "weak_function", weak_function ); +CYG_LDR_TABLE_ENTRY(weak_function_entry, "weak_function", weak_function); // Test Variable -CYG_LDR_TABLE_ENTRY( weak_fn_called_entry, "weak_fn_called", &weak_fn_called ); +CYG_LDR_TABLE_ENTRY(weak_fn_called_entry, "weak_fn_called", &weak_fn_called);