Ejemplo n.º 1
0
void vlwIPInit( void )
{
    /* Initialize lwIP and its interface layer. */
	sys_init();
	mem_init();
	memp_init();
	pbuf_init();
	netif_init();
	ip_init();
	tcpip_init( NULL, NULL );
}
Ejemplo n.º 2
0
Archivo: init.c Proyecto: dzruyk/spam
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();

	lock_kernel();
	// 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:

	// 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.
	ENV_CREATE(user_icode, ENV_TYPE_USER);
#endif // TEST*

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

	// Schedule and run the first user environment!
	sched_yield();
}
Ejemplo n.º 3
0
Archivo: vm.c Proyecto: merolle/ripe
int main(int argc, char** argv)
{
  // Provide argc and argv to interested modules
  sys_argc = argc;
  sys_argv = argv;

  // Initialize memory system
  mem_init();

  // Initialize stack and exception system
  stack_init();

  // Initialize static symbol table
  sym_init();

  // Initialize value klass system
  klass_init();

  // Phase 1
  stack_annot_push("init1_Function");
    init1_Function();
  stack_annot_pop();
  stack_annot_push("init1_Object");
    init1_Object();
  stack_annot_pop();

  ripe_module1a();
  ripe_module1b();

  // Phase 1.5
  stack_annot_push("phase 1.5");
    common_init_phase15();
    klass_init_phase15();
  stack_annot_pop();

  // Phase 2
  stack_annot_push("init2_Function");
    init2_Function();
  stack_annot_pop();
  stack_annot_push("init2_Object");
    init2_Object();
  stack_annot_pop();

  ripe_module2();
  ripe_module3();

  // Call main.
  Value rv = ripe_main();
  if (is_int64(rv)){
    return unpack_int64(rv);
  }
  mem_deinit();
  return 0;
}
Ejemplo n.º 4
0
void navilnux_init(void)
{
    mem_init();
    task_init();
    msg_init();
    syscall_init();

    os_timer_init();
    gpio0_init();

    os_timer_start();
}
Ejemplo n.º 5
0
void main(void)		/* This really IS void, no error here. */
{			/* The startup routine assumes (well, ...) this */
/*
 * Interrupts are still disabled. Do necessary setups, then
 * enable them
 */
 	ROOT_DEV = ORIG_ROOT_DEV;
 	drive_info = DRIVE_INFO;
	memory_end = (1<<20) + (EXT_MEM_K<<10);
	memory_end &= 0xfffff000;
	if (memory_end > 16*1024*1024)
		memory_end = 16*1024*1024;
	if (memory_end > 12*1024*1024) 
		buffer_memory_end = 4*1024*1024;
	else if (memory_end > 6*1024*1024)
		buffer_memory_end = 2*1024*1024;
	else
		buffer_memory_end = 1*1024*1024;
	main_memory_start = buffer_memory_end;
#ifdef RAMDISK
	main_memory_start += rd_init(main_memory_start, RAMDISK*1024);
#endif
	mem_init(main_memory_start,memory_end);
	trap_init();
	blk_dev_init();
	chr_dev_init();
	tty_init();
	time_init();
	sched_init();
	buffer_init(buffer_memory_end);
	hd_init();
	floppy_init();
	sti();
	move_to_user_mode();

	setup((void *) &drive_info);
	(void) open("/dev/tty0",O_RDWR,0);
	(void) dup(0);
	(void) dup(0);
	(void) open("/var/process.log",O_CREAT|O_TRUNC|O_WRONLY,0666); 

	if (!fork()) {		/* we count on this going ok */
		init();
	}
/*
 *   NOTE!!   For any other task 'pause()' would mean we have to get a
 * signal to awaken, but task0 is the sole exception (see 'schedule()')
 * as task 0 gets activated at every idle moment (when no other tasks
 * can run). For task0 'pause()' just means we go check if some other
 * task can run, and if not we return here.
 */
	for(;;) pause();
}
Ejemplo n.º 6
0
Archivo: network.c Proyecto: gz/aos10
void
network_init(void)
{
    printf("\nStarting %s\n", __FUNCTION__);

    // Initialise the nslu2 hardware
    ixOsalOemInit(); 

    /* Initialise lwIP */
    mem_init();
    memp_init();
    pbuf_init();
    netif_init();
    udp_init();
    etharp_init();

    /* Setup the network interface */
    struct ip_addr netmask, ipaddr, gw;
    IP4_ADDR(&netmask, 255, 255, 255, 0);	// Standard net mask
    IP4_ADDR(&gw,      192, 168, 0, 1);		// Your host system
    IP4_ADDR(&ipaddr,  192, 168, 0, 2);		// The Slug's IP address

    struct netif *netif = netif_add(&ipaddr,&netmask,&gw, sosIfInit, ip_input);
    netif_set_default(netif);

    // Generate an arp entry for our gateway
    // We should only need to do this once, but Linux seems to love ignoring
    // ARP queries (why??!), so we keep trying until we get a response
    struct pbuf *p = etharp_query(netif, &netif->gw, NULL);
    do {
        (*netif_default->linkoutput)(netif, p);	// Direct output
        sos_usleep(100000);	// Wait a while for a reply
    } while (!etharp_entry_present(&netif->gw));
    pbuf_free(p);

    // Finish the initialisation of the nslu2 hardware
    ixOsalOSServicesFinaliseInit();


    /* Initialise NFS */
    int r = nfs_init(gw); assert(!r);

    mnt_get_export_list();	// Print out the exports on this server

    const char *msg;
    if (mnt_mount(NFS_DIR, &mnt_point))		// Mount aos_nfs
	msg = "%s: Error mounting path '%s'!\n";
    else
	msg = "Successfully mounted '%s'\n";
    printf(msg, __FUNCTION__, NFS_DIR);

    printf("Finished %s\n\n", __FUNCTION__);
}
Ejemplo n.º 7
0
// Implement mem_init(tile_id, file)
static PyObject *python_mem_init(PyObject *self, PyObject *args) {
    unsigned int memory_id;
    char *path;
    if (!args || !PyArg_ParseTuple(args, "Is", &memory_id, &path)) {
        printf("Invalid arguments when running mem_init\n");
        return Py_None;
    }

    mem_init(&memory_id, 1, path);

    return Py_None;
}
Ejemplo n.º 8
0
Archivo: init.c Proyecto: Gilles86/afni
 void
