Commit Graph

360 Commits

Author SHA1 Message Date
chao an 7aa45305b7 fs/inode: remove all unnecessary check for filep/inode
Since VFS layer already contains sanity checks, so remove unnecessary lower half checks

Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-29 09:47:11 +08:00
ligd b743d62703 syslog: remove unsed check
To simplify the code

Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-25 17:31:31 +08:00
Jiuzhu Dong 904ca21a00 syslog & ramlog: add BOARDIOC_RESET_CAUSE for syslog & ramlog
cold boot should clear syslog & ramlog buffer

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-25 17:31:31 +08:00
ligd 45c04e9125 syslog_rpmsg: update check method when do flush()
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-19 01:35:19 +08:00
Petro Karashchenko 1b0baa8337 nuttx: use lib_free for memory de-allocation after strdup or asprintf
The memory allocated with strdup and asprintf is done via lib_malloc
so we need to use lib_free to deallocate memory otherwise the assertion
"Free memory from the wrong heap" is hit with flat mode and user separated
heap enabled mode.

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-08-08 11:58:29 -03:00
yinshengkai 6a0ffa5c52 syslog: replace lib_sprintf to lib_sprintf_internal
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-07-14 00:22:11 +03:00
yinshengkai 0052ff2bd8 syslog: replace %pV with lib_sprintf
%pV will increase the stack size

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-07-14 00:22:11 +03:00
yinshengkai ce98f186c0 syslog: add syslog channel filtering function
support to control the opening or closing of the specified channel through the syslogmask command at runtime

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-07-13 01:04:07 +08:00
chao an 6ee9ec7656 build: add initial cmake build system
1. Update all CMakeLists.txt to adapt to new layout
2. Fix cmake build break
3. Update all new file license
4. Fully compatible with current compilation environment(use configure.sh or cmake as you choose)

------------------

How to test

From within nuttx/. Configure:

cmake -B build -DBOARD_CONFIG=sim/nsh -GNinja
cmake -B build -DBOARD_CONFIG=sim:nsh -GNinja
cmake -B build -DBOARD_CONFIG=sabre-6quad/smp -GNinja
cmake -B build -DBOARD_CONFIG=lm3s6965-ek/qemu-flat -GNinja

(or full path in custom board) :
cmake -B build -DBOARD_CONFIG=$PWD/boards/sim/sim/sim/configs/nsh -GNinja

This uses ninja generator (install with sudo apt install ninja-build). To build:

$ cmake --build build

menuconfig:

$ cmake --build build -t menuconfig

--------------------------

2. cmake/build: reformat the cmake style by cmake-format

https://github.com/cheshirekow/cmake_format

$ pip install cmakelang

$ for i in `find -name CMakeLists.txt`;do cmake-format $i -o $i;done
$ for i in `find -name *\.cmake`;do cmake-format $i -o $i;done

Co-authored-by: Matias N <matias@protobits.dev>
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-08 13:50:48 +08:00
Petro Karashchenko 2ca40e14e9 drivers/syslog: remove redundant 'int' cast
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-07-07 17:39:39 -03:00
Xiang Xiao efd1b838e6 syslog: Add sc_write_force callback
It is used to write the log message to the channel immediately
when the log message is generated in the interrupt context, which
is faster than the normal force callback.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-23 09:55:19 -03:00
Xiang Xiao e62c915972 syslog: Remove syslog_force and related stuff
syslog_force is used to force the syslog output to the
console in interrupt context, but we can use syslog_write
to do the same(and more) thing.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-23 09:55:19 -03:00
Tiago Medicci Serrano 71c8265e2d drivers/syslog: add mutex to syslog_default_write
This commit reverts 19f269e54b and
substitutes the semaphore to a mutex, used as a locking mechanism
to avoid syslog messages being messed.

Considering SMP, threads running on different CPUs could call
syslog_default_write simultaneously. It then calls `up_nputs` that,
in most of the implementations, calls `up_putc` multiple times to
write to the serial. So, calling it at the same would cause syslog
messages to interfere with each other.

