Commit 8bd642b5 authored by Stefan Lankes's avatar Stefan Lankes Committed by Stefan Lankes
Browse files

minor changes to pass the format check

parent 8e04f43d
......@@ -276,12 +276,7 @@ impl<'a> VirtioNetDriver<'a> {
for i in 0..vqsize {
let buffer = RxBuffer::new(buffer_size);
let addr = buffer.addr;
vqueues[VIRTIO_NET_RX_QUEUE].add_buffer(
i,
addr,
buffer_size,
VIRTQ_DESC_F_WRITE,
);
vqueues[VIRTIO_NET_RX_QUEUE].add_buffer(i, addr, buffer_size, VIRTQ_DESC_F_WRITE);
vec_buffer.push(buffer);
}
}
......@@ -292,12 +287,7 @@ impl<'a> VirtioNetDriver<'a> {
for i in 0..vqsize {
let buffer = TxBuffer::new(buffer_size);
let addr = buffer.addr;
vqueues[VIRTIO_NET_TX_QUEUE].add_buffer(
i,
addr,
buffer_size,
VIRTQ_DESC_F_DEFAULT,
);
vqueues[VIRTIO_NET_TX_QUEUE].add_buffer(i, addr, buffer_size, VIRTQ_DESC_F_DEFAULT);
vec_buffer.push(buffer);
}
}
......
......@@ -732,8 +732,8 @@ pub fn init_page_tables() {
// make sure that only the required areas are mapped
let start = pde
+ ((mm::kernel_end_address().as_usize() >> (PAGE_MAP_BITS + PAGE_BITS)) * mem::size_of::<u64>())
as u64;
+ ((mm::kernel_end_address().as_usize() >> (PAGE_MAP_BITS + PAGE_BITS))
* mem::size_of::<u64>()) as u64;
let size = (512 - (mm::kernel_end_address().as_usize() >> (PAGE_MAP_BITS + PAGE_BITS)))
* mem::size_of::<u64>();
......
......@@ -81,14 +81,19 @@ pub fn init() {
// Calculate the start and end addresses of the 2 MiB page(s) that map the kernel.
unsafe {
KERNEL_START_ADDRESS = environment::get_base_address().align_up_to_large_page();
KERNEL_END_ADDRESS = (environment::get_base_address() + environment::get_image_size()).align_up_to_large_page();
KERNEL_END_ADDRESS = (environment::get_base_address() + environment::get_image_size())
.align_up_to_large_page();
}
arch::mm::init();
arch::mm::init_page_tables();
info!("Total memory size: {} MB", total_memory_size() >> 20);
info!("Kernel region: [0x{:x} - 0x{:x}]", kernel_start_address(), kernel_end_address());
info!(
"Kernel region: [0x{:x} - 0x{:x}]",
kernel_start_address(),
kernel_end_address()
);
// we reserve physical memory for the required page tables
// In worst case, we use page size of BasePageSize::SIZE
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment