Fix semantics of posix time function#240
Fix semantics of posix time function#240zhanghe-vivo wants to merge 1 commit intovivoblueos:mainfrom
Conversation
|
Can you elaborate why do we need to invent a new POSIX timer in kernel rather than using soft timer? |
2cb31b7 to
c96c29f
Compare
|
stub posix timers, preserve clock implement |
c96c29f to
b08053d
Compare
|
build_prs #240 vivoblueos/librs#22 vivoblueos/libc#5 |
|
Job is started, see https://github.com/vivoblueos/kernel/actions/runs/20710231867. |
|
❌ Job failed. Failed jobs: check_format (failure), build_and_check_boards (failure), see https://github.com/vivoblueos/kernel/actions/runs/20710231867. |
b08053d to
70cef89
Compare
|
build_prs #240 vivoblueos/librs#22 vivoblueos/libc#5 |
|
Job is started, see https://github.com/vivoblueos/kernel/actions/runs/20710672760. |
|
❌ Job failed. Failed jobs: build_and_check_boards (failure), see https://github.com/vivoblueos/kernel/actions/runs/20710672760. |
70cef89 to
4599868
Compare
|
build_prs #240 vivoblueos/librs#22 vivoblueos/libc#5 |
|
Job is started, see https://github.com/vivoblueos/kernel/actions/runs/20710835888. |
|
❌ Job failed. Failed jobs: build_and_check_boards (failure), see https://github.com/vivoblueos/kernel/actions/runs/20710835888. |
|
build_prs #240 vivoblueos/librs#22 vivoblueos/libc#5 |
|
Job is started, see https://github.com/vivoblueos/kernel/actions/runs/20711463695. |
|
❌ Job failed. Failed jobs: build_and_check_boards (failure), see https://github.com/vivoblueos/kernel/actions/runs/20711463695. |
|
build_prs #240 vivoblueos/librs#22 vivoblueos/libc#5 |
|
Job is started, see https://github.com/vivoblueos/kernel/actions/runs/20711707723. |
|
❌ Job failed. Failed jobs: build_and_check_boards (failure), see https://github.com/vivoblueos/kernel/actions/runs/20711707723. |
|
build_prs #240 vivoblueos/librs#22 vivoblueos/libc#5 |
|
Job is started, see https://github.com/vivoblueos/kernel/actions/runs/20712177870. |
|
✅ All jobs completed successfully, see https://github.com/vivoblueos/kernel/actions/runs/20712177870. |
|
build_prs #240 vivoblueos/librs#22 vivoblueos/libc#5 |
|
Job is started, see https://github.com/vivoblueos/kernel/actions/runs/20712502352. |
|
✅ All jobs completed successfully, see https://github.com/vivoblueos/kernel/actions/runs/20712502352. |
|
❌ Job failed. Failed jobs: build_and_check_boards (failure), see https://github.com/vivoblueos/kernel/actions/runs/22388379202. |
5b3d30b to
8521569
Compare
|
build_prs #240 vivoblueos/librs#22 vivoblueos/libc#5 |
|
Job is started, see https://github.com/vivoblueos/kernel/actions/runs/22388526351. |
|
❌ Job failed. Failed jobs: check_format (failure), see https://github.com/vivoblueos/kernel/actions/runs/22388526351. |
8521569 to
075043b
Compare
|
build_prs #240 vivoblueos/librs#22 vivoblueos/libc#5 |
|
Job is started, see https://github.com/vivoblueos/kernel/actions/runs/22389341686. |
|
✅ All jobs completed successfully, see https://github.com/vivoblueos/kernel/actions/runs/22389341686. |
| if !evp.is_null() { | ||
| return -EINVAL as c_long; | ||
| } | ||
| unsafe { *timerid = 1 as timer_t }; |
There was a problem hiding this comment.
If not fully implemented, it is recommended to add a TODO marker.
There was a problem hiding this comment.
chang as suggestion
|
|
||
| // Global realtime offset. | ||
| use crate::sync::spinlock::SpinLock; | ||
| static REALTIME_OFFSET_NS: SpinLock<i64> = SpinLock::new(0); |
There was a problem hiding this comment.
some target won't support this width atomic operation, e.g 'https://github.com/rust-lang/rust/blob/dbcb048e2854ab1ce451e98ee52f4b4f3d455335/compiler/rustc_target/src/spec/targets/thumbv7m_none_eabi.rs#L21
There was a problem hiding this comment.
AtomicU64 is supported via libatomic on 32-bit platforms. However, it's not lock-free.
There was a problem hiding this comment.
Yes, I also think that in most scenarios we should use an efficient implementation, and only fall back to use lock in 32-bit environments.
There was a problem hiding this comment.
AtomicU64 is supported via libatomic on 32-bit platforms. However, it's not lock-free.
According to https://doc.rust-lang.org/std/sync/atomic/, rust's Atomic only supports lock-free types, so AtomicU64 might be unavailable on 32-bit platoforms. Using spinlock here LGTM.
d034ad8 to
915f29f
Compare
|
build_prs #240 vivoblueos/librs#22 vivoblueos/libc#5 |
|
Job is started, see https://github.com/vivoblueos/kernel/actions/runs/22661144095. |
|
✅ All jobs completed successfully, see https://github.com/vivoblueos/kernel/actions/runs/22661144095. |
915f29f to
d260fc8
Compare
|
build_prs #240 vivoblueos/librs#22 vivoblueos/libc#5 |
|
Job is started, see https://github.com/vivoblueos/kernel/actions/runs/22701076137. |
|
❌ Job failed. Failed jobs: check_format (failure), build_and_check_boards (failure), see https://github.com/vivoblueos/kernel/actions/runs/22701076137. |
d260fc8 to
049deda
Compare
|
build_prs #240 vivoblueos/librs#22 vivoblueos/libc#5 |
|
Job is started, see https://github.com/vivoblueos/kernel/actions/runs/22701822414. |
|
❌ Job failed. Failed jobs: build_and_check_boards (failure), see https://github.com/vivoblueos/kernel/actions/runs/22701822414. |
|
build_prs #240 vivoblueos/librs#22 vivoblueos/libc#5 |
|
Job is started, see https://github.com/vivoblueos/kernel/actions/runs/22704702662. |
|
✅ All jobs completed successfully, see https://github.com/vivoblueos/kernel/actions/runs/22704702662. |
signal process hasn't added, will rebase #238