Moving around some math macros.

This commit is contained in:
Ben Vanik
2014-08-16 17:18:20 -07:00
parent 54ce9db743
commit 5b83cf5fd1
23 changed files with 148 additions and 137 deletions

View File

@@ -9,13 +9,14 @@
#include <xenia/common.h>
#include <xenia/core.h>
#include <xenia/xbox.h>
#include <xenia/core/hash.h>
#include <xenia/kernel/async_request.h>
#include <xenia/kernel/kernel_state.h>
#include <xenia/kernel/xboxkrnl_private.h>
#include <xenia/kernel/objects/xevent.h>
#include <xenia/kernel/objects/xfile.h>
#include <xenia/kernel/util/shim_utils.h>
#include <xenia/xbox.h>
namespace xe {

View File

@@ -7,6 +7,7 @@
******************************************************************************
*/
#include <poly/math.h>
#include <xenia/common.h>
#include <xenia/core.h>
#include <xenia/xbox.h>
@@ -251,8 +252,8 @@ SHIM_CALL MmAllocatePhysicalMemoryEx_shim(
}
// Round up the region size and alignment to the next page.
uint32_t adjusted_size = XEROUNDUP(region_size, page_size);
uint32_t adjusted_alignment = XEROUNDUP(alignment, page_size);
uint32_t adjusted_size = poly::round_up(region_size, page_size);
uint32_t adjusted_alignment = poly::round_up(alignment, page_size);
// Callers can pick an address to allocate with min_addr_range/max_addr_range
// and the memory must be allocated there. I haven't seen a game do this,
@@ -433,7 +434,7 @@ SHIM_CALL ExAllocatePoolTypeWithTag_shim(
uint32_t alignment = 8;
uint32_t adjusted_size = size;
if (adjusted_size < 4 * 1024) {
adjusted_size = XEROUNDUP(adjusted_size, 4 * 1024);
adjusted_size = poly::round_up(adjusted_size, 4 * 1024);
} else {
alignment = 4 * 1024;
}