Skip to content

Commit

Permalink
Increase size of allowed messages and userspace heaps
Browse files Browse the repository at this point in the history
These are both required to send larger messages on PlatformBus inspection.
We should have a look at how to do this dynamically in the future (on
both counts).
  • Loading branch information
IsaacWoods committed Nov 30, 2024
1 parent fa93858 commit e3bcb6f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/poplar/src/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use ptah::{DeserializeOwned, Serialize};

// TODO: we now have heap-allocated buffers for sending, but still have bounded receives based on
// stack sizes. Is there any way of dealing with larger messages on receive?
const BYTES_BUFFER_SIZE: usize = 512;
const BYTES_BUFFER_SIZE: usize = 2048;

#[derive(Debug)]
pub enum ChannelSendError {
Expand Down
8 changes: 7 additions & 1 deletion lib/std/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,14 @@ unsafe extern "C" fn rust_entry() -> ! {
}

// Initialize the heap
/*
* TODO: we need a better userspace heap allocator - I don't think we even need to allocate an
* initial heap - on the first allocation, we should create an initial memory object and map
* it, and then increase the size of it as it becomes exhausted. At some point, we should
* probably free massive heaps if tasks have a high tidemark but low normal usage or whatever.
*/
const HEAP_START: usize = 0x600000000;
const HEAP_SIZE: usize = 0x4000;
const HEAP_SIZE: usize = 0x8000;
let heap = MemoryObject::create(HEAP_SIZE, MemoryObjectFlags::WRITABLE).unwrap();
let _mapped_heap = heap.map_at(HEAP_START).unwrap();
ALLOCATOR.lock().init(HEAP_START as *mut u8, HEAP_SIZE);
Expand Down
4 changes: 2 additions & 2 deletions user/platform_bus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,12 @@ pub struct PlatformBusInspect {
pub enum DeviceInspect {
Unclaimed {
name: String,
// device_info: BTreeMap<PropertyName, Property>,
device_info: BTreeMap<PropertyName, Property>,
// handoff_info_names: Vec<PropertyName>,
},
Claimed {
name: String,
// device_info: BTreeMap<PropertyName, Property>,
device_info: BTreeMap<PropertyName, Property>,
},
}

Expand Down
7 changes: 3 additions & 4 deletions user/platform_bus/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,14 @@ impl PlatformBus {
Device::Unclaimed { bus_driver, device_info, handoff_info } => {
devices.push(DeviceInspect::Unclaimed {
name: name.clone(),
// device_info: device_info.0.clone(),
device_info: device_info.0.clone(),
// TODO
// handoff_info_names: Vec::new(),
});
}
Device::Claimed { bus_driver, device_info, device_driver } => {
devices.push(DeviceInspect::Claimed {
name: name.clone(), /*device_info: device_info.0.clone()*/
});
devices
.push(DeviceInspect::Claimed { name: name.clone(), device_info: device_info.0.clone() });
}
}
}
Expand Down

0 comments on commit e3bcb6f

Please sign in to comment.