int do_idma (bd_t * bd, int argc, char * const argv[])
#endif	/* STANDALONE */
{
	int i;

	app_startup(argv);
	dpinit_done = 0;

	idma_init ();

	DEBUG ("Installing dma handler\n");
	install_hdlr (7, dmadone_handler, (void *) bdf);

	memset ((void *) 0x100000, 'a', 512);
	memset ((void *) 0x200000, 'b', 512);

	for (i = 0; i < 32; i++) {
		printf ("Startin IDMA, iteration=%d\n", i);
		idma_start (1, 1, 512, 0x100000, 0x200000, 3);
	}

	DEBUG ("Uninstalling dma handler\n");
	free_hdlr (7);

	return 0;
}
static void
_init(void)
{
  app_startup();
  configuration = cfg_new_snippet();
  cr_assert(cfg_load_module(configuration, "affile"));
}
Beispiel #3
0
void
setup(void)
{
  app_startup();
  init_template_tests();
  cfg_load_module(configuration, "stardate");
}
int
main(int argc, char *argv[])
{

  app_startup();

  if (argc > 1)
    verbose = TRUE;

  msg_init(TRUE);

  configuration = cfg_new(0x0302);
  plugin_load_module("basicfuncs", configuration, NULL);
  plugin_load_module("syslogformat", configuration, NULL);

  pattern_db_global_init();

  test_patterndb_rule();
  test_patterndb_parsers();
  test_patterndb_message_property_inheritance();
  test_patterndb_context_length();
  test_patterndb_tags_outside_of_rule();

  app_shutdown();
  return  (fail ? 1 : 0);
}
Test(template_speed, test_template_speed)
{
  app_startup();

  init_template_tests();
  setenv("TZ", "MET-1METDST", TRUE);
  tzset();

  cfg_load_module(configuration, "syslogformat");
  cfg_load_module(configuration, "basicfuncs");

  perftest_template("$DATE\n");
  perftest_template("<$PRI>$DATE $HOST $MSGHDR$MSG\n");
  perftest_template("$DATE\n");
  perftest_template("$DATE $HOST\n");
  perftest_template("$DATE $HOST $MSGHDR\n");
  perftest_template("$DATE $HOST $MSGHDR$MSG\n");
  perftest_template("$DATE $HOST $MSGHDR$MSG value\n");
  perftest_template("$DATE $HOST $MSGHDR$MSG ${APP.VALUE}\n");
  perftest_template("$MSG\n");
  perftest_template("$TAGS\n");
  perftest_template("$(echo $MSG)\n");
  perftest_template("$(+ $FACILITY_NUM $FACILITY_NUM)\n");
  perftest_template("$DATE $FACILITY.$PRIORITY $HOST $MSGHDR$MSG $SEQNO\n");
  perftest_template("${APP.VALUE} ${APP.VALUE2}\n");
  perftest_template("$DATE ${HOST:--} ${PROGRAM:--} ${PID:--} ${MSGID:--} ${SDATA:--} $MSG\n");

  app_shutdown();
}
Beispiel #6
0
int hello_world (int argc, char * const argv[])
{
	int i;

	/* Print the ABI version */
	app_startup(argv);
	printf ("Example expects ABI version %d\n", XF_VERSION);
	printf ("Actual U-Boot ABI version %d\n", (int)get_version());

	printf ("Hello World\n");

	printf ("argc = %d\n", argc);

	for (i=0; i<=argc; ++i) {
		printf ("argv[%d] = \"%s\"\n",
			i,
			argv[i] ? argv[i] : "<NULL>");
	}

	printf ("Hit any key to exit ... ");
	while (!tstc())
		;
	/* consume input */
	(void) getc();

	printf ("\n\n");
	return (0);
}
Beispiel #7
0
int kmain(int argc, char* argv[], uint32_t table) {
	int exit_num = 0;
	unsigned *old_instr1 = 0, *old_instr2 = 0;
	unsigned *old_instr_irq_1 = 0, *old_instr_irq_2 = 0;

	app_startup(); /* bss is valid after this point */
	global_data = table;

	//install the swi custom handler
	install_handler((unsigned int*)0x8, (int)swi_handler, old_instr1, old_instr2);
	//install the irq custom handler
	install_handler((unsigned int*)0x18, (int)irq_handler, old_instr_irq_1, old_instr_irq_2);

	//initiate the interrupt and timer 0
	init_interrupt();
	init_timer0();
	
	//load user program	
	exit_num = load_user(argc, argv);

	//restore the swi system handler
	restore_handler((unsigned int*)0x8, old_instr1, old_instr2);
	//restore the irq system handler
	restore_handler((unsigned int*)0x18, old_instr_irq_1, old_instr_irq_2);

	return exit_num;

}
Beispiel #8
0
int
main(int argc, char **argv)
{
  app_startup();
  putenv("TZ=MET-1METDST");
  tzset();

  start_grabbing_messages();
  test_condition_success();
  test_reference_on_condition_cloned();
  test_set_field_exist_and_set_literal_string();
  test_set_field_not_exist_and_set_literal_string();
  test_set_field_exist_and_set_template_string();
  test_subst_field_exist_and_substring_substituted();
  test_subst_field_exist_and_substring_substituted_with_template();
  test_subst_field_exist_and_substring_substituted_only_once_without_global();
  test_subst_field_exist_and_substring_substituted_every_occurence_with_global();
  test_subst_field_exist_and_substring_substituted_when_regexp_matched();
  test_set_field_honors_time_zone();
  test_set_field_exist_and_group_set_literal_string();
  test_set_field_exist_and_group_set_multiple_fields_with_glob_pattern_literal_string();
  test_set_field_exist_and_group_set_multiple_fields_with_glob_question_mark_pattern_literal_string();
  test_set_field_exist_and_group_set_multiple_fields_with_multiple_glob_pattern_literal_string();
  test_set_field_exist_and_group_set_template_string();
  test_set_field_exist_and_group_set_template_string_with_old_value();
  test_set_field_invalid_template();
  test_set_field_exist_and_group_set_when_condition_doesnt_match();
  test_set_field_exist_and_group_set_when_condition_matches();
  test_set_field_cloned();
  stop_grabbing_messages();
}
Beispiel #9
0
int
main(int argc, char *argv[])
{

  app_startup();

  msg_init(TRUE);

  configuration = cfg_new(0x0302);
  plugin_load_module("basicfuncs", configuration, NULL);
  plugin_load_module("syslogformat", configuration, NULL);

  pattern_db_global_init();

  test_conflicting_rules_with_different_parsers();
  test_conflicting_rules_with_the_same_parsers();
  test_patterndb_rule();
  test_patterndb_parsers();
  test_patterndb_message_property_inheritance();
  test_patterndb_context_length();
  test_patterndb_tags_outside_of_rule();

  app_shutdown();
  return 0;
}
Beispiel #10
0
int interrupt (int argc, char * const argv[])
{
	int c, irq = -1;

	app_startup (argv);

	if (argc > 1)
		irq = simple_strtoul (argv[1], NULL, 0);
	if ((irq < 0) || (irq > NR_IRQS))
		irq = DFL_IRQ;

	printf ("Installing handler for irq vector %d and doing busy wait\n",
		irq);
	printf ("Press 'q' to quit\n");

	/* Install interrupt handler */
	install_hdlr (irq, irq_handler, NULL);
	while ((c = getc ()) != 'q') {
		printf ("Ok, ok, I am still alive!\n");
	}

	free_hdlr (irq);
	printf ("\nInterrupt handler has been uninstalled\n");

	return (0);
}
int
main(int argc, char *argv[])
{
  GPtrArray *transformers;

  app_startup();
  putenv("TZ=MET-1METDST");
  tzset();

  configuration = cfg_new(0x0302);
  plugin_load_module("syslogformat", configuration, NULL);
  msg_format_options_defaults(&parse_options);
  msg_format_options_init(&parse_options, configuration);
  parse_options.flags |= LP_SYSLOG_PROTOCOL;

  testcase("rfc3164", NULL, "DATE,FACILITY,HOST,MESSAGE,PID,PRIORITY,PROGRAM", NULL);
  testcase("core", NULL, "DATE,FACILITY,HOST,MESSAGE,PID,PRIORITY,PROGRAM", NULL);
  testcase("base", NULL, "DATE,FACILITY,HOST,MESSAGE,PID,PRIORITY,PROGRAM", NULL);

  testcase("rfc5424", NULL, "[email protected],[email protected],.SDATA.meta.sequenceId,.SDATA.meta.sysUpTime,.SDATA.origin.ip,DATE,FACILITY,HOST,MESSAGE,MSGID,PID,PRIORITY,PROGRAM", NULL);
  testcase("syslog-proto", NULL, "[email protected],[email protected],.SDATA.meta.sequenceId,.SDATA.meta.sysUpTime,.SDATA.origin.ip,DATE,FACILITY,HOST,MESSAGE,MSGID,PID,PRIORITY,PROGRAM", NULL);

  testcase("selected-macros", NULL, "DATE,FACILITY,HOST,MESSAGE,PID,PRIORITY,PROGRAM,SEQNUM,SOURCEIP,TAGS", NULL);

  testcase("nv-pairs", NULL, "HOST,MESSAGE,MSGID,PID,PROGRAM", NULL);
  testcase("dot-nv-pairs", NULL, "[email protected],[email protected],.SDATA.meta.sequenceId,.SDATA.meta.sysUpTime,.SDATA.origin.ip", NULL);

  testcase("sdata", NULL, "[email protected],[email protected],.SDATA.meta.sequenceId,.SDATA.meta.sysUpTime,.SDATA.origin.ip", NULL);

  testcase("all-nv-pairs", NULL, "[email protected],[email protected],.SDATA.meta.sequenceId,.SDATA.meta.sysUpTime,.SDATA.origin.ip,HOST,MESSAGE,MSGID,PID,PROGRAM", NULL);

  testcase("everything", NULL, "[email protected],[email protected],.SDATA.meta.sequenceId,.SDATA.meta.sysUpTime,.SDATA.origin.ip,AMPM,BSDTAG,C_DATE,C_DAY,C_FULLDATE,C_HOUR,C_ISODATE,C_MIN,C_MONTH,C_MONTH_ABBREV,C_MONTH_NAME,C_MONTH_WEEK,C_SEC,C_STAMP,C_TZ,C_TZOFFSET,C_UNIXTIME,C_WEEK,C_WEEKDAY,C_WEEK_DAY,C_WEEK_DAY_ABBREV,C_WEEK_DAY_NAME,C_YEAR,C_YEAR_DAY,DATE,DAY,FACILITY,FACILITY_NUM,FULLDATE,HOST,HOUR,HOUR12,ISODATE,LEVEL,LEVEL_NUM,LOGHOST,MESSAGE,MIN,MONTH,MONTH_ABBREV,MONTH_NAME,MONTH_WEEK,MSEC,MSG,MSGHDR,MSGID,PID,PRI,PRIORITY,PROGRAM,R_AMPM,R_DATE,R_DAY,R_FULLDATE,R_HOUR,R_HOUR12,R_ISODATE,R_MIN,R_MONTH,R_MONTH_ABBREV,R_MONTH_NAME,R_MONTH_WEEK,R_MSEC,R_SEC,R_STAMP,R_TZ,R_TZOFFSET,R_UNIXTIME,R_USEC,R_WEEK,R_WEEKDAY,R_WEEK_DAY,R_WEEK_DAY_ABBREV,R_WEEK_DAY_NAME,R_YEAR,R_YEAR_DAY,SDATA,SEC,SEQNUM,SOURCEIP,STAMP,SYSUPTIME,S_AMPM,S_DATE,S_DAY,S_FULLDATE,S_HOUR,S_HOUR12,S_ISODATE,S_MIN,S_MONTH,S_MONTH_ABBREV,S_MONTH_NAME,S_MONTH_WEEK,S_MSEC,S_SEC,S_STAMP,S_TZ,S_TZOFFSET,S_UNIXTIME,S_USEC,S_WEEK,S_WEEKDAY,S_WEEK_DAY,S_WEEK_DAY_ABBREV,S_WEEK_DAY_NAME,S_YEAR,S_YEAR_DAY,TAG,TAGS,TZ,TZOFFSET,UNIXTIME,USEC,WEEK,WEEKDAY,WEEK_DAY,WEEK_DAY_ABBREV,WEEK_DAY_NAME,YEAR,YEAR_DAY", NULL);

  testcase("nv-pairs", ".SDATA.*", "HOST,MESSAGE,MSGID,PID,PROGRAM", NULL);

  /* tests that the exclude patterns do not affect explicitly added
   * keys. The testcase function adds a "test.key" and then checks if
   * it is indeed present. Even if it would be excluded it still has
   * to be in the result set. */
  testcase("rfc3164", "test.*", "DATE,FACILITY,HOST,MESSAGE,PID,PRIORITY,PROGRAM", NULL);

  /* tests that excluding works even when the key would be in the
   * default set. */
  testcase("nv-pairs", "MESSAGE", "HOST,MSGID,PID,PROGRAM", NULL);

  /* test the value-pair transformators */
  transformers = g_ptr_array_new();
  g_ptr_array_add(transformers, value_pairs_new_transform_add_prefix("__"));
  g_ptr_array_add(transformers, value_pairs_new_transform_shift(2));
  g_ptr_array_add(transformers, value_pairs_new_transform_replace("C_", "CC_"));

  testcase("everything", NULL, "[email protected],[email protected],.SDATA.meta.sequenceId,.SDATA.meta.sysUpTime,.SDATA.origin.ip,AMPM,BSDTAG,CC_DATE,CC_DAY,CC_FULLDATE,CC_HOUR,CC_ISODATE,CC_MIN,CC_MONTH,CC_MONTH_ABBREV,CC_MONTH_NAME,CC_MONTH_WEEK,CC_SEC,CC_STAMP,CC_TZ,CC_TZOFFSET,CC_UNIXTIME,CC_WEEK,CC_WEEKDAY,CC_WEEK_DAY,CC_WEEK_DAY_ABBREV,CC_WEEK_DAY_NAME,CC_YEAR,CC_YEAR_DAY,DATE,DAY,FACILITY,FACILITY_NUM,FULLDATE,HOST,HOUR,HOUR12,ISODATE,LEVEL,LEVEL_NUM,LOGHOST,MESSAGE,MIN,MONTH,MONTH_ABBREV,MONTH_NAME,MONTH_WEEK,MSEC,MSG,MSGHDR,MSGID,PID,PRI,PRIORITY,PROGRAM,R_AMPM,R_DATE,R_DAY,R_FULLDATE,R_HOUR,R_HOUR12,R_ISODATE,R_MIN,R_MONTH,R_MONTH_ABBREV,R_MONTH_NAME,R_MONTH_WEEK,R_MSEC,R_SEC,R_STAMP,R_TZ,R_TZOFFSET,R_UNIXTIME,R_USEC,R_WEEK,R_WEEKDAY,R_WEEK_DAY,R_WEEK_DAY_ABBREV,R_WEEK_DAY_NAME,R_YEAR,R_YEAR_DAY,SDATA,SEC,SEQNUM,SOURCEIP,STAMP,SYSUPTIME,S_AMPM,S_DATE,S_DAY,S_FULLDATE,S_HOUR,S_HOUR12,S_ISODATE,S_MIN,S_MONTH,S_MONTH_ABBREV,S_MONTH_NAME,S_MONTH_WEEK,S_MSEC,S_SEC,S_STAMP,S_TZ,S_TZOFFSET,S_UNIXTIME,S_USEC,S_WEEK,S_WEEKDAY,S_WEEK_DAY,S_WEEK_DAY_ABBREV,S_WEEK_DAY_NAME,S_YEAR,S_YEAR_DAY,TAG,TAGS,TZ,TZOFFSET,UNIXTIME,USEC,WEEK,WEEKDAY,WEEK_DAY,WEEK_DAY_ABBREV,WEEK_DAY_NAME,YEAR,YEAR_DAY", transformers);
  g_ptr_array_free(transformers, TRUE);

  app_shutdown();
  if (success)
    return 0;
  return 1;
}
int
main(int argc, char *argv[])
{
  app_startup();
  test_transport_mapper_unix();
  app_shutdown();
  return 0;
}
Beispiel #13
0
void
setup(void)
{
  app_startup();
  setenv("TZ", "MET-1METDST", TRUE);
  tzset();
  init_and_load_syslogformat_module();
}
int main()
{
  app_startup();

  test_cfg_lexer_subst();
  app_shutdown();
  return 0;
}
Beispiel #15
0
/**
 *	smc911x_eeprom - our application's main() function
 */
