Implement physical memory allocator#89
Implement physical memory allocator#89dawidpawliczek4 wants to merge 5 commits intoOperacja-System:mainfrom
Conversation
| *addrOUT = *addrOUT; | ||
| (void)header; | ||
| return ERR_NOT_IMPLEMENTED; | ||
| error_t pmallocator_allocate(frame_order_t frame_order, memory_region_t header_region, phys_addr_t* addrOUT) { |
There was a problem hiding this comment.
This needs to be wrapped in a critical section (both signals and for other harts).
For now you can add a blank implementation on hal_critical_section_{begin/end} to the hal and just call them here.
There was a problem hiding this comment.
when hal is merged, just do hal_enable_irq/hal_disable_irq and add a FIXME: use a real critical section
There was a problem hiding this comment.
It was decided there will be no parallelism, so no need for critical section (but interrupt disablement is still required)
| (void)addr; | ||
| (void)header; | ||
| return ERR_NOT_IMPLEMENTED; | ||
| error_t pmallocator_free(frame_order_t frame_order, phys_addr_t addr, memory_region_t header_region) { |
| memory_region_t header_region = phys_mem_reg_to_reg(header_pmr); | ||
| phys_addr_t frame_data = nullptr; | ||
| error_t err = pmallocator_allocate(frame_size + 12, header_region, &frame_data); | ||
| error_t err = pmallocator_allocate(frame_size, header_region, &frame_data); |
There was a problem hiding this comment.
Do we know why the +12 was removed?
There was a problem hiding this comment.
I don't see anything wrong, if @qbojj's requests are addressed and @frogrammer9 accepts we can merge.
|
There will be a change made to the palloc interface shortly and i would prefer to wait with merging this PR until it up to date with those changes. |
No description provided.