[rt-smart][fix/lwp] don't restore terminal for background lwp (#6847)

* [fix/lwp] don't restore term for background lwp
This commit is contained in:
Shell 2023-01-13 09:48:43 +08:00 committed by GitHub
parent 7b35c8d353
commit b2402029b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 13 additions and 1 deletions

View File

@ -25,6 +25,7 @@
#define BAUD_RATE_115200 115200
#define BAUD_RATE_230400 230400
#define BAUD_RATE_460800 460800
#define BAUD_RATE_500000 500000
#define BAUD_RATE_921600 921600
#define BAUD_RATE_2000000 2000000
#define BAUD_RATE_2500000 2500000

View File

@ -22,6 +22,7 @@
#define BAUD_RATE_115200 115200
#define BAUD_RATE_230400 230400
#define BAUD_RATE_460800 460800
#define BAUD_RATE_500000 500000
#define BAUD_RATE_921600 921600
#define BAUD_RATE_2000000 2000000
#define BAUD_RATE_2500000 2500000

View File

@ -922,6 +922,7 @@ static const struct speed_baudrate_item _tbl[] =
{B115200, BAUD_RATE_115200},
{B230400, BAUD_RATE_230400},
{B460800, BAUD_RATE_460800},
{B500000, BAUD_RATE_500000},
{B921600, BAUD_RATE_921600},
{B2000000, BAUD_RATE_2000000},
{B3000000, BAUD_RATE_3000000},

View File

@ -1024,6 +1024,7 @@ const static struct speed_baudrate_item _tbl[] =
{B115200, BAUD_RATE_115200},
{B230400, BAUD_RATE_230400},
{B460800, BAUD_RATE_460800},
{B500000, BAUD_RATE_500000},
{B921600, BAUD_RATE_921600},
{B2000000, BAUD_RATE_2000000},
{B3000000, BAUD_RATE_3000000},

View File

@ -1282,6 +1282,10 @@ pid_t lwp_execve(char *filename, int debug, int argc, char **argv, char **envp)
}
}
else
{
lwp->background = RT_TRUE;
}
thread->lwp = lwp;
#ifndef ARCH_MM_MMU
struct lwp_app_head *app_head = (struct lwp_app_head*)lwp->text_entry;

View File

@ -126,6 +126,7 @@ struct rt_lwp
struct lwp_avl_struct *address_search_head; /* for addressed object fast rearch */
char working_directory[DFS_PATH_MAX];
int debug;
int background;
uint32_t bak_first_ins;
#ifdef LWP_ENABLE_ASID

View File

@ -445,7 +445,7 @@ void lwp_free(struct rt_lwp* lwp)
}
rt_hw_interrupt_enable(level);
/* for parent */
if (!lwp->background)
{
struct termios *old_stdin_termios = get_old_termios();
struct rt_lwp *old_lwp = NULL;
@ -466,7 +466,10 @@ void lwp_free(struct rt_lwp* lwp)
lwp->tty = RT_NULL;
}
}
}
/* for parent */
{
if (lwp->parent)
{
struct rt_thread *thread;