Skip to content

Commit c2c480c

Browse files
authored
Merge pull request #1658 from hermit-os/release-0.11.0
chore: release version 0.11.0
2 parents 2657e74 + 698bede commit c2c480c

Some content is hidden

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

45 files changed

+312
-450
lines changed

Cargo.lock

Lines changed: 99 additions & 97 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "hermit-kernel"
3-
version = "0.10.0"
3+
version = "0.11.0"
44
authors = [
55
"Stefan Lankes <slankes@eonerc.rwth-aachen.de>",
66
"Colin Finck <colin.finck@rwth-aachen.de>",

src/arch/aarch64/kernel/interrupts.rs

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ pub(crate) extern "C" fn do_fiq(_state: &State) -> *mut usize {
120120
if let Some(irqid) = GicV3::get_and_acknowledge_interrupt() {
121121
let vector: u8 = u32::from(irqid).try_into().unwrap();
122122

123-
debug!("Receive fiq {}", vector);
123+
debug!("Receive fiq {vector}");
124124
increment_irq_counter(vector);
125125

126126
if let Some(handlers) = INTERRUPT_HANDLERS.get() {
@@ -148,7 +148,7 @@ pub(crate) extern "C" fn do_irq(_state: &State) -> *mut usize {
148148
if let Some(irqid) = GicV3::get_and_acknowledge_interrupt() {
149149
let vector: u8 = u32::from(irqid).try_into().unwrap();
150150

151-
debug!("Receive interrupt {}", vector);
151+
debug!("Receive interrupt {vector}");
152152
increment_irq_counter(vector);
153153

154154
if let Some(handlers) = INTERRUPT_HANDLERS.get() {
@@ -189,27 +189,27 @@ pub(crate) extern "C" fn do_sync(state: &State) {
189189
// add page fault handler
190190

191191
error!("Current stack pointer {state:p}");
192-
error!("Unable to handle page fault at {:#x}", far);
192+
error!("Unable to handle page fault at {far:#x}");
193193
error!("Exception return address {:#x}", ELR_EL1.get());
194194
error!("Thread ID register {:#x}", TPIDR_EL0.get());
195195
error!("Table Base Register {:#x}", TTBR0_EL1.get());
196-
error!("Exception Syndrome Register {:#x}", esr);
196+
error!("Exception Syndrome Register {esr:#x}");
197197

198198
GicV3::end_interrupt(irqid);
199199
scheduler::abort()
200200
} else {
201201
error!("Unknown exception");
202202
}
203203
} else if ec == 0x3c {
204-
error!("Trap to debugger, PC={:#x}", pc);
204+
error!("Trap to debugger, PC={pc:#x}");
205205
} else {
206-
error!("Unsupported exception class: {:#x}, PC={:#x}", ec, pc);
206+
error!("Unsupported exception class: {ec:#x}, PC={pc:#x}");
207207
}
208208
}
209209

210210
#[unsafe(no_mangle)]
211211
pub(crate) extern "C" fn do_bad_mode(_state: &State, reason: u32) -> ! {
212-
error!("Receive unhandled exception: {}", reason);
212+
error!("Receive unhandled exception: {reason}");
213213

214214
scheduler::abort()
215215
}
@@ -257,13 +257,9 @@ pub(crate) fn init() {
257257
let cpu_id = core_id();
258258

259259
info!("Found {num_cpus} cpus!");
260+
info!("Found GIC Distributor interface at {gicd_start:p} (size {gicd_size:#X})");
260261
info!(
261-
"Found GIC Distributor interface at {:p} (size {:#X})",
262-
gicd_start, gicd_size
263-
);
264-
info!(
265-
"Found generic interrupt controller redistributor at {:p} (size {:#X}, stride {:#X})",
266-
gicr_start, gicr_size, gicr_stride
262+
"Found generic interrupt controller redistributor at {gicr_start:p} (size {gicr_size:#X}, stride {gicr_stride:#X})"
267263
);
268264

269265
let gicd_address =
@@ -323,10 +319,7 @@ pub(crate) fn init() {
323319
TIMER_INTERRUPT = irq;
324320
}
325321

326-
debug!(
327-
"Timer interrupt: {}, type {}, flags {}",
328-
irq, irqtype, irqflags
329-
);
322+
debug!("Timer interrupt: {irq}, type {irqtype}, flags {irqflags}");
330323

331324
IRQ_NAMES
332325
.lock()
@@ -366,7 +359,7 @@ static IRQ_NAMES: InterruptTicketMutex<HashMap<u8, &'static str, RandomState>> =
366359

367360
#[allow(dead_code)]
368361
pub(crate) fn add_irq_name(irq_number: u8, name: &'static str) {
369-
debug!("Register name \"{}\" for interrupt {}", name, irq_number);
362+
debug!("Register name \"{name}\" for interrupt {irq_number}");
370363
IRQ_NAMES.lock().insert(SPI_START + irq_number, name);
371364
}
372365

src/arch/aarch64/kernel/pci.rs

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ fn detect_pci_regions(dtb: &Dtb<'_>, parts: &[&str]) -> (u64, u64, u64) {
8989
}
9090
0b10 => {
9191
let prefetchable = high.get_bit(30);
92-
debug!("32 bit memory space: prefetchable {}", prefetchable);
92+
debug!("32 bit memory space: prefetchable {prefetchable}");
9393
if mem32_start != 0 {
9494
warn!("Found already 32 bit memory space");
9595
}
@@ -100,7 +100,7 @@ fn detect_pci_regions(dtb: &Dtb<'_>, parts: &[&str]) -> (u64, u64, u64) {
100100
}
101101
0b11 => {
102102
let prefetchable = high.get_bit(30);
103-
debug!("64 bit memory space: prefetchable {}", prefetchable);
103+
debug!("64 bit memory space: prefetchable {prefetchable}");
104104
if mem64_start != 0 {
105105
warn!("Found already 64 bit memory space");
106106
}
@@ -194,10 +194,7 @@ fn detect_interrupt(
194194
(value_slice, residual_slice) = residual_slice.split_at(core::mem::size_of::<u32>());
195195
let irq_flags = u32::from_be_bytes(value_slice.try_into().unwrap());
196196

197-
trace!(
198-
"Interrupt type {:#x}, number {:#x} flags {:#x}",
199-
irq_type, irq_number, irq_flags
200-
);
197+
trace!("Interrupt type {irq_type:#x}, number {irq_number:#x} flags {irq_flags:#x}");
201198

202199
if high.get_bits(0..24) == addr {
203200
pin += 1;
@@ -250,8 +247,7 @@ pub fn init() {
250247
let pci_address =
251248
virtualmem::allocate_aligned(size.try_into().unwrap(), 0x1000_0000).unwrap();
252249
info!(
253-
"Mapping PCI Enhanced Configuration Space interface to virtual address {:p} (size {:#X})",
254-
pci_address, size
250+
"Mapping PCI Enhanced Configuration Space interface to virtual address {pci_address:p} (size {size:#X})"
255251
);
256252

257253
let mut flags = PageTableEntryFlags::empty();
@@ -265,9 +261,9 @@ pub fn init() {
265261

266262
let (mut io_start, mem32_start, mut mem64_start) = detect_pci_regions(&dtb, &parts);
267263

268-
debug!("IO address space starts at{:#X}", io_start);
269-
debug!("Memory32 address space starts at {:#X}", mem32_start);
270-
debug!("Memory64 address space starts {:#X}", mem64_start);
264+
debug!("IO address space starts at{io_start:#X}");
265+
debug!("Memory32 address space starts at {mem32_start:#X}");
266+
debug!("Memory64 address space starts {mem64_start:#X}");
271267
assert!(io_start > 0);
272268
assert!(mem32_start > 0);
273269
assert!(mem64_start > 0);
@@ -339,8 +335,7 @@ pub fn init() {
339335
&parts,
340336
) {
341337
debug!(
342-
"Initialize interrupt pin {} and line {} for device {}",
343-
pin, line, device_id
338+
"Initialize interrupt pin {pin} and line {line} for device {device_id}"
344339
);
345340
dev.set_irq(pin, line);
346341
}

src/arch/aarch64/kernel/processor.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,7 @@ pub fn configure() {
203203
out(reg) pmcr_el0,
204204
options(nostack, nomem),
205205
);
206-
debug!(
207-
"PMCR_EL0 (has RES1 bits and therefore mustn't be zero): {:#X}",
208-
pmcr_el0
209-
);
206+
debug!("PMCR_EL0 (has RES1 bits and therefore mustn't be zero): {pmcr_el0:#X}");
210207
pmcr_el0 |= (1 << 0) | (1 << 2) | (1 << 6);
211208
asm!(
212209
"msr pmcr_el0, {}",

src/arch/aarch64/kernel/scheduler.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ impl TaskStacks {
181181

182182
pub fn from_boot_stacks() -> TaskStacks {
183183
let stack = VirtAddr::new(CURRENT_STACK_ADDRESS.load(Ordering::Relaxed));
184-
debug!("Using boot stack {:p}", stack);
184+
debug!("Using boot stack {stack:p}");
185185

186186
TaskStacks::Boot(BootStack { stack })
187187
}
@@ -327,7 +327,7 @@ extern "C" fn task_start(_f: extern "C" fn(usize), _arg: usize, _user_stack: u64
327327

328328
#[cfg(target_os = "none")]
329329
extern "C" fn thread_exit(status: i32) -> ! {
330-
debug!("Exit thread with error code {}!", status);
330+
debug!("Exit thread with error code {status}!");
331331
core_scheduler().exit(status)
332332
}
333333

src/arch/aarch64/kernel/systemtime.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ pub fn init() {
6464
let (slice, _residual_slice) = residual_slice.split_at(core::mem::size_of::<u64>());
6565
let size = u64::from_be_bytes(slice.try_into().unwrap());
6666

67-
debug!("Found RTC at {:p} (size {:#X})", addr, size);
67+
debug!("Found RTC at {addr:p} (size {size:#X})");
6868

6969
let pl031_address = virtualmem::allocate_aligned(
7070
size.try_into().unwrap(),

src/arch/aarch64/mm/paging.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -550,15 +550,15 @@ fn get_page_range<S: PageSize>(virtual_address: VirtAddr, count: usize) -> PageI
550550
}
551551

552552
pub fn get_page_table_entry<S: PageSize>(virtual_address: VirtAddr) -> Option<PageTableEntry> {
553-
trace!("Looking up Page Table Entry for {:p}", virtual_address);
553+
trace!("Looking up Page Table Entry for {virtual_address:p}");
554554

555555
let page = Page::<S>::including_address(virtual_address);
556556
let root_pagetable = unsafe { &mut *(L0TABLE_ADDRESS.as_mut_ptr::<PageTable<L0Table>>()) };
557557
root_pagetable.get_page_table_entry(page)
558558
}
559559

560560
pub fn get_physical_address<S: PageSize>(virtual_address: VirtAddr) -> Option<PhysAddr> {
561-
trace!("Getting physical address for {:p}", virtual_address);
561+
trace!("Getting physical address for {virtual_address:p}");
562562

563563
let page = Page::<S>::including_address(virtual_address);
564564
let root_pagetable = unsafe { &mut *(L0TABLE_ADDRESS.as_mut_ptr::<PageTable<L0Table>>()) };
@@ -586,8 +586,7 @@ pub fn map<S: PageSize>(
586586
flags: PageTableEntryFlags,
587587
) {
588588
trace!(
589-
"Mapping virtual address {:p} to physical address {:p} ({} pages)",
590-
virtual_address, physical_address, count
589+
"Mapping virtual address {virtual_address:p} to physical address {physical_address:p} ({count} pages)"
591590
);
592591

593592
let range = get_page_range::<S>(virtual_address, count);
@@ -616,10 +615,7 @@ pub fn map_heap<S: PageSize>(virt_addr: VirtAddr, count: usize) -> Result<(), us
616615
}
617616

618617
pub fn unmap<S: PageSize>(virtual_address: VirtAddr, count: usize) {
619-
trace!(
620-
"Unmapping virtual address {:p} ({} pages)",
621-
virtual_address, count
622-
);
618+
trace!("Unmapping virtual address {virtual_address:p} ({count} pages)");
623619

624620
let range = get_page_range::<S>(virtual_address, count);
625621
let root_pagetable = unsafe { &mut *(L0TABLE_ADDRESS.as_mut_ptr::<PageTable<L0Table>>()) };
@@ -635,7 +631,7 @@ pub unsafe fn init() {
635631
let aa64mmfr0: u64;
636632

637633
let ram_start = get_ram_address();
638-
info!("RAM starts at physical address {:p}", ram_start);
634+
info!("RAM starts at physical address {ram_start:p}");
639635

640636
// determine physical address size
641637
unsafe {

src/arch/riscv64/kernel/devicetree.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub fn init() {
5858
warn!("Unknown platform, guessing PLIC context 1");
5959
PLATFORM_MODEL = Model::Unknown;
6060
}
61-
info!("Model: {}", model);
61+
info!("Model: {model}");
6262
}
6363
}
6464
}
@@ -122,7 +122,7 @@ pub fn init_drivers() {
122122
.property("local-mac-address")
123123
.expect("local-mac-address property for GEM not found in FDT")
124124
.value;
125-
debug!("Local MAC address: {:x?}", mac);
125+
debug!("Local MAC address: {mac:x?}");
126126
let mut phy_addr = u32::MAX;
127127

128128
let phy_node = gem_node
@@ -140,10 +140,7 @@ pub fn init_drivers() {
140140
}
141141

142142
let gem_region_start = PhysAddr::new(gem_region.starting_address as u64);
143-
debug!(
144-
"Init GEM at {:p}, irq: {}, phy_addr: {}",
145-
gem_region_start, irq, phy_addr
146-
);
143+
debug!("Init GEM at {gem_region_start:p}, irq: {irq}, phy_addr: {phy_addr}");
147144
paging::identity_map::<paging::HugePageSize>(
148145
AddrRange::new(
149146
gem_region_start,
@@ -181,10 +178,7 @@ pub fn init_drivers() {
181178

182179
let virtio_region_start = PhysAddr::new(virtio_region.starting_address as u64);
183180

184-
debug!(
185-
"Init virtio_mmio at {:p}, irq: {}",
186-
virtio_region_start, irq
187-
);
181+
debug!("Init virtio_mmio at {virtio_region_start:p}, irq: {irq}");
188182
paging::identity_map::<paging::HugePageSize>(
189183
AddrRange::new(
190184
virtio_region_start,

src/arch/riscv64/kernel/interrupts.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static IRQ_NAMES: InterruptTicketMutex<HashMap<u8, &'static str, RandomState>> =
5656

5757
#[allow(dead_code)]
5858
pub(crate) fn add_irq_name(irq_number: u8, name: &'static str) {
59-
debug!("Register name \"{}\" for interrupt {}", name, irq_number);
59+
debug!("Register name \"{name}\" for interrupt {irq_number}");
6060
IRQ_NAMES.lock().insert(irq_number, name);
6161
}
6262

@@ -102,7 +102,7 @@ pub(crate) fn enable_and_wait() {
102102
// // Disable Supervisor-level software interrupt, wakeup not needed
103103
// sie::clear_ssoft();
104104

105-
debug!("sip: {:x?}", pending_interrupts);
105+
debug!("sip: {pending_interrupts:x?}");
106106
trace!("TIMER");
107107
crate::arch::riscv64::kernel::scheduler::timer_handler();
108108
break;
@@ -138,7 +138,7 @@ pub(crate) fn install_handlers() {
138138
+ PLIC_ENABLE_OFFSET
139139
+ 0x80 * (*context as usize)
140140
+ ((*irq_number / 32) * 4) as usize;
141-
debug!("enable_address {:x}", enable_address);
141+
debug!("enable_address {enable_address:x}");
142142
core::ptr::write_volatile(enable_address as *mut u32, 1 << (irq_number % 32));
143143
}
144144
}
@@ -196,7 +196,7 @@ fn external_handler() {
196196
let irq = unsafe { core::ptr::read_volatile(claim_address as *mut u32) };
197197

198198
if irq != 0 {
199-
debug!("External INT: {}", irq);
199+
debug!("External INT: {irq}");
200200
let mut cur_int = CURRENT_INTERRUPTS.lock();
201201
cur_int.push(irq);
202202
if cur_int.len() > 1 {

0 commit comments

Comments
 (0)