blob: 27e246128448d1cd66b073e4186eb2662f855358 [file] [log] [blame]
Karl Meakin6291eb22024-11-18 12:43:47 +00001/*
2 * Copyright 2024 The Hafnium Authors.
3 *
4 * Use of this source code is governed by a BSD-style
5 * license that can be found in the LICENSE file or at
6 * https://opensource.org/licenses/BSD-3-Clause.
7 */
8
9#pragma once
10
11#include "hf/addr.h"
12#include "hf/mm.h"
13
14struct mem_range {
15 paddr_t begin;
16 paddr_t end;
17};
18
19static inline struct mem_range make_mem_range(uintptr_t base_address,
20 uint32_t page_count)
21{
22 return (struct mem_range){
23 .begin = pa_init(base_address),
24 .end = pa_init(base_address + page_count * PAGE_SIZE - 1),
25 };
26}