Skip to content

Commit 87ed8fd

Browse files
committed
limit the size of the object name
1 parent 95fb77d commit 87ed8fd

File tree

18 files changed

+270
-263
lines changed

18 files changed

+270
-263
lines changed

bsp/qemu-vexpress-a9/.config

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
# CONFIG_RT_UTEST_TC_USING_KLIBC is not set
109109
# end of klibc options
110110

111-
CONFIG_RT_NAME_MAX=8
111+
CONFIG_RT_NAME_MAX=16
112112
# CONFIG_RT_USING_ARCH_DATA_TYPE is not set
113113
# CONFIG_RT_USING_NANO is not set
114114
# CONFIG_RT_USING_SMART is not set
@@ -496,6 +496,7 @@ CONFIG_RT_PAGE_MAX_ORDER=11
496496
# CONFIG_PKG_USING_FREEMODBUS is not set
497497
# CONFIG_PKG_USING_NANOPB is not set
498498
# CONFIG_PKG_USING_WIFI_HOST_DRIVER is not set
499+
# CONFIG_PKG_USING_ESP_HOSTED is not set
499500

500501
#
501502
# Wi-Fi
@@ -603,6 +604,7 @@ CONFIG_RT_PAGE_MAX_ORDER=11
603604
# CONFIG_PKG_USING_QMODBUS is not set
604605
# CONFIG_PKG_USING_PNET is not set
605606
# CONFIG_PKG_USING_OPENER is not set
607+
# CONFIG_PKG_USING_FREEMQTT is not set
606608
# end of IoT - internet of things
607609

608610
#
@@ -831,6 +833,7 @@ CONFIG_RT_PAGE_MAX_ORDER=11
831833
# CONFIG_PKG_USING_RMP is not set
832834
# CONFIG_PKG_USING_R_RHEALSTONE is not set
833835
# CONFIG_PKG_USING_HEARTBEAT is not set
836+
# CONFIG_PKG_USING_MICRO_ROS_RTTHREAD_PACKAGE is not set
834837
# end of system packages
835838

836839
#
@@ -954,6 +957,8 @@ CONFIG_RT_PAGE_MAX_ORDER=11
954957
#
955958
# HC32 DDL Drivers
956959
#
960+
# CONFIG_PKG_USING_HC32F4_CMSIS_DRIVER is not set
961+
# CONFIG_PKG_USING_HC32F4_SERIES_DRIVER is not set
957962
# end of HC32 DDL Drivers
958963

959964
#
@@ -967,6 +972,21 @@ CONFIG_RT_PAGE_MAX_ORDER=11
967972
# CONFIG_PKG_USING_NXP_IMX6UL_DRIVER is not set
968973
# CONFIG_PKG_USING_NXP_IMXRT_DRIVER is not set
969974
# end of NXP HAL & SDK Drivers
975+
976+
#
977+
# NUVOTON Drivers
978+
#
979+
# CONFIG_PKG_USING_NUVOTON_CMSIS_DRIVER is not set
980+
# CONFIG_PKG_USING_NUVOTON_SERIES_DRIVER is not set
981+
# CONFIG_PKG_USING_NUVOTON_ARM926_LIB is not set
982+
# end of NUVOTON Drivers
983+
984+
#
985+
# GD32 Drivers
986+
#
987+
# CONFIG_PKG_USING_GD32_ARM_CMSIS_DRIVER is not set
988+
# CONFIG_PKG_USING_GD32_ARM_SERIES_DRIVER is not set
989+
# end of GD32 Drivers
970990
# end of HAL & SDK Drivers
971991

972992
#

bsp/qemu-vexpress-a9/drivers/automac.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
#define AUTOMAC0 0x52
99
#define AUTOMAC1 0x54
1010
#define AUTOMAC2 0x00
11-
#define AUTOMAC3 0x60
12-
#define AUTOMAC4 0x47
13-
#define AUTOMAC5 0x90
11+
#define AUTOMAC3 0xd2
12+
#define AUTOMAC4 0x20
13+
#define AUTOMAC5 0x28
1414

1515
#endif

bsp/qemu-vexpress-a9/rtconfig.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161

6262
/* end of rt_strnlen options */
6363
/* end of klibc options */
64-
#define RT_NAME_MAX 8
64+
#define RT_NAME_MAX 16
6565
#define RT_CPUS_NR 1
6666
#define RT_ALIGN_SIZE 8
6767
#define RT_THREAD_PRIORITY_256
@@ -410,6 +410,14 @@
410410
/* NXP HAL & SDK Drivers */
411411

412412
/* end of NXP HAL & SDK Drivers */
413+
414+
/* NUVOTON Drivers */
415+
416+
/* end of NUVOTON Drivers */
417+
418+
/* GD32 Drivers */
419+
420+
/* end of GD32 Drivers */
413421
/* end of HAL & SDK Drivers */
414422

415423
/* sensors drivers */

components/drivers/core/device.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,17 @@ rt_err_t rt_device_register(rt_device_t dev,
6868
const char *name,
6969
rt_uint16_t flags)
7070
{
71+
rt_err_t ret = RT_NULL;
7172
if (dev == RT_NULL)
7273
return -RT_ERROR;
7374

7475
if (rt_device_find(name) != RT_NULL)
7576
return -RT_ERROR;
7677

77-
rt_object_init(&(dev->parent), RT_Object_Class_Device, name);
78+
ret = rt_object_init(&(dev->parent), RT_Object_Class_Device, name);
79+
if (ret != RT_EOK)
80+
return RT_NULL;
81+
7882
dev->flag = flags;
7983
dev->ref_count = 0;
8084
dev->open_flag = 0;

components/drivers/ipc/condvar.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ void rt_condvar_init(rt_condvar_t cv, char *name)
2626
{
2727
#ifdef USING_RT_OBJECT
2828
/* TODO: support rt object */
29-
rt_object_init();
29+
rt_err_t ret = RT_NULL;
30+
ret = rt_object_init();
31+
if (ret != RT_EOK)
32+
return RT_NULL;
3033
#endif
3134

3235
rt_wqueue_init(&cv->event);

components/lwp/lwp_pgrp.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ rt_processgroup_t lwp_pgrp_find(pid_t pgid)
8888
rt_processgroup_t lwp_pgrp_create(rt_lwp_t leader)
8989
{
9090
rt_processgroup_t group = RT_NULL;
91+
rt_err_t ret = RT_NULL;
9192

9293
/* parameter check */
9394
if (leader == RT_NULL)
@@ -98,7 +99,9 @@ rt_processgroup_t lwp_pgrp_create(rt_lwp_t leader)
9899
group = rt_malloc(sizeof(struct rt_processgroup));
99100
if (group != RT_NULL)
100101
{
101-
rt_object_init(&(group->object), RT_Object_Class_ProcessGroup, "pgrp");
102+
ret = rt_object_init(&(group->object), RT_Object_Class_ProcessGroup, "pgrp");
103+
if (ret != RT_EOK)
104+
return RT_NULL;
102105
rt_list_init(&(group->process));
103106
rt_list_init(&(group->pgrp_list_node));
104107
rt_mutex_init(&(group->mutex), "pgrp", RT_IPC_FLAG_PRIO);

components/lwp/lwp_session.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ rt_session_t lwp_session_find(pid_t sid)
6161
rt_session_t lwp_session_create(rt_lwp_t leader)
6262
{
6363
rt_session_t session = RT_NULL;
64+
rt_err_t ret = RT_NULL;
6465

6566
/* parameter check */
6667
if (leader == RT_NULL)
@@ -71,7 +72,10 @@ rt_session_t lwp_session_create(rt_lwp_t leader)
7172
session = rt_malloc(sizeof(struct rt_session));
7273
if (session != RT_NULL)
7374
{
74-
rt_object_init(&(session->object), RT_Object_Class_Session, "session");
75+
ret = rt_object_init(&(session->object), RT_Object_Class_Session, "session");
76+
if (ret != RT_EOK)
77+
return RT_NULL;
78+
7579
rt_list_init(&(session->processgroup));
7680
rt_mutex_init(&(session->mutex), "session", RT_IPC_FLAG_PRIO);
7781
session->leader = leader;

documentation/3.kernel/object/object.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ A class of objects is managed by an `rt_object_information` structure, and each
156156
An uninitialized static object must be initialized before it can be used. The initialization object uses the following interfaces:
157157

158158
```c
159-
void rt_object_init(struct rt_object* object ,
159+
rt_err_t rt_object_init(struct rt_object* object ,
160160
enum rt_object_class_type type ,
161161
const char* name)
162162
```

0 commit comments

Comments
 (0)