summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Kconfig1
-rw-r--r--src/ipc.c2
-rw-r--r--src/kservice.c23
-rw-r--r--src/object.c9
-rw-r--r--src/signal.c6
5 files changed, 14 insertions, 27 deletions
diff --git a/src/Kconfig b/src/Kconfig
index 2b9fcdd789..849ce5fa3b 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -25,7 +25,6 @@ config RT_USING_SMART
select RT_USING_DFS
select RT_USING_POSIX_CLOCKTIME
select RT_USING_DEVICE
- select RT_USING_TTY
select RT_USING_NULL
select RT_USING_ZERO
select RT_USING_RANDOM
diff --git a/src/ipc.c b/src/ipc.c
index 33b9cfe420..5ffcf017c2 100644
--- a/src/ipc.c
+++ b/src/ipc.c
@@ -598,7 +598,7 @@ static rt_err_t _rt_sem_take(rt_sem_t sem, rt_int32_t timeout, int suspend_flag)
thread = rt_thread_self();
/* reset thread error number */
- thread->error = -RT_EINTR;
+ thread->error = RT_EINTR;
LOG_D("sem take: suspend thread - %s", thread->parent.name);
diff --git a/src/kservice.c b/src/kservice.c
index fc6dbab0b5..7c0cb0b58c 100644
--- a/src/kservice.c
+++ b/src/kservice.c
@@ -47,7 +47,6 @@
#ifdef RT_USING_SMART
#include <lwp.h>
#include <lwp_user_mm.h>
-#include <console.h>
#endif
/**
@@ -283,27 +282,6 @@ RTM_EXPORT(rt_console_get_device);
*/
rt_device_t rt_console_set_device(const char *name)
{
-#ifdef RT_USING_SMART
- rt_device_t new_iodev = RT_NULL, old_iodev = RT_NULL;
-
- /* find new console device */
- new_iodev = rt_device_find(name);
- if (new_iodev != RT_NULL)
- {
- if (_console_device != RT_NULL)
- {
- old_iodev = console_set_iodev(new_iodev);
- }
- else
- {
- console_register("console", new_iodev);
- _console_device = rt_device_find("console");
- rt_device_open(_console_device, RT_DEVICE_OFLAG_RDWR | RT_DEVICE_FLAG_STREAM);
- }
- }
-
- return old_iodev;
-#else
rt_device_t new_device, old_device;
/* save old device */
@@ -329,7 +307,6 @@ rt_device_t rt_console_set_device(const char *name)
}
return old_device;
-#endif
}
RTM_EXPORT(rt_console_set_device);
#endif /* RT_USING_DEVICE */
diff --git a/src/object.c b/src/object.c
index 66a7826681..bdb69364ce 100644
--- a/src/object.c
+++ b/src/object.c
@@ -15,6 +15,7 @@
* 2018-01-25 Bernard Fix the object find issue when enable MODULE.
* 2022-01-07 Gabriel Moving __on_rt_xxxxx_hook to object.c
* 2023-09-15 xqyjlj perf rt_hw_interrupt_disable/enable
+ * 2023-11-17 xqyjlj add process group and session support
*/
#include <rtthread.h>
@@ -74,6 +75,8 @@ enum rt_object_info_type
#endif
#ifdef RT_USING_SMART
RT_Object_Info_Channel, /**< The object is a IPC channel */
+ RT_Object_Info_ProcessGroup, /**< The object is a process group */
+ RT_Object_Info_Session, /**< The object is a session */
#endif
#ifdef RT_USING_HEAP
RT_Object_Info_Custom, /**< The object is a custom object */
@@ -133,6 +136,10 @@ static struct rt_object_information _object_container[RT_Object_Info_Unknown] =
#ifdef RT_USING_SMART
/* initialize object container - module */
{RT_Object_Class_Channel, _OBJ_CONTAINER_LIST_INIT(RT_Object_Info_Channel), sizeof(struct rt_channel), RT_SPINLOCK_INIT},
+ {RT_Object_Class_ProcessGroup, _OBJ_CONTAINER_LIST_INIT(RT_Object_Info_ProcessGroup), sizeof(struct rt_processgroup), RT_SPINLOCK_INIT},
+ {RT_Object_Class_Session, _OBJ_CONTAINER_LIST_INIT(RT_Object_Info_Session), sizeof(struct rt_session), RT_SPINLOCK_INIT},
+#endif
+#ifdef RT_USING_HEAP
{RT_Object_Class_Custom, _OBJ_CONTAINER_LIST_INIT(RT_Object_Info_Custom), sizeof(struct rt_custom_object), RT_SPINLOCK_INIT},
#endif
};
@@ -469,7 +476,7 @@ rt_object_t rt_object_allocate(enum rt_object_class_type type, const char *name)
object->flag = 0;
#if RT_NAME_MAX > 0
- rt_strncpy(object->name, name, RT_NAME_MAX); /* copy name */
+ rt_strncpy(object->name, name, RT_NAME_MAX - 1); /* copy name */
#else
object->name = name;
#endif /* RT_NAME_MAX > 0 */
diff --git a/src/signal.c b/src/signal.c
index 77379b1a31..23b352cb1f 100644
--- a/src/signal.c
+++ b/src/signal.c
@@ -19,7 +19,11 @@
#ifdef RT_USING_SIGNALS
#ifndef RT_SIG_INFO_MAX
-#define RT_SIG_INFO_MAX 32
+ #ifdef ARCH_CPU_64BIT
+ #define RT_SIG_INFO_MAX 64
+ #else
+ #define RT_SIG_INFO_MAX 32
+ #endif /* ARCH_CPU_64BIT */
#endif /* RT_SIG_INFO_MAX */
#define DBG_TAG "SIGN"