Skip to content

Commit e203e9d

Browse files
committed
Hide functions to enable MMU.
They need to be public because the macro calls them, but they shouldn't be called directly.
1 parent 2676f1b commit e203e9d

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ use core::arch::naked_asm;
2828
pub use entry::secondary_entry;
2929
#[cfg(feature = "initial-pagetable")]
3030
pub use pagetable::{
31-
DEFAULT_MAIR, DEFAULT_SCTLR, DEFAULT_TCR, InitialPagetable, enable_mmu_el1, enable_mmu_el2,
32-
enable_mmu_el3,
31+
__enable_mmu_el1, __enable_mmu_el2, __enable_mmu_el3, DEFAULT_MAIR, DEFAULT_SCTLR, DEFAULT_TCR,
32+
InitialPagetable,
3333
};
3434

3535
#[cfg(not(feature = "initial-pagetable"))]

src/pagetable.rs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,9 @@ macro_rules! initial_pagetable {
9797
/// Expects the MAIR value in x8, the TCR value in x9, and the SCTLR value in x10.
9898
///
9999
/// Clobbers x8-x9.
100+
#[doc(hidden)]
100101
#[unsafe(naked)]
101-
pub unsafe extern "C" fn enable_mmu_el1() {
102+
pub unsafe extern "C" fn __enable_mmu_el1() {
102103
naked_asm!(
103104
// Load and apply the memory management configuration, ready to enable MMU and
104105
// caches.
@@ -134,8 +135,9 @@ pub unsafe extern "C" fn enable_mmu_el1() {
134135
/// Expects the MAIR value in x8, the TCR value in x9, and the SCTLR value in x10.
135136
///
136137
/// Clobbers x8-x9.
138+
#[doc(hidden)]
137139
#[unsafe(naked)]
138-
pub unsafe extern "C" fn enable_mmu_el2() {
140+
pub unsafe extern "C" fn __enable_mmu_el2() {
139141
naked_asm!(
140142
// Load and apply the memory management configuration, ready to enable MMU and
141143
// caches.
@@ -171,8 +173,9 @@ pub unsafe extern "C" fn enable_mmu_el2() {
171173
/// Expects the MAIR value in x8, the TCR value in x9, and the SCTLR value in x10.
172174
///
173175
/// Clobbers x8-x9.
176+
#[doc(hidden)]
174177
#[unsafe(naked)]
175-
pub unsafe extern "C" fn enable_mmu_el3() {
178+
pub unsafe extern "C" fn __enable_mmu_el3() {
176179
naked_asm!(
177180
// Load and apply the memory management configuration, ready to enable MMU and
178181
// caches.
@@ -225,7 +228,7 @@ macro_rules! __enable_mmu {
225228
MAIR_VALUE = const $mair,
226229
TCR_VALUE = const $tcr,
227230
SCTLR_VALUE = const $sctlr,
228-
enable_mmu_el1 = sym $crate::enable_mmu_el1,
231+
enable_mmu_el1 = sym $crate::__enable_mmu_el1,
229232
);
230233
};
231234
}
@@ -257,7 +260,7 @@ macro_rules! __enable_mmu {
257260
MAIR_VALUE = const $mair,
258261
TCR_VALUE = const $tcr,
259262
SCTLR_VALUE = const $sctlr,
260-
enable_mmu_el2 = sym $crate::enable_mmu_el2,
263+
enable_mmu_el2 = sym $crate::__enable_mmu_el2,
261264
);
262265
};
263266
}
@@ -289,7 +292,7 @@ macro_rules! __enable_mmu {
289292
MAIR_VALUE = const $mair,
290293
TCR_VALUE = const $tcr,
291294
SCTLR_VALUE = const $sctlr,
292-
enable_mmu_el3 = sym $crate::enable_mmu_el3,
295+
enable_mmu_el3 = sym $crate::__enable_mmu_el3,
293296
);
294297
};
295298
}
@@ -326,9 +329,9 @@ macro_rules! __enable_mmu {
326329
MAIR_VALUE = const $mair,
327330
TCR_VALUE = const $tcr,
328331
SCTLR_VALUE = const $sctlr,
329-
enable_mmu_el1 = sym $crate::enable_mmu_el1,
330-
enable_mmu_el2 = sym $crate::enable_mmu_el2,
331-
enable_mmu_el3 = sym $crate::enable_mmu_el3,
332+
enable_mmu_el1 = sym $crate::__enable_mmu_el1,
333+
enable_mmu_el2 = sym $crate::__enable_mmu_el2,
334+
enable_mmu_el3 = sym $crate::__enable_mmu_el3,
332335
);
333336
};
334337
}

0 commit comments

Comments
 (0)