obkrnl/uma/
x86_64.rs

1use super::Alloc;
2use crate::vm::Vm;
3
4/// See `uma_small_alloc` on the Orbis for a reference.
5///
6/// # Reference offsets
7/// | Version | Offset |
8/// |---------|--------|
9/// |PS4 11.00|0x22FD70|
10pub fn small_alloc(vm: &Vm, flags: Alloc) {
11    // TODO: There are an increment on an unknown variable on the Orbis.
12    vm.alloc_page(
13        None,
14        // TODO: Refactor this for readability.
15        ((((u32::from(flags) & 0x100) >> 2) - (u32::from((u32::from(flags) & 0x401) == 1)) + 0x22)
16            | 0x100)
17            .into(),
18    );
19
20    todo!()
21}