int smc911x_eeprom(int argc, char *argv[])
{
	/* Print the ABI version */
	app_startup(argv);
	if (XF_VERSION != get_version()) {
		printf("Expects ABI version %d\n", XF_VERSION);
		printf("Actual U-Boot ABI version %lu\n", get_version());
		printf("Can't run\n\n");
		return 1;
	}

	/* Initialize the MAC/EEPROM somewhat */
	puts("\n");
	if (smc911x_init())
		return 1;

	/* Dump helpful usage information */
	puts("\n");
	usage();
	puts("\n");

	while (1) {
		char *line;

		/* Send the prompt and wait for a line */
		puts("eeprom> ");
		line = getline();

		/* Got a ctrl+c */
		if (!line)
			return 0;

		/* Eat leading space */
		line = skip_space(line);

		/* Empty line, try again */
		if (!line[0])
			continue;

		/* Only accept 1 letter commands */
		if (line[0] && line[1] && line[1] != ' ' && line[1] != '\t')
			goto unknown_cmd;

		/* Now parse the command */
		switch (line[0]) {
		case 'W': write_stuff(line);  break;
		case 'D': dump_eeprom();      break;
		case 'M': dump_regs();        break;
		case 'C': copy_from_eeprom(); break;
		case 'P': print_macaddr();    break;
		unknown_cmd:
		default:  puts("ERROR: Unknown command!\n\n");
		case '?':
		case 'H': usage();            break;
		case 'Q': return 0;
		}
	}
}
void
setup(void)
{
  app_startup();
  setenv("TZ", "UTC", TRUE);
  tzset();

  init_and_load_kmsgformat_module();
}
Beispiel #17
0
int
main(int argc, char *argv[])
{
  app_startup();
  test_nv_registry();
  test_nvtable();
  app_shutdown();
  return 0;
}
Beispiel #18
0
static void
setup(void)
{
  app_startup();

  main_loop = main_loop_get_instance();
  main_loop_init(main_loop, &main_loop_options);
  _setup_dd();
}
Beispiel #19
0
void
setup(void)
{
  app_startup();
  setenv("TZ", "MET-1METDST", TRUE);
  tzset();
  configuration = cfg_new_snippet();
  configuration->stats_options.level = 1;
  cr_assert(cfg_init(configuration), "cfg_init failed!");
}
int
main (void)
{
  app_startup();

  test_template_on_error();

  app_shutdown();

  return 0;
}
Beispiel #21
0
int
main()
{
  app_startup();
  putenv("TZ=MET-1METDST");
  tzset();

  testcase_zero_diskbuf_alternating_send_acks();
  testcase_zero_diskbuf_and_normal_acks();
  return 0;
}
Beispiel #22
0
int kmain(int argc, char** argv, uint32_t table)
{
	app_startup(); /* bss is valid after this point */
	global_data = table;

	/* Add your code here */
	unsigned int *user_stack_ptr;
	
	/*
	 * set up the custom swi ad irq handler by hijacking the existing swi handling
	 * infrastructure
	 */
	if(install_handler((unsigned int *)SWI_VECTOR_ADDR, (void *)s_handler) < 0){
		printf("\n KERNEL MAIN: installation of custom SWI handler failed");
		return 0xbadc0de;
}
	
	if(install_handler((unsigned int *)IRQ_VECTOR_ADDR, (void *)i_handler) < 0){
		printf("\n KERNEL MAIN: installation of custom IRQ handler failed");
		return 0xbadc0de;
}

	/*
	 * init the IRQ related registers
	 */
	init_irq_regs();	
	
	/*
	 * setup IRQ stack
	 */
	setup_irq_stack(irq_stack + IRQ_STACK_SIZE - sizeof(long));

	/*
	 * init the timer driver
	 */
	init_timer_driver();

	/*
	 * setup the user stack with command line args
	 */
	user_stack_ptr = setup_user_stack(argc, argv);

	/*
	 * launch the user task
	 */
	launch_user_app(user_stack_ptr);

	/*
	 * this is the point we will return to during the exit syscall
	 * from here, we return to uboot
	 */
    return (get_kernel_r0()); 
	return 0;
}
Beispiel #23
0
int
main(int argc, char *argv[])
{
  app_startup();

  configuration = cfg_new(VERSION_VALUE);
  test_resolve_hostname_to_hostname();
  test_resolve_hostname_to_sockaddr();
  test_resolve_sockaddr_to_hostname();
  cfg_free(configuration);
  return 0;
}
int main()
{
  app_startup();

  configuration = cfg_new(0x0303);
  plugin_load_module("syslogformat", configuration, NULL);
  msg_format_options_defaults(&parse_options);
  msg_format_options_init(&parse_options, configuration);

  test_value_pairs_walk_prefix_data(configuration);
  app_shutdown();
};
Beispiel #25
0
int main()
{
  app_startup();

  setlocale (LC_ALL, "C");
  putenv("TZ=CET-1");
  tzset();

  configuration = cfg_new(0x0302);

  /* Various ISO8601 formats */
  testcase("2015-01-26T16:14:49+0300", NULL, NULL, "2015-01-26T16:14:49+03:00");
  testcase("2015-01-26T16:14:49+0330", NULL, NULL, "2015-01-26T16:14:49+03:30");
  testcase("2015-01-26T16:14:49+0200", NULL, NULL, "2015-01-26T16:14:49+02:00");
  testcase("2015-01-26T16:14:49+03:00", NULL, NULL, "2015-01-26T16:14:49+03:00");
  testcase("2015-01-26T16:14:49+03:30", NULL, NULL, "2015-01-26T16:14:49+03:30");
  testcase("2015-01-26T16:14:49+02:00", NULL, NULL, "2015-01-26T16:14:49+02:00");
  testcase("2015-01-26T16:14:49Z", NULL, NULL, "2015-01-26T16:14:49+00:00");
  testcase("2015-01-26T16:14:49A", NULL, NULL, "2015-01-26T16:14:49-01:00");
  testcase("2015-01-26T16:14:49B", NULL, NULL, "2015-01-26T16:14:49-02:00");
  testcase("2015-01-26T16:14:49N", NULL, NULL, "2015-01-26T16:14:49+01:00");
  testcase("2015-01-26T16:14:49O", NULL, NULL, "2015-01-26T16:14:49+02:00");
  testcase("2015-01-26T16:14:49GMT", NULL, NULL, "2015-01-26T16:14:49+00:00");
  testcase("2015-01-26T16:14:49PDT", NULL, NULL, "2015-01-26T16:14:49-07:00");

  /* RFC 2822 */
  testcase("Tue, 27 Jan 2015 11:48:46 +0200", NULL, "%a, %d %b %Y %T %z", "2015-01-27T11:48:46+02:00");

  /* Apache-like */
  testcase("21/Jan/2015:14:40:07 +0500", NULL, "%d/%b/%Y:%T %z", "2015-01-21T14:40:07+05:00");

  /* Try with additional text at the end, should fail */
  testcase("2015-01-26T16:14:49+0300 Disappointing log file", NULL, NULL, NULL);

  /* Dates without timezones. America/Phoenix has no DST */
  testcase("Tue, 27 Jan 2015 11:48:46", NULL, "%a, %d %b %Y %T", "2015-01-27T11:48:46+01:00");
  testcase("Tue, 27 Jan 2015 11:48:46", "America/Phoenix", "%a, %d %b %Y %T", "2015-01-27T11:48:46-07:00");
  testcase("Tue, 27 Jan 2015 11:48:46", "+05:00", "%a, %d %b %Y %T", "2015-01-27T11:48:46+05:00");

  /* Try without the year. */
  testcase("01/Jan:00:40:07 +0500", NULL, "%d/%b:%T %z", "2016-01-01T00:40:07+05:00");
  testcase("01/Aug:00:40:07 +0500", NULL, "%d/%b:%T %z", "2015-08-01T00:40:07+05:00");
  testcase("01/Sep:00:40:07 +0500", NULL, "%d/%b:%T %z", "2015-09-01T00:40:07+05:00");
  testcase("01/Oct:00:40:07 +0500", NULL, "%d/%b:%T %z", "2015-10-01T00:40:07+05:00");
  testcase("01/Nov:00:40:07 +0500", NULL, "%d/%b:%T %z", "2015-11-01T00:40:07+05:00");


  testcase("1446128356 +01:00", NULL, "%s %z", "2015-10-29T15:19:16+01:00");
  testcase("1446128356", "Europe/Budapest", "%s", "2015-10-29T15:19:16+01:00");

  app_shutdown();
  return 0;
};
int
main (void)
{
  app_startup();

  test_type_hint_parse();
  test_type_cast();

  app_shutdown();

  return 0;
}
Beispiel #27
0
int rhino_leds (int argc, char *argv[])
{
    int i;

	app_startup(argv);
	printf ("Rhino LED Control Program\n");

    if(argc < 3)
    {
        printf("Incorrect arguments.\nUsage: rhino_leds x y   ,\
                 where x,y = '0' or '1'");
        return -1;
    }
Beispiel #28
0
int
main (void)
{
  app_startup ();

  test_pipe_init_success ();
  test_pipe_init_fail ();
  test_pipe_init_multi_success ();
  test_pipe_init_multi_with_bad_node ();

  app_shutdown ();

  return 0;
}
Beispiel #29
0
int main(int argc, char **argv)
{
#if __hpux__
  return 0;
#endif
  app_startup();

  HOSTID_TESTCASE(test_if_hostid_generated_when_persist_file_not_exists);
  HOSTID_TESTCASE(test_if_hostid_remain_unchanged_when_persist_file_exists);

  app_shutdown();

  return 0;
}
int hello_world (int argc, char *argv[])
{
	int i;

	/* Print the ABI version */
	app_startup(argv);
	printf ("Example expects ABI version %d\n", XF_VERSION);
	printf ("Actual U-Boot ABI version %d\n", (int)get_version());

	printf ("Hello World\n");

	printf ("argc = %d\n", argc);

	for (i=0; i<=argc; ++i) {
		printf ("argv[%d] = \"%s\"\n",
			i,
			argv[i] ? argv[i] : "<NULL>");
	}
	
	volatile unsigned long *GPIO_DATAIN_BOOTKEY = 0x48310038;
	volatile unsigned long *GPIO_OE_SYSLED4 = 0x49058034;
	volatile unsigned long *GPIO_DATAOUT_SYSLED4 = 0x4905803C;
	
	*GPIO_OE_SYSLED4 &= 0xffffffef;
	
	while(!tstc())
	{
	  if((*GPIO_DATAIN_BOOTKEY & 0x00000080) == 0)
	  {
	    printf ("Button NOT pushed: LED OFF\n");
	    *GPIO_DATAOUT_SYSLED4 |= 0x00000010;
	  }
	
	  else
	  {
	    printf ("Button pushed: LED ON\n");
	    *GPIO_DATAOUT_SYSLED4 &= 0xffffffef;
	  }
	}
	
	printf ("Hit any key to exit ... ");
	while (!tstc())
		;
	/* consume input */
	(void) getc();

	printf ("\n\n");
	return (0);
}