예제 #1
0
nesc_attribute start_attribute_use(word name)
{
  /* Prepare to read an initialiser for the attribute definition 
     specified by name */
  nesc_attribute attr = new_nesc_attribute(parse_region, name->location, name,
					   NULL);
  tag_ref aref = lookup_attribute(name); /* XXX: aref leaks */
  type atype = error_type;

  /* Create new environment so that we can track whether this is a
     deputy scope or not. Using an environment makes it easy to
     recover parsing errors: we just call poplevel in the appropriate
     error production (see nattrib rules in c-parse.y). */
  pushlevel(FALSE);

  attr->tdecl = aref->tdecl;
  if (aref->tdecl)
    {
      atype = make_tagged_type(aref->tdecl);
      if (aref->tdecl->deputy_scope)
	current.env->deputy_scope = TRUE;
    }

  start_init(NULL, attr);
  really_start_incremental_init(atype);

  return attr;
}
예제 #2
0
파일: op_01.c 프로젝트: nmlgc/ReC98
void start_game(void)
{
    start_init();
    mikoconfig->rank = rank;
    mikoconfig->stage = 0;
    start_exec();
}
예제 #3
0
파일: op_01.c 프로젝트: nmlgc/ReC98
void start_extra(void)
{
    start_init();
    mikoconfig->rank = RANK_EXTRA;
    mikoconfig->stage = 5;
    mikoconfig->rem_lives = 2;
    mikoconfig->rem_bombs = 1;
    mikoconfig->start_lives = 2;
    mikoconfig->start_bombs = 1;
    start_exec();
}
예제 #4
0
파일: main.c 프로젝트: gurugio/gurugio
void start_kernel(void)
{
	char str[] = "C FUNCTION START!";
		
	/*
	 * ARCHITECTURE DEPENDENT INITIALIZATIONS
	 */

	/* screen - message display */
	init_screen();
	caos_printf("%s\n", str);

	/* memory manager */
	setup_memory();

	

	/* exception & interrupt */
	init_idt();
	set_idtr();


	/* device & IRQ */
	init_char_dev();
	keyboard_init();
	init_timer();

	/* scheduling */
	init_scheduler();


	/* task management */
	setup_task();
	init_cpu_tss();


	/* after task setup, start scheduler */
	start_scheduler();



	/*************************************************/

	/*
	 * ARCHITECTURE INDEPENDENT PROCESSING
	 */


	if (create_task(init, "init") < 0)
		caos_printf("Create Init fail..\n");

	if (create_task(user1, "user1") < 0)
		caos_printf("Create user1 fail..\n");

	if (create_task(user2, "user2") < 0)
		caos_printf("Create user2 fail..\n");




	caos_printf("CaOS KERNEL END!!\n");

	/* execute user mode task */
	start_init();
	


	while (1);
}
예제 #5
0
파일: rxtx.c 프로젝트: lunixbochs/bladeRF
int cmd_rxtx(struct cli_state *s, int argc, char **argv)
{
    int ret = CMD_RET_OK;
    int fpga_loaded;
    enum rxtx_cmd cmd;
    struct common_cfg *common;
    bool is_tx;
    int (*start_init)(struct cli_state *s);
    int (*stop_cleanup)(struct cli_state *s);

        if (!strcasecmp("tx", argv[0])) {
            is_tx = true;
            common = &s->rxtx_data->tx.common;
            start_init = tx_start_init;
            stop_cleanup = tx_stop_cleanup;
        } else if (!strcasecmp("rx", argv[0])) {
            is_tx = false;
            common = &s->rxtx_data->rx.common;
            start_init = rx_start_init;
            stop_cleanup = rx_stop_cleanup;
        } else {
            /* Bug */
            assert(0);
            return CMD_RET_UNKNOWN;
        }

    /* Just <rx|tx> is supported shorthand for <rx|tx> config */
    if (argc == 1) {
        cmd = RXTX_CMD_CFG;
    } else {
        cmd = get_cmd(argv[1]);
    }

    switch (cmd) {
        case RXTX_CMD_START:
            if (!cli_device_is_opened(s)) {
                ret = CMD_RET_NODEV;
            } else if (get_state(common) == RXTX_STATE_RUNNING) {
                ret = CMD_RET_STATE;
            } else {
                fpga_loaded = bladerf_is_fpga_configured(s->dev);
                if (fpga_loaded < 0) {
                    s->last_lib_error = fpga_loaded;
                    ret = CMD_RET_LIBBLADERF;
                } else if (!fpga_loaded) {
                    cli_err(s, argv[0], "FPGA is not configured");
                    ret = CMD_RET_INVPARAM;
                } else {
                    ret = validate_config(s, argv[0], s->rxtx_data, is_tx);
                    if (!ret) {
                        ret = open_samples_file(common, NULL, is_tx ? "r" : "w");
                        if (!ret) {
                            ret = start_init(s);
                        }
                    }
                }
            }
            break;

        case RXTX_CMD_STOP:
            if (!cli_device_is_opened(s)) {
                ret = CMD_RET_NODEV;
            } else if (get_state(common) != RXTX_STATE_RUNNING) {
                ret = CMD_RET_STATE;
            } else {
                ret = stop_cleanup(s);
            }
            break;

        case RXTX_CMD_CFG:
            if (argc > 2) {
                if (get_state(common) != RXTX_STATE_RUNNING) {
                    ret = handle_params(s, argc, argv, is_tx);
                } else {
                    ret = CMD_RET_STATE;
                }
            } else {
                print_config(s->rxtx_data, is_tx);
            }
            break;

        default:
            cli_err(s, argv[0], "Invalid command (%s)", argv[1]);
            ret = CMD_RET_INVPARAM;
    }


    return ret;
}