tg-clock 0.1.0

Clock helper library for rCore tutorial bare-metal experiments in RISC-V S-mode.
Documentation
# tg-clock

A tiny `no_std` clock helper crate for bare-metal RISC-V S-mode experiments.

It provides a minimal timer setup flow used in rCore tutorial style kernels:

- enable S-mode timer interrupts
- read current `time` CSR
- schedule next timer event via SBI

## Installation

```toml
[dependencies]
tg-clock = "0.1.0"
```

## Minimal Example

```rust
#![no_std]

use tg_clock::{clock_set_next_event, get_time, init};

pub fn kernel_init() {
    init();
}

pub fn on_timer_interrupt() {
    let _now = get_time();
    clock_set_next_event();
}
```

## API Summary

- `init()`
  - enables `sstatus.SIE` and `sie.STIE`
  - schedules the first timer event
- `clock_set_next_event()`
  - programs next timer interrupt through SBI `set_timer`
- `get_time() -> usize`
  - reads current value from RISC-V `time` CSR

## Notes

- Target: `riscv64gc-unknown-none-elf`
- Runtime: bare-metal / `no_std`
- Requires SBI implementation compatible with `tg-rcore-tutorial-sbi`