1. Mar 04, 2023
  2. Mar 03, 2023
  3. Mar 02, 2023
  4. Feb 21, 2023
    • bors[bot]'s avatar
      Merge #123 · b359b072
      bors[bot] authored
      
      
      123: Added clippy to the CI workflow r=almindor a=romancardenas
      
      I've been working with this crate for a while and noticed that it didn't include clippy as part of the CI process. This PR checks that clippy does not trigger any warning for new contributions. I also ran `cargo clippy --fix` to "fix" the crate.
      
      If you think this is useful, I can adapt other repos (e.g., riscv-rt or e310x). Cheers!
      
      Co-authored-by: default avatarRomán Cárdenas <rcardenas.rod@gmail.com>
      b359b072
  5. Feb 20, 2023
  6. Jan 19, 2023
  7. Jan 18, 2023
  8. Nov 11, 2022
  9. Nov 10, 2022
  10. Oct 20, 2022
    • bors[bot]'s avatar
      Merge #117 · 462b5509
      bors[bot] authored
      
      
      117: fix atomicity of critical section, fixes #116 r=dkhayes117 a=almindor
      
      This changes `SingleHartCriticalSection::acquire` to be done in an atomic way.
      
      Fixes #116
      
      NOTE: no changelog since it fixes a small bug on unreleased change
      
      Co-authored-by: default avatarAles Katona <ales@katona.me>
      462b5509
  11. Oct 17, 2022
  12. Oct 13, 2022
  13. Oct 07, 2022
  14. Oct 06, 2022
  15. Aug 22, 2022
    • bors[bot]'s avatar
      Merge #109 · 54bfff3f
      bors[bot] authored
      
      
      109: Update to edition 2021. r=Disasm a=Dirbaio
      
      This shouldn't be a breaking change since Edition 2021 came out in
      Rust 1.56, and MSRV is already higher than that (Rust 1.59)
      
      Co-authored-by: default avatarDario Nieuwenhuis <dirbaio@dirbaio.net>
      54bfff3f
    • Dario Nieuwenhuis's avatar
      Update to edition 2021. · d75714ae
      Dario Nieuwenhuis authored
      This shouldn't be a breaking change since Edition 2021 came out in
      Rust 1.56, and MSRV is already higher than that (Rust 1.59)
      d75714ae
  16. Aug 14, 2022
    • bors[bot]'s avatar
      Merge #108 · 98ae3aa2
      bors[bot] authored
      
      
      108: fix: clearify that mip.{MSIP, MTIP} are read-only r=almindor a=luojia65
      
      closes #62
      
      In RISC-V privileged specification, it says:
      
      > Bits mip.MTIP and mie.MTIE are the interrupt-pending and interrupt-enable bits for machine timer interrupts. MTIP is read-only in mip, and is cleared by writing to the memory-mapped machine-mode timer compare register.
      >
      > Bits mip.MSIP and mie.MSIE are the interrupt-pending and interrupt-enable bits for machine-level software interrupts. MSIP is read-only in mip, and is written by accesses to memory-mapped control registers, which are used by remote harts to provide machine-level interprocessor interrupts.
      
      indicated by the specification, mip.MSIP and mip.MTIP bits are read-only. This pull request clearifies this by removing {set, clear}_{msoft, mtimer} functions from mip module of riscv crate.
      
      Co-authored-by: default avatarluojia65 <me@luojia.cc>
      98ae3aa2
    • luojia65's avatar
      fix: clearify that mip.{MSIP, MTIP} are read-only · 9418b6c5
      luojia65 authored
      closes #62
      9418b6c5
  17. Aug 08, 2022
  18. Jul 31, 2022
  19. Jul 16, 2022
    • bors[bot]'s avatar
      Merge #104 · d50928b6
      bors[bot] authored
      
      
      104: Fix asm::delay not clobbering count register r=dkhayes117 a=adamgreig
      
      I noticed that a small example using two `asm::delay()` calls worked fine in debug mode but not in release mode. Eventually `@jamesmunns` spotted that the count register wasn't being reloaded between calls:
      
      ```
          # loads a2 with real_cyc
          400001ce:	02faf637          lui	a2,0x2faf
          400001d2:	0816061b          addiw	a2,a2,129
          # turn on led
          400001d6:	c10c              sw	a1,0(a0)
          # count down (delay impl)
          400001d8:	167d              addi	a2,a2,-1
          400001da:	fe7d              bnez	a2,400001d8 <.LBB0_8+0x30>
          # turn off led
          400001dc:	00052023          sw	zero,0(a0) # 2000000 <.Lline_table_start0+0x1fff7a4>
          # count down again (delay impl, note a2 not reloaded)
          400001e0:	167d              addi	a2,a2,-1
          400001e2:	fe7d              bnez	a2,400001e0 <.LBB0_8+0x38>
          # loop back to start
          400001e4:	bfcd              j	400001d6 <.LBB0_8+0x2e>
      ```
      
      By changing the register spec to `inout`, Rust knows the register is modified and reloads it next time. I added the nomem and nostack options too since the instructions don't touch memory or stack, to match the cortex-m impl. This change fixes codegen for my example:
      
      
      ```
          400001ce:	02faf637          lui	a2,0x2faf
          400001d2:	0816061b          addiw	a2,a2,129
          400001d6:	c10c              sw	a1,0(a0)
          400001d8:	86b2              mv	a3,a2
          400001da:	16fd              addi	a3,a3,-1
          400001dc:	fefd              bnez	a3,400001da <.LBB0_8+0x32>
          400001de:	00052023          sw	zero,0(a0) # 2000000 <.Lline_table_start0+0x1fff779>
          400001e2:	86b2              mv	a3,a2
          400001e4:	16fd              addi	a3,a3,-1
          400001e6:	fefd              bnez	a3,400001e4 <.LBB0_8+0x3c>
          400001e8:	b7fd              j	400001d6 <.LBB0_8+0x2e>
      
      ```
      
      Co-authored-by: default avatarAdam Greig <adam@adamgreig.com>
      d50928b6
    • Adam Greig's avatar
      Fix asm::delay not clobbering count register · cdd70bb4
      Adam Greig authored
      cdd70bb4
  20. Apr 21, 2022