`up_nputs` and `up_putc` are low-level functions that could be used
during initialization and by the interrupt handler. Hence, it isn't
advisable to implement any locking mechanism on them. On the other
hand, syslog can also be used from the interrupt: if the interrupt
buffer is selected (`CONFIG_SYSLOG_INTBUFFER=y`), the syslog
messages will be flushed when we aren't serving an interrupt.
On the contrary, if it isn't set, it would call the registered
`sc_force` callback, which calls `syslog_default_putc` instead of
the lock-protected `syslog_default_write`.
2023-06-02 10:17:54 +08:00
chao an fb9b41221d semantic/parser: fix compile warning found by sparse
Reference:
https://linux.die.net/man/1/sparse

Signed-off-by: chao an <anchao@xiaomi.com>
2023-05-30 23:00:00 +08:00
Xiang Xiao 20ea607bd0 stream: Rename syslogstream to syslograwstream
to prepare a new stream implementation of syslog

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Signed-off-by: chao an <anchao@xiaomi.com>
2023-05-25 15:22:04 +08:00
chao an 0455167457 stream/syslog: use internal buffer to decoupling syslog with iob
Signed-off-by: chao an <anchao@xiaomi.com>
2023-05-24 09:53:30 +08:00
chao an d3240061db syslog/Kconfig: fix kconfig warning
warning: The int symbol SYSLOG_RPMSG_WORK_DELAY (defined at drivers/syslog/Kconfig:274) is being evaluated in a logical context somewhere. It will always evaluate to n.
make: *** [tools/Unix.mk:663: olddefconfig] Error 1

Signed-off-by: chao an <anchao@xiaomi.com>
2023-05-08 21:36:45 +03:00
Xiang Xiao 51dc67ad5f fs: Add g_ prefix for all global file_operations instances
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-04-24 16:13:29 +02:00
Xiang Xiao 2c5f653bfd Remove the tail spaces from all files except Documentation
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-26 13:24:24 -08:00
chao an d03b105160 drivers/syslog: correct Kconfig name
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-05 01:05:32 +08:00
chao an 4c8d244fae sched/getpid: replace syscall getpid/tid/ppid() to kernel version
NuttX kernel should not use the syscall functions, especially after
enabling CONFIG_SCHED_INSTRUMENTATION_SYSCALL, all system functions
will be traced to backend, which will impact system performance.

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-02 10:33:01 +08:00
yinshengkai e9ed994fec syslog: merge multiple lib_sprintf into one
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-01-05 02:00:43 +08:00
yinshengkai 74b8776872 syslog: put variable initialization in the front
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-01-05 02:00:43 +08:00
yinshengkai 72b19200b5 syslog: replace the switch statement with an array of strings
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-01-05 02:00:43 +08:00
Xiang Xiao b0a0ba3ad7 fs: Move mmap callback before truncate in [file|mountpt]_operations
since mmap may exist in block_operations, but truncate may not,
moving mmap beforee truncate could make three struct more compatible

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-04 17:43:59 +02:00
Xiang Xiao 779a610ca3 Remove the unnecessary NULL fields in global instance definition of file_operations
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-04 00:32:13 +02:00
Jukka Laitinen f33dc4df3f Change FIOC_MMAP into file operation call
- Add mmap into file_operations and remove it from ioctl definitions.
- Add mm_map structure definitions to support future unmapping
- Modify all drivers to initialize the operations struct accordingly

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-01-02 11:23:20 -03:00
Jukka Laitinen 41e9df2f3e Add ftruncate into file operation calls
- Add truncate into file_operations
- Move truncate to be common for mountpt_operations and file_operations
- Modify all drivers to initialize the operations struct accordingly

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-01-02 11:23:20 -03:00
yinshengkai 275b2e70a4 syslog: fix extra line breaks in syslog when SYSLOG_COLOR_OUTPUT is enabled
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-01-02 21:22:46 +08:00
Xiang Xiao 055f1f33eb libc/stream: Rename [lib_stream_](put|get) to [lib_stream_](putc|getc)
to make the naming style consistent with each other

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-05 14:27:55 +01:00
田昕 1d8d6e5ed2 drivers/syslog:support stream as syslog backend.
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2022-11-28 20:19:00 +08:00
Xiang Xiao af2b491420 driver/segger: Move SYSLOG_RTT config from drivers/syslog to drivers/segger
and remove include/nuttx/syslog/syslog_rtt.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-27 23:10:39 +01:00
Xiang Xiao 5fd1379d3f syslog: Move syslog stream to libc like other stream implementation
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-25 01:46:31 +08:00
qinwei1 8021dfece6 sched/task/task_getpid: getpid should return process id not thread id
Summary:
   implement the right semantics:
1. getpid should return the main thread id
2. gettid should return the current thread id

Refer to:
 https://github.com/apache/incubator-nuttx/issues/2499
 https://github.com/apache/incubator-nuttx/pull/2518

Signed-off-by: qinwei1 <qinwei1@xiaomi.com>
2022-11-17 17:58:08 +08:00
yinshengkai 95d9abcf58 tools: replace DEFINE script to Makefile variable
In the past, predefined macros were generated by define.sh scripts
Now they are generated by concatenating environment variables

In this way, when executing makefile, no shell command will be executed,
it will improve the speed of executing makfile

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-11-03 19:59:55 +08:00
anjiahao d7b4e91dda Call nxsem_destroy or nxmutex_destry in the error path
1.Don't check the return value of nxsem_init or nxmutex_init
2.Fix some style issue

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-30 13:56:52 +01:00
anjiahao e1ca516488 use SEM_INITIALIZER inside of NXSEM_INITIALIZER
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-10-22 14:50:48 +08:00
anjiahao 5724c6b2e4 sem:remove sem default protocl
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-10-22 14:50:48 +08:00
Xiang Xiao dca5a3483f drivers: Destroy mutex and sem in the error path
also correct the order to ensure the memory free is last step

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-17 15:59:46 +09:00
anjiahao d1d46335df Replace nxsem API when used as a lock with nxmutex API
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-17 15:59:46 +09:00
Xiang Xiao bdeaea3742 Remove the unnessary empty line after label
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-30 17:54:56 +02:00
wangbowen6 344c8be049 poll: add poll_notify() api and call it in all drivers
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-09-26 12:06:32 +08:00
Xiang Xiao 130b196876 Refine how to specify iob and ramlog data section
1.Remove the default value(.bss)
2.Remove !ARCH_SIM dependence

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-25 14:05:17 +02:00
Xiang Xiao ba9486de4a iob: Remove iob_user_e enum and related code
since it is impossible to track producer and consumer
correctly if TCP/IP stack pass IOB directly to netdev

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-15 08:41:20 +03:00
Xiang Xiao 64f0267993 syslog: Move syslog_rpmsg_server_init to syslog_initialize
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-11 02:08:42 +03:00
ligd 8a3683fb9f rptun: add ns_match callback to resolve rptun deadlock
thread A: accept -> net_lock -> socket_rpmsg_accept
          -> rpmsg_register_callabck -> rptun_lock
thread B: ns_bind -> rpmsg_socket_ns_bind -> get_tx_payload_buffer
          -> rptun_wait_tx -> usrsock_rpmsg_ept_cb -> usrsockdev_write
          -> net_lock -> deadlock

