From: Fiona Behrens
Generate the `rust_helper_read{b,w,l,q}`, `rust_helper_write{b,w,l,q}`
and the relaxed version using a C macro.
This removes a lot of redundant code and is in preparation for pio
functions which uses a similar C macro.
Signed-off-by: Fiona Behrens
Signed-off-by: Andrew
rust name
- specialize `io_backend` for the x86 case
- do not modify lib/iomap.c
- rebased on v6.15-rc6
Link to v1:
https://lore.kernel.org/rust-for-linux/20250509031524.2604087-1-andrewjballa...@gmail.com/
Andrew Ballance (3):
rust: io: add new Io type
rust: io: add from_raw_cookie functi
hint about their type.
Suggested-by: Danilo Krummrich
Signed-off-by: Andrew Ballance
---
rust/kernel/io.rs | 73 +++
1 file changed, 73 insertions(+)
diff --git a/rust/kernel/io.rs b/rust/kernel/io.rs
index 9445451f4b02..81b26602d3bc 100644
--- a
-off-by: Fiona Behrens
Co-developed-by: Andrew Ballance
Signed-off-by: Andrew Ballance
---
drivers/gpu/nova-core/regs.rs | 1 +
rust/kernel/devres.rs | 4 +-
rust/kernel/io.rs | 438 +++-
rust/kernel/pci.rs | 2 +-
samples
renames `Bar` to `RawBar` and makes it generic over `IoAccess`.
a user can give a compile time suggestion when mapping a bar so
that the type of io can be known.
updates nova-core and rust_driver_pci to use new bar api.
Suggested-by: Danilo Krummrich
Signed-off-by: Andrew Ballance
---
drivers
From: Fiona Behrens
Implement `Debug` for `kernel::io::IoRaw` which also outputs the const
generic SIZE as a field.
Add some doctests to `IoRaw::new` and `MMIo::from_raw(_ref)`.
Signed-off-by: Fiona Behrens
Signed-off-by: Andrew Ballance
---
rust/kernel/io.rs | 63
adds a new Io type that uses the C ioread/iowrite family of functions
and implements the IoAccess trait for it and renames the old `Io`
to `MMIo`.
Signed-off-by: Andrew Ballance
---
rust/helpers/io.c | 7
rust/kernel/io.rs | 97 ---
2 files
t; path would be
> sufficient to cover the common outliers (ata, uart, vga, ipmi, ne2000)
> that need the iomap indirection and also the legacy devices that only
> need port I/O (floppy, x86 platform devices, ...).
Yeah, we probably don`t need the `PortIo` type and can rely on `Io` fo
can give a hint about their type.
Suggested-by: Danilo Krummrich
Signed-off-by: Andrew Ballance
---
rust/kernel/io.rs | 104 ++
1 file changed, 104 insertions(+)
diff --git a/rust/kernel/io.rs b/rust/kernel/io.rs
index 3d8b6e731ce7..30892f2909a6
update rust_driver_pci.rs to use the new bar and io api.
Signed-off-by: Andrew Ballance
---
samples/rust/rust_driver_pci.rs | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/samples/rust/rust_driver_pci.rs b/samples/rust/rust_driver_pci.rs
index 2bb260aebc9e
From: Fiona Behrens
Replace the Io struct with a new MMIo struct that uses the different
traits (`IoAccess`, `IoAccess64`, `IoAccessRelaxed` and
`IoAccess64Relaxed).
This allows to later implement PortIo and a generic Io framework.
Signed-off-by: Fiona Behrens
Co-developed-by: Andrew Ballance
From: Fiona Behrens
Generate the `rust_helper_read{b,w,l,q}`, `rust_helper_write{b,w,l,q}`
and the relaxed version using a C macro.
This removes a lot of redundant code and is in preparation for pio
functions which uses a similar C macro.
Signed-off-by: Fiona Behrens
Signed-off-by: Andrew
fix a doc test to use the new Io api.
Signed-off-by: Andrew Ballance
---
rust/kernel/devres.rs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/rust/kernel/devres.rs b/rust/kernel/devres.rs
index ddb1ce4a78d9..88d145821ca8 100644
--- a/rust/kernel/devres.rs
+++ b/rust
updates nova-core to use the new Io and Bar api.
Signed-off-by: Andrew Ballance
---
drivers/gpu/nova-core/driver.rs | 4 ++--
drivers/gpu/nova-core/regs.rs | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/nova-core/driver.rs b/drivers/gpu/nova-core/driver.rs
renames `Bar` to `RawBar` and makes it generic over `IoAccess`.
a user can give a compile time suggestion when mapping a bar so
that the type of io can be known.
Suggested-by: Danilo Krummrich
Signed-off-by: Andrew Ballance
---
rust/kernel/pci.rs | 88
From: Fiona Behrens
Move the non arch specific PIO size to linux/io.h.
This allows rust to access `PIO_OFFSET`, `PIO_MASK` and
`PIO_RESERVED`. This is required to implement `IO_COND` in rust.
Signed-off-by: Fiona Behrens
Signed-off-by: Andrew Ballance
---
include/linux/io.h | 13
adds a new Io type that uses the C ioread/iowrite family of functions
and implements the IoAccess trait for it.
Signed-off-by: Andrew Ballance
---
rust/helpers/io.c | 8 +
rust/kernel/io.rs | 86 +++
2 files changed, 94 insertions(+)
diff --git
From: Fiona Behrens
Add `rust::io::PortIo` implementing the `IoAccess` trait.
Signed-off-by: Fiona Behrens
Signed-off-by: Andrew Ballance
---
rust/helpers/io.c | 20 +++
rust/kernel/io.rs | 88 +++
2 files changed, 108 insertions(+)
diff
From: Fiona Behrens
Implement `Debug` for `kernel::io::IoRaw` which also outputs the const
generic SIZE as a field.
Add some doctests to `IoRaw::new` and `MMIo::from_raw(_ref)`.
Signed-off-by: Fiona Behrens
Signed-off-by: Andrew Ballance
---
rust/kernel/io.rs | 62
/#narrow/channel/288089-General/topic/.60IoRaw.60.20and.20.60usize.60/near/514788730
[1]
Andrew Ballance (6):
rust: io: add new Io type
rust: io: add from_raw_cookie functions
rust: pci: make Bar generic over Io
samples: rust: rust_driver_pci: update to use new bar and io api
gpu: nova
The requested Vec methods have been implemented thus, removes
the completed item from the nova task list
Signed-off-by: Andrew Ballance
---
Documentation/gpu/nova/core/todo.rst | 10 --
1 file changed, 10 deletions(-)
diff --git a/Documentation/gpu/nova/core/todo.rst
b/Documentation
implement the equivalent of the rust std's Vec::resize
on the kernel's Vec type.
Signed-off-by: Andrew Ballance
---
rust/kernel/alloc/kvec.rs | 26 ++
1 file changed, 26 insertions(+)
diff --git a/rust/kernel/alloc/kvec.rs b/rust/kernel/alloc/kvec.rs
index 18
implement the equivalent to the std's Vec::truncate
on the kernel's Vec type.
Signed-off-by: Andrew Ballance
---
rust/kernel/alloc/kvec.rs | 36
1 file changed, 36 insertions(+)
diff --git a/rust/kernel/alloc/kvec.rs b/rust/kernel/alloc/kve
:
https://lore.kernel.org/rust-for-linux/20250315024235.5282-1-andrewjballa...@gmail.com/
Andrew Ballance (3):
rust: alloc: add Vec::truncate method
rust: alloc: add Vec::resize method
gpu: nova-core: remove completed Vec extentions from task list
Documentation/gpu/nova/core/todo.rst | 10
This patch series implements the Vec::truncate and Vec::resize methods
that were needed by the nova driver and removes the corresponding item
from their task list
Andrew Ballance (3):
rust: alloc: add Vec::truncate method
rust: alloc: add Vec::resize method
gpu: nova-core: remove completed
implements the equivalent to the std's Vec::truncate
on the kernel's Vec type.
Signed-off-by: Andrew Ballance
---
rust/kernel/alloc/kvec.rs | 36
1 file changed, 36 insertions(+)
diff --git a/rust/kernel/alloc/kvec.rs b/rust/kernel/alloc/kve
implemnts the equivalent of the rust std's Vec::resize
on the kernel's Vec type.
Signed-off-by: Andrew Ballance
---
rust/kernel/alloc/kvec.rs | 25 +
1 file changed, 25 insertions(+)
diff --git a/rust/kernel/alloc/kvec.rs b/rust/kernel/alloc/kvec.rs
index 75
The requested Vec methods have been implemented thus, removes
the completed item from the nova task list
Signed-off-by: Andrew Ballance
---
Documentation/gpu/nova/core/todo.rst | 10 --
1 file changed, 10 deletions(-)
diff --git a/Documentation/gpu/nova/core/todo.rst
b/Documentation
On Sat, Mar 15, 2025 at 10:09:26AM +, Benno Lossin wrote:
> On Sat Mar 15, 2025 at 3:42 AM CET, Andrew Ballance wrote:
> > implements the equivalent to the std's Vec::truncate
> > on the kernel's Vec type.
> >
> > Signed-off-by: Andrew Ballance
> &
29 matches
Mail list logo