summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzhao maosheng <[email protected]>2024-04-02 15:43:50 +0800
committerRbb666 <[email protected]>2024-04-19 16:18:41 +0800
commit4e7d13b2db171148644a5b5183ec480bd98ea813 (patch)
tree1f5093488d3d77257963e106d316fadc074cced1
parente9133d56609a2e68a0e37843475b66d4c7ee42db (diff)
fix: code format of serial.c and compile error in aarch64 context_gcc
-rw-r--r--components/drivers/serial/serial.c20
-rw-r--r--libcpu/aarch64/common/context_gcc.S9
2 files changed, 13 insertions, 16 deletions
diff --git a/components/drivers/serial/serial.c b/components/drivers/serial/serial.c
index 0f46832a92..fef049ae03 100644
--- a/components/drivers/serial/serial.c
+++ b/components/drivers/serial/serial.c
@@ -1019,30 +1019,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 */
diff --git a/libcpu/aarch64/common/context_gcc.S b/libcpu/aarch64/common/context_gcc.S
index 9dd3c5e4b0..c425460029 100644
--- a/libcpu/aarch64/common/context_gcc.S
+++ b/libcpu/aarch64/common/context_gcc.S
@@ -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