summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2017-12-12 07:36:37 +0800
committerBernard Xiong <[email protected]>2017-12-12 07:36:37 +0800
commit2f409c85f1faf3662c9ee99eed78e460286ec046 (patch)
tree8cb7d40433fa873576a75bca6a45d3456eb6893e /components
parent5ec1046ca9dd63078a154401553d96aa8ae1933f (diff)
[Kernel] Use rt_object_get_information to get object chain
Diffstat (limited to 'components')
-rw-r--r--components/dfs/filesystems/devfs/devfs.c5
-rw-r--r--components/net/lwip-1.3.2/src/arch/sys_arch_init.c6
-rw-r--r--components/net/lwip-1.4.1/src/arch/sys_arch.c5
-rw-r--r--components/net/lwip-2.0.2/src/arch/sys_arch.c5
4 files changed, 9 insertions, 12 deletions
diff --git a/components/dfs/filesystems/devfs/devfs.c b/components/dfs/filesystems/devfs/devfs.c
index 6bfeccb578..4f2f0ebcd9 100644
--- a/components/dfs/filesystems/devfs/devfs.c
+++ b/components/dfs/filesystems/devfs/devfs.c
@@ -150,13 +150,12 @@ int dfs_device_fs_open(struct dfs_fd *file)
struct device_dirent *root_dirent;
rt_uint32_t count = 0;
- extern struct rt_object_information rt_object_container[];
-
/* lock scheduler */
rt_enter_critical();
/* traverse device object */
- information = &rt_object_container[RT_Object_Class_Device];
+ information = rt_object_get_information(RT_Object_Class_Device);
+ RT_ASSERT(information != RT_NULL);
for (node = information->object_list.next; node != &(information->object_list); node = node->next)
{
count ++;
diff --git a/components/net/lwip-1.3.2/src/arch/sys_arch_init.c b/components/net/lwip-1.3.2/src/arch/sys_arch_init.c
index 73aa34171c..f70de7cc0a 100644
--- a/components/net/lwip-1.3.2/src/arch/sys_arch_init.c
+++ b/components/net/lwip-1.3.2/src/arch/sys_arch_init.c
@@ -41,8 +41,6 @@ static void tcpip_init_done_callback(void *arg)
struct rt_object* object;
struct rt_object_information *information;
- extern struct rt_object_information rt_object_container[];
-
LWIP_ASSERT("invalid arg.\n",arg);
IP4_ADDR(&gw, 0,0,0,0);
@@ -53,7 +51,9 @@ static void tcpip_init_done_callback(void *arg)
rt_enter_critical();
/* for each network interfaces */
- information = &rt_object_container[RT_Object_Class_Device];
+ information = rt_object_get_information(RT_Object_Class_Device);
+ RT_ASSERT(information != RT_NULL);
+
for (node = information->object_list.next; node != &(information->object_list); node = node->next)
{
object = rt_list_entry(node, struct rt_object, list);
diff --git a/components/net/lwip-1.4.1/src/arch/sys_arch.c b/components/net/lwip-1.4.1/src/arch/sys_arch.c
index 3ae6360198..d480242cd0 100644
--- a/components/net/lwip-1.4.1/src/arch/sys_arch.c
+++ b/components/net/lwip-1.4.1/src/arch/sys_arch.c
@@ -72,8 +72,6 @@ static void tcpip_init_done_callback(void *arg)
struct rt_object* object;
struct rt_object_information *information;
- extern struct rt_object_information rt_object_container[];
-
LWIP_ASSERT("invalid arg.\n",arg);
IP4_ADDR(&gw, 0,0,0,0);
@@ -84,7 +82,8 @@ static void tcpip_init_done_callback(void *arg)
rt_enter_critical();
/* for each network interfaces */
- information = &rt_object_container[RT_Object_Class_Device];
+ information = rt_object_get_information(RT_Object_Class_Device);
+ RT_ASSERT(information != RT_NULL);
for (node = information->object_list.next;
node != &(information->object_list);
node = node->next)
diff --git a/components/net/lwip-2.0.2/src/arch/sys_arch.c b/components/net/lwip-2.0.2/src/arch/sys_arch.c
index 06198d5191..c8e1fe1d33 100644
--- a/components/net/lwip-2.0.2/src/arch/sys_arch.c
+++ b/components/net/lwip-2.0.2/src/arch/sys_arch.c
@@ -74,8 +74,6 @@ static void tcpip_init_done_callback(void *arg)
struct rt_object* object;
struct rt_object_information *information;
- extern struct rt_object_information rt_object_container[];
-
LWIP_ASSERT("invalid arg.\n",arg);
IP4_ADDR(&gw, 0,0,0,0);
@@ -86,7 +84,8 @@ static void tcpip_init_done_callback(void *arg)
rt_enter_critical();
/* for each network interfaces */
- information = &rt_object_container[RT_Object_Class_Device];
+ information = rt_object_get_information(RT_Object_Class_Device);
+ RT_ASSERT(information != RT_NULL);
for (node = information->object_list.next;
node != &(information->object_list);
node = node->next)