fileinit(Void)
{
	register char *s;
	register int i, j;

	lastiolabno = 100000;
	lastlabno = 0;
	lastvarno = 0;
	nliterals = 0;
	nerr = 0;

	infile = stdin;

	maxtoklen = 502;
	token = (char *)ckalloc(maxtoklen+2);
	memset(dflttype, tyreal, 26);
	memset(dflttype + 'i' - 'a', tyint, 6);
	memset(hextoi_tab, 16, sizeof(hextoi_tab));
	for(i = 0, s = "0123456789abcdef"; *s; i++, s++)
		hextoi(*s) = i;
	for(i = 10, s = "ABCDEF"; *s; i++, s++)
		hextoi(*s) = i;
	for(j = 0, s = "abcdefghijklmnopqrstuvwxyz"; i = *s++; j++)
		Letters[i] = Letters[i+'A'-'a'] = j;

	ctls = ALLOCN(maxctl+1, Ctlframe);
	extsymtab = ALLOCN(maxext, Extsym);
	eqvclass = ALLOCN(maxequiv, Equivblock);
	hashtab = ALLOCN(maxhash, Hashentry);
	labeltab = ALLOCN(maxstno, Labelblock);
	litpool = ALLOCN(maxliterals, Literal);
	labarray = (struct Labelblock **)ckalloc(maxlablist*
					sizeof(struct Labelblock *));
	fmt_init();
	mem_init();
	np_init();

	ctlstack = ctls++;
	lastctl = ctls + maxctl;
	nextext = extsymtab;
	lastext = extsymtab + maxext;
	lasthash = hashtab + maxhash;
	labtabend = labeltab + maxstno;
	highlabtab = labeltab;
	main_alias[0] = '\0';
	if (forcedouble)
		dfltproc[TYREAL] = dfltproc[TYDREAL];

/* Initialize the routines for providing C output */

	out_init ();
}
Ejemplo n.º 9
0
int Winapi
ec_init(void)
{
    char *	initfile = (char *) 0;
    char	filename_buf[MAX_PATH_LEN];
    pword	goal,module;
    int		res;

    
    /*----------------------------------------------------------------
     * Make the connection to the shared heap, if any.
     * Because of mmap problems on some machines this should
     * happen AFTER initializing the message passing system.
     *----------------------------------------------------------------*/
    mem_init(ec_options.init_flags);	/* depends on -c and -m options */

    /*
     * Init the global (shared) eclipse structures, dictionary, code...
     * Maybe load a saved state.
     * Note that we don't have an engine yet!
     */
    eclipse_global_init(ec_options.init_flags);


    /*----------------------------------------------------------------
     * Setup the Prolog engine
     *----------------------------------------------------------------*/
    /*
     * Initialize the Prolog engine
     */
    emu_init(ec_options.init_flags, 0);

    initfile = strcat(strcpy(filename_buf, ec_eclipse_home), "/lib/kernel.eco");
    if (ec_access(initfile, R_OK) < 0)
    {
	initfile = strcat(strcpy(filename_buf, ec_eclipse_home), "/lib/kernel.pl");
	if (ec_access(initfile, R_OK) < 0)
	{
	    ec_panic("Aborting: Can't find boot file! Please check either\na) your program's setting for eclipsedir in ec_set_option(), or\nb) your setting for ECLIPSEDIR environment variable.\n","ec_init()");
	}
    }	    

    res = eclipse_boot(initfile);
    if (res != PSUCCEED)
    	return res;

    goal = ec_term(ec_did("main",1), ec_long(ec_options.init_flags & INIT_SHARED ? 0 : 1));
    module.val.did = ec_.d.kernel_sepia;
    module.tag.kernel = ModuleTag(ec_.d.kernel_sepia);
    if (main_emulc_noexit(goal.val, goal.tag, module.val, module.tag) != PYIELD)
	return PFAIL;
    return PSUCCEED;
}
Ejemplo n.º 10
0
/* initialize the simulator */
void
sim_init(void)
{
  sim_num_refs = 0;

  /* allocate and initialize register file */
  regs_init(&regs);

  /* allocate and initialize memory space */
  mem = mem_create("mem");
  mem_init(mem);
}
Ejemplo n.º 11
0
void uos_init (void)
{
	/* Baud 19200. */
	UBRR = ((int) (KHZ * 1000L / 19200) + 8) / 16 - 1;

	/* Enable external RAM: port A - address/data, port C - address. */
	setb (SRE, MCUCR);
	mem_init (&pool, RAM_START, RAM_END);

	slip_init (&slip, 0, "slip0", 80, &pool, KHZ, 38400);
	task_create (hello, 0, "hello", 1, task, sizeof (task));
}
Ejemplo n.º 12
0
/*
 * Set up kernel memory allocators
 */
static void __init mm_init(void)
{
	/*
	 * page_cgroup requires countinous pages as memmap
	 * and it's bigger than MAX_ORDER unless SPARSEMEM.
	 */
	page_cgroup_init_flatmem();
	mem_init();
	kmem_cache_init();
	pgtable_cache_init();
	vmalloc_init();
}
Ejemplo n.º 13
0
/**
 * Perform Sanity check of user-configurable values, and initialize all modules.
 */
void ICACHE_FLASH_ATTR
lwip_init(void)
{
    /* Modules initialization */
    stats_init();
#if !NO_SYS
    sys_init();
#endif /* !NO_SYS */
    mem_init();
    memp_init();
    pbuf_init();
    netif_init();
#if LWIP_SOCKET
    lwip_socket_init();
#endif /* LWIP_SOCKET */
    ip_init();
#if LWIP_ARP
    etharp_init();
#endif /* LWIP_ARP */
#if LWIP_RAW
    raw_init();
#endif /* LWIP_RAW */
#if LWIP_UDP
    udp_init();
#endif /* LWIP_UDP */
#if LWIP_TCP
    tcp_init();
#endif /* LWIP_TCP */
#if LWIP_SNMP
    snmp_init();
#endif /* LWIP_SNMP */
#if LWIP_AUTOIP
    autoip_init();
#endif /* LWIP_AUTOIP */
#if LWIP_IGMP
    igmp_init();
#endif /* LWIP_IGMP */
#if LWIP_DNS
    dns_init();
#endif /* LWIP_DNS */
#if LWIP_IPV6
    ip6_init();
    nd6_init();
#if LWIP_IPV6_MLD
    mld6_init();
#endif /* LWIP_IPV6_MLD */
#endif /* LWIP_IPV6 */

#if LWIP_TIMERS
    sys_timeouts_init();
#endif /* LWIP_TIMERS */
}
Ejemplo n.º 14
0
/**
 * Unit test's main function.
 */
int
main (int __attr_unused___ argc,
      char __attr_unused___ **argv)
{
  TEST_INIT ();

  const bytecode_data_header_t *bytecode_data_p;
  jsp_status_t parse_status;

  mem_init ();

  // #1
  char program1[] = "a=1;var a;";

  serializer_init ();
  parser_set_show_instrs (true);
  parse_status = parser_parse_script ((jerry_api_char_t *) program1, strlen (program1), &bytecode_data_p);

  JERRY_ASSERT (parse_status == JSP_STATUS_OK && bytecode_data_p != NULL);

  vm_instr_t instrs[] =
  {
    getop_meta (OPCODE_META_TYPE_SCOPE_CODE_FLAGS, // [ ]
                OPCODE_SCOPE_CODE_FLAGS_NOT_REF_ARGUMENTS_IDENTIFIER
                | OPCODE_SCOPE_CODE_FLAGS_NOT_REF_EVAL_IDENTIFIER,
                VM_IDX_EMPTY),
    getop_reg_var_decl (VM_REG_FIRST, VM_REG_GENERAL_FIRST, 0),
    getop_var_decl (0),             // var a;
    getop_assignment (130, 1, 1),   // $tmp0 = 1;
    getop_assignment (0, 6, 130),   // a = $tmp0;
    getop_ret ()                    // return;
  };

  JERRY_ASSERT (instrs_equal (bytecode_data_p->instrs_p, instrs, 5));

  serializer_free ();

  // #2
  char program2[] = "var var;";

  serializer_init ();
  parser_set_show_instrs (true);
  parse_status = parser_parse_script ((jerry_api_char_t *) program2, strlen (program2), &bytecode_data_p);

  JERRY_ASSERT (parse_status == JSP_STATUS_SYNTAX_ERROR && bytecode_data_p == NULL);

  serializer_free ();

  mem_finalize (false);

  return 0;
} /* main */
Ejemplo n.º 15
0
int main(void)
{
	u8 key,fontok=0; 
   	Stm32_Clock_Init(9);	//系统时钟设置
	delay_init(72);			//延时初始化
	uart_init(72,115200); 	//串口1初始化 
	LCD_Init();				//初始化液晶 
	LED_Init();         	//LED初始化	 
	KEY_Init();				//按键初始化	 
	usmart_dev.init(72);	//usmart初始化	
 	USART2_Init(36,115200);	//初始化串口2 
	TP_Init();				//初始化触摸屏
	mem_init(SRAMIN);		//初始化内部内存池	    
 	exfuns_init();			//为fatfs相关变量申请内存  
  	f_mount(0,fs[0]); 		//挂载SD卡 
	key=KEY_Scan(0);  
	if(key==KEY_RIGHT)		//强制校准
	{
		LCD_Clear(WHITE);	//清屏
		TP_Adjust();  		//屏幕校准 
		TP_Save_Adjdata();	  
		LCD_Clear(WHITE);	//清屏
	}
	fontok=font_init();		//检查字库是否OK
	if(fontok||key==KEY_DOWN)//需要更新字库				 
	{
		LCD_Clear(WHITE);		   	//清屏
 		POINT_COLOR=RED;			//设置字体为红色	   	   	  
		LCD_ShowString(60,50,200,16,16,"ALIENTEK STM32");
		while(SD_Initialize())		//检测SD卡
		{
			LCD_ShowString(60,70,200,16,16,"SD Card Failed!");
			delay_ms(200);
			LCD_Fill(60,70,200+60,70+16,WHITE);
			delay_ms(200);		    
		}								 						    
		LCD_ShowString(60,70,200,16,16,"SD Card OK");
		LCD_ShowString(60,90,200,16,16,"Font Updating...");
		key=update_font(20,110,16,0);//从SD卡更新
		while(key)//更新失败		
		{			 		  
			LCD_ShowString(60,110,200,16,16,"Font Update Failed!");
			delay_ms(200);
			LCD_Fill(20,110,200+20,110+16,WHITE);
			delay_ms(200);		       
		} 		  
		LCD_ShowString(60,110,200,16,16,"Font Update Success!");
		delay_ms(1500);	
		LCD_Clear(WHITE);//清屏	       
	}  
	sim900a_test();
}
Ejemplo n.º 16
0
/*! Initialize user process environment */
void prog_init ( void *args )
{
	/* open stdin & stdout */
	stdio_init ();

	/* initialize dynamic memory */
	pi.mpool = mem_init ( pi.heap, pi.heap_size );

	/* call starting function */
	( (void (*) ( void * ) ) pi.entry ) ( args );

	pthread_exit ( NULL );
}
Ejemplo n.º 17
0
int main(int argc, char *argv[])
{
	mem_init();
#ifdef __linux__
#if DXX_WORDS_NEED_ALIGNMENT
	prctl(PR_SET_UNALIGN, PR_UNALIGN_NOPRINT, 0, 0, 0);
#endif
#else
	error_init(msgbox_error);
	set_warn_func(msgbox_warning);
#endif
	return dsx::main(argc, argv);
}
Ejemplo n.º 18
0
void vlwIPInit( void )
{
    /* Initialize lwIP and its interface layer. */
	sys_init();
	mem_init();								
	memp_init();
	pbuf_init();
	netif_init();
	ip_init();
	sys_set_state(( signed char * ) "lwIP", lwipTCP_STACK_SIZE);
	tcpip_init( NULL, NULL );	
	sys_set_default_state();
}
Ejemplo n.º 19
0
int main(int argc,char **argv)
{
    sys_init();
    mem_init();
    memp_init();
    pbuf_init();


    sys_thread_new((void *)(main_thread), NULL);
    pause();

    return 0;
}
Ejemplo n.º 20
0
int main(int argc, char **argv)
{
#if ! defined(_WIN32)
     __log_error = (void (*)(void *, const char *,...)) log_server;     /*set c-icap library log  function */
#else
     __vlog_error = vlog_server;        /*set c-icap library  log function */
#endif

     mem_init();
     init_internal_lookup_tables();
     ci_acl_init();
     init_http_auth();
     ci_txt_template_init();
     ci_txt_template_set_dir(DATADIR"templates");

     if (!(CONF.MAGIC_DB = ci_magic_db_load(CONF.magics_file))) {
          ci_debug_printf(1, "Can not load magic file %s!!!\n",
                          CONF.magics_file);
     }
     init_conf_tables();
     request_stats_init();
     init_modules();
     init_services();
     config(argc, argv);
     compute_my_hostname();
     ci_debug_printf(2, "My hostname is:%s\n", MY_HOSTNAME);

#if ! defined(_WIN32)
     if (is_icap_running(CONF.PIDFILE)) {
          ci_debug_printf(1, "c-icap server already running!\n");
          exit(-1);
     }
     if (DAEMON_MODE)
          run_as_daemon();
     if (!set_running_permissions(CONF.RUN_USER, CONF.RUN_GROUP))
          exit(-1);
     store_pid(CONF.PIDFILE);
#endif

     if (!log_open()) {
          ci_debug_printf(1, "Can not init loggers. Exiting.....\n");
          exit(-1);
     }
     if (!init_server(CONF.ADDRESS, CONF.PORT, &(CONF.PROTOCOL_FAMILY)))
          return -1;
     post_init_modules();
     post_init_services();
     start_server();
     clear_pid(CONF.PIDFILE);
     return 0;
}
Ejemplo n.º 21
0
Archivo: mem.c Proyecto: jihnsius/d2r
void mem_free( void * buffer )
{
	int id;

	if (Initialized==0)
		mem_init();

#if MEMSTATS
	{
		unsigned long	theFreeMem = 0;
	
		if (sMemStatsFileInitialized)
		{
			theFreeMem = FreeMem();
		
			fprintf(sMemStatsFile,
					"\n%9u bytes free before attempting: FREE", theFreeMem);
		}
	}
#endif	// end of ifdef memstats

	if (buffer==NULL  &&  (!out_of_memory))
	{
		con_printf(CON_CRITICAL, "\nMEM_FREE_NULL: An attempt was made to free the null pointer.\n" );
		Warning( "MEM: Freeing the NULL pointer!" );
		Int3();
		return;
	}

	id = mem_find_id( buffer );

	if (id==-1 &&  (!out_of_memory))
	{
		con_printf(CON_CRITICAL, "\nMEM_FREE_NOMALLOC: An attempt was made to free a ptr that wasn't\nallocated with mem.h included.\n" );
		Warning( "MEM: Freeing a non-malloced pointer!" );
		Int3();
		return;
	}
	
	mem_check_integrity( id );
	
	BytesMalloced -= MallocSize[id];

	free( buffer );

	Present[id] = 0;
	MallocBase[id] = 0;
	MallocSize[id] = 0;

	free_list[ --num_blocks ] = id;
}
Ejemplo n.º 22
0
void test_lookup_existing_user(test_t *t) {
    mem_init();
    user_t *user = user_new_with_name("test");
    mem_store_user(user);

    user_t *found = NULL;

    mem_res res = mem_lookup_user("test", &found);

    assert_eq_int(t,MEM_OK, res);
    assert_eq_str(t,"test", found->username);

    user_free(user);
}
Ejemplo n.º 23
0
//*------------------------------------------------------------------------------------------------
//* 函数名称 : __ilvInitLwIP
//* 功能描述 : 完成LwIP最基本的初始化工作
//* 入口参数 : 无
//* 出口参数 : 无
//*------------------------------------------------------------------------------------------------
__inline void __ilvInitLwIP(void)
{
	sys_init();
	
	mem_init();
	
	memp_init();
	
	pbuf_init();
	
	/*	下面的这个函数有一定的问题 在接受消息的时候一直不堵塞,因为按照要求在没有消息的时候 应该是堵塞的,但是现在一直没有堵塞*/
	/*	这个函数是对前面的函数的封装,里面创建了一个接受的进程	*/
	tcpip_init(NULL, NULL);
}
Ejemplo n.º 24
0
  Vector(GlobalOrdinal startIdx, LocalOrdinal local_sz)
   : startIndex(startIdx),
     local_size(local_sz),
     coefs(local_size)
  {
    MemInitOp<Scalar> mem_init;
    mem_init.ptr = &coefs[0];
    mem_init.n = local_size;

    #pragma omp parallel for
    for(size_t i=0; i<mem_init.n; ++i) {
      mem_init(i);
    }
  }
