KERNEL_LOAD_BASE
.long (990b - KERNEL_LOAD_BASE) ; \
".long (990b - " STRINGIFY(KERNEL_LOAD_BASE) ") \n" \
#define KERNEL_FIXUP_FOR_LONG_MODE (KERNEL_LOAD_BASE_64_BIT - KERNEL_LOAD_BASE)
#ifndef KERNEL_LOAD_BASE
if (virtualAddress < KERNEL_LOAD_BASE)
gMMUOps->add_page_table(KERNEL_LOAD_BASE);
add_page_table(KERNEL_LOAD_BASE);
if (address < KERNEL_LOAD_BASE || address + size * B_PAGE_SIZE
>= KERNEL_LOAD_BASE + kMaxKernelSize)
if (address < KERNEL_LOAD_BASE || address + size > sNextVirtualAddress) {
gKernelArgs.virtual_allocated_range[0].start = KERNEL_LOAD_BASE;
gKernelArgs.virtual_allocated_range[0].size = sNextVirtualAddress - KERNEL_LOAD_BASE;
static addr_t sNextVirtualAddress = KERNEL_LOAD_BASE + kMaxKernelSize;
static addr_t sMaxVirtualAddress = KERNEL_LOAD_BASE /*+ 0x400000*/;
if (virtualAddress < KERNEL_LOAD_BASE)
gMMUOps->add_page_table(KERNEL_LOAD_BASE);
add_page_table(KERNEL_LOAD_BASE);
if (address < KERNEL_LOAD_BASE || address + size * B_PAGE_SIZE
>= KERNEL_LOAD_BASE + kMaxKernelSize)
if (address < KERNEL_LOAD_BASE || address + size > sNextVirtualAddress) {
gKernelArgs.virtual_allocated_range[0].start = KERNEL_LOAD_BASE;
gKernelArgs.virtual_allocated_range[0].size = sNextVirtualAddress - KERNEL_LOAD_BASE;
static addr_t sNextVirtualAddress = KERNEL_LOAD_BASE + kMaxKernelSize;
static addr_t sMaxVirtualAddress = KERNEL_LOAD_BASE /*+ 0x400000*/;
if (virtualAddress < KERNEL_LOAD_BASE)
gMMUOps->add_page_table(KERNEL_LOAD_BASE);
add_page_table(KERNEL_LOAD_BASE);
if (address < KERNEL_LOAD_BASE || address + size * B_PAGE_SIZE
>= KERNEL_LOAD_BASE + kMaxKernelSize)
if (address < KERNEL_LOAD_BASE || address + size > sNextVirtualAddress) {
gKernelArgs.virtual_allocated_range[0].start = KERNEL_LOAD_BASE;
gKernelArgs.virtual_allocated_range[0].size = sNextVirtualAddress - KERNEL_LOAD_BASE;
static addr_t sNextVirtualAddress = KERNEL_LOAD_BASE + kMaxKernelSize;
static addr_t sMaxVirtualAddress = KERNEL_LOAD_BASE /*+ 0x400000*/;
if (!mmu_get_virtual_mapping(KERNEL_LOAD_BASE + (i * B_PAGE_SIZE),
if (address >= KERNEL_LOAD_BASE)
if (virtualAddress < KERNEL_LOAD_BASE) {
if (virtualAddress < KERNEL_LOAD_BASE) {
if (address < KERNEL_LOAD_BASE || address + size * B_PAGE_SIZE
>= KERNEL_LOAD_BASE + kMaxKernelSize)
if (address < KERNEL_LOAD_BASE || address + size > sNextVirtualAddress) {
return sNextVirtualAddress - KERNEL_LOAD_BASE;
if (virtualAddress < KERNEL_LOAD_BASE) {
gKernelArgs.virtual_allocated_range[0].start = KERNEL_LOAD_BASE;
= sNextVirtualAddress - KERNEL_LOAD_BASE;
gKernelArgs.arch_args.virtual_end = KERNEL_LOAD_BASE;
static addr_t sNextVirtualAddress = KERNEL_LOAD_BASE + kMaxKernelSize;
static addr_t sNextVirtualAddress = KERNEL_LOAD_BASE + kMaxKernelSize;
if (virtAddr >= KERNEL_LOAD_BASE)
KERNEL_LOAD_BASE - B_PAGE_SIZE) == B_OK) {
if (virtAddr >= KERNEL_LOAD_BASE)
gKernelArgs.virtual_allocated_range[0].start = KERNEL_LOAD_BASE;
= get_current_virtual_address() - KERNEL_LOAD_BASE;
gKernelArgs.arch_args.virtual_end = ROUNDUP(KERNEL_LOAD_BASE
KERNEL_LOAD_BASE + (i * B_PAGE_SIZE), &phys) != B_OK) {
if (virtualAddress < KERNEL_LOAD_BASE
|| (virtualAddress + size) > (KERNEL_LOAD_BASE + kMaxKernelSize)) {
static addr_t sNextVirtualAddress = KERNEL_LOAD_BASE + kMaxKernelSize;
static addr_t sNextVirtualAddress = KERNEL_LOAD_BASE + kMaxKernelSize;
static addr_t sMaxVirtualAddress = KERNEL_LOAD_BASE /*+ 0x400000*/;
addr_t gFreeVirtMem = KERNEL_LOAD_BASE;
vm_free_unused_boot_loader_range(KERNEL_LOAD_BASE, KERNEL_SIZE);
void* address = (void*)(KERNEL_LOAD_BASE + patch->kernel_offset);
vm_free_unused_boot_loader_range(KERNEL_LOAD_BASE,
args->arch_args.virtual_end - KERNEL_LOAD_BASE);