コード例 #1
0
ファイル: exports.c プロジェクト: zig/kos-dcplaya
int export_init() {
	/* Add our two export tables */
	if (nmmgr_handler_add(&st_kern.nmmgr) < 0)
		return -1;
	if (nmmgr_handler_add(&st_arch.nmmgr) < 0)
		return -1;
	return 0;
}
コード例 #2
0
ファイル: tcpfs.c プロジェクト: WinCoder/DreamShell
int tcpfs_init() {
	
	if (inited)
		return 0;

	inited = 1;

	/* Register with VFS */
	return nmmgr_handler_add(&vh.nmmgr) ||  nmmgr_handler_add(&vh_udpfs.nmmgr);
}
コード例 #3
0
ファイル: tcpfs.c プロジェクト: pcercuei/dcplaya
int tcpfs_init()
{
  if (init)
    return 0;

  init = 1;

  /* Register with VFS */
  return nmmgr_handler_add(&vh) ||  nmmgr_handler_add(&vh_udpfs);
}
コード例 #4
0
ファイル: http.c プロジェクト: pcercuei/dcplaya
int httpfs_init()
{
  if (init)
    return 0;

  init = 1;

  /* Register with VFS */
  return nmmgr_handler_add(&vh);
}
コード例 #5
0
ファイル: fs_dcload.c プロジェクト: KallistiOS/KallistiOS
/* used for dcload-ip + lwIP
 * assumes fs_dcload_init() was previously called
 */
int fs_dcload_init_lwip(void *p) {
    /* Check for combination of KOS networking and dcload-ip */
    if((dcload_type == DCLOAD_TYPE_IP) && (__kos_init_flags & INIT_NET)) {
        lwip_dclsc = p;

        dbglog(DBG_INFO, "dc-load console support enabled (lwIP)\n");
    }
    else
        return -1;

    /* Register with VFS */
    return nmmgr_handler_add(&vh.nmmgr);
}
コード例 #6
0
ファイル: syscalls.c プロジェクト: pcercuei/dcplaya
void fs_shutdown()
{
  if (!init)
    return;
  init = 0;
  nmmgr_handler_remove(&vh);

  old_printk_func = real_old_printk_func;

  if (oldfs) {
    nmmgr_handler_add(oldfs);
    oldfs = NULL;
  }

  sem_destroy(result_sema);
  result_sema = NULL;
}
コード例 #7
0
ファイル: fs_dcload.c プロジェクト: KallistiOS/KallistiOS
/* Call fs_dcload_init_console() before calling fs_dcload_init() */
int fs_dcload_init() {
    // This was already done in init_console.
    if(dcload_type == DCLOAD_TYPE_NONE)
        return -1;

    /* Check for combination of KOS networking and dcload-ip */
    if((dcload_type == DCLOAD_TYPE_IP) && (__kos_init_flags & INIT_NET)) {
        dbglog(DBG_INFO, "dc-load console+kosnet, will switch to internal ethernet\n");
        return -1;
        /* if (old_printk) {
            dbgio_set_printk(old_printk);
            old_printk = 0;
        }
        return -1; */
    }

    /* Register with VFS */
    return nmmgr_handler_add(&vh.nmmgr);
}
コード例 #8
0
ファイル: fs_rz.c プロジェクト: pcercuei/dcplaya
/* Initialize the file system */
int fs_rz_init(const unsigned char * romdisk)
{
  SDDEBUG("[%s] [%p]\n", __FUNCTION__, romdisk);

  /* Could not create 2 ramdisks. */
  if (root) {
    SDERROR("[%s] : only one ROM disk is available.\n", __FUNCTION__);
    return -1;
  }
  if (!romdisk) {
    SDERROR("[%s] : bad pointer.\n", __FUNCTION__);
    return -1;
  }

  if (memcmp(romdisk,"RD-BEN",6)) {
    SDERROR("[%s] : invalid romdisk.\n", __FUNCTION__);
    return -1;
  }
      
  root_entries = * (uint16 *) (romdisk + 6);
  SDDEBUG("[%s] : %d entries\n",__FUNCTION__, root_entries);

  /* Register with VFS */
  if (nmmgr_handler_add(&vh.nmmgr)) {
    SDERROR("-->fs_handler_add failed\n");
    return -1;
  }

  root = romdisk;
  cur_rd = 0;
  cached_addr = 0;
  cached_shadow = 0;
  memset(&myrd,0,sizeof(myrd));
  memset(&mydh,0,sizeof(mydh));
  cur_dh = 0;

  return 0;
}
コード例 #9
0
ファイル: syscalls.c プロジェクト: pcercuei/dcplaya
int fs_init()
{
  nmmgr_handler_t * hnd;

  if (init)
    return 0;

  init = 1;

  result_sema = sem_create(0);

  real_old_printk_func = old_printk_func;
  old_printk_func = printk_func;

  hnd = nmmgr_lookup("/pc");
  if (hnd) {
    nmmgr_handler_remove(hnd);
    oldfs = hnd;
  }

  /* Register with VFS */
  return nmmgr_handler_add(&vh);
}
コード例 #10
0
ファイル: module.c プロジェクト: DC-SWAT/DreamShell
int lib_open(klibrary_t * lib) {
	luaopen_task(GetLuaState());
	RegisterLuaLib(lib_get_name(), (LuaRegLibOpen *)luaopen_task);
	return nmmgr_handler_add(&ds_luaTask_hnd.nmmgr);
}
コード例 #11
0
ファイル: module.c プロジェクト: DC-SWAT/DreamShell
int lib_open(klibrary_t * lib) {
    tolua_STD_open(GetLuaState());
	RegisterLuaLib(lib_get_name(), (LuaRegLibOpen *)tolua_STD_open);
    return nmmgr_handler_add(&ds_luaSTD_hnd.nmmgr);
}