mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-24 22:04:54 +08:00
[Kernel] Change the order of initialization.
1. Remove INIT_FS_EXPORT and change INIT_DEVICE_EXPORT as the first item in the initalization thread. 2. Move the eth_system_device_init into INIT_PREV_EXPORT item.
This commit is contained in:
@@ -820,7 +820,7 @@ int elm_init(void)
|
||||
|
||||
return 0;
|
||||
}
|
||||
INIT_FS_EXPORT(elm_init);
|
||||
INIT_COMPONENT_EXPORT(elm_init);
|
||||
|
||||
/*
|
||||
* RT-Thread Device Interface for ELM FatFs
|
||||
|
||||
@@ -726,5 +726,5 @@ int dfs_jffs2_init(void)
|
||||
rt_kprintf("init jffs2 lock mutex okay\n");
|
||||
return 0;
|
||||
}
|
||||
INIT_FS_EXPORT(dfs_jffs2_init);
|
||||
INIT_COMPONENT_EXPORT(dfs_jffs2_init);
|
||||
|
||||
|
||||
@@ -1159,4 +1159,5 @@ int nfs_init(void)
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
INIT_FS_EXPORT(nfs_init);
|
||||
INIT_COMPONENT_EXPORT(nfs_init);
|
||||
|
||||
|
||||
@@ -427,7 +427,7 @@ int dfs_ramfs_init(void)
|
||||
|
||||
return 0;
|
||||
}
|
||||
INIT_FS_EXPORT(dfs_ramfs_init);
|
||||
INIT_COMPONENT_EXPORT(dfs_ramfs_init);
|
||||
|
||||
struct dfs_ramfs* dfs_ramfs_create(rt_uint8_t *pool, rt_size_t size)
|
||||
{
|
||||
|
||||
@@ -330,5 +330,5 @@ int dfs_romfs_init(void)
|
||||
dfs_register(&_romfs);
|
||||
return 0;
|
||||
}
|
||||
INIT_FS_EXPORT(dfs_romfs_init);
|
||||
INIT_COMPONENT_EXPORT(dfs_romfs_init);
|
||||
|
||||
|
||||
@@ -24,22 +24,23 @@
|
||||
#include <rtthread.h>
|
||||
#include <dfs.h>
|
||||
#include <dfs_fs.h>
|
||||
#include <dfs_file.h>
|
||||
|
||||
#include "dfs_skt_fs.h"
|
||||
|
||||
int dfs_skt_mount(struct dfs_filesystem* fs, unsigned long rwflag, const void* data)
|
||||
{
|
||||
return DFS_STATUS_OK;
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
int dfs_skt_unmount(struct dfs_filesystem* fs)
|
||||
{
|
||||
return DFS_STATUS_OK;
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
int dfs_skt_ioctl(struct dfs_fd* file, int cmd, void* args)
|
||||
{
|
||||
return -DFS_STATUS_EIO;
|
||||
return -RT_EIO;
|
||||
}
|
||||
|
||||
int dfs_skt_read(struct dfs_fd* file, void *buf, rt_size_t count)
|
||||
@@ -49,22 +50,22 @@ int dfs_skt_read(struct dfs_fd* file, void *buf, rt_size_t count)
|
||||
|
||||
int dfs_skt_lseek(struct dfs_fd* file, rt_off_t offset)
|
||||
{
|
||||
return -DFS_STATUS_EIO;
|
||||
return -RT_EIO;
|
||||
}
|
||||
|
||||
int dfs_skt_close(struct dfs_fd* file)
|
||||
{
|
||||
return DFS_STATUS_OK;
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
int dfs_skt_open(struct dfs_fd* file)
|
||||
{
|
||||
return DFS_STATUS_OK;
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
int dfs_skt_stat(struct dfs_filesystem* fs, const char *path, struct stat *st)
|
||||
{
|
||||
return DFS_STATUS_OK;
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
int dfs_skt_getdents(struct dfs_fd* file, struct dirent* dirp, rt_uint32_t count)
|
||||
@@ -72,26 +73,32 @@ int dfs_skt_getdents(struct dfs_fd* file, struct dirent* dirp, rt_uint32_t count
|
||||
return count * sizeof(struct dirent);
|
||||
}
|
||||
|
||||
static const struct dfs_filesystem_operation _skt_fs =
|
||||
static const struct dfs_file_ops _skt_fops =
|
||||
{
|
||||
"skt",
|
||||
DFS_FS_FLAG_DEFAULT,
|
||||
dfs_skt_mount,
|
||||
dfs_skt_unmount,
|
||||
RT_NULL,
|
||||
RT_NULL,
|
||||
|
||||
dfs_skt_open,
|
||||
dfs_skt_close,
|
||||
dfs_skt_ioctl,
|
||||
dfs_skt_read,
|
||||
RT_NULL,
|
||||
RT_NULL,
|
||||
NULL, /* write */
|
||||
NULL, /* flush */
|
||||
dfs_skt_lseek,
|
||||
dfs_skt_getdents,
|
||||
RT_NULL,
|
||||
};
|
||||
|
||||
static const struct dfs_filesystem_ops _skt_fs =
|
||||
{
|
||||
"skt",
|
||||
DFS_FS_FLAG_DEFAULT,
|
||||
&_skt_fops,
|
||||
|
||||
dfs_skt_mount,
|
||||
dfs_skt_unmount,
|
||||
NULL, /* mkfs */
|
||||
NULL, /* statfs */
|
||||
|
||||
NULL, /* unlink */
|
||||
dfs_skt_stat,
|
||||
RT_NULL,
|
||||
NULL, /* rename */
|
||||
};
|
||||
|
||||
int dfs_skt_init(void)
|
||||
@@ -100,4 +107,5 @@ int dfs_skt_init(void)
|
||||
dfs_register(&_skt_fs);
|
||||
return 0;
|
||||
}
|
||||
INIT_FS_EXPORT(dfs_skt_init);
|
||||
INIT_COMPONENT_EXPORT(dfs_skt_init);
|
||||
|
||||
|
||||
@@ -668,5 +668,5 @@ int dfs_uffs_init(void)
|
||||
}
|
||||
return -RT_ERROR;
|
||||
}
|
||||
INIT_FS_EXPORT(dfs_uffs_init);
|
||||
INIT_COMPONENT_EXPORT(dfs_uffs_init);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user