Skip to content

Commit 2563a3f

Browse files
committed
doc: system type → kernel trait type, update code examples
1 parent b7d10d5 commit 2563a3f

File tree

10 files changed

+28
-28
lines changed

10 files changed

+28
-28
lines changed

src/r3_port_arm_m/src/systick_tickful/cfg.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ pub trait SysTickOptions {
4747
/// See the following example.
4848
///
4949
/// ```rust,ignore
50-
/// r3_port_arm_m::use_systick_tickful!(unsafe impl PortTimer for System);
50+
/// r3_port_arm_m::use_systick_tickful!(unsafe impl PortTimer for SystemTraits);
5151
///
52-
/// impl r3_port_arm_m::SysTickOptions for System {
52+
/// impl r3_port_arm_m::SysTickOptions for SystemTraits {
5353
/// // SysTick = AHB/8, AHB = HSI (internal 16-MHz RC oscillator)
5454
/// const FREQUENCY: u64 = 2_000_000;
5555
/// }
5656
///
57-
/// const fn configure_app(b: &mut CfgBuilder<System>) -> Objects {
58-
/// System::configure_systick(b);
57+
/// const fn configure_app(b: &mut r3_kernel::Cfg<SystemTraits>) -> Objects {
58+
/// SystemTraits::configure_systick(b);
5959
/// /* ... */
6060
/// }
6161
/// ```

src/r3_port_arm_m/src/systick_tickful/imp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use r3_portkit::tickful::{TickfulCfg, TickfulOptions, TickfulState, TickfulState
99

1010
use crate::{SysTickOptions, INTERRUPT_SYSTICK};
1111

12-
/// Implemented on a system type by [`use_systick_tickful!`].
12+
/// Implemented on a kernel trait type by [`use_systick_tickful!`].
1313
///
1414
/// # Safety
1515
///

src/r3_port_riscv/src/mtime/cfg.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,29 @@ use r3_core::kernel::InterruptNum;
33

44
/// Attach the implementation of [`PortTimer`] based on the RISC-V machine-mode
55
/// timer (`mtime`/`mtimecfg`) to a given kernel trait type. This macro also
6-
/// implements [`Timer`] on the system type.
6+
/// implements [`Timer`] on the kernel trait type.
77
/// **Requires [`MtimeOptions`].**
88
///
99
/// [`PortTimer`]: r3_kernel::PortTimer
1010
/// [`Timer`]: crate::Timer
1111
///
1212
/// You should do the following:
1313
///
14-
/// - Implement [`MtimeOptions`] on the system type `$Traits`.
14+
/// - Implement [`MtimeOptions`] on the kernel trait type `$Traits`.
1515
/// - Call `$Traits::configure_timer()` in your configuration function.
1616
/// See the following example.
1717
///
1818
/// ```rust,ignore
19-
/// r3_port_riscv::use_mtime!(unsafe impl PortTimer for System);
19+
/// r3_port_riscv::use_mtime!(unsafe impl PortTimer for SystemTraits);
2020
///
21-
/// impl r3_port_riscv::MtimeOptions for System {
21+
/// impl r3_port_riscv::MtimeOptions for SystemTraits {
2222
/// const MTIME_PTR: usize = 0x1001_1000;
2323
/// const MTIMECMP_PTR: usize = 0x1001_1000;
2424
/// const FREQUENCY: u64 = 1_000_000;
2525
/// }
2626
///
27-
/// const fn configure_app(b: &mut CfgBuilder<System>) -> Objects {
28-
/// System::configure_timer(b);
27+
/// const fn configure_app(b: &mut r3_kernel::Cfg<SystemTraits>) -> Objects {
28+
/// SystemTraits::configure_timer(b);
2929
/// /* ... */
3030
/// }
3131
/// ```

src/r3_port_riscv/src/mtime/imp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use tock_registers::{
99

1010
use crate::mtime::cfg::MtimeOptions;
1111

12-
/// Implemented on a system type by [`use_mtime!`].
12+
/// Implemented on a kernel trait type by [`use_mtime!`].
1313
///
1414
/// # Safety
1515
///

src/r3_port_riscv/src/plic/cfg.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@ use super::plic_regs;
1010
/// [`InterruptController`]: crate::InterruptController
1111
/// [`InterruptControllerToPort`]: crate::InterruptControllerToPort
1212
///
13-
/// This macro adds `const fn configure_plic(b: &mut CfgBuilder<Self>)` to the
14-
/// system type. **It should be called by your application's configuration
13+
/// This macro adds a method `const fn configure_plic(b: &mut Cfg<C>)` to the
14+
/// kernel trait type. **It should be called by your application's configuration
1515
/// function.** See the following example:
1616
///
1717
/// ```rust,ignore
18-
/// r3_port_riscv::use_plic!(unsafe impl InterruptController for System);
18+
/// r3_port_riscv::use_plic!(unsafe impl InterruptController for SystemTraits);
1919
///
20-
/// impl r3_port_riscv::PlicOptions for System {
20+
/// impl r3_port_riscv::PlicOptions for SystemTraits {
2121
/// // SiFive E
2222
/// const MAX_PRIORITY: InterruptPriority = 7;
2323
/// const MAX_NUM: InterruptNum = 127;
2424
/// const PLIC_BASE: usize = 0x0c00_0000;
2525
/// }
2626
///
27-
/// const fn configure_app(b: &mut CfgBuilder<System>) -> Objects {
28-
/// System::configure_plic(b);
27+
/// const fn configure_app(b: &mut r3_kernel::Cfg<SystemTraits>) -> Objects {
28+
/// SystemTraits::configure_plic(b);
2929
/// /* ... */
3030
/// }
3131
/// ```

src/r3_port_riscv/src/sbi_timer/cfg.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use r3_core::kernel::InterruptNum;
44
/// Attach the implementation of [`PortTimer`] based on [the RISC-V Supervisor
55
/// Binary Interface][1] Timer Extension (EID #0x54494D45 "TIME") and `time[h]`
66
/// CSR to a given kernel trait type.
7-
/// This macro also implements [`Timer`] on the system type.
7+
/// This macro also implements [`Timer`] on the kernel trait type.
88
/// **Requires [`SbiTimerOptions`].**
99
///
1010
/// [1]: https://github.com/riscv-non-isa/riscv-sbi-doc
@@ -13,19 +13,19 @@ use r3_core::kernel::InterruptNum;
1313
///
1414
/// You should do the following:
1515
///
16-
/// - Implement [`SbiTimerOptions`] on the system type `$Traits`.
16+
/// - Implement [`SbiTimerOptions`] on the kernel trait type `$Traits`.
1717
/// - Call `$Traits::configure_timer()` in your configuration function.
1818
/// See the following example.
1919
///
2020
/// ```rust,ignore
21-
/// r3_port_riscv::use_sbi_timer!(unsafe impl PortTimer for System);
21+
/// r3_port_riscv::use_sbi_timer!(unsafe impl PortTimer for SystemTraits);
2222
///
23-
/// impl r3_port_riscv::SbiTimerOptions for System {
23+
/// impl r3_port_riscv::SbiTimerOptions for SystemTraits {
2424
/// const FREQUENCY: u64 = 1_000_000;
2525
/// }
2626
///
27-
/// const fn configure_app(b: &mut CfgBuilder<System>) -> Objects {
28-
/// System::configure_timer(b);
27+
/// const fn configure_app(b: &mut r3_kernel::Cfg<SystemTraits>) -> Objects {
28+
/// SystemTraits::configure_timer(b);
2929
/// /* ... */
3030
/// }
3131
/// ```

src/r3_port_riscv/src/sbi_timer/imp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use r3_portkit::tickless::{TicklessCfg, TicklessStateTrait};
66

77
use crate::sbi_timer::cfg::SbiTimerOptions;
88

9-
/// Implemented on a system type by [`use_sbi_timer!`].
9+
/// Implemented on a kernel trait type by [`use_sbi_timer!`].
1010
///
1111
/// # Safety
1212
///

src/r3_port_riscv/src/threading/imp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ pub use csr::{CsrSet, NumTy};
156156
#[allow(dead_code)]
157157
const XSTATUS_PART_MASK: usize = csr::XSTATUS_FS_1;
158158

159-
/// Implemented on a system type by [`use_port!`].
159+
/// Implemented on a kernel trait type by [`use_port!`].
160160
///
161161
/// # Safety
162162
///

src/r3_port_std/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ pub const INTERRUPT_LINE_TIMER: InterruptNum = 1022;
7575
/// The default interrupt priority for [`INTERRUPT_LINE_TIMER`].
7676
pub const INTERRUPT_PRIORITY_TIMER: InterruptPriority = 16383;
7777

78-
/// Implemented on a system type by [`use_port!`].
78+
/// Implemented on a kernel trait type by [`use_port!`].
7979
///
8080
/// # Safety
8181
///

src/r3_support_rza1/src/os_timer/imp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use rza1::ostm0 as ostm;
77

88
use crate::os_timer::cfg::OsTimerOptions;
99

10-
/// Implemented on a system type by [`use_os_timer!`].
10+
/// Implemented on a kernel trait type by [`use_os_timer!`].
1111
///
1212
/// # Safety
1313
///

0 commit comments

Comments
 (0)