Skip to content

Commit

Permalink
fix: code format of serial.c and compile error in aarch64 context_gcc
Browse files Browse the repository at this point in the history
  • Loading branch information
zmshahaha authored and mysterywolf committed Apr 2, 2024
1 parent 34fb8d2 commit 687eb87
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
20 changes: 9 additions & 11 deletions components/drivers/serial/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -1015,30 +1015,28 @@ static void _tc_flush(struct rt_serial_device *serial, int queue)

}

static inline int _termio_to_termios(const struct termio *termio,
struct termios *termios)
static inline int _termio_to_termios(const struct termio *termio, struct termios *termios)
{
termios->c_iflag = termio->c_iflag;
termios->c_oflag = termio->c_oflag;
termios->c_cflag = termio->c_cflag;
termios->c_lflag = termio->c_lflag;
termios->c_iflag = termio->c_iflag;
termios->c_oflag = termio->c_oflag;
termios->c_cflag = termio->c_cflag;
termios->c_lflag = termio->c_lflag;
termios->c_line = termio->c_line;
rt_memcpy(termios->c_cc, termio->c_cc, NCC);

return 0;
return 0;
}

static inline int _termios_to_termio(const struct termios *termios,
struct termio *termio)
static inline int _termios_to_termio(const struct termios *termios, struct termio *termio)
{
termio->c_iflag = (unsigned short)termios->c_iflag;
termio->c_oflag = (unsigned short)termios->c_oflag;
termio->c_cflag = (unsigned short)termios->c_cflag;
termio->c_lflag = (unsigned short)termios->c_lflag;
termio->c_line = termios->c_line;
rt_memcpy(termio->c_cc, termios->c_cc, NCC);
rt_memcpy(termio->c_cc, termios->c_cc, NCC);

return 0;
return 0;
}
#endif /* RT_USING_POSIX_TERMIOS */

Expand Down
9 changes: 4 additions & 5 deletions libcpu/aarch64/common/context_gcc.S
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@
#include "armv8.h"

#ifndef RT_USING_SMP
.bss
.align 3
rt_interrupt_from_thread: .comm 8, 8
rt_interrupt_to_thread: .comm 8, 8
rt_thread_switch_interrupt_flag: .comm 8, 8
.section .data
rt_interrupt_from_thread: .zero 8
rt_interrupt_to_thread: .zero 8
rt_thread_switch_interrupt_flag: .zero 8
#endif

.text
Expand Down

0 comments on commit 687eb87

Please sign in to comment.