• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ env_init函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中env_init函数的典型用法代码示例。如果您正苦于以下问题:C++ env_init函数的具体用法?C++ env_init怎么用?C++ env_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了env_init函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: do_printenv

void do_printenv (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
{
	uchar *env, *nxt;
	int i;

#if defined(CFG_FLASH_ENV_ADDR)
	uchar *environment = env_init();
#else
	env_init();
#endif	/* CFG_FLASH_ENV_ADDR */

	if (argc == 1) {		/* Print all env variables	*/
		uchar *start = environment;
		for (env=environment; *env; env=nxt+1) {
			for (nxt=env; *nxt; ++nxt)
				;
			puts (env);
			putc  ('\n');

			if (tstc()) {
				getc ();
				printf ("\n ** Abort\n");
				return;
			}
		}

		printf("\nEnvironment size: %d bytes\n", env-start);

		return;
	}

	for (i=1; i<argc; ++i) {	/* print single env variables	*/
		char *name = argv[i];
		char *val = NULL;

		for (env=environment; *env; env=nxt+1) {

			for (nxt=env; *nxt; ++nxt)
				;
			val=envmatch(name, env);
			if (val) {
				puts (name);
				putc ('=');
				puts (val);
				putc ('\n');
				break;
			}
		}
		if (!val)
			printf ("## Error: \"%s\" not defined\n", name);
	}
}
开发者ID:GWARDAR,项目名称:OpenPLi-1,代码行数:52,代码来源:cmd_nvedit.c


示例2: mips_init

void mips_init()
{
	printf("init.c:\tmips_init() is called\n");
	mips_detect_memory();

	mips_vm_init();
	page_init();
	//page_check();

	env_init();

	//ENV_CREATE(user_fktest);
	//ENV_CREATE(user_pt1);
	ENV_CREATE(user_idle);
	ENV_CREATE(fs_serv);
	//ENV_CREATE(user_fktest);
	//ENV_CREATE(user_pingpong);
	//ENV_CREATE(user_testfdsharing);
	//ENV_CREATE(user_testspawn);
	//ENV_CREATE(user_testpipe);
	//ENV_CREATE(user_testpiperace);
	ENV_CREATE(user_icode);
	trap_init();
	kclock_init();
	//env_run(&envs[0]);

	//env_run(&envs[1]);

	panic("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");

	while (1);

	panic("init.c:\tend of mips_init() reached!");
}
开发者ID:SivilTaram,项目名称:Jos-mips,代码行数:34,代码来源:init.c


示例3: rpmsg_init

int rpmsg_init(int dev_id, struct remote_device **rdev,
                rpmsg_chnl_cb_t channel_created,
                rpmsg_chnl_cb_t channel_destroyed,
                rpmsg_rx_cb_t default_cb, int role) {
    int status;

    /* Initialize IPC environment */
    status = env_init();
    if (status == RPMSG_SUCCESS) {
        /* Initialize the remote device for given cpu id */
        status = rpmsg_rdev_init(rdev, dev_id, role, channel_created,
                        channel_destroyed, default_cb);
        if (status == RPMSG_SUCCESS) {
            /* Kick off IPC with the remote device */
            status = rpmsg_start_ipc(*rdev);
        }
    }

    /* Deinit system in case of error */
    if (status != RPMSG_SUCCESS) {
        rpmsg_deinit(*rdev);
    }

    return status;
}
开发者ID:CharlesAndrews95,项目名称:embeddedsw,代码行数:25,代码来源:rpmsg.c


示例4: env_proc_read

static ssize_t env_proc_read(struct file *file, char __user *buf, size_t size, loff_t *ppos)
{
	char p[32];
	char *page = (char *)p;
	int err = 0;
	ssize_t len = 0;
	int env_valid_length = 0;

	env_init();

	if (!env_valid) {
		pr_err("[%s]read no env valid\n", MODULE_NAME);
		page += sprintf(page, "\nno env valid\n");
		len = page - &p[0];

		if (*ppos >= len)
			return 0;
		err = copy_to_user(buf, (char *)p, len);
		*ppos += len;
		if (err)
			return err;
		return len;
	} else {
		env_valid_length = get_env_valid_length();
		if (*ppos >= env_valid_length)
			return 0;
		if ((size + *ppos) > env_valid_length)
			size = env_valid_length - *ppos;
		err = copy_to_user(buf, g_env.env_data + *ppos, size);
		if (err)
			return err;
		*ppos += size;
		return size;
	}
}
开发者ID:John677,项目名称:Kernal_k3note,代码行数:35,代码来源:env.c


示例5: i386_init

void
i386_init(void)
{
	extern char edata[], end[];

	// Before doing anything else, complete the ELF loading process.
	// Clear the uninitialized global data (BSS) section of our program.
	// This ensures that all static/global variables start out zero.
	memset(edata, 0, end - edata);

	// Initialize the console.
	// Can't call cprintf until after we do this!
	cons_init();

	cprintf("6828 decimal is %o octal!\n", 6828);

	// Lab 2 memory management initialization functions
	i386_detect_memory();
	i386_vm_init();
	page_init();
	page_check();

	// Lab 3 user environment initialization functions
	env_init();
	idt_init();

	// Lab 4 multitasking initialization functions
	pic_init();
	kclock_init();

	// Should always have an idle process as first one.
	ENV_CREATE(user_idle);

	// Start fs.
	ENV_CREATE(fs_fs);
	ENV_CREATE(user_icode);

#if defined(TEST)
	// Don't touch -- used by grading script!
	ENV_CREATE2(TEST, TESTSIZE)
#else
	// Touch all you want.
	// ENV_CREATE(user_icode);
	// ENV_CREATE(user_pipereadeof);
	// ENV_CREATE(user_pipewriteeof);
	// ENV_CREATE(user_testpipe);
	// ENV_CREATE(user_primespipe);
	// ENV_CREATE(user_testpiperace);
	// ENV_CREATE(user_testpiperace2);
	// ENV_CREATE(user_testfdsharing);
#endif // TEST*

	// Should not be necessary - drain keyboard because interrupt has given up.
	kbd_intr();

	// Schedule and run the first user environment!
	sched_yield();


}
开发者ID:sunrenjie,项目名称:jos,代码行数:60,代码来源:init.c


示例6: __attribute__

void __attribute__((noreturn)) mainloop (void)
{
  prvSetupHardware ();
  vLedInit ();

  /* If no previous environment exists - create a new, but don't store it */
  env_init ();
  if(!env_load ()) {
    debug_printf ("unable to load environment, resetting to defaults\n");
    bzero (&env, sizeof (env));
  }

  if (env.e.n_lamps > MAX_LAMPS)
    env.e.n_lamps = 0;

  vRndInit ((((u_int32_t) env.e.mac_h) << 8) | env.e.mac_l);
  vNetworkInit ();

  xTaskCreate (vUSBCDCTask, (signed portCHAR *) "USB", TASK_USB_STACK,
	       NULL, TASK_USB_PRIORITY, NULL);

  PtInitProtocol ();
  vUSBShellInit ();
  vTaskStartScheduler ();

  while(1);
}
开发者ID:KhMassri,项目名称:DTNWorkspace,代码行数:27,代码来源:main.c


示例7: fih_hwid_get

void fih_hwid_get(void)
{
  pr_info("======FIH HWID init start======\r\n");

  if (fih_get_s1_boot())
  {
    pr_info("This is s1 boot\r\n");
  }
  else
  {
    pr_info("This is qcom boot\r\n");
  }

  if(env_init())
  {
    pr_info("FIH HWID init fail\r\n");
    pr_info("================================\r\n");
  }

  if(hwid_map())
  {
    pr_info("******map fail use default HWID******\r\n");
  }

  hwid_info();

  pr_info("================================\r\n");

}
开发者ID:Anik1199,项目名称:tulip,代码行数:29,代码来源:fih_hwid_init.c


示例8: board_init_f

void board_init_f(ulong dummy)
{
	/* Set global data pointer */
	gd = &gdata;
	/* Clear global data */
	memset((void *)gd, 0, sizeof(gd_t));
#ifdef CONFIG_LS2085A
	arch_cpu_init();
#endif
#ifdef CONFIG_FSL_IFC
	init_early_memctl_regs();
#endif
	board_early_init_f();
	timer_init();
#ifdef CONFIG_LS2085A
	env_init();
#endif
	get_clocks();

	preloader_console_init();

#ifdef CONFIG_SPL_I2C_SUPPORT
	i2c_init_all();
#endif
	dram_init();

	/* Clear the BSS */
	memset(__bss_start, 0, __bss_end - __bss_start);

#ifdef CONFIG_LAYERSCAPE_NS_ACCESS
	enable_layerscape_ns_access();
#endif
	board_init_r(NULL, 0);
}
开发者ID:CheezeCake,项目名称:edison-u-boot,代码行数:34,代码来源:spl.c


示例9: i386_init

void
i386_init(void)
{
    extern char edata[], end[];

    // Before doing anything else, complete the ELF loading process.
    // Clear the uninitialized global data (BSS) section of our program.
    // This ensures that all static/global variables start out zero.
    memset(edata, 0, end - edata);

    // Initialize the console.
    // Can't call cprintf until after we do this!
    cons_init();

    cprintf("6828 decimal is %o octal!\n", 6828);

    // Lab 2 memory management initialization functions
    mem_init();

    // Lab 3 user environment initialization functions
    env_init();
    trap_init();

#if defined(TEST)
    // Don't touch -- used by grading script!
    ENV_CREATE(TEST, ENV_TYPE_USER);
#else
    // Touch all you want.
    ENV_CREATE(user_hello, ENV_TYPE_USER);
#endif // TEST*

    // We only have one user environment for now, so just run it.
    env_run(&envs[0]);
}
开发者ID:nvsskchaitanya,项目名称:jos,代码行数:34,代码来源:init.c


示例10: setup_and_process_keys

/// Setup our environment (e.g., tty modes), process key strokes, then reset the environment.
void setup_and_process_keys(bool continuous_mode) {
    is_interactive_session = 1;  // by definition this is interactive
    set_main_thread();
    setup_fork_guards();
    wsetlocale(LC_ALL, L"POSIX");
    program_name = L"fish_key_reader";
    env_init();
    reader_init();
    input_init();

    // Installing our handler for every signal (e.g., SIGSEGV) is dubious because it means that
    // signals that might generate a core dump will not do so. On the other hand this allows us
    // to restore the tty modes so the terminal is still usable when we die.
    for (int signo = 1; signo < 32; signo++) {
        signal(signo, signal_handler);
    }

    if (continuous_mode) {
        printf("\n");
        printf("Type 'exit' or 'quit' to terminate this program.\n");
        printf("\n");
        printf("Characters such as [ctrl-D] (EOF) and [ctrl-C] (interrupt)\n");
        printf("have no special meaning and will not terminate this program.\n");
        printf("\n");
    } else {
        set_wait_on_escape_ms(500);
    }

    // TODO: We really should enable keypad mode but see issue #838.
    process_input(continuous_mode);
    restore_term_mode();
}
开发者ID:Command-Line,项目名称:fish-shell,代码行数:33,代码来源:fish_key_reader.cpp


示例11: env_init_only_key

///仅使用私钥初始化信封函数库
ENVELOP_API int env_init_only_key(IN const char * key)
{
	g_pub_key_list = (LinkList)malloc(sizeof(LNode));	
	memset(g_pub_key_list,0,sizeof(LNode));

	return env_init(NULL,key);
}
开发者ID:SomebodyLuo,项目名称:exm_onvif,代码行数:8,代码来源:gt_env.c


示例12: init_telnet

void
init_telnet(void)
{
    env_init();

    SB_CLEAR();
    ClearArray(options);

    connected = ISend = localflow = donebinarytoggle = 0;
#ifdef	AUTHENTICATION
#ifdef	ENCRYPTION
    auth_encrypt_connect(connected);
#endif
#endif
    restartany = -1;

    SYNCHing = 0;

    /* Don't change NetTrace */

    escape = CONTROL(']');
    rlogin = _POSIX_VDISABLE;
#ifdef	KLUDGELINEMODE
    echoc = CONTROL('E');
#endif

    flushline = 1;
    telrcv_state = TS_DATA;
}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:29,代码来源:telnet.c


示例13: allocate

int allocate(wam_t *wam)
{
	environ_t *env = env_init(wam->ctnptr, wam->env);
	wam->env = env;
	wam->pc += 1;
	return 0;
}
开发者ID:ranxian,项目名称:cwam,代码行数:7,代码来源:machine.c


示例14: kernel_init

void kernel_init()
{

  //TODO: init all kernel modules

#ifdef __KERN_DEBUG__

#ifdef USE_KERN_SHELL
  mimosa_kshell_run(NULL);
#endif // End of USE_KERN_SHELL;

#endif

#ifdef __MIMOSA_APP__
  mimosa_app_run();
#endif
  
  /*
  mimosa_memory_init();
  mimosa_fs_init();
  mimosa_interrupt_init();
  */
  
  // Call env_init at the end

  env_init();
}
开发者ID:NalaGinrut,项目名称:mimosa,代码行数:27,代码来源:kernel.c


示例15: setup_and_process_keys

/// Setup our environment (e.g., tty modes), process key strokes, then reset the environment.
static void setup_and_process_keys(bool continuous_mode) {
    is_interactive_session = 1;    // by definition this program is interactive
    setenv("LC_ALL", "POSIX", 1);  // ensure we're in a single-byte locale
    set_main_thread();
    setup_fork_guards();
    env_init();
    reader_init();
    input_init();
    proc_push_interactive(1);
    signal_set_handlers();
    install_our_signal_handlers();

    if (continuous_mode) {
        printf("\n");
        printf("To terminate this program type \"exit\" or \"quit\" in this window,\n");
        printf("or press [ctrl-C] or [ctrl-D] twice in a row.\n");
        printf("\n");
    }

    process_input(continuous_mode);
    restore_term_mode();
    restore_term_foreground_process_group();
    input_destroy();
    reader_destroy();
}
开发者ID:bbarenblat,项目名称:fish-shell,代码行数:26,代码来源:fish_key_reader.cpp


示例16: setup_and_process_keys

/// Setup our environment (e.g., tty modes), process key strokes, then reset the environment.
static void setup_and_process_keys(bool continuous_mode) {
    is_interactive_session = 1;  // by definition this program is interactive
    set_main_thread();
    setup_fork_guards();
    proc_push_interactive(1);
    env_init();
    reader_init();
    // We need to set the shell-modes for ICRNL,
    // in fish-proper this is done once a command is run.
    tcsetattr(STDIN_FILENO, TCSANOW, &shell_modes);
    install_our_signal_handlers();

    if (continuous_mode) {
        std::fwprintf(stderr, L"\n");
        std::fwprintf(stderr,
                      L"To terminate this program type \"exit\" or \"quit\" in this window,\n");
        std::fwprintf(stderr, L"or press [ctrl-%c] or [ctrl-%c] twice in a row.\n",
                      shell_modes.c_cc[VINTR] + 0x40, shell_modes.c_cc[VEOF] + 0x40);
        std::fwprintf(stderr, L"\n");
    }

    process_input(continuous_mode);
    restore_term_mode();
    restore_term_foreground_process_group();
}
开发者ID:fish-shell,项目名称:fish-shell,代码行数:26,代码来源:fish_key_reader.cpp


示例17: board_boot_order

void board_boot_order(u32 *spl_boot_list)
{
	/* Default boot sequence SPI -> MMC */
	spl_boot_list[0] = spl_boot_device();
	spl_boot_list[1] = BOOT_DEVICE_MMC1;
	spl_boot_list[2] = BOOT_DEVICE_UART;
	spl_boot_list[3] = BOOT_DEVICE_NONE;

	/*
	 * In case of emergency PAD pressed, we always boot
	 * to proper u-boot and perform recovery tasks there.
	 */
	if (board_check_emergency_pad())
		return;

#ifdef CONFIG_SPL_ENV_SUPPORT
	/* 'fastboot' */
	const char *s;

	if (env_init() || env_load())
		return;

	s = env_get("BOOT_FROM");
	if (s && !bootcount_error() && strcmp(s, "ACTIVE") == 0) {
		spl_boot_list[0] = BOOT_DEVICE_MMC1;
		spl_boot_list[1] = spl_boot_device();
	}
#endif
}
开发者ID:CogSystems,项目名称:u-boot,代码行数:29,代码来源:spl.c


示例18: main

int			main(int ac, char **av)
{
	GLFWwindow	*win;
	t_env		env;

	if (ac != 2)
		return (0);
	get_level(&env, av[1]);
	if (!glfwInit())
		exit(EXIT_FAILURE);
	win = glfwCreateWindow(2560, 1440, "Arkanoid",
			glfwGetPrimaryMonitor(), NULL);
	if (!win)
	{
		glfwTerminate();
		return (-1);
	}
	env_init(&env);
	glfwMakeContextCurrent(win);
	glfwSetKeyCallback(win, key_callback);
	do_window(win, &env);
	glfwDestroyWindow(win);
	glfwTerminate();
	return (0);
}
开发者ID:jbahus,项目名称:arkanoid,代码行数:25,代码来源:arkanoid.c


示例19: i386_init

void
i386_init(void)
{
	extern char edata[], end[];

	// Before doing anything else, complete the ELF loading process.
	// Clear the uninitialized global data (BSS) section of our program.
	// This ensures that all static/global variables start out zero.
	memset(edata, 0, end - edata);

	// Initialize the console.
	// Can't call cprintf until after we do this!
	cons_init();

	cprintf("6828 decimal is %o octal!\n", 6828);

	// Lab 2 memory management initialization functions
	i386_detect_memory();
	i386_vm_init();

	// Lab 3 user environment initialization functions
	env_init();
	idt_init();

	// Lab 4 multitasking initialization functions
	pic_init();
	kclock_init();

	time_init();
	pci_init();

	// Should always have an idle process as first one.
	ENV_CREATE(user_idle);

	// Start fs.
	ENV_CREATE(fs_fs);

#if !defined(TEST_NO_NS)
	// Start ns.
	ENV_CREATE(net_ns);
#endif

#if defined(TEST)
	// Don't touch -- used by grading script!
	ENV_CREATE2(TEST, TESTSIZE);
#else
	// Touch all you want.
	// ENV_CREATE(net_testoutput);
	// ENV_CREATE(user_echosrv);
	// ENV_CREATE(user_httpd);
  // ENV_CREATE(user_writemotd);
	// ENV_CREATE(user_testfile);
	ENV_CREATE(user_icode);
	// ENV_CREATE(user_primes);
#endif // TEST*

	// Schedule and run the first user environment!
	sched_yield();
}
开发者ID:mcorley,项目名称:jos,代码行数:59,代码来源:init.c


示例20: i386_init

void
i386_init(void)
{
	extern char edata[], end[];

	// Before doing anything else, complete the ELF loading process.
	// Clear the uninitialized global data (BSS) section of our program.
	// This ensures that all static/global variables start out zero.
	memset(edata, 0, end - edata);

	// Initialize the console.
	// Can't call cprintf until after we do this!
	cons_init();

	cprintf("6828 decimal is %o octal!\n", 6828);

	// Lab 2 memory management initialization functions
	mem_init();

	// Lab 3 user environment initialization functions
	env_init();
	trap_init();

	// Lab 4 multiprocessor initialization functions
	mp_init();
	lapic_init();

	// Lab 4 multitasking initialization functions
	pic_init();

	// Acquire the big kernel lock before waking up APs
	// Your code here:
        lock_kernel();
	// Starting non-boot CPUs
	boot_aps();

	// Start fs.
	ENV_CREATE(fs_fs, ENV_TYPE_FS);

#if defined(TEST)
	// Don't touch -- used by grading script!
	ENV_CREATE(TEST, ENV_TYPE_USER);
#else
	// Touch all you want.
//<<<<<<< HEAD
	ENV_CREATE(user_icode, ENV_TYPE_USER);
//=======
//	ENV_CREATE(user_dumbfork, ENV_TYPE_USER);
         
        
//>>>>>>> lab4
#endif // TEST*

	// Should not be necessary - drains keyboard because interrupt has given up.
	kbd_intr();

	// Schedule and run the first user environment!
	sched_yield();
}
开发者ID:liuxu1005,项目名称:Operating-System-Engineering,代码行数:59,代码来源:init.c



注:本文中的env_init函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ env_relocate函数代码示例发布时间:2022-05-30
下一篇:
C++ env_get_string函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap