1/**
2 * \file
3 * \brief
4 */
5
6/*
7 * Copyright (c) 2010, ETH Zurich.
8 * All rights reserved.
9 *
10 * This file is distributed under the terms in the attached LICENSE file.
11 * If you do not find this file, copies can be found by writing to:
12 * ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
13 */
14
15#include <barrelfish/barrelfish.h>
16#include "../../vspace_internal.h"
17
18/**
19 * \brief Initialize the x86_32 layout
20 */
21errval_t vspace_layout_init(struct vspace_layout *l)
22{
23    l->offset = 0;
24    l->granularity = X86_32_BASE_PAGE_SIZE;
25#ifdef CONFIG_PAE
26    l->size = ((genvaddr_t)X86_32_PDPTE_SIZE * X86_32_PTABLE_SIZE *
27               X86_32_PTABLE_SIZE * X86_32_BASE_PAGE_SIZE);
28#else
29    l->size = ((genvaddr_t)X86_32_PDIR_SIZE * X86_32_PTABLE_SIZE *
30               X86_32_BASE_PAGE_SIZE);
31#endif
32
33    return SYS_ERR_OK;
34}
35