Ejemplo n.º 25
0
Archivo: main.c Proyecto: ahua/c
void main(void)
{
  memory_end = (1<<20) + (*(unsigned short *)0x90002);
  memory_end &= 0xfffff000;
  if( memory_end > 16 * 1024 * 1024) 
    memory_end = 16*1024*1024;
  buffer_memory_end = 4*1024*1024;
  main_memory_start = buffer_memory_end;

  mem_init(main_memory_start, memory_end);
  tty_init();

  for(;;);
}
Ejemplo n.º 26
0
void test_lookup_non_exsisting_user(test_t *t) {
    mem_init();
    user_t *user = user_new_with_name("test");
    mem_store_user(user);

    user_t *found = NULL;

    mem_res res = mem_lookup_user("test-non", &found);

    assert_eq_int(t,MEM_NOTFOUND, res);
    assert(t,"'found' is not nil", NULL == found);

    user_free(user);
}
Ejemplo n.º 27
0
/**
 * Perform Sanity check of user-configurable values, and initialize all modules.
 */
void
lwip_init(void)
{
  /* Sanity check user-configurable values */
  lwip_sanity_check();

  /* Modules initialization */
  stats_init();
  sys_init();
  mem_init();
  memp_init();
  pbuf_init();
  netif_init();
#if LWIP_SOCKET
  lwip_socket_init();
#endif /* LWIP_SOCKET */
  ip_init();
#if LWIP_ARP
  etharp_init();
#endif /* LWIP_ARP */
#if LWIP_RAW
  raw_init();
#endif /* LWIP_RAW */
#if LWIP_UDP
  udp_init();
#endif /* LWIP_UDP */
#if LWIP_TCP
  tcp_init();
#endif /* LWIP_TCP */
#if LWIP_AUTOIP
  autoip_init();
#endif /* LWIP_AUTOIP */
#if LWIP_IGMP
  igmp_init();
#endif /* LWIP_IGMP */
#if LWIP_DNS
  dns_init();
#endif /* LWIP_DNS */

#if !NO_SYS
  /* in the Xilinx lwIP 1.2.0 port, lwip_init() was added as a convenience utility function
     to initialize all the lwIP layers. lwIP 1.3.0 introduced lwip_init() in the base lwIP 
     itself. However a user cannot use lwip_init() regardless of whether it is raw or socket
     modes. The following call to lwip_sock_init() is made to make sure that lwIP is properly
     initialized in both raw & socket modes with just a call to lwip_init().
   */
  lwip_sock_init();
#endif
}
Ejemplo n.º 28
0
/*
* Startup initialization of a MIX machine.
* Sets condition and overflow bits, clears registers,
* and creates and initializes memory.
* param machine - MIX machine to initialize.
*/
void startup_init(mix_pt machine)
{
    printf("Starting MIX machine...\n");
    
    // Set the status bits for the comparison bit and overflow bit to:
    // EQUAL and NO_OVERFLOW, repectively.
    machine->condition = EQUAL;
    machine->overflow = NO_OVERFLOW;

    // Initialize registers to +0.
    reg_init(machine);

    // Create and initialize memory.
    mem_init(machine);
}
Ejemplo n.º 29
0
void BSP_Init(void)
{
	NVIC_Configuration();	 
	delay_init();	    			 //延时函数初始化	  
	uart_init(115200);	 		//串口初始化为9600
	LED_Init();		  				//初始化与LED连接的硬件接口
	TFTLCD_Init();			   	//初始化LCD		 
	tp_dev.init();
//	tp_dev.adjust();
	mem_init();				//初始化内存池

	RCC_AHBPeriphClockCmd(RCC_AHBPeriph_CRC,ENABLE);
  GUI_Init();
	
}
Ejemplo n.º 30
0
void exec_loop(){
	mem_init();
	rom_init();
	readrom("nestest.nes");
	cpu_init(&cpu);
	cpu_reset(&cpu);
	ppu_init();
	cpu_exec(&cpu,18);
	cpu_trigger_nmi(&cpu);
	cpu_exec(&cpu,30);
		//check for interrupts
		//mem_dump(mem,8);
		//test = 0;
		//printf("test = %d",test);
}