Skip to content

Commit ec46da5

Browse files
committed
Merge branch 'bits/190-rust' into asahi-wip
2 parents 2e8b20d + 5802d91 commit ec46da5

75 files changed

Lines changed: 5172 additions & 162 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

MAINTAINERS

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6919,6 +6919,19 @@ F: include/linux/dma-mapping.h
69196919
F: include/linux/swiotlb.h
69206920
F: kernel/dma/
69216921

6922+
DMA MAPPING HELPERS DEVICE DRIVER API [RUST]
6923+
M: Abdiel Janulgue <abdiel.janulgue@gmail.com>
6924+
M: Danilo Krummrich <dakr@kernel.org>
6925+
R: Daniel Almeida <daniel.almeida@collabora.com>
6926+
R: Robin Murphy <robin.murphy@arm.com>
6927+
R: Andreas Hindborg <a.hindborg@kernel.org>
6928+
L: rust-for-linux@vger.kernel.org
6929+
S: Supported
6930+
W: https://rust-for-linux.com
6931+
T: git https://github.com/Rust-for-Linux/linux.git alloc-next
6932+
F: rust/kernel/dma.rs
6933+
F: samples/rust/rust_dma.rs
6934+
69226935
DMA-BUF HEAPS FRAMEWORK
69236936
M: Sumit Semwal <sumit.semwal@linaro.org>
69246937
R: Benjamin Gaignard <benjamin.gaignard@collabora.com>
@@ -16004,6 +16017,8 @@ F: include/linux/kmod.h
1600416017
F: include/linux/module*.h
1600516018
F: kernel/module/
1600616019
F: lib/test_kmod.c
16020+
F: rust/kernel/module_param.rs
16021+
F: rust/macros/module.rs
1600716022
F: scripts/module*
1600816023
F: tools/testing/selftests/kmod/
1600916024

drivers/block/rnull.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use kernel::{
2727
module! {
2828
type: NullBlkModule,
2929
name: "rnull_mod",
30-
author: "Andreas Hindborg",
30+
authors: ["Andreas Hindborg"],
3131
description: "Rust implementation of the C null block driver",
3232
license: "GPL v2",
3333
}

drivers/gpu/drm/drm_panic.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -486,11 +486,6 @@ static void drm_panic_qr_exit(void)
486486
stream.workspace = NULL;
487487
}
488488

489-
extern size_t drm_panic_qr_max_data_size(u8 version, size_t url_len);
490-
491-
extern u8 drm_panic_qr_generate(const char *url, u8 *data, size_t data_len, size_t data_size,
492-
u8 *tmp, size_t tmp_size);
493-
494489
static int drm_panic_get_qr_code_url(u8 **qr_image)
495490
{
496491
struct kmsg_dump_iter iter;

drivers/gpu/drm/drm_panic_qr.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
//! * <https://github.com/bjguillot/qr>
2828
2929
use core::cmp;
30-
use kernel::str::CStr;
30+
use kernel::{prelude::*, str::CStr};
3131

3232
#[derive(Debug, Clone, Copy, PartialEq, Eq, Ord, PartialOrd)]
3333
struct Version(usize);
@@ -929,7 +929,7 @@ impl QrImage<'_> {
929929
/// * `tmp` must be valid for reading and writing for `tmp_size` bytes.
930930
///
931931
/// They must remain valid for the duration of the function call.
932-
#[no_mangle]
932+
#[export]
933933
pub unsafe extern "C" fn drm_panic_qr_generate(
934934
url: *const kernel::ffi::c_char,
935935
data: *mut u8,
@@ -980,8 +980,13 @@ pub unsafe extern "C" fn drm_panic_qr_generate(
980980
/// * If `url_len` > 0, remove the 2 segments header/length and also count the
981981
/// conversion to numeric segments.
982982
/// * If `url_len` = 0, only removes 3 bytes for 1 binary segment.
983-
#[no_mangle]
984-
pub extern "C" fn drm_panic_qr_max_data_size(version: u8, url_len: usize) -> usize {
983+
///
984+
/// # Safety
985+
///
986+
/// Always safe to call.
987+
// Required to be unsafe due to the `#[export]` annotation.
988+
#[export]
989+
pub unsafe extern "C" fn drm_panic_qr_max_data_size(version: u8, url_len: usize) -> usize {
985990
#[expect(clippy::manual_range_contains)]
986991
if version < 1 || version > 40 {
987992
return 0;

drivers/net/phy/ax88796b_rust.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ kernel::module_phy_driver! {
1919
DeviceId::new_with_driver::<PhyAX88796B>()
2020
],
2121
name: "rust_asix_phy",
22-
author: "FUJITA Tomonori <fujita.tomonori@gmail.com>",
22+
authors: ["FUJITA Tomonori <fujita.tomonori@gmail.com>"],
2323
description: "Rust Asix PHYs driver",
2424
license: "GPL",
2525
}

drivers/net/phy/qt2025.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ kernel::module_phy_driver! {
2626
phy::DeviceId::new_with_driver::<PhyQT2025>(),
2727
],
2828
name: "qt2025_phy",
29-
author: "FUJITA Tomonori <fujita.tomonori@gmail.com>",
29+
authors: ["FUJITA Tomonori <fujita.tomonori@gmail.com>"],
3030
description: "AMCC QT2025 PHY driver",
3131
license: "GPL",
3232
firmware: ["qt2025-2.0.3.3.fw"],

drivers/soc/apple/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ config APPLE_SART
7474

7575
Say 'y' here if you have an Apple SoC.
7676

77+
config RUST_APPLE_RTKIT
78+
bool
79+
depends on RUST
80+
depends on APPLE_RTKIT
81+
7782
endmenu
7883

7984
endif

include/drm/drm_panic.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,4 +163,11 @@ static inline void drm_panic_unlock(struct drm_device *dev, unsigned long flags)
163163

164164
#endif
165165

166+
#if defined(CONFIG_DRM_PANIC_SCREEN_QR_CODE)
167+
size_t drm_panic_qr_max_data_size(u8 version, size_t url_len);
168+
169+
u8 drm_panic_qr_generate(const char *url, u8 *data, size_t data_len, size_t data_size,
170+
u8 *tmp, size_t tmp_size);
171+
#endif
172+
166173
#endif /* __DRM_PANIC_H__ */

include/linux/sprintf.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,7 @@ __scanf(2, 0) int vsscanf(const char *, const char *, va_list);
2424
extern bool no_hash_pointers;
2525
int no_hash_pointers_enable(char *str);
2626

27+
/* Used for Rust formatting ('%pA') */
28+
char *rust_fmt_argument(char *buf, char *end, const void *ptr);
29+
2730
#endif /* _LINUX_KERNEL_SPRINTF_H */

lib/Kconfig.debug

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3289,6 +3289,14 @@ config RUST_KERNEL_DOCTESTS
32893289

32903290
If unsure, say N.
32913291

3292+
config RUST_EXTRA_LOCKDEP
3293+
bool "Extra lockdep checking"
3294+
depends on RUST && PROVE_LOCKING
3295+
help
3296+
Enabled additional lockdep integration with certain Rust types.
3297+
3298+
If unsure, say N.
3299+
32923300
endmenu # "Rust"
32933301

32943302
endmenu # Kernel hacking

0 commit comments

Comments
 (0)