static void __init mioa701_machine_init(void) { PSLR = 0xff100000; /* SYSDEL=125ms, PWRDEL=125ms, PSLR_SL_ROD=1 */ PCFR = PCFR_DC_EN | PCFR_GPR_EN | PCFR_OPDE; RTTR = 32768 - 1; /* Reset crazy WinCE value */ UP2OCR = UP2OCR_HXOE; pxa2xx_mfp_config(ARRAY_AND_SIZE(mioa701_pin_config)); pxa_set_ffuart_info(NULL); pxa_set_btuart_info(NULL); pxa_set_stuart_info(NULL); mio_gpio_request(ARRAY_AND_SIZE(global_gpios)); bootstrap_init(); pxa_set_fb_info(NULL, &mioa701_pxafb_info); pxa_set_mci_info(&mioa701_mci_info); pxa_set_keypad_info(&mioa701_keypad_info); pxa_set_udc_info(&mioa701_udc_info); pxa_set_ac97_info(&mioa701_ac97_info); pm_power_off = mioa701_poweroff; arm_pm_restart = mioa701_restart; platform_add_devices(devices, ARRAY_SIZE(devices)); gsm_init(); i2c_register_board_info(1, ARRAY_AND_SIZE(mioa701_pi2c_devices)); pxa_set_i2c_info(&i2c_pdata); pxa27x_set_i2c_power_info(NULL); pxa_set_camera_info(&mioa701_pxacamera_platform_data); }
int main(int argc, char* argv[]) { if (argc != 4) { printf ("Usage:\n"); printf ("./eyeunitesource <listenport> <bandwidth> <media file>\n"); return; } // Create a port // Substitute bootsrap in here later char pid[EU_TOKENSTRLEN]; char lt[EU_TOKENSTRLEN]; char port[EU_PORTSTRLEN]; memcpy (port, argv[1], EU_PORTSTRLEN); int bw = atoi (argv[2]); media_file = argv[3]; // global struct bootstrap* btstr = bootstrap_init (APP_ENGINE, port, pid, NULL); if (bootstrap_lobby_create (btstr, lt)) { print_error ("Couldn't create a lobby\n"); } char endpoint[EU_ADDRSTRLEN*4]; snprintf(endpoint, EU_ADDRSTRLEN*4, "tcp://*:%s", port); void* sock = sn_initzmq (endpoint, pid); // Create tree -- needs bootstrap struct tree_t* tree = initialize (sock, 5, bw, pid, port, 0); printTree (tree); pthread_t control_thread_id; pthread_create (&control_thread_id, NULL, control_thread, tree); pthread_t data_thread_id; pthread_create (&data_thread_id, NULL, data_thread, tree); pthread_join (data_thread_id, NULL); pthread_join (control_thread_id, NULL); if (bootstrap_lobby_leave (btstr)) { print_error ("Error leaving lobby\n"); } bootstrap_cleanup (btstr); sn_closesocket (sock); freeTree (tree); return; }
void libSystem_atfork_child(void) { _dyld_fork_child(); _pthread_fork_child(); _malloc_fork_child(); dispatch_atfork_child(); bootstrap_init(); _mach_fork_child(); _libc_fork_child(); _asl_fork_child(); _notify_fork_child(); xpc_atfork_child(); _libSC_info_fork_child(); _pthread_fork_child_postinit(); }
static void __init mioa701_machine_init(void) { PSLR = 0xff100000; /* SYSDEL=125ms, PWRDEL=125ms, PSLR_SL_ROD=1 */ PCFR = PCFR_DC_EN | PCFR_GPR_EN | PCFR_OPDE; RTTR = 32768 - 1; /* Reset crazy WinCE value */ UP2OCR = UP2OCR_HXOE; pxa2xx_mfp_config(ARRAY_AND_SIZE(mioa701_pin_config)); mio_gpio_request(ARRAY_AND_SIZE(global_gpios)); bootstrap_init(); set_pxa_fb_info(&mioa701_pxafb_info); pxa_set_mci_info(&mioa701_mci_info); pxa_set_keypad_info(&mioa701_keypad_info); udc_init(); pm_power_off = mioa701_poweroff; arm_pm_restart = mioa701_restart; platform_add_devices(devices, ARRAY_SIZE(devices)); gsm_init(); mioa701_battery_init(); }
static void __init mioa701_machine_init(void) { int rc; PSLR = 0xff100000; /* SYSDEL=125ms, PWRDEL=125ms, PSLR_SL_ROD=1 */ PCFR = PCFR_DC_EN | PCFR_GPR_EN | PCFR_OPDE; RTTR = 32768 - 1; /* Reset crazy WinCE value */ UP2OCR = UP2OCR_HXOE; /* * Set up the flash memory : DiskOnChip G3 on first static memory bank */ __raw_writel(0x7ff02dd8, MSC0); __raw_writel(0x0001c391, MCMEM0); __raw_writel(0x0001c391, MCATT0); __raw_writel(0x0001c391, MCIO0); pxa2xx_mfp_config(ARRAY_AND_SIZE(mioa701_pin_config)); pxa_set_ffuart_info(NULL); pxa_set_btuart_info(NULL); pxa_set_stuart_info(NULL); rc = gpio_request_array(ARRAY_AND_SIZE(global_gpios)); if (rc) pr_err("MioA701: Failed to request GPIOs: %d", rc); bootstrap_init(); pxa_set_fb_info(NULL, &mioa701_pxafb_info); pxa_set_mci_info(&mioa701_mci_info); pxa_set_keypad_info(&mioa701_keypad_info); pxa_set_udc_info(&mioa701_udc_info); pxa_set_ac97_info(&mioa701_ac97_info); pm_power_off = mioa701_poweroff; platform_add_devices(devices, ARRAY_SIZE(devices)); gsm_init(); i2c_register_board_info(1, ARRAY_AND_SIZE(mioa701_pi2c_devices)); pxa_set_i2c_info(&i2c_pdata); pxa27x_set_i2c_power_info(NULL); pxa_set_camera_info(&mioa701_pxacamera_platform_data); }
void libSystem_initializer(int argc, const char* argv[], const char* envp[], const char* apple[], const struct ProgramVars* vars) { static const struct _libkernel_functions libkernel_funcs = { .version = 1, .dlsym = dlsym, .malloc = malloc, .free = free, .realloc = realloc, ._pthread_exit_if_canceled = _pthread_exit_if_canceled, }; static const struct _libpthread_functions libpthread_funcs = { .version = 1, .exit = exit, }; __libkernel_init(&libkernel_funcs, envp, apple, vars); bootstrap_init(); __libplatform_init(NULL, envp, apple, vars); __pthread_init(&libpthread_funcs, envp, apple, vars); __libc_init(vars, libSystem_atfork_prepare, libSystem_atfork_parent, libSystem_atfork_child, apple); // TODO: Move __malloc_init before __libc_init after breaking malloc's upward link to Libc __malloc_init(apple); _dyld_initializer(); libdispatch_init(); _libxpc_initializer(); __stack_logging_early_finished(); /* <rdar://problem/11588042> * C99 standard has the following in section 7.5(3): * "The value of errno is zero at program startup, but is never set * to zero by any library function." */ errno = 0; } /* * libSystem_atfork_{prepare,parent,child}() are called by libc when we fork, then we deal with running fork handlers * for everyone else. */ void libSystem_atfork_prepare(void) { _libSC_info_fork_prepare(); xpc_atfork_prepare(); dispatch_atfork_prepare(); _pthread_fork_prepare(); _malloc_fork_prepare(); } void libSystem_atfork_parent(void) { _malloc_fork_parent(); _pthread_fork_parent(); dispatch_atfork_parent(); xpc_atfork_parent(); _libSC_info_fork_parent(); }