fix:
add ns_match callback

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-27 20:36:51 +08:00
Xiang Xiao d04ed9587b drivers/syslog: Call up_nputs in syslog_default_write
since the buffer may not be terminated by null

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-07-21 21:26:10 +03:00
Jiuzhu Dong e7b8af7a35 driver/ramlog: set CONFIG_SYSLOG_DEVPATH to /dev/kmsg when enbale ramglog
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-21 23:40:56 +08:00
Jiuzhu Dong af62e6cbfa driver/syslog: support syslog rpmsg server chardev
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-21 23:40:56 +08:00
Jiuzhu Dong eedb774d68 driver/syslog: remove TRANSFER_DONE and sem wait when buffer is full
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-21 23:40:56 +08:00
Jiuzhu Dong 059114557f driver/syslog: support syslog output when buffer remaining space over 75%
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-21 23:40:56 +08:00
Jiuzhu Dong 664fcb2698 driver/syslog: support syslog rpmsg character buffer
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-21 23:40:56 +08:00
ligd 5c33db4220 syslog_rpmsg: head must bigger then tail when syslog_rpmsg_init
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-21 23:40:56 +08:00
Xiang Xiao 19f269e54b syslog: Remove the lock from syslog_default_write
to avoid the problem when is called from interrupt/signal handler

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-07-17 17:31:19 +03:00
Xiang Xiao 8254ad9159 drivers/syslog: Call up_puts instead up_putc one by one
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-07-17 17:31:19 +03:00
Nathan Hartman 1867bc2210 Fix compiler warnings (-Wunused-parameter) in various functions
Fixes the -Wunused-parameter warning in:
* group/group_signal.c: group_signal()
* irq/irq_unexpectedisr.c: irq_unexpected_isr()
* task/task_spawn.c: nxtask_spawn_proxy()
* timer/timer_getoverrun.c: timer_getoverrun()
* misc/dev_null.c: devnull_read(), devnull_write(), devnull_poll()
* misc/dev_zero.c: devzero_read(), devzero_write(), devzero_poll()
* syslog/syslog_channel.c: syslog_default_write()
* syslog/syslog_device.c: syslog_dev_flush()
* grp/lib_initgroups.c: initgroups()
* misc/lib_mknod.c: mknod()
* misc/lib_glob.c: ignore_err()
* pthread/pthread_barrierinit.c: pthread_barrier_init()
* pthread/pthread_atfork.c: pthread_atfork()
* semaphore/sem_init.c: nxsem_init()
* stream/lib_nullinstream.c: nullinstream_getc()
* stream/lib_nulloutstream.c: nulloutstream_putc()
* stream/lib_libnoflush.c: lib_noflush()
* stream/lib_libsnoflush.c: lib_snoflush()
* string/lib_strerror.c: strerror()
* time/lib_gettimeofday.c: gettimeofday()
* time/lib_settimeofday.c: settimeofday()
* unistd/lib_pathconf.c: fpathconf(), pathconf()
* unistd/lib_getrusage.c: getrusage()
* unistd/lib_setrlimit.c: setrlimit()
* unistd/lib_getrlimit.c: getrlimit()
* unistd/lib_setpriority.c: setpriority()
2022-07-12 11:42:34 +08:00
Nathan Hartman 849f760b77 Fix various typos 2022-07-08 02:15:54 +08:00
Fotis Panagiotopoulos 34e7ce5817 Reset syslog color before printing messages. 2022-06-30 09:44:41 +08:00
Xiang Xiao 22548d71eb drivers/syslog: reuse rmutex_t for the recursive check
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-06-16 19:01:49 +03:00
Petro Karashchenko e42e3aa642 drivers/syslog: fix deadlock by reverting part of the changes from b88a8cf39f
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-06-14 00:11:28 +08:00
Fotis Panagiotopoulos 73d5a27702 Fix in default syslog date format. 2022-06-05 22:23:32 +08:00
Fotis Panagiotopoulos c0df7317ac Fix in syslog file separator. 2022-06-04 14:30:15 +08:00
anjiahao b88a8cf39f use rmutex inside of all repeated implementation
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-05-30 19:43:48 +08:00
gaojiawei 335fc3dde2 syslog: Fixed a potential buffer overflow issue
The `CONFIG_SYSLOG_MAX_CHANNELS` is user-specified, however, if the user
defines more channels than what `CONFIG_SYSLOG_MAX_CHANNELS` was defined as,
a potential buffer overflow occurred. Although the compiler does warn us about
that, we should explicitly tell the user this is an error.

