Skip to content

Commit ad0cf97

Browse files
committed
fix: correct wrong error messages and a doc comment
1 parent 644474c commit ad0cf97

15 files changed

Lines changed: 18 additions & 18 deletions

File tree

14_virtual_mem_part2_mmio_remap/kernel/src/memory.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl<ATYPE: AddressType> Sub<Address<ATYPE>> for Address<ATYPE> {
101101
#[inline(always)]
102102
fn sub(self, rhs: Address<ATYPE>) -> Self::Output {
103103
match self.value.checked_sub(rhs.value) {
104-
None => panic!("Overflow on Address::sub"),
104+
None => panic!("Underflow on Address::sub"),
105105
Some(x) => Self::new(x),
106106
}
107107
}

14_virtual_mem_part2_mmio_remap/kernel/src/memory/mmu/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ impl<ATYPE: AddressType> MemoryRegion<ATYPE> {
172172
self.end_exclusive
173173
}
174174

175-
/// Returns the exclusive end page address.
175+
/// Returns the inclusive end page address.
176176
pub fn end_inclusive_page_addr(&self) -> PageAddress<ATYPE> {
177177
self.end_exclusive.checked_offset(-1).unwrap()
178178
}

15_virtual_mem_part3_precomputed_tables/kernel/src/bsp/raspberrypi/kernel.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ SECTIONS
9191
. += 8 * 1024 * 1024;
9292
__mmio_remap_end_exclusive = .;
9393

94-
ASSERT((. & PAGE_MASK) == 0, "End of boot core stack is not page aligned")
94+
ASSERT((. & PAGE_MASK) == 0, "MMIO remap reservation is not page aligned")
9595

9696
/***********************************************************************************************
9797
* Misc

15_virtual_mem_part3_precomputed_tables/kernel/src/memory.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl<ATYPE: AddressType> Sub<Address<ATYPE>> for Address<ATYPE> {
101101
#[inline(always)]
102102
fn sub(self, rhs: Address<ATYPE>) -> Self::Output {
103103
match self.value.checked_sub(rhs.value) {
104-
None => panic!("Overflow on Address::sub"),
104+
None => panic!("Underflow on Address::sub"),
105105
Some(x) => Self::new(x),
106106
}
107107
}

15_virtual_mem_part3_precomputed_tables/kernel/src/memory/mmu/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ impl<ATYPE: AddressType> MemoryRegion<ATYPE> {
172172
self.end_exclusive
173173
}
174174

175-
/// Returns the exclusive end page address.
175+
/// Returns the inclusive end page address.
176176
pub fn end_inclusive_page_addr(&self) -> PageAddress<ATYPE> {
177177
self.end_exclusive.checked_offset(-1).unwrap()
178178
}

16_virtual_mem_part4_higher_half_kernel/kernel/src/memory.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl<ATYPE: AddressType> Sub<Address<ATYPE>> for Address<ATYPE> {
101101
#[inline(always)]
102102
fn sub(self, rhs: Address<ATYPE>) -> Self::Output {
103103
match self.value.checked_sub(rhs.value) {
104-
None => panic!("Overflow on Address::sub"),
104+
None => panic!("Underflow on Address::sub"),
105105
Some(x) => Self::new(x),
106106
}
107107
}

16_virtual_mem_part4_higher_half_kernel/kernel/src/memory/mmu/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ impl<ATYPE: AddressType> MemoryRegion<ATYPE> {
177177
self.end_exclusive
178178
}
179179

180-
/// Returns the exclusive end page address.
180+
/// Returns the inclusive end page address.
181181
pub fn end_inclusive_page_addr(&self) -> PageAddress<ATYPE> {
182182
self.end_exclusive.checked_offset(-1).unwrap()
183183
}

17_kernel_symbols/kernel/src/memory.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl<ATYPE: AddressType> Sub<Address<ATYPE>> for Address<ATYPE> {
101101
#[inline(always)]
102102
fn sub(self, rhs: Address<ATYPE>) -> Self::Output {
103103
match self.value.checked_sub(rhs.value) {
104-
None => panic!("Overflow on Address::sub"),
104+
None => panic!("Underflow on Address::sub"),
105105
Some(x) => Self::new(x),
106106
}
107107
}

17_kernel_symbols/kernel/src/memory/mmu/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ impl<ATYPE: AddressType> MemoryRegion<ATYPE> {
177177
self.end_exclusive
178178
}
179179

180-
/// Returns the exclusive end page address.
180+
/// Returns the inclusive end page address.
181181
pub fn end_inclusive_page_addr(&self) -> PageAddress<ATYPE> {
182182
self.end_exclusive.checked_offset(-1).unwrap()
183183
}

18_backtrace/kernel/src/memory.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl<ATYPE: AddressType> Sub<usize> for Address<ATYPE> {
101101
#[inline(always)]
102102
fn sub(self, rhs: usize) -> Self::Output {
103103
match self.value.checked_sub(rhs) {
104-
None => panic!("Overflow on Address::sub"),
104+
None => panic!("Underflow on Address::sub"),
105105
Some(x) => Self::new(x),
106106
}
107107
}
@@ -113,7 +113,7 @@ impl<ATYPE: AddressType> Sub<Address<ATYPE>> for Address<ATYPE> {
113113
#[inline(always)]
114114
fn sub(self, rhs: Address<ATYPE>) -> Self::Output {
115115
match self.value.checked_sub(rhs.value) {
116-
None => panic!("Overflow on Address::sub"),
116+
None => panic!("Underflow on Address::sub"),
117117
Some(x) => Self::new(x),
118118
}
119119
}

0 commit comments

Comments
 (0)