Signed-off-by: gaojiawei <gaojiawei@xiaomi.com>
2022-05-18 01:36:16 +08:00
Petro Karashchenko 09b3fb25ab drivers: remove unimplemented open/close/ioctl interfaces
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-04-15 16:56:25 +08:00
Petro Karashchenko ea5ffac7d1 drivers/syslog: update description if Kconfig
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-04-11 23:36:39 +08:00
Xiang Xiao 9785d6606c openamp: Change the dependence from OPENAMP to RPTUN
since all rpmsg driver need the extension api exposed by rptun driver

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-05 10:05:41 +03:00
Jiuzhu Dong 840ba09b24 driver/syslog: Add microseconds after date time
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-03-31 23:57:15 +08:00
ligd 7619d2a6f9 syslog: fix syslog print twice when active assert
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-03-29 12:20:37 +08:00
ligd b6e0614be6 syslog: use & instead of % when calculate offset
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-03-29 12:20:37 +08:00
ligd 61cb79d192 syslog_rpmsg: change head & tail NON-wrap
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-03-29 12:20:37 +08:00
Jiuzhu Dong a8866132c2 ramlog: support setting threshold value of ramlog for poll waiters
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-03-28 22:48:56 +08:00
Petro Karashchenko 68902d8732 pid_t: unify usage of special task IDs
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-03-22 21:22:32 +08:00
Xiang Xiao 8391ad2721 syslog: Change g_syslog_default_sem to static function variable
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-20 12:37:09 +02:00
chao.an 40f63453f4 syslog/channel: minor fix to avoid unreachabled return
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-03-19 11:13:44 +02:00
chao.an 4e08b1df93 drviers/syslog: correct the return value of default channel write
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-03-14 08:59:34 +02:00
Xiang Xiao 8a880df37d syslog/ramlog: Fix error: argument to 'section' attribute is not valid
mach-o section specifier requires a segment and section separated by a comma

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-05 17:23:48 +02:00
Xiang Xiao f1ed349dd9 sched/clock: Remove CLOCK_MONOTONIC option from Kconfig
here is the reason:
1.clock_systime_timespec(core function) always exist regardless the setting
2.CLOCK_MONOTONIC is a foundamental clock type required by many places

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-23 01:21:26 +08:00
Petro Karashchenko 74a4394352 drivers/syslog/syslog_device: fix flushing data when end of line is detected
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-02-05 03:10:31 +08:00
Xiang Xiao 4c167b0729 Correct the code alignment
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-01 21:22:21 -03:00
Xiang Xiao 01b791d773 drivers/syslog: Implement RTT based log channel
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-01 11:26:46 +01:00
Xiang Xiao 1e87d50d34 drivers/syslog: Refine Kconfig option
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-01-31 13:42:19 +01:00
Xiang Xiao 6a0dbba62b syslog: Include nuttx/syslog/syslog.h in include/nuttx/syslog/syslog_rpmsg.h
to avoid struct syslog_channel_s used before definition
and remove the unnecessary inclusion

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-01-31 13:41:56 +01:00
Fotis Panagiotopoulos 0c41611429 syslog: Fix in file channel initialization. 2022-01-13 19:16:10 +01:00
Petro Karashchenko a743fed63d file_operations: get back C89 compatible initializer
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-01-11 02:14:00 +08:00
Jiuzhu Dong f35c6d7ef1 syslog/rpmsg: using up_putc to force flush syslog_rpmsg buffer
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-12-17 11:43:08 -06:00
Petro Karashchenko 51a2db6ffc Kconfig: improve uniformity
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2021-12-14 07:32:48 -06:00
Xiang Xiao 69468b700d libc: Move syslog_stream from nuttx/streams.h to drivers/syslog/syslog.h
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-14 00:51:59 -06:00
ligd 9a86aa7f77 syslog_rpmsg: fix typo
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-12-13 11:08:28 -06:00
ligd 93426ca7cc syslog_rpmsg: update syslog_rpmsg to support non-overwrite
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-12-13 11:08:28 -06:00
ligd 5b369c5cec libs/lbc: remove CHAR_BIT = 16 support
For CEVA platform CHAR_BIT is 16, and will do lots of extra work
when use IPC.
We will not support this platform anymore, so remove all the b2c operations.

Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-12-13 11:08:28 -06:00
Xiang Xiao 3d6a5a2d0d syslog: Add [] around the prefix like others
make the output format consistent

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-11 10:08:32 -06:00
anjiahao 41c3b42468 change /dev/syslog & /dev/ramlog for unix standard
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2021-11-24 05:19:46 -06:00
ligd ff0cd0baac Revert "drivers/syslog: Call up_puts in syslog_default_write instad up_putc"
This reverts commit 174b240325.

Revert "drivers/syslog: Ensure the buffer zero terminate"

This reverts commit 1692aa7894.
2021-11-01 06:54:05 -05:00
Xiang Xiao 1692aa7894 drivers/syslog: Ensure the buffer zero terminate
This patch fix the regression by:
commit 174b240325
Author: Xiang Xiao <xiaoxiang@xiaomi.com>
Date:   Fri Sep 17 11:56:21 2021 +0800

    drivers/syslog: Call up_puts in syslog_default_write instad up_putc

    since some drivers(e.g. semihosting) have more fast implementation.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-09-21 08:44:44 -03:00
Xiang Xiao 174b240325 drivers/syslog: Call up_puts in syslog_default_write instad up_putc
since some drivers(e.g. semihosting) have more fast implementation.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-09-18 07:33:44 -03:00
Jiuzhu Dong 19cea67f3e syslog: reslove crash because vmov.i32 instruction is not ready when system boot
So avoid to use vmov.i32 instruction before FPU is ready.

Before modification:
3c03b35c <nx_vsyslog>:
3c03b35c:	f2c00010 	vmov.i32	d16, #0	; 0x00000000
3c03b360:	f2c02050 	vmov.i32	q9, #0	; 0x00000000
3c03b364:	e92d40f0 	push	{r4, r5, r6, r7, lr}
3c03b368:	e24dd08c 	sub	sp, sp, #140	; 0x8c
3c03b36c:	e28d301c 	add	r3, sp, #28
3c03b370:	e2505000 	subs	r5, r0, #0
3c03b374:	edcd0b0f 	vstr	d16, [sp, #60]	; 0x3c
3c03b378:	edcd0b01 	vstr	d16, [sp, #4]

After modification:
3c03b35c <nx_vsyslog>:
3c03b35c:       e92d40f0        push    {r4, r5, r6, r7, lr}
3c03b360:       e2505000        subs    r5, r0, #0
3c03b364:       e24dd08c        sub     sp, sp, #140    ; 0x8c
3c03b368:       e1a06001        mov     r6, r1
3c03b36c:       e1a07002        mov     r7, r2
3c03b370:       e28d000c        add     r0, sp, #12
3c03b374:       1a00003a        bne     3c03b464 <nx_vsyslog+0x108>

Change-Id: I643c19f5416c94a529764fdaa81f3088fcf95355
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-25 23:02:04 -07:00
David Sidrane 3e4b3ada5e syslog:syslog_channel:Fix compiler warnings
syslog_channel.c:98:8: error: unknown type name 'sem_t'
   syslog/syslog_channel.c:99:14: error: 'g_syslog_default_sem'
   defined but not used
2021-07-14 17:38:30 -07:00
Jiuzhu Dong 0c3cb0cb66 syslog: optimize init logic for early buffer initialize
N/A

Change-Id: I3295803977fa51e8ed8dedf7f0966b9604f8204d
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-10 11:10:13 -07:00
Jiuzhu Dong 4bb48892d0 ramlog: init head and tail when buffer is empty on boot
N/A

Change-Id: I6963ef6256c3a93ac7a63115c303033ceafa321f
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-10 11:10:13 -07:00